<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matthew Williams &#187; Arduino</title>
	<atom:link href="http://www.matthewdavidwilliams.com/category/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matthewdavidwilliams.com</link>
	<description>Another Ruby/Mac/Nerd Blog.</description>
	<lastBuildDate>Fri, 12 Jun 2009 23:22:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Introducing Barduino &#8211; The Ruby Powered Bar Monkey</title>
		<link>http://www.matthewdavidwilliams.com/2008/10/17/introducing-barduino-the-ruby-powered-bar-monkey/</link>
		<comments>http://www.matthewdavidwilliams.com/2008/10/17/introducing-barduino-the-ruby-powered-bar-monkey/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 17:21:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ORUG]]></category>
		<category><![CDATA[Orlando]]></category>
		<category><![CDATA[barduino]]></category>
		<category><![CDATA[physical computing]]></category>
		<category><![CDATA[rad]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.matthewdavidwilliams.com/?p=11</guid>
		<description><![CDATA[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&#8230;.

(Photo credit: Anthony Eden)

Barduino is an Arduino based bar monkey implementation.  To sum up [...]]]></description>
			<content:encoded><![CDATA[<p>On October 10, 2008, I presented on the Ruby Arduino development framework, <a title="Ruby Arduino Framework Home" href="http://rad.rubyforge.org">RAD</a> for the <a title="Orlando Ruby Users Group" href="http://orug.org">Orlando Ruby Users Group</a>.  After two years of attending ORUG, I decided it was time to make my contribution back to the community and that contribution was&#8230;.</p>
<p><img src="http://farm4.static.flickr.com/3183/2948553177_06c1190acb.jpg" alt="Barduino Introduction" /><br />
(Photo credit: <a href="http://anthony.mp/">Anthony Eden</a>)</p>
<p><span id="more-11"></span></p>
<p>Barduino is an <a title="Arduino Home" href="http://arduino.cc">Arduino</a> based bar monkey implementation.  To sum up a bar monkey, it&#8217;s typically a computer control drink dispensing system.  The Arduino, a very <a title="Arduino at Sparkfun.com" href="http://www.sparkfun.com/commerce/product_info.php?products_id=666">cost effective</a> physical computing platform was the perfect base for the Barduino.  And the ability to work with a language I&#8217;m comfortable with, <a title="Ruby Home" href="http://www.ruby-lang.org/en/">Ruby</a>, to write the software that runs on the Arduino made this a relatively simple project.  All of this being made possible with the <a title="RAD Home" href="http://rad.rubyforge.org">Ruby Arduino Development Framework</a>.</p>
<p>So first off, let&#8217;s take a look at the Barduino in action:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=75c35dc234&amp;photo_id=2945307979" /><param name="bgcolor" value="#000000" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.flickr.com/apps/video/stewart.swf?v=61761" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://www.flickr.com/apps/video/stewart.swf?v=61761" allowfullscreen="true" bgcolor="#000000" flashvars="intl_lang=en-us&amp;photo_secret=75c35dc234&amp;photo_id=2945307979"></embed></object></p>
<p>So how was this accomplished?  You can take a look at the <a title="GitHub Barduino Link" href="http://github.com/mwilliams/barduino/tree/master/barduino.rb">source code over at GitHub</a>.</p>
<p>Here&#8217;s the basic breakdown of what the Arduino is doing:</p>
<ul>
<li>Verify there&#8217;s a glass sitting under the dispense area.  This is accomplished with a <a title="Photoresistor at Radio Shack" href="http://www.radioshack.com/product/index.jsp?productId=2062590&amp;cp=&amp;sr=1&amp;kw=photoresistor&amp;origkw=photoresistor&amp;parentPage=search">photoresistor</a> that detects light</li>
<li>Verify the Arduion has a serial connection for it to receive commands</li>
<li>Listen for either a &#8220;1&#8243; or &#8220;2&#8243; being send to the board over the serial line (via the USB port)</li>
<li>If a &#8220;1&#8243; or &#8220;2&#8243; is received, call the dispense method pass it the pump it needs to turn on</li>
<li>Dispense a single ounce of liquid on the given pump and return back to the main loop</li>
</ul>
<p>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&#8217;s take a look at an example recipe.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">drink <span style="color:#996600;">'Screwdriver'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  serve_in <span style="color:#996600;">'Highball Glass'</span>
  ingredients <span style="color:#9966CC; font-weight:bold;">do</span>
    2.<span style="color:#9900CC;">ounces</span> <span style="color:#ff3333; font-weight:bold;">:vodka</span>
    5.<span style="color:#9900CC;">ounces</span> <span style="color:#ff3333; font-weight:bold;">:orange_juice</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Now that&#8217;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 <a title="Barduino-tender on GitHub" href="http://github.com/mwilliams/barduino-tender/">take a look at the DSL on GitHub</a>.</p>
<p>So what does the circuit look like that&#8217;s driving the Barduino?  Here&#8217;s a photo, give it a click to head on over to Flickr so you can see what each of the components are.</p>
<p><a title="Barduino - Circuit Overview by MatthewAndLindsey, on Flickr" href="http://www.flickr.com/photos/mdweezer/2945309387/"><img src="http://farm4.static.flickr.com/3285/2945309387_4b57c6d089.jpg" alt="Barduino - Circuit Overview" width="500" height="375" /></a></p>
<p>How about cost?  It was very minimal.  $34.99 for the Arduino.  <a href="http://www.sciplus.com/singleItem.cfm/terms/14315">$9.75 for each pump</a>.  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!</p>
<p>Lastly, the presentation slides, some links, and some other photos courtesy of <a href="http://anthony.mp">Anthony Eden</a> (who also contributed to the project with his <a href="http://orug.org/articles/2007/10/19/orug-meeting-notes">DSL talk last year at an ORUG meeting</a>).</p>
<div id="__ss_663960" style="width:425px;text-align:left"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="Physical Computing with Ruby and Arduino" href="http://www.slideshare.net/orug/physical-computing-with-ruby-and-arduino-presentation?type=powerpoint">Physical Computing with Ruby and Arduino</a><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=mwilliamsarduinoorug-1224216426229036-8&amp;stripped_title=physical-computing-with-ruby-and-arduino-presentation" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slideshare.net/swf/ssplayer2.swf?doc=mwilliamsarduinoorug-1224216426229036-8&amp;stripped_title=physical-computing-with-ruby-and-arduino-presentation" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View SlideShare <a style="text-decoration:underline;" title="View Physical Computing with Ruby and Arduino on SlideShare" href="http://www.slideshare.net/orug/physical-computing-with-ruby-and-arduino-presentation?type=powerpoint">presentation</a> or <a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint">Upload</a> your own. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/ruby">ruby</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/arduino">arduino</a>)</div>
</div>
<p><img style="visibility:hidden;width:0px;height:0px;" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyMjQyODc4MTQ*OTYmcHQ9MTIyNDI4NzgzMjMyMiZwPTEwMTkxJmQ9Jmc9MiZ*PSZvPTk1Y2Q2MWEzZGQzZjQ*NmY4YjFhMmVjMGNlZGIwZjI*.gif" border="0" alt="" width="0" height="0" /></p>
<p><a href="http://www.timrosenblatt.com/blog/2008/10/16/physical-computing-with-ruby-and-arduino/">Notes from Tim Rosenblatt with lots of links to various resources and components I discussed during the talk. (Thanks Tim!)</a></p>
<p><img src="http://farm4.static.flickr.com/3250/2949912286_129f51c450.jpg" alt="The audience waits" /></p>
<p><img src="http://farm4.static.flickr.com/3015/2949409248_bcc8a0426d.jpg" alt="Up close and personal" /></p>
<p><img src="http://farm4.static.flickr.com/3285/2948552227_6ec4d81dfb.jpg" alt="Setting up the Barduino" /></p>
<p><img src="http://farm4.static.flickr.com/3295/2949411918_8c5212c966.jpg" alt="Dispensing some blue fluid" /></p>
<p><img src="http://farm4.static.flickr.com/3184/2949411224_5fb562d494.jpg" alt="Dispensing some red liquid" /></p>
<p>Lastly, big thanks to <a href="http://railsenvy.com/">Gregg Pollack</a> for running the show at <a href="http://orug.org">ORUG</a> and be sure to check his latest project with partner in crime Jason, <a href="http://envycasts.com/">EnvyCasts</a> for some of the most well produced screencasts that you&#8217;re going to find in the Rails world.  Absolutely worth every penny.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewdavidwilliams.com/2008/10/17/introducing-barduino-the-ruby-powered-bar-monkey/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.216 seconds -->
