☀ How to Build an Arduino Data Logger ☀

This project has been running since late 2013, and the site is now peppered with many different logger builds that arose naturally over time as we tackled different research questions.  Those variations have been causing some confusion for people who google their way into the middle of it all.

So this page is simply a consolidated set of links to the different DIY logger build tutorials that we’ve developed over time, with commentary to put them in context.

What is Arduino?  If you’re asking yourself that question then it might be a good time to review some of the great background material that you can find on the web . The hardware side of the Arduino platform isn’t actually that unique: it’s just a circuit board built around an Atmel AVR micro controller chip with connections broken out so you can attach wires to it more easily. It is really the software development environment (called the IDE) that makes programming the Arduino easy for beginners. The IDE handles a lot of messy details when converting the code you’ve written into something that will run on that little processor.  Because those low level details are taken care of, you can run essentially the same program on many different flavors of Arduino – even if they look different physically.

An Uno-based  basic data logger, with no soldering required.  As the instructor, you can assemble this logger very quickly with pre-made jumpers but we found the connections were too easily knocked loose by clumsy students, so it's worth taking the time with them to put stiff solid core wires in place.

Most people who are just discovering Arduino start with the UNO. It’s a relatively large board, and robust enough for the physical handling you see in a classroom situation.  We have posted several tutorials for the UNO that are suitable for beginners, with the hope that that teachers will use this material to create their own Arduino-based lessons.  UNO’s don’t run very long on batteries, but they are a fantastic platform for learning programming and electronics.

  1. Arduino UNO Data Logger for Beginners
  2. Adding Sensors (& Modules) to an Arduino Data Logger (beginners)
  3. How to Configure I²C Digital Sensors with Arduino Code (advanced)
  4. Display ‘Live’ Sensor Data from an Arduino with the Serial Plotter
  5. A simple Arduino Logger code example w Sleep & RTC wake-up (beginners)
  6. Build your own Arduino Starter Kits for the Classroom
  7. Starting Points & Ideas for your Arduino STEM Curriculum

While it might not be immediately obvious, tutorial #4 is probably the most important one in the set for teachers. The serial plotter which comes with the IDE makes it possible to view live sensor output simply by adding one print statement to the code. This updates a graph live on screen by sending the numbers over the USB cable attached to a laptop. Nothing I’ve used before lets you do real-time demos so easily, and more advanced use of that plotter functionality allows you to capture those displays and replicate some tasks that would normally require an oscilloscope costing 10x as much.

MasonsSensorPottingThe drawback of most larger Arduinos is that they are built for ease of use, rather than being optimized for low power operation. Since this project is building data loggers that have to run for several years on one set of batteries we use smaller Pro-Mini style Arduinos, which we modify by removing a few light-emitting diodes and changing the regulator to extend the operating time. There are some important differences between Arduino models in terms of pin locations and operating voltage, but the key thing to realize is that once you get your UNO based logger recording sensor data,  you should be able to transfer that code into to a Pro-Mini based build with few (if any) changes to the programming.  This gives you a development path, where your prototypes get smaller and more energy efficient as your skills improve, with some people reaching the point of using raw processors from the AVR family to create custom sensors. Or if your code grows to the point where you are exceeding the available memory of a standard 328P, you can switch to a board with a 1284P processor.   Since October 2016, Arduino’s are also being made with 32-bit ARM CortexM3 microcontrollers, which will coexist with the more limited 8-bit AVRs. ARM and AVR are not compatible at the lowest level, but they can be programmed with the same IDE and most beginner level programs compile without changes for the two chip families.

This project started building data loggers with smaller Pro Mini style Arduinos in 2014using a generic wiring plan to enable future development. Incremental improvements are easiest to make when you only need to update one replaceable component, and not the overall design as you would if the logger was based on a custom PCB:

In 2015 we released a series of step-by-step tutorials to guide people who wanted to build these stand-alone loggers for their own projects:

  1. Preparation of the three main components (2015)
  2. Connecting those modules to build a data logger (2015)
  3. Assembling a waterproof housing and attaching sensors (2015)
  4. An (advanced) Logger code example with data buffering & sensor interrupts

There is an additional assembly tutorial with suggestions for achieving better power optimization, but that material is somewhat advanced so it’s a good idea to get a few of the basic three-module loggers running before tackling those modifications. Provided you sleep the loggers between readings you should get at least six months of operating time on 4xAA’s with the 2015 build. Choosing sensors with low sleep currents can extend that significantly.

In 2016  We updated that build to the Pro Mini Logger with Dupont Connectors

2016 Dupont Jumpers build with less soldering

This combines Parts 1&2 from 2015 with links to all the parts needed for construction.
It’s cheaper, takes about 1/3 less time, and is easier for beginners to assemble
The connections are not quite as robust as the fully soldered version from 2015, so that build is still better for deployments where the logger would be bumped around. But for site locations that are relatively protected from physical disturbance, the 2016 Dupont build should work fine.  

 

2017 build with screw terminal board.

In 2017  we added a fourth component to create the Pro Mini Screw Terminal Logger , which makes it easier to connect sensors through a terminal shield. That new build fits easily into our DIY PVC housings, or into a range of pre-made range of pre-made housings from eBay

In addition to the written guide, there is
a complete set of YouTube VIDEOs to guide you through the soldering of this advanced data logger build:

 

In 2018  we also published our first academic paper:  A Flexible Arduino-Based Logging Platform for Long-Term Monitoring in Harsh Environments   This 26 page open-access publication is free for anyone do download, and it describes real world deployments that show how modifying both the logger and the housing enable us to monitor different aspects of groundwater flow with similar sensors. The “modules & jumper wires” approach makes it easy to create prototypes to suit different research questions, and other groups are now taking advantage of this flexibility; extending the basic 3-module design with new housings & sensor configurations.

The 4″ housing described in the Pro Mini tutorial series uses a rubber end cap, which can only be submerged to ~ 5m before water pressure compresses the bottom section too much.  Many of our deployment sites are much deeper than that, so we also developed a stronger underwater housing and inexpensive underwater connectors so that sensors can be placed at the end of long cables.  The core of the logger is still built around the same modules as the 4″ rubber-bottom build, but they are re-arranged to fit inside the 2″ PVC pipe.  We’ve also been developing methods to add 5110 LCD & OLED display screens using the lowest possible amount of power & system memory.

Cave Pearl data loggers

An underwater DS18b20 temperature sensor chain with 24 nodes and MS5803 pressure sensor. This build uses the 2″ PVC housing designed for deployments below 5m.

There are many sensor tutorials on the site, and that list is constantly growing. We are also developing methods for calibrating inexpensive sensors  to research standards.  I hope that by the time you’ve built few of these loggers,  you’ll be able to find all that additional information via the search  option on the upper right hand corner of all pages. In addition, progress summary lists  are shown there for some of the instruments I’m currently working on. 

Below that you will find a very long list of links to other Arduino projects that I found helpful or interesting. If you get stuck on something, leave a comment on the related page of this blog or post your questions to the forums at Arduino.cc – especially if you are trying to build something for your own research using a sensor I have not worked with yet.  Arduino.cc is by far the best resource available for beginners, and I always start my searches there.

Good luck with your project!