Introducing Barduino – The Ruby Powered Bar Monkey

On October 10, 2008, I presented on the Ruby Arduino development framework, RAD for the Orlando Ruby Users Group.  After two years of attending ORUG, I decided it was time to make my contribution back to the community and that contribution was….

Barduino Introduction
(Photo credit: Anthony Eden)

Barduino is an Arduino based bar monkey implementation.  To sum up a bar monkey, it’s typically a computer control drink dispensing system.  The Arduino, a very cost effective physical computing platform was the perfect base for the Barduino.  And the ability to work with a language I’m comfortable with, Ruby, to write the software that runs on the Arduino made this a relatively simple project.  All of this being made possible with the Ruby Arduino Development Framework.

So first off, let’s take a look at the Barduino in action:

So how was this accomplished?  You can take a look at the source code over at GitHub.

Here’s the basic breakdown of what the Arduino is doing:

  • Verify there’s a glass sitting under the dispense area.  This is accomplished with a photoresistor that detects light
  • Verify the Arduion has a serial connection for it to receive commands
  • Listen for either a “1″ or “2″ being send to the board over the serial line (via the USB port)
  • If a “1″ or “2″ is received, call the dispense method pass it the pump it needs to turn on
  • Dispense a single ounce of liquid on the given pump and return back to the main loop

So now we have the Arduino programmed and ready to go, but how do we send those characters over the serial port to actually make some drinks?  With a domain specific language written with Ruby of course.  In the case of the Barduino, you have the Barduino-tender.  You build a recipe in a very elegant Ruby like manner and from there, you let the Barduino-tender go ahead and tell the Barduino which pumps to turn on and how many times.  So let’s take a look at an example recipe.

drink 'Screwdriver' do
  serve_in 'Highball Glass'
  ingredients do
    2.ounces :vodka
    5.ounces :orange_juice
  end
end

Now that’s all left to do is run that recipe against the barduino-tender and the Barduino will proceed to dispense 8 single ounce shots from the respective pumps.  You can take a look at the DSL on GitHub.

So what does the circuit look like that’s driving the Barduino?  Here’s a photo, give it a click to head on over to Flickr so you can see what each of the components are.

Barduino - Circuit Overview

How about cost? It was very minimal. $34.99 for the Arduino. $9.75 for each pump. And the rest of the parts came from Radio Shack. The total cost of this project was less than $75. And thanks to Mike Wheeler for whipping up the rig for me to mount everything on!

Lastly, the presentation slides, some links, and some other photos courtesy of Anthony Eden (who also contributed to the project with his DSL talk last year at an ORUG meeting).

Notes from Tim Rosenblatt with lots of links to various resources and components I discussed during the talk. (Thanks Tim!)

The audience waits

Up close and personal

Setting up the Barduino

Dispensing some blue fluid

Dispensing some red liquid

Lastly, big thanks to Gregg Pollack for running the show at ORUG and be sure to check his latest project with partner in crime Jason, EnvyCasts for some of the most well produced screencasts that you’re going to find in the Rails world. Absolutely worth every penny.

11 comments ↓

#1 Keg Status » The Kegbot Ideas are back on the Drawing Board on 10.17.08 at 2:10 pm

[...] many features connecting beer and internet. I read about a presentation where someone had created a device that served mixed drinks. I was again inspired to transform the kegerator into something [...]

#2 Dev Blog AF83 » Blog Archive » Veille technologique : 37 Signals, OOo 3.0, MAMA, Tag Maps, CSS3, benchmarks, Merb on 10.20.08 at 10:08 am

[...]  http://www.matthewdavidwilliams.com/2008/10/17/introducing-barduino-the-ruby-powered-bar-monkey/ : Barduino, la rencontre d’Arduino et de Ruby à des fins très utiles [...]

#3 เร็วส์ หกสิบหก » นั่งเทียนเขียนข่าว#20 on 10.26.08 at 1:35 am

[...] Introducing Barduino – The Ruby Powered Bar Monkey — Matthew Williams [...]

#4 My First Open Source Project: « Life Two Point Oh! on 03.17.09 at 12:26 pm

[...] of the simpler models I saw is the Barduino powered by the Arduino microcontroller. Using just 2 windshield washer pumps it’s able to mix [...]

#5 Kenneth on 06.11.09 at 1:46 pm

I am embarking on a similar mission right now. I am set on the washer pumps (found some for 4 bucks) over CO2, but i am not yet set on the interface.

How many outputs can the arduino handle? I was hoping to start out with about 10 ingredients, but be expandable to around 30.

#6 sangeetha priya on 08.15.09 at 2:57 am

hai………………

#7 gosala on 08.25.09 at 4:24 am

hello…….,

#8 FreeRun on 04.07.10 at 3:49 am

То что бредомысли это действительно

#9 Piepcecedip on 05.17.10 at 12:15 pm

Не поспоришь, глупая заметка

#10 дизайн стенда on 05.18.10 at 10:25 am

В целом, хозяин сайта расово верно отжег.

#11 DIY Automated bottling for under 100$ is it possible ? - Home Brew Forums on 01.18.11 at 4:42 pm

[...] saw a video of a guy who made a Drink maker using a microcontroller and 2 windshield washer pump. http://www.matthewdavidwilliams.com/2008/10/17/introducing-barduino-the-ruby-powered-bar-monkey/ It made me think about using it at bottling time with beer on one side and the priming sugar on [...]