Sunday, April 14, 2013

Arduino Based Kegerator / Keezer Build

So I decided it was time to build a kegerator... Due to space (front to back depth) constraints in my garage I couldn't use a normal fridge/freezer like I wanted, so I had to use a chest freezer.  I needed something less than 25" deep and with a bit of research the GE 7 cubic foot chest freezer - Model FCM7SUWW - fit the bill perfectly.

It will fit 3 home brew / ball lock corny kegs on the bottom (the 4th one just BARELY doesn't fit), and with a 10" collar you can fit another on the hump.

More importantly, because I'm a nerd and I've never worked with an Arduino I decided it would be fun to play with one.  I ended up with an Arduino controlling an LCD for each of the 3 taps I installed, displaying what beer is on tap and how much beer is left in the keg.  For funzies I added a couple temp sensors, one to measure the keezer temp, and one to measure the outdoor temp (I plan to move this to my deck in the summers)

I also decided I wanted to do this without making any permanent modifications to the chest freezer so I can easily put it back to original condition.

  1. Buy a chest freezer and all of the keg equipment (CO2, regulators, taps, etc.).
    1. I used 12' of 2x10 to build my collar, making it tall so I could fit another keg on the hump if i needed, and to give me room to install the taps/LCDs.  Measure and make sure you get what you need.
    2. I used L brackets to help assemble the collar and make it more sturdy.
    3. I used a 80mm computer case fan and an old 12v AC adapter to circulate air so the air temperature is consistent across the entire keezer.
    4. I also used two Eva-dry E-500 dehumidifiers to prevent puddles in the bottom of the kegerator
  2. Buy a temp controller that can regulate the temperature of the chest freezer at beer temps, I used the STC-1000 which is a popular choice for this task.
  3. For my Arduino build I used:
    1. Arduino Mega R3
    2. Ethernet Shield
    3. 16gb Micro SD Card from an old phone
    4. 3x Flow Sensors
    5. 6x 1/2" to 1/4" adapters
    6. 3x LCD's
    7. 2x DS18B20 Temp Sensors
    8. 2x Breadboard / jumper wire / 22 gauge regular wire
Tools Required:
  1. Circular, table, or miter saw (I used a miter saw)
  2. Jigsaw to cut the LCD holes for the LCD's
  3. Router w/ Rabbet bit to make the LCD fit in the hole flush (I used 1 & 3/8, 1 & 1/2 would have been easier to work with, the LCD's just BARELY fit)
  4. Drill w/ 1" spade or forstner bit to drill holes for the tap shanks
  5. Soldering iron for the Arduino work

Getting started:
  1. Build the collar
    1. Using the chopsaw I cut my lumber to the dimensions I needed (20.75" on the sides, 37" on front & back), using Miter cuts so it would look clean
    2. With all the cuts made I test fit my collar to make sure it was perfect
    3. To make life easier, before assembling the collar I did all of the work to the pieces
      1. Drill the holes for the taps
      2. Drill a hole in the back for wires to pass through, including power for the arduino and fan, and a temp sensor. Later we will caulk this hole.
      3. Use a Jigsaw to cut a hole for the STC-100 Temp controller
      4. Use a Jigsaw cut the holes for the LCD screen
      5. Because the LCD is smaller than the PCB it is attached to I used a router to carve out the back side of the 2x10 so the LCD would be flush mounted in the board.  
    4. Apply wood glue to each miter cut, assemble the collar and line it up just the way you want it and use a ratchet strap (I saw somebody else do this, great idea) to hold it together and keep it square while the glue dried.  I did mine directly on the keezer so I could control exactly how it lined up.  I wiped up the excess glue after a few minutes, and then again the next morning.
    5. For added strength, once the glue dried I cut some 1.5x1.5x8 strips and screwed them in to the corners, letting them hang a little low in to the freezer to help hold the collar in place.  This seems to work quite well.  I didn't account for the freezer lid fitting properly so I had to remove them, cut them an inch shorter, and reinstall.  Make sure you pay attention to that :)
    6. I applied the first coat (of two) of primer to the inside and while that dried I tested the temp controller
    7. To wire the STC-1000 I removed the side plate from the freezer, popped out the built in controller, disconnected all the wires from that, and wired it like so (I used butt connectors on the freezer side to tap in to the existing wiring without having to modify it):
      1. Black from power plug - Pin 1
      2. White from power plug (shared with white to compressor) - Pin 2
      3. Black to compressor - Pin 7
      4. Jumper wire from Pin 1 to Pin 8
      5. It works :)
      6. I put 2 coats of primer on the inside, and then stained the outside:
  2. With the collar built it's time for final construction.  I ran 3/16" white weather stripping around the top of the freezer and then installed the collar with the original hinges making it easier to get kegs in, and purchased generic indoor door hinges to attach the freezer lid to the collar.  I drilled a couple new holes in each door hinge to match the layout of the holes on the original lid.  When I want to open the main collar I have to be careful because the lid falls open, so I use a piece of tape to temporarily hold it shut.

  3. I ran all the wires and stapled them (BAD idea, the staples ended up bridging some of the smaller wires so use tape instead) to the inside of the collar, and then cut channels in the back of the styrofoam so it would fit flush, then attached a second piece over the first so it is well insulated.  I used  the expanding spray foam stuff to insulate the back of the LCD's and hold them in place.  Don't get it on your hands, it's suuuper sticky and impossible to get off.

  4. An 80mm PC fan to help circulate air so the temp is consistent from top to bottom, and a mini breadboard to easily connect the flow sensors to the Arduino.  This is important, without it the top of the freezer is considerably warmer than the bottom and the beer pours foamy (I turned it off to see how much of an affect it has, and it's quite drastic).

  5. And a final view of the rats nest / co2 tank.
  6. The last thing I did was put one of the baskets in the freezer (I stacked them together), which works great for holding chilled glasses. It currently rests between the power controller on the front and the sytrofoam on the back, but I plan to come up with a more permanent solution.
The final product, ready to be moved to the deck.  I haven't decided what to do for a drip tray yet.


To simplify debugging I built the Arduino in stages.  First I worked with the LCD's, figured out how the pinouts worked and how to address them.  I read a post about which pins could be combined but had other issues and ended up running all of the wires directly to the arduino (except power, those all went to the breadboard).  I did combine the contrast pins so one pot can control them all. Then I attached the flow sensors, and modified the sample code from adafruit.  I simply blew through a flow sensor to make the wheel spin and test it. Once I had that working I fully wired the 3 LCD's on the kitchen table just the way it would be installed, and then carefully moved it to the collar and put it in place.  One at a time I positioned each LCD the way I wanted it, and then used expanding sprayfoam insulation to insulate and hold it in place (be careful, don't pack it in too much or it might ooze in to the LCD display).  

For the collar to hinge I had to put a breadboard in the back corner so the flow sensors wouldn't be pulled on when the lid was opened.  The flow sensors terminate to the mini breadboard which has jumper wires to the main breadboard and arduino input pins for the flow sensors.

Finally, I wanted the Arduino to be fully self contained, so I used a webserver (available in the comments on this page) for configuration, and an SD card for persistent memory.  This was tricky to work with, at one point I broke the webserver by using pin 51 for a flow sensor, which interferes with the ethernet module. whoops.

Once I finish the code I will post it.  In the meantime if you would like a copy contact me and I'll be happy to share it with you.