<?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; Data Logger</title>
	<atom:link href="http://www.eightlines.com/blog/category/ideas/data-logger/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>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>
	</channel>
</rss>
