Data Logging Shield (Assembled)

Author Gravatar Image PHILLIP BURGESS

Have your Arduino save data to files on any FAT16 or FAT32 formatted SD card, to be read by any plotting, spreadsheet or analysis program. The included Real Time Clock timestamps all your data with the current time and date, so that you know precisely what happened when!

This page covers the preassembled version of this board, not the original kit version.

Product Link: http://www.adafruit.com/products/1141
Libraries: Real time clock: https://github.com/adafruit/RTClib
SD card read/write: https://github.com/adafruit/SD (Or the default SD library included in the Arduino IDE is sufficient in many situations — see notes below)
Tutorial: http://learn.adafruit.com/adafruit-data-logger-shield/overview

Plug-and-Play Compatible Boards

The Data Logging Shield is tested and fully compatible with the following boards:
  • Arduino Uno (all revisions)
  • Arduino Duemilanove and Diecimila w/ATmega328 chip

Incompatible or Partially-Compatible Boards

This shield may work with other boards with some additional steps:

Arduino Leonardo

The RTC is compatible. For the SD card, the following may be tried, in decreasing order of recommendation:
  • Use the Adafruit SD library, specifying pin 10 for chip select, 11 for MOSI, 12 for MISO and 13 for SCK.
  • Edit the file utility/Sd2Card.h in the default Arduino SD library, adding the line "#define SOFTWARE_SPI" (not MEGA_SOFT_SPI) at the top.
  • Add jumper wires from pin 11 on the shield to ICSP pin 4 on the board (on the 6-pin header), pin 12 to ICSP-1 and pin 13 to ICSP-3, then use the standard library in its default state (no SOFTWARE_SPI). This is difficult due to the shield obscuring the ICSP header and is not much recommended.

Arduino Mega 2560 R3 or Mega ADK

The RTC is compatible. For the SD card, the following may be tried, in decreasing order of recommendation:
  • Use the Adafruit SD library, specifying pin 10 for chip select, 11 for MOSI, 12 for MISO and 13 for SCK.
  • Edit the file utility/Sd2Card.h in the default Arduino SD library, changing line 42 to read "#define MEGA_SOFT_SPI 1" (default is 0).

Arduino Mega 2560 R2 & Earlier

RTC:
  • Add jumper wire from SDA on shield to pin 20 on Mega board.
  • Add jumper wire from SCL on shield to pin 21 on Mega board.
For the SD card, the following may be tried, in decreasing order of recommendation:
  • Use the Adafruit SD library, specifying pin 10 for chip select, 11 for MOSI, 12 for MISO and 13 for SCK.
  • Edit the file utility/Sd2Card.h in the default Arduino SD library, changing line 42 to read "#define MEGA_SOFT_SPI 1" (default is 0).

Arduino Due

The RTC is compatible (when using latest library). Accessing the SD card is possible with the addition of some jumper wires, but difficult due to the fact that the shield obscures the ICSP header where these wires must be connected.
  • Add jumper wire from pin 11 on shield to ICSP pin 4.
  • Add jumper wire from pin 12 to ICSP pin 1.
  • Add jumper wire from pin 13 to ICSP pin 3.
Use the standard SD library (not the Adafruit fork). Do NOT #define SOFTWARE_SPI or MEGA_SOFT_SPI in the library.

Pin and Address Reference

The shield uses the following pins:
  • +5V
  • GND
For SD card:
  • Digital pins 10-13 (Chip Select, MOSI, MISO, SCK, respectively)
For RTC:
  • SDA and SCL (on boards that have these pins)
  • Analog pins 4 and 5 (see notes below)
This shield can usually be stacked with others (including those using SPI or I²C), provided that each has a unique Chip Select pin (for SPI) and address (I²C), or is not using these interfaces. The RTC has a fixed address of 0x68.

Do not use Analog pins 4 or 5 with your project in combination with this shield, even on Arduino boards that use different pins for I²C communication (Leonardo, Mega, Due). For compatibility with “classic” (pre-R3) Arduino boards, the shield connects SDA and SCL to Analog pins 4 and 5, respectively; communication and analog readings would mutually interfere. Leonardo users should likewise avoid Digital pins 2 and 3 when using I²C.

Untested Boards and Other Notes

  • Arduino Mega 1280: compatibility should be similar to the Mega 2560 R2; extra jumper wires would be required for the RTC, and library changes for the SD card.
  • Adafruit Menta: equivalent to Arduino Duemilanove w/328 chip; almost certainly compatible.
  • Arduino Duemilanove and Diecimila w/ATmega168 chip, and Arduino NG or older: electrically and mechanically compatible with 328 chip, but has only half the RAM and program space. The RTC library is not especially memory hungry and is likely compatible. The SD libraries require a lot of RAM; chances of compatibility are slim.
The original kit version of this shield did not use the “R3” pins for I²C, but did include separate SDA and SCL pads. Thus the RTC on the original kit will not work directly with some newer boards like the Leonardo, but could be adapted with some hardware know-how.
If you have specific experience with this shield on the above boards or others, please use the Feedback & Corrections link at left. Thanks!

If experiencing trouble with a board listed as “compatible,” review the introduction for tips and visit the Adafruit Forums for assistance.
Last updated on 2014-04-17 at 04.15.18 AM Published on 2013-08-14 at 06.39.19 PM