Raspberry Pi Proofing Box
I have a sourdough recipe that calls for a proofing box, but didn't feel like shelling out the $200 to buy one. Then I had an idea. I'm normally charged with cooking the Thanksgiving turkey for my family, and have to transport it an hour away for dinner. I tried a few things in the past to keep it hot, but last year I decided to build a turkey transporter. Basically I measured my roaster and built a wooden box with a latch. Worked perfectly! The bird was still steaming hot when I got there but lid was slightly warped from heat and moisture (slight oversight on latch). BTW, my woodworking skills are mediocre at best! So with a table saw, and carpenter square, just about anyone can make a decent box if I can. Anyway, I had the great idea to repurpose the box as a proofer, but how? The Pi project was born!
I included all materials below, as well as my python script I asked a friend to write (more on this later). BTW, I found a good heater with thermostat online for about the same price, but where's the fun in that??? So here is what I came up with for around $50. Raspberry Pi is the brains of the operation, a heating pad with no auto cut-off is heat source, relay for power control, and temperature sensor. So basically, the heating pad will sit at the bottom of the box since heat rises, I'll need some type of shelf for dough/banneton's to sit on, and probably some type of insulation on shelf to avoid direct heat from heating pad. From there, I'll run the power cord from pad, out the box to the relay on the Pi. I will also have the temperature sensor mounted on the side of the box level with the dough, with wiring back to the Pi. I'm also going to have a temp sensor report at the end of the proof so I can see how close to I came to a constant 74 degrees. Since temp will cut off at 74 and back on again at 73, I assume fluctuation possibly up to 75 degrees. The pad will take time to cool, and the dough itself will generate heat as it ferments. I'm going to experiment with insulation on my box if there is too much fluctuation, but I'm guessing box as-is will be good.
I would love to tell you this came together as a smashing success, but not exactly. While I was working on this project I moved to another state. Too busy with move to work on project, and if you can believe this, lost the Pi in the move. I have a bunch of stuff in storage so assuming that somehow my "make sure this box comes in the car" box got mixed in with storage stuff. Anyway, before that happened I had a problem with the script. I took a hairdryer to heat up the temp sensor past 74 (I think I set it to 78 for testing) and the relay did NOT turn off. Bummer! I know my relay works because I have a script to turn it on and off. And I know temp sensor works because the basic script for it outputs temp and humidity on the screen. So all components are good, just something goofy in my script.
Anyway, I thought I would share in case anyone else wants to geek out and make a fun, and affordable proofer. And if you figure out what's wrong with my script, or have some better ideas, let me know :). Hope to have it out of storage soon. Enjoy!
HiLetgo 2pcs 5V One Channel Relay Module Relay Switch with OPTO Isolation High Low Level Trigger | 5.98 |
Gowoops 2pcs DHT22 / AM2302 Digital Humidity and Temperature Sensor Module for Arduino Raspberry Pi, Temp Humidity Gauge Monitor Electronic Practice DIY Replace SHT11 SHT15 | 14.37 |
Raspberry Pi Zero WH (Zero W with Headers) | 14 |
Jumper Wires | 5.99 |
Electic cord and plug | 5 |
Heating pad | 5 |
Total | 50.34 |
Python Script:
import Adafruit_DHT as dht
import RPi.GPIO as GPIO
from time import sleep
from datetime import datetime
# Constants
TEMP_LOWER = 73
TEMP_UPPER = 74
SLEEP_TIME = 5
# Pin constants for temperature sensor and relay
DHT = 4
HEATER = 21
def heater_on():
GPIO.output(HEATER, GPIO.HIGH)
def heater_off():
GPIO.output(HEATER, GPIO.LOW)
def get_temp():
h,t = dht.read_retry(dht.DHT22, DHT)
return h,t
def log(message):
print(str(datetime.now()) + ' ' + str(message))
def main():
# GPIO init
GPIO.setmode(GPIO.BCM)
GPIO.setup(HEATER, GPIO.OUT)
try:
# Infinite loop
while True:
#Read Temp and Hum from DHT22
h,t = get_temp()
#Print timestamp, temperature and humidity
log('Temp={0:0.1f}*C Humidity={1:0.1f}%'.format(t,h))
if int(t) < TEMP_LOWER:
heater_on()
log("Turning heater on")
elif int(t) >= TEMP_UPPER:
heater_off()
log("Turning heater off")
# Wait before starting the loop over
sleep(SLEEP_TIME)
# Clean up GPIO pins before terminating the program
finally:
GPIO.cleanup()
if __name__ == "__main__":
from sys import exit
exit(main())