<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/2.4.1" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Kurt's Arduino Projects</title>
		<link>http://www.janspace.com/b2evolution/arduino.php</link>
		<description></description>
		<language>en-US</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=2.4.1"/>
		<ttl>60</ttl>
				<item>
			<title>Welcome To My Arduino Blog</title>
			<link>http://www.janspace.com/b2evolution/arduino.php/2010/06/26/welcome-to-my-arduino-blog</link>
			<pubDate>Sun, 27 Jun 2010 01:21:43 +0000</pubDate>			<dc:creator>kschulz</dc:creator>
			<category domain="main">Welcome</category>			<guid isPermaLink="false">25@http://www.janspace.com/b2evolution/</guid>
						<description>&lt;p&gt;&lt;font size=&quot;2&quot;&gt;&lt;br /&gt;
If you don't know what Arduino is, start here: &lt;a href=&quot;http://www.arduino.cc/&quot;&gt; Arduino site&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Google it and you'll find a plethora of information and project sites. It's quite a remarkable little piece of &quot;open hardware&quot; electronic awesomeness that inspires unrelentingly. If you're a hack like me you won't be disappointed. Powerful for its size and cost, and extemely easy to learn and use.&lt;br /&gt;
&lt;br /&gt;
Please register using the Log In link in the upper right corner. Feel free to leave comments by clicking on the post title.&lt;br /&gt;
&lt;br /&gt;
My projects...&lt;br /&gt;
&lt;br /&gt;
First up: &lt;a href=&quot;http://www.janspace.com/b2evolution/arduino.php/2010/06/01/scooterputer&quot;&gt;Scooterputer&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;1&quot;&gt;&lt;i&gt;Scooterputer is a trademark of Schulz Design&lt;/i&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.janspace.com/b2evolution/arduino.php/2010/06/26/welcome-to-my-arduino-blog&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p><font size="2"><br />
If you don't know what Arduino is, start here: <a href="http://www.arduino.cc/"> Arduino site</a><br />
<br />
Google it and you'll find a plethora of information and project sites. It's quite a remarkable little piece of "open hardware" electronic awesomeness that inspires unrelentingly. If you're a hack like me you won't be disappointed. Powerful for its size and cost, and extemely easy to learn and use.<br />
<br />
Please register using the Log In link in the upper right corner. Feel free to leave comments by clicking on the post title.<br />
<br />
My projects...<br />
<br />
First up: <a href="http://www.janspace.com/b2evolution/arduino.php/2010/06/01/scooterputer">Scooterputer</a><br />
<br />
</font><br />
<font size="1"><i>Scooterputer is a trademark of Schulz Design</i></font></p><div class="item_footer"><p><small><a href="http://www.janspace.com/b2evolution/arduino.php/2010/06/26/welcome-to-my-arduino-blog">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://www.janspace.com/b2evolution/arduino.php/2010/06/26/welcome-to-my-arduino-blog#comments</comments>
		</item>
				<item>
			<title>Scooterputer</title>
			<link>http://www.janspace.com/b2evolution/arduino.php/2010/06/26/scooterputer</link>
			<pubDate>Sun, 27 Jun 2010 01:21:57 +0000</pubDate>			<dc:creator>kschulz</dc:creator>
			<category domain="main">Scooterputer</category>			<guid isPermaLink="false">26@http://www.janspace.com/b2evolution/</guid>
						<description>&lt;p&gt;&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayComputer-600.jpg&quot; alt=&quot;Scooterputer Image&quot; title=&quot;Scooterputer&quot; /&gt;&lt;/p&gt;


