Dough133
Posted on March 5, 2024 • 14 min read • 2,982 wordsA project to build an intelligent heated enclosure for fermenting and proofing sourdough.
This post is about building an intelligent heated enclosure for fermenting and proofing sourdough.
Our family started making sourdough bread during the pandemic. For the bulk fermentation and proofing phases of this bread-making process, it is helpful to keep the dough between 21-30°C (70-85°F)1 2 3 4. Our kitchen is much colder than this during the winter, however. Temperature affects the rate of fermentation and the flavor of the bread. Fancy proofer container solutions can cost more than $200 (e.g., the Brød & Taylor proofer and slow cooker4) so I wondered how easy it would be to build my own version. I know there are plenty of DIY solutions and much simpler systems such as the heat drawer of an oven, or a container with a small light bulb for heat. But I needed an excuse for a project.
I call my system “Dough133.” It is pronounced “Dough Lee”, but with a 1337 accent and optional touch of irony. It uses a small cooler as the container for the dough, a PTC heater, a simple temperature/humidity sensor in the cooler to monitor conditions, and my own microcontroller board mounted on the outside of the cooler for control.
I’m happy with the result. The enclosure quickly reaches the goal temperature, it tracks the target temperature extremely precisely, it integrates nicely with our home automation system, and it uses very little power.
This is the first of a few blog posts about the project. Later posts will detail the electronic design and temperature control.
The main job of Dough133 is to provide a temperature-controlled space for fermenting and proofing sourdough. It must be large enough for the dough and its container, but small enough not to use too much space in the kitchen or be inconvenient for storage. We want the system to be relatively energy efficient, so the container should be well insulated to prevent heat from leaking out of the enclosure.
Here is a simple model of the overall system. It consists of these basic elements:
A large part of the system design is the identification and selection of its physical components.
The enclosure isolates the environment for the dough from the ambient air in the kitchen.
I first tried using a simple insulated food delivery bag5. This works, and is very inexpensive, but it is larger than necessary and there is significant heat loss through the fabric walls.
Here is an example of the power usage of the version with an insulated bag. The system draws 70W at first as it rapidly comes up to the target temperature, then eventually settles to slightly more than 20W.
I switched to a small Coleman cooler6 instead, which requires less than half the power to maintain the desired temperature.
Enclosure type | Power to maintain temperature |
---|---|
Insulated grocery bag | 21 W |
Cooler | 8.5 W |
The cooler costs around $20 rather than 7.50 for the insulated bag, making it the most expensive component of the system.
The dough fits nicely into the enclosure along with the heater and sensor.
A number of kinds of devices which might be used to heat the enclosure. I could possibly have used a simple heating element or heat pad, but for now I’m using a PTC heater7 with a fan. It is designed to heat the air, so the sensor in the container senses the same temperature experienced by the dough. If the system used a heat pad to heat the dough container, it could be trickier to sense the dough temperature.
The system has both a physical user interface and a web interface. It is also designed to optionally work with smart home systems via MQTT8 (see the Home Assistant section). The physical user interface is very simple: a small OLED screen and a simple push button to enable and disable control of the enclosure temperature. To change the target temperature, you need to either use the device’s web interface or a home automation system. When you first turn on the device, it acts as a WiFi access point for your laptop or phone, then can use its web interface to connect it to your home’s WiFi. You can use this web interface also to set the target enclosure temperature, turn the heater control on and off, and modify parameters of the temperature control system.
I use two SHTC39 temperature/humidity sensors for this application. The SHTC3 is precise (±2 % relative humidity and ±0.2 °C), inexpensive, and is easy to interface using . It works over a range of 0 to 100 %RH and temperatures from -40 to 125 °C. An integrated module form of the sensor is used in the enclosure. A second SHTC3 in surface-mount form is soldered onto the surface of the control PCB in the EBox outside the cooler.
As discussed further in Temperature Control below, there are two sensors because the steady state power required to keep the enclosure at the desired temperature depends on the difference between the enclosure temperature and ambient temperature. If we lack a sensor for ambient temperature, we can instead measure the temperature of the enclosure before temperature control is first turned-on, and use that value as the ambient temperature thereafter.
The electrical design will be covered in depth in a later post, but I will summarize it quickly here.
I wanted to use C++ to program the microcontroller because I am familiar with it and it
is a well-supported language for this kind of application.
I use PlatformIO17 to compile and upload the firmware to the device.
From various projects I have worked on, including this one, I have built a C++ framework
that I like to use with ESP microprocessors.
I recently published this library, “og3”18, as open source on GitHub.
This library is also the basis for the software for the
Plant133 project from my previous blog post.
The present blog post is the first time og3
has been publicized, so at the time of
writing no one else has used this library.
I will describe og3
in a later blog post, along with the software used for this Dough133 project.
The library supplies the infrastructure for the WiFi configuration, the
web interface, the MQTT interface, saving and loading configuration to/from flash memory,
and writing text to the OLED display.
There are three 3D-printed custom components in the system:
All printed components were designed using OpenSCAD19.
The EBox houses the PCB, and has raised “bumps” for the OLED screen, the MOSFETs, and connectors. This shape cannot easily be 3D-printed without supports, so the figure below shows how the top of the EBox is printed using “organic” supports. These are generated by PrusaSlicer, the program I use to turn the 3D model of the parts I want to print into instructions for my printer. The organic supports look like tree branches, and are removed with pliers after the part is printed. At first I printed this part upside down, but the top surface finish is better when printed with the supports below. I recently moved the screw-tabs from top and bottom to the sides of the box to keep the top mounting screw away from the WiFi antenna of the ESP32 module.
The heater holder is a bit of plastic the heater is bolted onto and the temperature sensor mounted in, and which can be screwed to the bottom of the cooler to keep these components in place. The 3D model for this, and the model of the heater I used for designing the holder, are shown in the figure below.
Wires to the heater, the fan, and the temperature sensor need to run from the EBox mounted on the outside of the cooler to the heater holder on the inside. A hole is drilled through the wall of the cooler for this purpose. To slow the loss of heat through the hole, and to make it look slightly better, I designed a plug to hold the wires.
The plug is printed in two parts which can be pressed together with the wires between them, then inserted into the hole from the outside of the enclosure. The outer side of the plug is threaded so that a printed nut can be screwed onto its end from the inside of the enclosure. This holds the plug in place and better seals against the wall of the cooler.
Control of the enclosure temperature is one of the more interesting parts of the project. It will be covered more in depth in a later post. There are two components of the control command. These are added together to make the value that controls the heater power:
The feedforward component is simple. Depending on the quality of the insulation of the enclosure, a certain consistent amount of heater power will eventually cause a constant temperature difference inside and outside the enclosure. If you double the power to the heater, this temperature difference will double. So if you do an experiment to measure the temperature difference for a given command (e.g., 15% of full power), you can scale the command proportionally for the desired temperature difference you want to achieve.
For the feedback component, the system uses a standard PID controller20.
The code for this is the
PID class in the og3
library.
Feedback control helps reach the desired enclosure temperature more quickly, and also
more precisely in long run.
The og3
library used to write the software for this project makes it easy to interface
a device like Dough133 with Home Assistant21.
If you have a Home Assistant instance and an MQTT broker in your home, you use the web
interface to tell the device how to talk to the MQTT broker.
Then, a set of sensors and a thermostat control for Dough133 will automatically be
discovered by the Home Assistant instance.
The thermostat widget that Home Assistant offers for controlling our device is shown below.
Before I developed the safety circuit on the controller board, I used a smart plug with the Home Assistant system in my house to implement a simple power cut-off mechanism for safety. The smart plug measures power supplied to the device and can be switched on and off by Home Assistant. The home automation system adds-up the power supplied to the device over 15 minutes. If this value gets too high, an automation rule switches the smart plug off.
I found by experimentation that when things are working normally, the integrated power should not get above 100 (the scaling of these values is arbitrary, not SI units) over 15 minutes. So I have the system send a warning to our phones if the value gets above 125, and cut power if the value gets above 150.
Here is a rough breakdown of the cost of materials for making a single Dough133 device. These are ballpark estimates since the prices vary over time and by vendor. It is cheaper than the fancy commercial systems, though lacking features like humidity control. It costs quite a bit more than a small light bulb in a Tupperware container.
Component | Cost |
---|---|
PCB (4 layer, lead-free finish) | $3 |
Total PCB electronics components (est) | 10 |
PTC Heater | 7 |
Cooler | 20 |
12V A/C power adapter | 12 |
Printed components | 4 |
Total | $56 |
This is a thermal image of the system in operation. Almost all the electrical energy used by the device turns into heat, so the less heat we see in the thermal images of the cooler, the more efficient the system. That means not much heat is leaking out into the kitchen. It is possible to see some heat escaping through the hole in the cooler near its bottom, where wires run into it for supplying power for the fan and heater and communication to the temperature/humidity sensor.
We do want heat to escape from the EBox, to keep components like the microcontroller from getting too hot. Heat is generated by the MOSFETs used to control power to the heater and the fan, the microprocessor, the WiFi antenna, the power regulators, and the OLED display. The hottest location in the image of the EBox is actually the hole exposing the push-button, where warm air escapes from the EBox. This suggests it might be a good idea to add some air vents to the top of the EBox, which should be more effective at letting heat escape. The microprocessor is visible to the right of the push-button, near the top of the EBox. The 12V power supply to the right of the cooler is also an obvious source of heat.
Here is a view of the EBox when the system has recently been turned-on and the heater is near full power. The hottest component is the MOSFET controlling power to the heater. It is below the microprocessor, near the middle of the picture.
I’m happy with the system as it is working now, so don’t have plans to make major changes. If you know of ways it might be improved however, I’d be interested to hear!
Proofer and slow cooker by Brød & Taylor. ↩︎ ↩︎
Insulated Reusable Grocery Bag which was $15 for 2 at the time. 16”x10”x12” high. ↩︎
Constant Temperature Air Heater 12V100W ( AliExpress $7). ↩︎
The MQTT protocol ( Wikipedia) is useful for IOT (Internet of Things) applications. ↩︎
SHTC3 module ( AliExpress) ( Datasheet) ↩︎
ESP32: a family of microcontrollers made by Espressif Systems. A successor to the ESP8266 microcontroller. ↩︎
Pulse-width modulation (PWM) is a method of representing a signal as a rectangular wave with a varying duty cycle (ratio of “on” to “off”) Wikipedia. ↩︎
The metal–oxide–semiconductor field-effect transistor (MOSFET) has the ability to change conductivity with the amount of applied voltage, and can be used for amplifying or switching electronic signals. Wikipedia. ↩︎
A flyback diode is any diode connected across an inductor used to eliminate flyback, which is the sudden voltage spike seen across an inductive load when its supply current is suddenly reduced or interrupted. It is used in circuits in which inductive loads are controlled by switches, and in switching power supplies and inverters. Wikipedia. ↩︎
A buck converter is a DC-to-DC converter which decreases voltage, while increasing current, from its input (supply) to its output (load). It is a class of switched-mode power supply. ( Wikipedia). ↩︎
A low-dropout regulator (LDO regulator) is a DC linear voltage regulator that can operate even when the supply voltage is very close to the output voltage ( Wikipedia). ↩︎
ESP8266: a low-cost WiFi microchip, with built-in TCP/IP networking software, and microcontroller capability, produced by Espressif Systems. ↩︎
PlatformIO is an open source framework for compiling/uploading embedded software, and managing libraries used by this software. ↩︎
og3
is my C++ utility library for ESP microprocessors, published on
GitHub. ↩︎
OpenSCAD is an open source program which implements a programming language for building 3D models. It is a way to build models using solid modeling primitives. ↩︎
PID control. see Proportional-integral-derivative controller in Wikipedia. ↩︎
Home Assistant is a popular Open Source home automation platform. It is the hub for my own smart home, and it is a blast to work with. ↩︎