Note: For an updated version with simpler code and important information about hardware issues see this new post: Arduino Sous Vide, Version 2
Heavily inspired by an old blog post by the brilliant Seattle Food Geek, I set out to build an arduino powered sous vide / thermal immersion circulator machine. Instead of a PID controller, it uses an arduino with a relay + waterproof thermistor. A little less sexy, but just as effective with the added bonus of being modular with reusable parts.
- Sterilite® Ultra Latch 17 L container $4
- Made of polyproplyene, softens at ~155°C according to the Merck index, melts at 165°C; perfect for our application of temps < 100°C.
- Avoid long term exposure to UV light as paranoid precaution against degradation
- You can simply use a big pot instead of the plastic container. I Outlet boxhave an enamelled cast iron pot that is excellent for maintaining a steady temperature.
- Arduino (I’m using UNO rev3) $35
- Waterproof temperature sensor / thermistor (DS18b20 ) $2.03
- This thermistor is waterproof but not rated for full immersion
- I sealed mine in a small bit of plastic with the vacuum sealer. problem solved
- See previous post for how to calibrate
- Immersion heater (2x) $13
- 3 prong power cable free if sacrificed, otherwise $6+
- 5V 1 channel relay $1.36
- This relay is really cheap and was starting to fall apart on me; I substituted it with another one I had laying around. YMMV
- Aquarium water pump 80GPH $6.88
- Ziploc V150 vacuum sealer system $30 (on clearance at Target)
- GFCI outlet $12.30
- Outlet faceplate $1 (optional)
- Outlet box $0.50 (link is to pack of 100, cheaper to buy in store)
- Wire coat hanger / safety wire
- Large binder clips (2x) $0.50
- Male to female (3x) and male to male jumper wires (the more the merrier) $2.00
- A 4.7 k Ω resistor for thermistor $0.05
Grand Total: $114.62 if you buy everything. You can add an extra heater or two if desired. I found that two alone work pretty well. My units have been calculated to heat at about 0.01 C per second, taking an hour to get up to an average cooking temp of 65C from room temperature water.
Step 1: Building the relay
The first step is building a functioning relay. The beauty of this sous vide machine is that it is comprised of parts that can be cannibalized and put to other uses when you’re not sous vide cooking. The relay is especially cool as it allows you to control high voltage devices from the measly 5V microcontroller of the arduino. The options from here are limited only by your creativity and/or depravity. (Lots of options of pairing it with motion!)
I followed a Sparkfun tutorial on how to build a Controllable Power Outlet. Quite frankly, there is no need to rehash something that is described better there. Check it out.
Here’s a diagram for the relay listed in the parts list. You can figure it all out from this picture alone.
Step 2: Testing Relay
Controlling a relay with pyfirmata
Controlling the relay is incredibly easy with pyfirmata. It’s as simple as turning a pin on and off to open and close the relay. If you know how to switch a LED on, you can control a relay.
Here’s some example code to function test it.
import pyfirmata port = '/dev/ttyACM0' board = pyfirmata.Arduino(port) it = pyfirmata.util.Iterator(board) it.start() pin4 = board.get_pin('d:4:o') while True: ui = raw_input("Enter 'on' or 'off': ") if ui == 'on': pin4.write(1) elif ui == 'off': pin4.write(0) else: pass
Plug your relay into the arduino, plug your arduino into a PC and test it out by plugging in your relay controlled power outlet and lamp into the outlet.
That’s all there is to it. It’s only a small leap from here to put some devices online that you can control remotely. (Check out X10 for anything beyond a few devices).
Building a feedback loop with a thermistor and using thermostat-like hysteresis curves for controlling the immersion heaters.