The Fresh Loaf

A Community of Amateur Bakers and Artisan Bread Enthusiasts.

Raspberry Pi Proofing Box

paul0130's picture
paul0130

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!

Pi Proofing Box Project

 

HiLetgo 2pcs 5V One Channel Relay Module Relay Switch with OPTO Isolation High Low Level Trigger5.98
Gowoops 2pcs DHT22 / AM2302 Digital Humidity and Temperature Sensor Module for Arduino Raspberry Pi, Temp Humidity Gauge Monitor Electronic Practice DIY Replace SHT11 SHT1514.37
Raspberry Pi Zero WH (Zero W with Headers)14
Jumper Wires5.99
Electic cord and plug5
Heating pad5
Total50.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())

albacore's picture
albacore

A noble project, but you can buy those little STC1000 controllers very cheaply, complete with probe. They are on/off rather than PID, but that's good enough for a proofing box.

I like to include a fan in any proofing boxes I build to assist in achieving a uniform temperature throughout.

Lance

Mike Wurlitzer's picture
Mike Wurlitzer

A good start but may I suggest a rethink. If you are into any sort of home automation, the RPi is fantastic for this and so much more.  Think WiFi first.

I am running an RPi 3B using NodeRed {free} and Sonoff devices for all my lights and a Sonoff TH16 {Temp/Humidity controller w/16 amp relay} with the same temp/humidity sensor you have for my proofing box which is a nice well insulated Ice Chest {which in under 15 seconds can be used for its original purpose}.

What this brings to the party is the ability to monitor and control my proofing box {and my lights} from any cell phone, or laptop, or tablet anywhere in the house. If you are really geeky like me, you can even control all of this from anywhere in the world over the Internet.

What I would like to do, is take my very old DAK Bread machine and use an RPi to control all the functions based off any recipe from a Excel, or LibreOffice file.  The old DAK machine just had a couple of pre-programmed functions.

tpassin's picture
tpassin

I don't know anything about your controller or sensor, but your temperature is apparently being reported in deg C but you are comparing against deg F for the control functions (e.g., if int(t) < TEMP_LOWER:).

I assume that the if block is actually indented under the main() function. Otherwise the whole thing would be weird.

BTW, it's not really Pythonic to use a main() function with if __name__ == '__main__':.  Just put the body of main() there instead.  And since your main() doesn't return anything, the line exit(main()) is pointless.  Execution will end anyway.