Tutorial: DataLogger #1 – Measure/Graph/Log Current with the Raspberry Pi

Arduino Uno, then Arduino Pro Mini Test Runs

Tutorial: DataLogger #1 –  Measure/Graph/Log Current with the Screen Shot 2016-06-03 at 5.26.02 AMRaspberry Pi

Introduction

One of our current projects at SwitchDoc Labs is the design of a low power WeatherLink transmitter that will wirelessly send down the weather information from a WeatherRack to an OurWeather station or a similar Arduino or Raspberry Pi setup.   Since we would like to supply the WeatherLink transmitter from either a solar power system or a battery, how much power/current we are consuming is critical.   We have done a lot of experimenting with a number of different low power libraries and functions for the Arduino and are closing in on a final design.    Next up for that project is designing the PC Board and having it fabricated.   The testing of this project requires a DataLogger.

Since current is so important in this design, we decided to build a Raspberry Pi based DataLogger to read how much current was going into the Arduino based transmitter and use this information to modify the system to reduce the current.  This tutorial shows how to build the DataLogger.

Part 1: DataLogger Introduction

Part 2:  DataLogger Hardware

Part 3: DataLogger Software

Introduction

The DataLogger consists of a Raspberry Pi 3 running the DataLogging Python Software,  MySQL, MatPlotLib and an Apache Webserver.   Installing all this software will be described in Part 3 of this tutorial.

IMG_9621 2
Modified Grove Cable
DataLogger
DataLogger Hardware Block Diagram

Since we are currently measuring current, we are using a Grove INA3221  3 Channel current/voltage measurement device.   What is Grove?   Grove is a system for prototyping systems quickly by the use of standardized plugs. Check our full Grove tutorial here.   The block diagram to the left shows the basic structure.   The Raspberry reads the INA3221 via the I2C bus.   The power line for the DUT (Device Under Test) is split and the end wire directly from the power supply is fed into the INA1+ line and then a wire goes from the INA1- line into the power supply of the DUT.   For doing current measurements of Grove devices, we built a special Grove cable, cutting the power line and adding two female jumpers so we can plug them into the INA3221.

We have used this DataLogger in two projects so far.   The first was a system test of our new product, the Grove Digital Extender board, an I2C board that gives 8 more Grove Digital ports.

Note that the SunAirPlus board contains an INA3221.  Since we are planning to make this Wireless system Solar Powered, we used the INA3221 in SunAirPlus.  We could have easily used a Grove INA3221, but then we would have had to cut a USB cable and install two female jumpers in the power line.

Pi2Grover
Measuring the current of the LEDs and Grove Digital Extender

The second project, described in the introduction is the WeatherLink, a wireless data transmission project for the WeatherRack.

WeatherLink Prototype with DataLogger
WeatherLink Prototype with DataLogger