<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Richard Parker&#039;s blog &#187; Projects</title>
	<atom:link href="http://blog.richard.parker.name/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.richard.parker.name</link>
	<description>Physical computing, the web, usability and tech miscellany</description>
	<lastBuildDate>Mon, 02 Aug 2010 07:19:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.richard.parker.name' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/1f05f2fc51a59cd1da1161279d7ca5fa?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Richard Parker&#039;s blog &#187; Projects</title>
		<link>http://blog.richard.parker.name</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.richard.parker.name/osd.xml" title="Richard Parker&#039;s blog" />
	<atom:link rel='hub' href='http://blog.richard.parker.name/?pushpress=hub'/>
		<item>
		<title>Open-source FTP-to-Azure blob storage: multiple users, one blob storage account</title>
		<link>http://blog.richard.parker.name/2010/08/02/azure-ftp-server/</link>
		<comments>http://blog.richard.parker.name/2010/08/02/azure-ftp-server/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 06:45:59 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Microsoft Windows Azure]]></category>
		<category><![CDATA[Microsoft.NET]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[ftp]]></category>

		<guid isPermaLink="false">http://blog.richard.parker.name/?p=463</guid>
		<description><![CDATA[A little while ago, I came across an excellent article by Maarten Balliauw in which he described a project he was working on to support FTP directly to Azure&#8217;s blob storage. I discovered it while doing some research on a similar concept I was working on. At the time of writing this post though, Maarten wasn&#8217;t  sharing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=463&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A little while ago, I came across an excellent <a href="http://blog.maartenballiauw.be/post/2010/03/15/Using-FTP-to-access-Windows-Azure-Blob-Storage.aspx">article</a> by Maarten Balliauw in which he described a project he was working on to support FTP directly to Azure&#8217;s blob storage. I discovered it while doing some research on a similar concept I was working on. At the time of writing this post though, Maarten wasn&#8217;t  sharing his source code and even if he did decide to at some point soon, his project appears to focus on permitting access to the <em>entire</em> blob storage account. This wasn&#8217;t really what I was looking for but it was very similar&#8230;</p>
<h3>My goal: FTP to Azure blobs, many users: one blob storage account with &#8216;home directories&#8217;</h3>
<p>I wanted a solution to enable multiple users to access the <em>same </em>storage account, but to have their own unique portion of it &#8211; thereby mimicking an actual FTP server. A bit like giving authenticated user&#8217;s their own &#8216;home folder&#8217; on your Azure Blob storage account.</p>
<p>This would ultimately give your Azure application the ability to accept incoming FTP connections and store files directly into blob storage via any popular FTP client &#8211; mimicking a file and folder structure and permitting access only to regions of the blob storage account you determine. There are many potential uses for this kind of implementation, especially when you consider that blob storage can feed into the Microsoft CDN&#8230;</p>
<h3>Features</h3>
<ul>
<li>Deploy within a worker-role</li>
<li>Support for most common FTP commands</li>
<li>Custom authentication API: because you determine the authentication and authorisation APIs, you control who has access to what, quickly and easily</li>
<li>Written in C#</li>
</ul>
<h3>How it works</h3>
<p>In my implementation, I wanted the ability to literally &#8216;fake&#8217; a proper FTP server to any popular FTP client: the server component to be running on Windows Azure. I wanted to have some external web service do my authentication (you could host <em>yours</em> on Windows Azure, too) and then only allow each user access to their own tiny portion of my Azure Blob Storage account.</p>
<p>It turns out, Azure&#8217;s containers did exactly what I wanted, more or less. All I had to do was to come up with a way of authenticating clients via FTP and returning which container they have access to (the easy bit), and write an FTP to Azure &#8216;bridge&#8217; (adapting and extending <a href="http://www.codeguru.com/csharp/csharp/cs_internet/desktopapplications/article.php/c13163">a project by Mohammed Habeeb</a> to run in Azure as a worker role).</p>
<p>Here&#8217;s how my first implementation works:</p>
<p><img class="size-full wp-image-471 alignnone" title="FTP to Azure Bridge - How it Works" src="http://brainthings.files.wordpress.com/2010/07/azureftp.jpg?w=560&#038;h=353" alt="" width="560" height="353" /></p>
<h3>A quick note on authentication</h3>
<p>When an FTP client authenticates, I grab the username and password sent by the client, pass that into my web service for authentication, and if successful, I return a container name specific to that customer. In this way, the remote user can only work with blobs within that container. In essence, it is their own &#8216;home directory&#8217; on my master Azure Blob Storage account.</p>
<p>The FTP server code will deny authentication for any user who does not have a container name associated with them, so just return null to the login procedure if you&#8217;re not going to give them access (I&#8217;m assuming you don&#8217;t want to return a different error code for &#8216;bad password&#8217; vs. &#8216;bad username&#8217; &#8211; which is a good thing).</p>
<p>Your authentication API could easily be adapted to permit access to the same container by multiple users, too.</p>
<h3>Simulating a regular file system from blob storage</h3>
<p>Azure Blob Storage doesn&#8217;t work like a traditional disk-based system in that it doesn&#8217;t actually have a hierarchical <em>directory </em>structure &#8211; but the FTP service simulates one so that FTP clients can work in the traditional way. Mohammed&#8217;s initial C# FTP server code was superb: he wrote it so that the file system could be replaced back in 2007 &#8211; to my knowledge, before Azure existed, but it&#8217;s like he <em>meant</em> for it to be used this way (that is to say, it was so painless to adapt it one could be forgiven for thinking this. Mohammed, thanks!).</p>
<p>Now I have my FTP server, modified and adapted to work for Azure, there are many ways in which this project can be expanded&#8230;</p>
<h3>Over to you (and the rest of the open source community)</h3>
<p>It&#8217;s my first open source project and I actively encourage you to help me improve it. When I started out, most of this was &#8216;proof of concept&#8217; for a similar idea I was working on. As I look back over the past few weekends of work, there are many things I&#8217;d change but I figured there&#8217;s enough here to make a start.</p>
<p>If you decide to use it &#8220;as is&#8221; (something I don&#8217;t advise at this stage), do remember that it&#8217;s not going to be perfect and you&#8217;ll need to do a little leg work &#8211; it&#8217;s a work in progress and it wasn&#8217;t written (at least initially) to be an open-source project. Drop me a note to let me know how you&#8217;re using it though, it&#8217;s always fun to see where these things end up once you&#8217;ve released them into the wild.</p>
<h3>Where to get it</h3>
<p>Head on over to the <a href="http://ftp2azure.codeplex.com/">FTP to Azure Blob Storage Bridge</a> project on <a href="http://ftp2azure.codeplex.com/">CodePlex</a>.</p>
<p>It&#8217;s free for you to use however you want. It carries all the usual caveats and warnings as other &#8216;free open-source&#8217; software: use it at your own risk.</p>
<p>If you do use it and it works well for you, drop me an email and it&#8217;ll make me happy. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://blog.richard.parker.name/category/software-development/microsoft-windows-azure/'>Microsoft Windows Azure</a>, <a href='http://blog.richard.parker.name/category/software-development/microsoftnet/'>Microsoft.NET</a>, <a href='http://blog.richard.parker.name/category/projects/open-source/'>Open Source</a>, <a href='http://blog.richard.parker.name/category/projects/'>Projects</a>, <a href='http://blog.richard.parker.name/category/software-development/'>Software Development</a>, <a href='http://blog.richard.parker.name/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/463/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=463&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2010/08/02/azure-ftp-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2010/07/azureftp.jpg" medium="image">
			<media:title type="html">FTP to Azure Bridge - How it Works</media:title>
		</media:content>
	</item>
		<item>
		<title>Arduinometer, anyone?</title>
		<link>http://blog.richard.parker.name/2009/04/27/arduinometer-anyone/</link>
		<comments>http://blog.richard.parker.name/2009/04/27/arduinometer-anyone/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 17:30:26 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electricity]]></category>
		<category><![CDATA[gas]]></category>
		<category><![CDATA[meter]]></category>
		<category><![CDATA[water]]></category>

		<guid isPermaLink="false">http://blog.richard.parker.name/?p=251</guid>
		<description><![CDATA[On Sunday, I published an article showing how I&#8217;d built an Arduino-powered ethernet gas meter, to publish real-time gas meter readings to Pachube. Thanks to James Taylor (http://twitter.com/jtonline) who re-tweeted my initial tweet highlighting it as potentially of interest to the #homecamp folks, within a few hours some 200 people had read the article, and I&#8217;ve [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=251&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On Sunday, I <a href="http://blog.richard.parker.name/2009/04/25/how-to-build-a-web-connected-gas-meter-with-your-arduino/">published an article</a> showing how I&#8217;d built an Arduino-powered ethernet gas meter, to publish real-time gas meter readings to <a href="http://www.pachube.com">Pachube</a>. Thanks to James Taylor (<a href="http://twitter.com/jtonline">http://twitter.com/jtonline</a>) who <a href="http://twitter.com/jtonline/statuses/1620343610">re-tweeted</a> <a href="http://twitter.com/rikp/statuses/1619392860">my initial tweet</a> highlighting it as potentially of interest to the #<a href="http://homecamp.org">homecamp</a> folks, within a few hours some 200 people had read the article, and I&#8217;ve received some great feedback and inclusion on several sites on the web. Not bad for my first article of this kind, I thought!</p>
<p>I&#8217;ve been thinking that I should really extend this little venture into a project that adds support for:</p>
<ul>
<li>Tracking electricity, gas and water meter values (all from the same Arduino), using cheap sensors</li>
<li>Add support for pulse meters, as well as what I&#8217;ve dubbed &#8216;reflective&#8217; meters (not sure of the proper name, but these are the meters with the little reflective discs of metal on one of the dials).</li>
</ul>
<p>I&#8217;ve <a href="http://code.google.com/p/arduinometer">created a project on Google Code </a>for anyone who&#8217;s interested in following (there&#8217;s not a lot there just yet, though). I&#8217;ve got a busy few weeks ahead, but will do what I can in the interim. It&#8217;s look like June will be the first real chance I have to sit down and extend the code. If anyone&#8217;s interested in getting involved, or helping out in any way, please get in touch. I&#8217;m still fairly new to the world of Arduino and physical computing, so I&#8217;m still learning too &#8211; all feedback is appreciated!</p>
<br />Posted in Arduino, Projects  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/251/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=251&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/04/27/arduinometer-anyone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>
	</item>
		<item>
		<title>How to build a web connected gas meter with your Arduino</title>
		<link>http://blog.richard.parker.name/2009/04/25/how-to-build-a-web-connected-gas-meter-with-your-arduino/</link>
		<comments>http://blog.richard.parker.name/2009/04/25/how-to-build-a-web-connected-gas-meter-with-your-arduino/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 22:00:28 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[gas meter]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[schematic]]></category>

		<guid isPermaLink="false">http://blog.richard.parker.name/?p=204</guid>
		<description><![CDATA[A few months back, I bought a Current Cost electricity meter, hacked that and started pushing the data up to Pachube and displaying real-time electricity usage right here on my blog. But, electricity is only one part of the picture &#8211; we also use gas for our heating and hot water systems, and I wanted [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=204&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few months back, I bought a Current Cost electricity meter, hacked that and started pushing the data up to Pachube and displaying real-time electricity usage <a href="http://blog.richard.parker.name/ehome">right here on my blog</a>. But, electricity is only one part of the picture &#8211; we also use gas for our heating and hot water systems, and I wanted to track our usage of this too. The catch, of course, is that there doesn&#8217;t appear to be a consumer product on the market to do this for me, and I really wanted an excuse to go out and buy an Arduino and start playing with that.</p>
<p>My goal for this project was to hook the gas meter up to Pachube, using <a href="http://www.eeml.org">EEML </a>as the format:</p>
<pre class="brush: xml;">&lt;eeml xmlns='http://www.eeml.org/xsd/005' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd'&gt;
&lt;environment&gt;
&lt;location exposure='indoor' domain='physical' disposition='fixed'&gt;
&lt;name&gt;London, United Kingdom&lt;/name&gt;
&lt;/location&gt;
&lt;data id='0'&gt;
&lt;tag&gt;gas&lt;/tag&gt;&lt;tag&gt;cubic metres&lt;/tag&gt;
&lt;value&gt;2&lt;/value&gt;
&lt;/data&gt;
&lt;data id='1'&gt;
&lt;tag&gt;temperature&lt;/tag&gt;&lt;tag&gt;degrees&lt;/tag&gt;&lt;tag&gt;celsius&lt;/tag&gt;
&lt;value&gt;28&lt;/value&gt;&lt;/data&gt;
&lt;/environment&gt;
&lt;/eeml&gt;
</pre>
<p>What follows is how I set about using my Arduino, an Ethernet Shield and various other parts in order to build the gas meter!</p>
<p><strong>Introduction</strong></p>
<p>Those of you who have been following my previous blog posts will know that I&#8217;ve been working on this for a while, finding a few minutes spare to tinker as and when I can. This post is the promised amalgamation of all those recent posts.</p>
<div id="attachment_212" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-212" title="Arduino Gas Meter (Web/XML)" src="http://brainthings.files.wordpress.com/2009/04/img_0045.jpg?w=300&#038;h=235" alt="The completed Arduino Ethernet Gas Meter unit" width="300" height="235" /><p class="wp-caption-text">The completed Arduino Ethernet Gas Meter unit</p></div>
<p>So, this is the completed unit (picture, left). Whilst this isn&#8217;t intended as a complete step-by-step tutorial, my aim is to provide enough information to enable somebody else to build one of these.</p>
<p>To keep things nice and neat, I mounted the Arduino, Ethernet- and Proto- shields into a plastic project box from Maplin. I drilled a ventillation hole and added a mini CPU fan connected to a temperature sensor to help keep the unit cool. I also wanted to add one because it&#8217;s nice to tinker around with new sensors and I hadn&#8217;t yet played with a temp sensor ;)</p>
<p><strong>How does it work?</strong></p>
<p>The main sensor on this unit is a photo-reflector, which is a fancy name for an infrared LED and an infrared sensor in one assembly. When the infrared sensor detects a reflection from the infrared LED, the strength of that reflection is fed back into the Arduino. I used a pull-up resistor circuit to connect this sensor to a digital input pin, which is switched to LOW when a reflection is detected. Because my gas meter has a little reflective metal disc on one of the dials, this gives me a nice reflection to count when the dial passes.</p>
<p>The Arduino then keeps a tally of all the reflections it has counted, which is accessible in XML (conformant to the <a href="http://www.eeml.org">EEML </a>standard) over the web via the Ethernet Shield. To keep my meter in synch with the actual gas meter, one can pass a parameter via the HTTP querystring to the gas meter module to set it&#8217;s current value (useful, for instance, after a power cut or if you need to disconnect it). Because the unit is accessible over the public internet (without authentication), I only allow the querystring parameter to reset the meter value if a certain digital pin is &#8216;HIGH&#8217; &#8211; a crude (yet effective) kind of physical security.</p>
<p>For fun, I then added a mini-CPU fan connected to a temperature sensor which causes the fan to start up when the temperature inside the unit gets a bit too toasty. It then kicks in until it has successfully dropped the temperature to within the threshold amount. The CPU fan runs off 12v, which the Arduino will happily produce &#8211; but it gave me an opportunity to use a transistor to switch the 12V supply on/off based on the state of a digital output pin @ 5 volts.</p>
<p><strong>Contents</strong></p>
<ol>
<li>Before you begin: finding out if this will this work for you!</li>
<li>Shopping list &#8211; what you need to buy and where to get it</li>
<li>Constructing the sensor circuit</li>
<li>The sketch</li>
<li>Connect it all up, fine tune and test</li>
<li>Acknowledgements</li>
</ol>
<p><strong>Before you begin:</strong> check your gas meter</p>
<p><span style="color:#800000;"><em>Please note: this project involves mounting sensing equipment in a non-permanent, non-invasive way to your household gas meter, based on my experience and research. I strongly encourage you to check for yourself whether these instructions are suitable for you, and, if so, only to proceed if you feel competent enough to connect this unit safely. This information is provided &#8216;as is&#8217;, and you use it entirely at your own risk.</em></span></p>
<p>This kit will only work on <em>certain types of gas meter</em>. Firstly, you must have the odometer-style gas meter (these are the ones with rotary dials with numbers on). Secondly, one of the dials, usually the dial representing a 100th of a Cubic Metre should have a little reflective disk between two of the digits (on mine, that is digit 5 and 6). I&#8217;ve no doubt that you could probably modify my design here to work with another type of meter, but you may need to change the photo reflector to either a pulse counter or something else appropriate. The underlying code to count the pulses and make the Arduino web-connectable should be the same.</p>
<p><strong>Shopping list</strong></p>
<p>1 x Arduino Duemillanove (or similar) &#8230;.. £23.81<br />
1 x <a href="http://www.skpang.co.uk/catalog/product_info.php?products_id=394">Sparkfun Ethernet Shield</a> &#8230; £33.35<br />
1 x 9v DC Power Supply with a 2.1mm centre-positive connector (<a href="http://www.maplin.co.uk/Module.aspx?ModuleNo=13453">Maplin: GS74R</a>) &#8230; £7.99<br />
1 x 220 ohm resistor<br />
1 x 10K ohm resistor<br />
1 x Transistor (if you plan to add the fan circuit and you use a 12V fan)<br />
1 x <a href="http://www.active-robots.com/products/sensors/sensors-fairchild.shtml" target="_blank">Fairchild QRB1134 IR Photoreflector </a>&#8230;. £2.62<br />
1 x Project Box (eg. Maplin XYZXYZ) &#8230;. £2.99<br />
1 x Mini CPU Fan (eg. Maplin) &#8230;. £4.99<br />
1 x Breadboard &#8211; OR -<br />
1 x <a href="http://www.nuelectronics.com/estore/index.php?main_page=product_info&amp;cPath=1&amp;products_id=3" target="_blank">Nuelectronics Protoshield</a> &#8230;. £4.99</p>
<p>Total cost to build from scracth: £80.74<br />
Total cost if you already have the Arduino, an ethernet shield and a few other bits and bobs: &lt; £20.</p>
<p>You will also need/want the following tools to hand:</p>
<ul>
<li>Soldering iron and lead-free solder (well, use whatever you like, but lead-free is better for you and the environment!)</li>
<li>Wire cutters</li>
<li>Some suitable wire/jump leads etc</li>
<li>A pair of <a href="http://www.maplin.co.uk/module.aspx?moduleno=4017">&#8220;helping hands&#8221;</a> if you have them</li>
</ul>
<p><strong>Goals</strong></p>
<p>Before starting out, I had a quick think about the project&#8217;s desired behaviors. That way, coding it up would be a little easier because I&#8217;d know what I was supposed to be coding <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here they are:</p>
<ul>
<li>Connect the photo reflector to a digital input
<ul>
<li>When the input goes LOW, increment a counter</li>
</ul>
</li>
<li>Check the current temperature inside the unit
<ul>
<li>When the temperature is above the threshold, turn on the CPU fan.</li>
<li>When the temperature falls below the threshold, turn off the CPU fan.</li>
</ul>
</li>
<li>Check if a web client is connecting.
<ul>
<li>Read the query string.</li>
<li>If the query string value contains &#8220;?x=&#8221;, change the internal count to the value of x but <strong>only</strong> when a digital pin is set to HIGH (so web users can&#8217;t set it for us!).</li>
<li>If the query string does not contain the above element, generate EEML containing the data that we need.</li>
</ul>
</li>
</ul>
<p>With these points in mind, I started to construct the sensor circuit.</p>
<p><strong>Constructing the sensor circuit and preparing the project box</strong></p>
<p>Ok, so first things first &#8211; let&#8217;s start by preparing the project box. Drill two holes into the box &#8211; one on top, and another on the side (as pictured):</p>
<div id="attachment_241" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-241" title="Gas Meter Project Box" src="http://brainthings.files.wordpress.com/2009/04/box.jpg?w=300&#038;h=236" alt="Prepared Project Box" width="300" height="236" /><p class="wp-caption-text">Prepared Project Box</p></div>
<p>It doesn&#8217;t really matter what size you make the hole on the side providing that there is sufficient room to fit a power cable, ethernet cable and the 4 wires from the photoreflector through. The hole on top should be just a shade smaller than the size of the fan that you have so that you can mount it to the inside of the case properly.</p>
<p>Next up, we&#8217;re going to construct the sensor circuit board. You can use either a breadboard, or &#8211; as I have used &#8211; an <a href="http://www.nuelectronics.com/estore/index.php?main_page=product_info&amp;cPath=1&amp;products_id=3" target="_blank">unassembled protoshield board from nuelectronics</a>. I have used Fritzing to create a diagram of the entire circuit (shown below). I&#8217;ve also produced a schematic to accompany the diagram. I&#8217;m not quite sure how correct it is though, so be warned! (Corrections on a post-card, please!).</p>
<div id="attachment_228" class="wp-caption alignnone" style="width: 710px"><img class="size-full wp-image-228" title="Arduino Gas Meter Circuit Layout" src="http://brainthings.files.wordpress.com/2009/04/gas-meter-sketch1.jpg?w=700&#038;h=417" alt="A tidier view of the wiring" width="700" height="417" /><p class="wp-caption-text">A tidier view of the wiring</p></div>
<div id="attachment_246" class="wp-caption alignnone" style="width: 710px"><img class="size-full wp-image-246" title="Arduino Gas Meter Schematic" src="http://brainthings.files.wordpress.com/2009/04/gas-meter-final.jpg?w=700&#038;h=302" alt="Schematic" width="700" height="302" /><p class="wp-caption-text">Schematic</p></div>
<p>Start by soldering two wires &#8211; one each to the 5V rail and the GND rail respectively. Next, solder the resistors, transistor and temperature sensor onto the board, according to the schematic shown. Take care when soldering the transistor and temperature sensor to the board: the heat from your soldering iron may damage them.</p>
<p>Next, pass the bare sensor wires through the outside hole that you drilled and then solder them onto the board in the posistions shown. Make sure you use enough wire &#8211; you&#8217;ll want about 11-13cm for each connection you make (you can trim the non-soldered ends later).  Finally, solder the positive and ground wires for the CPU fan onto your board.</p>
<p>If you&#8217;re new to soldering (as I am), then do take extra care that your connections are good and don&#8217;t bridge multiple points on the board. If you do, you&#8217;ll likely create a short circuit and that will drive you nuts, trust me! When you&#8217;re done, you should end up with something that looks a bit like this:</p>
<div id="attachment_242" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-242" title="Arduino Sensor Circuit" src="http://brainthings.files.wordpress.com/2009/04/board.jpg?w=300&#038;h=225" alt="The finished sensor circuit" width="300" height="225" /><p class="wp-caption-text">The finished sensor circuit</p></div>
<p><strong>The sketch</strong></p>
<p>Now that you&#8217;ve done the hard part, here comes the copy and paste! Take the sketch below and place it into your Arduino suite. You&#8217;ll need to modify the following:</p>
<ul>
<li>Line 13: Set your own unique MAC address</li>
<li>Line 14: Set your own unique IP address (accessible from computers on your network)</li>
<li>Line 15: Set your router&#8217;s gateway address</li>
</ul>
<pre class="brush: cpp;">#include &quot;Ethernet2.h&quot;
#include &quot;WString.h&quot;
#include &quot;stdio.h&quot;

// --- [ Pin setup ] ---
int sensorPin = 5;
int ledPin = 9;
int fanPin = 7;
int tempPin = 3;
int unlockPin = 8;

// --- [ Ethernet setup ] ---
static uint8_t mac[6] = { 0x02, 0xAA, 0xAA, 0xCC, 0x00, 0x22 };
static uint8_t ip[4] = { 192, 168, 1, 99 };
static uint8_t gateway[4] = { 192, 168, 1, 2 };
int serverPort = 80;

String url = String(25);
int maxLength=25;

// --- [ Variables to control when the unit fan kicks in/cuts out... ] ---
float maxTemp = 26.0;
float minTemp = 24.0;

// --- [ Variables to store our sensor values ] ---
volatile int totalTicks = 0;
float tempc = 0.0;
int maxi = -100, mini = 100;

// --- [ Misc. vars ] ---
float inputVolts = 5.01;
int previousState = -2;
int delayMs = 1500;
int i;
boolean lock;

Server server(serverPort);

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(fanPin, OUTPUT);
  pinMode(sensorPin, INPUT);
  pinMode(unlockPin, INPUT);
  previousState = digitalRead(sensorPin);
  Serial.begin(115200);                                   // Use serial for debugging locally...
  Serial.println(&quot;Ardugas server saying: Howdy!&quot;);
  Ethernet.begin(mac, ip, gateway);
  server.begin();
}

void loop() {
  checkUnitTemp();                                      // Take action based on unit temp
  checkSensor();                                        // Check the gas meter sensor
  getCurrentTemperature();                              // Get the unit temperature
  listenWeb();                                          // Handle any web connections
  digitalWrite(ledPin, !digitalRead(sensorPin));        // Light LED if sensor is LOW
}

// Serve pachube EEML and accept a querystring param to set the current value
void listenWeb() {   

 boolean read_url = true;
 boolean unlock = false;

 Client client = server.available();
  if (client) {

    Serial.println(&quot;Ethernet client connected...&quot;);

    // an http request ends with a blank line
    boolean current_line_is_blank = true;
    int valuesChanged = 0;
    while (client.connected()) {

      if (client.available()) {

        char c = client.read();
          if (url.length() &lt; maxLength) {
            url.append(c);
          }
        if (c == '\n' &amp;&amp; current_line_is_blank) {

           // send a standard http response header, but change the response type to text/xml
          client.println(&quot;HTTP/1.1 200 OK&quot;);
          client.println(&quot;Content-Type: text/xml&quot;);
          client.println();

          // This is our unlock pin. When set to high, we allow the querystring parameter 'x' to force-set our meter value.
          if (digitalRead(unlockPin) == HIGH) {
            unlock = true;
          }

          if (url.contains(&quot;x&quot;) &amp;&amp; unlock) {
            Serial.println(url);
            String v = String(10);
            int startIndex = url.indexOf('=')+1;
            int stopIndex = url.indexOf('H');
            v = url.substring(startIndex, stopIndex);
            Serial.println(v);
            totalTicks = atoi(v);
          } 

          int t = tempc;

          // EEML
          client.println(&quot;&quot;);
          client.println(&quot;&quot;);

          client.println(&quot;&quot;);
          client.println(&quot;Ardugas Server&quot;);
          client.println(&quot;&quot;);

          // Gas Meter Reading
          client.println(&quot;&quot;);
          client.println(&quot;gascubic metres&quot;);
          client.print(&quot;&quot;);
          client.print(totalTicks);
          client.println(&quot;&quot;);
          client.println(&quot;&quot;);

          client.println(&quot;&quot;);
          client.println(&quot;temperaturedegreescelsius&quot;);
          client.print(&quot;&quot;);
          client.print(t);
          client.print(&quot;&quot;);
          client.println(&quot;&quot;);         

          client.println(&quot;&quot;);
          client.println(&quot;&quot;);

          client.println(); 

          break;

        }

        if (c == '\n') {
          // we're starting a new line
          current_line_is_blank = true;
        } else if (c != '\r') {
          // we've gotten a character on the current line
          current_line_is_blank = false;
        }

      }
    }
    // give the web browser time to receive the data
    url = &quot;&quot;;
    delay(5);
    client.stop();
  } 

}

// Switch the cooling fan on if it's too hot!
void checkUnitTemp() {
 if (tempc &gt;= maxTemp) {
   digitalWrite(fanPin, HIGH);
 }
 if (tempc  maxi) {maxi = tempc;} // record max temperature
  if(tempc &lt; mini) {mini = tempc;} // record min temperature
}

// Count sensor values
void checkSensor() {
  int currentState = digitalRead(sensorPin);
  if (currentState == LOW &amp;&amp; previousState == HIGH) {
    if (!lock) {
      lock = true;
      delay(delayMs);
      totalTicks++;
    }
  }
  if (currentState == HIGH &amp;&amp; previousState == LOW) {
    lock = false;
  }
  previousState = currentState;
}
</pre>
<p>Attach the Ethernet Shield to your Arduino, attach your sensor circuit, upload the sketch and then test it out according to the behaviours mapped out above. For testing, I used a a square of foil and passed it under the sensor. This should cause the sensor pin to swith to LOW, and increment the counter by one. To test if your cooling fan circuit is working, change the threshold values in the sketch above.</p>
<p><strong>Connect it all up, fine tune and test</strong></p>
<p>Now for the exciting bit&#8230; it&#8217;s time to connect it up to your gas meter. Now, my gas meter was really quite awkward because there is a curved plastic bezel cover over the meter dials, which made it had to find the best point to get a reflection. That is, in the end, why I opted for a very sturdy and reliable &#8216;blu-tac&#8217; mount! I think I&#8217;ll definitely replace that with a bracket at some point in the futre though.</p>
<p> [Photo to follow shortly]</p>
<p>Now, connect up your circuit. Make sure you&#8217;ve got your test LED inserted into the ledPin you defined in the sketch. This will light up when your sensor detects a reflection. At this point it would be good if you have someone to help you by turning your hot water on/off, or, turn your gas hob or heating on for the duration of the setup. The object here is to have the dial start to turn so that you can find the best position for your sensor. Begin by holding the photoreflector just over the dial with the reflective disc. Wait for it to turn one revolution. The LED should light when the sensor detects a reflection &#8211; so make sure that it only lights up when the dial is directly underneath it. As the disc approaches the sensor, there is a period of &#8216;noisy reflection&#8217; that my sketch accounts for by forcing a delay after the first detection. This prevents artifical inflation of the meter count.</p>
<p>Once you&#8217;ve found the ideal position, firmly fix it in place &#8211; I used blu tac quite successfully but you can use whatever you need to, providing it doesn&#8217;t pierce or physically interfere with the meter in any way. Now that it&#8217;s attached, you need to program your arduino with your current gas meter value.  To enable this, you must first connect a jumper lead from 5V to resetPin. Then, browse to the IP address you set, but add the querystring value &#8216;x=[your meter reading]&#8216;. For example, to set a meter reading of 894.121, and your IP address is 192.168.1.99, your URL would look like: <a href="http://192.168.1.99/?x=894121">http://192.168.1.99/?x=894121</a>.</p>
<p>So, that&#8217;s it! I&#8217;ve been sitting on this article for about a week now, but due to work and other commitments I&#8217;ve not really had as much time as I&#8217;d have liked to work on it &#8211; so I thought I&#8217;d just get it out there and take as much feedback as possible from my readers to help improve it.</p>
<p>I hope you enjoyed reading and that you can derive some use from this.</p>
<p>Thanks!</p>
<br />Posted in Arduino, Projects, Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=204&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/04/25/how-to-build-a-web-connected-gas-meter-with-your-arduino/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/04/img_0045.jpg?w=300" medium="image">
			<media:title type="html">Arduino Gas Meter (Web/XML)</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/04/box.jpg?w=300" medium="image">
			<media:title type="html">Gas Meter Project Box</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/04/gas-meter-sketch1.jpg" medium="image">
			<media:title type="html">Arduino Gas Meter Circuit Layout</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/04/gas-meter-final.jpg" medium="image">
			<media:title type="html">Arduino Gas Meter Schematic</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/04/board.jpg?w=300" medium="image">
			<media:title type="html">Arduino Sensor Circuit</media:title>
		</media:content>
	</item>
		<item>
		<title>Assembling the Sparkfun Protoshield for Arduino</title>
		<link>http://blog.richard.parker.name/2009/02/21/assembling-the-sparkfun-protoshield-for-arduino/</link>
		<comments>http://blog.richard.parker.name/2009/02/21/assembling-the-sparkfun-protoshield-for-arduino/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 11:54:41 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[protoshield]]></category>

		<guid isPermaLink="false">http://brainthings.wordpress.com/?p=193</guid>
		<description><![CDATA[Yesterday I finished assembling the Sparkfun Arduino Protoshield (v2) (if you&#8217;re wondering what a &#8216;Protoshield&#8217; is, be sure to read the footer of this post for a quick explanation). I chose to purchase the Protoshield kit so that I could deploy my Gas Meter-reading gadgetry in a relatively small, neat package. I previously purchased the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=193&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday I finished assembling the <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=7914">Sparkfun Arduino Protoshield (v2)</a> (if you&#8217;re wondering what a &#8216;Protoshield&#8217; is, be sure to read the footer of this post for a quick explanation). I chose to purchase the Protoshield kit so that I could deploy my <a href="http://brainthings.wordpress.com/2009/02/18/part-2a-the-sensor-bar-arduino-gas-meter-project/">Gas Meter-reading gadgetry</a> in a relatively small, neat package.</p>
<p>I previously purchased the Nuelectronics Protoshield kit &#8211; which is basically a variation on the Sparkfun model. Although there wasn&#8217;t anything wrong with the Nuelectronics version, in my experience working with Nuelectronics gear, you have to be a bit more proficient in the field of electronics etc., i.e. a higher level of competance is assumed. Whereas the Sparkfun gear, although used by both novices and professionals, is just that bit more refined and &#8211; in my humble opinion &#8211; higher quality. I actually broke the Nuelectronics protoshield on my first attempt, and it was at that point I decided to go with the flow and buy the Sparkfun model.</p>
<p>Although the board is made by Sparkfun, I didn&#8217;t actually buy mine from them directly as the shipping costs to the UK are quite high (at least the cost of the board!). Instead, I sourced the official board from <a href="http://www.skpang.co.uk/catalog/product_info.php?products_id=351">SK Pang Electronics</a> (a UK-based firm I hadn&#8217;t used before), for a very reasonable £14.84 plus shipping. I will certainly order from SK Pang again, by the way, since the item arrived next day via Recorded Delivery &#8211; perfect for the tinkerer with a weekend on the way! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Assembly</strong></p>
<p>Being a novice in the field of electronics, I wasn&#8217;t too confident that I&#8217;d be able to assemble it &#8211; soldering components onto a PCB is a tad intimidating if you&#8217;ve never really soldered before (I&#8217;d had only limited experience soldering and that wasn&#8217;t particularly successful!)! That said though, after reading a few basic tips on how to solder, I gave it a shot and about 30 minutes later the entire PCB was assembled. What a fantastic kit.</p>
<p>Although the kit ships disassembled, SparkFun do not give you assembly instructions. Instead, I referred to <a href="http://www.atomicsalad.com/archive/2007/03/11/tutorial_sparkfun_protoshield_assembly_use.php">Bob Gallop&#8217;s excellent tutorial</a>. Bob&#8217;s instructions are based on the V1 protoshield, which differs only very slightly from the newer V2 that I&#8217;d purchased. His tutorial also offers some great tips on how to keep components in place while you&#8217;re trying to solder them &#8211; so it was well worth the read, and the photography makes it all the more easier to follow along.</p>
<p>One thing I would add though is that I am incredibly pleased with the pair of <a href="http://www.maplin.co.uk/module.aspx?moduleno=4017">Helping Hands</a> I&#8217;d purchased from <a href="http://www.maplin.co.uk/module.aspx?moduleno=4017">Maplin </a>a few weeks back &#8211; a necessity for PCB soldering.</p>
<p><strong>The finished board</strong></p>
<p>Here&#8217;s a photo of the Protoshield without the breadboard attached. You could of course leave the breadboard out entirely if you wanted to, and solder directly onto the shield. As I want to retain the flexibility of the shield though, I&#8217;ll add the breadboard on in a moment. In this picture, I&#8217;ve yet to solder on the single male pins JC1, JC2 and JC3 and also the BlueSMIiRF  female headers:</p>
<p><img class="size-full wp-image-194 alignnone" title="Protoshield without Breadboard" src="http://brainthings.files.wordpress.com/2009/02/beforebreadboard.jpg?w=710&#038;h=534" alt="Protoshield without Breadboard" width="710" height="534" /></p>
<p>And when mounted on top of the Arduino, with a mini-breadboard, the remaining pins and BlueSMiRF headers added:</p>
<p><img class="size-full wp-image-195 alignnone" title="Protoshield with Breadboard" src="http://brainthings.files.wordpress.com/2009/02/withbreadboard.jpg?w=709&#038;h=534" alt="Protoshield with Breadboard" width="709" height="534" /></p>
<p>All in all, thoroughly pleased with myself <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Not only did I have fun while assembling the board, I learned a few new skills and have boosted my confidence in the world of tinkering. Still, a long way to go yet! But at least now I have a better way of continuing my <a href="http://brainthings.wordpress.com/2009/02/18/part-2a-the-sensor-bar-arduino-gas-meter-project/">Gas Meter</a> project.</p>
<p><strong>What is a Protoshield?</strong></p>
<p>If you&#8217;re new to the world of Arduino &#8211; as I am &#8211; then you might be wondering what a &#8216;protoshield&#8217; is and what they do. &#8216;Shields&#8217; are essentially printed circuit boards that are designed to slot on top of your Arduino board, and provide some extra capabilities. There are <a href="http://www.sparkfun.com/commerce/advanced_search_result.php?keywords=arduino+shield&amp;x=0&amp;y=0&amp;search_section=products">all kinds of shields that you can buy</a>: some offer radio transmission/reception capabilities and others, like my Protoshield, simply offer you the flexibility to affix a tiny breadboard to the top of your Arduino to make protoyping that much easier.</p>
<br />Posted in Arduino, Projects  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=193&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/02/21/assembling-the-sparkfun-protoshield-for-arduino/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/beforebreadboard.jpg" medium="image">
			<media:title type="html">Protoshield without Breadboard</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/withbreadboard.jpg" medium="image">
			<media:title type="html">Protoshield with Breadboard</media:title>
		</media:content>
	</item>
		<item>
		<title>Part 2a: The Sensor Bar (Arduino Gas Meter project)</title>
		<link>http://blog.richard.parker.name/2009/02/18/part-2a-the-sensor-bar-arduino-gas-meter-project/</link>
		<comments>http://blog.richard.parker.name/2009/02/18/part-2a-the-sensor-bar-arduino-gas-meter-project/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 21:48:57 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[gas meter]]></category>
		<category><![CDATA[photoreflector]]></category>
		<category><![CDATA[sensor]]></category>

		<guid isPermaLink="false">http://brainthings.wordpress.com/?p=189</guid>
		<description><![CDATA[Ok, so here we are a few days later than expected. I&#8217;ve been a bit too busy to tinker lately, but I&#8217;ve made some interesting progress. I&#8217;ll keep this post brief&#8230; Firstly, the phototransistor I ordered from Maplin turned out to be of limited use since it&#8217;s &#8216;detection range&#8217; is a little bit too small [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=189&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, so here we are a few days later than expected. I&#8217;ve been a bit too busy to tinker lately, but I&#8217;ve made some interesting progress. I&#8217;ll keep this post brief&#8230;</p>
<p>Firstly, the phototransistor I ordered from Maplin turned out to be of limited use since it&#8217;s &#8216;detection range&#8217; is a little bit too small to work with the gas meter properly. Also, due to the siting of the gas meter within my property (in a cupboard, with a chair in front of it!), I needed the sensor to be remote to the Arduino. So I ordered a Fairchild Photoreflector from Active Robots. On the surface, it&#8217;s everything I need (a photoreflector with wires already attached). Very inexpensive.</p>
<p><img class="alignnone size-full wp-image-190" title="Fairchild Photoreflector" src="http://brainthings.files.wordpress.com/2009/02/fairchildsensor.jpg?w=642&#038;h=532" alt="Fairchild Photoreflector" width="642" height="532" /></p>
<p>Simply dropped this right in place of the existing photoreflector and it works a treat.</p>
<p><strong>Experiments with mounting the sensor to the gas meter</strong></p>
<p>So far, having attempted to mount the sensor on a little bracket in front of the meter, I can&#8217;t get an accurate reflection (annoyingly there is a clear plastic cover over the reflective disc which is at a 45 degree angle &#8211; sort of &#8211; and curved). Having run out of Blu-tac on a previous tinkering experiment, I&#8217;ll have to go get some more tomorrow in order to experiment with that.</p>
<p><strong>Reading the meter</strong></p>
<p>I just got my hands on a Nuelectronics LCD Shield so I&#8217;ll be setting that up soon to display the meter value.</p>
<p>More to follow soon&#8230;</p>
<br />Posted in Arduino, Projects  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=189&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/02/18/part-2a-the-sensor-bar-arduino-gas-meter-project/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/fairchildsensor.jpg" medium="image">
			<media:title type="html">Fairchild Photoreflector</media:title>
		</media:content>
	</item>
		<item>
		<title>Reading a gas meter with an Arduino, Part 2</title>
		<link>http://blog.richard.parker.name/2009/02/10/reading-a-gas-meter-with-an-arduino-part-2/</link>
		<comments>http://blog.richard.parker.name/2009/02/10/reading-a-gas-meter-with-an-arduino-part-2/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 00:47:54 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[gas meter]]></category>
		<category><![CDATA[phototransistor]]></category>

		<guid isPermaLink="false">http://brainthings.wordpress.com/?p=177</guid>
		<description><![CDATA[In Part 1 of Reading a Gas Meter with an Arduino, I outlined in brief what I wanted to achieve and how I thought I might go about it. In this second article, I detail my experiences using the photo-reflector purchased from Maplin. Since I haven&#8217;t yet created any circuits more complicated than some basic [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=177&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://brainthings.wordpress.com/2009/02/09/reading-a-gas-meter-with-an-arduino-part-1/">Part 1 of Reading a Gas Meter with an Arduino</a>, I outlined in brief what I wanted to achieve and how I thought I might go about it.</p>
<p>In this second article, I detail my experiences using the photo-reflector purchased from Maplin. Since I haven&#8217;t yet created any circuits more complicated than <a href="http://brainthings.wordpress.com/2009/02/09/arduino-traffic-lights-take-two/">some basic traffic lights</a>, this would be my first real experience using this type of sensor in a circuit. I had a feeling when starting that I&#8217;d be needing to use the pull-down resistor type set-up on one of the sensor pins, and it turns out I was right &#8211; special thanks to everyone on the <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234177936">Arduino Forums for assisting</a>.</p>
<p>It turns out, with a little help from the Arduino forums, it was pretty easy (it always is when you know how!). Having first connected the sensor to a digital input, and reading the value from the digital pin in the loop() method, it quickly became clear that trying to count one pass of the reflective disc on the gas meter in this manner wouldn&#8217;t work. Adding delay statements wouldn&#8217;t work either &#8211; I might miss the disc moving past the sensor as the speed it rotates is variable (depending on the amount of gas being consumed). If you&#8217;re not sure why this won&#8217;t work, think of the Arduino and photo-reflector as a high-speed camera: taking many frames per second the second a reflection is detected. You might receive &#8211; for argument&#8217;s sake &#8211; 1,000 &#8216;frames&#8217; while the gas meter disc is passing under the sensor, but how do you know &#8211; in code &#8211; which one to &#8216;act&#8217; upon and which to ignore? Clearly, you can&#8217;t send a thousand &#8216;pulses&#8217; to your data logger, because your data will all be wrong. This dilemma only came up because in my limited knowledge of the Arduino and the C++ implementation it uses meant that I was trying to stuff all this &#8220;detection logic&#8221; into the loop() statement.</p>
<p><strong>Enter the Hardware Interrupt&#8230; the simplest answer to the problem<br />
</strong></p>
<p>In my traditional .NET coding, I&#8217;d simply use an &#8216;event&#8217; to achieve what I wanted, and then write some minimal state-checking code. On the Arduino, however, I have learned that the hardware interrupt is basically very similar (but a bit cooler, actually!). What&#8217;s even better is that I don&#8217;t even need to bother with any complex code to determine whether or not the sensor is still sensing the same revolution of the disc: when you initialise the interrupt, you state whether you want it to be triggered when a certain condition is met, i.e. any state change, from low to high, from high to low etc. This really nifty feature is exactly what I needed.</p>
<p>Refer to line 7 of the sketch sample below to see how easy it is to register the interrupt. In this example, I simply use the interrupt to turn on an LED whenever the photo-reflector is LOW, i.e. it is detecting a reflection. In later articles, I&#8217;ll be changing this to do some logging. The reason for this, is simply that this hardware interrupt is fired only ONCE &#8211; and not again until the state changes.</p>
<p><strong>Finding out what&#8217;s going on under the hood</strong></p>
<p>I use the Serial library to output &#8216;debug&#8217; information to help me figure out what&#8217;s happening inside the Arduino. It&#8217;s not necessary for reading values from the photo-reflector, and at a later stage in this project I&#8217;ll probably remove the debug information as I&#8217;ll need to be sending the information that is read from the gas meter back to the PC somehow.</p>
<p><strong>The Sketch</strong></p>
<pre class="brush: cpp;">

int ledPin = 13;                     // select the pin for the LED
volatile int state = LOW;            // remember the current state

void setup() {
  pinMode(ledPin, OUTPUT);            // declare the ledPin as an OUTPUT
  Serial.begin(9600);
  attachInterrupt(0, check, CHANGE);  // attach an interrupt (interrupt 0 = digital pin 2)
}

void loop() {
  digitalWrite(ledPin, state);
}

void check() {    // Checks for feedback from the phototransistor
  state = !state;
  Serial.print(&quot;State changed to: &quot;);
  Serial.print(state);
  Serial.print(&quot;.\n&quot;);
}
</pre>
<p><strong>Photograph</strong></p>
<p><img class="alignnone" title="Arduino setup with Maplin photo-reflector" src="http://brainthings.files.wordpress.com/2009/02/photo.jpg?w=696&#038;h=330" alt="" width="696" height="330" /></p>
<p><strong>Schematic</strong></p>
<p>I have attempted to re-create the above in schematic form, using Fritzing. As mentioned in earlier posts, Fritzing is a beta tool and it doesn&#8217;t currently have symbols for all the electrical components one might use. Having searched the web for a suitable circuit symbol for my photoreflector, I can&#8217;t find one. I suspect that because, although the photo-reflector is an &#8216;all-in-one&#8217; design, it is actually just comprised of an LED and a photosensitive transistor:</p>
<p><strong><img class="alignnone size-full wp-image-186" title="Arduino schematic showing placement of maplin photo-reflector" src="http://brainthings.files.wordpress.com/2009/02/schematic.jpg?w=464&#038;h=652" alt="Arduino schematic showing placement of maplin photo-reflector" width="464" height="652" /><br />
</strong></p>
<p><strong>Next Steps&#8230;</strong></p>
<p>Now that I have figured out how to interpret a value from a photo-reflector within the Arduino, what I need to do is build a prototype sensor &#8216;bar&#8217; that I can mount to the gas meter. The next post on this subject will probably be just that &#8211; how I made (or am making!) the sensor bar. One point I&#8217;ll be bearing in mind is that I&#8217;d like to site the Arduino remotely from the sensor arm, and I&#8217;d like to be able to collect data from other sensors attached to the same board. Thinking &#8216;out loud&#8217; as I go really, but I promise to write a proper &#8216;How-To&#8217; article when I&#8217;m on the other side of the learning curve!</p>
<br />Posted in Arduino, Projects  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=177&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/02/10/reading-a-gas-meter-with-an-arduino-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/photo.jpg" medium="image">
			<media:title type="html">Arduino setup with Maplin photo-reflector</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/schematic.jpg" medium="image">
			<media:title type="html">Arduino schematic showing placement of maplin photo-reflector</media:title>
		</media:content>
	</item>
		<item>
		<title>Reading a gas meter with an Arduino, Part 1</title>
		<link>http://blog.richard.parker.name/2009/02/09/reading-a-gas-meter-with-an-arduino-part-1/</link>
		<comments>http://blog.richard.parker.name/2009/02/09/reading-a-gas-meter-with-an-arduino-part-1/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 18:00:37 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[gas meter]]></category>
		<category><![CDATA[phototransistor]]></category>

		<guid isPermaLink="false">http://brainthings.wordpress.com/?p=170</guid>
		<description><![CDATA[Ok, since I received my Arduino, I have been playing around with some simple projects in an effort to understand more about the way the Arduino board works, and to gather some of the basic electronic skills necessary to work with it. So now, I want to turn my attention to something a little more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=170&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, since I received my Arduino, I have been playing around with <a href="http://brainthings.wordpress.com/category/projects/">some simple projects</a> in an effort to understand more about the way the Arduino board works, and to gather some of the basic electronic skills necessary to work with it. So now, I want to turn my attention to something a little more in tune with my reasons for actually buying the Arduino in the first place: home automation.</p>
<p>After a trip to the gas meter cupboard, unfortunately my gas meter is not the type that outputs a digital &#8216;pulse&#8217; at regular intervals: it&#8217;s an odometer type. However, usefully, I did discover that it has a little reflective disc between the digit &#8217;6&#8242; and &#8217;7&#8242;, which could presumably be read with some kind of reflection sensor. I did some digging around to see who else on the web has built their own gas-meter readers, and found <a href="http://bwired.nl">BWired.nl</a>. This is an awesome site &#8211; certainly way beyond what most of us mere mortals could aspire to for our home automation setups! Anyway, <a href="http://bwired.nl/How_rfxcom.asp">on this page</a>, the owner describes using a &#8216;CNY70 Reflective Optical Sensor with Transistor Output&#8217;. After some digging around, I found that Maplin has something which (I think) might be similar <a href="http://www.maplin.co.uk/module.aspx?moduleno=12709">here </a>- it&#8217;s called &#8220;Photoreflector SY-CR102&#8243; and it costs £0.79! This neat little device includes a photo-emitting diode and a phototransistor, which should do the trick.</p>
<p>I&#8217;ll go down to the store and pickup the Photoreflector later today, and have a go at playing with it over the coming days. Essentially what I need to do is figure out how the sensor responds whenever the reflective disk of the gas meter passes the sensor aperture. In theory then, at least, it&#8217;s then going to be a case of simply counting the &#8216;pulses&#8217; from the sensor. Once I can do that, given that the dial will rotate once a known quantity of gas has been consumed, I should be able to create a very accurate sensor device that is synchronous with the gas meter itself.</p>
<p>Here&#8217;s how I imagine the project to unfold:</p>
<ul>
<li>Part 1: planning (you&#8217;re here!)</li>
<li><a href="http://brainthings.wordpress.com/2009/02/10/reading-a-gas-meter-with-an-arduino-part-2/">Part 2: connecting the phototransistor to the Arduino, and experimenting with creating a pulse counter</a></li>
<li><a href="http://brainthings.wordpress.com/2009/02/18/part-2a-the-sensor-bar-arduino-gas-meter-project/">Part 2a: building a prototype sensor &#8216;bar&#8217; to connect the phototransistor to the gas meter</a></li>
<li>Part 3: connecting the Arduino to the gas meter and capturing the data</li>
<li>Part 4: transmitting the data back to the PC (for this I&#8217;ll probably use an Ethernet Shield so I can send packets of data back to a client app)</li>
</ul>
<p>I&#8217;m quite excited about this &#8211; it&#8217;s such a steep learning curve though! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>/Rich</p>
<br />Posted in Arduino, Projects  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=170&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/02/09/reading-a-gas-meter-with-an-arduino-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>
	</item>
		<item>
		<title>Arduino Traffic Lights &#8211; Take Two</title>
		<link>http://blog.richard.parker.name/2009/02/09/arduino-traffic-lights-take-two/</link>
		<comments>http://blog.richard.parker.name/2009/02/09/arduino-traffic-lights-take-two/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 01:37:14 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[traffic lights]]></category>

		<guid isPermaLink="false">http://brainthings.wordpress.com/?p=154</guid>
		<description><![CDATA[Ok, so after starting my first project (yesterday: Arduino timer-based traffic lights), I decided to expand upon the concept today. In keeping with the traffic light theme (it seemed like a good idea!), I added a few extra LEDs and a digital switch so that someone can &#8216;cross the road&#8217; by pressing the button to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=154&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, so after starting my first project (yesterday: <a href="http://brainthings.wordpress.com/2009/02/07/arduino-traffic-lights-timer/">Arduino timer-based traffic lights</a>), I decided to expand upon the concept today. In keeping with the traffic light theme (it seemed like a good idea!), I added a few extra LEDs and a digital switch so that someone can &#8216;cross the road&#8217; by pressing the button to change the lights to red.</p>
<p><strong>Scenario</strong>: traffic and crossing lights</p>
<p>Instead of having the lights cycle from red &#8211; amber &#8211; green infinitely as in the previous project, this time I wanted the lights to go through a fake initialise sequence (i.e. turn on the Arduino board, have the red LED blink 5 times, then have all three traffic lights switch on, as an example) then to step to amber, then green. To make things a little more interesting, I also added two new LEDs: a &#8216;Green Man&#8217; and a &#8216;Red Man&#8217; light &#8211; to help our little pedestrians figure out when it&#8217;s safe to cross the road. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The traffic lights should remain on green until a &#8216;pedestrian&#8217; presses the crossing button, at which point we should go to amber, then red. We should wait a little bit for the pedestrian to cross, blink the green man light a few times to indicate that the pedestrian needs to get out of the road, followed by blinking the Amber light a few times to alert the traffic to get ready, then go back to a green traffic light and a red man light.</p>
<p>The lights and crossing should obey the following rules:</p>
<ul>
<li>When a red traffic light is displayed, the green man light should be on</li>
<li>When a green traffic light is displayed, the red man light should be on</li>
</ul>
<p>Common sense really! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So our sequence of events needs to resemble the following:</p>
<ul>
<li>Initialise the lights (blink red LED 5 times, then turn on all three traffic lights)</li>
<li>Show amber traffic light</li>
<li>Show green traffic light and wait on green
<ul>
<li>When the crossing button is pressed:
<ul>
<li>Show the amber traffic light</li>
<li>Show the red traffic light</li>
<li>Show the green man</li>
<li>Wait a preset amount of time to let the pedestrians cross</li>
<li>Blink the green man light a few times</li>
<li>Blink the amber traffic light a few times</li>
<li>Extinguish the green man light and turn on the red man light</li>
</ul>
</li>
<li>Resume green traffic light</li>
<li>Repeat!</li>
</ul>
</li>
</ul>
<p>After about a half hour tinkering, I&#8217;d stripped the breadboard and added a digital switch and two new LEDs (for the crossing indicators). The Arduino sketch was modified to include controls for the crossing LEDs, and the continuous alternating traffic light sequence was replaced with a solid green LED (which remains green until the switch is pressed).</p>
<p><strong>A quick observation: the digital switch and pull-down resistors<br />
</strong></p>
<p>My switch is connected to a digital input. Initially, this resulted in an intermittent switch: picking up HIGH or LOW sometimes worked, and sometimes didn&#8217;t. I figured out after a little bit of Googling that I actually needed to connect the switch in a mini &#8216;pull-down resistor circuit&#8217; which now works brilliantly. I will admit, I have yet to fully understand the principles behind why this works, but that&#8217;s something I will continue to look into (besides wanting to just have fun with the Arduino, one of my goals is to learn more about the basic electrical principles regarding physical computing).</p>
<p><strong>The board setup:</strong></p>
<p><strong><img class="alignnone size-full wp-image-157" title="Pedestrian Crossing with Traffic Lights" src="http://brainthings.files.wordpress.com/2009/02/crossinglightboard1.jpg?w=500&#038;h=308" alt="Pedestrian Crossing with Traffic Lights" width="500" height="308" /><br />
</strong></p>
<p><strong></strong></p>
<p><strong>And the wiring diagram:</strong></p>
<p><strong><img class="alignnone" title="Project #2 Wiring Diagram" src="http://brainthings.files.wordpress.com/2009/02/pedcrossingwiringdiagram1.jpg?w=500&#038;h=308" alt="" width="500" height="308" /></strong></p>
<p>Now then! The lovely <a href="http://fritzing.org">Fritzing </a>program I used to create the above diagram (which I absolutely love), is so new, that it doesn&#8217;t (yet) have a switch symbol for the type of switch I have used. Hence, with my very limited knowledge of electrical schematics, I&#8217;ve used the standard switch symbol and tried to represent how I&#8217;ve actually wired the switch up. Here&#8217;s a close-up photograph of what I&#8217;ve actually done, in the hopes that someone can correct me:</p>
<p><img class="alignnone size-medium wp-image-159" title="Switch Detail" src="http://brainthings.files.wordpress.com/2009/02/switchcloseup.jpg?w=300&#038;h=225" alt="Switch Detail" width="300" height="225" /></p>
<p>I found <a href="http://www.ladyada.net/learn/arduino/lesson5.html">this technique here</a>.</p>
<p><strong>Video:</strong></p>
<p><span style="text-align:center; display: block;"><a href="http://blog.richard.parker.name/2009/02/09/arduino-traffic-lights-take-two/"><img src="http://img.youtube.com/vi/KjQIFH5yVsE/2.jpg" alt="" /></a></span></p>
<p><strong>The Sketch</strong></p>
<p>This is a bit messy at the moment, but I&#8217;ll clean it up tomorrow (I&#8217;ve used generic on/off methods to set light states instead of just using a &#8216;setRed&#8217; or &#8216;setGreen&#8217; method, which encapsulates the code to extinguish lights that aren&#8217;t used by that mode, for instance) and also remove some of the &#8216;debugging&#8217; serial code I wrote:</p>
<pre class="brush: cpp;">
// Configure the light pins
int redLed = 2;
int yelLed = 3;
int grnLed = 4;
int redManLed = 8;
int grnManLed = 7;

// Program variables
int lightState = 0;
int crossingRequestSwitchPin = 13;            // The pin our crossing button is connected to
int switchStatePin = 6;

// Traffic Light Variables
int timerDelayTime = 3000;                    // The ms between each light change when running in timer mode
int crossingTime = 5000;

// Setup
void setup() {
  pinMode(redLed, OUTPUT);
  pinMode(yelLed, OUTPUT);
  pinMode(grnLed, OUTPUT);
  pinMode(switchStatePin, OUTPUT);
  pinMode(grnManLed, OUTPUT);
  pinMode(redManLed, OUTPUT);
  pinMode(crossingRequestSwitchPin, INPUT);
  Serial.begin(9600);                        // Initialise the serial port for debugging
  changeLightState(-1);                      // Set the light state to &quot;initialise&quot;.
}

void loop() {
 if (lightState == -1) {
   doBeginSequence();
   changeLightState(0);                      // Now our &quot;initialise&quot; phase is done, increment the light state
 }
 if (lightState == 0) {
   lightOn(redLed);
   lightOn(yelLed);
   lightOn(grnLed);
   delay(1500);
   startLightsOnTimer();
 }
}

void doBeginSequence() {                    // Handles the lighting sequence for lights that have just been started.
  Serial.println(&quot;Begin sequence was requested.&quot;);
  blinkLed(redLed, 5, 500);
}

void startLightsOnTimer() {

  Serial.println(&quot;Starting timed-sequence.&quot;);
  allLightsOff();                          // Turn all lights off

  while ( lightState == 0 ) {    

    lightOn(grnLed);
    lightOn(redManLed);

    /*lightOn(redLed);
    delay(timerDelayTime);
    lightOn(yelLed);
    delay(timerDelayTime);
    lightOff(redLed);
    lightOff(yelLed);
    lightOn(grnLed);
    */

    // When the light is green, allow anyone to signal for a crossing request
    int request = checkForCrossingRequest();
    if (request &gt; 0) {
      Serial.println(&quot;Beginning crossing sequence...\n&quot;);
      beginCrossing();
    }

  }

}

// Switch lights to red for a crossing sequence
void beginCrossing() {

   changeLightState(1);                 // Indicate that we're beginning a crossing sequence

   // Goto Amber...
   allLightsOff();
   lightOn(yelLed);
   delay(timerDelayTime);

   // Goto Red, and wait for crossingTime milliseconds before continuing...
   lightOff(redManLed);
   lightOff(yelLed);
   lightOn(redLed);
   lightOn(grnManLed);
   delay(crossingTime);
   blinkLed(grnManLed, 5, 500);

   // Blink the Yellow Led...
   lightOff(redLed);
   blinkLed(yelLed, 5, 500);            // Blink the Yellow LED 5 times to signal to drivers to proceed if the way is clear
   lightOn(grnLed);
   lightOff(grnManLed);
   changeLightState(0);                 // Change back to timer mode lighting

}

// Check for crossing button push
int checkForCrossingRequest() {
  int val = digitalRead(crossingRequestSwitchPin);
  if (val == HIGH) {
    Serial.println(&quot;*** Crossing Request Received ***\n&quot;);
    return 1;      // Crossing requested
  } else {
    return 0;
  }
}

// Helper functions
void lightOn(int pin) {      // Turn an LED on
   digitalWrite(pin, HIGH);
   Serial.print(&quot;Set pin &quot;);
   Serial.print(pin);
   Serial.print(&quot; to HIGH.\n&quot;);
}

void allLightsOff() {       // Turns all LEDs off
  digitalWrite(redLed, LOW);
  digitalWrite(yelLed, LOW);
  digitalWrite(grnLed, LOW);
  Serial.println(&quot;All lights turned OFF.\n&quot;);
}

void lightOff(int pin) {    // Turn an LED off
  digitalWrite(pin, LOW);
  Serial.print(&quot;Set pin &quot;);
  Serial.print(pin);
  Serial.print(&quot; to LOW.\n&quot;);
}

void blinkLed(int pin, int timesToBlink, int blinkIntervalMs) {  // Blinks the LED pin the set number of times
  Serial.print(&quot;Beginning blink sequence... Pin &quot;);
  Serial.print(pin);
  Serial.print(&quot;, &quot;);
  Serial.print(timesToBlink);
  Serial.print(&quot; times with a &quot;);
  Serial.print(blinkIntervalMs);
  Serial.println(&quot;ms interval between each blink.\n&quot;);

  for (int i=0; i &lt;= timesToBlink; i++) {
    digitalWrite(pin, HIGH);
    delay(blinkIntervalMs);
    digitalWrite(pin, LOW);
    delay(blinkIntervalMs);
  }
}

void changeLightState(int newLightState) { // Changes the current lightState
  Serial.print(&quot;Light state changed from &quot;);
  Serial.print(lightState);
  Serial.print(&quot; to &quot;);
  Serial.print(newLightState);
  Serial.println(&quot;.\n&quot;);
  lightState = newLightState;
}
</pre>
<p>So! There you have it&#8230; My second Arduino project&#8230; or, rather an extension of the first! Thanks for reading!</p>
<p>/Rich</p>
<p><strong><br />
</strong></p>
<br />Posted in Arduino, Projects  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/154/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=154&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/02/09/arduino-traffic-lights-take-two/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/crossinglightboard1.jpg" medium="image">
			<media:title type="html">Pedestrian Crossing with Traffic Lights</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/pedcrossingwiringdiagram1.jpg" medium="image">
			<media:title type="html">Project #2 Wiring Diagram</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/switchcloseup.jpg?w=300" medium="image">
			<media:title type="html">Switch Detail</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/KjQIFH5yVsE/2.jpg" medium="image" />
	</item>
		<item>
		<title>Unpacking the Arduino: making some traffic lights</title>
		<link>http://blog.richard.parker.name/2009/02/07/arduino-traffic-lights-timer/</link>
		<comments>http://blog.richard.parker.name/2009/02/07/arduino-traffic-lights-timer/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 16:12:38 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[sketch]]></category>
		<category><![CDATA[traffic lights]]></category>

		<guid isPermaLink="false">http://brainthings.wordpress.com/?p=141</guid>
		<description><![CDATA[My long-awaited Arduino Duemilanove board arrived today. Great! Now I have a use for all the miscellaneous electronic kit I have been randomly purchasing over the past week-and-a-half. After 10 minutes, it was connected, and the obligatory &#8220;Hello World&#8221; flashing-LED had been created. Woo! Sure it&#8217;s simple, but my entry into the world of physical [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=141&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My long-awaited Arduino Duemilanove board arrived today. Great! Now I have a use for all the miscellaneous electronic kit I have been randomly purchasing over the past week-and-a-half.</p>
<p>After 10 minutes, it was connected, and the obligatory &#8220;Hello World&#8221; flashing-LED had been created. Woo! Sure it&#8217;s simple, but my entry into the world of physical computing. Just a few minutes later, I&#8217;d expanded that solitary LED into a chain of 5 blinking LEDs (I know what you&#8217;re thinking: &#8220;that&#8217;s <em>awesome</em>, Rich&#8221;).</p>
<p><strong>My first project: timer-based traffic lights<br />
</strong></p>
<p>Given that I don&#8217;t have any force-sensors or other sensing gadgetry laying around just yet, I decided to model a simple, timer-based traffic light model comprising of three LEDs, and four combinations of light:</p>
<ul>
<li>Red</li>
<li>Red + Amber</li>
<li>Green</li>
<li>Amber</li>
</ul>
<p>(In the UK, that&#8217;s the sequence of traffic lights we use to dictate: &#8220;Stop&#8221;, &#8220;Proceed if it&#8217;s OK&#8221;, &#8220;Go&#8221;, &#8220;Get ready to stop&#8221;.)</p>
<p>I decided that, for the purposes of my first adventure, I would run the lights on a simple 2.5 second timer (long enough to figure out if the sequence is right, quick enough to prevent instantaneous brain boredom, waiting for them to change).</p>
<p>So, without further ado, the grand unveiling, here is my first Arduino circuit:</p>
<p><img class="alignnone size-full wp-image-142" title="Arduino Traffic Lights (Timer version)" src="http://brainthings.files.wordpress.com/2009/02/preview.jpg?w=422&#038;h=253" alt="Arduino Traffic Lights (Timer version)" width="422" height="253" /></p>
<p>Given that&#8217;s so messy, here&#8217;s a circuit diagram, created using <a href="http://fritzing.org">Fritzing</a> (which is awesome, by the way &#8211; go get it, it&#8217;s free):</p>
<p><img class="alignnone" title="Arduino Traffic Light Timer Version Schematic" src="http://brainthings.files.wordpress.com/2009/02/circuit-diagram1.jpg?w=422&#038;h=253" alt="" width="422" height="253" /></p>
<p>Ignore the fact it says &#8220;Arduino Diecimila&#8221;, I&#8217;m actually using the Arduino Duemilanove which I&#8217;m told is the newest one. I don&#8217;t think Fritzing has been updated with the new part just yet, but of course the bits you&#8217;re interested in are the pin connections&#8230;</p>
<p>Here&#8217;s a video of the traffic light sketch in action:</p>
<p><span style="text-align:center; display: block;"><a href="http://blog.richard.parker.name/2009/02/07/arduino-traffic-lights-timer/"><img src="http://img.youtube.com/vi/wzqun5cktXk/2.jpg" alt="" /></a></span></p>
<p>For posterity, I&#8217;ve also shown the sketch used to create this marvellous display of light:</p>
<pre class="brush: cpp;">
/* Richard's Traffic Light Program */

int pinRedLed = 2;
int pinYelLed = 3;
int pinGrnLed = 4;
int lightState = 0;

void setup() {
    pinMode(pinRedLed, OUTPUT);    /* Set the LED pins to output */
    pinMode(pinYelLed, OUTPUT);
    pinMode(pinGrnLed, OUTPUT);
    digitalWrite(pinRedLed, HIGH);  /* Turn the RED light on, so we don't cause any traffic accidents while we initialise <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  */
}

void loop() {

    lightState++;
    if (lightState &gt; 3) {            // If the light state &gt; 3, reset it to 0 (red).
      lightState = 0;
    }       

  delay(2500);

  /* Display correct light sequence */
  if (lightState == 0) { // Red
    digitalWrite(pinRedLed, HIGH);
    lightOff(pinYelLed);
    lightOff(pinGrnLed);
  }
  if (lightState == 1) { // Red and Amber
    digitalWrite(pinRedLed, HIGH);
    digitalWrite(pinYelLed, HIGH);
    lightOff(pinGrnLed);
  }
  if (lightState == 2) { // Green
    digitalWrite(pinGrnLed, HIGH);
    lightOff(pinYelLed);
    lightOff(pinRedLed);
  }
  if (lightState == 3) { // Amber-only
    digitalWrite(pinYelLed, HIGH);
    lightOff(pinRedLed);
    lightOff(pinGrnLed);
  }

}

void lightOff(int pin) {
  digitalWrite(pin, LOW);
}
</pre>
<p><strong>So what&#8217;s next?</strong><br />
Tomorrow, or as soon as I get some more spare time, I&#8217;m going to modify this sketch to wait for a button press before changing the light sequence (instead of working on a timer). Actually, thinking about it, it would be good to have the lights operating autonomously on a timer, but as soon as a button is pushed, stop the traffic (go to Amber, then Red), wait for 10 seconds to let our pedestrians cross the road safely, then let the traffic pass again (go to Red + Amber, then Green) and then resume timer functionality. Ooo! That sounds exciting! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>/Rich</p>
<br />Posted in Arduino, Projects  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=141&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/02/07/arduino-traffic-lights-timer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/preview.jpg" medium="image">
			<media:title type="html">Arduino Traffic Lights (Timer version)</media:title>
		</media:content>

		<media:content url="http://brainthings.files.wordpress.com/2009/02/circuit-diagram1.jpg" medium="image">
			<media:title type="html">Arduino Traffic Light Timer Version Schematic</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/wzqun5cktXk/2.jpg" medium="image" />
	</item>
		<item>
		<title>1 x Arduino short of a project</title>
		<link>http://blog.richard.parker.name/2009/02/01/1-x-arduino-short-of-a-project/</link>
		<comments>http://blog.richard.parker.name/2009/02/01/1-x-arduino-short-of-a-project/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 23:55:35 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[arduino]]></category>

		<guid isPermaLink="false">http://brainthings.wordpress.com/?p=113</guid>
		<description><![CDATA[Ok, so I couldn&#8217;t wait for Tinker.it&#8217;s Arduino Starter Kits to come back into stock &#8211; I&#8217;m so impatient. I also didn&#8217;t want to pay $40 for US shipping (after having to admit I overspend on &#8216;gadgetry&#8217;), so I sourced an Arduino board from coolcomponents.co.uk, and hit Maplin for just about everything else. As this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=113&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, so I couldn&#8217;t wait for Tinker.it&#8217;s Arduino Starter Kits to come back into stock &#8211; I&#8217;m so impatient. I also didn&#8217;t want to pay $40 for US shipping (after having to admit I overspend on &#8216;gadgetry&#8217;), so I sourced an Arduino board from <a href="http://www.coolcomponents.co.uk">coolcomponents.co.uk</a>, and hit Maplin for just about everything else. As this is my first ever foray into &#8216;physical computing&#8217;, I decided that I needed, well, everything. So I went and bought a Jump Wire Kit, a breadboard kit with banana sockets for power, a regulated switchable DC power supply, about a trillion LEDs, resistors, capacitors and anything else that looked &#8216;electronicy&#8217;.</p>
<p>I also bought <a href="http://www.amazon.co.uk/exec/obidos/ASIN/159200346X">Physical Computing</a> and <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0596510519">Making Things Work</a> &#8211; two excellent books.</p>
<p>So all this stuff has arrived, but my Arduino, ordered on the same day, hasn&#8217;t. So right now I&#8217;m like most kids who are stuck indoors looking out at the snow: I really, really just wanna play! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />Posted in Arduino, Projects  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brainthings.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brainthings.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brainthings.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brainthings.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brainthings.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brainthings.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brainthings.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brainthings.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brainthings.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brainthings.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brainthings.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brainthings.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brainthings.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brainthings.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.richard.parker.name&amp;blog=4676700&amp;post=113&amp;subd=brainthings&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.richard.parker.name/2009/02/01/1-x-arduino-short-of-a-project/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5ae52ab090a4ee98dd58240c2f3a937?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">Richard</media:title>
		</media:content>
	</item>
	</channel>
</rss>