Close

Data Logging

A project log for Beetje Bloks

Build a project bit-by-bit, making it easy to design, debug, and program. Electronics is hard unless you Keep It Simple Stupid.

MakersBoxMakersBox 09/09/2018 at 01:220 Comments

My only experience with SD cards and Arduino was with Adafruit's Wave Shield, so I knew you could at least read data.  An SD card seems like an ideal way to data log because you can remove the card and read it on a computer and not worry about having to transfer data via serial.  For long term data logging, I'm interested in power consumption.  For short term data logging (like model rockets), I'm interested in how fast I can write data.

For the circuit, I copied Adafruit's Micro SD breakout, minus her five volt level shifting.  There is a SD library in the standard Arduino libraries.

My first attempt using a 4 Gb card resulted in failure, and I'm not sure why.  I formatted the card using the official formatter recommend in Adafruit's tutorial.  The card was recognized by the Arduino, but wouldn't read or write and subsequent attempts to reformat were unsuccessful.

I did a bit of a design review before throwing another card at it.  Nothing showed up, and my next attempt with a 2 Gb card was successful.  Was it Einstein who said "Insanity is doing the same thing twice while expecting different results"?  Welcome to crazy.

I wrote some test code to see how fast it was writing.  I can basically three data points 43 times a second, or once every 23 ms.  Not terribly fast, but fast enough?  We will have to wait for the EEPROM blok to do a comparison.

Discussions