&lt;p&gt;&lt;font size=&quot;2&quot;&gt;&lt;br /&gt;
I spend a fair amount of time zipping around town on my scooter, and thought it would be cool to add a voltage monitor to warn when the battery might need recharging. Waiting until the electric starter no longer works is somehow lacking. So after an evening with an Arduino Duemilanove, I had a simple programmable voltage divider with 3 LEDs indicating battery low, good, and charging. Done. &lt;br /&gt;
&lt;br /&gt;
That's when I saw &lt;a href=&quot;http://www.liquidware.com/&quot;&gt; Liquidware's&lt;/a&gt; very cool TouchShield Slide OLED display with touch screen. It was telling me it wanted to be on my scooter. It's a bit overkill for just battery status, so I added temperature and time/date readouts. I went to &lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;Sparkfun.com&lt;/a&gt; and found a DS18B20 temperature sensor and a DS1307 RTC chip. Perfect. Oh wait, what's this...an accelerometer?  Sweet!  Hey, a GPS chip... &lt;br /&gt;
&lt;br /&gt;
So a few weeks later, here's what my battery voltage indicator is looking like:&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/Display-1.jpg&quot; alt=&quot;Scooterputer Display&quot; title=&quot;Scooterputer Display&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see in the first photo that the TouchShield display is separated from the Duemilanove / Cell Module / Sensor shields. These are installed &quot;under the hood&quot; of my scooter and provide power and signals to the display module via a standard 8-wire ethernet cable. This keeps the sensors (accelerometer, GPS, cell module, etc.) with  the scooter making it functional even without the removable external display, as we'll see later. (NOTE: this photo was taken before the display was fully mounted inside the enclosure, and is shown without the protective rubber boot.)&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Features&lt;/b&gt;&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Battery voltage indicator &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Time and date &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Temperature &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Lean gauge with resettable max L-R indicators &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Current speed &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Resettable max speed indicator &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Odometer &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; 2 resettable trip meters &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Latitude and longitude readouts &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; Compass heading readout &lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font size=&quot;2&quot;&gt; GSM/GPRS quad-band cellular module &lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Schematic&lt;/b&gt;&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/VisualSchematic.png&quot; alt=&quot;Visual Schematic&quot; title=&quot;VisualSchematic&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Sensor Shield&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;2&quot;&gt;&lt;br /&gt;
The sensors are mounted on a Proto Shield PCB from &lt;a href=&quot;http://www.adafruit.com/&quot;&gt;Ladyada's Adafruit Industries&lt;/a&gt; (which is also where I get my Duemilanoves). Most of the wiring was done using 30 gauge Kynar solid wire, with heavier gauge used for some power and ground connections. Good mechanical connections are important considering the shock and vibrations this will be subjected to.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Sensor Shield - Top&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/SensorShield-Top.jpg&quot; alt=&quot;Sensor Shield - Top&quot; title=&quot;SensorShield-Top&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Sensor Shield - Bottom&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/SensorShield-Bottom.jpg&quot; alt=&quot;Sensor Shield - Bottom&quot; title=&quot;SensorShield-Bottom&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;I went with breakout boards for the surface mount chips. They take up a bit more real estate on the PCB but are very easy to solder and save a lot of construction time. Note the DS1307 RTC on the underside...the profile is still low enough to allow the parts to fit nicely in the open space between boards when stacked. I soldered a right-angle pin header directly to the pads of the GPS breakout board, and straight pin headers on the others.&lt;/p&gt;


&lt;p&gt;&lt;b&gt;GPS/RTC Breakout&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/GPSRTC.jpg&quot; alt=&quot;GPS/RTC Breakout&quot; title=&quot;GPSRTC_Breakout&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;You might be wondering why I even included the RTC chip since time-of-day and date can be gotten from the GPS data. The DS1307 RTC chip also has 56 bytes of non-volatile RAM. I'm using these registers for storing the trip meter and odometer values so they can be restored between power cycles.&lt;/p&gt;

&lt;p&gt;The GPS uses pins 0 and 1 for its TxD and RxD signals to communicate to the Duemilanove. The TouchShield Slide also uses these pins for downloading sketches. The &quot;Program Switch&quot; is used to disconnect the TouchShield Slide from these pins when not downloading so they're free for use by the GPS. Fortunately the TouchShield Slide uses pins 2 and 3 during normal operation, which I'm driving with digital I/O pins 4 and 5 on the Duemilanove.&lt;/p&gt;

&lt;p&gt;Three devices require serial communications (GPS, TouchShield Slide, and Cell Module), and it was a real challenge getting the Duemilanove to support these at data rates needed for the desired performance. Having the GPS, running at 9600 baud, use the hardware serial port (pins 0 and 1) proved to be the best approach. The TouchShield Slide (19200 baud) and Cell Module (4800 baud) use digital I/O pins, and &lt;a href=&quot;http://arduiniana.org/libraries/newsoftserial/&quot;&gt; Mikal Hart's NewSoftSerial&lt;/a&gt; library for 'software' interrupt driven serial communications was invaluable in getting these to play nicely together.&lt;/p&gt;

