Operation KEG Part 2: Kegbot 101

kegbot_fullsize`
[Image Credits: Mike Wakerly, Kegbot.org]

The Venture Café bar staff recently outfitted one of the taps of the kegerator with a quick-release keg coupler system, documented for posterity in Operation KEG Part 1. This wondrous surgical procedure enables us to serve European beers. Stop by the Café this Thursday to witness the majesty of Eurobeer cascading into Vegware cups from a keg attached to an S-coupler and enjoy a serving or two! With a successful plumbing project under our belts, we decided, naturally, that the kegerator needed a brain. Our vision of the Smart Kegerator involved instrumenting it to collect beer consumption and visitor preference data. Also, if the setup were capable of providing advance warning of empty kegs, the fine fashions sported by the bartenders would remain unsullied by those last explosive burps of beer emanating from the tap.

Enter Kegbot! Mike Wakerly, an engineer at Google and the Kegbot mastermind, first released the open source beer kegerator control system in 2003 and remains the maintainer of the project. The Venture Café Kegerator Enhancement Group (KEG, overloaded acronyms never get old…) would be fools not to use Kegbot as the foundation for our foray into artificial intelligence. Kegbot consists of seven principal components, four pieces of hardware and 3 software applications:

1.Flow Meter: a low-pressure flow sensor installed in the beer line, the SwissFlow SF800 (actually Dutch), measures flow velocities of 0-20 L/minute. Internal electronics emit an infrared signal that is periodically masked by a 3-blade rotor inside the device. The velocity of the rotor and the frequency of the resulting series of pulses output to a cable attached to the sensor are proportional to the volume of beer dispensed during a pour. Since the volume of the keg is known a priori, the amount of beer dispensed can be measured with enough precision not only to anticipate kegs kicking, but also to provide fascinating consumption data. (We expect to observe a strong correlation between pours per hour and real-time visitor ratings once we start collecting them.)
flow-sensors

2. Solenoid Valve (Optional): An electromechanical valve controlled by a relay can be inserted in series with the flow sensor in the beer line to either restrict or grant access to the tap. This capability appeals to those operating communal kegerators who share the cost of beer. Users must authenticate in order to open the tap line and those who drink more, pay more. A number of Kegbotters have reported that the presence of this valve introduces a problematic amount of turbulence in the line, resulting in excessively foamy beer. The Venture Café kegerator vociferously objects to solenoid valves on principle and will be spared the indignity of this feature.

3. Kegbot Coaster: A small (0.7”x 1.5”) printed circuit board, the Kegboard Coaster resides inside the kegerator attached on or near the keg coupler. The Coaster includes a temperature sensor, a connector for the flow sensor cable, electrical connections for the optional solenoid valves, and, of course, a blinky green LED. Power, ground, and data are transmitted between the Coaster and the Controller board over a standard CAT-5 cable that terminates in an RJ-45 connector—in other words, a standard wired Ethernet cable.
coaster

4.Kegboard Controller: The Kegboard monitors temperature and flow sensors (one per tap) and opens and closes the solenoid valves. It can also handle user authentication via a 125 kHz ID-12 RFID reader and play a tune and blink LEDs on command. In the original incarnation of Kegbot, an Arduino, a single-board 8-bit microcontroller beloved amongst the Maker set, plays the role Kegbot Controller. A Kegbot add-on board, or “shield,” mates with the Arduino. The Controller shield shown in the accompanying photo provides power to and collects the temperature and flow sensor data from two Kegbot Coaster boards. The relay controllers for the solenoid valves are also mounted on the Kegbot shield. The Controller communicates with the device running the primary Kegbot software application, the Kegbot Core, via a simple serial protocol sent over a USB cable. (We have taken considerable liberties with Venture Café’s incarnation of the Kegbot Controller, which will be unveiled in Operation KEG Part 3.)

kegboard-blockshero-auth.small
kegboardArduino_UNO_unpacked

5. Kegtab Android Tablet Interface: An Android tablet running the Kegtap app acts as the Kegbot user interface and runs the Kegbot Core, the main control process. Kegtab interfaces the Kegbot Server, a web applications, by accessing the Internet using Wi-Fi on the tablet. Kegtab’s main functions include:

• Monitoring and displaying Kegboard data: communicating with Kegbot hardware, translating flow sensor data into beer pour volumes, uploading drink statistics and temperature readings to the Kegbot Server
• Displaying beer tap configuration data stored on the Server
• Correlating authentication data with drink events.
• Generating new user registrations and drink history reports.
• Taking photos of people dispensing beer with the front-facing camera.

kegbot-xoom_1_display

6. Kegbot Server: The Kegbot Server is a web application that stores all Kegbot data in a database and displays a variety of charts and statistics. The Server enables bartenders to add and configure taps, map kegs to taps, map beers and breweries to kegs, track beer levels in kegs, and take specific kegs in and out of service. It supports both login/password and RFID-based authentication and authorization and generates individual URLs for each drinking session. Images and sound files can be uploaded and associated with individual users, taps, or events (e.g., an annoying buzzer sounding after the bartender dispenses the 3rd beer to a Venture Café visitor). The Server includes hooks into social networking sites and other external websites, as well as a standard JSON API for custom client interfaces. The Kegbot server is written in Python using a subset of the Django framework. It incorporates the Celery task queue distributed message passing protocol to handle interfaces to external web apps and social networking sites, Highcharts for chart and graph generation, the Nginx and Gunicorn web servers, and supervisord for process control and monitoring.

hero-stats.small

In short, Kegbot embodies open source goodness. As inspiring and impressive as it is in its current form, mindlessly cloning the work of others shouldn’t make us feel too good about ourselves. How hard could it be to supercharge Kegbot for Venture Café? It is not, in fact, a Sisyphean task, since one of the bartenders (yours truly) happens to make a living designing electronics. Put on your nerd hat, prepare yourself to throw the dog a bone, and stay tuned for Part 3…

BrimlessBeanieCapWPatchAdultbeagle-hd-logo

Leave a Reply

Your email address will not be published.