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

<channel>
	<title>Eightlines Creations &#187; Arduino</title>
	<atom:link href="http://www.eightlines.com/blog/category/tutorial/arduino-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eightlines.com/blog</link>
	<description>Experiments in Physical Computing</description>
	<lastBuildDate>Wed, 09 Jun 2010 19:09:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Air Quality Monitoring</title>
		<link>http://www.eightlines.com/blog/2009/06/air-quality-monitoring/</link>
		<comments>http://www.eightlines.com/blog/2009/06/air-quality-monitoring/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 02:57:53 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[Air Quality]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Data Logger]]></category>
		<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=187</guid>
		<description><![CDATA[Recently I had a discussion with someone from the South Riverdale Community Health Centre on Air Quality monitoring in Ontario (AQI). I learned a number of things, there are only 40 Air Quality Monitors in Ontario and they test for six key indexes. Toronto runs a slightly different test, the Air Quality Health Index (AQHI) [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had a discussion with someone from the <a title="South Riverdale Community Health Centre" href="http://www.srchc.ca/">South Riverdale Community Health Centre</a> on Air Quality monitoring in Ontario (<span class="caps">AQI</span>). I learned a number of things, there are only <a title="AQI Ontario" href="http://www.ene.gov.on.ca/en/air/aqo/index.php#what" target="_blank">40 Air Quality Monitors in Ontario</a> and they test for six key indexes. Toronto runs a slightly different test, the <a title="Air Quality Health Index" href="http://www.ec.gc.ca/cas-aqhi/default.asp?lang=En&amp;n=CB0ADB16-1" target="_blank">Air Quality Health Index</a> (<span class="caps">AQHI</span>) which is a pilot programme and reports on how the Air Quality will affect your health. The <span class="caps">AQHI</span> test for <a title="AQHI Indicators" href="http://www.ec.gc.ca/cas-aqhi/default.asp?Lang=En&amp;n=065BE995-1#calculated" target="_blank">three key indicators</a>. Detecting three indexes sounds pretty&nbsp;reasonable.</p>
<p><a title="Mobile Air Quality Monitor by Eightlines, on Flickr" href="http://www.flickr.com/photos/eightlines/3597088400/"><img src="http://farm3.static.flickr.com/2466/3597088400_866e918c09_m.jpg" alt="Mobile Air Quality Monitor" width="240" height="180" align="left" /></a>By building my own Air Quality project I hope to be able to reproduce the <span class="caps">AQHI</span> results at a fraction of the price and provide instruction to enable anyone across the province a chance to build their&nbsp;own.</p>
<p>To the left is a photo of the final (but always in a state of flux) result. It is a <span class="caps">GPS</span> enabled device powered by two <span class="caps">AA</span>&#8217;s which senses Air Quality and Ozone. I am currently running tests in a variety of ways. This is a more complex setup than it has to be. Below I&#8217;ll detail both a simple setup and a complex&nbsp;setup.</p>
<p><strong>Simple Air Quality&nbsp;Monitor:</strong></p>
<ul>
<li><a title="Arduino Mini USB" href="http://arduino.cc/en/Main/MiniUSB" target="_blank"><span class="caps">USB</span>-Serial Connection</a>&nbsp;(~$15)</li>
<li><a title="Futurlec Sensors" href="http://www.futurlec.com/Gas_Sensors.shtml" target="_blank">Air Quality Sensor <span class="amp">&amp;</span> Ozone Sensor</a> ($6&nbsp;each)</li>
<li>2 Resistors ($.15 - I&#8217;m using a 15k&nbsp;Ohm)</li>
</ul>
<p>Connect the sensors as illustrated on the <a title="Wiring" href="http://www.wiring.org.co/learning/examples/airQuality_MQ135.html" target="_blank">Wiring.org</a> website. Attach to a computer and upload the data to a provider such as <a title="Pachube" href="http://www.pachube.com/" target="_blank">Pachube</a> to share with the world. (Need an invite? Message&nbsp;me.)</p>
<p><strong>Mobile Air Quality&nbsp;Monitor:</strong></p>
<ul>
<li><a title="Arduino Duemilanove" href="http://arduino.cc/en/Main/ArduinoBoardDuemilanove" target="_blank">Arduino</a>&nbsp;(~$45)</li>
<li><a title="Adafruit" href="http://www.adafruit.com/index.php?main_page=product_info&amp;cPath=17_21&amp;products_id=98" target="_blank"><span class="caps">GPS</span> Sheild</a>&nbsp;($16)</li>
<li><a title="Adafruit" href="http://www.adafruit.com/index.php?main_page=product_info&amp;cPath=18&amp;products_id=99" target="_blank"><span class="caps">GPS</span></a>&nbsp;($60)</li>
<li><span class="caps">SD</span>-Card ($20-60 depending on size - the <span class="caps">SD</span>-Card library uses a <span class="caps">FAT</span>-16 environment, so <span class="caps">1GB</span> is all you&#8217;re going to&nbsp;need)</li>
<li><a title="Adafruit" href="http://www.adafruit.com/index.php?main_page=product_info&amp;cPath=10&amp;products_id=14" target="_blank">MintyBoost</a> ($20 - 12 Hour lifespan for 2 AAs, 3 for a 9V&nbsp;battery)</li>
<li>Air Quality <span class="amp">&amp;</span> Ozone Sensor ($6 each, see above for&nbsp;links)</li>
<li>Batteries (~$5 - I&#8217;d suggest&nbsp;rechargables)</li>
<li>2 Resistors&nbsp;($.15)</li>
</ul>
<p>See above for the sensor connection details, then <a title="Ladyada.net" href="http://www.ladyada.net/make/gpsshield/download.html" target="_blank">download the code</a> to run the <span class="caps">GPS</span> and log the data (plus sensor data). I&#8217;m using the <span class="caps">GPS</span> <span class="caps">CSV</span> logging&nbsp;sketch.</p>
<p>Now for the&nbsp;notes:</p>
<ul>
<li>I have no idea if this is capale of producing valid <span class="caps">AQHI</span> data, I&#8217;m researching this&nbsp;now.</li>
<li>The sensors are not calibrated, the data should only be valid relative to my own readings. I&#8217;d like to make the result reproducible across all sorts of&nbsp;devices.</li>
<li>Particulates are not being measured. Someone suggested taking apart a smoke alarm to dig out the sensor. I still have to try&nbsp;this.</li>
<li>Mapping of my results is coming soon. I intend on using this device in a setting where I can measure the effects on a highway with and without cars in the coming days. I will post the&nbsp;results.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=187</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Coding with a Fork</title>
		<link>http://www.eightlines.com/blog/2009/03/coding-with-a-fork/</link>
		<comments>http://www.eightlines.com/blog/2009/03/coding-with-a-fork/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 02:17:51 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Found]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Bespin]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=173</guid>
		<description><![CDATA[Recently I&#8217;ve been experimenting with online coding tools, wonderfl and Bespin. Essentially both are IDE&#8217;s enabling you to write code with syntax highlighting. Wonderfl enables coding for the Flash environment, while Bespin works in the HTML/JavaScript spectrum. There&#8217;s some pretty immediate differences, Bespin is an attempt at building an environment entirely in Canvas and wonderfl [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been experimenting with online coding tools, <a title="wonderfl web site" href="http://wonderfl.kayac.com/" target="_blank">wonderfl</a> and <a title="wonderfl web site" href="http://wonderfl.kayac.com/" target="_blank"></a><a title="Bespin homepage" href="https://bespin.mozilla.com/" target="_blank">Bespin</a>. Essentially both are <span class="caps">IDE</span>&#8217;s enabling you to write code with syntax highlighting. Wonderfl enables coding for the Flash environment, while Bespin works in the <span class="caps">HTML</span>/JavaScript spectrum. There&#8217;s some pretty immediate differences, Bespin is an attempt at building an environment entirely in Canvas and wonderfl has the ability to generate the Flash piece on the&nbsp;fly.</p>
<p>Where things start getting interesting is when you start to be able to share the code with other developers. This is a more complete feature within wonderfl so for the next little bit I&#8217;ll concentrate on its model. This looks like a feature that will come with Bespin, allowing contributors to participate in Open Source&nbsp;initiatives.</p>
<p>Wonderfl allows the audience to browse other publicly available projects (does a private mode exist?). If they like the code they are free to fork the code and develop it in their own user environment. The owner of the original code is then notified that their code has been forked and is free to observe the changes. Its a smart introduction of social sharing that has always existed in the coding environment, but never to this level of&nbsp;slickness.</p>
<p>Today the guys over at the <a title="Arduino Blog" href="http://arduino.cc/blog/?p=209" target="_blank">Arduino Blog</a> posted this interesting hack enabling Bespin to enable syntax highlighting for Arduino code. Check out the comments, Olle Jonsson has developed a python script that allows you to compile (though still in the initial stages) Arduino code. Wonderfl has already produced some fantastic applications, and Bespin appears to be just getting started. There&#8217;s something significant brewing here, coding in the cloud appears to be something to watch very closely over the next couple of&nbsp;years.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=173</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating &#916;v to Maximize EEPROM Storage</title>
		<link>http://www.eightlines.com/blog/2008/12/calculating-v-to-maximize-eeprom-storage/</link>
		<comments>http://www.eightlines.com/blog/2008/12/calculating-v-to-maximize-eeprom-storage/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 20:08:20 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[EEPROM]]></category>
		<category><![CDATA[velocity]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=135</guid>
		<description><![CDATA[After a round of clarity (read: beer), Noel thought up a good way of maximizing the EEPROM memory in the data logger. Unfortunately it didn&#8217;t quite work, I&#8217;ll demonstrate&#160;below. To reiterate, the RPMs I was recording off of the Hall Sensor would increase to a rate of over 255 revolutions provided the speed was fast [...]]]></description>
			<content:encoded><![CDATA[<p>After a round of clarity (read: beer), Noel thought up a good way of maximizing the <span class="caps">EEPROM</span> memory in the data logger. Unfortunately it didn&#8217;t quite work, I&#8217;ll demonstrate&nbsp;below.</p>
<p>To reiterate, the RPMs I was recording off of the Hall Sensor would increase to a rate of over 255 revolutions provided the speed was fast enough. This makes it difficult to save the data to a single address block in the <span class="caps">EEPROM</span> without bit-shifting the data to two&nbsp;addresses.</p>
<p>What Noel suggested was that you might only have to record the change in velocity, or Δ<em>v</em>, to attain the same data. Recording the previous velocity in <span class="caps">RPM</span> minus the new velocity would give you a difference - which could in many cases be assured to be less than 255 revolutions at the wheel diameter I&#8217;m&nbsp;using.</p>
<p>For example, this is a fragment of the data I collected on one trip:<br />
[ [ 0,0 ], [ 0,55 ], [ 255,45 ], [ 255,35 ]&nbsp;]</p>
<p>This takes up eight address blocks. When bit-shifted back to its original values it looks like this:<br />
[ 0, 55, 300, 290&nbsp;]</p>
<p>But by recording the change in velocity we can reduce this by a factor of two.<br />
[ 0, 55, 245, -10&nbsp;]</p>
<p>You can achieve the same results by adding the values of the above array in a linear sequence. And therein lies the problem. The <span class="caps">EEPROM</span> address block can&#8217;t store a negative value (not without that extra byte), so we can&#8217;t reduce our&nbsp;reading.</p>
<p>Well, it was a pretty good idea, perhaps if we lived in a perpetual state of drunken stupor it would have worked&nbsp;out.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=135</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thinking out loud &#8212; Arduino as Webcam</title>
		<link>http://www.eightlines.com/blog/2008/12/thinking-out-loud-arduino-as-webcam/</link>
		<comments>http://www.eightlines.com/blog/2008/12/thinking-out-loud-arduino-as-webcam/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 19:51:55 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=131</guid>
		<description><![CDATA[Lately much of my work has been dealing with getting Flash to talk to the Arduino. There&#8217;s no real functionality to do this on its own, so you have to rely on some other components to host the conversation. There&#8217;s a whole host of methods you can use&#160;here: Socket Connection - This requires a socket [...]]]></description>
			<content:encoded><![CDATA[<p>Lately much of my work has been dealing with getting Flash to talk to the Arduino. There&#8217;s no real functionality to do this on its own, so you have to rely on some other components to host the conversation. There&#8217;s a whole host of methods you can use&nbsp;here:</p>
<ul>
<li>Socket Connection - This requires a socket policy to be set up on the server or else you&#8217;ll get a nasty SecurityError. I used Processing to open the connection, and Flash connects to that socket. Check out this <a title="Socket Connection" href="http://www.mikkoh.com/blog/?p=50" target="_blank">version</a> by Mikko Haapoja which uses Processing to generate OpenGL and pass it to Flash as a ByteArray. You pass bytes from here. Also check out <a title="AS3Glue" href="http://code.google.com/p/as3glue/" target="_blank">AS3Glue</a> which extends the Socket&nbsp;Connection.</li>
<li><a title="Merapi Project Home" href="http://www.merapiproject.net/" target="_blank">Merapi</a> - This bridges Java and&nbsp;Flash. </li>
<li><a title="Serproxy" href="http://www.arduino.cc/en/Main/Software" target="_blank">Serproxy</a> - Included with Arduino, different versions for Mac/Win/Linux. I had difficulty with Serproxy on a Mac and had to switch to a <a title="Serial Server" href="http://itp.nyu.edu/~dbo3/SerialServer/SerialServer.html" target="_blank">Java&nbsp;version</a>.</li>
</ul>
<div>All of these work, but the issue is that it still requires a second piece of software to be installed to mediate the connection. In an ideal world it would be nice if Flash could handle the Serial connection itself. This would probably fall under the <span class="caps">AIR</span> umbrella in order to properly handle the security permissions. </div>
<div>From what I understand this is a common request to Adobe, and there&#8217;s no date that has been set for the feature. This has got me thinking if there&#8217;s a way to do it ourselves. (Note: I have no experience writing drivers, so I&#8217;m just speculating at this point.)</div>
<div></div>
<div>The general idea is to write a driver that would fool the <span class="caps">OS</span> into thinking the Arduino is a webcam. With Flash having native support for the webcam, content sent from the Arduino would be received through the <a title="Camera Class" href="http://livedocs.adobe.com/flex/3/langref/flash/media/Camera.html" target="_blank">Camera class</a> (which is Final, so we can&#8217;t extend it). The video object would connect to Camera and interpret the transmission as a ByteArray. Theoretically, this would only give us Read ability. </div>
<div></div>
<div>This still leaves us with another piece of software to install, so in the end we&#8217;re no further ahead than we were using a proxy connection.</div>
<div></div>
<div>Before I dig in and figure out how to build a webcam driver, anyone have any input? Has anyone produced a simillar project? I&#8217;ve been searching for a while now and haven&#8217;t come up with any useful information. </div>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=131</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Machining a Maple Case for the GPS</title>
		<link>http://www.eightlines.com/blog/2008/11/machining-a-maple-case-for-the-gps/</link>
		<comments>http://www.eightlines.com/blog/2008/11/machining-a-maple-case-for-the-gps/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 02:10:52 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Data Logger]]></category>
		<category><![CDATA[Woodworking]]></category>
		<category><![CDATA[GPS]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/2008/11/machining-a-maple-case-for-the-gps/</guid>
		<description><![CDATA[GPS&#160;Case Originally uploaded by Eightlines Playing with code is fun, but when you do it all day for work it&#8217;s nice to come home and build something tangible. I picked up some scrap Hard Maple from the baseball bat manufacturer that happens to make Barry Bonds&#8217; bat of choice (purportedly). Now I&#8217;ve worked with Pine, [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;"><a title="photo sharing" href="http://www.flickr.com/photos/eightlines/3050988465/"><img style="border: solid 2px #000000;" src="http://farm4.static.flickr.com/3055/3050988465_f432b8f8fb_m.jpg" alt="" /></a></p>
<p><span style="font-size: 0.9em; margin-top: 0px;"><br />
<a href="http://www.flickr.com/photos/eightlines/3050988465/"><span class="caps">GPS</span>&nbsp;Case</a></p>
<p>Originally uploaded by <a href="http://www.flickr.com/people/eightlines/">Eightlines</a><br />
</span></div>
<p>Playing with code is fun, but when you do it all day for work it&#8217;s nice to come home and build something tangible. I picked up some scrap Hard Maple from the baseball bat manufacturer that happens to make Barry Bonds&#8217; bat of choice (purportedly). Now I&#8217;ve worked with Pine, Oak, Soft Maple, and some exotic woods, but I think this has to be my favourite. The stuff is durable, cuts really well, sands nicely, and has a nice texture to it. I&#8217;ve even tested it for a year under <a href="http://www.flickr.com/photos/eightlines/2376422109/in/photostream/">hard field conditions</a>. Its going to be interesting how this looks like once I finish the inlay, seal, and mounting on my&nbsp;bike.</p>
<p>I&#8217;m devising a quick release mounting mechanism for the stem of my bike. This is my current hang-up with the project. I&#8217;m also thinking of drilling to within 1/16&#8221; of the outside casing so that the <span class="caps">LED</span>&#8217;s display without protruding from the case. I&#8217;d have liked to do the same with the power button, but I couldn&#8217;t make the case wall thin enough to make it flexible without it&nbsp;cracking.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/2008/11/machining</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapping GPS Data</title>
		<link>http://www.eightlines.com/blog/2008/11/mapping-gps-data/</link>
		<comments>http://www.eightlines.com/blog/2008/11/mapping-gps-data/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 20:35:33 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Data Logger]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[Maps]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=105</guid>
		<description><![CDATA[When I last left the data logger project off I was having quite a few issues with managing the size of the data in the allotted EEPROM space on board the Arduino. I built up an SDCard writer based on several specs I found in the messageboard and it worked flawlessly. I successfully captured RPM [...]]]></description>
			<content:encoded><![CDATA[<p>When I last left the data logger project off I was having quite a few issues with managing the size of the data in the allotted <a title="EEPROM Build" href="http://www.eightlines.com/blog/2008/09/data-logging-to-the-arduino-eeprom/" target="_self"><span class="caps">EEPROM</span> space</a> on board the Arduino. I built up an <a title="SDCard writer post" href="http://www.eightlines.com/blog/2008/09/data-logger-next-steps/" target="_self">SDCard writer</a> based on several specs I found in the messageboard and it worked flawlessly. I successfully <a title="RPM Dataset" href="http://www.eightlines.com/projects/eepromDataLogger/" target="_blank">captured <span class="caps">RPM</span> data</a> from my bicycle commute. The problem was, I had no way to correlate one collection of data to the other. Different routes, days, time, weather could all affect the results of the&nbsp;dataset.</p>
<div id="attachment_106" class="wp-caption aligncenter" style="width: 510px"><a title="GPS Logger" href="http://www.eightlines.com/projects/gpsDataLogger/" target="_blank"><img class="size-full wp-image-106" title="GPS Tracking Sample" src="http://www.eightlines.com/blog/wp-content/uploads/2008/11/picture-1.png" alt="" width="500" height="225" /></a><p class="wp-caption-text">Note: Requires Flash Player&nbsp;10</p></div>
<p>It was never on my list of things to do since I knew the battery usage scenario would be so high, but I figured I&#8217;d bite the bullet and go the <span class="caps">GPS</span> route anyways. I picked up <a title="LadyAda GPS Sheild" href="http://www.ladyada.net/make/gpsshield/" target="_blank">LadyAda&#8217;s <span class="caps">GPS</span> Sheild</a> and have had a wonderful time working with it ever&nbsp;since.</p>
<p>I had been working on a way to parse the <span class="caps">NMEA</span> string data from the <span class="caps">GPS</span> device delivers when I figured it would be a perfect way to try out the <a title="Google Maps Flash API" href="http://code.google.com/apis/maps/documentation/flash/" target="_blank">Google Maps Flash <span class="caps">API</span></a> (my previous experience had only been using the JavaScript <span class="caps">API</span>, and Yahoo Maps <span class="caps">API</span>) and Flash Player 10. Flash Player 10 offers a number of new features, one of which being the FileReference <span class="caps">API</span> which allows you to browse for a file on your local machine and load it into the Flash Player without making a round trip to the server. Once loaded I split the text file based on the carriage return and cast all of the <span class="caps">GPS</span> Points to a Vector (another new feature&thinsp;&#8212;&thinsp;typecast Array. The speed difference is quite&nbsp;staggering!).</p>
<p>The end result is plotted on a map and colour coded based on velocity, which is recorded in Knots and translated to Km/h. The end result is a colourful chart of the route I commuted that particular&nbsp;day.</p>
<p>In the screenshot above, note the big red blotch at Allen Gardens&thinsp;&#8212;&thinsp;flat tire. The other red marks are stop lights or&nbsp;streetcars.</p>
<p>An example of the map in action requires some coordinates, so save these <a title="Log File 1" href="http://www.eightlines.com/projects/gpsDataLogger/GPSLOG01.TXT" target="_blank">text</a> <a title="Log File 2" href="http://www.eightlines.com/projects/gpsDataLogger/GPSLOG02.TXT" target="_blank">files</a> to your machine first (contains a couple hundred lines of <span class="caps">NMEA</span> data), and hit the load button in the <a title="GPS Logger" href="http://www.eightlines.com/projects/gpsDataLogger/" target="_blank">map application</a>. Once loaded the map should recentre on the coordinate&nbsp;boundary.</p>
<p>I&#8217;m currently working on some new modifications for the map so I should have more available soon. But first I&#8217;m putting the finishing touches on a wooden case I&#8217;m hand crafting as a shell for the <span class="caps">GPS</span> device. I&#8217;ll have photos up from that project&nbsp;soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=105</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Data Logger &#8212; Next Steps</title>
		<link>http://www.eightlines.com/blog/2008/09/data-logger-next-steps/</link>
		<comments>http://www.eightlines.com/blog/2008/09/data-logger-next-steps/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 01:46:23 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Data Logger]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[SD Card]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=73</guid>
		<description><![CDATA[The Arduino EEPROM is a useful thing to have available for those times when you need to store small samples of data. In my initial data logger prototype I managed to record the Hall Sensor data into two bytes worth of space per minute interval. This gave me around 4.25 hours of recording&#160;data. What if [...]]]></description>
			<content:encoded><![CDATA[<p>The Arduino <span class="caps">EEPROM</span> is a useful thing to have available for those times when you need to store small samples of data. In my initial data logger prototype I managed to record the Hall Sensor data into two bytes worth of space per minute interval. This gave me around 4.25 hours of recording&nbsp;data.</p>
<p>What if you wanted to record more data, or at an increased resolution? Adding another sensor would further reduce your available space depending on how many bytes the recorded data would require. Its time to look at other methods of storing&nbsp;data.</p>
<ul>
<li>An <a title="Arduino Website - I2C EEPROM" href="http://www.arduino.cc/playground/Code/I2CEEPROM" target="_blank"><span class="caps">I2C</span> <span class="caps">EEPROM</span></a> with greater storage capacity connected to the Arduino using the wire.h library - couldn&#8217;t readily find an <span class="caps">IC</span> from any local&nbsp;vendors</li>
<li><span class="caps">USB</span> Stick - got these sitting around, but the Arduino won&#8217;t act as a host device. <a title="Viniculum Website" href="http://www.vinculum.com/products.html" target="_blank">Viniculum</a> makes such a device, but it would require an additional purchase and possibly a bigger form&nbsp;factor</li>
<li><a title="Arduino Forums - SD Card Schematic" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/8" target="_blank"><span class="caps">SD</span> Card</a> - readily available, just had to rip apart a cheap card reader for the&nbsp;port</li>
</ul>
<div class="wp-caption aligncenter" style="width: 385px"><a href="http://www.flickr.com/photos/eightlines/2903600322/"><img title="Data Logger Prototype V2" src="http://farm4.static.flickr.com/3143/2903600322_b06b422401.jpg" alt="SD Card Writer" width="375" height="500" /></a><p class="wp-caption-text"><span class="caps">SD</span> Card Writer - Data Logger Prototype&nbsp;V2</p></div>
<p>I&#8217;m coming to the realization that the more difficult phase of this project is making sense of the data I&#8217;m collecting. I&#8217;m currently working on an application which monitors the data and charts and maps the correlations, but the collection of the data needs to be more seamless. I&#8217;m currently looking at a number of services, so I&#8217;ll be sure to write about them&nbsp;later.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=73</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Data Logging to the Arduino EEPROM</title>
		<link>http://www.eightlines.com/blog/2008/09/data-logging-to-the-arduino-eeprom/</link>
		<comments>http://www.eightlines.com/blog/2008/09/data-logging-to-the-arduino-eeprom/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 18:14:31 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Data Logger]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=45</guid>
		<description><![CDATA[<dl id="attachment_47" class="wp-caption alignright" style="width: 290px;"> <dt class="wp-caption-dt"><a href="http://www.eightlines.com/blog/wp-content/uploads/2008/09/datalogger.gif"><img class="size-full wp-image-47" title="Data Logger Schematic" src="http://www.eightlines.com/blog/wp-content/uploads/2008/09/datalogger.gif" alt="Data Logger Schematic" width="280" height="297" /></a></dt> </dl>I made the first successful run with the data logger yesterday. I've wired up a hall sensor to the wheel of my bike and recorded 60s intervals of my ride into work and back.  Ideally I'm looking for increased resolution over a typical bicycle computer; where a low cost <a title="CatEye Website" href="http://www.cateye.com/" target="_blank">CatEye</a> gives you average speed over the course of a total ride, I'd like to see how that average speed changes in increments. I recognize I wouldn't be able to compete with a device such as a <a title="Garmin Website" href="http://www.garmin.com/garmin/cms/site/us" target="_blank">Garmin</a>, but I could definitely improve on the $30 devices you get at bike stores.]]></description>
			<content:encoded><![CDATA[<dl id="attachment_47" class="wp-caption alignright" style="width: 290px;">
<dt class="wp-caption-dt"><a href="http://www.eightlines.com/blog/wp-content/uploads/2008/09/datalogger.gif"><img class="size-full wp-image-47" title="Data Logger Schematic" src="http://www.eightlines.com/blog/wp-content/uploads/2008/09/datalogger.gif" alt="Data Logger Schematic" width="280" height="297" /></a></dt>
</dl>
<p>I made the first successful run with the data logger yesterday. I&#8217;ve wired up a hall sensor to the wheel of my bike and recorded 60s intervals of my ride into work and back.  Ideally I&#8217;m looking for increased resolution over a typical bicycle computer; where a low cost <a title="CatEye Website" href="http://www.cateye.com/" target="_blank">CatEye</a> gives you average speed over the course of a total ride, I&#8217;d like to see how that average speed changes in increments. I recognize I wouldn&#8217;t be able to compete with a device such as a <a title="Garmin Website" href="http://www.garmin.com/garmin/cms/site/us" target="_blank">Garmin</a>, but I could definitely improve on the $30 devices you get at bike&nbsp;stores.</p>
<p>The first issue was how to deal with the intermittent pickups of the Hall Sensor. If the sensor fired too rapidly and the loop method wasn&#8217;t in the right position you wouldn&#8217;t pick up the digital I/O change. The solution, offered by <a href="http://www.eightlines.com/blog/2008/08/data-logger/#comment-18">Blalor</a>, was to use the Arduino <a title="Arduino Interrupt Reference" href="http://www.arduino.cc/en/Reference/AttachInterrupt" target="_blank">Interrupt</a> commands. The Interrupt fires whenever a digital I/O signal is received. In this case I receive a 1 every loop. I&#8217;d be looking for a 0, so I&#8217;d set the Interrupt to look for a <em><span class="caps">FALLING</span></em>&nbsp;attribute.</p>
<p>The <span class="caps">EEPROM</span> was the next issue. 512 bytes is a serious limitation. Some math was required to see if I what wanted to do was even possible. If I were to poll every minute over a ride I&#8217;d be able to record 8.5 hours of one byte readings. That&#8217;s pretty good, seeing a 200km ride would take approximately 6&nbsp;hours.</p>
<p>One byte is capable of storing 256 possible values. Is that enough, or would I need more values? If my revolutions were 255 with a wheel circumference of 2110mm I&#8217;d be traveling an average speed of 32km/h. Clearly not enough. I&#8217;d need to peak at 70km/h, with an average at maybe&nbsp;30-40km/h.</p>
<p>Is it possible to compress a value of over 256 into a byte? <a title="Neil Marshall's Portfolio" href="http://eightlines.com/neil/" target="_blank">Neil</a> sent along an interesting piece of code on <a title="Octet Packed Integers" href="http://wiki.tcl.tk/4334" target="_blank">Octet Packed Integers</a>. This code is a little beyond my comprehension so I gave it a pass. Instead it was decided to use a second byte. This allows a max value of 65535 rotations to be recorded&thinsp;&#8212;&thinsp;and at a circumference of 2110mm a max speed of 8257km/h. Well over the speed of sound! That should give me ample room to&nbsp;accelerate.</p>
<p>Problem is the second byte reduces my overall recording time to 4.25 hours. I also decided to remove 2 bytes from the array so I could track my counter when the device was turned off. When you start it back up it starts recording at the next address from where you left off. One possible solution to the space issue is to externalize the <span class="caps">EEPROM</span> and use the <a href="http://www.arduino.cc/en/Reference/Wire" target="_blank">wire.h</a> library to communicate. This would also reduce the issue of each address of the <span class="caps">EEPROM</span> only be written (and guaranteed) <a href="http://en.wikipedia.org/wiki/Non-volatile_memory" target="_blank">100,000</a>&nbsp;times.</p>
<p>Neil also helped with the splitting of the rotation counter across two bytes. We took the full rotation count and masked it out with a hex value of 0x00FF and stored that as an <em>int low</em>. Then the full rotation count was bit-shifted right ( &lt;&lt; 8 ) and stored as <em>int high</em>. When the report is generated after the ride the values are recombined and reported back to the&nbsp;screen.</p>
<p>I also added in three indicator LEDs for the Hall pickup, reset button, and report button. The reset button when held down for three seconds deletes all the data on the <span class="caps">EEPROM</span>,  anything less than that will generate a report of the current <span class="caps">EEPROM</span>&nbsp;memory.</p>
<p>I&#8217;ve included the code below, any suggestions on improvements would be much&nbsp;appreciated.</p>
<pre class="c"><span style="color: #339933;">#include </span>
&nbsp;
<span style="color: #339933;">#define PIN_SENSOR_HALL 2 //Hall Sensor</span>
<span style="color: #339933;">#define PIN_LED_HALL 13 //Hall indicator <span class="caps">LED</span></span>
<span style="color: #339933;">#define PIN_LED_RESET 6 //Reset indicator <span class="caps">LED</span></span>
<span style="color: #339933;">#define PIN_LED_RESET_COMPLETE 5 //Reset complete indicator</span>
<span style="color: #339933;">#define PIN_BUTTON_RESET 7 //Reset/Report Button</span>
<span style="color: #339933;">#define TIME_INTERVAL 60000 //<span class="caps">EEPROM</span> write interval (60s)</span>
<span style="color: #339933;">#define MEM_SIZE 510 //<span class="caps">EEPROM</span> memory size (remaining 2 bytes reserved for count)</span>
&nbsp;
<span style="color: #993333;">long</span> countReset = <span style="color: #cc66cc;">-1</span>;
<span style="color: #993333;">long</span> countCurrent = <span style="color: #cc66cc;">-1</span>;
<span style="color: #993333;">int</span> countEEPROM = <span style="color: #cc66cc;">0</span>; <span style="color: #808080; font-style: italic;">//<span class="caps">EEPROM</span> Address Count</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">int</span> countRotation = <span style="color: #cc66cc;">0</span>; <span style="color: #808080; font-style: italic;">//Rotation Counter</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
  pinMode<span style="color: #66cc66;">&#40;</span>PIN_SENSOR_HALL, <span class="caps">INPUT</span><span style="color: #66cc66;">&#41;</span>;
  pinMode<span style="color: #66cc66;">&#40;</span>PIN_LED_HALL, <span class="caps">OUTPUT</span><span style="color: #66cc66;">&#41;</span>;
  pinMode<span style="color: #66cc66;">&#40;</span>PIN_LED_RESET, <span class="caps">OUTPUT</span><span style="color: #66cc66;">&#41;</span>;
  pinMode<span style="color: #66cc66;">&#40;</span>PIN_LED_RESET_COMPLETE, <span class="caps">OUTPUT</span><span style="color: #66cc66;">&#41;</span>;
  pinMode<span style="color: #66cc66;">&#40;</span>PIN_BUTTON_RESET, <span class="caps">INPUT</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  Serial.<span style="color: #202020;">begin</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">115200</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  countEEPROM = <span class="caps">EEPROM</span>.<span style="color: #202020;">read</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">512</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//Set counter to last known free space</span>
&nbsp;
  reportEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;  <span style="color: #808080; font-style: italic;">//Report all <span class="caps">EEPROM</span> entries</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
  digitalWrite<span style="color: #66cc66;">&#40;</span>PIN_LED_HALL, <span class="caps">LOW</span><span style="color: #66cc66;">&#41;</span>;
  digitalWrite<span style="color: #66cc66;">&#40;</span>PIN_LED_RESET_COMPLETE, <span class="caps">HIGH</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">//Write to <span class="caps">EEPROM</span> at specified interval</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>millis<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> % TIME_INTERVAL<span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
    writeEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">//If Hall Sensor triggered then init the test</span>
  attachInterrupt<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, incrementRotation, <span class="caps">FALLING</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  resetEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> reportEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
  Serial.<span style="color: #202020;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span class="caps">EEPROM</span> Report: &quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;[&quot;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color: #cc66cc;">0</span>; i &amp;lt; <span style="color: #66cc66;">&#40;</span>MEM_SIZE - <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>; i = <span style="color: #66cc66;">&#40;</span>i + <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#123;</span>
    <span style="color: #993333;">int</span> h = <span class="caps">EEPROM</span>.<span style="color: #202020;">read</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span> &amp;lt; &amp;lt; <span style="color: #cc66cc;">8</span>;
    <span style="color: #993333;">int</span> l = <span class="caps">EEPROM</span>.<span style="color: #202020;">read</span><span style="color: #66cc66;">&#40;</span>i + <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span>h + l<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>i != <span style="color: #66cc66;">&#40;</span>MEM_SIZE - <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;,&quot;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
  Serial.<span style="color: #202020;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;]&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> incrementRotation<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
  countRotation++;
  digitalWrite<span style="color: #66cc66;">&#40;</span>PIN_LED_HALL, <span class="caps">HIGH</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Rotations: &quot;</span><span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">println</span><span style="color: #66cc66;">&#40;</span>countRotation<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> writeEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
  byte low = countRotation &amp;amp; 0x00FF;
  byte high = countRotation &amp;gt;&amp;gt; <span style="color: #cc66cc;">8</span>;
&nbsp;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span class="caps">EEPROM</span> Address: &quot;</span><span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span>countEEPROM<span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;, High: &quot;</span><span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span>high, <span class="caps">BIN</span><span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;, Low: &quot;</span><span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span>low, <span class="caps">BIN</span><span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;, Stored: &quot;</span><span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span>low + <span style="color: #66cc66;">&#40;</span>high &amp;lt; &amp;lt; <span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span>, <span class="caps">DEC</span><span style="color: #66cc66;">&#41;</span>;
  Serial.<span style="color: #202020;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;;&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span class="caps">EEPROM</span>.<span style="color: #202020;">write</span><span style="color: #66cc66;">&#40;</span>countEEPROM, high<span style="color: #66cc66;">&#41;</span>;
  <span class="caps">EEPROM</span>.<span style="color: #202020;">write</span><span style="color: #66cc66;">&#40;</span>countEEPROM + <span style="color: #cc66cc;">1</span>, low<span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>countEEPROM + <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> &amp;lt; MEM_SIZE<span style="color: #66cc66;">&#41;</span>
    countEEPROM = countEEPROM + <span style="color: #cc66cc;">2</span>; <span style="color: #808080; font-style: italic;">//Increment the <span class="caps">EEPROM</span> Address</span>
  <span style="color: #b1b100;">else</span>
    countEEPROM = <span style="color: #cc66cc;">0</span>; <span style="color: #808080; font-style: italic;">//Loop back to start address</span>
&nbsp;
  <span class="caps">EEPROM</span>.<span style="color: #202020;">write</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">512</span>, countEEPROM<span style="color: #66cc66;">&#41;</span>;
&nbsp;
  countRotation = <span style="color: #cc66cc;">0</span>; <span style="color: #808080; font-style: italic;">//Reset the rotation count</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> resetEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>digitalRead<span style="color: #66cc66;">&#40;</span>PIN_BUTTON_RESET<span style="color: #66cc66;">&#41;</span> == <span class="caps">LOW</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#123;</span>
    digitalWrite<span style="color: #66cc66;">&#40;</span>PIN_LED_RESET, <span class="caps">LOW</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>countReset == <span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">//Start Reset counter only if -1</span>
      countReset = millis<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
  <span style="color: #b1b100;">else</span>
  <span style="color: #66cc66;">&#123;</span>
    digitalWrite<span style="color: #66cc66;">&#40;</span>PIN_LED_RESET, <span class="caps">HIGH</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>countReset != <span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
      countCurrent = millis<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>countCurrent - countReset<span style="color: #66cc66;">&#41;</span> &amp;gt; <span style="color: #cc66cc;">3000</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#123;</span>
        Serial.<span style="color: #202020;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Reset&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color: #cc66cc;">0</span>; i &amp;lt; MEM_SIZE; i++<span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
          <span class="caps">EEPROM</span>.<span style="color: #202020;">write</span><span style="color: #66cc66;">&#40;</span>i, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        digitalWrite<span style="color: #66cc66;">&#40;</span>PIN_LED_RESET_COMPLETE, <span class="caps">LOW</span><span style="color: #66cc66;">&#41;</span>;
        delay<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span>;
        digitalWrite<span style="color: #66cc66;">&#40;</span>PIN_LED_RESET_COMPLETE, <span class="caps">HIGH</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
      reportEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      countCurrent = countReset = <span style="color: #cc66cc;">-1</span>;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>The post ride report looks something like this (values are in rotations per&nbsp;minute):</p>
<pre class="c">EEPROM Report:
<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">-31156</span>,<span style="color: #cc66cc;">310</span>,<span style="color: #cc66cc;">332</span>,<span style="color: #cc66cc;">300</span>,<span style="color: #cc66cc;">392</span>,<span style="color: #cc66cc;">306</span>,<span style="color: #cc66cc;">216</span>,<span style="color: #cc66cc;">598</span>,<span style="color: #cc66cc;">228</span>,<span style="color: #cc66cc;">516</span>,<span style="color: #cc66cc;">390</span>,<span style="color: #cc66cc;">282</span>,<span style="color: #cc66cc;">254</span>,<span style="color: #cc66cc;">354</span>,
<span style="color: #cc66cc;">496</span>,<span style="color: #cc66cc;">198</span>,<span style="color: #cc66cc;">436</span>,<span style="color: #cc66cc;">60</span>,<span style="color: #cc66cc;">254</span>,<span style="color: #cc66cc;">263</span>,<span style="color: #cc66cc;">400</span>,<span style="color: #cc66cc;">382</span>,<span style="color: #cc66cc;">280</span>,<span style="color: #cc66cc;">394</span>,<span style="color: #cc66cc;">362</span>,<span style="color: #cc66cc;">340</span>,<span style="color: #cc66cc;">300</span>,<span style="color: #cc66cc;">306</span>,<span style="color: #cc66cc;">256</span>,
<span style="color: #cc66cc;">380</span>,<span style="color: #cc66cc;">354</span>,<span style="color: #cc66cc;">297</span>,<span style="color: #cc66cc;">284</span>,<span style="color: #cc66cc;">20</span>,<span style="color: #cc66cc;">72</span>,<span style="color: #cc66cc;">378</span>,<span style="color: #cc66cc;">486</span>,<span style="color: #cc66cc;">450</span>,<span style="color: #cc66cc;">104</span>,<span style="color: #cc66cc;">398</span>,<span style="color: #cc66cc;">522</span>,<span style="color: #cc66cc;">372</span>,<span style="color: #cc66cc;">370</span>,<span style="color: #cc66cc;">133</span>,<span style="color: #cc66cc;">366</span>,
<span style="color: #cc66cc;">360</span>,<span style="color: #cc66cc;">164</span>,<span style="color: #cc66cc;">336</span>,<span style="color: #cc66cc;">460</span>,<span style="color: #cc66cc;">542</span>,<span style="color: #cc66cc;">488</span>,<span style="color: #cc66cc;">366</span>,<span style="color: #cc66cc;">396</span>,<span style="color: #cc66cc;">384</span>,<span style="color: #cc66cc;">512</span>,<span style="color: #cc66cc;">484</span>,<span style="color: #cc66cc;">300</span>,<span style="color: #cc66cc;">300</span>,<span style="color: #cc66cc;">332</span>,<span style="color: #cc66cc;">346</span>,
<span style="color: #cc66cc;">344</span>,<span style="color: #cc66cc;">360</span>,<span style="color: #cc66cc;">398</span>,<span style="color: #cc66cc;">226</span>,<span style="color: #cc66cc;">360</span>,<span style="color: #cc66cc;">390</span>,<span style="color: #cc66cc;">8</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,
<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,
<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,
<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,
<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,
<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,
<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span></pre>
<p>There appears to be some irrelevant data in the mix (see the array item 0 for example) which I haven&#8217;t quite figured out. The numbers don&#8217;t quite calculate to the precision I expect from a cycle computer. I have a feeling the Hall count is firing multiple times per revolution&thinsp;&#8212;&thinsp;like it has a <em><span class="caps">FALLING</span></em> state more than&nbsp;once.</p>
<p>Here is a quick <a title="Data Logger JavaScript Example" href="http://www.eightlines.com/projects/eepromDataLogger/" target="_blank">JavaScript rendition</a> of the data in a bar chart format. The RPMs are converted using this&nbsp;equation:</p>
<p>(((rpm * wheel circumference) / 1000) / 1000) * 60 =&nbsp;km/h</p>
<p>The next phase is to gather data on multiple days for the same course and comparing the results for analysis. I&#8217;m looking at developing an <a title="Adobe AIR Product page" href="http://www.adobe.com/products/air/" target="_blank">Adobe <span class="caps">AIR</span> Project</a> which would allow me to keep an offline/online database. Getting real time data is another big incentive and I&#8217;d be looking at the XBee solution for that. Being able to record heart rate data and <span class="caps">GPS</span>/Digital Compass are also interesting but the limitations of the <span class="caps">EEPROM</span> don&#8217;t easily allow for recording of data that complex. So I think hooking up an SDCard is the next most probable option. I&#8217;ve already tried a <span class="caps">USB</span> adapter but the Arduino does not have <span class="caps">USB</span> host capabilities, so that didn&#8217;t work. There are options to get the <span class="caps">USB</span> host to work, but it involves purchasing another <span class="caps">PCB</span>. Finally, I don&#8217;t think any of this makes much sense without introducing a mapping <span class="caps">API</span> to add context to the data. So there&#8217;s still lots more to&nbsp;come!</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=45</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Data Logger</title>
		<link>http://www.eightlines.com/blog/2008/08/data-logger/</link>
		<comments>http://www.eightlines.com/blog/2008/08/data-logger/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 02:29:44 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Data Logger]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[EEPROM]]></category>
		<category><![CDATA[Hall Sensor]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=30</guid>
		<description><![CDATA[Been working on a data logging application lately with the intentions of recording my biking sessions and displaying them on a mapping API. The general idea is to use the Hall sensor common in many RPM applications to record revolutions to the EEPROM onboard the&#160;Arduino. I&#8217;m having a few issues getting the readings I need, [...]]]></description>
			<content:encoded><![CDATA[<p>Been working on a data logging application lately with the intentions of recording my biking sessions and displaying them on a mapping <span class="caps">API</span>. The general idea is to use the Hall sensor common in many <span class="caps">RPM</span> applications to record revolutions to the <span class="caps">EEPROM</span> onboard the&nbsp;Arduino.</p>
<p>I&#8217;m having a few issues getting the readings I need, namely the revolutions are not counting with any consistency. I think the issue is with the way Arduino loops through the script. Below is the first iteration of the code I&#8217;ve&nbsp;written.</p>
<p><strong><span class="caps">NOTE</span>: </strong>Script updated August 31, with Blalor&#8217;s suggestions. The <span class="caps">RPM</span> reading now works with a high rate of&nbsp;speed.</p>
<pre class="c"><span style="color: #993333;">int</span> pinHall = <span style="color: #cc66cc;">2</span>; <span style="color: #808080; font-style: italic;">//Hall Sensor</span>
<span style="color: #993333;">int</span> pinLed = <span style="color: #cc66cc;">13</span>; <span style="color: #808080; font-style: italic;">//Indicator <span class="caps">LED</span></span>
<span style="color: #993333;">int</span> time = <span style="color: #cc66cc;">10000</span>; <span style="color: #808080; font-style: italic;">//<span class="caps">EEPROM</span> Write Interval</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">int</span> rpm = <span style="color: #cc66cc;">0</span>; <span style="color: #808080; font-style: italic;">//<span class="caps">RPM</span> Counter</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    pinMode<span style="color: #66cc66;">&#40;</span>pinHall, <span class="caps">INPUT</span><span style="color: #66cc66;">&#41;</span>;
    pinMode<span style="color: #66cc66;">&#40;</span>pinLed, <span class="caps">OUTPUT</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    Serial.<span style="color: #202020;">begin</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">9600</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">//Write to <span class="caps">EEPROM</span> at specified interval</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>millis<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> % time<span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
        writeEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">//If Hall Sensor triggered then init the test</span>
    attachInterrupt<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, incrementRPM, <span class="caps">FALLING</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> incrementRPM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
        rpm++;
        digitalWrite<span style="color: #66cc66;">&#40;</span>pinLed, <span class="caps">HIGH</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
        Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span class="caps">RPM</span>: &quot;</span><span style="color: #66cc66;">&#41;</span>;
        Serial.<span style="color: #202020;">println</span><span style="color: #66cc66;">&#40;</span>rpm<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> writeEEPROM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    noInterrupts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    Serial.<span style="color: #202020;">print</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span class="caps">EEPROM</span>: &quot;</span><span style="color: #66cc66;">&#41;</span>;
    Serial.<span style="color: #202020;">println</span><span style="color: #66cc66;">&#40;</span>rpm<span style="color: #66cc66;">&#41;</span>;
    rpm = <span style="color: #cc66cc;">0</span>;
    interrupts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>It appears to me like the <em>checkReading()</em> method isn&#8217;t firing with any consistency and therefore I&#8217;m not incrementing <em>rpm</em> properly. The <em>writeEEPROM()</em> method is firing on target, however I worry that the writing process may be delaying the <em>rpm</em>&nbsp;count.</p>
<p>Below is a <a title="Fritzing external link" href="http://www.fritzing.org/" target="_blank">Fritzing</a> illustration of the circuit I&#8217;ve wired&nbsp;up:</p>
<div id="attachment_37" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.eightlines.com/blog/wp-content/uploads/2008/08/datalogger.gif"><img class="size-full wp-image-37" title="Data Logger Schematic" src="http://www.eightlines.com/blog/wp-content/uploads/2008/08/datalogger.gif" alt="Setup of the Data Logger" width="500" height="325" /></a><p class="wp-caption-text">Setup of the Data&nbsp;Logger</p></div>
<p>Suggestions? I&#8217;m open to any hints someone might have on how to structure this a little&nbsp;differently.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=30</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Passing the kid test</title>
		<link>http://www.eightlines.com/blog/2008/08/passing-the-kid-test/</link>
		<comments>http://www.eightlines.com/blog/2008/08/passing-the-kid-test/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 01:24:23 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Controlling Rain]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Solenoid]]></category>
		<category><![CDATA[Xbee]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=19</guid>
		<description><![CDATA[I&#8217;ve had the Solenoid project working for about a week and a half now, but the rain and lack of sunlight was getting in the way of making a video of everything in action. It worked out well because it gave me the chance to demonstrate the project to a number of visitors today, all [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a title="Passing the kid test by Eightlines, on Flickr" href="http://www.flickr.com/photos/eightlines/2747579544/"><img class="aligncenter" src="http://farm4.static.flickr.com/3119/2747579544_596254f19f.jpg" alt="Passing the kid test" width="375" height="500" /></a></p>
<p style="text-align: left;">I&#8217;ve had the Solenoid project working for about a week and a half now, but the rain and lack of sunlight was getting in the way of making a video of everything in action. It worked out well because it gave me the chance to demonstrate the project to a number of visitors today, all at once. And, as the photo above demonstrates, the project passes the kid&nbsp;test.</p>
<div><a style="float:left;margin-right:10px;" title="Aligning the valves by Eightlines, on Flickr" href="http://www.flickr.com/photos/eightlines/2711945917/"><img src="http://farm4.static.flickr.com/3237/2711945917_01129e1b2d_m.jpg" alt="Aligning the valves" width="240" height="180" /></a></p>
<p><a style="float:left;margin-right:10px;" title="Solenoid controller by Eightlines, on Flickr" href="http://www.flickr.com/photos/eightlines/2712757808/"><img src="http://farm4.static.flickr.com/3280/2712757808_aa010166e7_m.jpg" alt="Solenoid controller" width="180" height="240" /></a></p>
<p><a style="float:left;margin-right:10px;" title="Solenoids in circular pattern by Eightlines, on Flickr" href="http://www.flickr.com/photos/eightlines/2712757656/"><img src="http://farm4.static.flickr.com/3074/2712757656_56a0462397_m.jpg" alt="Solenoids in circular pattern" width="240" height="180" /></a></div>
<p style="text-align: left;clear:both;">
<p style="text-align: left;clear:both;">
<p style="text-align: left;clear:both;">The project is still in need of refinement, but I&#8217;m thinking that&#8217;s where things would get expensive. I&#8217;ve sourced out some new solenoids that could be used in a multimedia environment, I&#8217;m just unsure of the cost. The solenoids I have used are $7 washing machine parts. Specialty valves are bound to be more expensive. Some of the valves leak, and I&#8217;m pretty sure it&#8217;s not occurring in the sections I&#8217;ve sealed, the valves may be defective, or they may have a scratch in the plastic I created when I was reconfiguring the orientation of the&nbsp;connectors.</p>
<p style="text-align: left;clear:both;">The brace you can see in the photo on the left was constructed to correctly position the hoses in sequence. the centre photo demonstrates the digital radio, Arduino, and transistor controller. The green wires leading out of frame are wired to the Solenoids. On the right, the solenoids are hooked up to the hoses. (All the photos have notes visible in&nbsp;Flickr)</p>
<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.vimeo.com/moogaloop.swf?clip_id=1498223&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://www.vimeo.com/moogaloop.swf?clip_id=1498223&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<a href="http://www.vimeo.com/1498223?pg=embed&amp;sec=1498223">Solenoid Project</a> from <a href="http://www.vimeo.com/eightlines?pg=embed&amp;sec=1498223">Eightlines</a> on <a href="http://vimeo.com?pg=embed&amp;sec=1498223">Vimeo</a>.</div>
<p style="text-align: left;clear:both;">In the above video, I&#8217;ve got the device filled with water, and directed through flexible hoses. Valves 2, 4, 6, 7, and 1 turn on. They then cycle off, leaving valve 1 open. The camera then pans up to the controller where it zooms in on the LEDs which I&#8217;m using as indicators of which valves are turned on. We then go through a test of all the valves on and off to demonstrate the flow when everything is open. A couple of the valves don&#8217;t work, and I&#8217;ve traced that back to a point on the controller circuit that I think has not been soldered&nbsp;correctly.</p>
<p style="text-align: left;clear:both;">I think it would be important to note the projects out there that are doing the same thing. The <a title="Jeep Waterfall" href="http://www.youtube.com/watch?v=Z2LUz2WVcek" target="_blank">Jeep waterfall</a> was unveiled at a Detroit autoshow in 2000. This <a title="Waterfall" href="http://blog.makezine.com/archive/2008/08/waterfall_spells_out_word.html?CMP=OTC-0D6B48984890" target="_blank">waterfall</a> was published on the Make blog just the other day. <a title="MIT Expo Pavillion" href="http://www.inhabitat.com/2007/07/26/mit-digital-water-pavilion/" target="_blank"><span class="caps">MIT</span>&#8217;s building</a> made of water is scheduled to open at the 2008 Expo, they&#8217;ve hired <a title="Lumiartecnia" href="http://www.lumiartecnia.com" target="_blank">Lumiartecnia</a> to produce the valves. Also check out this <a title="Water Keyboard" href="http://www.vimeo.com/1250915?pg=embed&amp;sec=1250915" target="_blank">water keyboard</a> for its innovative use of sensing electric resistance when you touch the water to control the solenoids&thinsp;&#8212;&thinsp;in this case controlling air flow in a liquid. All these examples show that the envelope can be pushed that much further, and that there&#8217;s a large degree of possible&nbsp;variatons.</p>
<p style="text-align: left;clear:both;">Still lots more ideas to play with, but many of these will be with the code. I&#8217;ve got some really interesting image processing ideas coming&nbsp;up.</p>
<p style="text-align: left;clear:both;">
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/eightlines.com/blog/p=19</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