The GPS chip is powered by the 3.3v regulator. The 10k resistor and 1N914 diode circuit on the serial RxD line of the chip are used to dampen the 5v signal from the Arduino hardware TxD line used to send data to the chip. When that line is high, the diode doesn't conduct allowing the 10k pull up resistor to apply a 3.3v high to the GPS RxD input. When it's low, the diode conducts and the line sinks through the TxD driver pulling the line down. The .7 volt drop across the diode is still sufficient for a low to be recognized by the GPS RxD input. A schottky diode with a .2v drop might be an improvement here, but the 1N914 seems to work fine. The GPS is rarely receiving data anyways - data is usually sent only one time to initialize the NMEA sentences to be sent, the baud rate, and the update cycle rate. &lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Display&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;2&quot;&gt;&lt;br /&gt;
The TouchShield Slide is mounted on another Proto Shield PCB. The CAT-5 connector is wired to the PCB using solid telephone wire to provide power and ground, and to connect the RxD and TxD signals from the Duemilanove to the display. Another line is brought up to drive the beeper.&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Display Shield&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayShield-2.jpg&quot; alt=&quot;/DisplayShield 2&quot; title=&quot;/DisplayShield_2&quot; /&gt;&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayShield-3.jpg&quot; alt=&quot;/DisplayShield 3&quot; title=&quot;/DisplayShield_3&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The display assembly is mounted in an enclosure I found at &lt;a href=&quot;http://www.boxenclosures.com/index.html&quot;&gt;boxenclosures.com&lt;/a&gt;, part #40-12-NO-R-BL. It's a perfect size for the TouchShield Slide, once the inside bosses were removed with a Dremel tool. I cut out an opening for the display/touchscreen using a plastic cutter tool, and added a 1/16&quot; gasket I cut from a sheet of neoprene to seal it.&lt;/p&gt;

&lt;p&gt;Box Enclosures also has a nice protective rubber boot for the enclosure, which is shown in  the scooter photos below.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Display Enclosure With Gasket&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayShield-5.jpg&quot; alt=&quot;/DisplayShield 5&quot; title=&quot;/DisplayShield_5&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Cell Module&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;2&quot;&gt;&lt;br /&gt;
The SM5100B GSM/GPRS Cell Module just needs a SIM card and antenna. The antenna can be obtained from &lt;a href=&quot;http://www.sparkfun.com/commerce/product_info.php?products_id=675&quot;&gt;Sparkfun.com&lt;/a&gt; and attaches to the wire with the red cap covering the connector. &lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Cell Module&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/CELL-1.jpg&quot; alt=&quot;Cell Module&quot; title=&quot;CellModule&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;The Cell Module shield and Sensor shield plug in to the Duemilanove, stacked one on the other. The Duemilanove is programmed to reply to text messages made to the cell with a return text message containing latitude/longitude data, heading, speed, and a time stamp.  The GPS latitude and longitude coordinates can be entered online to see the location on a map, such as using &lt;a href=&quot;http://itouchmap.com/latlong.html&quot;&gt;touchmap.com&lt;/a&gt;. I can also use this to capture my precise location when riding in an unfamiliar area. One of the spare buttons on the display could be used to tell the Scooterputer to text a cell phone with this information. &lt;/p&gt;

&lt;p&gt;The Duemilanove is also programmed to send the text message to my cell phone when it initializes. This serves as kind of a scooter &quot;LoJack&quot;. If the scooter is ever borrowed without permission, it will notify me each time it starts, and as long as it is running it can be texted to obtain its present location. Recovery and bad-guy-in-jail are just a text message away. Of course now my wife can text my scooter any time she wants to find out what I'm up to (note to self: add a pass phrase to the incoming message).&lt;/p&gt;

&lt;p&gt;I also have it programmed to forward any incoming calls to my personal cell.&lt;/p&gt;

&lt;p&gt;The display is not needed for any of these features. Also note that the Cell Module is optional. The Sensor shield can be plugged directly into the Duemilanove if the telecommunication features are not desired. &lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Duemilanove/Cell/Sensor&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/DuemCellSensor-2.jpg&quot; alt=&quot;Duemilanove/Cell/Sensor&quot; title=&quot;DuemCellSensor&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Calibrating&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;2&quot;&gt;&lt;br /&gt;
Very little is needed for calibration. Check out the source code to see how simple it is. Debug #defines are included to selectively send the sensor values to the Arduino serial monitor during operation. The scaling and mapping can then be tweaked as needed while observing the output.&lt;/p&gt;

&lt;p&gt;The ranges for the accelerometer readings are easily obtained by analyzing the analog input data. I found full range to be 453 to 580 for both the X and Y axis, which is 127 units with a center around 516. I arbitrarily took 20 off each end and mapped these to -90 to +90 for the Lean Gauge values.&lt;/p&gt;

