Smart Kegerator

Discovery Channel Canada’s “Daily Planet” segment: https://www.youtube.com/watch?v=ENPVkKDqYiE (very similar to the walkthrough above)

Update 7/31/2015:

New installation guide has been posted here:
https://philsprojects.wordpress.com/2015/07/31/smartkegerator-v2-installation-guide/

 

The purpose of this project was to allow my roommates and friends to be able to drink as much beer from the kegerator as they’d like, without guesstimating who owes what when it comes time to refill the kegs. The system uses two flow meters in the beer lines to detect when beer is poured, and once a pour has started, the raspi camera module turns on to run facial recognition (disabled when I shot this video) and charge the appropriate user for their beer. I wanted the system to be as passive as possible, requiring zero human interaction (no RFID cards, no selecting the user every time) but to record all pours and how much was poured. So far the system is running great, minus that accidental spill because my tap handles are too close together 🙂

Eventually I’d like to use weight sensors under each keg to get a better estimation of keg volume, and use a liquid probe thermometer to better estimate the temperature of the beer instead of the air. I’m also moving to a NOIR pi camera module after finding it had much better low light performance, and I’ll probably add some IR lamps to help illuminate the face for recognition when the lights are off. I also need to mount the camera a bit better, ideally higher and a littler further behind the tower, but the flex arm tripod worked great for this first implementation.

I’m also working on a new UI that will probably look something like this:

Mock up UI v2

Mock up UI v2

The source is currently avilable at https://www.assembla.com/code/smartkegerator/subversion/nodes/ but it’s certainly not finished or polished.

The UI is written in QT and C++, using python scripts for the gpio flow interrupts (the c++ interrupts seemed unreliable,but python’s implementation worked perfectly) and the C loldht script found on these forums to read the temp from the temp/humidity sensor.

I’ve made a quick and dirty fritzing image to illustrate the connections, but I’m not very good with frizing so I’ve included text as well.
KegeratorSchematic
On each flow meter, I connected the red to the pi’s 3.3v, black to ground, and the yellow pin to GPIO #23 and GPIO #24 for left and right sides respectively.
The temperature sensor, looking at the front of it (the side with the holes) the pins go left to right 1-4. Pin 1 to GPIO #17, so that I can turn it on/off by writing power out on pin 17. Pin 2 to GPIO #4. Pin 3 to ground. And lastly put a 4.7k ohm resistor between pins 1 and 2.

Parts:
Rasperry pi
http://www.amazon.com/RASPBERRY-MODEL-756-8308-Raspberry-Pi/dp/B009SQQF9C/ref=sr_1_1?ie=UTF8&qid=1394450356&sr=8-1&keywords=raspberry+pi

Mimo 720S display
http://www.amazon.com/Powered-Slide-out-Touch-Screen-Monitor/dp/B002QFP4Z8/ref=sr_1_1?ie=UTF8&qid=1394450430&sr=8-1&keywords=mimo+720s

Powered USB Hub
http://www.amazon.com/gp/product/B005A0B3FG/ref=oh_details_o05_s01_i00?ie=UTF8&psc=1

DHT22 temp/humidity sensor
https://www.adafruit.com/products/385

Flow meters
http://www.adafruit.com/products/828

Pi Camera module (NOIR seems ideal for low light)
http://www.amazon.com/Raspberry-Pi-Camera-Filter-Vision/dp/B00G76YEU8/ref=sr_1_1?ie=UTF8&qid=1394450401&sr=8-1&keywords=raspberry+pi+noir

100cm SPI cable (raspi camera cable)
http://www.ebay.com/itm/141129552486?var=440222309796&ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

Camera housing
http://www.amazon.com/gp/product/B00E1UOXMQ/ref=oh_details_o06_s00_i00?ie=UTF8&psc=1

Wide-angle lens
http://www.amazon.com/gp/product/B009NED5E2/ref=oh_details_o00_s00_i00?ie=UTF8&psc=1

Techflex cable sleeve(I think it makes the raspi camera cable better looking)
http://www.amazon.com/gp/product/B007VT6HSC/ref=oh_details_o02_s00_i00?ie=UTF8&psc=1

For the gpio breakout:
10 pin ribbon cable
http://www.ebay.com/itm/281152427395?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

10 pin connectors
http://www.ebay.com/itm/171047381713?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

protoboard from radioshack
http://www.radioshack.com/product/index.jsp?productId=2104052

References:
Mimo 720S solution – http://www.raspberrypi.org/phpBB3/viewtopic.php?t=27781
Raspberry pi camera to opencv/facial recognition – http://thinkrpi.wordpress.com/opencv-and-pi-camera-board/

More info coming soon!

Pandora controlling Google chrome plugin

I recently moved away from the OCR method of reading data from pandora, and moved to a google chrome plugin. This has the downside of requiring chrome to be running, but it allows infinitely more control.

I’ll do a better writeup soon, but following files make up the plugin:

manifest.json
http://snipt.org/MaPj4

background.js
http://snipt.org/MaQf9

pandoraController.js
http://snipt.org/MaOc8