<?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>Aitch&#039;s Place ... &#187; robot</title>
	<atom:link href="http://howardsandford.com/blog/tag/robot/feed/" rel="self" type="application/rss+xml" />
	<link>http://howardsandford.com/blog</link>
	<description>... somewhere on the interwebs for &#039;H&#039; to have his say</description>
	<lastBuildDate>Mon, 21 Jun 2010 22:26:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Electronic Robot Car &#8211; L293D &#8211; 5v Motors &#8211; ATTiny &#8211; AVR</title>
		<link>http://howardsandford.com/blog/electronic-robot-car-l293d-5v-motors-attiny-avr/</link>
		<comments>http://howardsandford.com/blog/electronic-robot-car-l293d-5v-motors-attiny-avr/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 16:59:55 +0000</pubDate>
		<dc:creator>H</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[ATTiny]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[car]]></category>
		<category><![CDATA[L293D]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[vehicle]]></category>

		<guid isPermaLink="false">http://howardsandford.com/blog/?p=51</guid>
		<description><![CDATA[The other day, well actually quite a lot of days ago, Thomas, one of my twin boys, asked about making an electronic car.  It seems that they might be making an electronic car at school soon, and he wanted to get a head start &#8230; awww, bless him, he&#8217;s only 8  
So I thought [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, well actually quite a lot of days ago, Thomas, one of my twin boys, asked about making an electronic car.  It seems that they might be making an electronic car at school soon, and he wanted to get a head start &#8230; awww, bless him, he&#8217;s only 8 <img src='http://howardsandford.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So I thought I&#8217;d better get prepared.</p>
<p><div style="position: relative;float: left; margin-right: 10px;"><script type="text/javascript"><!--
google_ad_client = "pub-9779393397850606";
/* howardsandford-big-image-300x250, created 21/04/10 */
google_ad_slot = "8024658496";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></p>
<p>Now, we didn&#8217;t really have much in the electronics box that we could use, apart from an L293D.  This is a DC motor driver, a simple IC that can control DC motors via an H-Bridge circuit.  Now, if we&#8217;re going to be connecting up some 5v hobby motors to a microcontroller chip such as an ATTiny45, we need to protect the chip from i) drawing too much current, and ii) problems associated with switching inductive loads such as motors.</p>
<p>An H-Bridge is simply a set of four switches with protective flyback diodes, and the L293D provides a very convenient way to control two motors via a microcontroller chip.  Yay!</p>
<p><img class="alignright size-medium wp-image-52" title="Salvaged micro-switches" src="http://howardsandford.com/blog/wp-content/uploads/2009/12/2009-12-21-07.52.05-300x225.jpg" alt="Salvaged micro-switches" width="300" height="225" />However, it turns out I didn&#8217;t have much else &#8230;</p>
<p>&#8230; apart from a USB missile launcher which hadn&#8217;t worked in years &#8230; hmmm.  Taking the USB missile launcher apart gave us some wonderful pieces to play with.  Not only did it have two low voltage DC motors, but some very useful microswitches which will come in handy later (I&#8217;m thinking of bump/collision detection here!)</p>
<p>So, two motors, three microswitches, ATTiny45, L293D &#8230; what else do we need?</p>
<p>WHEELS!</p>
<p><img class="alignleft size-medium wp-image-58" title="Wheel glued to the DC motor" src="http://howardsandford.com/blog/wp-content/uploads/2009/12/2009-12-21-07.51.37-300x225.jpg" alt="Wheel glued to the DC motor" width="300" height="225" />Of course.  Good job Thomas had a Konnects building set which just so happened to have some wheels included, and he was happy to donate them to the project.  It was an easy case of gluing the wheels to the DC motors.  Also, I have some standard stripboard which we can use for the chassis and to hold all the electronics.  This is looking good!</p>
<p>Now we have all our bits and pieces, we just need to get started on building the circuit.  The code itself is going to be simply a case of making control pins go HIGH and LOW, though for reading the microswitches I&#8217;m going to use another simple technique rather than constantly polling the input pins.</p>
<p>Effectively I&#8217;m going to create a resistor ladder with all the microswitches connected into the resitor ladder circuit to act as a voltage divider or potential divider, and then measure the voltage at the input pin relative to the source voltage.  By running an ADC conversion at the input pin, we can determine which microswitch has been pressed.  More on this in a later post.</p>
<p>So, we have all the pieces ready.  All we have to do now is build the circuit, program the ATTiny, and let Thomas take it in to his &#8220;show and tell&#8221; session at school &#8230;</p>
<p>&#8230; but first, perhaps, I should wait for Thomas to help me build the electronic robot car, eh? <img src='http://howardsandford.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   That will be the basis of the next post in this series &#8230;</p>
<p><img class="alignleft size-medium wp-image-69" title="Stripboard, ATTiny45, L293D, 5v DC motors, microswitches, wheels ... robot car is ready to build!" src="http://howardsandford.com/blog/wp-content/uploads/2009/12/2009-12-21-07.53.54-300x225.jpg" alt="Stripboard, ATTiny45, L293D, 5v DC motors, microswitches, wheels ... robot car is ready to build!" width="300" height="225" /></p>
]]></content:encoded>
			<wfw:commentRss>http://howardsandford.com/blog/electronic-robot-car-l293d-5v-motors-attiny-avr/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