&lt;p&gt;The Lean Gauge display is designed to show the current real time values in bright green, and the max L-R readings are maintained on the background in dark green. These can be reset by pressing the Lean button on the display.&lt;/p&gt;

&lt;p&gt;The Battery Voltage Indicator ranges were set by varying the voltage applied from a bench power supply. The top of the indicator is calibrated to 14.0v and the bottom 10.0v, again by mapping the values coming in the analog input to the 0 - 100 range expected by the Battery Voltage Indicator. With a strong battery, at idle the indicator floats within the green zone and at speed it just gets into the orange. When the battery is weak and the indicator falls into the red zone, the red area flashes at a 500 msec rate from bright red to dark red.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Calibrating The Battery Voltage Indicator&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayComputer-2.jpg&quot; alt=&quot;Calibrating BVM&quot; title=&quot;CalibratingBVM&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=&quot;2&quot;&gt;&lt;br /&gt;
The &lt;a href=&quot;http://en.wikipedia.org/wiki/Haversine_formula&quot;&gt;Haversine formula&lt;/a&gt; is used to calculate the distance traveled for the odometer and trip meters, using lat/lon data returned from the GPS. This seems to track the odometer on the scooter fairly close as long as I'm not riding in tight circles or zigzags. Since I don't ride while intoxicated, this should work fine for the trip meters but I have my doubts about the long term accuracy for use as an odometer. Time will tell, and I expect I'll be tweaking the algorithm to calibrate for improved accuracy. &lt;br /&gt;
&lt;br /&gt;
As an alternative, I experimented some with a hall-effect sensor triggered by a magnet attached to the wheel. I'm confident this would be very effective as a speedometer and odometer, but have decided to go strictly with the GPS for now. If you're interested, let me know and I can post the hall-effect sensor circuit and sketch. (Update 08/25/2010: added link below to circuit diagram and test sketch)&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Source Code and Antipasto IDE&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;2&quot;&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/Scooterputer-07112010.zip&quot;&gt;Scooterputer.zip&lt;/a&gt; - sketches for Arduino Duemilanove and TouchShield Slide&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.liquidware.com/antipasto_arduino_ide&quot;&gt;Liquidware Antipasto&lt;/a&gt; - Antipasto Arduino IDE (supports Arduino Duemilanove and TouchShield Slide)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/HallEffectSensorTest-08252010.zip&quot;&gt;HallEffectSensorTest.zip&lt;/a&gt; - circuit and test sketch for Hall Effect sensor &lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;


&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Scooter&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;2&quot;&gt;&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Scooterputer Mounted Under The Hood&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/ScootArduino-1.jpg&quot; alt=&quot;Scooter Under Hood 1&quot; title=&quot;ScooterUnderHood 1&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Scooterputer Mounted Under The Hood&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/ScootArduino-2.jpg&quot; alt=&quot;Scooter Under Hood 2&quot; title=&quot;ScooterUnderHood 2&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Scooterputer Display with RAM Mount&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/ScootDisplay-1.jpg&quot; alt=&quot;Scooter Display RAM Mount&quot; title=&quot;ScooterDisplayRAMMount&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Scooterputer Display&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.janspace.com/b2evolution/blogs/media/Arduino/ScootDisplay-2.jpg&quot; alt=&quot;Scooter Display&quot; title=&quot;ScooterDisplay&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Scooter Walkaround&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;youtube center&quot;&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; style=&quot;width:425px; height:350px&quot; data=&quot;http://www.youtube.com/v/WzzKB-dMWsQ&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/WzzKB-dMWsQ&quot; /&gt;&lt;/object&gt;&lt;/div&gt; &lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;p&gt;&lt;/p&gt;


