Wed, Nov 4, 2015

Telemetry

Measuring everything and putting it on the Internet.

When you buy top-of-the-line equipment and have it installed by professionals, you can generally assume it’ll work as advertised. But when you’re doing it yourself, you have to constantly monitor the performance and make adjustments. A major goal of our temperature control projects has been telemetry, the practice of collecting measurements and data.

My favourite microcontroller lately is the ESP8266 because it’s plenty powerful enough to do fairly complex temperature control and has integrated Wi-Fi capability. I can use them anywhere in our cidery and have them join the wifi network to send telemetry data to a remote server.

For the server I use InfluxDB, a simple timeseries database written in Go. Controllers can make simple HTTP requests to push it one datapoint after another. It’s easy to set up and really fast. I pretty much just forgot about it once I got it set up.

InfluxDB has a rudimentary web interface which will plot data, but for prettier graphs it’s best paired with Grafana, a fully client-side application where you can organize graphs into dashboards. I put both of these on a Free Tier VPS on Amazon Web Services.

I still haven’t gotten a solution for alerting. I wanted us to get email or SMS alerts if temperatures went beyond certain thresholds. InfluxDB doesn’t do this itself, and neither does Grafana. I could add another piece of software into the mix, but in practice we haven’t missed this functionality much. During our first season of cidermaking, we were making adjustments so frequently that we were pretty much watching these dashboards every day anyway.

At any given time we’ve had two or three different controllers around the cidery sending measurements up to the server every 10 seconds. It was great to have multiple independent controllers so that they could be repurposed as our needs changed or if their wires got ripped apart while moving an IBC full of juice (happened once or twice).

Here are the “models” I’ve made so far…

DCC-01 - Single-probe temperature monitor

A single prototyping board that we put into service as soon as we got possession of the building. There was no cider to monitor but it let me test the whole scheme and make sure our Internet uplink was reliable.

DCC-02 - Multi-probe temperature & Current monitor

This one has two clamp-on current sensing transformers that can be used to measure the AC current going to a motor, heater, light, etc. Originally I wanted to hook these to the two legs feeding our building’s main panel in order to monitor our total power consumption, but our electrician talked me out of that. This controller got repurposed a few times though.

First we used it to monitor the temperature of our brite tank (and the current used by its glycol chiller). I had a sensor in the glycol reservoir, and two stuck onto the tank. We didn’t have a level indicator on our tank, but the temperature sensors showed when the liquid fell below them as the sensor would become less coupled to the cold liquid and thus read a slightly higher temperature.

Then later in the winter we used it to monitor the temperature of our packaged cider to make sure it wasn’t freezing (and monitor the current used by the heaters). I just poked the sensors into the middle of a few pallets.

DCC-03 - Air conditioner controller

This one’s my favourite, because it let us salvage regular home air conditioners and use them as chillers for our cider cave. A/C units like these only go down to 17°C with their original controllers so that don’t risk freezing the condenser coils into a solid block of ice and burning out the motor. With this controller, I was able to get the cave down to 3°C using a software algorithm to monitor the temperature at multiple locations and carefully manage the length of the cooling cycles.

I made a second one of these for Mike and Leslie’s wedding, where we converted a shed on the farm into a walk-in cold room to keep flowers and food fresh.

The ESP8266 is under $5 shipped directly from China. The sensors are around $3 each, and most of the other parts I found in my junk bin. This incredibly versatile setup cost us almost nothing (if you don’t factor in my time — which I don’t!).

Posted on Wed, Nov 4, 2015 by Luke Cyca