Above: These two little breakout boards are the key to using an Arduino to log data. A microSD card board (right) allows the data to be saved. A real time clock (left) keeps track of time (basic Arduinos don't remember what time it is when you turn them off).
A few weeks ago I noticed a product that allowed an Arduino Nano to be used for logging data (thread here). It added a real time clock (RTC) and a microSD card slot to the Arduino Nano microcontroller, and made it possible to construct a working data logger with sensors without doing any soldering. I ordered a few of these and in the meantime started playing with the standalone versions of the components this device combined.
Above: The four components of a data logger which records environmental data every few seconds or every several minutes. Left to right: Arduino Nano, RTC board, BMP280 temperature and barometric pressure sensor, microSD board. All four can be purchased on eBay for as little as $6.00 total, including shipping from Asia. This is sort of an outrageous and hard to ignore feature of the world today.
I wanted to know if an Arduino Nano could log data for an extended time like a Riffle, Mayfly logger, or Cave Pearl Logger. So I made what is essentially a simple version of Ed Mallon's breadboarded logger but with a Nano instead of an Arduino Uno. Ed's Uno logger is intended for classroom use where power can be supplied by a computer or wall wart. But the sketch Ed recommends has power saving features (e.g., it puts the SD card board to sleep between logging events), so I was hoping it might be able log for a week or two on a good battery pack.
I think one major limitation to long term logging with either the Uno or Nano is that both have a USB port driven by a serial hardware (uart) chip that is always powered. Another limitation is that the Uno and Nano are 5 volt boards, not 3.3 volts like the Pro Mini boards that Ed uses in his field loggers. I think there are some other limitations I don't quite grasp. Ed makes modifications to the off-the-shelf boards he uses to reduce power consumption, and the Riffle has some hardware features built in to deal with these issues. The goal I was chasing was to use unmodified off-the-shelf components that cost less than $20.00 and did not require (much if any) soldering to make a data logger that would run on batteries for a couple of weeks.
I first tried to run this test logger with a version of the sketch written for the Riffle. But the Riffle has different hardware (including a mosfet that I think was being used by the sketch) and it didn't work (it did log data, it just did so three times a second and never put anything to sleep). I then tried Ed Mallon's simple sketch for the Uno breadboard logger and was able to get that to work well. The sketch puts some components (SD card, others?) to sleep between data writes and uses the alarm feature of the DS3231 RTC to wake everything up when it's time to log data again. That was encouraging, so a couple of days ago I hooked up four AAA eneloop batteries and put the whole little breadboarded thing outside. It was logging temperature (from the RTC and the BMP280 sensor) and also barometric pressure every five minutes. Here is the sketch it was running: CavePearlNano.txt
Above: Temperature and pressure data from 32 hours of logging. The record starts at 10:30 PM when I put the logger outside, runs all through the next day, then ends at 6:30 AM the next morning when I assume the batteries failed to supply the required power.
The batteries did not last for two days. The batteries were the same ones I had been using to test the logger for a couple of days, so they were not fully charged at the start of the trial. This logger could probably do better, but I am a long way from my goal of two weeks of logging. The easy changes to make are fresher batteries, bigger batteries (AA instead of AAA) and more batteries (six instead of four). I'm not sure whether there are other obvious things to do to extend the logging life.