## Controlling the temperature of a pot of water

### Controlling the temperature of a pot of water

A few days ago I posted about my library for the DS18B20 temperature sensor. I wrote that as part of a larger project to make a Sous Vide cooker. I needed a way to control the temperature of a water bath to a fairly accurate degree (pun intended).
So, With an Arduino, the temperature sensor and the LCD Shield Kit (from Adafruit), a hot plate and a DIY solid-state relay I have got a system working.
Sous Vide cooker prototype
CookerProto1.JPG (647.44 KiB) Viewed 1252 times

status display
CookerDisplayStatus.JPG (570.36 KiB) Viewed 1253 times

Since the LCD shield uses polling for the buttons (not interrupts) I had to be careful with the loop to not miss button presses while reading the temperature and updating the display. That now works quite well.
But the real problem, as I anticipated, is that the hysteresis of the system is really big. My prototype is now simply turning on the hot-plate when the temperature of the water falls below the goal temperature and turning it off when the temperature is reached. What I intend to do is to adjust the duty-cycle of the hot-plate based on the temperature delta.
I know I can dial that in but if anyone has had to solve this or a similar problem I would really like your input.
Thanks to Adafruit and Arduino and the community for inspiration and the bits and knowledge needed to build this. I'm sure something like this has been made many times by others but I have had a great time pulling myself up by the bootstraps and getting this running!
- Totoro (aka Michael)
And if there is any interest in the code, let me know and I'll get it somewhere for download. But be warned, it's pretty rough!

Totoro

Posts: 9
Joined: Fri Aug 28, 2009 3:05 pm
Location: Hamburg, Germany

### Re: Controlling the temperature of a pot of water

What I intend to do is to adjust the duty-cycle of the hot-plate based on the temperature delta.

What you are describing is a "Proportional Controller". That is the "P" part of a "PID Controller" (Proportional/Integral/Derivative). There are quite a few Arduino implementations of PID control. You should be able to find several at http://arduino.cc/playground/. For many simple temperature control applications, proportional control is sufficient and you can ignore the "I" and "D" terms of the controller.

Posts: 16027
Joined: Sat Feb 07, 2009 9:11 am

### Re: Controlling the temperature of a pot of water

Thank you! Indeed, there are many PID implementations to investigate and choose from. The fun begins anew.
Also, thank you for the LCD Shield. That made the input/output part of this so easy.
- Totoro

Totoro

Posts: 9
Joined: Fri Aug 28, 2009 3:05 pm
Location: Hamburg, Germany

### Re: Controlling the temperature of a pot of water

Just an update. The PID was indeed what was needed. And I got to learn about something new! I posted about this project on my site at http://vondervotteimittiss.com/belfry/?p=108. I also made the code available. Just scroll to the end of the post. (Comments are very welcome!)
Thanks again!
- Totoro

Totoro

Posts: 9
Joined: Fri Aug 28, 2009 3:05 pm
Location: Hamburg, Germany