&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;b&gt;Links&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;2&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.arduino.cc/&quot;&gt;www.arduino.cc&lt;/a&gt; - start here&lt;br /&gt;
&lt;a href=&quot;http://www.adafruit.com/&quot;&gt;www.adafruit.com/&lt;/a&gt; - get lots of great Arduino stuff here. Ladyada rocks!&lt;br /&gt;
&lt;a href=&quot;http://www.liquidware.com/&quot;&gt;www.liquidware.com&lt;/a&gt; - TouchShield Slide&lt;br /&gt;
&lt;a href=&quot;http://www.liquidware.com/antipasto_arduino_ide&quot;&gt;www.liquidware.com/antipasto_arduino_ide&lt;/a&gt; - Antipasto Arduino IDE&lt;br /&gt;
&lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;www.sparkfun.com&lt;/a&gt; - components: accelerometer chip, GPS chip, RTC chip, temperature sensor, cell module, and much more&lt;br /&gt;
&lt;a href=&quot;http://www.boxenclosures.com/index.html&quot;&gt;www.boxenclosures.com/index.html&lt;/a&gt; - nice project cases&lt;br /&gt;
&lt;a href=&quot;http://arduiniana.org/&quot;&gt;arduiniana.org&lt;/a&gt; - NewSoftSerial and TinyGPS libraries. Mikal rocks too.&lt;br /&gt;
&lt;a href=&quot;http://itouchmap.com/latlong.html&quot;&gt;itouchmap.com/latlong.html&lt;/a&gt; - mapping GPS coordinates&lt;br /&gt;
&lt;a href=&quot;http://www.hhhh.org/wiml/proj/nmeaxor.html&quot;&gt;www.hhhh.org/wiml/proj/nmeaxor.html&lt;/a&gt; - NMEA sentence checksum calculator&lt;br /&gt;
&lt;a href=&quot;http://www.movable-type.co.uk/scripts/latlong.html&quot;&gt;www.movable-type.co.uk/scripts/latlong.html&lt;/a&gt; - useful latitude/longitude formulas&lt;br /&gt;
&lt;a href=&quot;http://www.ram-mount.com/&quot;&gt;www.ram-mount.com&lt;/a&gt; - mounting systems for cars, motorcycles, scooters, ATVs, etc.&lt;br /&gt;
&lt;a href=&quot;http://www.genuinescooters.com/&quot;&gt;www.genuinescooters.com&lt;/a&gt; - awesome scooters!&lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size=&quot;1&quot;&gt;&lt;i&gt;Scooterputer is a trademark of Schulz Design&lt;/i&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.janspace.com/b2evolution/arduino.php/2010/06/26/scooterputer&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p><img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayComputer-600.jpg" alt="Scooterputer Image" title="Scooterputer" /></p>


<p><font size="2"><br />
I spend a fair amount of time zipping around town on my scooter, and thought it would be cool to add a voltage monitor to warn when the battery might need recharging. Waiting until the electric starter no longer works is somehow lacking. So after an evening with an Arduino Duemilanove, I had a simple programmable voltage divider with 3 LEDs indicating battery low, good, and charging. Done. <br />
<br />
That's when I saw <a href="http://www.liquidware.com/"> Liquidware's</a> very cool TouchShield Slide OLED display with touch screen. It was telling me it wanted to be on my scooter. It's a bit overkill for just battery status, so I added temperature and time/date readouts. I went to <a href="http://www.sparkfun.com/">Sparkfun.com</a> and found a DS18B20 temperature sensor and a DS1307 RTC chip. Perfect. Oh wait, what's this...an accelerometer?  Sweet!  Hey, a GPS chip... <br />
<br />
So a few weeks later, here's what my battery voltage indicator is looking like:<br />
<br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/Display-1.jpg" alt="Scooterputer Display" title="Scooterputer Display" /><br />
<br />
<br />
You can see in the first photo that the TouchShield display is separated from the Duemilanove / Cell Module / Sensor shields. These are installed "under the hood" of my scooter and provide power and signals to the display module via a standard 8-wire ethernet cable. This keeps the sensors (accelerometer, GPS, cell module, etc.) with  the scooter making it functional even without the removable external display, as we'll see later. (NOTE: this photo was taken before the display was fully mounted inside the enclosure, and is shown without the protective rubber boot.)<br />
</font></p>

<p><font size="3"><br />
<b>Features</b><br />
</font></p>
<ul>
   <li><font size="2"> Battery voltage indicator </font></li>
   <li><font size="2"> Time and date </font></li>
   <li><font size="2"> Temperature </font></li>
   <li><font size="2"> Lean gauge with resettable max L-R indicators </font></li>
   <li><font size="2"> Current speed </font></li>
   <li><font size="2"> Resettable max speed indicator </font></li>
   <li><font size="2"> Odometer </font></li>
   <li><font size="2"> 2 resettable trip meters </font></li>
   <li><font size="2"> Latitude and longitude readouts </font></li>
   <li><font size="2"> Compass heading readout </font></li>
   <li><font size="2"> GSM/GPRS quad-band cellular module </font></li>
</ul>

