Home > Electronics > Thermostat Replacement For Kegorator

Thermostat Replacement For Kegorator

February 26th, 2012


I had experimented for some time with a peltier based heat exchanger to cool beer from my kegs (home brewing), but after a few iterations, I felt the system would not be as compact as I hoped, and the peltier was eating up too much current (80W).  Here’s the unit  – heatsink, peltier, and big block of metal that would be placed in a water bath.  I have 16ft of stainless steel tubing that wraps around the block for the beer to flow through.  I had the unit in a bucket surrounded by expanding foam for insulation.   Ultimately, it was ugly.

I finally gave in, and decided to buy a dedicated fridge for the kegs instead.  I found a neighbor selling one of the right size across the street (very convenient).  He was the nth owner, and it was a commercial unit with a nice stainless steel exterior.  However, after getting it home, it seemed apparent that the thermostat was useless.  It would turn on randomly and off randomly.  I figured I could fix this, but my goal was to spend no money.  Also, the thermostat has this meal tube that goes into the wall of the fridge – and it seems permanently attached, so I wasn’t sure how feasible it would be to replace the thermostat if I had to take the entire thing apart to replace that tube.


After looking through my pile of PCBs that I could repurpose, I came across my Texas Instruments LauchPad that I picked up at ESC.

The thing that makes this unit amazing as compared to the arduino is that it costs $4.30.  The thing that sucks is that the target MCU is a POS and really didn’t have enough ram/flash for my liking.  However, after looking at the schematic, the IC at the top left of the picture caught my eye.  It’s a MSP430F1612, and it is used as a programming interface for the target IC.  Unlike the target MCU, it’s very nice and had all the features I wanted.  It’s powered off USB (5V) but has a 3.6V regulator onboard.  This surprised me a bit as this is the max voltage the MSP430s run at, with 3.3V being more logical, and what I would have expected.  Additionally, the header exposed 4 of the I/O lines which are used to interface (program) the target MCU.  This was the minimum I needed to implement a temperature sensor, a display, and to control a relay to switch on the refrigerator compressor.

I love how appliances have wiring schematics on them these days (though I had to remove the condenser coils to access it).


Both neutral and line voltage (120VAC) are present at the location of the thermostat, and a simple relay is sufficient to drive it.   Oddly enough, the lamp switch was present but unused in the fridge (so it was always on – was probably a design mistake as the door never made contact with the lamp switch anyhow).   Not surprisingly, the bulb was burnt out.


The relay replaced the thermostat (pins 3,4 in the photo).  And a wall adaptor for my old cell phone which presented a 5V USB interface was used to provide power.  It was connected to the BLU wire and the WHT wires in place of the lamp.

imageThe schematic for the lauchpad is provided by TI, which was nice.  The header I interfaced was J3. If you look, you’ll find that pins 5.1, 5.2, 4.7, and 4.2 are all connected through R5 to SBWTDIO.  Setting all but one pin as an input, and using the output pin worked fine.  Additinally, pin 5.3 connectes to SBWTCK (with a pulldown resistor which we can ignore if we are driving the pin).  Finally, we have the a serial interface on pins 3.7 and 3.6.

The header on the top left (you need to add pins) provide the programming header for the MSP430F1612.  There might be some way to program it from the USB port, but as I had the programmer, it was fairly easy.

The interface I  built was super simple, but looked ugly as it was a mass of wires handing all over.  Here’s the schematic.


Starting from the top, an IO is used to switch a darlington which turns on the relay.  Again, I just used what I had lying around, and it was able to switch the relay at 2V, which was good.

I have a number of SHT75 temperature and humidity sensors lying around that require a clock and data line to interface.  Additionally, the data line requires a pullup resistor, but the MSP430F1612 doesn’t have any so an external one was added.  They have some horrible example code that I ported over and after a few tweaks I was able to get it to work.  One tricky bit is that the data line should never be driven high – when the code wants it to go high, set it as an input so that the pullup resistor pulls it up.  For some of the messaging, you need to watch that line and see when the SHT75 module pulls it low.

Finally, I got lucky and had an LCD with the SerLCD module from sparkfun mounted.     It lets you use a serial line to drive a serial interface, dropping the I/O line requirements from something like 8 to 1.

I recently got an Ultimaker which is cool, but the documentation sucks sucks sucks sucks for a commercial product.  I need to spend the rest of the day today taking apart the print head and which is encased in melted plastic to add some teflon tape to prevent the plastic from oozing everywhere.   In any case, I was able to print out an enclosure for the device, and for the most part, it works fine.  Not having any additional input lines, I have no way to adjust the temperature setpoint without pulling the board out and reprogramming it.  It’s currently set to turn on at 45 deg F and off at 40 deg F, which seems a reasonable temperature range for beer.  Here are some photos of the unit operating.


The temperature probe is taped to the back of the fridge.


Yes, humidity is pointless in this application, but I had enough space on the LCD.


It’s still a mess, and I would like to remake the enclosure so it’s a bit nicer and it fully hides all the wires.  Feel free to contact me if you want a copy of the firmware.

Electronics ,

  1. No comments yet.
  1. No trackbacks yet.