<?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>ArduinoFun.com Blog &#187; Project Files</title>
	<atom:link href="http://arduinofun.com/blog/index.php/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://arduinofun.com/blog</link>
	<description>- Think It - Build It - Share It -</description>
	<lastBuildDate>Thu, 01 Apr 2010 22:39:59 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CoasterBot Part I</title>
		<link>http://arduinofun.com/blog/2010/04/01/coasterbot-part-i/</link>
		<comments>http://arduinofun.com/blog/2010/04/01/coasterbot-part-i/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 22:27:16 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Project]]></category>
		<category><![CDATA[Arduino Robot]]></category>
		<category><![CDATA[coasterbot]]></category>
		<category><![CDATA[jameco]]></category>
		<category><![CDATA[make zine]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=462</guid>
		<description><![CDATA[Jameco and Make Zine are holding a contest to build a &#8220;CoasterBot,&#8221; a mini robot development platform using CD/DVD media as the main body components. I signed up, and this will be my first post documenting my progress. I have my chassis ready so far, and plan to use my Arduino.
In the Make: Robot build newsletter [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jameco.com/Jameco/PressRoom/makerobotbuild.html?CID=HPRBBannerA" target="_blank">Jameco</a> and <a href="http://makezine.com/robotbuild/" target="_blank">Make Zine</a> are holding a contest to build a &#8220;CoasterBot,&#8221; a mini robot development platform using CD/DVD media as the main body components. I signed up, and this will be my first post documenting my progress. I have my chassis ready so far, and plan to use my Arduino.</p>
<p>In the Make: Robot build newsletter #3, <a href="http://kurtsrobotbuild.blogspot.com/" target="_blank">Kurt Meredith</a> was mentioned for his idea of thermoforming a CD. After viewing his blog, it gave me the idea to try using a hot air gun to bend the CD for my robot chassis.</p>
<p><img class="alignleft size-medium wp-image-463" title="Hot Air bending a CD" src="http://arduinofun.com/blog/wp-content/uploads/2010/04/100_2160-300x225.jpg" alt="Hot Air bending a CD" width="300" height="225" />I had two different CD&#8217;s, one was a TDK that had gold paint on it. This one folded over nicely, but the paint is now peeling on it. The other was some no name brand with no paint. Once I heated it up, it folded over but I could also hear some cracking. I broke a corner, but was able to fit it back by melting the two pieces together. Once I had both CDs folded the way I wanted them, I used some strong glue and stuck them together so that I had two sides to mount my servos to.</p>
<p><img class="alignleft size-medium wp-image-465" title="CoasterBot chassis" src="http://arduinofun.com/blog/wp-content/uploads/2010/04/100_2173-300x225.jpg" alt="CoasterBot chassis" width="300" height="225" />After the glue was dry, I was not happy with the rounded front and back, so took a Dremel to them and squared it off. The chassis seems fairly sturdy but I don&#8217;t think it would hold much weight without cracking my bends. I ran a bead of glue on the underside to help with this (I hope). I should have measured where I was going to place the servos and drilled those out first, but I wasn&#8217;t thinking that far ahead <img src='http://arduinofun.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>What I wound up doing was taking an old soldering iron, drawing out my holes and servo mounting areas and then burning them away. It worked, but it is kind of ugly. I was able to file down a lot of the areas so they were fairly smooth.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2010%2F04%2F01%2Fcoasterbot-part-i%2F&amp;linkname=CoasterBot%20Part%20I"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2010/04/01/coasterbot-part-i/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DIY RGB Ambient Lamp Kit</title>
		<link>http://arduinofun.com/blog/2010/02/08/diy-rgb-ambient-lamp-kit/</link>
		<comments>http://arduinofun.com/blog/2010/02/08/diy-rgb-ambient-lamp-kit/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:06:08 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Clone]]></category>
		<category><![CDATA[Eagle Cad]]></category>
		<category><![CDATA[Lifelong Labs]]></category>
		<category><![CDATA[RGB Lamp]]></category>
		<category><![CDATA[RGB LED]]></category>
		<category><![CDATA[StackDuino]]></category>
		<category><![CDATA[Workshops]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=430</guid>
		<description><![CDATA[My new kit uses an Arduino clone that I designed that I am calling &#8220;StackDuino&#8221;. For this project I designed an RGB Led board that displays various colors. The RGB board screws on top of the StackDuino.
This kit will be home brew. I will be posting the Eagle Board files shortly for anyone interested.
We are [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_433" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-433" title="RGB Lamp Kit" src="http://arduinofun.com/blog/wp-content/uploads/2010/02/100_1964-300x225.jpg" alt="RGB Lamp Kit" width="300" height="225" /><p class="wp-caption-text">RGB Lamp Kit</p></div>
<p style="text-align: left;">My new kit uses an Arduino clone that I designed that I am calling &#8220;StackDuino&#8221;. For this project I designed an RGB Led board that displays various colors. The RGB board screws on top of the StackDuino.</p>
<p>This kit will be home brew. I will be posting the Eagle Board files shortly for anyone interested.</p>
<p>We are in the process of setting up a new creative space in Columbus, OH called Lifelong Labs (<a href="http://www.lifelonglabs.com">http://www.lifelonglabs.com</a>) and this will be one of the first project that we work on. We should be fully operational by March.</p>
<p>Lifelong Labs provide “all ages” instructional workshops that explore the intersection of art &amp; technology.  An organization created to engage enthusiast and the general public with artistic works intertwined with scientific and technological elements.<span id="more-430"></span></p>
<p>Our mission is to provide a fun atmosphere for learning that the whole family can enjoy!</p>
<p>Below are a few photos of the RGb Lamp. This is an open source kit, you are welcome to improve upon it. If you add to the design, please send me some photos so I can display them here.</p>
<p>The kit will come with the StackDuino board, RGB LED board, recycled cardboard box and battery holder. I will also be including some files to you get started with creating a simple origami box to use for the lamp shade.</p>
<p><a href="http://www.youtube.com/ArduinoFun#p/u/0/q7czBKdZ99k">YouTube Video of Lamp</a></p>
<p>The Arduino code is by Earthshine Design and can be <a href="http://earthshinedesign.co.uk/ASKManual/ASKManual.pdf">downloaded here</a>.</p>
<div id="attachment_434" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-434" title="StackDuino with RGB LED Board" src="http://arduinofun.com/blog/wp-content/uploads/2010/02/100_1889-300x225.jpg" alt="StackDuino with RGB LED Board" width="300" height="225" /><p class="wp-caption-text">StackDuino with RGB LED Board</p></div>
<p>a few photos of the lamp in action to show some of the colors&#8230;</p>
<div id="attachment_435" class="wp-caption alignleft" style="width: 235px"><img class="size-medium wp-image-435" title="RGB Lamp with simple paper shade" src="http://arduinofun.com/blog/wp-content/uploads/2010/02/100_1925-225x300.jpg" alt="RGB Lamp with simple paper shade" width="225" height="300" /><p class="wp-caption-text">RGB Lamp with simple paper shade</p></div>
<div id="attachment_436" class="wp-caption alignleft" style="width: 235px"><img class="size-medium wp-image-436" title="RGB Lamp with simple paper shade" src="http://arduinofun.com/blog/wp-content/uploads/2010/02/100_1927-225x300.jpg" alt="RGB Lamp with simple paper shade" width="225" height="300" /><p class="wp-caption-text">RGB Lamp with simple paper shade</p></div>
<div id="attachment_437" class="wp-caption alignleft" style="width: 235px"><img class="size-medium wp-image-437" title="RGB Lamp with simple paper shade" src="http://arduinofun.com/blog/wp-content/uploads/2010/02/100_1933-225x300.jpg" alt="RGB Lamp with simple paper shade" width="225" height="300" /><p class="wp-caption-text">RGB Lamp with simple paper shade</p></div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2010%2F02%2F08%2Fdiy-rgb-ambient-lamp-kit%2F&amp;linkname=DIY%20RGB%20Ambient%20Lamp%20Kit"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2010/02/08/diy-rgb-ambient-lamp-kit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking the SX-150. Building an Arduino-based sequencer</title>
		<link>http://arduinofun.com/blog/2010/01/24/hacking-the-sx-150-building-an-arduino-based-sequencer/</link>
		<comments>http://arduinofun.com/blog/2010/01/24/hacking-the-sx-150-building-an-arduino-based-sequencer/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 01:01:54 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=424</guid>
		<description><![CDATA[Jeff at Totus Terra has been working on an Arduino based sequencer. He has a three part series on his blog.  Part 1 takes control of the SX-150 pitch control.
Part 2 is a build on the basic sequencer note-on/note-off control.
Part 3 is where it comes together with a hardware-and-Arduino based 4-step sequencer for the SX-150
Jeff [...]]]></description>
			<content:encoded><![CDATA[<p><object style="width: 320px; height: 265px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="265" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/UrIPblFWjcw" /><param name="align" value="left" /><param name="vspace" value="10" /><param name="hspace" value="10" /><embed style="width: 320px; height: 265px;" type="application/x-shockwave-flash" width="320" height="265" src="http://www.youtube.com/v/UrIPblFWjcw" hspace="10" vspace="10" align="left"></embed></object>Jeff at <a href="http://totusterra.com/index.php">Totus Terra</a> has been working on an Arduino based sequencer. He has a three part series on his blog.  <a href="http://totusterra.com/index.php/2010/01/01/hacking-the-sx-150-building-an-arduino-b-1">Part 1</a> takes control of the SX-150 pitch control.</p>
<p><a href="http://totusterra.com/index.php/2010/01/09/hacking-the-sx-150-building-an-arduino-b-2">Part 2 </a>is a build on the basic sequencer note-on/note-off control.</p>
<p><a href="http://totusterra.com/index.php/2010/01/24/hacking-the-sx-150-building-an-arduino-b-3">Part 3</a> is where it comes together with a hardware-and-Arduino based 4-step sequencer for the SX-150</p>
<p>Jeff has included complete instructions, explanations, schematics and Arduino sketch files for this build.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2010%2F01%2F24%2Fhacking-the-sx-150-building-an-arduino-based-sequencer%2F&amp;linkname=Hacking%20the%20SX-150.%20Building%20an%20Arduino-based%20sequencer"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2010/01/24/hacking-the-sx-150-building-an-arduino-based-sequencer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lilypad Arduino Passion Sensing Scarf</title>
		<link>http://arduinofun.com/blog/2009/12/28/lilypad-arduino-passion-sensing-scarf/</link>
		<comments>http://arduinofun.com/blog/2009/12/28/lilypad-arduino-passion-sensing-scarf/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 15:32:23 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Lilypad]]></category>
		<category><![CDATA[Lilypad Arduino]]></category>
		<category><![CDATA[RGB LED]]></category>
		<category><![CDATA[Sensor]]></category>
		<category><![CDATA[Soft Circuit]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=359</guid>
		<description><![CDATA[My latest Instructable:  Lilypad Arduino Passion Sensing Scarf. This was my first time working with an Arduino Lilypad. I have been wanting to try something that dealt with soft circuits for awhile now. This project is what I came up with. The concept is based off my friend Ethan Dicks from theFusefactory.org&#8217;s emergent Sheep Sculpture [...]]]></description>
			<content:encoded><![CDATA[<p>My latest <a href="http://www.instructables.com/id/Arduino-Lilypad-Interactive-Passion-Sensing-Scarf/">Instructable</a>:  Lilypad Arduino Passion Sensing Scarf. This was my first time working with an Arduino Lilypad. I have been wanting to try something that dealt with soft circuits for awhile now. This project is what I came up with. The concept is based off my friend <a href="http://www.penguincentral.com/">Ethan Dicks</a> from <a href="http://www.thefusefactory.org">theFusefactory.org</a>&#8217;s emergent Sheep Sculpture project.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="265" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/bXNb9uBN-Uc" /><embed type="application/x-shockwave-flash" width="320" height="265" src="http://www.youtube.com/v/bXNb9uBN-Uc"></embed></object></p>
<p>The  Lilypad Interactive Passion Sensing Scarf works like so:</p>
<p>Scarf number one being worn by someone walking alone will light up with the color Blue for Lonely. When the wearer of scarf number two joins up with number one, the two scarves will sense each other and then  light up Red for Love.</p>
<p>Future plans for capacitance touch: which will allow the colors to Pulsate for Passion if one wearer touches the other wearers scarf. <a href="http://www.instructables.com/id/Arduino-Lilypad-Interactive-Passion-Sensing-Scarf/">View My Instructable</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2009%2F12%2F28%2Flilypad-arduino-passion-sensing-scarf%2F&amp;linkname=Lilypad%20Arduino%20Passion%20Sensing%20Scarf"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2009/12/28/lilypad-arduino-passion-sensing-scarf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Autonomous Robot</title>
		<link>http://arduinofun.com/blog/2009/11/25/arduino-autonomous-robot/</link>
		<comments>http://arduinofun.com/blog/2009/11/25/arduino-autonomous-robot/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 20:59:10 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Code]]></category>
		<category><![CDATA[Arduino Robot]]></category>
		<category><![CDATA[Arduino Sketch]]></category>
		<category><![CDATA[Autonomous Robot]]></category>
		<category><![CDATA[IR Sensor]]></category>
		<category><![CDATA[Parallax Ping Sonar]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[Sensor]]></category>
		<category><![CDATA[Sharp Sensor]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=275</guid>
		<description><![CDATA[This is a repost of a previous project. I am still working to get the older post back online from when we upgraded Wordpress.
The robot was basically built using a Parallax Boe Bot chassis. Rather than using the Basic Stamp we added an Arduino with a proto shield to control the robot functions.
You can use [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="240" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/6J_eh1HPu54" /><param name="align" value="left" /><param name="vspace" value="5" /><param name="hspace" value="5" /><embed type="application/x-shockwave-flash" width="320" height="240" src="http://www.youtube.com/v/6J_eh1HPu54" hspace="5" vspace="5" align="left"></embed></object>This is a repost of a previous project. I am still working to get the older post back online from when we upgraded Wordpress.</p>
<p>The robot was basically built using a Parallax Boe Bot chassis. Rather than using the Basic Stamp we added an <a href="http://store.arduinofun.com/freeduino-usb-complete-kit-arduino-duemilanove-compatible.html">Arduino</a> with a <a href="http://store.arduinofun.com/freeduino-protoshield-kit-for-arduino.html">proto shield</a> to control the robot functions.</p>
<p>You can use any type of chassis for this project. The robot moves about using a ping sonar and <a href="http://store.arduinofun.com/infrared-proximity-sensor--sharp-gp2y0a2021.html">IR sensors</a> to avoid running into any objects. As you can see in the video, it was a bit thrown off by our kitten. We added additional items such as a wireless camera that sends audio/video back to our TV.<span id="more-275"></span>The original design for this was created by an Instructable&#8217;s member and can be <a href="http://www.instructables.com/id/BOB-V20/">found here</a>.</p>
<p><strong>Items you will need for this project:</strong></p>
<ul>
<li><a href="http://store.arduinofun.com/freeduino-usb-complete-kit-arduino-duemilanove-compatible.html">Arduino/Freeduino</a> or <a href="http://store.arduinofun.com/breadboard-arduino-kit.html">Breadboard Arduino</a></li>
<li>(3) <a href="http://store.arduinofun.com/infrared-sensor-jumper-wire--3pin-js3.html">3-Wire Sensor Cables</a></li>
<li><a href="http://store.arduinofun.com/breadboard-400-tie-po400.html">Breadboard</a> (small) or <a href="http://store.arduinofun.com/breadboard-840-tie-po840.html">Breadboard</a> (large)</li>
<li><a href="http://store.arduinofun.com/freeduino-protoshield-kit-for-arduino.html">Protoshield</a></li>
<li>(3) <a href="http://store.arduinofun.com/infrared-proximity-sensor--sharp-gp2y0a2021.html">Sharp IR Sensors</a></li>
<li><a href="http://store.arduinofun.com/5v-1a-switching-voltage-regulat51.html">5V 1A Switching voltage regulator</a></li>
<li><a href="http://store.arduinofun.com/wire-jumper-kit-for-breadboards.html">Various lengths of wire</a></li>
<li><a href="http://store.arduinofun.com/5mm-red-and-green-leds-pk-of510.html">LED</a></li>
<li><a href="http://store.arduinofun.com/220-ohm-resistor-pk-22010.html">220 Ohm resistor</a></li>
<li><a href="http://store.arduinofun.com/4-aa-battery-holde4.html">Optional &#8211; 4 AA Battery Holder</a></li>
<li>Piezo Speaker/Element</li>
<li>Parallax Ping))) Ultrasonic Rangefinder</li>
<li>(2) Parallax Continuous Rotation Servos</li>
<li>1 Parallax Standard Rotation Servos</li>
<li>9.6V Ni-Cd Rechargeable Battery (or any other 8-AA cell <a href="http://store.arduinofun.com/4-aa-battery-holde4.html">battery     pack</a>/any rechargeable battery pack above 9V)</li>
<li>Optional Method: <a href="http://store.arduinofun.com/dual-motor-breakout-board.html">Dual Motor Breakout</a> and <a href="http://store.arduinofun.com/12vdc-mabuchi-rs380ph-12380.html">2 DC Motors</a> (<a href="http://arduinofun.com/blog/2009/10/25/duel-motor-driver/">Tutorial Available Here</a>)</li>
</ul>
<div id="attachment_310" class="wp-caption alignleft" style="width: 330px"><a href="http://www.flickr.com/photos/34908673@N00/4133522899/sizes/l/"><img class="size-full wp-image-310" title="Arduino Autonomous Robot" src="http://arduinofun.com/blog/wp-content/uploads/2009/11/lars1.jpg" alt="Arduino Autonomous Robot" width="320" height="240" /></a><p class="wp-caption-text">Arduino Autonomous Robot</p></div>
<p>The standard servo will be used to mount the Ping Rangefinder. This will give you a back and forth sweep motion as the robot travels around. The two continuous rotation servos are used for the wheels. You do not need to use the Parallax brand of servos, other brands will work. You may have to adjust the PWM values in the source code to go with the servos you are using.</p>
<p>It is also possible to use <a href="http://store.arduinofun.com/motors.html">DC motors</a> and edit the code, which would be considerably cheaper. You could use a SN754410 Quad Half H-Bridge to drive two DC motors. <a href="http://arduinofun.com/blog/2009/10/25/duel-motor-driver/">Tutorial for how to do this is available here</a>.</p>
<p>The Arduino hook up is pretty simple. You will have the following:</p>
<ul>
<li>Pin (Analog) 0: Left Sensor</li>
<li>Pin (Analog) 1: Center Sensor</li>
<li>Pin (Analog) 2: Right Sensor</li>
<li>Pin 5: Pan Servo</li>
<li>Pin 6: Left Drive Servo</li>
<li>Pin 7: Ultrasonic Rangefinder ( &#8216;Ping)))&#8217; )</li>
<li>Pin 9: Right Drive Servo</li>
<li>Pin 11: Piezo Speaker</li>
</ul>
<div id="attachment_313" class="wp-caption alignleft" style="width: 330px"><a href="http://www.flickr.com/photos/34908673@N00/4133522649/sizes/l/"><img class="size-full wp-image-313" title="Shield Close-up" src="http://arduinofun.com/blog/wp-content/uploads/2009/11/lars2.jpg" alt="Shield Close-up" width="320" height="240" /></a><p class="wp-caption-text">Shield Close-up</p></div>
<p>Radioshack sells an RC car battery as well as connector repair kit. You can solder the repair kit connector onto the shield, and then be able to hook up your battery to power the servos with. You can use a separate <a href="http://store.arduinofun.com/4-aa-battery-holde4.html">battery holder</a> to power the Arduino.</p>
<p>Make all your connections onto <a href="http://store.arduinofun.com/freeduino-protoshield-kit-for-arduino.html">the shield</a>. This way everything can remain in place if you need to use your Arduino for something else and save you from needing to tear apart everything.</p>
<p>for power to the shield, you won&#8217;t need any extra filter capacitors since the <a href="http://store.arduinofun.com/5v-1a-switching-voltage-regulat51.html">5V switching  regulator</a> has them built in. We used a small project box to hold the battery in place, and was able to attach the wireless camera on top of it.</p>
<p>The Arduino and camera are power source 1, while the servos and sensors are power source 2 (the RC battery). A small piece of PVC pipe mounted onto a cable clip will help you to keep your wires all organized to a central point and be less likely to get caught or tangled up into something as the robot is moving around.</p>
<p><strong>Arduino Sketch</strong></p>
<pre><span style="color: #7E7E7E;">// Begin Robot Code</span>
<span style="color: #CC6600;">int</span> micVal;
<span style="color: #CC6600;">int</span> cdsVal;
<span style="color: #CC6600;">int</span> irLval;  <span style="color: #7E7E7E;">// Left IR</span>
<span style="color: #CC6600;">int</span> irCval;  <span style="color: #7E7E7E;">// Center IR</span>
<span style="color: #CC6600;">int</span> irRval;  <span style="color: #7E7E7E;">// Right IR</span>

<span style="color: #CC6600;">int</span> i;   <span style="color: #7E7E7E;">// Generic Counter</span>
<span style="color: #CC6600;">int</span> x;  <span style="color: #7E7E7E;">// Generic Counter</span>
<span style="color: #CC6600;">int</span> PLval;  <span style="color: #7E7E7E;">// Pulse Width for Left Servo</span>
<span style="color: #CC6600;">int</span> PRval;  <span style="color: #7E7E7E;">// Pulse Width for Right Servo</span>
<span style="color: #CC6600;">int</span> cntr;  <span style="color: #7E7E7E;">// Generic Counter Used for Determining amt. of Object Detections</span>
<span style="color: #CC6600;">int</span> counter; <span style="color: #7E7E7E;">// Generic Counter</span>
<span style="color: #CC6600;">int</span> clrpth;  <span style="color: #7E7E7E;">// amt. of Milliseconds Of Unobstructed Path</span>
<span style="color: #CC6600;">int</span> objdet;  <span style="color: #7E7E7E;">// Time an Object was Detected</span>
<span style="color: #CC6600;">int</span> task;  <span style="color: #7E7E7E;">// Routine to Follow for Clearest Path</span>
<span style="color: #CC6600;">int</span> pwm;  <span style="color: #7E7E7E;">// Pulse Width for Pan Servo</span>
<span style="color: #CC6600;">boolean</span> add;  <span style="color: #7E7E7E;">// Whether to Increment or Decrement PW Value for Pan Servo</span>
<span style="color: #CC6600;">int</span> distance;  <span style="color: #7E7E7E;">// Distance to Object Detected via Ultrasonic Ranger</span>
<span style="color: #CC6600;">int</span> oldDistance;  <span style="color: #7E7E7E;">// Previous Distance Value Read from Ultrasonic Ranger</span>

<span style="color: #CC6600;">float</span> scale = 1.9866666666666666666666666666667;  <span style="color: #7E7E7E;">// *Not Currently Used*</span>

<span style="color: #CC6600;">int</span> LeftPin = 6;  <span style="color: #7E7E7E;">// Left Servo</span>
<span style="color: #CC6600;">int</span> RightPin = 9;  <span style="color: #7E7E7E;">// Right Servo</span>
<span style="color: #CC6600;">int</span> PiezoPin = 11;  <span style="color: #7E7E7E;">// Piezo</span>
<span style="color: #CC6600;">int</span> PingServoPin = 5;  <span style="color: #7E7E7E;">// Pan Servo</span>
<span style="color: #CC6600;">int</span> irLPin = 0;            <span style="color: #7E7E7E;">// Analog 0; Left IR</span>
<span style="color: #CC6600;">int</span> irCPin = 1;            <span style="color: #7E7E7E;">// Analog 1; Center IR</span>
<span style="color: #CC6600;">int</span> irRPin = 2;            <span style="color: #7E7E7E;">// Analog 2; Right IR</span>

<span style="color: #CC6600;">int</span> ultraSoundSignal = 7; <span style="color: #7E7E7E;">// Ultrasound signal pin</span>
<span style="color: #CC6600;">int</span> val = 0;              <span style="color: #7E7E7E;">// Used for Ultrasonic Ranger</span>
<span style="color: #CC6600;">int</span> ultrasoundValue = 0;  <span style="color: #7E7E7E;">// Raw Distance Val</span>
<span style="color: #CC6600;">int</span> oldUltrasoundValue;  <span style="color: #7E7E7E;">// *Not used*</span>
<span style="color: #CC6600;">int</span> pulseCount;        <span style="color: #7E7E7E;">// Generic Counter</span>
<span style="color: #CC6600;">int</span> timecount = 0; <span style="color: #7E7E7E;">// Echo counter</span>
<span style="color: #CC6600;">int</span> ledPin = 13; <span style="color: #7E7E7E;">// LED connected to digital pin 13</span>

#define BAUD 9600
#define CmConstant 1/29.034

<span style="color: #CC6600;">void</span> <span style="color: #CC6600;"><strong>setup</strong></span>() {
  <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">begin</span>(9600);
  <span style="color: #CC6600;">pinMode</span>(PiezoPin, <span style="color: #006699;">OUTPUT</span>);
  <span style="color: #CC6600;">pinMode</span>(ledPin, <span style="color: #006699;">OUTPUT</span>);
  <span style="color: #CC6600;">pinMode</span>(LeftPin, <span style="color: #006699;">OUTPUT</span>);
  <span style="color: #CC6600;">pinMode</span>(RightPin, <span style="color: #006699;">OUTPUT</span>);
  <span style="color: #CC6600;">pinMode</span>(PingServoPin, <span style="color: #006699;">OUTPUT</span>);
  <span style="color: #CC6600;">pinMode</span>(irLPin, <span style="color: #006699;">INPUT</span>);
  <span style="color: #CC6600;">pinMode</span>(irCPin, <span style="color: #006699;">INPUT</span>);
  <span style="color: #CC6600;">pinMode</span>(irRPin, <span style="color: #006699;">INPUT</span>);
  <span style="color: #CC6600;">for</span>(i = 0; i &lt; 500; i++) {
    <span style="color: #CC6600;">digitalWrite</span>(PiezoPin, <span style="color: #006699;">HIGH</span>);
    <span style="color: #CC6600;">delayMicroseconds</span>(1000);
    <span style="color: #CC6600;">digitalWrite</span>(PiezoPin, <span style="color: #006699;">LOW</span>);
    <span style="color: #CC6600;">delayMicroseconds</span>(1000);
  }
  <span style="color: #CC6600;">for</span>(i = 0; i &lt; 20; i++) {
  <span style="color: #CC6600;">digitalWrite</span>(PingServoPin, <span style="color: #006699;">HIGH</span>);
  <span style="color: #CC6600;">delayMicroseconds</span>(655 * 2);
  <span style="color: #CC6600;">digitalWrite</span>(PingServoPin, <span style="color: #006699;">LOW</span>);
  <span style="color: #CC6600;">delay</span>(20);
  }
  ultrasoundValue = 600;
  i = 0;
}

<span style="color: #CC6600;">void</span> <span style="color: #CC6600;"><strong>loop</strong></span>()
{
  <span style="color: #7E7E7E;">//Scan();</span>
  Look();
  Go();
}
<span style="color: #CC6600;">void</span> Look() {
  irLval = <span style="color: #CC6600;">analogRead</span>(irLPin);
  irCval = <span style="color: #CC6600;">analogRead</span>(irCPin);
  irRval = <span style="color: #CC6600;">analogRead</span>(irRPin);
  <span style="color: #7E7E7E;">//if(counter &gt; 10) {</span>
    <span style="color: #7E7E7E;">//counter = 0;</span>
    <span style="color: #7E7E7E;">//readPing();</span>
  <span style="color: #7E7E7E;">//}</span>
  <span style="color: #CC6600;">if</span>(irLval &gt; 200) {
    PLval = 850;
    PRval = 820;
    x = 5;
    cntr = cntr + 1;
    clrpth = 0;
    objdet = <span style="color: #CC6600;">millis</span>();
  }
  <span style="color: #CC6600;">else</span> <span style="color: #CC6600;">if</span>(irCval &gt; 200) {
    PLval = 850;
    PRval = 820;
    x = 10;
    cntr = cntr + 1;
    clrpth = 0;
    objdet = <span style="color: #CC6600;">millis</span>();
  }
  <span style="color: #CC6600;">else</span> <span style="color: #CC6600;">if</span>(irRval &gt; 200) {
    PLval = 650;
    PRval = 620;
    x = 5;
    cntr = cntr + 1;
    clrpth = 0;
    objdet = <span style="color: #CC6600;">millis</span>();
  }
  <span style="color: #CC6600;">else</span> {
    x = 1;
    PLval = 850;
    PRval = 620;
    counter = counter + 1;
    clrpth = (<span style="color: #CC6600;">millis</span>() - objdet);
    <span style="color: #CC6600;">if</span>(add == <span style="color: #CC6600;">true</span>) {
      pwm = pwm + 50;
    }
    <span style="color: #CC6600;">else</span> <span style="color: #CC6600;">if</span>(add == <span style="color: #CC6600;">false</span>) {
      pwm = pwm - 50;
    }
    <span style="color: #CC6600;">if</span>(pwm &lt; 400) {
      pwm = 400;
      add = <span style="color: #CC6600;">true</span>;
    }
    <span style="color: #CC6600;">if</span>(pwm &gt; 950) {
      pwm = 950;
      add = <span style="color: #CC6600;">false</span>;
    }
    <span style="color: #CC6600;">digitalWrite</span>(PingServoPin, <span style="color: #006699;">HIGH</span>);
    <span style="color: #CC6600;">delayMicroseconds</span>(pwm * 2);
    <span style="color: #CC6600;">digitalWrite</span>(PingServoPin, <span style="color: #006699;">LOW</span>);
    <span style="color: #CC6600;">delay</span>(20);
    readPing();
    <span style="color: #CC6600;">if</span>(ultrasoundValue &lt; 500) {
      cntr = cntr + 1;
      <span style="color: #CC6600;">switch</span>(pwm) {
        <span style="color: #CC6600;">case</span> 400:
          x = 7;
          PLval = 650;
          PRval = 650;
          Go();
          break;
        <span style="color: #CC6600;">case</span> 500:
          x = 10;
          PLval = 650;
          PRval = 650;
          Go();
          break;
        <span style="color: #CC6600;">case</span> 600:
          x = 14;
          PLval = 850;
          PRval = 850;
          Go();
          break;
        <span style="color: #CC6600;">case</span> 700:
          x = 10;
          PLval = 850;
          PRval = 850;
          Go();
          break;
        <span style="color: #CC6600;">case</span> 950:
          x = 7;
          PLval = 850;
          PRval = 850;
          Go();
          break;
      }
    }
  }
  <span style="color: #7E7E7E;">//Serial.print("clrpth: ");</span>
  <span style="color: #7E7E7E;">//Serial.println(clrpth);</span>
  <span style="color: #7E7E7E;">//Serial.print("objdet: ");</span>
  <span style="color: #7E7E7E;">//Serial.println(objdet);</span>
  <span style="color: #7E7E7E;">//Serial.print("cntr: ");</span>
  <span style="color: #7E7E7E;">//Serial.println(cntr);</span>
  <span style="color: #CC6600;">if</span>(cntr &gt; 25 &amp;&amp; clrpth &lt; 2000) {
    clrpth = 0;
    cntr = 0;
    Scan();
  }
}
<span style="color: #CC6600;">void</span> Go() {
  <span style="color: #CC6600;">for</span>(i = 0; i &lt; x; i++) {
    <span style="color: #CC6600;">digitalWrite</span>(LeftPin, <span style="color: #006699;">HIGH</span>);
    <span style="color: #CC6600;">delayMicroseconds</span>(PLval * 2);
    <span style="color: #CC6600;">digitalWrite</span>(LeftPin, <span style="color: #006699;">LOW</span>);
    <span style="color: #CC6600;">digitalWrite</span>(RightPin, <span style="color: #006699;">HIGH</span>);
    <span style="color: #CC6600;">delayMicroseconds</span>(PRval * 2);
    <span style="color: #CC6600;">digitalWrite</span>(RightPin, <span style="color: #006699;">LOW</span>);
    <span style="color: #CC6600;">delay</span>(20);
  }
}
<span style="color: #CC6600;">void</span> readPing() {  <span style="color: #7E7E7E;">// Get Distance from Ultrasonic Ranger</span>
 timecount = 0;
 val = 0;
 <span style="color: #CC6600;">pinMode</span>(ultraSoundSignal, <span style="color: #006699;">OUTPUT</span>); <span style="color: #7E7E7E;">// Switch signalpin to output</span>

<span style="color: #7E7E7E;">/* Send low-high-low pulse to activate the trigger pulse of the sensor</span>
<span style="color: #7E7E7E;"> * -------------------------------------------------------------------</span>
<span style="color: #7E7E7E;"> */</span>

<span style="color: #CC6600;">digitalWrite</span>(ultraSoundSignal, <span style="color: #006699;">LOW</span>); <span style="color: #7E7E7E;">// Send low pulse</span>
<span style="color: #CC6600;">delayMicroseconds</span>(2); <span style="color: #7E7E7E;">// Wait for 2 microseconds</span>
<span style="color: #CC6600;">digitalWrite</span>(ultraSoundSignal, <span style="color: #006699;">HIGH</span>); <span style="color: #7E7E7E;">// Send high pulse</span>
<span style="color: #CC6600;">delayMicroseconds</span>(5); <span style="color: #7E7E7E;">// Wait for 5 microseconds</span>
<span style="color: #CC6600;">digitalWrite</span>(ultraSoundSignal, <span style="color: #006699;">LOW</span>); <span style="color: #7E7E7E;">// Holdoff</span>

<span style="color: #7E7E7E;">/* Listening for echo pulse</span>
<span style="color: #7E7E7E;"> * -------------------------------------------------------------------</span>
<span style="color: #7E7E7E;"> */</span>

<span style="color: #CC6600;">pinMode</span>(ultraSoundSignal, <span style="color: #006699;">INPUT</span>); <span style="color: #7E7E7E;">// Switch signalpin to input</span>
val = <span style="color: #CC6600;">digitalRead</span>(ultraSoundSignal); <span style="color: #7E7E7E;">// Append signal value to val</span>
<span style="color: #CC6600;">while</span>(val == <span style="color: #006699;">LOW</span>) { <span style="color: #7E7E7E;">// Loop until pin reads a high value</span>
  val = <span style="color: #CC6600;">digitalRead</span>(ultraSoundSignal);
}

<span style="color: #CC6600;">while</span>(val == <span style="color: #006699;">HIGH</span>) { <span style="color: #7E7E7E;">// Loop until pin reads a high value</span>
  val = <span style="color: #CC6600;">digitalRead</span>(ultraSoundSignal);
  timecount = timecount +1;            <span style="color: #7E7E7E;">// Count echo pulse time</span>
}

<span style="color: #7E7E7E;">/* Writing out values to the serial port</span>
<span style="color: #7E7E7E;"> * -------------------------------------------------------------------</span>
<span style="color: #7E7E7E;"> */</span>

ultrasoundValue = timecount; <span style="color: #7E7E7E;">// Append echo pulse time to ultrasoundValue</span>

<span style="color: #7E7E7E;">//serialWrite('A'); // Example identifier for the sensor</span>
<span style="color: #7E7E7E;">//printInteger(ultrasoundValue);</span>
<span style="color: #7E7E7E;">//serialWrite(10);</span>
<span style="color: #7E7E7E;">//serialWrite(13);</span>

<span style="color: #7E7E7E;">/* Lite up LED if any value is passed by the echo pulse</span>
<span style="color: #7E7E7E;"> * -------------------------------------------------------------------</span>
<span style="color: #7E7E7E;"> */</span>

<span style="color: #CC6600;">if</span>(timecount &gt; 0){
  <span style="color: #CC6600;">digitalWrite</span>(ledPin, <span style="color: #006699;">HIGH</span>);
}
} 
<span style="color: #CC6600;">void</span> Scan() {   <span style="color: #7E7E7E;">// Scan for the Clearest Path</span>
  oldDistance = 30;
  task = 0;
  <span style="color: #CC6600;">for</span>(i = 1; i &lt; 5; i++) {
    <span style="color: #CC6600;">switch</span>(i) {
      <span style="color: #CC6600;">case</span> 1:
        <span style="color: #7E7E7E;">//Serial.println("Pos. 1");</span>
        pwm = 1125;    <span style="color: #7E7E7E;">///  incr. by 100 from 1085</span>
        break;
      <span style="color: #CC6600;">case</span> 2:
        <span style="color: #7E7E7E;">//Serial.println("Pos. 2");</span>
        pwm = 850; <span style="color: #7E7E7E;">//// increased by 100 from 850</span>
        break;
      <span style="color: #CC6600;">case</span> 3:
        <span style="color: #7E7E7E;">//Serial.println("Pos. 3");</span>
        pwm = 400;
        break;
      <span style="color: #CC6600;">case</span> 4:
        <span style="color: #7E7E7E;">//Serial.println("Pos. 4");</span>
        pwm = 235;
        break;
    }
    <span style="color: #CC6600;">for</span>(pulseCount = 0; pulseCount &lt; 20; pulseCount++) {  <span style="color: #7E7E7E;">// Adjust Pan Servo and Read USR</span>
      <span style="color: #CC6600;">digitalWrite</span>(PingServoPin, <span style="color: #006699;">HIGH</span>);
      <span style="color: #CC6600;">delayMicroseconds</span>(pwm * 2);
      <span style="color: #CC6600;">digitalWrite</span>(PingServoPin, <span style="color: #006699;">LOW</span>);
      readPing();
      <span style="color: #CC6600;">delay</span>(20);
    }
    distance = ((<span style="color: #CC6600;">float</span>)ultrasoundValue * CmConstant);   <span style="color: #7E7E7E;">// Calculate Distance in Cm</span>
    <span style="color: #CC6600;">if</span>(distance &gt; oldDistance) {  <span style="color: #7E7E7E;">// If the Newest distance is longer, replace previous reading with it</span>
      oldDistance = distance;
      task = i;   <span style="color: #7E7E7E;">// Set task equal to Pan Servo Position</span>
    }
  }
  <span style="color: #7E7E7E;">//Serial.print("Task: ");</span>
  <span style="color: #7E7E7E;">//Serial.println(task);</span>
  <span style="color: #7E7E7E;">//Serial.print("distance: ");</span>
  <span style="color: #7E7E7E;">//Serial.println(distance);</span>
  <span style="color: #7E7E7E;">//Serial.print("oldDistance: ");</span>
  <span style="color: #7E7E7E;">//Serial.println(oldDistance);</span>
  distance = 50;  <span style="color: #7E7E7E;">// Prevents Scan from Looping</span>
  <span style="color: #CC6600;">switch</span>(task) {   <span style="color: #7E7E7E;">// Determine which task should be carried out</span>
    <span style="color: #CC6600;">case</span> 0:  <span style="color: #7E7E7E;">// Center was clearest</span>
      x = 28;
      PLval = (850);
      PRval = (850);
      Go();
      break;
    <span style="color: #CC6600;">case</span> 1:  <span style="color: #7E7E7E;">// 90 degrees Left was Clearest</span>
      x = 14;
      PLval = (650);
      PRval = (650);
      Go();
      break;
    <span style="color: #CC6600;">case</span> 2:  <span style="color: #7E7E7E;">// 45 degrees left</span>
      x = 7;
      PLval = (650);
      PRval = (650);
      Go();
      break;
    <span style="color: #CC6600;">case</span> 3:  <span style="color: #7E7E7E;">// 45 degrees right</span>
      x = 7;
      PLval = (850);
      PRval = (850);
      Go();
      break;
    <span style="color: #CC6600;">case</span> 4:  <span style="color: #7E7E7E;">// 90 degrees right</span>
      x = 14;
      PLval = (850);
      PRval = (850);
      Go();
      break;
  }
}

<span style="color: #7E7E7E;">// End Robot Code</span></pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2009%2F11%2F25%2Farduino-autonomous-robot%2F&amp;linkname=Arduino%20Autonomous%20Robot"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2009/11/25/arduino-autonomous-robot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Arduino PIR Motion Sensing Bridge with Solar Powered LED Lighting</title>
		<link>http://arduinofun.com/blog/2009/11/15/arduino-pir-motion-sensing-bridge-with-solar-powered-led-lighting/</link>
		<comments>http://arduinofun.com/blog/2009/11/15/arduino-pir-motion-sensing-bridge-with-solar-powered-led-lighting/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 03:14:56 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Code]]></category>
		<category><![CDATA[Arduino PIR Sensing]]></category>
		<category><![CDATA[Arduino Sketch]]></category>
		<category><![CDATA[Columbus]]></category>
		<category><![CDATA[Columbus State]]></category>
		<category><![CDATA[LED Lighting]]></category>
		<category><![CDATA[Motion Detection]]></category>
		<category><![CDATA[Motion Sensor]]></category>
		<category><![CDATA[OH]]></category>
		<category><![CDATA[Parallax PIR Sensor]]></category>
		<category><![CDATA[Solar Power]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=266</guid>
		<description><![CDATA[The bridge, “Passage” by L. Brower Hatcher at Columbus State, is one of the most outstanding and notable landmarks on campus. Connecting the main parking garage and Davidson Hall over Spring Street, the bridge offers safe passage above the fast moving one-way traffic below. Painted bright red, it also adds a strong visual contrast against [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_267" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-267" title="Bridge Passage, courtesy of Professor Tom Robbins, Architecture" src="http://arduinofun.com/blog/wp-content/uploads/2009/11/bridge1sm-300x223.jpg" alt="Bridge Passage,courtesy of Professor Tom Robbins, Architecture" width="300" height="223" /><p class="wp-caption-text">Bridge Passage, photo courtesy of Professor Tom Robbins, Architecture</p></div>
<p>The bridge, “Passage” by L. Brower Hatcher at Columbus State, is one of the most outstanding and notable landmarks on campus. Connecting the main parking garage and Davidson Hall over Spring Street, the bridge offers safe passage above the fast moving one-way traffic below. Painted bright red, it also adds a strong visual contrast against the blue sky above and the green grass below.</p>
<p>The bridge contains many educational symbols and decorative metal icons mounted along the passage, which at one time were lighted at night by fiber-optics, creating a moving array of colors and light. This night-time light display has been noticeably absent for several years, apparently due to the mechanical failure of the high-powered “luminaries” which project colored light through the fiber optic cables.</p>
<div id="attachment_269" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-269" title="Bridge Icons" src="http://arduinofun.com/blog/wp-content/uploads/2009/11/bridge2sm-300x223.jpg" alt="Bridge Icons" width="300" height="223" /><p class="wp-caption-text">Bridge Icons</p></div>
<p>As a class project, we designed a <strong>Solar Powered LED Lighting</strong> system to replace the existing outdated system that no longer works. (I can&#8217;t reveal the design yet here until things are approved) After thorough investigation, our class determined that the luminaries, located on the side of the bridge, most likely failed due to heat build-up, and possibly corrosion from exhaust and salt water mist from the traffic below. By contacting the vendor, we discovered that the 277 VAC model PH-3001 luminaries installed when the bridge was commissioned are no longer manufactured, and the replacement units would not be compatible with any of the PH-3001 units which still may be repairable on the bridge.  This means that to light the bridge again using the high-powered Metal-Halide luminaries, all 14 units would need to be replaced, at a minimum cost of $13,000.00 USD, not including labor.</p>
<p>It is also important to note, that the PH-3001 units are extremely difficult to maintain. Maintenance is very labor intensive, and consumes a large block of time for maintenance personnel who obviously have a multitude of other important tasks, maintaining a large campus the size of Columbus State. The bulbs burn out frequently, with a replacement cost of $211.00 each, or approximately $3000.00 USD per year. The units are also located in a difficult to reach location, and the fragile glass color wheels which require frequent cleaning and maintenance because of pollution from the traffic below, are easily damaged during maintenance.<span id="more-266"></span></p>
<p><strong>Cost Benefit Analysis:</strong></p>
<p>As noted earlier, the old Metal Halide lighting units are very labor intensive, and difficult to maintain. Due to heat buildup inside the enclosed units (Metal Halide bulbs run very hot), the bulbs would need to be changed yearly at a material cost of $3000.00 USD. Added to this amount would be a minimum of 28 hours of labor at $40 per hour, or $1120 in labor costs. The 14 units each consume approximately 200 watts of power per hour, or a total of $3.36 per day, $1226 per year. This would bring the approximate operating costs for the old lighting units to $3000 + $1120 + $1226 = $5346.00 per year operating cost.</p>
<p>Since the Solar Powered LED illuminated bridge runs off of the Sun’s energy, electrical costs and Carbon footprint would be Zero. LED light bulbs have an average MTBF (Mean time between failure) of 50,000 to 100,000 hours, or approximately 20 times that of the metal halide bulbs. By eliminating the mechanical rotating color wheels, valuable maintenance costs for an LED lighting system would be greatly reduced, to possibly only several hours per year. <strong>The estimated cost savings for the Solar Powered LED lighting system would be over $5000.00 USD per year.</strong></p>
<p>So far the school has seemed to drag their feet with getting things done. Each day when I go to class and walk across the bridge I day dream about more stuff to add to the design which brings me to my original intent for this post, which is how to connect a PIR sensor to an Arduino.</p>
<p>The bridge has lighted square panels along the walkway. What I would like to see added is the ability for each panel to light up as a person gets close and then turn off as they move further away. This I feel will add to the cost savings since the walk way lights will only be in use at night when there is traffic on the bridge. If nobody is on the bridge, there is no need for them to be on at that time since the only purpose they serve is to see where you are walking.</p>
<div id="attachment_271" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-271" title="Arduino with PIR Sensor" src="http://arduinofun.com/blog/wp-content/uploads/2009/11/100_1512-300x225.jpg" alt="Arduino with PIR Sensor" width="300" height="225" /><p class="wp-caption-text">Arduino with PIR Sensor</p></div>
<p><strong>Connecting a PIR sensor to an Arduino board can be done easily.</strong> PIR sensors consist of 3 pins, Vcc (Positive Voltage), Vss (Ground), and Signal. Interfacing it to the Arduino only requires +5v, GND and a digital input pin.</p>
<p>I put a short video clip on <a href="http://www.youtube.com/watch?v=Wn5-fyzOLOs" target="_blank">YouTube</a> showing how the sensor works and the code is below.</p>
<p>I am thinking I could easily put together a small board and have each one located throughout the bridge with PIR sensors connected to them to control the individual squares. Or possibly have one central location for a control station and each PIR sensor runs to it.</p>
<p>Then as you walk, each panel will light up and turn off a few seconds later as you move away from it. The panels are staggered all the way down the walkway, so this would give a nice effect at night as someone is walking across the bridge.</p>
<p>Another thought I had was to tie all the walkway panels into one PIR at the entrance and one PIR at the exit of the bridge (maybe one in the middle also) and then the bridge would light up in 2-3 stages, rather than individual panels. Kind of boring, but serves its purpose for safety.</p>
<p>Additional Resources:</p>
<p><a href="http://www.parallax.com/dl/docs/prod/audiovis/PIRSensor-V1.1.pdf">Parallax PIR Sensor Datasheet</a></p>
<p><a href="http://www.arduino.cc/playground/Code/PIRsense">Arduino PIRsense</a></p>
<p><strong>Arduino Sketch:</strong></p>
<pre><span style="color: #7E7E7E;">// Parallax PIR sensor's output</span>

<span style="color: #7E7E7E;">//VARS</span>
<span style="color: #7E7E7E;">//the time we give the sensor to calibrate (10-60 secs according to the datasheet)</span>
<span style="color: #CC6600;">int</span> calibrationTime = 30;        

<span style="color: #7E7E7E;">//the time when the sensor outputs a low impulse</span>
<span style="color: #CC6600;">long</span> <span style="color: #CC6600;">unsigned</span> <span style="color: #CC6600;">int</span> lowIn;         

<span style="color: #7E7E7E;">//the amount of milliseconds the sensor has to be low </span>
<span style="color: #7E7E7E;">//before we assume all motion has stopped</span>
<span style="color: #CC6600;">long</span> <span style="color: #CC6600;">unsigned</span> <span style="color: #CC6600;">int</span> pause = 5000;  

<span style="color: #CC6600;">boolean</span> lockLow = <span style="color: #CC6600;">true</span>;
<span style="color: #CC6600;">boolean</span> takeLowTime;  

<span style="color: #CC6600;">int</span> pirPin = 3;    <span style="color: #7E7E7E;">//the digital pin connected to the PIR sensor's output</span>
<span style="color: #CC6600;">int</span> ledPin = 13;

<span style="color: #7E7E7E;">//SETUP</span>
<span style="color: #CC6600;">void</span> <span style="color: #CC6600;"><strong>setup</strong></span>(){
  <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">begin</span>(9600);
  <span style="color: #CC6600;">pinMode</span>(pirPin, <span style="color: #006699;">INPUT</span>);
  <span style="color: #CC6600;">pinMode</span>(ledPin, <span style="color: #006699;">OUTPUT</span>);
  <span style="color: #CC6600;">digitalWrite</span>(pirPin, <span style="color: #006699;">LOW</span>);

  <span style="color: #7E7E7E;">//give the sensor some time to calibrate</span>
  <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">print</span>(<span style="color: #006699;">"calibrating sensor "</span>);
    <span style="color: #CC6600;">for</span>(<span style="color: #CC6600;">int</span> i = 0; i &lt; calibrationTime; i++){
      <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">print</span>(<span style="color: #006699;">"."</span>);
      <span style="color: #CC6600;">delay</span>(1000);
      }
    <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">println</span>(<span style="color: #006699;">" done"</span>);
    <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">println</span>(<span style="color: #006699;">"SENSOR ACTIVE"</span>);
    <span style="color: #CC6600;">delay</span>(50);
  }

<span style="color: #7E7E7E;">////////////////////////////</span>
<span style="color: #7E7E7E;">//LOOP</span>
<span style="color: #CC6600;">void</span> <span style="color: #CC6600;"><strong>loop</strong></span>(){

     <span style="color: #CC6600;">if</span>(<span style="color: #CC6600;">digitalRead</span>(pirPin) == <span style="color: #006699;">HIGH</span>){
       <span style="color: #CC6600;">digitalWrite</span>(ledPin, <span style="color: #006699;">HIGH</span>);   <span style="color: #7E7E7E;">//the led visualizes the sensors output pin state</span>
       <span style="color: #CC6600;">if</span>(lockLow){
         <span style="color: #7E7E7E;">//makes sure we wait for a transition to LOW before any further output is made:</span>
         lockLow = <span style="color: #CC6600;">false</span>;
         <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">println</span>(<span style="color: #006699;">"---"</span>);
         <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">print</span>(<span style="color: #006699;">"motion detected at "</span>);
         <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">print</span>(<span style="color: #CC6600;">millis</span>()/1000);
         <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">println</span>(<span style="color: #006699;">" sec"</span>);
         <span style="color: #CC6600;">delay</span>(50);
         }         
         takeLowTime = <span style="color: #CC6600;">true</span>;
       }

     <span style="color: #CC6600;">if</span>(<span style="color: #CC6600;">digitalRead</span>(pirPin) == <span style="color: #006699;">LOW</span>){
       <span style="color: #CC6600;">digitalWrite</span>(ledPin, <span style="color: #006699;">LOW</span>);  <span style="color: #7E7E7E;">//the led visualizes the sensors output pin state</span>

       <span style="color: #CC6600;">if</span>(takeLowTime){
        lowIn = <span style="color: #CC6600;">millis</span>();          <span style="color: #7E7E7E;">//save the time of the transition from high to LOW</span>
        takeLowTime = <span style="color: #CC6600;">false</span>;       <span style="color: #7E7E7E;">//make sure this is only done at the start of a LOW phase</span>
        }
       <span style="color: #7E7E7E;">//if the sensor is low for more than the given pause, </span>
       <span style="color: #7E7E7E;">//we assume that no more motion is going to happen</span>
       <span style="color: #CC6600;">if</span>(!lockLow &amp;&amp; <span style="color: #CC6600;">millis</span>() - lowIn &gt; pause){
           <span style="color: #7E7E7E;">//makes sure this block of code is only executed again after </span>
           <span style="color: #7E7E7E;">//a new motion sequence has been detected</span>
           lockLow = <span style="color: #CC6600;">true</span>;
           <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">print</span>(<span style="color: #006699;">"motion ended at "</span>);      <span style="color: #7E7E7E;">//output</span>
           <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">print</span>((<span style="color: #CC6600;">millis</span>() - pause)/1000);
           <span style="color: #CC6600;">Serial</span>.<span style="color: #CC6600;">println</span>(<span style="color: #006699;">" sec"</span>);
           <span style="color: #CC6600;">delay</span>(50);
           }
       }
  }</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2009%2F11%2F15%2Farduino-pir-motion-sensing-bridge-with-solar-powered-led-lighting%2F&amp;linkname=Arduino%20PIR%20Motion%20Sensing%20Bridge%20with%20Solar%20Powered%20LED%20Lighting"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2009/11/15/arduino-pir-motion-sensing-bridge-with-solar-powered-led-lighting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Open Source ADM-Robot 1.0 (part 1)</title>
		<link>http://arduinofun.com/blog/2009/11/01/open-source-adm-robot-1-0-part-1/</link>
		<comments>http://arduinofun.com/blog/2009/11/01/open-source-adm-robot-1-0-part-1/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 18:37:13 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Project]]></category>
		<category><![CDATA[Arduino Robot]]></category>
		<category><![CDATA[Arduino Sketch]]></category>
		<category><![CDATA[GridConnect]]></category>
		<category><![CDATA[Open Source Project]]></category>
		<category><![CDATA[Open Source Robot]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[Printed Circuit Board]]></category>
		<category><![CDATA[Recycling]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[Science Fair Projects]]></category>
		<category><![CDATA[WiFly]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=174</guid>
		<description><![CDATA[It&#8217;s that time of year again&#8230; where the sounds of knowledge fill the home labs, garages and basements across the globe. Here in the ArduinoFun lab, we have been busy working on this years project ADM-Robot 1.0 aka Recycle-bot.
I will be posting progress photos and notes as we go along to document the process for [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_175" class="wp-caption alignleft" style="width: 330px"><img class="size-full wp-image-175" title="Drew and Jacob - Soldering boards" src="http://arduinofun.com/blog/wp-content/uploads/2009/11/sf1.jpg" alt="Drew and Jacob - Soldering boards" width="320" height="240" /><p class="wp-caption-text">Drew and Jacob - Soldering boards</p></div>
<p>It&#8217;s that time of year again&#8230; where the sounds of knowledge fill the home labs, garages and basements across the globe. Here in the ArduinoFun lab, we have been busy working on this years project ADM-Robot 1.0 aka Recycle-bot.</p>
<p>I will be posting progress photos and notes as we go along to document the process for our science fair project.</p>
<p>What is ADM 1.0? Basically we built an Arduino, added a Dual Motor Controller to it and a small prototyping area. Hence the name ADM (Arduino Dual Motor).  The board works and is programmed just like a normal Arduino. For the science fair, part of the rules stated we could not use an actual Arduino board, but were able to build or modify our own.<span id="more-174"></span></p>
<div id="attachment_176" class="wp-caption alignleft" style="width: 330px"><img class="size-full wp-image-176" title="Shawn and Jacob - Drilling component holes" src="http://arduinofun.com/blog/wp-content/uploads/2009/11/sf2.jpg" alt="Shawn and Jacob - Drilling component holes" width="320" height="240" /><p class="wp-caption-text">Shawn and Jacob - Drilling component holes</p></div>
<p>Below is a zip file which contains the files that will allow you to create your own PCB file. According to Drew and Jacob, Recycle bot will be used in school to help drive interest in getting classmates to start recycling. &#8220;Having a cool robot moving around the lunch room to collect your recyclables will encourage everyone to participate because it is so cool!&#8221;</p>
<p>We will be using a metal trash can that we found at the store that just looks like it was meant to be a robot.</p>
<p>To make a copy of the PCB, you can follow the <a href="http://www.instructables.com/id/Creating-Printed-Circuit-Boards-with-a-INKJET-Prin/">Instructable that I created</a> that uses a home Inkjet printer. The entire process works really well and the boards have turned out great.</p>
<p><a href="http://arduinofun.com/files/adm1.zip"></a></p>
<div id="attachment_183" class="wp-caption alignleft" style="width: 330px"><a><img class="size-full wp-image-183" title="Drew and Jacob - Prototyping ADM 1.0" src="http://arduinofun.com/blog/wp-content/uploads/2009/11/sf3.jpg" alt="Drew and Jacob - Prototyping ADM 1.0" width="320" height="240" /></a><p class="wp-caption-text">Drew and Jacob - Prototyping ADM 1.0</p></div>
<p><a href="http://arduinofun.com/files/adm1.zip">This zip file</a> contains two PDF files (solder side &amp; component side), for printing your own circuit board.</p>
<p>Once we get a little further along I will start posting some videos, photos and Arduino sketches that we use.</p>
<p>We are also working with <a href="http://www.gridconnect.com/wiflygsxkit.html">GridConnect</a> on a project, and hopefully if all goes well ADM will be enabled with WiFly</p>
<p>Board Photos on My <a href="http://www.flickr.com/photos/34908673@N00/">Flickr</a> Page.</p>
<p><a href="http://www.flickr.com/photos/34908673@N00/4067482659/">Component Side</a>, <a href="http://www.flickr.com/photos/34908673@N00/4068232404/">Solder Side</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2009%2F11%2F01%2Fopen-source-adm-robot-1-0-part-1%2F&amp;linkname=Open%20Source%20ADM-Robot%201.0%20%28part%201%29"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2009/11/01/open-source-adm-robot-1-0-part-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Dual Motor Driver with Arduino using a SN754410NE Quad Half H-Bridge</title>
		<link>http://arduinofun.com/blog/2009/10/25/duel-motor-driver/</link>
		<comments>http://arduinofun.com/blog/2009/10/25/duel-motor-driver/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 01:39:53 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Sketch]]></category>
		<category><![CDATA[Arduino Tutorial]]></category>
		<category><![CDATA[DC Motor]]></category>
		<category><![CDATA[Duel Motor]]></category>
		<category><![CDATA[H-Bridge]]></category>
		<category><![CDATA[Science Fair Projects]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=144</guid>
		<description><![CDATA[With this post I am going to show you how to use a SN754410NE Quad Half H-Bridge IC to control two 12 volt DC Motors.  I have added a video so that you can see the Dual Motor in action.  As you can see in the video, all the wires can be a little confusing [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_147" class="wp-caption alignleft" style="width: 295px"><img class="size-medium wp-image-147" title="H-Bridge Setup" src="http://arduinofun.com/blog/wp-content/uploads/2009/10/hbridge_setup-285x300.jpg" alt="H-Bridge Setup" width="285" height="300" /><p class="wp-caption-text">H-Bridge Setup</p></div>
<p>With this post I am going to show you how to use a <strong>SN754410NE Quad Half H-Bridge IC</strong> to control two 12 volt DC Motors.  I have added a video so that you can see the Dual Motor in action.  As you can see in the video, all the wires can be a little confusing to look at.  To make things easier to view and understand as we go along, I have also created an illustration for you to refer to.  <a href="http://arduinofun.com/instruct/hbridge.pdf" target="_blank">You may also download a printable PDF file of this illustration</a>.  I have depicted an Arduino board in the illustration, if you already have one you are good to go, if not&#8230; you can do like I have and <a href="http://arduinofun.com/blog/2009/10/15/breadboard-arduino/"><strong>Build Your Own Arduino</strong></a> following another one of my tutorials.<span id="more-144"></span></p>
<p>Here is the recommended parts you will need in order to complete this project. I have provided sources where you can purchase items from and their prices.</p>
<ol>
<li>Arduino board &#8211; $29.95 at <a href="http://www.curiousinventor.com/store/product/283" target="_blank">CuriousInventor.com</a> <strong>or&#8230; </strong></li>
<li><a href="http://www.instructables.com/id/Build-Your-Own-Arduino/">Build Your Own Arduino</a> &#8211; Total build cost $15.95 at <a href="http://store.arduinofun.com/breadboard-arduino-kit.html" target="_blank">ArduinoFun.com</a></li>
<li>SN754410 Quad Half H-Bridge &#8211; $2.50 available at <a href="http://store.arduinofun.com/sn754410-quad-half-h754410.html" target="_blank">ArduinoFun.com</a></li>
<li>840 Tie Point Breadboard &#8211; $6.95 available at <a href="http://store.arduinofun.com/breadboard-840-tie-po840.html" target="_blank">ArduinoFun.com</a></li>
<li>Wire Jumper Kit &#8211; $12.95 available at <a href="http://store.arduinofun.com/wire-jumper-kit-for-breadboards.html" target="_blank">ArduinoFun.com</a></li>
<li>Two DC Motors &#8211; $3.99 ea. available at <a href="http://store.arduinofun.com/heavy-duty-dc-motor1.html" target="_blank">ArduinoFun.com</a></li>
</ol>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="265" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/-puvkFxyMOI&amp;hl=en&amp;fs=1&amp;color1=0x2b405b&amp;color2=0x6b8ab6" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="320" height="265" src="http://www.youtube.com/v/-puvkFxyMOI&amp;hl=en&amp;fs=1&amp;color1=0x2b405b&amp;color2=0x6b8ab6" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div id="attachment_150" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-150" title="H-Bridge Pinout" src="http://arduinofun.com/blog/wp-content/uploads/2009/10/hbridge_pinout-300x250.jpg" alt="H-Bridge Pinout" width="300" height="250" /><p class="wp-caption-text">H-Bridge Pinout</p></div>
<p>As you are looking at the SN754410NE chip, you will notice a u-shaped notch at one end.  This will help to identify pin 1.</p>
<p>Pins 1, 9, and 16 are +5V<br />
Pin 8 is +12V and will run the +12V DC motors.<br />
Pins 4, 5, 12, and 13 are for GND</p>
<p>DC Motors have two hook ups on them.  If you hooked one up straight to the source power you would have one lead going to positive and one lead going to GND.</p>
<p>For our H-Bridge driver, you will hook the left motor leads to pin 3 &amp; 6.  The right motor leads will hook up to pins 11 &amp; 14.</p>
<p>Connect h-bridge pin 2 to the Arduino digital pin 2, and h-bridge pin 7 to Arduino digital pin 3.<br />
Connect h-bridge pin 10 to Arduino digital pin 8, and h-bridge pin 15 to Arduino digital pin 7</p>
<p>Once you have your h-bridge circuit completed, you can upload the sketch to your Arduino.  The sketch will cycle back and forth on the dc motors driving them forward and backwards and then light an led connected to pin 13 on the arduino.</p>
<p><strong>Arduino Sketch</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co1">// Use this code to test your motor with the Arduino board:</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// if you need PWM, just use the PWM outputs on the Arduino</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// and instead of digitalWrite, you should use the analogWrite command</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// ————————————————————————— &nbsp;Motors</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">int</span> motor_left<span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="br0">&#123;</span><span class="nu0">2</span>, <span class="nu0">3</span><span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">int</span> motor_right<span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="br0">&#123;</span><span class="nu0">7</span>, <span class="nu0">8</span><span class="br0">&#125;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">int</span> ledPin = &nbsp;<span class="nu0">13</span>; &nbsp; &nbsp;<span class="co1">// LED connected to digital pin 13</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// ————————————————————————— Setup</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> setup<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">Serial.<span class="me1">begin</span><span class="br0">&#40;</span><span class="nu0">9600</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="co1">// Setup motors</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">int</span> i;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">for</span><span class="br0">&#40;</span>i = <span class="nu0">0</span>; i &lt; <span class="nu0">2</span>; i++<span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">pinMode<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span>i<span class="br0">&#93;</span>, OUTPUT<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">pinMode<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span>i<span class="br0">&#93;</span>, OUTPUT<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">pinMode<span class="br0">&#40;</span>ledPin, OUTPUT<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="co1">// ————————————————————————— Loop</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> loop<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">drive_forward<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">delay<span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">motor_stop<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Serial.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;1&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">drive_backward<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">delay<span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">motor_stop<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Serial.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;2&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">turn_left<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">delay<span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">motor_stop<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Serial.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;3&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">turn_right<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">delay<span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">motor_stop<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Serial.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;4&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">motor_stop<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">delay<span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">motor_stop<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Serial.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;5&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>ledPin, HIGH<span class="br0">&#41;</span>; &nbsp; <span class="co1">// set the LED on</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; delay<span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// wait for a second</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; digitalWrite<span class="br0">&#40;</span>ledPin, LOW<span class="br0">&#41;</span>; &nbsp; &nbsp;<span class="co1">// set the LED off</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; delay<span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// wait for a second</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="co1">// ————————————————————————— Drive</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> motor_stop<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">delay<span class="br0">&#40;</span><span class="nu0">25</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> drive_forward<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, HIGH<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, HIGH<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> drive_backward<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, HIGH<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, HIGH<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> turn_left<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, HIGH<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, HIGH<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw4">void</span> turn_right<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, HIGH<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_left<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>, LOW<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">digitalWrite<span class="br0">&#40;</span>motor_right<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, HIGH<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2009%2F10%2F25%2Fduel-motor-driver%2F&amp;linkname=Dual%20Motor%20Driver%20with%20Arduino%20using%20a%20SN754410NE%20Quad%20Half%20H-Bridge"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2009/10/25/duel-motor-driver/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Arduino Solar Tracker</title>
		<link>http://arduinofun.com/blog/2009/10/21/arduino-solar-tracker/</link>
		<comments>http://arduinofun.com/blog/2009/10/21/arduino-solar-tracker/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 12:30:40 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Projects]]></category>
		<category><![CDATA[Arduino Sketch]]></category>
		<category><![CDATA[Arduino Solar Tracker]]></category>
		<category><![CDATA[Energy Savings]]></category>
		<category><![CDATA[Solar Panel]]></category>
		<category><![CDATA[Solar Power]]></category>
		<category><![CDATA[Solar Tracking]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=121</guid>
		<description><![CDATA[Solar power is energy that is produced from the sun, unlike typical energy sources which use fossil fuels. Fossil fuels are a non-renewable energy source, so as they are used they are depleted from the Earth. Solar power provides many benefits that enhance our quality of life.
With the rising fuel prices I decided to purchase [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-122" title="arduino solar tracker" src="http://arduinofun.com/blog/wp-content/uploads/2009/10/solar.jpg" alt="arduino solar tracker" width="320" height="213" />Solar power is energy that is produced from the sun, unlike typical energy sources which use fossil fuels. Fossil fuels are a non-renewable energy source, so as they are used they are depleted from the Earth. Solar power provides many benefits that enhance our quality of life.</p>
<p>With the rising fuel prices I decided to purchase a <a href="http://www.piaggio.com/">Piaggio Scooter</a> to ride back and forth to school on in nice weather.  Living in Ohio I only get about 6 months out of the year that I can ride it however it&#8217;s still a big savings for me.  During the winter months when you have to store your scooter unless you plug your battery into a wall tender when spring comes you will find your scooter not starting.  Looking for ways to save even more I set out to build something that would charge my scooter and not raise my electricity bill in the process.  The solution was to have a solar panel outside of my garage do the work for me.<span id="more-121"></span></p>
<p>You can view a larger photo on my <a href="http://www.flickr.com/photos/34908673@N00/3698584662/sizes/l/in/set-72157613805579303/">Flickr page</a> which will help to show the hook ups.  For the Arduino, I am using one that I created on a breadboard, you can follow <a href="http://arduinofun.com/blog/2009/10/15/breadboard-arduino/">this tutorial</a> if you would like to do the same.</p>
<div id="attachment_530" class="wp-caption alignleft" style="width: 330px"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="265" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/JgfL67a-0L0&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="320" height="265" src="http://www.youtube.com/v/JgfL67a-0L0&amp;hl=en&amp;fs=1&amp;" allowfullscreen="true" allowscriptaccess="always"></embed></object><p class="wp-caption-text">Arduino Solar Tracker</p></div>
<p>This is my initial testing of the Arduino Solar Tracker. I am going to need to also create a shunt regulator, so that when the battery is fully charged it won&#8217;t over charge.  The charging ability will basically shut off until the battery drops down to a certain level.  I picked up a nice <a href="http://www.harborfreight.com/cpi/ctaf/displayitem.taf?Itemnumber=41144">solar panel</a> at Harbour Freight, if you have a local store near you check there first because it may be cheaper in store than from the web.</p>
<p>The next step will be to build a bracket outside my garage that can hold the solar panel and be able to move as the sun moves across the sky.</p>
<p>I will post more information as I complete each piece of this project.  For now, here is what you will need to do in order to get the Arduino Solar Tracker portion set up.  Orignial credit to <a href="http://stigern.net/blog/">Stigern.net</a> for the concept.</p>
<p>For testing purposes I used two small photoresistors, but the final project will use two <a href="http://store.arduinofun.com/giant-cds-cell.html">giant cds cells</a>.</p>
<p><strong>What you will need:</strong></p>
<ol>
<li>(2) Photoresistors</li>
<li>(2) 470 Ohms resistors</li>
<li>(1) Servo</li>
<li><a href="http://store.arduinofun.com/wire-jumper-kit-for-breadboards.html">Hook-up wire</a></li>
<li><a href="http://store.arduinofun.com/breadboard-840-tie-po840.html">Breadboard</a></li>
</ol>
<p><strong>Hook-up</strong></p>
<p><strong>Breadboard Power.</strong> In my set up photo above, I used two small <a href="http://store.arduinofun.com/breadboard-400-tie-po400.html">half sized breadboards</a>.  Then I just jumped power and GND to the second one.</p>
<p><strong>Servo Power.</strong> The red wire goes to 5V, the black wire goes to GND, and depending on your servo the yellow or white wire will go to arduino pin 9.</p>
<div id="attachment_131" class="wp-caption alignleft" style="width: 160px"><a href="http://arduinofun.com/files/LightTracker.jpg"><img class="size-thumbnail wp-image-131" title="Light Tracker Schematic" src="http://arduinofun.com/blog/wp-content/uploads/2009/10/LightTracker-150x150.jpg" alt="Light Tracker Schematic" width="150" height="150" /></a><p class="wp-caption-text">Schematic</p></div>
<p><strong>Photocell Circuit:</strong></p>
<p>The photocells are hooked up as 5v to leg one, then on leg two you will have leg one of the 470 Ohm resistor and a connection to arduino pin 0. The other leg of the resistor goes to GND. Do the same for the second photocell but it will connect to arduino pin 1.</p>
<p><strong></strong></p>
<p><strong>Arduino Sketch File:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"> <span class="co2">#include </span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">Servo myservo;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw4">int</span> pos = <span class="nu0">0</span>; &nbsp;<span class="co1">// Variable to store the servo position.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">int</span> inputPhotoLeft = <span class="nu0">1</span>; <span class="co1">// Easier to read, instead of just 1 or 0.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">int</span> inputPhotoRight = <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">int</span> Left = <span class="nu0">0</span>; <span class="co1">// Store readings from the photoresistors.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw4">int</span> Right = <span class="nu0">0</span>; <span class="co1">// Store readings from the photoresistors.</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> setup<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">myservo.<span class="me1">attach</span><span class="br0">&#40;</span><span class="nu0">9</span><span class="br0">&#41;</span>; <span class="co1">// Attach servo to pin 9.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> loop<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Reads the values from the photoresistors to the Left and Right variables.</span></div>
</li>
<li class="li2">
<div class="de2">Left = analogRead<span class="br0">&#40;</span>inputPhotoLeft<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">Right = analogRead<span class="br0">&#40;</span>inputPhotoRight<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Checks if right is greater than left, if so move to right.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>Left &gt; <span class="br0">&#40;</span>Right <span class="nu0">+20</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co1">// +20 is the deadzone, so it wont jiggle back and forth.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>pos &lt; <span class="nu0">179</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">pos++;</div>
</li>
<li class="li1">
<div class="de1">myservo.<span class="me1">write</span><span class="br0">&#40;</span>pos<span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Checks if left is greater than right, if so move to left.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>Right &gt; <span class="br0">&#40;</span>Left <span class="nu0">+20</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// +20 is the deadzone, so it wont jiggle back and forth.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>pos &gt; <span class="nu0">1</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">pos -= <span class="nu0">1</span>;</div>
</li>
<li class="li1">
<div class="de1">myservo.<span class="me1">write</span><span class="br0">&#40;</span>pos<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Added some delay, increase or decrease if you want less or more speed.</span></div>
</li>
<li class="li1">
<div class="de1">delay<span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2009%2F10%2F21%2Farduino-solar-tracker%2F&amp;linkname=Arduino%20Solar%20Tracker"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2009/10/21/arduino-solar-tracker/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Arduino Wireless Xbee</title>
		<link>http://arduinofun.com/blog/2009/10/19/arduino-wireless-xbee/</link>
		<comments>http://arduinofun.com/blog/2009/10/19/arduino-wireless-xbee/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:38:27 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Project Files]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Tutorial]]></category>
		<category><![CDATA[Arduino Xbee Tutorial]]></category>
		<category><![CDATA[Xbee]]></category>

		<guid isPermaLink="false">http://arduinofun.com/blog/?p=92</guid>
		<description><![CDATA[I have set this post up as an introduction to using the Xbee devices with Arduino.   As a beginner, I found it confusing at first to get started so I hope this post will help others to get up and running a little easier.   The first place I checked out was Adafruits tutorials for the [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_95" class="wp-caption alignleft" style="width: 250px"><img class="size-full wp-image-95" title="Arduino Wireless Xbee" src="http://arduinofun.com/blog/wp-content/uploads/2009/10/xbee.jpg" alt="Arduino Wireless Xbee" width="240" height="180" /><p class="wp-caption-text">Arduino Wireless Xbee</p></div>
<p>I have set this post up as an introduction to using the Xbee devices with Arduino.   As a beginner, I found it confusing at first to get started so I hope this post will help others to get up and running a little easier.   The first place I checked out was <a href="http://www.ladyada.net/make/xbee/">Adafruits tutorials</a> for the Xbee Adapter that she sells.</p>
<p>Once you have your Xbee&#8217;s configured you can follow this setup and use the sketches that I have provided below (<a href="http://lab.guilhermemartins.net/">Thanks to Guilherme Martins</a>) and you should be able to be up and running fairly quickly.  You can view a larger (1024&#215;768) version of this photo on my <a href="http://www.flickr.com/photos/34908673@N00/3372334263/sizes/l/in/set-72157613805579303/">Flickr page</a> which will help you see the hook-ups easier.<span id="more-92"></span></p>
<p><strong>What You Will Need:</strong></p>
<ul>
<li>2 Arduinos, We used a Arduino Duemilanove and a Adafruit</li>
<li>Boarduino</li>
<li>Breadboard and Regulated Power</li>
<li>2 Potentiometers</li>
<li>2 Xbee Pro Devices</li>
<li>2 Xbee Adapter Kits</li>
<li>Protoshield with Mini-breadboard</li>
<li>2 LED’s</li>
<li>Hook-up Wire</li>
<li>Portable Power for 2nd Arduino</li>
</ul>
<p>The Arduino Duemilanove is the “receiver” and the Boarduino is the “sender”.   To not cause an error, upload both sketches to the Arduinos before hooking anything up.</p>
<p><strong>For the Sender:</strong>  we hook up +5v power and GND to the Boarduino and again to the Xbee adapter.<br />
1. Boarduino TX goes to Xbee RX and Boarduino RX goes to Xbee TX.<br />
2. Power and GND to each of the Pots.<br />
3. Analog Pin 2 to Pot 1<br />
4. Analog Pin 5 to Pot 2</p>
<p><strong>For the Receiver:</strong>  plug in your protoshield to the Arduino and place the Xbee on top. Position this so that you have room in front and behind the adapter to hook up wires to. Connect +5v power and GND from the protoshield to the Xbee adapter.<br />
1. Arduino TX (D1 on shield) goes to Xbee RX and Arduino RX (D0 on shield) goes to Xbee TX<br />
2. Digital Pin 5 connected through resistor 1 (we used 220 ohms) to positive end of the LED. GND to the negative end.<br />
3. Digital Pin 6 connected through resistor 2 to positive end of LED. GND to to negative end.</p>
<p>Now, since you already uploaded the sketches to each Arduino, turn power on for both. Turn your potentiometers on and off and if you have everything correct, you will see the LED’s turn on an off.  The range on these particular Xbee&#8217;s were really good.  We tested the sender being in our basement lab and the reciever was traveling around the block in our neighborhood. Amazing!</p>
<p><strong>Arduino Sketch Files:</strong></p>
<ol>
<li><a href="http://www.arduinofun.com/sketch/Xbee_Send.pde">Xbee Send</a></li>
<li><a href="http://www.arduinofun.com/sketch/Xbee_Receive.pde">Xbee Receive</a></li>
</ol>
<p><strong>Other References:</strong></p>
<ol>
<li><a href="http://itp.nyu.edu/~raf275/meshnetworking/XBee/">Rob Faludi&#8217;s XBee page</a></li>
<li><a href="http://www.tigoe.net/pcomp/code/category/category/XBee">Tom Igoe&#8217;s XBee page</a></li>
<li><a href="http://mrtof.danslchamp.org/AXIC">Arduino Xbee Interface Circuit (AXIC)</a></li>
</ol>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Farduinofun.com%2Fblog%2F2009%2F10%2F19%2Farduino-wireless-xbee%2F&amp;linkname=Arduino%20Wireless%20Xbee"><img src="http://arduinofun.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://arduinofun.com/blog/2009/10/19/arduino-wireless-xbee/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
