Sous-vide
After a relatively long hiatus here's a somewhat larger project. This is yet another take at the DIY sous-vide scene, though in a more polished form than I've typically seen before. For those reading this that don't know what sous-vide is; very briefly it is the cooking of food at the desired finished temperature using a water bath with the food in some type of sealed plastic bag. This is really nice because it allows for the food to be completely cooked homogeneously, that is to say a rare steak will be equally rare all the way through. (Which really can't be done in a typical environment where the heat source is far higher than the ending temperature, eg. a skillet, oven etc). Think of sous-vide as an ultra-slow-roast.
Essentially, what has been done here is a black box sitting between a rice cooker that measures the temperature of the water bath and controls the output power to the rice cooker. This is done using a DS18B20 temperature probe (0.5° absolute accuracy, OneWire serial protocol) which is read with an Atmel ATMega 168 which has (among other things) a standard digital PID controller with some added functions for anti-windup and derivative smoothing. The output from the controller drives a solid state relay (SSR) that controls the power to the rice cooker. Now, there's a lot more that the microprocessor does as well such as offering a menu system on an LCD panel where the end-user can adjust the setpoint temperature, PID controller coefficients, a system timeout and so on.
There is also an additional daughterboard in the enclosure that's used for the user interface, a custom developed capacitive rotary encoder / 7-way navigation button. This device measures the capacitance of 7 pads on the front side using a charge transfer scheme, where the capacitance of each pad is measured by comparing it to a reference capacitor and the number of cycles required to move a charge from the measuring plate to the reference capacitor. (See here for a similar system, however instead of measuring the discharge time I'm just measuring the number of cycles required to reach a logic transition on the AVR's input pin). From a user perspective this allows for navigation by pressing a button (such as up/down/left/right) as well as dragging one's finger around that can be used to eg. change a variable. The encoder mode gives out 12 counts per revolution and the user doesn't have to do anything to switch modes, it detects whether a single button was pressed of if a rotation is occurring.
Initial tests have shown it to work quite well, after an initial settling period of 15 minutes or so the water is kept to within +-0.3 degrees celcius of measured temperature, which seems to give good enough performance. Also, as the temperature fluctuates fairly evenly around this at a period of 5-10 minutes this should be very well evened out inside the food being cooked, essentially limiting the accuracy to that of the sensor which is rated to have an absolute accuracy of better than 0.5 degrees celcius.
There's been a lot of pre-work developing parts here that can be of use for later projects as well, such as a basic library for the DS18B/S20, ring buffers with arbitrary contents, a PID controller, a relatively portable menu system, not to mention the capacitive rotary encoder, which was quite a project in and of itself.
All eagle files, source code and so on for the sous-vide system are available here under a GPL3 license. All eagle files, source code and so on for the capacitive rotary encoder are available here, also under the GPL3 license. Finally, there is a document describing how to interface/integrate the capwheel unit here.