Grow Box

15 January 2018

When our wine cooler gav up the ghost, I didn't have the heart to just throw away such a nice looking carcass. I gutted the machine and cut out the top to accommodate a couple of CFL grow lights. I removed the evaporator and replaced it with the innards from an old space heater. I rewired the heating elements so they are now in series instead of parallel and put a hefty diode in series with the elements to greatly cut down on the power. In a sealed environment like this it doesn't take much power to maintain temperatures appropriate for a grow box. I kept in place a muffin fan in the plenum to distribute the heat. 

On initial testing I found out that the humidity quickly rises to 100 percent when plants or seedlings are placed inside. I cut two holes in the bottom of the cabinet for ventilation. Over one hole I mounted a muffin fan to draw in fresh air and the other hole allows the cabinet air to escape. 

I also discovered that the grow lights put out too much heat so they now reside in a sealed chamber with a dedicated fan that cools the lights whenever they are turned on.

The electronics consists of a Raspberry Pi 3, a BME280 temperature and humidity sensor wired to the I2C bus, and a 4 channel relay that controls the grow lights, the heater, heater fan and ventilation fan.

Initially I set up the Raspberry Pi with Raspian Lite and turned on the I2C bus. I installed an MQTT broker and wrote some Python scripts to control everything. To control the box and change settings, I used an app on my Android phone called MQTT Dashboard to change data on a few MQTT topics. All this worked just fine for a year, but without an elegant web interface, it was a little clumsy to operate.

In the mean time, I learned about Node Red and used it with great success for my Crawl Space ventilation project

Here's a snapshot of the Node Red dashboard running on the grow box:

The Temperature and Humidity Set Points are controlled by a Slider and the set point gauges are set up in Compass style. The actual temperature and humidity readings are gauges set up in the default Gauge style. The indicators on the bottom of the screen are actually gauges set up in Donut style with a minimum reading of zero and a maximum reading of one. I changed the default colors to yellow for the grow lights, red for the heater, blue for ventilation and red for Over Temp and sensor timeout errors and blue for Under Temp. The Adafruit BME280 sensor was failing periodically so I added a Timeout feature to make sure the heater couldn't run if data stopped flowing in from the sensor. I've since replaced the sensor with one from DIYMALL (Amazon link) and it's rock solid.

A cool feature of Node Red is the ability to connect the flow to social media. I set up the grow box with its own Twitter account and I now get tweets if the box temperature is 5 degrees higher or lower than the set point or the flow doesn't receive a temperature sensor reading in 2 minutes. Normally a Python script sends a sensor reading to an MQTT topic every two seconds. If the flow doesn't receive a temperature reading after 5 seconds, I'll get a timeout notification. You can see these tweets by checking out the Twitter account @wt4y_growbox.

Another feature I recently discovered is the ability of Node Red to send voice messages to Google Home speakers. There is a node called "Google Home Notify" that allows you to send a string to the Google Home device of your choice. Simply configure the node with the I.P. address of your device and send a string to it. My flow sends messages to my Living Room Google Home speaker if there is a temperature error or loses communications with the BME280 sensor.

Here's what my flow looks like:

If you're interested in importing this flow into your Node Red installation, I'll send you the text file. You'll have to promise to change the Twitter nodes to use your own account. I can also send the Python script that reads the BME280 sensor every 2 seconds and updates MQTT topics. As you can see from the flow, I rely heavily on MQTT to pass data around. Note the gb/temperature and gb/humidity topics are Retained so that the settings will survive a re-boot. As I recall, the nodes I had to install that were not part of the default installation are node-red-contrib-deadmanswitch, node-red-contrib-edge-trigger, node-red-dashboard, node-red-contrib-google-home-notify and node-red-node-timeswitch.  There may be others, but I am old and easily confused (obscure Seinfeld reference).

This is my interface to the Raspberry Pi. There are 2 pins to supply 5 volts power, 4 pins for the I2C interface and 6 pins for the 4 channel relay.

If you have found this article helpful, how about throwing a tip into my bitcoin wallet?