/Dehydrator

Precision control for food dehydrators

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Dehydrator

An Arduino based adjustable precision bang bang relay controller for food dehydrators.

3D Printed Controller & Relay Enclosures

Features

  • LCD interface w/ intuitive up/select/down button menus
  • Filament heating time and temperature tables (editable in configuration.h)
  • 'OFF', 'Select Filament', and 'Dry -> Holding' modes
  • Separate relays for fan & heater
  • Dallas & DHTXX sensors for decent precision with low cost
  • Adjustable temperature hysteresis for heating mode
  • Heater "ON" LED indicator
  • Displays temp, set temp, humidity, and heater duty cycle % in dry and hold modes
  • Obeys minimum switching times

Hardware Used:

  • Arduino pro mini (or similar m328p)
  • DHT22 sensor
  • Dallas temp sensor (optional)
  • 1602 I2C LCD
  • 2@ 5VDC/250VAC-20A Relay (for heater & fan, fan may use a lower amp relay)
  • Food Dehydrator, 120VAC (Presto 6302 or similar)
  • 3@ 6x6x6mm N.O. toggle buttons
  • 3@ 4k7ohm resistors (button pullups)
  • 5VDC supply (USB, wallwart, or similar)
  • 0.22uF+220ohm RC snubber (Kemet P409CP224M275AH221 or similar)
  • LED + limiting resistor (heater on indicator)

Operation

Normal bootup goes in to off mode. Hitting select switches to filament select mode.

In filament select mode, the heater will remain off, while the LCD displays the filament name, drying temperature, & holding humidity. During filament select mode, up/down changes the selected filament, and select will go to drying mode.

While in drying mode the heater is hysteresis controlled to maintain the desired temperature for the configured elapsed time. The LCD displays hours until dry (eta), relative humidity %, actual/desired temp, and heater duty cycle %. The fan remains on always in drying mode. During dry mode, up/down will adjust the desired temperature, and select will switch to holding mode. If the timer counts to zero the code goes to holding mode.

Holding mode toggles the heater on/off using +/- hysteresis to maintain the set humidity level. The LCD displays "Hold", heating %, actual temp, and actual/desired humidity. The fan turns on when the heater is turned on, and it turns off a few seconds after heater turns off. The up/down buttons adjust the desired humidity %, and the select button will go to off mode. A safety check ensures the selected filament holding temperature is not exceeded in holding mode regardless of humidity values.

In all modes, an LED toggles on/off to indicate that the heater relay is ON. Some display modes show heater %. It is calculated as (on time)/(on time + off time). This percentage is updated each time the heater is turned either on or off.

Adjusting Hysteresis (runtime)

During bootup, if select is held until the splash screen, the code will enter temperature hysteresis adjust mode. In this mode you can use up/down to modify the hysteresis used in dry mode. When done, push select to go to off mode. The modified hysteresis will persist until reboot.

Notes

Since DHT sensors are prone to errors, this code implements an "NAN" value check on the dht sensor readings. By default if more than 5 consecutive NAN's are read, the code will soft reset.

  • Warning: Mains Voltage Work Required!!!

Hacking a dehydrator requires you to be familiar with best practices while working around and designing high voltage devices. As such, this is not a suitable build for a non-skilled electrician. If you burn your house down or electrocute yourself using any ideas from this project, you're on your own. ;)

  • HV wiring

It is recommended that you connect your high voltage lines like this:

                                       --[heater relay]--[heater]--
                                      |                            |
[LINE]-[thermal fuse]---[fan relay]---|------------[fan]-----------|---[NEUTRAL]
                                      |                            |
                                       ---------[RC snubber]-------

Wired in series this way, the fan relay must be activate for the heater to work. This is much safer than wiring the fan relay parallel to the heater relay, which makes it possible for the heater to be powered on while the fan is off.

Most appliances with mains powered appliances with heaters have a thermal fuse installed on or near near the heating element. It is typically located and wired in a way that minimizes live wire length inside the device after it opens (in the above schematic, this short wire run is indicated by a single "-"). For obvious safety reasons, it is best to leave this part of the circuit unmodified. IE, do not bypass the fuse or significantly increase the length of 'line side' wire leading to it. Care should also be taken to ensure proper line-neutral polarity of the mains plug (ie, ensure your 'line' wire actually connects to the fuse, and not the 'neutral' wire). Also, do not use solder on the thermal fuse, or anywhere near the heated areas of the appliance (it will melt).

  • RC snubber

For the Presto brand dehydrator used by the author of this code, and likely other brands as well, motor off switching transients resulted in occasional 'phantom button press' when the fan shut off. The behavior was verified with an o-scope, and an appropriate solution was tested; a 0.22uF+220ohm RC snubber in parallel to the motor wires. For safety it is preferable to use a purpose built snubber device like the Kemet P409CP224M275AH221. Install the snubber as close to the motor as reasonably possible. Accessing the motor on the author's Presto brand dehydrator was impossible without first removing the impeller (and destroying it in the process). Instead, connecting the snubber in a relay/junction box located ~18" from the motor was good enough to fix the problem.

Installation

The files and directory structure are intended for direct use with PlatformIO, but the code is also compatible with Arduino IDE and others. To install, clone and extract this repository to your hard drive, and use PlatformIO to compile the project to your board of choice.