<?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"
	>

<channel>
	<title>Eightlines Creations</title>
	<atom:link href="http://www.eightlines.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eightlines.com/blog</link>
	<description>Experiments in Physical Computing</description>
	<pubDate>Sun, 16 Nov 2008 23:10:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
			<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>
<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>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://www.eightlines.com/blog/2008/11/mapping-gps-data/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Maker&#8217;s deep-dark secret</title>
		<link>http://www.eightlines.com/blog/2008/11/a-makers-deep-dark-secret/</link>
		<comments>http://www.eightlines.com/blog/2008/11/a-makers-deep-dark-secret/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 03:02:15 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[Make]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=99</guid>
		<description><![CDATA[I&#8217;m just going to put this out there, I feel its something that isn&#8217;t talked about often and can be an influencing factor when making things. Building things yourself will almost certainly cost you more than if you buy the object in the store (if it exists already). On almost every single project I&#8217;ve built [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just going to put this out there, I feel its something that isn&#8217;t talked about often and can be an influencing factor when making things. <em>Building things yourself will almost certainly cost you more than if you buy the object in the store</em> (if it exists already). On almost every single project I&#8217;ve built I&#8217;ve gone over budget&#8230; not that I&#8217;ve had a budget, but if my budget was set it would probably be at or less than the cost of buying something in the&nbsp;store.</p>
<ul>
<li><span class="caps">LED</span> Lighting system for my bike = $75 store bought&nbsp;lights</li>
<li>Solenoid project = less than the professional units, but more than I was planning on&nbsp;spending</li>
<li><span class="caps">GPS</span> unit = equivalent to a Garmin&nbsp;device</li>
<li>Multitouch table = less than Microsoft&#8217;s Surface, but can I call it&nbsp;completed?</li>
<li>Wooden toys for my daughter = more than it would cost from a mass factory in China (but minus the lead&nbsp;additives)</li>
</ul>
<p>The point is, we shouldn&#8217;t be choosing to build these projects to save money. Looking back on things, I did think I could do it cheaper by doing it myself. Chances are you will get a less polished result, and more expense trying to fix things that went&nbsp;wrong.</p>
<p>But buying something in a store won&#8217;t get you the experience, the inspired creative ideas, or abilities gained out of doing it yourself. And in my case those reasons far outweigh the immediacy of running out to the store and adding an item to your&nbsp;collection.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eightlines.com/blog/2008/11/a-makers-deep-dark-secret/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Conversation Clouds with Physics</title>
		<link>http://www.eightlines.com/blog/2008/11/conversation-clouds-with-physics/</link>
		<comments>http://www.eightlines.com/blog/2008/11/conversation-clouds-with-physics/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 03:42:15 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[APE]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[physics]]></category>

		<category><![CDATA[tag cloud]]></category>

		<category><![CDATA[tweener]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=92</guid>
		<description><![CDATA[So after posting the previous entry I went to sleep, only to find myself thinking about improving the visual aspect of the Conversation Cloud. I decided that adding physics would be the way to go, it would allow words to deflect off of each other, grow and gain mass, and constrain themselves to a&#160;container.
I&#8217;ve used [...]]]></description>
			<content:encoded><![CDATA[<p>So after posting the <a href="http://www.eightlines.com/blog/2008/11/conversation-clouds/" target="_self">previous entry</a> I went to sleep, only to find myself thinking about improving the visual aspect of the Conversation Cloud. I decided that adding physics would be the way to go, it would allow words to deflect off of each other, grow and gain mass, and constrain themselves to a&nbsp;container.</p>
<p>I&#8217;ve used <a href="http://www.cove.org/ape/" target="_blank"><span class="caps">APE</span></a> for the physics engine, and <a href="http://code.google.com/p/tweener/" target="_blank">Tweener</a> for some of the elasticity when the mass&nbsp;increases. </p>
<p><script src="/js/swfobject.js" type="text/javascript"></script> <script type="text/javascript"><!--
var flashvars = {};
var params = {};
var attributes = {};
swfobject.embedSWF("http://www.eightlines.com/blog/wp-content/uploads/2008/11/conversationcloud.swf", "demo2", "500", "500", "9.0.0", false, flashvars, params, attributes);
// --></script></p>
<div id="demo2"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.eightlines.com/blog/2008/11/conversation-clouds-with-physics/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Conversation Clouds</title>
		<link>http://www.eightlines.com/blog/2008/11/conversation-clouds/</link>
		<comments>http://www.eightlines.com/blog/2008/11/conversation-clouds/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 02:51:27 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[dictation]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[tag cloud]]></category>

		<category><![CDATA[voice]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=82</guid>
		<description><![CDATA[Word of mouth is one of those impossible things people like to track. The best people seem to be able to do is to ask the question on a registration form, &#8220;Where did you hear about&#160;us?&#8221;
Is it possible to track word of mouth any better? This is the premise of my latest project, Conversation&#160;Clouds.
Imagine a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.eightlines.com/blog/wp-content/uploads/2008/11/tagcloud2.swf"></a>Word of mouth is one of those impossible things people like to track. The best people seem to be able to do is to ask the question on a registration form, &#8220;Where did you hear about&nbsp;us?&#8221;</p>
<p>Is it possible to track word of mouth any better? This is the premise of my latest project, Conversation&nbsp;Clouds.</p>
<p>Imagine a conference on multiple floors, with thousands of people. You stand at a screen visualizing all the conversations going on simultaneously. And there on the screen is the general location of a topic you&#8217;re interested in, so you venture down a floor and join&nbsp;in.</p>
<p>Now, privacy concerns aside, the system works as&nbsp;such:</p>
<ul>
<li>Microphones are placed around a physical space. Each is marked with an id which relates to its geographic&nbsp;location.</li>
<li>The audio is transmitted to a server which performs voice to text translations in small&nbsp;batches.</li>
<li>As each sample is translated it pushes to the visualization script which then displays on a central&nbsp;monitor.</li>
</ul>
<p><script src="/js/swfobject.js" type="text/javascript"></script> <script type="text/javascript"><!--
var flashvars = {};
var params = {};
var attributes = {};
swfobject.embedSWF("http://www.eightlines.com/blog/wp-content/uploads/2008/11/tagcloud2.swf", "demo", "500", "500", "9.0.0", false, flashvars, params, attributes);
// --></script></p>
<div id="demo"><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></div>
<p>In this early proof of concept I&#8217;m using recorded conversations left through answering machines which are transcribed into textual form. Once a new message arrives the script parses it through a custom UIComponent in Flex. Words are added to a hashmap and as repetition occurs the visualization increases the scale and opacity. With future versions I hope to add in a decay parameter as well, so as the conversation flows from one topic to the next so does the visualization. (In the demo above I&#8217;m using the content from a previous&nbsp;post.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eightlines.com/blog/2008/11/conversation-clouds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Drawdio - Cool Toy of the Day</title>
		<link>http://www.eightlines.com/blog/2008/10/drawdio-cool-toy-of-the-day/</link>
		<comments>http://www.eightlines.com/blog/2008/10/drawdio-cool-toy-of-the-day/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 01:35:12 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[Drawdio]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=79</guid>
		<description><![CDATA[The cool toy of the day has to go to Drawdio. You draw an picture and it connects a circuit through the graphite in the pencil. It then plays back the sound through the&#160;speaker.
The only complaint I&#8217;ve heard is that it sounds like a dentist drill. I fully intend on using this all day Monday [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.eightlines.com/blog/wp-content/uploads/2008/10/drawdio.jpg"><img class="size-medium wp-image-80 alignright" title="Drawdio" src="http://www.eightlines.com/blog/wp-content/uploads/2008/10/drawdio-300x225.jpg" alt="" width="300" height="225" /></a>The cool toy of the day has to go to <a title="Drawdio" href="http://ladyada.net/make/drawdio/index.html" target="_blank">Drawdio</a>. You draw an picture and it connects a circuit through the graphite in the pencil. It then plays back the sound through the&nbsp;speaker.</p>
<p>The only complaint I&#8217;ve heard is that it sounds like a dentist drill. I fully intend on using this all day Monday at the&nbsp;office.</p>
<p>Really straightforward kit, I&#8217;d recommend it to anyone that has a budding interest in electronics. At $20 it&#8217;d sure make a unique&nbsp;gift.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eightlines.com/blog/2008/10/drawdio-cool-toy-of-the-day/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nuit Blanche 2008</title>
		<link>http://www.eightlines.com/blog/2008/10/nuit-blanche-2008/</link>
		<comments>http://www.eightlines.com/blog/2008/10/nuit-blanche-2008/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 18:16:35 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[Nuit Blanche]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=76</guid>
		<description><![CDATA[
What struck me about the pieces shown during last night&#8217;s Nuit Blanche was that all the ideas were entirely doable by any person. In fact I feel that way about most art pieces. Its the idea that matters, and frankly, it doesn&#8217;t have to be an original idea to make an impact. Ideas and memes [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=86bf0d3691&amp;photo_id=2914987289&amp;show_info_box=true" /><param name="bgcolor" value="#000000" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.flickr.com/apps/video/stewart.swf?v=60247" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://www.flickr.com/apps/video/stewart.swf?v=60247" allowfullscreen="true" bgcolor="#000000" flashvars="intl_lang=en-us&amp;photo_secret=86bf0d3691&amp;photo_id=2914987289&amp;show_info_box=true"></embed></object></p>
<p>What struck me about the pieces shown during last night&#8217;s Nuit Blanche was that all the ideas were entirely doable by any person. In fact I feel that way about most art pieces. Its the idea that matters, and frankly, it doesn&#8217;t have to be an original idea to make an impact. Ideas and memes spread so quickly, to credit them with someone&#8217;s name seems almost impossible. This isn&#8217;t even a &#8220;in this day and age&#8221; concept, we still argue about whether the Wright brothers invented the airplane, or Bell invented the phone first. Watch Blinkenlights in the video above for example. What is the critical difference between this presentation and a <span class="caps">LED</span> matrix controlled by a&nbsp;computer?</p>
<p>The critical difference is the wherewithal to attempt a project this big. The scope of this project was aweinspiring but the technology (in concept) was simple. The mechanics and performance where anything but simple, but it was done so effectively it left you with that same feeling you get watching elite sports atheletes perform. Like&nbsp;magic.</p>
<p>This piece was inspiring, not because I found the artistic statement to be profound, but because I saw the look in the people&#8217;s faces as they watched the presentation. That amazement is something I want to strive for in all my&nbsp;works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eightlines.com/blog/2008/10/nuit-blanche-2008/feed/</wfw:commentRss>
		</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 you [...]]]></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>
<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>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://www.eightlines.com/blog/2008/09/data-logger-next-steps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Presenting at the Toronto Flex User Group</title>
		<link>http://www.eightlines.com/blog/2008/09/presenting-at-the-toronto-flex-user-group/</link>
		<comments>http://www.eightlines.com/blog/2008/09/presenting-at-the-toronto-flex-user-group/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 14:43:45 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://www.eightlines.com/blog/?p=68</guid>
		<description><![CDATA[Just a quick note that I will be presenting at the Toronto Flex User Group on Thursday October 23rd, 2008 at the Oakham House on the Ryerson Campus, starting at&#160;6:30pm.
Oakham House
Room: Oakham Lounge
55 Gould Street
Toronto, Ontario
M5B&#160;1E9
I&#8217;ll be presenting: ActionScript or Flex Project? Development lessons learned building client&#160;projects.
]]></description>
			<content:encoded><![CDATA[<p>Just a quick note that I will be presenting at the <a title="Toronto Flex User Group" href="http://www.torontoflex.org/" target="_blank">Toronto Flex User Group</a> on Thursday October 23rd, 2008 at the Oakham House on the Ryerson Campus, starting at&nbsp;6:30pm.</p>
<p><a title="Oakham House Website" href="http://www.oakhamhouse.com/pages/directions.php" target="_blank">Oakham House</a><br />
Room: Oakham Lounge<br />
55 Gould Street<br />
Toronto, Ontario<br />
<span class="caps">M5B</span>&nbsp;1E9</p>
<p>I&#8217;ll be presenting: <em>ActionScript or Flex Project? Development lessons learned building client&nbsp;projects</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eightlines.com/blog/2008/09/presenting-at-the-toronto-flex-user-group/feed/</wfw:commentRss>
		</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://www.eightlines.com/blog/2008/09/data-logging-to-the-arduino-eeprom/feed/</wfw:commentRss>
		</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, namely [...]]]></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>
<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>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://www.eightlines.com/blog/2008/08/data-logger/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
