<?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>microHobby.net</title>
	<atom:link href="http://microhobby.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://microhobby.net</link>
	<description>Electronics, embedded and software projects</description>
	<lastBuildDate>Mon, 20 Feb 2012 11:30:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Browse all Tuscany traffic fine photos</title>
		<link>http://microhobby.net/20-02-2012/projects/traffic-fines-in-toscana-italy-how-to-browse-them-all/</link>
		<comments>http://microhobby.net/20-02-2012/projects/traffic-fines-in-toscana-italy-how-to-browse-them-all/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 10:53:32 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=581</guid>
		<description><![CDATA[This is not really technical, just a quick write-up to show you the poor computer system behind Tuscany municipality police &#8220;POLIZIA MUNICIPALE&#8221;. After you have violated some traffic rule, like...]]></description>
			<content:encoded><![CDATA[<p>This is not really technical, just a quick write-up to show you the poor computer system behind Tuscany municipality police &#8220;POLIZIA MUNICIPALE&#8221;.<br />
After you have violated some traffic rule, like speeding or entering a restricted traffic area (like I did), firstly you&#8217;ll receive a letter from your car rental company stating they&#8217;ve charged your credit card. This amount is for handing your personal info to the police, plus a 20% sales tax. After a while you&#8217;ll receive the actual fine. This is a registered letter from the traffic police with stamps, signatures and a silvery sticker for authentication. On the front you have your personal info, info about the car, where it&#8217;s rented, where and when the violation took place and what paragraph you violated. On the back you will see the two sums that add up to your total amount, and where to pay it.</p>
<p>This is where it gets interesting. You get a website URL to visit, http://www.emo.nivi.it, along with a user name and a password. With this info, you log in to this Italian website. The website and login page looks dodgy. There is no encryption yet (no HTTPS in the URL). After logging in you can choose to view images that will authenticate the fine. this is funny.</p>
<p>This is me,<br />
<a href="http://microhobby.net/wp-content/uploads/2012/02/02658638.jpg"><img src="http://microhobby.net/wp-content/uploads/2012/02/02658638-150x150.jpg" alt="" title="02658638" width="150" height="150" class="alignleft size-thumbnail wp-image-582" /></a><a href="http://microhobby.net/wp-content/uploads/2012/02/02658638-1.jpg"><img src="http://microhobby.net/wp-content/uploads/2012/02/02658638-1-150x150.jpg" alt="" title="02658638-1" width="150" height="150" class="alignleft size-thumbnail wp-image-583" /></a><a href="http://microhobby.net/wp-content/uploads/2012/02/02658638-2.jpg"><img src="http://microhobby.net/wp-content/uploads/2012/02/02658638-2-150x150.jpg" alt="" title="02658638-2" width="150" height="150" class="alignleft size-thumbnail wp-image-584" /></a></p>
<p></br><br /></br><br /></br><br /></br><br /></br></p>
<p>and this is a person being caught somewhere else, two days prior,<br />
<a href="http://microhobby.net/wp-content/uploads/2012/02/numbertwo.jpg"><img src="http://microhobby.net/wp-content/uploads/2012/02/numbertwo-150x150.jpg" alt="" title="numbertwo" width="150" height="150" class="alignleft size-thumbnail wp-image-586" /></a><a href="http://microhobby.net/wp-content/uploads/2012/02/numbertwo-1.jpg"><img src="http://microhobby.net/wp-content/uploads/2012/02/numbertwo-1-150x150.jpg" alt="" title="numbertwo-1" width="150" height="150" class="alignleft size-thumbnail wp-image-587" /></a><a href="http://microhobby.net/wp-content/uploads/2012/02/numbertwo-2.jpg"><img src="http://microhobby.net/wp-content/uploads/2012/02/numbertwo-2-150x150.jpg" alt="" title="numbertwo-2" width="150" height="150" class="alignleft size-thumbnail wp-image-588" /></a></p>
<p></br><br /></br><br /></br><br /></br><br /></br></p>
<p>Huh?<br />
The links to my photos looked like this</p>
<p>http://www.emo.nivi.it/Comandi/P015/Foto/02658638.jpg</p>
<p>http://www.emo.nivi.it/Comandi/P015/Nol/02658638.jpg</p>
<p>http://www.emo.nivi.it/Comandi/P015/Verb/02658638.jpg</p>
<p>Now try to increase or decrease one of the numbers in the image file name. Yes, you can literally scroll through thousands of traffic fines with very little effort. Without logging in first. For a software guy, it would probably take him nothing but a few hours of coding and implementing an &#8220;image-to-text&#8221; converter on the license plate # (it&#8217;s always in the same spot, bottom left corner). This way, he could automatically download an extensive database of fines given to persons in this area or what-/wherever the images are from.</p>
<p>After logging in there is a time-out detection based on events like a proper secure connection would have. Also, when entering the actual payment sequence, there is a HTTPS connection.</p>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/20-02-2012/projects/traffic-fines-in-toscana-italy-how-to-browse-them-all/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Denver DAB-43C PLUS radio teardown</title>
		<link>http://microhobby.net/05-01-2012/projects/denver-dab-43c-plus-radio-teardown/</link>
		<comments>http://microhobby.net/05-01-2012/projects/denver-dab-43c-plus-radio-teardown/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 14:59:53 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[dab]]></category>
		<category><![CDATA[DAB-43C]]></category>
		<category><![CDATA[DENVER]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[PLUS]]></category>
		<category><![CDATA[q7]]></category>
		<category><![CDATA[quantek]]></category>
		<category><![CDATA[teardown]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=465</guid>
		<description><![CDATA[This will be a simple, non-thorough teardown of a DENVER DAB-43C PLUS DAB/digital radio (with FM). For my own interest, I wanted to see how much design work is put...]]></description>
			<content:encoded><![CDATA[<p><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-front-e1325767640623.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-front-e1325767773701.jpg" alt="DENVER DAB-43C PLUS front view" title="DENVER DAB-43C PLUS front" width="550" height="244" class="alignnone size-full wp-image-471" /></a></p>
<p>This will be a simple, non-thorough teardown of a DENVER DAB-43C PLUS <a title="DAB wikipedia article" href="http://en.wikipedia.org/wiki/Digital_Audio_Broadcasting">DAB/digital radio</a> (with FM). For my own interest, I wanted to see how much design work is put in the product by the final manufacturer (in this case, <a title="DENVER DAB-43C PLUS product page" href="http://www.denver-electronics.com/denver-dab-43c-plus/">DENVER</a>). I know of some DAB modules and integrated circuits, like the Atmel DAB-On-Chip ATR2740, and are always interested to see what other solutions are used in the most lowest cost consumer products. My intention is to, some time, add DAB functionality to an old FM/AM radio.</p>
<div id="attachment_466" class="wp-caption alignleft" style="width: 189px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-back.jpg"><img class="size-medium wp-image-466 " title="DENVER DAB-43C PLUS back screws" src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-back-179x300.jpg" alt="DENVER DAB-43C PLUS back screws" width="179" height="300" /></a><p class="wp-caption-text">4 screws must be removed from the back</p></div>
<div id="attachment_476" class="wp-caption alignleft" style="width: 189px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-opening.jpg"><img class="size-medium wp-image-476 " title="DENVER DAB-43C PLUS opening" src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-opening-179x300.jpg" alt="DENVER DAB-43C PLUS opening" width="179" height="300" /></a><p class="wp-caption-text">Pry the cover open from the bottom, it's hinged on the top</p></div>
<p>In total there are 4 screws to remove, one in each corner on the back of the radio. Start prying from the bottom on the front cover because the cover is hooked to two fastener clips on the top.</p>
<p>If you don&#8217;t have a nylon tool for opening cases and are afraid to scratch your product, just pry on the underside of the radio so any possible scratches won&#8217;t be visible when you&#8217;re done.<br />
<br /></br><br /></br><br /></br><br /></br></p>
<p>The inside reveals a very modular design, as expected. The main PCB has a standard 0.1&#8243; header pin footprint for mounting a ready-made DAB module from Quantek, <a title="Quantek Q7+" href="http://www.quantek-inc.com/Q7+.html">model Q7+</a>. As stated by the manufacturer, the module is delivered pre-programmed to it&#8217;s costumers wish, so no programming for the LCD controller or switchboard is necessary. That must make it a breeze to implement.</p>
<div id="attachment_474" class="wp-caption alignleft" style="width: 160px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-main-board.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-main-board-150x150.jpg" alt="DENVER DAB-43C PLUS main board" title="DENVER DAB-43C PLUS main board" width="150" height="150" class="size-thumbnail wp-image-474" /></a><p class="wp-caption-text">Main circuit board</p></div>
<div id="attachment_477" class="wp-caption alignleft" style="width: 160px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-overview.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-overview-150x150.jpg" alt="DENVER DAB-43C PLUS overview inside" title="DENVER DAB-43C PLUS overview inside" width="150" height="150" class="size-thumbnail wp-image-477" /></a><p class="wp-caption-text">Overview of the insides</p></div>
<div id="attachment_475" class="wp-caption alignleft" style="width: 160px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-module.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-module-150x150.jpg" alt="DENVER DAB-43C PLUS module" title="DENVER DAB-43C PLUS module" width="150" height="150" class="size-thumbnail wp-image-475" /></a><p class="wp-caption-text">Quantek Q7+ DAB/Dab+/FM module</p></div>
<p></br><br /></br><br /></br><br /></br><br /></br><br /></br><br /></br></p>
<p>All additional circuitry on the main board are power conditioning, audio amplifiers for headphones (<a href="http://www.datasheetcatalog.com/datasheets_pdf/T/D/A/2/TDA2822M.shtml" title="TDA2822M datasheet">TDA2822M</a>) and speaker (<a href="http://www.datasheetcatalog.com/datasheets_pdf/T/E/A/2/TEA2025B.shtml" title="TEA2025B datasheet">TEA2025B</a>) and connectors for connection to the outside world. </p>
<div id="attachment_468" class="wp-caption alignleft" style="width: 560px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-block-diagram.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-block-diagram-e1325851981394.jpg" alt="DENVER DAB-43C PLUS block diagram" title="DENVER DAB-43C PLUS block diagram" width="550" height="412" class="size-full wp-image-468" /></a><p class="wp-caption-text">Roughly drawn block diagram of the product</p></div>
<p>External PCBs include LCD screen module (looks to be the very standard one popular in DIY builds, so should be easy to change if you want a different colored one)</p>
<div id="attachment_472" class="wp-caption alignleft" style="width: 160px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-lcd.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-lcd-150x150.jpg" alt="DENVER DAB-43C PLUS lcd" title="DENVER DAB-43C PLUS lcd" width="150" height="150" class="size-thumbnail wp-image-472" /></a><p class="wp-caption-text">LCD module</p></div>
<div id="attachment_470" class="wp-caption alignleft" style="width: 160px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-diode.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-diode-150x150.jpg" alt="DENVER DAB-43C PLUS diode" title="DENVER DAB-43C PLUS diode" width="150" height="150" class="size-thumbnail wp-image-470" /></a><p class="wp-caption-text">Unpopulated diode?</p></div>
<div id="attachment_473" class="wp-caption alignleft" style="width: 160px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-lines-in-out.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-lines-in-out-150x150.jpg" alt="DENVER DAB-43C PLUS lines in out" title="DENVER DAB-43C PLUS lines in out" width="150" height="150" class="size-thumbnail wp-image-473" /></a><p class="wp-caption-text">Line out connector labeling</p></div>
<p></br><br /></br><br /></br><br /></br><br /></br><br /></br><br /></br></p>
<p>Lots of glued down components means the manufacturer has put some effort into making the product sturdy, but it also makes for some messy visuals when inspecting if it&#8217;s done in a hurry, like here. There&#8217;s super glue all over everything, but I guess it doesn&#8217;t really matter.<br />
Since all components are trough-hole, and not not all solder joints are uniform in size, it&#8217;s fair to expect this product is hand soldered and assembled.</p>
<p>The designer has conveniently labeled all inputs and outputs that goes to the line in/out and power input.</p>
<table border="0">
<tr>
<td><strong>GND</strong></td>
<td width="20"></td>
<td>Ground</td>
</tr>
<tr>
<td><strong>DAB_L</strong></td>
<td width="20"></td>
<td>Antenna</td>
</tr>
<tr>
<td><strong>DAB_R</strong></td>
<td width="20"></td>
<td>Antenna</td>
</tr>
<tr>
<td><strong>R_IN</strong></td>
<td width="20"></td>
<td>Line in Right channel</td>
</tr>
<tr>
<td><strong>L_IN</strong></td>
<td width="20"></td>
<td>Line in Left channel</td>
</tr>
<tr>
<td><strong>P_SW</strong></td>
<td width="20"></td>
<td>Power switch</td>
</tr>
<tr>
<td><strong>R_OUT</strong></td>
<td width="20"></td>
<td>Headphones line out Right</td>
</tr>
<tr>
<td><strong>L_OUT</strong></td>
<td width="20"></td>
<td> Headphones line out Left
</td>
</tr>
<tr>
<td><strong>GND</strong></td>
<td width="20"></td>
<td>Ground</td>
</tr>
<tr>
<td><strong>VCC</strong></td>
<td width="20"></td>
<td>+6V</td>
</tr>
</table>
<p></br><br />
A couple of very easy to spot design errors caught my eye. The first one being the LCD ribbon cable connector is rotated 180 degrees compared to the LCD position. This causes the cable to shorten a bit, and the tension from the left most wire actually pulls the connector outwards.<br />
<div id="attachment_467" class="wp-caption alignnone" style="width: 310px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-bad-connector.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-bad-connector-300x179.jpg" alt="DENVER DAB-43C PLUS bad connector" title="DENVER DAB-43C PLUS bad connector" width="300" height="179" class="size-medium wp-image-467" /></a><p class="wp-caption-text">LCD connector</p></div></p>
<p>The second error looks a bit funny. It&#8217;s a big electrolytic decoupling capacitor on the supply voltage pin of the TDA2822M, the audio amplifier chip for the headphones. I can image that cap must be a real pain to solder, so I hope that poor technician built himself a simple rig of some sort for the job. Also there&#8217;s a single wire from the ground lead on the cap to a solder pad on the DAB module where it&#8217;s supposed to sit a screw. Who knows if the screw was missing first, or if they removed the screw so they could attach the wire? It could be fun to have a look at the audio output with and without the cap. maybe later. My guess is that a less cheap AC/DC adapter would also do the trick.<br />
<div id="attachment_469" class="wp-caption alignnone" style="width: 310px"><a href="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-capacitor.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/12/DENVER-DAB-43C-PLUS-capacitor-300x179.jpg" alt="DENVER DAB-43C PLUS capacitor" title="DENVER DAB-43C PLUS capacitor" width="300" height="179" class="size-medium wp-image-469" /></a><p class="wp-caption-text">Big capacitor bodged on by hand</p></div> </p>
<p><strong>UPDATE</strong><br />
On request, I&#8217;ll add the key mapping with schematic and inputs for my radio. I had some trouble tracing the input lines, also as requested, as it only seemed to go straight trough the headphone amplifier chip and out &#8220;line out&#8221;.<br />
<a href="http://microhobby.net/wp-content/uploads/2012/01/DENVER-DAB-43C-PLUS-keys.jpg"><img src="http://microhobby.net/wp-content/uploads/2012/01/DENVER-DAB-43C-PLUS-keys-300x179.jpg" alt="DENVER DAB-43C PLUS keys" title="DENVER DAB-43C PLUS keys" width="300" height="179" class="size-medium wp-image-577" /></a><br />
<div id="attachment_578" class="wp-caption alignnone" style="width: 310px"><a href="http://microhobby.net/wp-content/uploads/2012/01/keymap.png"><img src="http://microhobby.net/wp-content/uploads/2012/01/keymap-300x105.png" alt="DENVER DAB-43C PLUS Keypad drawing" title="DENVER DAB-43C PLUS Keypad drawing" width="300" height="105" class="size-medium wp-image-578" /></a><p class="wp-caption-text">Keypad drawing</p></div><br />
<div id="attachment_579" class="wp-caption alignnone" style="width: 310px"><a href="http://microhobby.net/wp-content/uploads/2012/01/keymap-sch-DAB.png"><img src="http://microhobby.net/wp-content/uploads/2012/01/keymap-sch-DAB-300x129.png" alt="DENVER DAB-43C PLUS keypad schematic" title="DENVER DAB-43C PLUS keypad schematic" width="300" height="129" class="size-medium wp-image-579" /></a><p class="wp-caption-text">Keypad schematic</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/05-01-2012/projects/denver-dab-43c-plus-radio-teardown/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Soldering is Easy!</title>
		<link>http://microhobby.net/22-12-2011/projects/soldering-is-easy/</link>
		<comments>http://microhobby.net/22-12-2011/projects/soldering-is-easy/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 09:49:19 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=449</guid>
		<description><![CDATA[If you haven&#8217;t read the awesome Soldering is Easy! comic yet, please do! You will soon find out what a great resource it is for both you and all the...]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t read the awesome <a href="http://mightyohm.com/soldercomic" title="Soldering is Easy!">Soldering is Easy!</a> comic yet, please do! You will soon find out what a great resource it is for both you and all the people you&#8217;ll ever try to learn how to solder. It&#8217;s released under a Creative Commons License, so you are free to do whatever you want with it. Print it, copy it, translate it and distribute it freely! Even use it as curriculum for your science or hand crafting class. I will hang this up in our hackerspace and mail it to every technician at work (they just ruined a soldering tip I replaced one week ago). </p>
<p>As always, when people spend a lot of time making things freely available for everyone, they deserve some real credit.<br />
The creators of this book are</p>
<p><strong><a href="http://en.wikipedia.org/wiki/Mitch_Altman" title="Mitch Altman Wiki">Mitch Altman</a></strong> <em>&#8220;Soldering Wisdom&#8221;</em>, creater of the way popular <a href="http://www.tvbgone.com/" title="TV-B-Gone">TV-B-Gone</a>, which remotely switches off (or on) almost ANY TV set. How about that annoying commercial running on the TV at the doctors waiting room? Or just prank your friends next time you&#8217;re visiting? He also makes several other products and is a huge contributer to the Make/DIY community in every way he possibly can, so be sure to check out his site <a href="http://cornfieldelectronics.com" title="Cornfield Electronics">CornfieldElectronics.com</a>.</p>
<p><strong><a href="http://log.andie.se/" title="Andie Nordgren">Andie Nordgren</a></strong> <em>&#8220;Comics Adaption&#8221;</em>, works for <a href="http://www.ccpgames.com" title="CCP Games">CCP Games</a>, and co-founder of <a href="http://geekgirlmeetup.com/" title="Geek Girl Meetup">Geek Girl Meetup</a>. GGM is a recurring conference for girls in web development, software, hardware and technology. It&#8217;s intention is to pull tech girls out of their workplace, be social, learn new stuff, teach new stuff, and contribute to geek girls acknowledgement. Awesome!</p>
<p><strong><a href="http://mightyohm.com/" title="Jeff Keyzer">Jeff Keyzer</a></strong> <em>&#8220;Layout and Editing&#8221;</em>, One of the first people I started following when I got into electronics. He really is contributing in every way I know possible in todays Maker community, by running a blog, guest-hosting <a href="http://theamphour.com" title="The Amp Hour">The Amp Hour</a> podcast, traveling short and abroad to attend meet-ups and faires etc. Must mention, <a href="http://mightyohm.com/wifiradio/" title="Wi-fi radio">Wi-fi radio</a> and <a href="http://mightyohm.com/geigercounter" title="Geiger counter">geiger counter</a>, both Open Source, two great projects/products.</p>
<p>For Norwegian readers, here is my Norwegian translation of the comic <strong>Soldering is Easy!</strong>, <em><strong>Det Er Enkelt å Lodde!&#8221;</em></strong><br />
<strong><a href="http://microhobby.net/uploads/Det_Er_Enkelt_A_Lodde.pdf" title="Det Er Enkelt å Lodde!">Download/Last ned</a></p>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/22-12-2011/projects/soldering-is-easy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Clock driver for Sparkfun EasyDriver breakout</title>
		<link>http://microhobby.net/13-11-2011/projects/clock-driver-for-sparkfun-easydriver-breakout/</link>
		<comments>http://microhobby.net/13-11-2011/projects/clock-driver-for-sparkfun-easydriver-breakout/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 16:01:58 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=434</guid>
		<description><![CDATA[This is a project I&#8217;ve done on behalf of a person on an internet forum. The requested operation is simple: Use an EasyDriver stepper motor driver and a 1.8 deg/rotation...]]></description>
			<content:encoded><![CDATA[<p>This is a project I&#8217;ve done on behalf of a person on an internet forum. The requested operation is simple: Use an EasyDriver stepper motor driver and a 1.8 deg/rotation stepper motor and make the motor turn one revolution per minute. This frees me up a bit not having to select and source products myself, nor having to implement the actual stepper driver myself.</p>
<p><strong>Update: If you need your motor to turn one revolution per hour instead of one minute, <a href="http://microhobby.net/uploads/32KHzStepHour.c">download this slightly modified source code instead</a></strong></p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/11/productImage.jpg"><img class="aligncenter size-medium wp-image-436" title="productImage" src="http://microhobby.net/wp-content/uploads/2011/11/productImage-300x300.jpg" alt="" width="300" height="300" /></a><br />
The EasyDriver is REALLY simple in operation. Connect 7-30v DC to M+ (and ground to GND), connect a stepper motor to A and B and the motor automatically steps once for each LOW-&gt;HIGH transition on STEP. The direction is dependent on the state of DIR (+5v or ground). MS1 and MS2 together defines the step resolution. The driver chip is a Allegro A3967SLB, so the truth table for MS pins can be found in it&#8217;s datasheet, page 2.<br />
<a href="http://microhobby.net/wp-content/uploads/2011/11/MS-truthTable.jpg"><img class="aligncenter size-medium wp-image-435" title="MS-truthTable" src="http://microhobby.net/wp-content/uploads/2011/11/MS-truthTable-300x119.jpg" alt="" width="300" height="119" /></a><br />
The breakout board has pull-up resistors on both MS1 and MS2, which puts it in eight-step resolution as standard. To alter MS1 and MS2 you simply pull them to ground individually based on your desired resolution.<br />
<a href="http://microhobby.net/wp-content/uploads/2011/11/stripboard.jpg"><img class="aligncenter size-medium wp-image-442" title="stripboard" src="http://microhobby.net/wp-content/uploads/2011/11/stripboard-300x179.jpg" alt="" width="300" height="179" /></a></p>
<p>I decided to make a few improvements to the requested operation. Via a DIP-switch the user can select the resolution for the EasyDriver while simultaneously altering the steps/minute so it will always make one turn per minute even though the step resolution is changed. There is also an LED to indicate each step. I used a four-way DIP switch, the two remaining switches I used for step direction and to simply turn the steps on or off. The DIR signal is pulled up to +5v by a 10k resistor</p>
<p>My circuit is built on a strip board and is based on an AtTiny25. It&#8217;s system clock is driven by a low frequency 32.768kHz watch crystal. It&#8217;s important to program the correct fuse bits for low frequency crystal oscillators!<br />
<a href="http://microhobby.net/wp-content/uploads/2011/11/schematic.jpg"><img class="aligncenter size-medium wp-image-437" title="schematic" src="http://microhobby.net/wp-content/uploads/2011/11/schematic-300x217.jpg" alt="" width="300" height="217" /></a></p>
<p>On to the code. I&#8217;m using Timer 0 with system clock as clock source in output compare mode. The registers defining when an output compare interrupt hits is altered based on MS1 and MS2 signals on the DIP-switch.</p>
<pre class="brush: cpp; title: ; notranslate">
#include
#include
#define F_CPU 8000000UL
#include

#define DIV64 	3
#define DIV8 	2
#define FULL 	!(PINB &amp; (1&lt;#define HALF 	!(PINB &amp; (1&lt;#define QUARTER (PINB &amp; (1&lt;#define EIGHT 	(PINB &amp; (1&lt;
//MS1 pin 7 PB2
//MS2 pin 6 PB1

void step (void)
{
	PORTB ^= (1&lt;}

ISR(TIMER0_COMPA_vect) //Timer/Counter0 Overflow interrupt routine
{

	step();
}

int main (void)
{
	uint8_t previous = 1;
	uint8_t current = (PINB &amp; 36);
	//Port configuration
	DDRB |= (1&lt;	PORTB |= (1&lt;
	//Timer initialization
	TCCR0A |= (1&lt;	TCCR0B = DIV64;	//Timer/Counter0 prescaler
	TIMSK |= (1&lt;	OCR0A = 76;
	/* OCR0A values
	300ms period (ordinary step) =76/div64
	150ms period (half step) 37/div64
	75ms period (quarter step) 18/div64
	37.5ms period (eight step) 76/div8
	*/
	sei(); //Enable interrupts globally

	while(1)
	{
		current = (PINB &amp; 3);

		if (current != previous)
		{
			if 		(FULL) 		{ OCR0A=76; TCCR0B=DIV64; }
			else if (HALF) 		{ OCR0A=37; TCCR0B=DIV64; }
			else if (QUARTER) 	{ OCR0A=18; TCCR0B=DIV64; }
			else if (EIGHT) 	{ OCR0A=76; TCCR0B=DIV8;  }

			previous = current;
		}
	}

	return 0;
}
</pre>
<p>A final short demonstration, showing the LED indicating step pulses</p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/y2_X_8hy7Bs?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/13-11-2011/projects/clock-driver-for-sparkfun-easydriver-breakout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiwatt15 3D model</title>
		<link>http://microhobby.net/23-08-2011/projects/multiwatt15-3d-model/</link>
		<comments>http://microhobby.net/23-08-2011/projects/multiwatt15-3d-model/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 18:49:26 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=417</guid>
		<description><![CDATA[Drawn by me in Google Sketchup, dimensions are from ST Micro&#8217;s datasheet on the L298 Click the embedded image to open it in Google&#8217;s 3D warehouse and download it for...]]></description>
			<content:encoded><![CDATA[<p>Drawn by me in Google Sketchup, dimensions are from ST Micro&#8217;s datasheet on the L298</p>
<p>Click the embedded image to open it in Google&#8217;s 3D warehouse and download it for you projects!</p>
<p><iframe src="http://sketchup.google.com/3dwarehouse/mini?mid=a5169fd7679c4c797ab060b743bf0b4c&#038;etyp=sw&#038;width=400&#038;height=300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="400" height="300"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/23-08-2011/projects/multiwatt15-3d-model/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CNC Controller PCB, rev. 1</title>
		<link>http://microhobby.net/02-08-2011/projects/cnc-controller-pcb-rev-1/</link>
		<comments>http://microhobby.net/02-08-2011/projects/cnc-controller-pcb-rev-1/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 11:33:49 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=377</guid>
		<description><![CDATA[I had been looking for ready made do-it-all CNC controllers online for quite some time, but it seemed like the most affordable ones had some issues with optically isolating the...]]></description>
			<content:encoded><![CDATA[<p>I had been looking for ready made do-it-all CNC controllers online for quite some time, but it seemed like the most affordable ones had some issues with optically isolating the computer parallel port and the motor controller part, plus some other issues.</p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/08/IMAG0334.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/08/IMAG0334-300x179.jpg" alt="" title="Top side" width="300" height="179" class="alignnone size-medium wp-image-378" /></a></p>
<p>Most hobby CNC controllers are connected to your computer via the computers parallel port. One of the most used controller software packages will be running on the computer (Mach 3 being the most used), sending streams of pulses in real time to the controller board. A do-it-all controller board will handle both the pulse streams and convert it to usable motor stepper motor control sequences, often with the option to do full steps, half-steps, 1/4 steps and so on, and also actually implement the motor control circuitry on the same board.</p>
<p>The optical isolation is important for two reasons;<br />
one is protecting the computers parallel port in case of voltage spikes or high currents on it&#8217;s signal lines. The 2nd reason is to reduce noise on signal lines, and to remove the high voltage lines and ground plane from the incoming signal traces. Optical isolators come in IC packages and consists of a combined LED and a photo transistor. When you drive the LED current from a different power source than the photo transistor power source, they are totally isolated from each other. But the parallel port does not provide you with a +5v line, and if it did, it would not be able to source enough current for the pull-up resistors the signal line side of the controller. If I&#8217;d use the +5v logic source from the motor controller, you would no longer have isolated the two sides of the controller board. This is why I decided to put on a mini-USB connector for a maximum of 500mA current to the pull-up resistor, with an already regulated 5 volts. That should be more than sufficient.</p>
<p>The brain is an Atmega8 microcontroller, which handles both the inputs from the parallel port, and the outputs to the L298 dual H-bridge motor controllers. </p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/08/IMAG0335.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/08/IMAG0335-300x179.jpg" alt="" title="IMAG0335" width="300" height="179" class="alignnone size-medium wp-image-379" /></a></p>
<p>The PCB is double sided, and designed within the 10x10cm limit for REAL cheap manufacturing at either seeedstudio.com or iteadstudio.com. I paid around $15 to have mine manufactured, and that got me 10 copies! Unfortunately, I had an issue of two traces which were shorted to the ground plane on two separate PCB copies, but they are easily fixed with a sharp bladed knife or scalpel. Still, great value for money.</p>
<p>When I designed the PCB based on my schematic, some connections were changed to make routing easier, but this only affects some software changes on the Atmega8.</p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/08/schematic.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/08/schematic-300x183.jpg" alt="" title="schematic" width="300" height="183" class="alignnone size-medium wp-image-381" /></a></p>
<p>PCB partially soldered<br />
<a href="http://microhobby.net/wp-content/uploads/2011/08/IMAG0336.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/08/IMAG0336-300x179.jpg" alt="" title="Partially soldered" width="300" height="179" class="alignnone size-medium wp-image-380" /></a></p>
<p>Design files screenshots<br />
<a href="http://microhobby.net/wp-content/uploads/2011/08/top-side.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/08/top-side.jpg" alt="" title="top-side" width="427" height="460" class="alignnone size-full wp-image-383" /></a><br />
<a href="http://microhobby.net/wp-content/uploads/2011/08/bottom-side.jpg"><img src="http://microhobby.net/wp-content/uploads/2011/08/bottom-side.jpg" alt="" title="bottom-side" width="426" height="460" class="alignnone size-full wp-image-382" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/02-08-2011/projects/cnc-controller-pcb-rev-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bluetooth robot BT-Bot</title>
		<link>http://microhobby.net/26-06-2011/projects/bluetooth-robot-bt-bot/</link>
		<comments>http://microhobby.net/26-06-2011/projects/bluetooth-robot-bt-bot/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 15:26:30 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=369</guid>
		<description><![CDATA[Please see this post Bluetooth controlled DC motor, BT module review for a more in-depth demonstration of the Bluetooth part. For the past weeks I have had this robot to...]]></description>
			<content:encoded><![CDATA[<p><strong>Please see this post <a href="http://microhobby.net/16-05-2011/projects/bluetooth-controlled-dc-motor/" title="Bluetooth controlled DC motor, BT module review">Bluetooth controlled DC motor, BT module review</a> for a more in-depth demonstration of the Bluetooth part.</strong></p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/06/IMG_1257.jpg"><img class="alignleft size-medium wp-image-370" title="BT-Bot" src="http://microhobby.net/wp-content/uploads/2011/06/IMG_1257-300x200.jpg" alt="" width="300" height="200" /></a>For the past weeks I have had this robot to play with. Today I added some additional intelligence to it, and decided to post it here as a finished project.</p>
<p>The controls are based on my previous post on motor control via bluetooth. One extra motor was added to the code, I etched a new PCB for the L298 board so it took up less space, and attached it all to a robot chassis. The chassis is called &#8220;Mr. Basic&#8221; and is produced by Dagu specifically for the Let&#8217;s Make Robots community. You can buy it at dealextreme.com.</p>
<p>Since my last post on bluetooth motor control I have switched to another android application called QkCtrl. This application provides much more flexibility, and I recommend it. The bluetooth SPP module provides a wireless standard UART interface and is very easy to use and to set up. The whole concept is based on sending individual characters to the microcontroller for each key press in QkCtrl, and then interpreting character on the AtTiny2313 to execute different commands. The QkCtrl layout is user-definable, my layout is pictured below together with explanations on which button sends which character.</p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/06/bt-controls.jpg"><img class="alignleft size-large wp-image-371" title="bt-controls" src="http://microhobby.net/wp-content/uploads/2011/06/bt-controls-1024x616.jpg" alt="" width="640" height="385" /></a></p>
<p><strong>Forward</strong> &#8216;U&#8217; Starts the motors on a forward direction. Speed is 1/3 at startup.<br />
<strong>Backward</strong> &#8216;D&#8217; Starts the motors in a backward direction. Speed is 1/3 at startup.<br />
<strong>Left</strong> &#8216;L&#8217; Makes a small turn to the left when motors are running forward/backward<br />
<strong>Right</strong> &#8216;R&#8217; Makes a small turn to the right when motors are running forward/backward<br />
<strong>Stop</strong> &#8216;C&#8217; Stops both motors<br />
<strong>Speed down</strong> &#8216;s&#8217; Decreases motor speed. Affects both motors<br />
<strong>Speed up</strong> &#8216;f&#8217; Increases motor speed. Affects both motors<br />
<strong>Pirouette L</strong> &#8216;a&#8217; Full speed pirouette to the left<br />
<strong>Pirouette R</strong> &#8216;e&#8217; Full speed pirouette to the right<br />
<strong>Alarm</strong> &#8216;P&#8217; Activates &#8220;burglar&#8221; alarm (robot wiggling with sound when motion is detected)<br />
<strong>Child safe</strong> &#8216;H&#8217; When robot is ran against a wall, it automatically stop and changes direction<br />
<strong>Headlamp</strong> &#8216;l&#8217; Turn headlamp LEDs on and off<br />
<strong>Horn</strong> &#8216;h&#8217; Honks the horn for half a second</p>
<p>The next image explains each component of the robot (click to enlarge)<a href="http://microhobby.net/wp-content/uploads/2011/06/bluetoothbot.jpg"><img class="alignleft size-large wp-image-372" title="bluetoothbot" src="http://microhobby.net/wp-content/uploads/2011/06/bluetoothbot-1024x613.jpg" alt="" width="640" height="383" /></a><br />
<strong>1</strong> Bluetooth SPP modem<br />
<strong>2</strong> AtTiny2313 microcontroller<br />
<strong>3</strong> PIR motion sensor<br />
<strong>4</strong> Ultrasonic distance sensor<br />
<strong>5</strong> L298 dual motor control board<br />
<strong>6</strong> One of two LED headlamps<br />
<strong>7</strong> Buzzer/horn<br />
<strong>8</strong> One of two motors<br />
<strong>9</strong> Battery for the motors<br />
<strong>10</strong> Battery for the controls and logic (regulated to 5v with L7805)<br />
<strong>11</strong> On/off switch</p>
<p>A short demo video<br />
<iframe width="500" height="281" src="http://www.youtube.com/embed/dCBqRJg1fdg?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>The code is a bit messy without any comments, it will be improved and a schematic will be posted.</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;avr/io.h&gt;
#include &lt;avr/interrupt.h&gt;
#define F_CPU 8000000UL //Defines clock speed
#define USART_BAUDRATE 9600 //Baudrate for serial comm.
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)
#include &lt;util/delay.h&gt;

uint16_t distance;
uint8_t count = 0;
uint8_t ovf = 0;
uint8_t alarm = 0;
uint8_t light = 0;
uint8_t speed = 100;
uint8_t pir = 0;
uint8_t distanceSensor = 0;
char rotDir = 'L';
char state;

void forward(void)
{
	state = 'U';
	PORTB |= (1&lt;&lt;PIN1) | (1&lt;&lt;PIN4);
	PORTB &amp;= ~(1&lt;&lt;PIN0) &amp; ~(1&lt;&lt;PIN3);
	OCR0A = speed;
	OCR0B = speed;
}

void backward(void)
{
	state = 'D';
	PORTB |= (1&lt;&lt;PIN0) | (1&lt;&lt;PIN3);
	PORTB &amp;= ~(1&lt;&lt;PIN1) &amp; ~(1&lt;&lt;PIN4);
	OCR0A = speed;
	OCR0B = speed;
}

void rightTurn(void)
{
	PORTB |= (1&lt;&lt;PIN0) | (1&lt;&lt;PIN1);
	_delay_ms(350);
	if (state == 'U') forward();
	else if (state == 'D') backward();
}

void leftTurn(void)
{
	PORTB |= (1&lt;&lt;PIN3) | (1&lt;&lt;PIN4);
	_delay_ms(350);
	if (state == 'U') forward();
	if (state == 'D') backward();
}

void leftPirouette(void)
{
	state = 'a';
	rotDir = 'L';
	//PORTB = 0b00001010;
	PORTB |= (1&lt;&lt;PIN1) | (1&lt;&lt;PIN3);
	PORTB &amp;= ~(1&lt;&lt;PIN0) &amp; ~(1&lt;&lt;PIN4);
	OCR0A = 254;
	OCR0B = 254;
}

void rightPirouette(void)
{
	state = 'e';
	rotDir = 'R';
	//PORTB = 0b00010001;
	PORTB |= (1&lt;&lt;PIN0) | (1&lt;&lt;PIN4);
	PORTB &amp;= ~(1&lt;&lt;PIN3) &amp; ~(1&lt;&lt;PIN1);
	OCR0A = 254;
	OCR0B = 254;
}

void stop(void)
{
	if (state == 'U')
	{
		backward();
		_delay_ms(40);
	}

	else if (state == 'D')
	{
		forward();
		_delay_ms(40);
	}

	state = 'C';
	GIMSK &amp;= ~(1&lt;&lt;INT1);
	PORTB |= (1&lt;&lt;PIN0) | (1&lt;&lt;PIN1) | (1&lt;&lt;PIN3) | (1&lt;&lt;PIN4);
	OCR0A = 0;
	OCR0B = 0;
	_delay_ms(1000);
	GIMSK |= (1&lt;&lt;INT1);
}

void longBeep(void)
{
	PORTD |= (1&lt;&lt;PIN6);
	_delay_ms(500);
	PORTD &amp;= ~(1&lt;&lt;PIN6);
}

void shortBeep(void)
{
	PORTD |= (1&lt;&lt;PIN6);
	_delay_ms(50);
	PORTD &amp;= ~(1&lt;&lt;PIN6);
}

void lights(void)
{
	if (light == 0)
	{
		PORTB |= (1&lt;&lt;PIN5) | (1&lt;&lt;PIN6);
		light = 1;
	}

	else
	{
		PORTB &amp;= ~(1&lt;&lt;PIN5) &amp; ~(1&lt;&lt;PIN6);
		light = 0;
	}
}

void faster(void)
{
	if (OCR0A &lt; 244 &amp;&amp; OCR0B &lt; 244)
	{
		speed += 10;
		OCR0A = speed;
		OCR0B = speed;
	}
}

void slower(void)
{
	if (OCR0A &gt; 10 &amp;&amp; OCR0B &gt; 10)
	{
		speed -= 10;
		OCR0A = speed;
		OCR0B = speed;
	}
}

ISR(TIMER1_OVF_vect)
{
	ovf = 1;

	if(count == 25)
	{
	 	//Pulse the DYP-ME007 trigger pin
		PORTD |= (1&lt;&lt;PIN4);
		_delay_us(100);
		PORTD &amp;= ~(1&lt;&lt;PIN4);
		count = 0;
	}
	else count++;
}

ISR(INT0_vect)
{
	if(PIND &amp; (1&lt;&lt;PIN2))
	{
		TCNT1 = 0;
		ovf = 0;
	}

	else
	{
		distance = TCNT1;

		if (ovf == 1);
		else if (distance &gt; 15000 &amp;&amp; distanceSensor == 1)
		{
			if (alarm == 1)
			{
				alarm = 0;
				forward();
			}
		}

		else if (distance &lt;= 15000 &amp;&amp; alarm == 0 &amp;&amp; distanceSensor == 1)
		{
			stop();
			longBeep();
			alarm = 1;
			if (rotDir == 'L') leftPirouette();
			else if (rotDir == 'R') rightPirouette();
		}
	}
}

ISR(INT1_vect)
{
	if (state == 'C' &amp;&amp; pir == 1)
	{
		shortBeep();
		forward();
		_delay_ms(250);
		shortBeep();
		backward();
		_delay_ms(250);
		shortBeep();
		stop();
	}
}

//Serial com. Interrupt Service Routine (runs each time a byte is received)
ISR(USART_RX_vect)
{
	char ReceivedByte;
	ReceivedByte = UDR; // Retrieves byte from serial port (bluetooth module)
	//UDR = state; // Echoes it back for fun

	switch (ReceivedByte) //Which ASCII character was received?
	{
		case '!':	shortBeep();
					_delay_ms(50);
					shortBeep();
					_delay_ms(50);
					shortBeep();
					break;

		case 'U': 	forward();
					break; //Increase PWM duty cycle

		case 'C': 	stop();
					break; //Break motor by raising both direction inputs, PWM duty cycle 0%

		case 'D': 	backward();
					break; //Decrease PWM duty cycle

		case 'L': 	leftTurn();
					break;

		case 'R': 	rightTurn();
					break;

		case 'a':	leftPirouette();
					break;

		case 'e':	rightPirouette();
					break;

		case 'h':	longBeep();
					break;

		case 'l':	lights();
					break;

		case 'f':	faster();
					break;

		case 's':	slower();
					break;

		case 'P':	if (pir) pir = 0;
					else pir = 1;
					UDR = 'P';
					break;

		case 'H':	if (distanceSensor) distanceSensor = 0;
					else distanceSensor = 1;
					UDR = 'H';
					break;

		default:	UDR = '?';
					break; //Character unknown to my routine, discard character

	}

}

int main(void)
{
	//I/O Initialization
	DDRB |= (1&lt;&lt;PIN0) | (1&lt;&lt;PIN1) | (1&lt;&lt;PIN2) | (1&lt;&lt;PIN3) | (1&lt;&lt;PIN4) | (1&lt;&lt;PIN5) | (1&lt;&lt;PIN6); //DIR1, DIR2 and Enable pins as outputs
	DDRD |= (1&lt;&lt;PIN4) | (1&lt;&lt;PIN5) | (1&lt;&lt;PIN6);
	PORTB=0; //All initialized to 0

	//Timer0 initialization
	TCCR0A |= (1&lt;&lt;COM0A1) | (1&lt;&lt;COM0B1) | (1&lt;&lt;WGM00); //Phase correct PWM mode
	TCCR0B |= /*(1&lt;&lt;WGM02) |*/ (1&lt;&lt;CS00) | (1&lt;&lt;CS01); //div64
	OCR0A = 0; //Initialize PWM duty cycle to 0%
	OCR0B = 0;

	//Timer1 initialization
	TCCR1B |= (1&lt;&lt;CS10); //No prescaling (max count ~8ms)
	TIMSK |= (1&lt;&lt;TOIE1); //overflow interrupt

	//UART
	UCSRB |= (1 &lt;&lt; RXEN) | (1 &lt;&lt; TXEN); //Enable Tx and Rx
	UCSRC |= (1 &lt;&lt; UCSZ0) | (1 &lt;&lt; UCSZ1);
	UBRRL = BAUD_PRESCALE;			//Sets
	UBRRH = (BAUD_PRESCALE &gt;&gt; 8);	//baudrate registers
	UCSRB |= (1 &lt;&lt; RXCIE); //Enable USART-interrupt

	//External interrupts
	MCUCR |= (1&lt;&lt;ISC10) | (1&lt;&lt;ISC11) | (1&lt;&lt;ISC00); //INT1 rising trig. INT0 logic trig.
	GIMSK |= (1&lt;&lt;INT1) | (1&lt;&lt;INT0); //INT 0 and 1 enabled

	sei(); //Enable global interrupt

	/* This program is completely interrupt driven, so nothing goes on in while loop*/
	while(1); //Never gets out from here!

	return 0; //Never reaches this point!
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/26-06-2011/projects/bluetooth-robot-bt-bot/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Bluetooth controlled DC motor, BT module review</title>
		<link>http://microhobby.net/16-05-2011/projects/bluetooth-controlled-dc-motor/</link>
		<comments>http://microhobby.net/16-05-2011/projects/bluetooth-controlled-dc-motor/#comments</comments>
		<pubDate>Mon, 16 May 2011 12:38:11 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=296</guid>
		<description><![CDATA[This post will explain in detail how I control the speed and direction of the DC motor in the video below by bluetooth. First, here is the list of items...]]></description>
			<content:encoded><![CDATA[<p>This post will explain in detail how I control the speed and direction of the DC motor in the video below by bluetooth.<br />
<object width="500" height="306"><param name="movie" value="http://www.youtube.com/v/E6HEzZCdRWk?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/E6HEzZCdRWk?version=3" type="application/x-shockwave-flash" width="500" height="306" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>First, here is the list of items used in the experiment<br />
</strong><em><a href="http://microhobby.net/projects/l298-breakout-module/">L298 Double DC motor bidirectional speed controller</a><br />
AVR AtTiny2313V microcontroller<br />
<a href="http://www.goodluckbuy.com/serial-bluetooth-rf-transceiver-module-rs232-w-backplane-enable-and-state-pin-1.html">Bluetooth module for wireless serial communication<br />
</a>12V DC motor</em></p>
<p><strong>About the bluetooth module<br />
</strong>I bought this module as I saw it spread out over several chinese online stores, and was interested in seeing how easy it really is to implement it in a project.</p>
<p>Basically it&#8217;s a bluetooth replacement for the Rx and Tx wires in standard serial applications. So if you bought two of these you can have two microcontrollers or computers communicate with each other wireless in the same way as you&#8217;d set up standard serial communication. Just hook these up at the Rx and Tx pins of your devices and provide 5v logic supply and ground and you&#8217;re ready to go. If you&#8217;re not satisfied with the standard setup of the module (name: linvor, PIN: 0000, baudrate: 9600) you can change those settings by sending it AT commands serially. For example, AT+PIN1234 will set pin code to 1234. The device responds with PIN1234 OK. To change baudrate you use the AT+BAUDx where x represents the baudrate number described in the manual. #4 is 9600 and #1 is 1200, for starters.</p>
<p>But you don&#8217;t need two of these to have fun! As you already know, many devices these days are equipped with bluetooth, best known is your mobile phone. For your mobile phone to send and receive serial commands via bluetooth, the hardware and software of your phone has to support the Serial Port Profile protocol (SPP). Your android device supports SPP, your iPhone does not. Next thing you&#8217;ll need is an android application which can send and (optional) receive bytes by SPP. I found the free software called <a href="https://market.android.com/details?id=com.gundel.bluecontrol&amp;feature=search_result">Blue Control</a> in the android market, and this is what I&#8217;ve used here. You can also choose to try the <a href="https://market.android.com/details?id=com.kvndev.android.two">QkCtrl Serial BT</a> which is rather expensive, but much more configurable. Remember to pair your phone with the module from the Wireless settings in android before trying to connect to it in the applications.</p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/05/bt-control.jpg"><img class="alignnone size-large wp-image-301" title="bt-control" src="http://microhobby.net/wp-content/uploads/2011/05/bt-control-1024x484.jpg" alt="" width="640" height="302" /></a></p>
<p><em>Click the photo to enlarge, it will show less grainy. To see the whole figure, please see my schematic for the <a href="http://microhobby.net/projects/l298-breakout-module/">L298 motor controller in my previous post</a>.</em></p>
<p>I found the wake/power pin on the bluetooth module to be optional. The manual says it should be tied to ground when activated, and tied to Vcc to make it sleep. Maybe there&#8217;s a pull-down resistor on the module, because it works when floating the wake/power pin. There&#8217;s also a State output pin for a status LED, but there is already a red one on the module, so no need for an extra. The LED will blink at ~5Hz when not paired, and lit in a stable condition when successfully paired with another device AND the serial port is successfully occupied (when connected within the phones bluetooth application, se video).</p>
<p><strong>Programming the AtTiny2313V<br />
</strong>For this application we will use two peripherals on the microcontroller<br />
- The Timer 0, for PWM signal to the motor controller<br />
- The UART, for communicating with the bluetooth module (and thus, your mobile phone)</p>
<p>The microcontroller is interrupt driven, and changes to the control pins are only made when a byte is successfully received via the bluetooth serial module. The characters from the different button in the Blue Control application are pre-defined, will be using the up, down, left, right and center button, which are represented by the ASCII characters U, D, L, R and C. All other characters are ignored by the microcontroller. Please see the below source code which has helpful comments.</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;avr/io.h&gt;
#include &lt;avr/interrupt.h&gt;
#define F_CPU 3686400UL //Defines clock speed
#define USART_BAUDRATE 9600 //Baudrate for serial comm.
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)

//Serial com. Interrupt Service Routine (runs each time a byte is received)
ISR(USART_RX_vect)
{
	char ReceivedByte;
	ReceivedByte = UDR; // Retrieves byte from serial port (bluetooth module)
	UDR = ReceivedByte; // Echoes it back for fun

	switch (ReceivedByte) //Which ASCII character was received?
	{
		case 'U': 	if(OCR0A &lt;= 244)
						OCR0A += 10;
					break; //Increase PWM duty cycle

		case 'C': 	PORTB |= 0b11;
					OCR0A = 0;
					break; //Break motor by raising both direction inputs, PWM duty cycle 0%

		case 'D': 	if(OCR0A &gt;= 10)
						OCR0A -= 10;
					break; //Decrease PWM duty cycle

		case 'L': 	PORTB &amp;= ~(1&lt;&lt;PIN0) &amp; ~(1&lt;&lt;PIN1); //clear Dir-pins
					PORTB |= (1&lt;&lt;PIN0);
					break; //Change motor direction to left

		case 'R': 	PORTB &amp;= ~(1&lt;&lt;PIN0) &amp; ~(1&lt;&lt;PIN1); //clear Dir-pins
					PORTB |= (1&lt;&lt;PIN1);
					break; //Change motor direction to left

		default:	break; //Character unknown to my routine, discard character

	}

}

int main(void)
{
	//I/O Initialization
	DDRB |= (1&lt;&lt;PIN0) | (1&lt;&lt;PIN1) | (1&lt;&lt;PIN2); //DIR1, DIR2 and Enable pins as outputs
	PORTB=0; //All initialized to 0

	//Timer0 initialization
	TCCR0A |= (1&lt;&lt;COM0A1) | (1&lt;&lt;WGM00); //Phase correct PWM mode
	TCCR0B |= (1&lt;&lt;CS00) | (1&lt;&lt;CS01); //div64
	OCR0A = 0; //Initialize PWM duty cycle to 0%

	//UART
	UCSRB |= (1 &lt;&lt; RXEN) | (1 &lt;&lt; TXEN); //Enable Tx and Rx
	UCSRC |= (1 &lt;&lt; UCSZ0) | (1 &lt;&lt; UCSZ1);
	UBRRL = BAUD_PRESCALE;			//Sets
	UBRRH = (BAUD_PRESCALE &gt;&gt; 8);	//baudrate registers
	UCSRB |= (1 &lt;&lt; RXCIE); //Enable USART-interrupt

	sei(); //Enable global interrupt

	/* This program is completely interrupt driven, so nothing goes on in while loop*/
	while(1); //Never gets out from here!

	return 0; //Never reaches this point!
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/16-05-2011/projects/bluetooth-controlled-dc-motor/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>L298 breakout module</title>
		<link>http://microhobby.net/14-05-2011/projects/l298-breakout-module/</link>
		<comments>http://microhobby.net/14-05-2011/projects/l298-breakout-module/#comments</comments>
		<pubDate>Sat, 14 May 2011 21:09:52 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=284</guid>
		<description><![CDATA[I want to get deeper into the robotics scene, and need some sort of &#8220;base&#8221; to experiment from. So I bought the AREXX Mr. Basic 4WD robot/car chassis from DealExtreme.com...]]></description>
			<content:encoded><![CDATA[<div id="attachment_290" class="wp-caption alignleft" style="width: 160px"><a href="http://microhobby.net/wp-content/uploads/2011/05/l298_pl.jpg"><img class="size-thumbnail wp-image-290" title="l298_pl" src="http://microhobby.net/wp-content/uploads/2011/05/l298_pl-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Picture by Solarbotics.com, a great resoruce for hobby robotics!</p></div>
<p>I want to get deeper into the robotics scene, and need some sort of &#8220;base&#8221; to experiment from. So I bought the <a href="http://www.arexx.com.cn/en/ProductShow.asp?ID=54">AREXX Mr. Basic</a> 4WD robot/car chassis from <a href="http://www.dealextreme.com/p/lmr-mr-basic-educational-electronic-robotics-kit-3-aa-45542">DealExtreme.com (SKU 45542)</a>, and while it still has not arrived, I decided getting busy preparing it a warm welcome.</p>
<p>So, since the robot chassis has two stationary DC motors I wanted to make a TTL level compatible stationary motor driver, so I wouldn&#8217;t have to re-invent the wheel(driver) each time a prototype a new idea. This has at least two main advantages<br />
1 &#8211; Fewer components on the logic drive circuit, less time prototyping<br />
2 &#8211; Lower cost. Motor driver chips are expensive, and one chip per prototype is just unnecessary.</p>
<p>The best choice of chip type for this application is one of the many dual h-bridge driver chips out there. The reasons you should choose an integrated circuit instead of designing your own h-bridge with 8+ FETs is because they need almost no external components and take up less space. This gives you a lower <a href="http://en.wikipedia.org/wiki/Bill_of_materials">bill of materials</a>, more space left for other circuitry and an even easier design process. And since we&#8217;re building this as a module, it doesn&#8217;t even restrict the use to your one robot platform, it is really a very handy thing to have at hand!</p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/05/IMAG0190.jpg"><img class="alignright size-thumbnail wp-image-291" title="IMAG0190" src="http://microhobby.net/wp-content/uploads/2011/05/IMAG0190-150x150.jpg" alt="" width="150" height="150" /></a>The most available motor driver chips I have found to be the ones from ST Microelectronics. For applications with motors reaching currents up to 600mA (1.2A 100us peak) ampere, use the <a href="http://www.st.com/internet/analog/product/63141.jsp">L293D</a>. For currents up to 2A (3A 100us peak, 2.5A repetitive(see datasheet)), use the <a href="http://www.st.com/internet/analog/product/63147.jsp">L298</a>, like I did, to play it safe for all future applications.</p>
<p>What I basically did was to follow one of the example schematics in the datasheet and complete it with header pins and terminal block for connections to my microcontrollers, power supplies and motors. See Figure 6 : Bidirectional DC Motor Control on page 6 in the datasheet (current version at this date).</p>
<p>My complete schematic is shown here<br />
<a href="http://microhobby.net/wp-content/uploads/2011/05/L298.bmp"><img class="alignnone size-full wp-image-285" title="L298" src="http://microhobby.net/wp-content/uploads/2011/05/L298.bmp" alt="" /></a></p>
<p>One feature that this chip have, and the L293D has not, is the current sense output pins. Those pins are where the motor current is passed through so they need to be grounded. But since ST have been so nice to regulate the voltage on these output pins to 2 volts, you can add a high power, low value, resistor in series with the output and then easily sense the current drawn by the motors by measuring the voltage drop across the sense resistors. This voltage can then be directly read by a microcontroller ADC to get some great operational feedback. Remember to dimension the resistor value and specifications to match your application. If you&#8217;re expecting currents up to 3A you could easily reckon the voltage drop across small hobby motors will be big, so a 5W resistor will do in most cases, and 3A/2V=1,5 Ohms so a 2 Ohm 5 watt resistor is fine to play it safe. For smaller applications with less current drawn you just have to make sure to use a high resolution ADC to sense the smaller voltage drops.</p>
<p>In the video below I have connected one channel to my atmel STK500 at which all the momentary tact switches are pulled high when open, then drawn to ground when closed. Thats why the enable pin doesn&#8217;t cut the drive circuit until I press it&#8217;s connected button. If you like to see a curios cat, just keep watching. Note that in the pictures and on the video I have no current sensing resistors yet since I had none at hand when soldering the board. They will be added!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/14-05-2011/projects/l298-breakout-module/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dual comparator temperature check instrument</title>
		<link>http://microhobby.net/14-05-2011/projects/dual-comparator-temperature-check-instrument/</link>
		<comments>http://microhobby.net/14-05-2011/projects/dual-comparator-temperature-check-instrument/#comments</comments>
		<pubDate>Sat, 14 May 2011 15:11:56 +0000</pubDate>
		<dc:creator>Henrik Sandaker Palm</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://microhobby.net/?p=272</guid>
		<description><![CDATA[This is an easy build for most novices, and is a great beginners project for those who wants to learn how to solder, or have very few components at hand....]]></description>
			<content:encoded><![CDATA[<p>This is an easy build for most novices, and is a great beginners project for those who wants to learn how to solder, or have very few components at hand. The components are also cheap if you need to buy them.</p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/05/IMAG0196.jpg"><img class="alignnone size-thumbnail wp-image-276" title="IMAG0196" src="http://microhobby.net/wp-content/uploads/2011/05/IMAG0196-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p><strong>Functionality<br />
</strong>With this instrument you are able to preset two temperatures with two rotary dials. One upper limit, and one lower limit. When the &#8220;on&#8221;-button is pressed, the rgb led will light up in either of it&#8217;s three colors (red, green, blue &#8211; RGB). Red light means that ambient temperature is above your upper limit and blue light means that ambient temperature is below lower limit. Green light indicates that you are within both limits. The instrument is only turned on while checking led color, so battery life is ~forever.</p>
<p><strong>The circuit<a href="http://microhobby.net/wp-content/uploads/2011/05/tempset-simpl.jpg"><img class="alignleft size-full wp-image-274" title="tempset-simpl" src="http://microhobby.net/wp-content/uploads/2011/05/tempset-simpl.jpg" alt="" width="383" height="157" /></a><br />
</strong>The main parts of this circuit is the 100K Ohm NTC thermistor and the LM393N dual comparator. A thermistor is a temperature dependent resistor, which resistance increases linearly with its surrounding temperature. The idea is to make three voltage dividers:<br />
<em>1. From potentiometer (pot) 1, and a fixed value resistor (v1)<br />
</em><em>2. From pot 2, and a fixed value resistor (v2)<br />
</em><em>3. From a thermistor and a fixed value resistor (v3)</em></p>
<p>&nbsp;</p>
<p><em>v1</em> and <em>v2</em> will increase and decrease depending on which way the pot is turned. Voltage <em>v3</em> will vary depending on the NTCs surrounding temperature. What we want to do is compare both voltage <em>v1</em> and <em>v2</em> to <em>v3. </em>If <em>v1</em> drops below <em>v3</em>, output on comparator #1 will drop to 0v, and start sinking current for the common anode rgb led &#8220;red&#8221; pin (from now on called the red cathode). Likewise, if <em>v2</em> drops below <em>v3</em>, output on comparator #2 drops to 0v and starts sinking current for the blue cathode.</p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/05/nand-npn.jpg"><img class="alignleft size-full wp-image-273" title="nand-npn" src="http://microhobby.net/wp-content/uploads/2011/05/nand-npn.jpg" alt="" width="203" height="409" /></a>Now, if both comparator outputs are high, we know that we must be in between both set points, and need to sink current on the green cathode on the rgb led. This is solved by making a NAND-gate with two general purpose NPN transistors. A NAND-gate has two inputs and one output. The output is low only when both inputs are high The output is high on all other conditions. To the left you see the schematic of a NAND gate and the transistor equivalent. For the transistor equivalent to work exactly like real NAND-gate you will need an extra pull-up resistor for the output to go high on the correct conditions, but this is not needed in our case here.</p>
<p>Further down you can see the whole schematic. Please note that not all potentiometers nor NTC thermistors are alike, and this circuit is designed to match the values of what I had on hand.</p>
<p><a href="http://microhobby.net/wp-content/uploads/2011/05/tempset-sch.jpg"><img class="alignnone size-full wp-image-275" title="tempset-sch" src="http://microhobby.net/wp-content/uploads/2011/05/tempset-sch.jpg" alt="" width="812" height="551" /></a></p>
<p><strong>Notes<br />
</strong>- Thermistor (lower left corner). Not to be confused with a regular resistor!<br />
- LM393N. DIP 8 package IRL, but pin-outs on schematic is not &#8220;comparable&#8221; (hah&#8230;).<br />
- R7, the LED series resistor. This is the common series resistor for all cathodes, I&#8217;m allowing this because only one color is to be lit at the same time.<br />
- R12, R13 (upper left corner). Pull-up resistors on the comparator outputs are needed for the comparator to be able to switch between Vcc and GND.<br />
- R8-R11 (at the transistors). Biasing- and base resistors to keep transistor base voltages at the right level, and to ensure a fully switched off transistor when comparator outputs are low.<br />
- SW1 (top). In my circuit this is a momentary switch, you can use whatever, but remember that this instrument does not need to be switched on while in use or while taking measurements. The thermistor resistance will increase and decrease by temperature even though no voltage is applied.</p>
<p>Here is another two pictures of the insides of the instrument and a demo video.<br />
<a href="http://microhobby.net/wp-content/uploads/2011/05/IMAG0194.jpg"><img class="alignnone size-thumbnail wp-image-277" title="IMAG0194" src="http://microhobby.net/wp-content/uploads/2011/05/IMAG0194-150x150.jpg" alt="" width="150" height="150" /></a> <a href="http://microhobby.net/wp-content/uploads/2011/05/IMAG0195.jpg"><img class="alignnone size-thumbnail wp-image-278" title="IMAG0195" src="http://microhobby.net/wp-content/uploads/2011/05/IMAG0195-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>&nbsp;</p>
<p><iframe width="640" height="390" src="http://www.youtube.com/embed/hjmyQh2ygpE" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://microhobby.net/14-05-2011/projects/dual-comparator-temperature-check-instrument/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

