A data table in microcontroller memory that I can change from PC.

Is it possible to have a table of values that my microcontroller uses that I can change from my PC by connecting it to the board?

What software should I use to conveniently convert something like an excell spreadsheet into microcontroller data that I can flash into the device without erasing all memory?

Is it better to use USB or SD card? Can I use both? Bluetooth?

Any good examples of some project that would allow data editing both on the PC and using a graphic interface of the microcontroller device itself?

What microcontroller module from the Arduino family is better for this task?

I am controlling lights temperature and humidity in an enclosure and I need it to change over a period of time according to a graph.

Unlike those Reflow Oven modules I have three variables to control. Temperature, humidity and lights(on/off). Humidifier is built in such way that it the fan will run independently, bringing fresh filtered air to the system. So I want to play with 3-4 variables / time.

I need this for a biological experiment that I am conducting.

The control circuit is simple - transistors controlling solid-state relays from digital output pins.
Two cheap I2C Chinese humidity/temperature sensors will provide the data.

Thank you.

Is it better to use USB or SD card?

How can we tell?
We don't know how much data is involved.
It may be as simple as using the built-in EEPROM on the AVR.

Can try writing it to flash memory as well
https://forum.arduino.cc/index.php?topic=332191.0
Or add an FRAM, for SRAM access speed (vs EEPROM's 3.3mS write times) and EEPROM non-volatility, but can be written to waaaaay more often, like 10^12 read/write operations (1,000,000,000,000) vs 100,000 for EEPROM.
Example:
http://www.digikey.com/product-search/en/integrated-circuits-ics/memory/2556980?k=fram%20memory

Can I use an SD card itself instead of SRAM memory?

Would FRAM memory module work in this application? Adafruit SPI Non-Volatile FRAM Breakout - 64Kbit / 8KByte : ID 1897 : $5.95 : Adafruit Industries, Unique & fun DIY electronics and kits
I don't see a finished product that I can use to add SRAM to an Arduino module.

What is the difference between the two? I read some information on both but I am not a hardware engineer.

Memory shouldn't erase if power was switched off as I understand. I need a non-volatile memory.
Speed is not that important since the amount of data that will be stored will consist of about 128 Short integer values for temperature, humidity, lights on/off state. Maybe another table for measured values would be stored.

Use the EEPROM.

Can I use an SD card itself instead of SRAM memory?

Yes, you may lose some data if power goes away at the wrong time (in the middle of a card write).

There is 2048 bytes of SRAM in a 328P chip., it clears to 0 when power goes away.
FRAM will hold the data when power is lost. If power goes away during a write, I would think you'd only lose the byte or 2 you were writing at the time.
Unfortunately, it looks like 8-pin DIP versions of FRAM have gone away, you'll need to use an SOIC to DIP adapter, which are pretty readily available. They can be found in SPI versions (my preference, for speed, need 4 control lines) or slower I2C versions (need 2 control lines).

The adafruit part is just what I was referring to actually!

I buy all the Aliexpress versions of parts and I never have problems with them. (I know how to work with fake FTDI chips.)

Adafruit part will be the most expensive part in my project.

I will buy a FRAM chip and solder it on. I ordered adapters already.

Another question is: can I take atable from MS Excel or Open Office Excel and easily send it to my microcontroller, leaving behind all the graphical user stuff.

Is there a convenient way? Had anyone seen an example?

It really depends on how you get the data to the chip, but if you save the spreadsheet as a "csv" file it will be relatively easy to parse.

csv = comma separated value, a text file that will have a line for each row of your data terminated with a line feed+carriage return. Each column will be separated by a comma or tab.

Note, if the cells contain text data that includes the separator it may be more difficult to parse.

VT91:
I know how to work with fake FTDI chips.

Easy! Use Linux. :roll_eyes:

VT91:
Another question is: can I take atable from MS Excel or Open Office Excel and easily send it to my microcontroller, leaving behind all the graphical user stuff.

Is there a convenient way? Had anyone seen an example?

See this example how to transfer .csv files to the arduino via USB serial:

Or you can add an sd card reader to your arduino - copy the files onto the SD, read them in the arduino.

If it's acceptable that your sketch doesn't run all the time, you can simply hard-code your data into the sketch and upload it.

This really depends on how much data it is and how often you want to update it.

Paul__B:
Easy! Use Linux. :roll_eyes:

Not a fan of Linux for domestic use. Not until there will be plug and play Linux. I am talking about Windows.

hydrocontrol:
See this example how to transfer .csv files to the arduino via USB serial:
http://www.meccanismocomplesso.org/en/arduino-tutorial-serial-data-actuator/

Or you can add an sd card reader to your arduino - copy the files onto the SD, read them in the arduino.

If it's acceptable that your sketch doesn't run all the time, you can simply hard-code your data into the sketch and upload it.

This really depends on how much data it is and how often you want to update it.

Interesting. So I may have to use a Python script to convert the table to something that would be useful to the microcontroller. Thank you.

VT91:
Interesting. So I may have to use a Python script to convert the table to something that would be useful to the microcontroller. Thank you.

Too be more precise, the python script handles the serial traffic to the microcontroller. It transmits the lines in the file one by one, whatever they are. The arduino sketch then has to make sense of them. This is what KeithRB meant by "parsing".

I.e. if one of the lines in your .csv file would read

30, 245, 0, 3, 56,

Then the arduino script would have to do something like this:

Pseuo-code

Serial-read the characters arriving from the serial port into one character array, until there are no more characters available. // this would be one line of the .csv file

while (end of character array is not reached)
{
copy the characters in the array into a 2nd character array called "value", until the character is a comma

convert the "value" character array into an integer or other suitable data type

do whatever the sketch needs to do with the value

// continue from the top of the while loop with the first character after the comma
}

The process of advancing from comma to comma and reading the characters inbetween is called parsing.

Alternatively, you can parse the incoming serial character stream directly, without first copying the whole line into an array.

This really depends on the amount and type of data you want to transmit.

The parsing job always needs to be done, regardless of the way the sketch receives the data.

The only way you can avoid the parsing is if you include your table of data directly in your sketch, and upload the sketch ever time the data changes.
Like

int myDataTable[][4]= // you need to define how many fields there are in one row. In this case, 4
{
    { 12, 34, 45, 67, },
    { 11, 12, 13, 14, },
};

This array is stored in RAM. If it uses up too much RAM because it's too big, you'll have to use PROGMEM.

Do you know what tutorial they are talking about here?

aliexpress.com 3-2-inch-TFT-LCD-screen

VT91:
Do you know what tutorial they are talking about here?

aliexpress.com 3-2-inch-TFT-LCD-screen

It's a list of libraries, some native in the arduino IDE, some 3rd party.
e.g. UTFT - Rinky-Dink Electronics

hydrocontrol:
Too be more precise, the python script handles the serial traffic to the microcontroller. It transmits the lines in the file one by one, whatever they are. The arduino sketch then has to make sense of them. This is what KeithRB meant by "parsing".

I.e. if one of the lines in your .csv file would read

30, 245, 0, 3, 56,

Then the arduino script would have to do something like this:

Pseuo-code

Serial-read the characters arriving from the serial port into one character array, until there are no more characters available. // this would be one line of the .csv file

while (end of character array is not reached)
{
copy the characters in the array into a 2nd character array called "value", until the character is a comma

convert the "value" character array into an integer or other suitable data type

do whatever the sketch needs to do with the value

// continue from the top of the while loop with the first character after the comma
}




The process of advancing from comma to comma and reading the characters inbetween is called parsing.

Alternatively, you can parse the incoming serial character stream directly, without first copying the whole line into an array.

This really depends on the amount and type of data you want to transmit.

The parsing job always needs to be done, regardless of the way the sketch receives the data.

The only way you can avoid the parsing is if you include your table of data directly in your sketch, and upload the sketch ever time the data changes.
Like



int myDataTable[][4]= // you need to define how many fields there are in one row. In this case, 4
{
    { 12, 34, 45, 67, },
    { 11, 12, 13, 14, },
};




This array is stored in RAM. If it uses up too much RAM because it's too big, you'll have to use PROGMEM.

I understand that it does. In my case I won't have to do it in real time.

VT91:
Is it possible to have a table of values that my microcontroller uses that I can change from my PC by connecting it to the board?

If you are dealing with all numeric input, there is an Arduino command that will automatically parse:
Serial.parseFloat() see: Reference

The .parseFloat() works for interger or float serial characters and parses on spaces, commas, etc.

I have used this in a terminal calculator, articles and example code:
Forum
Instructables

For more complex data, like GPS, the parse is via comma. Here is an example.
Ray