<p><font size="3"><br />
<b>Schematic</b><br />
</font><br />
<br /></p>


<p><img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/VisualSchematic.png" alt="Visual Schematic" title="VisualSchematic" /><br />
<br /></p>


<p><font size="3"><br />
<b>Sensor Shield</b></font><br />
<font size="2"><br />
The sensors are mounted on a Proto Shield PCB from <a href="http://www.adafruit.com/">Ladyada's Adafruit Industries</a> (which is also where I get my Duemilanoves). Most of the wiring was done using 30 gauge Kynar solid wire, with heavier gauge used for some power and ground connections. Good mechanical connections are important considering the shock and vibrations this will be subjected to.<br />
<br /></p>


<p><b>Sensor Shield - Top</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/SensorShield-Top.jpg" alt="Sensor Shield - Top" title="SensorShield-Top" /><br />
<br /></p>


<p><b>Sensor Shield - Bottom</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/SensorShield-Bottom.jpg" alt="Sensor Shield - Bottom" title="SensorShield-Bottom" /><br />
<br /></p>

<p>I went with breakout boards for the surface mount chips. They take up a bit more real estate on the PCB but are very easy to solder and save a lot of construction time. Note the DS1307 RTC on the underside...the profile is still low enough to allow the parts to fit nicely in the open space between boards when stacked. I soldered a right-angle pin header directly to the pads of the GPS breakout board, and straight pin headers on the others.</p>


<p><b>GPS/RTC Breakout</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/GPSRTC.jpg" alt="GPS/RTC Breakout" title="GPSRTC_Breakout" /><br />
<br /></p>

<p>You might be wondering why I even included the RTC chip since time-of-day and date can be gotten from the GPS data. The DS1307 RTC chip also has 56 bytes of non-volatile RAM. I'm using these registers for storing the trip meter and odometer values so they can be restored between power cycles.</p>

<p>The GPS uses pins 0 and 1 for its TxD and RxD signals to communicate to the Duemilanove. The TouchShield Slide also uses these pins for downloading sketches. The "Program Switch" is used to disconnect the TouchShield Slide from these pins when not downloading so they're free for use by the GPS. Fortunately the TouchShield Slide uses pins 2 and 3 during normal operation, which I'm driving with digital I/O pins 4 and 5 on the Duemilanove.</p>

<p>Three devices require serial communications (GPS, TouchShield Slide, and Cell Module), and it was a real challenge getting the Duemilanove to support these at data rates needed for the desired performance. Having the GPS, running at 9600 baud, use the hardware serial port (pins 0 and 1) proved to be the best approach. The TouchShield Slide (19200 baud) and Cell Module (4800 baud) use digital I/O pins, and <a href="http://arduiniana.org/libraries/newsoftserial/"> Mikal Hart's NewSoftSerial</a> library for 'software' interrupt driven serial communications was invaluable in getting these to play nicely together.</p>

The GPS chip is powered by the 3.3v regulator. The 10k resistor and 1N914 diode circuit on the serial RxD line of the chip are used to dampen the 5v signal from the Arduino hardware TxD line used to send data to the chip. When that line is high, the diode doesn't conduct allowing the 10k pull up resistor to apply a 3.3v high to the GPS RxD input. When it's low, the diode conducts and the line sinks through the TxD driver pulling the line down. The .7 volt drop across the diode is still sufficient for a low to be recognized by the GPS RxD input. A schottky diode with a .2v drop might be an improvement here, but the 1N914 seems to work fine. The GPS is rarely receiving data anyways - data is usually sent only one time to initialize the NMEA sentences to be sent, the baud rate, and the update cycle rate. <br />
<br /></font><p></p>

<p><font size="3"><br />
<b>Display</b></font><br />
<font size="2"><br />
The TouchShield Slide is mounted on another Proto Shield PCB. The CAT-5 connector is wired to the PCB using solid telephone wire to provide power and ground, and to connect the RxD and TxD signals from the Duemilanove to the display. Another line is brought up to drive the beeper.</p>


<p><b>Display Shield</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayShield-2.jpg" alt="/DisplayShield 2" title="/DisplayShield_2" /></p>


<p><img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayShield-3.jpg" alt="/DisplayShield 3" title="/DisplayShield_3" /><br />
<br /></p>

<p>The display assembly is mounted in an enclosure I found at <a href="http://www.boxenclosures.com/index.html">boxenclosures.com</a>, part #40-12-NO-R-BL. It's a perfect size for the TouchShield Slide, once the inside bosses were removed with a Dremel tool. I cut out an opening for the display/touchscreen using a plastic cutter tool, and added a 1/16" gasket I cut from a sheet of neoprene to seal it.</p>

