Micro SD, Serial LCD, Analog Inputs...Suggestions?


I got my arduino deui and I started playing with it last night. I hooked up the serial LCD (from sparkfun) and got that part figured out. Next I hooked up the micro SD card reader module from Libelium and played around with it.

I will explain my requirements and the potential road block I'm seeing and would welcome some suggestions on how to proceed.

The most important part is sampling voltage changes from an analog input at a rate of 240 times a second. This can be for periods of up to 30 seconds at a time.

The next important part is storing those readings on the micro sd card. And the least important piece is displaying some message on the lcd screen (no worries here). I'm using SDuFat-basic for writing to the sd card.

I see some issues so far that I'm not sure how to get around yet. The rate at which it writes to the sd card is to slow to be able to write the data to the card as it comes in. I also don't know if the arduino can keep sampling and writing to the card at the same time (multi threading). This leads me to think that I will need to store all the samples in onboard memory as a buffer and then dump to the sd card once the samples over a given timeframe is complete.

For a 30 second test i would need to store 7,200 samples at 1-5 bytes of information (numeric value 0-1023 plus a comma (csv)) each. For a 30 second sample the max bytes needed would be 36,000 bytes (or 36kb).

How dificult is it going to be for me to store all these samples and their seperator value in memory prior to writing them to the card?

I appreciate any suggestions you guys might have.

Thanks John

I think I may have put this in the wrong section. This might have been better started in the Interfacing section.

You could use an EEPROM chip to store those values, however 32KB seems common. have a look at this http://www.arduino.cc/playground/Code/I2CEEPROM .

Do your values vary a small amount? or are you likely to get many identical values in a row? if so you could try to get rid of duplicates using very basic compression, or recording a timestamp and value only when a change is detected.

Good luck anyway, seems like an interesting project.

Hi and thanks for the reply,

I ended up getting a 16k FRAM module from mouser.com that I am planning on using. It should be a direct replacement for EEPROM so I think the library should work fine for this too.

I do have instances where the value is the same for a couple of readings in a row. I could probly store only the values that change and but then I’d need to figure out how to put them back in later. I need 240 samples in a span of a second so if the filtered samples weren’t some how logically put back in some how I’d end up with less than my desired 240 samples per second.

It’s something to think about for sure. Thanks again for the post.