# Building a temperature-controlled water bath

I want to build an accurate (±2 °C) water heater (sous vide) that heats water somewhere between 30-100 °C according to user input.

Although I have an engineering background I have no experience whatsover with building controllers and have no clue on how to start. I don't want to spend to much money on the project (< 100 €) thus money is an issue. The good thing is that I already have a power thyristor.

What I (probably) need:

• Temperature sensor PT100
• Input device to define water temperature (digital?)
• Controller (PID?)
• Resistor to heat the water (can be taken from old water cooker I assume)

My question is how I can best make the link between the sensor and the heating element. I of course need to build/program a circuit that does this but do I make an analog or digital circuit?

I have a thyristor but is this really necessary or should an on/off regulation also work? Don't forget that I also should be able to define the water temperature.

Any help is greatly appreciated (also useful links).

-
 Here's a nice sous vide implementation that may give you some ideas. flashingleds.net/sousvader/sousvader.html – Russell McMahon Jan 23 at 16:53

I just put together a sous-vide setup with a commercial PID. Originally I had planned on using a crockpot/slow-cooker, but was able to pick up an indoor turkey fryer via a post holiday sale.

My setup & costs:

1. JLD612 PID temperature controller ($33.50) 2. PT-100 0.1 degree Thermocouple ($19.00)
3. 40A Solid State Relay ($16.50) 4. Indoor turkey fryer ($25.00)

The JLD612 is pretty much self-contained, and has displays for current & target temperatures. It also has an auto-tune feature that configures the PID parameters for your particular setup. A downside is it's workings are a bit of a black box -- you don't really know what's going on inside. On my To-Do list is to build a combination PID/data-logger on the Arduino platform.

FYI, Make Magazine just had a Sous Vide Immersion Cooker project using a similar PID controller.

-
 very helpfull. Will look into it – Tarscher Feb 9 '11 at 8:46

You can build this with a very simple op-amp comparator circuit:

This uses a thermistor as the temperature sensor, and a potentiometer as the thermostat setting. You then just need to hook up your heater to the relay's switch contacts.

You'll just need to calibrate your pot by testing the water temp with a thermometer in different positions of the pot.

The parts should cost no more than around €11/£10/\$18. You can power it with an AC adaptor (might be a good idea to add a 470uF capacitor across the supply as well. You can then use the rest of your budget for the heater.

-
You'll want some hysteresis on that comparator or your relay will chatter at the setpoint. This is an excellent solution though. It's cheap, it's effective and it works. – Andrew Kohlsmith Feb 1 '11 at 14:39
thanks for the answer. How would I design that hysteresis (it should be more than 2 C)? – Tarscher Feb 1 '11 at 16:10
I think you'll need to add a schmitt trigger to it, which will basically set the 'on' threshold lower than the 'off' threshold. – BG100 Feb 1 '11 at 16:18
I'm pretty sure the way to do that is to add a resistor between the output of the op amp and the non-inverting input. I'm not sure of the value of the resistor though, it might be a good idea to use a variable resistor here so you can adjust the difference between the on and off thresholds. – BG100 Feb 1 '11 at 16:49

BG100's solution will work as a temperature controller, but I don't think it will hold temp within ±2 C unless the volume of water you're heating is fairly small. Water has a lot of thermal capacity and heats up and cools off slowly so it will probably overshoot the set temperature.

Are you building a sous vide cooker? If so, an easier way to do this, especially with that budget, is to look for a PID temperature controller on one of the surplus sites like All Electronics, surplusdirect, etc.

If you want to build it yourself, you can do it much cheaper though.

Where to start? Well first do a little research on Proportional control loops. It's simple: basically read the current temperature, subtract your setpoint temperature and use the difference to control the output. In this case the output control can be how long you turn on your thyristor for (duty cycle).

This can be accomplished with an Arduino or a Teensy (I prefer to just wire up raw AVRs since it's easy and they're much cheaper) and an analog sensor like the easy to use LM35 mentioned earlier, or a digital sensor like a MAX6675. You can set the desired temperature with a rotary encoder and use an LCD display for feedback. Even easier is to use an analog input to read a potentiometer that has a dial behind it.

Proportional control will result in an offset from the setpoint. If it's small enough you can ignore it, or if it's constant, then you can calibrate the setpoint "dial" to allow for offset. Otherwise, you can add an Integral term to your controller. I'm going to stop here because there are many references online that can explain basic control theory better than I probably can. But I hope you get the gist of it.

What you're trying to do isn't too difficult and makes for a fun little project and a great learning experience.

-

1. Kill a water heater and use the heat element, this can then be PWM:ed from a mcu with a relay in the middle. (You may need to think about how big pwm window your system needs.)
2. Temperature sensor, there is a lot to choose from. But anything that your mcu can use would do just fine.
3. A mcu with a potentiometer and a small display to show the current temp.

What mcu to choose is up to you and this forum has a lot of advice on that topic. (Maybe a AVR or a PIC?)

Then to program the mcu you can read a good article on the topic, PID without a PhD.

And then you trim the pid parameters and decide if you need a fast or a heating process.

Good luck.

-

I would use an arduino as a controller, it is probabably the easiest for a beginner. A LM35 may be ok in a wet enviroment up to 100 C but you might also consider a temperature dependent resistor or thermistor. To control the power a relay might be a good choice ( old microwave ovens can give you these and parts for a power supply ) Coffee cup heaters are a pretty good source of heaters that are well sealed against water or if you can use the whole device an electric kettle, croock pot or similar may serve. You want to keep the high voltage away from the low voltage, in part for your own safety. If you use semiconductors consider an optical isolator for this purpose.

-
 agreed on arduino and lm35, was just typing basically the same answer. , – posipiet Feb 1 '11 at 13:38 An advantage of this route is that you can set it up to output the temperature over a serial port and during development connect a PC to take data which you can plot to evaluate its performance. – Chris Stratton Feb 7 '11 at 15:10