<p>Box Enclosures also has a nice protective rubber boot for the enclosure, which is shown in  the scooter photos below.</p>

<p><b>Display Enclosure With Gasket</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayShield-5.jpg" alt="/DisplayShield 5" title="/DisplayShield_5" /><br />
<br /></font></p>

<p><font size="3"><br />
<b>Cell Module</b></font><br />
<font size="2"><br />
The SM5100B GSM/GPRS Cell Module just needs a SIM card and antenna. The antenna can be obtained from <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=675">Sparkfun.com</a> and attaches to the wire with the red cap covering the connector. <br />
<br /></p>


<p><b>Cell Module</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/CELL-1.jpg" alt="Cell Module" title="CellModule" /><br />
<br /></p>


<p>The Cell Module shield and Sensor shield plug in to the Duemilanove, stacked one on the other. The Duemilanove is programmed to reply to text messages made to the cell with a return text message containing latitude/longitude data, heading, speed, and a time stamp.  The GPS latitude and longitude coordinates can be entered online to see the location on a map, such as using <a href="http://itouchmap.com/latlong.html">touchmap.com</a>. I can also use this to capture my precise location when riding in an unfamiliar area. One of the spare buttons on the display could be used to tell the Scooterputer to text a cell phone with this information. </p>

<p>The Duemilanove is also programmed to send the text message to my cell phone when it initializes. This serves as kind of a scooter "LoJack". If the scooter is ever borrowed without permission, it will notify me each time it starts, and as long as it is running it can be texted to obtain its present location. Recovery and bad-guy-in-jail are just a text message away. Of course now my wife can text my scooter any time she wants to find out what I'm up to (note to self: add a pass phrase to the incoming message).</p>

<p>I also have it programmed to forward any incoming calls to my personal cell.</p>

<p>The display is not needed for any of these features. Also note that the Cell Module is optional. The Sensor shield can be plugged directly into the Duemilanove if the telecommunication features are not desired. <br />
<br /></p>

<p><b>Duemilanove/Cell/Sensor</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/DuemCellSensor-2.jpg" alt="Duemilanove/Cell/Sensor" title="DuemCellSensor" /><br />
<br /></font></p>

<p><font size="3"><br />
<b>Calibrating</b></font><br />
<font size="2"><br />
Very little is needed for calibration. Check out the source code to see how simple it is. Debug #defines are included to selectively send the sensor values to the Arduino serial monitor during operation. The scaling and mapping can then be tweaked as needed while observing the output.</p>

<p>The ranges for the accelerometer readings are easily obtained by analyzing the analog input data. I found full range to be 453 to 580 for both the X and Y axis, which is 127 units with a center around 516. I arbitrarily took 20 off each end and mapped these to -90 to +90 for the Lean Gauge values.</p>

<p>The Lean Gauge display is designed to show the current real time values in bright green, and the max L-R readings are maintained on the background in dark green. These can be reset by pressing the Lean button on the display.</p>

<p>The Battery Voltage Indicator ranges were set by varying the voltage applied from a bench power supply. The top of the indicator is calibrated to 14.0v and the bottom 10.0v, again by mapping the values coming in the analog input to the 0 - 100 range expected by the Battery Voltage Indicator. With a strong battery, at idle the indicator floats within the green zone and at speed it just gets into the orange. When the battery is weak and the indicator falls into the red zone, the red area flashes at a 500 msec rate from bright red to dark red.<br />
<br /></p>

<p><b>Calibrating The Battery Voltage Indicator</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/DisplayComputer-2.jpg" alt="Calibrating BVM" title="CalibratingBVM" /><br />
<br /></font></p>

<p><font size="2"><br />
The <a href="http://en.wikipedia.org/wiki/Haversine_formula">Haversine formula</a> is used to calculate the distance traveled for the odometer and trip meters, using lat/lon data returned from the GPS. This seems to track the odometer on the scooter fairly close as long as I'm not riding in tight circles or zigzags. Since I don't ride while intoxicated, this should work fine for the trip meters but I have my doubts about the long term accuracy for use as an odometer. Time will tell, and I expect I'll be tweaking the algorithm to calibrate for improved accuracy. <br />
<br />
As an alternative, I experimented some with a hall-effect sensor triggered by a magnet attached to the wheel. I'm confident this would be very effective as a speedometer and odometer, but have decided to go strictly with the GPS for now. If you're interested, let me know and I can post the hall-effect sensor circuit and sketch. (Update 08/25/2010: added link below to circuit diagram and test sketch)<br />
</font></p>

