
A "kegbot" is essentially a kegerator with a brain. It has two primary purposes:
Authenticate beer drinkers. No more random people stealing your precious beer. Kegbot locks the system until a user provides valid authentication, at which point the user may pour a beer, then the kegbot again disables the system.
Track beer drinker's consumption. This may be used for good or evil. Each time a user pours a beer, the volume of beer is stored in a database along with the user ID and a timestamp. This allows for all sorts of fun statistics like the user's BAC (blood alcohol content). Of course the kegbot should not be used to encourage drinking large quantities of alcohol, nor should it be used to measure BAC to determine ones ability to drive.
Mike Wakerly is the creator of the original kegbot, born circa 2003. Several other variants of the original have been built since then, including ours.
After Mike helped the guys at From the Shadows build and deploy a kegbot for DEF CON 13, Kevin Mahaffey (of FTS) and myself decided we wanted one.
Any refrigerator that will fit a keg of beer will work, and we happened to have an extra full sized fridge. It can fit one full keg plus one smaller keg, so we went for a dual kegerator / kegbot system.
Beer doesn't just need to be cold, it needs to be carbonated. Oxygen will spoil beer quickly, so a CO2 system is required to keep the keg pressurized and carbonated. The CO2 system consists of a tank of compressed CO2 gas, a pressure regulator, a tap for the right type of keg, a faucet to pour the beer from, and plenty of tubing to connect it all together.
Inline with the beer tubing, we place a solenoid valve and a flowmeter. The value is activated by 110 VAC (dangerous stuff!), which is controlled by relays, which are controlled by transistors, which are controlled by a microcontroller (the "brain"). The flowmeter is also connected to the microcontroller to report the volume of beer flowing. Eventually we will need to add optocouplers to eliminate electrical noise from the solenoids as well.
The authentication is handled by a standard HID Prox RFID reader, which is also connected to the microcontroller. A simple ASCII character based protocol was designed for easy communication between the host computer and microcontroller.
We chose the Microchip PIC18F4550 series of microcontrollers largely because of the built in USB support. We use Microchip's USB CDC library to emulate a serial device over USB. This makes it very easy to interface with a variety of platforms and programming languages.
On the software side of things, the microcontroller's firmware is written in C and compiled with Microchip's MPLAB C18 compiler. Any language with libraries to communicate with serial devices could interface with our kegbot, but we chose to use Ruby. The host software communicates with the microcontroller, handling requests for authentication and collecting data.
Unfortunately, while our kegbot is nearly complete we have run into issues with electrical noise from the solenoid valves causing problems in the microcontroller and don't have the time to troubleshoot right now. Some day...