Close

First Update

A project log for MIMO kegerator

A "kegerator" that can keep my beer cold and allow me to ferment my beer at precise temperatures using a MIMO (state space) control design.

scottScott 08/15/2018 at 00:300 Comments

I have been working on this project for the last month.  This first post is intended to document my progress.

I have purchased a small top open freezer and placed it in my garage.   (Make/Model:  Idylis 7.1 cu ft chest freezer)   I will be using this freezer to regulate the temperature of my keg/carboy.  I live in Texas so it is hot the majority of the time.  Initially I am planning on focusing my efforts on controlling the temperature of my freezer to cool my beer/carboy as needed.   The electronics I have designed will allow me to integrate a heating coil at a later date (i.e. in the winter!)

I purchased a small household scale and ripped out the electronics and soldered a cable to the wheatstone bridge scale elements.  (Make/Model:  Taylor 7042T)  The scale will sit in the bottom of the freezer and I will use it to calculate how much beer is in my keg as well as the specific gravity of my brew as it ferments.  To get the required resolution of the beer as it ferments I designed a unique analog circuit that implements a differential amplifier with a 12 bit digital to analog converter and 8 bit analog to digital converter to give a combined 20 bit resolution on the output of the scale.  I will update this page with information on my circuit design shortly.

I am using a Teensy as the micro controller to implement my control algorithm.  I have designed a custom interface board that allows my to plug my Teensy into the analog/digital circuitry to read my scale and four temperature sensors as well as be powered and communicate with a raspberry pi 3+.  The four temperature sensors each have a three wire digital interface.  (Make/Model:   Maxim Integrated, DS18B20+)

The Teensy will do the real time control of turning on and off the freezer to stabilize at an optimum temperature.  One of the temperature sensors will go into a thermowell that sticks down into my fermenting beer.  Another sensor will be integrated into an elastic strap that will go onto my keg once my beer is brewed.  Either of these temperature sensors will be the temperature input into my control system.  A third temperature sensor will measure the ambient temperature in my garage.  This will be the "disturbance" input.  The fourth temperature sensor will measure the ambient temperature in my project box that will be mounted on the wall and contain my electronics.  

Because I have two temperature inputs into my control system I will be able to teach myself how to implement a state space "MIMO" control algorithm.  (Super exciting!!!)  :-)  

The project box uses a din rail that I have mounted onto the metal plate in the back of a "Bussman" box.  On the din rail I have attached a 5V power supply (3A) that I am using to power my raspberry pi and Teensy micro controller and two 5V fans that circulate outside air through the project box.  I have two solid state relays that allow me to turn on and off 120V power.  (Make/Model:  Inkbird SSR-25DA)  One of the solid state relays will provide power to the freezer the other I am going to use to power a heating coil (when it gets cold outside).

That is about it for now:  The circuit to interface with the scale and temperature sensors has been designed and fabricated onto a OSHPark PCB.  The pcb has been integrated into the project box and connected to my Raspberry Pi.  I can read from all temperature sensors and the scale and turn on power to either output.

Now I need to program the thing:    My plan is to initially use the Raspberry Pi to provide a direct interface to the Teensy.  The Teensy will be programmed to do nothing other than read temperatures, the scale and turn on and off the freezer on command.  The Raspberry Pi is being programmed to act as a TCP/IP converter so that temperature/scale and freezer control can be controlled remotely from a copy of Matlab on my Mac.  I am going to use Matlab to model the thermal characteristics of the freezer and insulation so that I can get the model of my control system defined.  Once I have that I can then design my control algorithm and initially implement it in Matlab so that I can proof it and tweak it easily.

Now that progress to date and path forward have been documented I will see about uploading more pictures, schematics, and bill of material.

Discussions