<p><font size="3"><br />
<b>Source Code and Antipasto IDE</b></font><br />
<font size="2"></p>

<p><a href="http://www.janspace.com/b2evolution/blogs/media/Arduino/Scooterputer-07112010.zip">Scooterputer.zip</a> - sketches for Arduino Duemilanove and TouchShield Slide</p>

<p><a href="http://www.liquidware.com/antipasto_arduino_ide">Liquidware Antipasto</a> - Antipasto Arduino IDE (supports Arduino Duemilanove and TouchShield Slide)</p>

<p><a href="http://www.janspace.com/b2evolution/blogs/media/Arduino/HallEffectSensorTest-08252010.zip">HallEffectSensorTest.zip</a> - circuit and test sketch for Hall Effect sensor <br />
<br /></font></p>


<p><font size="3"><br />
<b>Scooter</b></font><br />
<font size="2"></p>


<p><b>Scooterputer Mounted Under The Hood</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/ScootArduino-1.jpg" alt="Scooter Under Hood 1" title="ScooterUnderHood 1" /><br />
<br /></p>


<p><b>Scooterputer Mounted Under The Hood</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/ScootArduino-2.jpg" alt="Scooter Under Hood 2" title="ScooterUnderHood 2" /><br />
<br /></p>


<p><b>Scooterputer Display with RAM Mount</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/ScootDisplay-1.jpg" alt="Scooter Display RAM Mount" title="ScooterDisplayRAMMount" /><br />
<br /></p>


<p><b>Scooterputer Display</b><br />
<img src="http://www.janspace.com/b2evolution/blogs/media/Arduino/ScootDisplay-2.jpg" alt="Scooter Display" title="ScooterDisplay" /><br />
<br /></p>

<p><b>Scooter Walkaround</b></p>
<div class="youtube center"><object type="application/x-shockwave-flash" style="width:425px; height:350px" data="http://www.youtube.com/v/WzzKB-dMWsQ"><param name="movie" value="http://www.youtube.com/v/WzzKB-dMWsQ" /></object></div> <br />
<br /></font><p></p>


<p><font size="3"><br />
<b>Links</b></font><br />
<font size="2"><br />
<a href="http://www.arduino.cc/">www.arduino.cc</a> - start here<br />
<a href="http://www.adafruit.com/">www.adafruit.com/</a> - get lots of great Arduino stuff here. Ladyada rocks!<br />
<a href="http://www.liquidware.com/">www.liquidware.com</a> - TouchShield Slide<br />
<a href="http://www.liquidware.com/antipasto_arduino_ide">www.liquidware.com/antipasto_arduino_ide</a> - Antipasto Arduino IDE<br />
<a href="http://www.sparkfun.com/">www.sparkfun.com</a> - components: accelerometer chip, GPS chip, RTC chip, temperature sensor, cell module, and much more<br />
<a href="http://www.boxenclosures.com/index.html">www.boxenclosures.com/index.html</a> - nice project cases<br />
<a href="http://arduiniana.org/">arduiniana.org</a> - NewSoftSerial and TinyGPS libraries. Mikal rocks too.<br />
<a href="http://itouchmap.com/latlong.html">itouchmap.com/latlong.html</a> - mapping GPS coordinates<br />
<a href="http://www.hhhh.org/wiml/proj/nmeaxor.html">www.hhhh.org/wiml/proj/nmeaxor.html</a> - NMEA sentence checksum calculator<br />
<a href="http://www.movable-type.co.uk/scripts/latlong.html">www.movable-type.co.uk/scripts/latlong.html</a> - useful latitude/longitude formulas<br />
<a href="http://www.ram-mount.com/">www.ram-mount.com</a> - mounting systems for cars, motorcycles, scooters, ATVs, etc.<br />
<a href="http://www.genuinescooters.com/">www.genuinescooters.com</a> - awesome scooters!<br />
<br /></font><br />
<font size="1"><i>Scooterputer is a trademark of Schulz Design</i></font></p><div class="item_footer"><p><small><a href="http://www.janspace.com/b2evolution/arduino.php/2010/06/26/scooterputer">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://www.janspace.com/b2evolution/arduino.php/2010/06/26/scooterputer#comments</comments>
		</item>
			</channel>
</rss>

