Keep the Beer Cold with IoT (but not too cold)by@wbelk
2,337 reads
2,337 reads

Keep the Beer Cold with IoT (but not too cold)

by William BelkMay 15th, 2016
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

IoT is the coolest. The boards get smaller every year; the possibilities grow each day. I’ve been trying to find ways to integrate smart devices into life and business. My beer company, <a href="" target="_blank">Blessed Brewing</a>, seems the perfect test ground for fun IoT stuff.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Keep the Beer Cold with IoT (but not too cold)
William Belk HackerNoon profile picture

This is the story of a simple 3.3V Arduino-compatible device that monitors commercial refrigerator temperatures, sends SMS text messages, and publishes data to a central service.

IoT is the coolest. The boards get smaller every year; the possibilities grow each day. I’ve been trying to find ways to integrate smart devices into life and business. My beer company, Blessed Brewing, seems the perfect test ground for fun IoT stuff.

The Problem

Keeping something cold seems so simple. Commercial refrigeration units come in all shapes and sizes. However, they are surprisingly difficult to calibrate and monitor with great accuracy. At any given time, Blessed Brewing might have $30,000 worth of fresh beer in our cold storage units. If we can keep our beer at a consistent temperature of 36ºF, we know that our customers will be able to enjoy a beer with the most dynamic flavor profile. Cold beer stays fresh longer, but more importantly it retains its subtle nuances of flavor. This is particularly important for a delicate and hoppy beer like our Big Fifty Pale Ale.

A general rule of thumb for the brewing industry is that beer stored at 100°F for one week tastes as old as beer stored at 70°F for two months, or as old as beer stored at 40°F for one year.

Because cold storage units are simple, mechanical and predictable, they create a very compelling case for IoT performance monitoring, failure prevention and notification:

  • What if the default temperature range on a unit is incorrect for our application?
  • What if our service technician does a poor job calibrating the thermostat?
  • What if a compressor fails?
  • What if a circuit breaker blows on the panel?
  • What if there is a power outage at our facility while we are away?
  • What if one of these things happens over a vacation weekend, or if we do not open the door to a cooler for 4 days?
  • What if an employee doesn’t notice that the cooler is at 59ºF instead of 36º?

On the other hand, what if our coolers get too cold? What if a cooler sustains a temperature of 16ºF over a holiday weekend? Our thermostat could fail or go out of calibration, wires could short.

We would cry if $30k worth of our glorious beer exploded (yes, frozen beer explodes) or our kegs valves expanded from cold-pressure causing permanent damage.

The Solution

Let’s build and install some 3.3V, 2G SMS Arduino devices with waterproof temperature sensors. This will surely satisfy an insatiable desire to limit the potential risk from critical infrastructure failures.

These sensors are programmed to do the following:

  • Show antenna strength, register with the cellular network and flash lots of pretty status lights
  • Check temperature every few minutes
  • Send SMS text messages if temp < 29ºF or > 46ºF
  • Publish data to our dashboard for visualization and historical trend analysis

3.3V IoT Temperature Sensor with 2G SMS, HTTP, and 48-hour Lithium Battery Fail-Over

The ingredients:

  • Arduino-compatible board with 2G SIM for SMS and GPRS for outgoing HTTP calls
  • Waterproof temperature sensor
  • Lithium battery
  • Antenna
  • USB wall socket & cable
  • Power switch
  • LED bulb
  • Lots of soldering
  • Lots of C code

Design Considerations

Why not use a commercially available Wifi sensor? Wifi will not work if the power goes out, or if Time Warner’s network goes down (just ask any Internet company how reliable their Wifi is when they need it most). 2G data networks are extremely stable, low-power, and our devices can exist on backup battery power for 48+ hours while still sending SMS texts and publishing data to our main service. Furthermore, we don’t have a need to stream realtime data via wifi. Temperatures do not change much over a 2 minute period, and change is mostly linear (either down while cooling, or up when the compressor is not engaged). I looked at things like and beyond, but complete reliance on wifi for data connectivity is too fragile and resource intensive on-site. The coolest device that I considered was this industrial sensor from Monnit. However, this is not a self-contained unit and requires an additional central cellular gateway to which each sensor connects in order to send data to a web service. Furthermore, I can’t extend a single device to do multiple things, like GPS + temperature (read below for section on “refrigerated delivery vehicles”). Finally, it’s no fun if I don’t get to build something myself!

Why not connect each refrigeration unit to its Arduino sensor, and use a relay to control on/off cycles based on temperature? This was a very attractive option, but I didn’t want to reinvent the wheel. Our digital thermostats work great. Once properly calibrated (with the help of new data visualization), our thermostats will work reliably within an expected range, and they don’t require code pushes for small calibration.

Why not use BrewPi? BrewPi is totally awesome, but there are few reasons why it’s not ideal for us: 1) it’s big and bulky 2) it’s optimized for keg fridge home brewing 3) it consumes a lot more power, and thus does not suit our battery failover consideration (must sustain on battery life for several days).


Altogether this was a difficult project, but extremely rewarding. Lots of small details, lots of quirks with the code, hardware, sensors, commercial refrigeration, thermostats, etc. One of the most interesting things was being able to visualize how variable refrigeration systems can be.

I started out very ignorant/naive to the following:

  • Thermometers are rarely perfectly accurate. One of our thermometers was off by 6ºF.
  • Thermostats are rarely (if ever) calibrated exactly the same. E.g. cut-in and cut-out temperatures were all over the map. With one of our units, we started with temperature fluctuations of 28ºF on a mechanical Ranco thermostat (and ultimately had to replace the thermostat twice with two different models).
  • As you can see illustrated below, it’s easy to visualize how a proper Cut-In/Cut-Out calibration is important to achieve a desired average temperature. One of our walk-in coolers had an extremely tight default temperature range. It would be very hard to know without graphing the data because the LED temperature readout on the unit was always within an expected range. Once we charted actual temperature data, we found that the compressor was being short-cycled to achieve the desired average temperature, causing too many on/off cycles that would have likely caused premature compressor failures in the future.

Apart from teaching me not to trust any refrigerator ever again, the best takeaway from the project was that it fueled my excitement for IoT and reinforced a feeling that Arduino and low-power connected devices will be a huge part of global innovation in the next decade.

What about refrigerated delivery vehicles?

I’m glad you asked! GPS and temperature monitoring together would be rad, so I extended the functionality of our 3.3V 2G SMS Temperature Sensors into 5V 3G devices that monitor delivery box temperatures and map vehicle GPS locations. Check out the data here:

Because refrigerated vehicles are much more prone to temperature fluctuations because of opening the back, loading/unloading etc., I won’t bore you with potential failure scenarios and calibration. With our current implementation, we just want to know where is the beer? and can the delivery truck get cold in the back?

That’s It

If you’re interested in tasting our perfectly cold beer, you can find us on tap and in bottles in San Luis Obispo and Los Angeles.

If you’d like me to help your brewery, wine, or food service company implement some cool IoT technology, send a message to [email protected]