Datalogger in an Altoids can

This is pretty much one of those required projects; everyone builds a data logger in an Alto IDs can.  But each is different and I enjoyed making mine.

  • Uses ATmega328P (low power, 32K flash for lots of program space)
  • Uses Maxim/Dallas DS1337 Real Time Clock (uses I2C)
  • Logs data to micro SD flash card, readable on PC (uses FAT32)
  • Runs on two AAA alkaline batteries
  • Low power draw (exact consumption varies based on SD card used)
  • Supports RS-232 for entering commands
  • Uses CR2032 lithium coin cell for RTC backup
  • Uses Analog Devices TMP36 for temperature sensor (not shown, it gets wired to the green four-position terminal shown below)
  • Uses Spark Fun 3.3VDC boost converter to provide stable voltage even as batteries die

I’ve updated the photo (20 Oct 09) to show the data logger after extensive updates.  The red PCB in the center is a 3.3VDC boost converter from SparkFun that should give me lots of extra life from the two alkaline batteries; check out their NCP1400-3.3 board.  The transistor just above the red PCB is the 2N3906, used to control power to the micro SD card.
Datalogger in an Altoids canHere is the Eagle schematic as a PDF.  I fixed a schematic error that showed the ISP connector hooked to 5 VDC; this whole system runs at 3.3 VDC.  Updated 14 Oct 09 to add a 4.7K pull up to SS (CS for the SD card) and to add a 270-ohm resistor in the MISO connection to the SD card.

I wired directly to the terminals of a Kingston micro SD adapter, which is the same size as a stock SD card.  I can then insert a micro SD card into the adapter, write data to it, then pull the micro SD card out of the adapter and insert it into a dedicated adapter in my PC’s USB hub.

Note that total power consumption varies based on the micro SD card.  I have a 128 MB card that reduces the total power draw in sleep mode to about 150 uA.  But if I use a Kingston 2 GB micro SD card, the sleep-mode power draw jumps up to almost 400 uA.  Updated 13 Oct 2009: I have recoded the SD access routines so that the power-down current draw for the entire data logger is less than 60 uA using the 128 MB micro SD card.

BTW, the Kingston 2 GB card draws in excess of 45 mA during writes!  What’s up with THAT?  The little no-name 128 MB card draws around 2 mA during writes.  The issue is moot at this point, however, as I’ve managed to trash the 2 GB card to the point that neither Windows nor Mac OSX can see the card, let alone reformat it.  Oh well.

 Read More: Datalogger in an Altoids can

Leave a Comment

Your email address will not be published. Required fields are marked *