Introduction: Streaming Sensor Data From a PpDAQC Pi-Plate Using InitialState

The Pi-PlatesppDAQC Data Acquisition and Control board is an ideal interface between sensors and a Raspberry Pi. With eight analog and eight digital inputs, up to sixteen channels of real world data can be captured by a single ppDAQC Pi-Plate. But, what can you do with that data? You can use it to control a process by turning around and driving the Digital and Analog outputs on the board. But chances are you will also want the ability to monitor it. Furthermore, the beauty of small, inexpensive single board computers (SBC) like the Raspberry Pi, is that they can be used in remote locations without a keyboard or a monitor. All they need is a source of power, and a WiFi adapter. Using a SBC in this way is referred to as a “headless” setup.

So that’s our plan: use a headless Raspberry Pi collecting sensor data in a remote location. Our options for viewing the data include:

  1. Watching individual readings scroll down our screen (boring)
  2. Saving data to a local file and then viewing the data later using a spreadsheet application or the matplotlib – sounds a lot like work
  3. Use InitialState to stream our data to the cloud and then look at beautiful plots of it in real time. This is how all the cool kids are doing it these days.

In this article we’re going to use option 3 to monitor two DS18B20 sensors measuring the ambient temperature in a storage closet as well as the temperature in a refrigerator used for keeping solder paste chilled.

Step 1: Stuff You Need

InitialState Access and Python Library

To begin, head to and apply for an account. While you’re waiting for approval, install their python module on your Raspberry Pi. We prefer to use pip since it makes life so easy. Go here to learn more about pip: From the command prompt, type:

sudo pip install ISStreamer

Once you have access to the InitialState service, you’re ready to start.


To collect the temperature data we will use the following:

  1. A Raspberry Pi which has been preloaded with the ppDAQC Python module. Go here if you need to perform this step.
  2. A ppDAQC board from
  3. Two DS18B20 temperature sensors. We got ours here at Amazon.
  4. Two 4.7K ohm resistors. Available from Radio Shack, Digikey, and Mouser to name a few.
  5. Hookup wire
  6. A proto-board for quick and dirty or a ppPROTO for a semi permanent setup.

Step 2: Build It


Using the materials called out in the previous step, perform the connections as shown in the drawing. Note: we were out of luck when we went looking for the 4.7K resistors so we ended up putting two 10K resistors in parallel.


First you will need to create a new logging Client Key from your Initial State account. After you’ve done this, use your favorite text editor on your Raspberry Pi (this is Nano for most people) and type in the following program:

import time<br>import piplates.ppDAQC as ppDAQC
from ISStreamer.Streamer import Streamer
logger = Streamer(bucket="Lab Temperature Data", client_key="YourClientKeyHere")
logger.log("Lab Temperature Data", "Stream Starting")
	logger.log("Cooler", tFridge)
	logger.log("Ambient", tAmbient)

Save the above in your home directory as, launch your program from the command prompt with the command sudo python, and verify that no errors occur.

What’s happening in this code? Well first, we import three modules that we will need: time, piplates.ppDAQC and ISStreamer.Streamer. Then we create a stream to the InitialState data logger with:

logger = Streamer(bucket="Lab Temperature Data", client_key = "YourClientKeyHere")

After that, we go into an infinite loop and use ppDAQC.getTEMP to read the two DS18B20 temp sensors. After each read, we “log” the data along with a label to our log file at InitialState. We sleep for 300 seconds (5 minutes) and then we take another measurement.

Step 3: Examining the Log Data - Step 1

You can start looking at your data right away but there won’t be much to see until a few hours have passed. Once you’re ready, log into your Initial State account. After you’ve completed that step you’ll be taken to your own page (see image) where you can access and view your log data.

You should have a log file called “Lab Temperature Data”. Click that and then click the button that says “Source.” You will then be presented with some pretty boring lines of raw data from your Raspberry Pi that looks like:


2014-12-18T15:50:57.837852Z,"Lab Temperature Data","Stream Starting"















Not very interesting is it.

Step 4: Examining the Log Data - Step 2

Now click the “Wave” button and you should see something much prettier. Here is what I had after about 18 hours of monitoring. To get this plot, I went into the Tools (that little gear icon) and hid the first line labeled “Lab Temperature Data.” Then, while still in Tools, I used the Amplify Signal+ feature to increase the size of each “waveform” until they filled the screen. Then, I clicked on the “Units” button and selected hours. Finally, I dragged to cursors to the beginning and end of the log.

So now we have our pretty plot courtesy of InitialState. The refrigerator data is on the top and the closet temperature is on the bottom. What conclusions can we draw?

  1. The refrigerator cycles the compressor periodically to maintain the temperature. By dragging the cursors to the appropriate locations we can measure the period of this cooling cycle as 0.6 hours or 36 minutes.
  2. Also, by dragging the cursor we can see that the refrigerator temperature swings from about 36.5 to 38.6 degrees Fahrenheit. This is good for solder paste but not so much for beer.
  3. We can observe that at about the 11 hour mark, the thermostat in the lab switched to night mode and the closet temperature started to ramp down.
  4. We can observe that about the 18 hour mark, the heat came back on and the closet temperature started ramping back up.
  5. The most interesting thing though is the fact that the cooler temperature droops a little during the night. This indicates a lack of good temperature regulation and a waste of energy.

Step 5: Examining the Log Data - Step 3

There are more toys to play with on your log page. With one of your waveforms selected, click on the “Stats” button. On the left is a detailed histogram of all of the Cooler data as well as some basic statistical values. Here we can see our maximum, minimum, and average values. While the average is 37.28 degrees, the histogram also tells us the values 36.54 to 36.69 occur most frequently – this measurement is called the “mode”. The chart on the right also reflects the mode data.

Step 6: Wrap Up

In this example we learned how to connect the DS18B20 temperature sensor to a Pi-PlatesppDAQC, how to stream the data to a log file at, and how to manipulate and examine our data after we streamed it.

This is just a simple example of what can be accomplished with these simple components. There’s plenty of other phenomena that can be measured and logged- things like humidity, sound, light, air pressure, resistance, distance, voltage, current, weight, and strain just to name a few.


jwasinger (author)2015-01-14

There's no reason it could not be used to record wind speed. But it would depend on what you're using for a sensor.

mjones222 (author)2014-12-20

Love your plan!! Any chance this could be used to record wind speed??