CellarWarden
A wine/beer cellar temperature/humidity monitoring and control app for the Raspberry Pi
Install / Use
/learn @craigmw/CellarWardenREADME
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="./help_styles.css">
</head>
<body>
<h2><a id="user-content-overview" class="anchor" href="#overview" aria-hidden="true"><span class="octicon octicon-link"></span></a>Overview</h2>
<p>CellarWarden is an application that runs on the Raspberry Pi
(B, B
Plus, RPi 2 and RPi 3 supported; the Pi Zero is not supported, nor is
the
BeagleBone Black...yet) that monitors and controls temperature and
humidity and
provides a graphical display of these values over time. This is useful
for monitoring wine cellars, kegerators/keezers, humidors, meat
cellars,
refrigerators, etc. for optimal temperature and humidity. If these
values are out of range, CellarWarden can be set to send alarm emails
and text messages to designated users. </p>
<p></p>
<p>CellarWarden now also provides
controllers for controlling temperature and humidity automatically,
useful for maintaining wine cellar temperature and humidity, the
temperature of a kegerator or keezer, or to control the temperature of
multiple wine/beer fermentation vessels. A
virtually unlimited number of controllers can be defined for this
purpose. These controllers may use hysteresis (thermostatic) or PID
temperature automatic control and can be programmed to follow
individual profiles
to vary the setpoint over time. </p>
<p></p>
<p>For temperature and humidity probes,
CellarWarden supports up to two DHT11/DHT22/AM2302 temperature/humidity
sensors connected to RPi GPIO pins. In addition, up to eight
Dallas One-Wire (DS18B20) temperature sensors can be connected to the
RPi and monitored by CellarWarden. As well, up to two door switches
can be monitored to ensure that cellar or fermentation doors
have
not been left open
for too long. Alarm functions can be set to only be activated when a
condition has been met for a set time (as configured in the <a style="color: rgb(51, 255, 51);" href="/public/help/help_alarms.html">Alarms
Configuration dialog</a>). The server daemon is programmed in
Node.js and the
client app is handled by Javascript. </p>
<h2><br>
<a id="user-content-web-app" class="anchor" href="#web-app" aria-hidden="true"><span class="octicon octicon-link"></span></a></h2>
<h2>Web App</h2>
<p><a href="https://github.com/craigmw/CellarWarden/blob/master/public/help/MainSensors.jpg"><img style="border: 0px solid ; width: 1000px; height: 685px;" alt="Cellar Warden Overview" src="/public/help/MainSensors.jpg"></a><a href="https://github.com/craigmw/CellarWarden/blob/master/public/help/MainSensors.jpg" target="_blank"><br>
</a></p>
<p>CellarWarden is a client/server application, with a Node.js
server
running as a service on the RPi perpetually. It continuously logs
temperature and humidity data and stores this to a log file.
CellarWarden now offers controller function to control temperature or
humidity using hysteresis or PID control. A virtually unlimited number
of controllers can be associated with temperature or humidity sensors
to control the output of refrigerators, wine cellars, fermentation
chambers, etc. CellarWarden only requires a Raspberry Pi, and connects
to such appliances via relay boards, with the relay boards driving the
powering of these attached appliances. CellarWarden also provides
controller profiles, a method to vary the setpoint for temperature or
humidity over time. These profiles can be generated using a <a style="color: rgb(51, 255, 51);" href="/public/help/help_profile.html">profile
editor</a>, and can be saved or loaded for re-use.</p>
<p></p>
<p>To
view logged data, or to
change configurations, controllers and alarm settings, a web based
app is used. Shown is the web client application, with temperature and
humidity data plotted over time. Also shown on the graph are
annotations indicating alarm conditions that were triggered. These
conditions can be set in <a style="color: rgb(51, 255, 51);" href="/public/help/help_alarms.html">a dialog</a> opened by
clicking on the Alarms
button. Alarm notifications are sent to specified email addresses,
including those associated with cell phone/SMS accounts. CellarWarden
also compresses older data, as can be configured under the Logging
Option in the <a style="color: rgb(51, 255, 51);" href="/public/help/help_config.html">Configure dialog</a>.
Alternatively, CellarWarden can
maintain data for a set period, deleting older data as time progresses
in round-robbin fashion. These logging options prevent the log file
from becoming too large and slowing down client side operations. Note
that while
not shown above, moving the mouse over the graphs will show the data
values for each plot in legend to the right of the graph. CellarWarden
call also monitor door open events and will plot these on the main
screen. Alarms can be set up to notify the user if doors are left open
too long.</p>
<p></p>
<h2><a id="user-content-hardware-configuration" class="anchor" href="#hardware-configuration" aria-hidden="true"><span class="octicon octicon-link"></span></a>Hardware
Configuration</h2>
<p>The minimal hardware for CellarWarden is a single
<a style="color: rgb(51, 255, 51);" href="https://www.adafruit.com/product/386">DHT11</a>/<a style="color: rgb(51, 255, 51);" href="https://www.adafruit.com/product/385">DHT22</a>/<a style="color: rgb(51, 255, 51);" href="https://www.adafruit.com/products/393">AM2302</a>
combined temp/humidity sensor connected to a free GPIO pin on a
Raspberry Pi B, B Plus or RPi2. As shown in the Fritzing schematic
below, this is done by running the specified GPIO input pin to the data
line on the sensor, with 3.3V and ground supplied to appropriate pins
on the sensor. Note that the DHT22/AM2302 is more accurate than the
DHT11, and thus it is recommended that one of these be employed. These
sensors use a form of one-wire protocol to communicate, although this
is proprietary and is not supported by the Dallas One Wire protocol. </p>
<p>In addition to these, two Dallas One Wire temperature sensors
may
also be configured. In this case, a single GPIO pin is required,
regardless of the number of One Wire sensors (e.g. <a style="color: rgb(51, 255, 51);" href="https://www.adafruit.com/products/374">DS18B20</a>). Each
DHT11/DHT22/AM2302 and the Dallas One Wire bus requires the data line
to be pulled high (3.3V or 5V) via a 4.7K Ohm resistor in series
between Vcc
(3.3V or 5V) and the data line (as shown). Note that the Dallas One
Wire data
line is currently set to use GPIO 4 on the RPiBv2 and RPiB+, as this is
set in Raspbian. However, newer implementations of <a style="color: rgb(51, 255, 51);" href="http://www.raspberrypi.org/documentation/configuration/device-tree.md">Raspbian
use a
Device Tree.</a> Thus it is possible to use a different GPIO pin
for setting up the
Dallas One Wire bus. CellarWarden does not currently change this GPIO
setting, although it stores the GPIO number in its configuration for
reference. </p>
<p>CellarWarden also supports a hardware LCD character display
based on
the Hitachi HD44780U controller. By default, CellarWarden will use a
20x4 single led backlit parallel display such as <a style="color: rgb(51, 255, 51);" href="http://www.amazon.com/RioRand-trade-Module-Arduino-White/dp/B00GZ6GK7A/ref=pd_sim_pc_5?ie=UTF8&refRID=0B8Q9M15C5P73Y20XB67">this</a>.
CellarWarden also supports LCD displays that connect via I2C backpacks,
including this <a style="color: rgb(51, 255, 51);" href="http://www.sainsmart.com/sainsmart-iic-i2c-twi-serial-2004-20x4-lcd-module-shield-for-arduino-uno-mega-r3.html">model</a>.
While I2C displays are slower than parallel displays, only two GPIO
pins are required and these can be shared with other devices, including
<a style="color: rgb(51, 255, 51);" href="https://www.adafruit.com/product/264">I2C realtime
clock (RTC) boards</a>.</p>
<p></p>
<p>In addition, up to two GPIO pins may be specified to monitor
door
opening via microswitches. As shown in the schematic, such a door
switch may also be used to switch on the LCD backlight (if used). Thus,
a simple SPDT microswitch may be used in which the common is connected
to Vcc, and the normally open contact is connected to the backlight pin
on the LCD </p>
<p>Note: CellarWarden uses the GPIO numbers as specified by
Broadcom,
not the actual pin numbers. GPIO numbers can be determined for
different RPi boards <a style="color: rgb(51, 255, 51);" href="http://pi.gadgetoid.com/pinout">here</a>.</p>
<p><a href="http://pi.gadgetoid.com/pinout"><br>
</a></p>
<h2>
<a id="user-content-schematics" class="anchor" href="#schematics" aria-hidden="true"><span class="octicon octicon-link"></span></a>Schematics</h2>
<p><a href="https://github.com/craigmw/CellarWarden/blob/master/public/help/CellarWardenMin_bb.jpg" target="_blank"><img src="https://github.com/craigmw/CellarWarden/raw/master/public/help/CellarWardenMin_bb.jpg" style="max-width: 100%;"></a></p>
<p>This is a relatively minimal setup involving one DHT22 to
measure
the cellar air temperature and humidity, a single DS18B20 One Wire
temperature sensor for measuring bottle temperature (using a
thermowell), and a door microswitch. Note that while some DS18B20
sensors are available wired in a waterproof probe, I prefer to use a
thermowell to simplify insertion of the probe into a wine bottle. Fill
an empty bottle with water, drill a 1/4" hole through the cork and then
insert the thermowell through the hole in the cork. Place the cork
tightly into the bottle and check for leaks. Put the bottle in the
cellar and insert the DS18B20 probe into the thermowell. A good source
for such thermowells is <a style="color: rgb(51, 255, 51);" href="https://www.brewershardware.com/12-Stainless-Steel-Thermowell-TWS12.html">here</a>.</p>
<p>Additional hardware configurations can be found in the <a style="color: rgb(51, 255, 51);" href="help_hardware.html">Hardware
Examples</a> help page.</p>
<p><a href="https://www.brewershardware.com/12-Stainless-Steel-Thermowell-TWS12.html"><br>
</a
