Public Lab is launching a new 🎈 Mini Balloon & Kite Kit as part of Kickstarter Gold -- take a look!

Public Lab Research note

  • 3

Inexpensive data logging

by cfastie |

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.

Above: The six dollars worth of components wired together and powered by a battery (off screen) and recording environmental data at regular intervals.

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.

Above: A wiring diagram of the test logger. The photos above include a BMP280 sensor, not the BME280 sensor shown here. But any I2C sensor or several of them could be added to this circuit.

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.

Above: The Nano logger shields arrived two days ago (17 days after ordering) and I am figuring out how to make them work.

Post your attempt to replicate this activity  Browse other activities for "nano-data-logger"

Replications (0)

None yet. Be the first to post one!

This is marked this as an activity for others to try.
Try it now   Click here to add some more details.

arduino datalogger sensor data-logging nano nano-data-logger



Hi there!! So interesting!!

At the we're using the Openlog, known for it's use as a drone black box combiend with an RTC. Just another recipe ;)


That Openlog is tiny! It combines an Arduino 328p with a microSD card, but still needs an RTC. There are clones of it available for $7.00. I have not found a version that adds an RTC, so that has to be connected (i.e., soldered). If you are going to solder, you can start with a Pro mini ($2.00) and add an SD card and RTC and stay under $5.00 total.


Love this. Thanks, Chris!

At some point it'd be awesome to collect all the loggers on a single method page, and look at the pros/cons/prices of each.

There is a growing list of logger options and specs in a Google sheet. Please add information there if you know other stuff.

Fantastic @cfastie! This nano shield looks awesome for 4$ ;)

You must be logged in to comment.