<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Hack a Day &#187; ATmega168</title>
	<atom:link href="http://hackaday.com/tag/atmega168/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Fri, 10 Feb 2012 11:18:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hackaday.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/5560f98f805877b0e332f191cb9e0af3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Hack a Day &#187; ATmega168</title>
		<link>http://hackaday.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hackaday.com/osd.xml" title="Hack a Day" />
	<atom:link rel='hub' href='http://hackaday.com/?pushpress=hub'/>
		<item>
		<title>WiFi experiments with ATtiny microcontrollers</title>
		<link>http://hackaday.com/2012/02/07/wifi-experiments-with-attiny-microcontrollers/</link>
		<comments>http://hackaday.com/2012/02/07/wifi-experiments-with-attiny-microcontrollers/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 20:01:33 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[attiny]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=66973</guid>
		<description><![CDATA[[Quinn Dunki] got some free stuff from Element14 to evaluate, including this Mircrochip WiFi module. It&#8217;s been used as the centerpiece of an Arduino shield in the past, and she grabbed a copy of that library to see if it would play nicely with an ATtiny chip. What follows is a struggle to de-Arduino the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=66973&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-66974" title="wifi-for-the-attiny13" src="http://hackadaycom.files.wordpress.com/2012/02/wifi-for-the-attiny13.jpg" alt="" width="470" height="400" /></p>
<p>[Quinn Dunki] got some free stuff from Element14 to evaluate, including this Mircrochip WiFi module. It&#8217;s been used as the centerpiece of an Arduino shield in the past, and she grabbed a copy of that library to see if it would play nicely with an ATtiny chip. What follows is <a href="http://quinndunki.com/blondihacks/?p=840">a struggle to de-Arduino the code so that it&#8217;s portable</a> for all AVR controllers.</p>
<p>This module is one of the least expensive ways to add WiFi to a project, coming in at around $23. But it&#8217;s not really an all-in-one solution as there&#8217;s still a huge software hurdle to cross. The hardware provides access to to radio functions needed to communicate with the network, but you need to supply the TCP/IP stack and everything that supports it. Hence the re-use of the Arduino library.</p>
<p>Battling adversity [Quinn] fought the good fight with this one. Switching from an ATtiny to the ATmega168, compiling more code, and troubleshooting the process. She used a single LED as feedback, and can get some connectivity with her hotspot. But to this point she hasn&#8217;t gotten everything up and running.</p>
<p>We&#8217;re hot for an AVR WiFi solution that is cheap and easy to use. But as we see here, the software is complex and perhaps best left up to beefier hardware like the ARM controllers. What do you think?</p>
<br />Filed under: <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/66973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/66973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/66973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/66973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/66973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/66973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/66973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/66973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/66973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/66973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/66973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/66973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/66973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/66973/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=66973&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2012/02/07/wifi-experiments-with-attiny-microcontrollers/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2012/02/wifi-for-the-attiny13.jpg" medium="image">
			<media:title type="html">wifi-for-the-attiny13</media:title>
		</media:content>
	</item>
		<item>
		<title>Microcontroller comm with a computer monitor</title>
		<link>http://hackaday.com/2011/12/22/microcontroller-comm-with-a-computer-monitor/</link>
		<comments>http://hackaday.com/2011/12/22/microcontroller-comm-with-a-computer-monitor/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 17:01:27 +0000</pubDate>
		<dc:creator>Brian Benchoff</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[manchester encoding]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[photoresistor]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=63921</guid>
		<description><![CDATA[Prolific Hack a Day author [Mike S] has been playing in his lab again and he&#8217;s come up with a neat way to talk to microcontrollers with an LCD monitor. The basic idea behind [Mike]&#8216;s work isn&#8217;t much different from the weird and/or cool Timex Datalink watch from the 1990s. Despite the fancy dev board, the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=63921&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://hackadaycom.files.wordpress.com/2011/12/lost.jpg"><img class="alignnone size-full wp-image-63922" title="LOST" src="http://hackadaycom.files.wordpress.com/2011/12/lost.jpg" alt="" width="470" height="204" /></a></p>
<p>Prolific Hack a Day author [Mike S] has been playing in his lab again and he&#8217;s come up with a neat way to <a href="http://jumptuck.com/2011/12/20/light-programming-showing-results/">talk to microcontrollers</a> with an LCD monitor. The basic idea behind [Mike]&#8216;s work isn&#8217;t much different from the weird and/or cool <a href="http://en.wikipedia.org/wiki/Timex_Datalink">Timex Datalink</a> watch from the 1990s.</p>
<p>Despite the fancy dev board, the hardware is very simple &#8211; a <a href="http://jumptuck.com/2011/12/16/manchester-encoding-monitor-light-sensor/?preview=true">photoresistor</a> is pointed at a computer monitor and reads bits using <a href="http://atmel.com/dyn/resources/prod_documents/doc9164.pdf">Manchester encoding</a>. The computer flashes a series of black and white screens thanks to a simple Javascript/HTML page, and data is (mostly) transmitted to the micro. [Mike] says he has about a failed message about 60% of the time, and he&#8217;s not quite sure where the problem is. He&#8217;s looking into another kind of Manchester encoding that uses samples instead of edges, so we hope everything works out for him.</p>
<p>This build is very similar &#8211; and was inspired by &#8211; an earlier post about microcontroller communication <a href="http://hackaday.com/2011/07/28/microcontroller-communications-using-flashing-lights/">with flashing lights</a>. Still, [Mike]&#8216;s build reminds us of the strangely futuristic Ironman watch we had in &#8217;97. Check out [Mike]&#8216;s demo of his computer/micro comm link after the break and his code on <a href="https://github.com/szczys/Light-Programmer">github</a>.</p>
<p><span id="more-63921"></span></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2011/12/22/microcontroller-comm-with-a-computer-monitor/"><img src="http://img.youtube.com/vi/NGbpC91oZJ4/2.jpg" alt="" /></a></span>
<br />Filed under: <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/63921/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/63921/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/63921/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/63921/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/63921/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/63921/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/63921/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/63921/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/63921/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/63921/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/63921/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/63921/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/63921/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/63921/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=63921&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/12/22/microcontroller-comm-with-a-computer-monitor/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">brianbenchoff</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/12/lost.jpg" medium="image">
			<media:title type="html">LOST</media:title>
		</media:content>
	</item>
		<item>
		<title>FIGnition FLINT is a stripboard build of the simple computer</title>
		<link>http://hackaday.com/2011/11/18/fignition-flint-is-a-stripboard-build-of-the-simple-computer/</link>
		<comments>http://hackaday.com/2011/11/18/fignition-flint-is-a-stripboard-build-of-the-simple-computer/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 22:24:21 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[8 bit]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[fignition]]></category>
		<category><![CDATA[strip board]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=61522</guid>
		<description><![CDATA[If you want people to really be impressed by your projects it&#8217;s often better not to have a fully finished look. In this case, we think hooking the stripboard version of FIGnition up to your TV will raise a lot more eyebrows than the PCB version will. [Julian] put together a guide to building the computer on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=61522&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-61523" title="fignition-built-on-stripboard" src="http://hackadaycom.files.wordpress.com/2011/11/fignition-built-on-stripboard-e1321636744603.jpg" alt="" width="470" height="353" /></p>
<p>If you want people to really be impressed by your projects it&#8217;s often better not to have a fully finished look. In this case, we think hooking the stripboard version of FIGnition up to your TV will raise a lot more eyebrows than the PCB version will.</p>
<p>[Julian] put together <a href="https://sites.google.com/site/libby8dev/fignition/documentation/build-it/fignition-flint">a guide to building the computer on strip board</a>. He&#8217;s using his own Java application for laying out circuits on this versatile prototyping substrate. This tool is worth a look as it may simplify those point-to-point solder prototypes you&#8217;ve been agonizing over. You&#8217;ll have to do some poking around on his site to gather all of the knowledge necessary to complete the build. Most of the components are easy to source, but unless you have them on hand, you&#8217;ll need put in a parts order for the crystal, the ATmega168, the SRAM chip, and the flash memory chip.</p>
<p>For those not familiar, <a href="http://sites.google.com/site/libby8dev/fignition">FIGnition is an 8-bit computer</a> with composite TV-out for a display and rudimentary input from the eight momentary push buttons.</p>
<br />Filed under: <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/61522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/61522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/61522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/61522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/61522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/61522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/61522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/61522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/61522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/61522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/61522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/61522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/61522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/61522/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=61522&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/11/18/fignition-flint-is-a-stripboard-build-of-the-simple-computer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/11/fignition-built-on-stripboard-e1321636744603.jpg" medium="image">
			<media:title type="html">fignition-built-on-stripboard</media:title>
		</media:content>
	</item>
		<item>
		<title>Pulse Width Modulation with microcontrollers</title>
		<link>http://hackaday.com/2011/06/26/pulse-width-modulation-with-microcontrollers/</link>
		<comments>http://hackaday.com/2011/06/26/pulse-width-modulation-with-microcontrollers/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 20:09:57 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[pulse-width modulation]]></category>
		<category><![CDATA[pwm]]></category>
		<category><![CDATA[timers]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=47095</guid>
		<description><![CDATA[Those following the ProtoStack tutorials will be happy to hear that there is a new installment which explains Pulse Width Modulation. If you&#8217;ve never heard of PWM before, it&#8217;s a method of generating a signal that is logic 1 for a portion of the time and logic 0 for the remainder of the time. It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=47095&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-47096" title="pwm-tutorial-protostack" src="http://hackadaycom.files.wordpress.com/2011/06/pwm-tutorial-protostack-e1309030289939.jpg" alt="" width="470" height="233" /></p>
<p>Those following the ProtoStack tutorials will be happy to hear that there is <a href="http://www.protostack.com/blog/2011/06/atmega168a-pulse-width-modulation-pwm/">a new installment which explains Pulse Width Modulation</a>. If you&#8217;ve never heard of PWM before, it&#8217;s a method of generating a signal that is logic 1 for a portion of the time and logic 0 for the remainder of the time. It is the most commonly used method for dimming an LED, and that&#8217;s [Daniel's] example in this tutorial. But you&#8217;ll also find it used in many other applications such as servo motor control and piezo speaker control.</p>
<p>[Daniel] starts off with a brief explanation of duty cycle, then moves on to some examples of hardware and software PWM. Many of the AVR microcontrollers have a hardware PWM feature that allows you to configure a pin that toggles based on a target timer value. This is demonstrated using an ATmega168, but a method of using interrupts and your own code is also covered in case you don&#8217;t have a hardware PWM pin available.</p>
<br />Filed under: <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/47095/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/47095/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/47095/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/47095/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/47095/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/47095/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/47095/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/47095/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/47095/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/47095/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/47095/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/47095/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/47095/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/47095/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=47095&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/06/26/pulse-width-modulation-with-microcontrollers/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/06/pwm-tutorial-protostack-e1309030289939.jpg" medium="image">
			<media:title type="html">pwm-tutorial-protostack</media:title>
		</media:content>
	</item>
		<item>
		<title>The Infrared Graduation Cap</title>
		<link>http://hackaday.com/2011/06/19/the-infrared-graduation-cap/</link>
		<comments>http://hackaday.com/2011/06/19/the-infrared-graduation-cap/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 19:00:40 +0000</pubDate>
		<dc:creator>Jeremy Cook</dc:creator>
				<category><![CDATA[wearable hacks]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[infrared]]></category>
		<category><![CDATA[led]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=46432</guid>
		<description><![CDATA[It&#8217;s graduation time for many high schoolers, and while many students would love to decorate their caps, administration generally looks down upon this practice. [Victor], however, thought of a way around this. The human eye cannot see infrared light, but camcorders generally can. Putting these two concepts together with a couple of infrared LEDs, [Victor] [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=46432&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://hackaday.com/2011/06/19/the-infrared-graduation-cap/33xhmck/" rel="attachment wp-att-46437"><img class="alignnone size-full wp-image-46437" title="33xhmck" src="http://hackadaycom.files.wordpress.com/2011/06/33xhmck.jpg" alt="" width="470" height="353" /></a></p>
<p>It&#8217;s graduation time for many high schoolers, and while many students would love to decorate their caps, administration generally looks down upon this practice. [Victor], however, thought of a way around this.</p>
<p>The human eye cannot see infrared light, but camcorders generally can. Putting these two concepts together with a couple of infrared LEDs, [Victor] was able to <a href="http://razorconcepts.net/Hat.html">make a cap that displayed his decoration in everyone&#8217;s &#8220;digital memory&#8221;,</a> but wouldn&#8217;t be detected until the video of the offense was displayed. Hopefully by the time the prank is detected, [Victor] will have successfully graduated and presumably gone on to other pursuits.</p>
<p>An ATmega 168 controls this hat to display his message, &#8220;Congratulations Class of 2011,&#8221; in Morse code. What a creative use of both old and new technology to pull off an awesome graduation prank. Be sure to check out the video after the break to see how everything was put together.<span id="more-46432"></span><br />
<div class='embed-vimeo' style='text-align:center;'><iframe src='http://player.vimeo.com/video/25287134' width='470' height='300' frameborder='0'></iframe></div></p>
<br />Filed under: <a href='http://hackaday.com/category/wearable-hacks/'>wearable hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/46432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/46432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/46432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/46432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/46432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/46432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/46432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/46432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/46432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/46432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/46432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/46432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/46432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/46432/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=46432&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/06/19/the-infrared-graduation-cap/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jeremyscook</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/06/33xhmck.jpg" medium="image">
			<media:title type="html">33xhmck</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding Ethernet control for a 5.1 speaker set</title>
		<link>http://hackaday.com/2011/05/16/adding-ethernet-control-for-a-5-1-speaker-set/</link>
		<comments>http://hackaday.com/2011/05/16/adding-ethernet-control-for-a-5-1-speaker-set/#comments</comments>
		<pubDate>Mon, 16 May 2011 20:32:20 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[digital audio hacks]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[enc28j60]]></category>
		<category><![CDATA[mains]]></category>
		<category><![CDATA[outlet]]></category>
		<category><![CDATA[RF]]></category>
		<category><![CDATA[speakers]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=42982</guid>
		<description><![CDATA[[HuB's] set of 5.1 surround sound speakers was gobbling up a bunch of electricity when in standby as evidenced by the 50 Hz hum coming from the sub-woofer and the burning hot heat sink on the power supply. He wanted to add a way to automatically control the systems and offer the new feature of disconnecting the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=42982&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-42985" title="ethernet-controlled-5-1-surround-sound-speakers" src="http://hackadaycom.files.wordpress.com/2011/05/ethernet-controlled-5-1-surround-sound-speakers.jpg" alt="" width="470" height="400" /></p>
<p>[HuB's] set of 5.1 surround sound speakers was gobbling up a bunch of electricity when in standby as evidenced by the 50 Hz hum coming from the sub-woofer and the burning hot heat sink on the power supply. He wanted to add a way to <a href="https://sites.google.com/site/hubmartin/electronics/ethernet-controlled-5-1-speakers">automatically control the systems and offer the new feature of disconnecting the power from the mains</a>.</p>
<p>The first part was not too hard, although he used a roundabout method of prototyping. He planned to use the IR receiver on the speakers to control them. At the time, [HuB] didn&#8217;t have an oscilloscope on hand that he could use to capture the IR protocol so he ended up using Audacity (the open source audio editing suite) to capture signals connected to the input of a sound card. He used this to establish the timing and encoding that he needed for all eight buttons on the original remote control.</p>
<p>Next, he grabbed a board that he built using an ATmega168 and an ENC28J60 Ethernet chip. This allows you to send commands via the Internet which are then translated into the appropriate IR signals to control the speakers and a few other devices in the room. The last piece of the puzzle was to wrap an RF controlled outlet into the project with lets him cut mains power to the speakers when not in use. You can see the video demonstration embedded after the break.</p>
<p><span id="more-42982"></span><span style="text-align:center; display: block;"><a href="http://hackaday.com/2011/05/16/adding-ethernet-control-for-a-5-1-speaker-set/"><img src="http://img.youtube.com/vi/Coa74-hGV-Q/2.jpg" alt="" /></a></span></p>
<br />Filed under: <a href='http://hackaday.com/category/digital-audio-hacks/'>digital audio hacks</a>, <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/42982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/42982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/42982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/42982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/42982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/42982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/42982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/42982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/42982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/42982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/42982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/42982/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/42982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/42982/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=42982&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/05/16/adding-ethernet-control-for-a-5-1-speaker-set/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/05/ethernet-controlled-5-1-surround-sound-speakers.jpg" medium="image">
			<media:title type="html">ethernet-controlled-5-1-surround-sound-speakers</media:title>
		</media:content>
	</item>
		<item>
		<title>15-digit Nixie clock contains mostly non-useful information</title>
		<link>http://hackaday.com/2011/04/06/15-digit-nixie-clock-contains-mostly-non-useful-information/</link>
		<comments>http://hackaday.com/2011/04/06/15-digit-nixie-clock-contains-mostly-non-useful-information/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 20:30:12 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[clock hacks]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[ds1307]]></category>
		<category><![CDATA[metronome]]></category>
		<category><![CDATA[nixie]]></category>
		<category><![CDATA[rtc]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=39567</guid>
		<description><![CDATA[[Jarek Lupinski] is at it again, this time building a clock using 15 Nixie tubes. Just look at the time&#8230;. wait, how do you read this now? It&#8217;s not seconds since the epoch, but an homage to a very expensive New York City art piece. [Jarek] took his inspiration from the Metronome art installation in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=39567&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-39568" title="15-digit-nixie-clock" src="http://hackadaycom.files.wordpress.com/2011/04/15-digit-nixie-clock-e1302106734492.jpg" alt="" width="470" height="351" /></p>
<p>[Jarek Lupinski] is at it again, this time building <a href="http://www.soniktech.com/mason.php">a clock using 15 Nixie tubes</a>. Just look at the time&#8230;. wait, how do you read this now? It&#8217;s not seconds since the epoch, but an homage to a very expensive New York City art piece. [Jarek] took his inspiration from the <a href="http://en.wikipedia.org/wiki/Metronome_%28public_artwork%29">Metronome art installation</a> in Union Square.</p>
<p>We hadn&#8217;t heard of it before and were shocked to learn that this art was commissioned at $4.2 million. It belches steam and confuses passersby with its cryptic fifteen digits. It seems that the eight digits on the left mark the current time &#8211; two digits for hours, two for minutes, two for seconds, and the final digit for hundreths of a second. The seven remaining digits count down the time left in the day. So when you watch it, you see the significant digits of the display increasing, and the insignificant half decreasing.</p>
<p>The Nixie version rests snuggly on a 15&#8243;x4&#8243; PCB. We&#8217;re sure it doesn&#8217;t number in the millions, but that couldn&#8217;t have been cheap to have manufactured. Each tube has its own driver chip, removing the need for multiplexing. An ATmega168 controls the clock (along with some shift registers to expand the I/O count), reading time from a DS1307 RTC chip. It looks fancy, but where&#8217;s the belching smoke on this version?</p>
<br />Filed under: <a href='http://hackaday.com/category/clock-hacks/'>clock hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/39567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/39567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/39567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/39567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/39567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/39567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/39567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/39567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/39567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/39567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/39567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/39567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/39567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/39567/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=39567&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/04/06/15-digit-nixie-clock-contains-mostly-non-useful-information/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/04/15-digit-nixie-clock-e1302106734492.jpg" medium="image">
			<media:title type="html">15-digit-nixie-clock</media:title>
		</media:content>
	</item>
		<item>
		<title>Ski pole persistence of vision</title>
		<link>http://hackaday.com/2011/02/16/ski-pole-persistence-of-vision/</link>
		<comments>http://hackaday.com/2011/02/16/ski-pole-persistence-of-vision/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 12:05:16 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[led hacks]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[pole]]></category>
		<category><![CDATA[POV]]></category>
		<category><![CDATA[ski]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=35099</guid>
		<description><![CDATA[[Powder4u] wanted to make a persistence of vision display for his bicycle but with 50 cm of snow on the ground it&#8217;s hard to get out and ride right now. Instead he made this persistence of vision ski-pole accessory. We asked him to share some details and he obliged. It&#8217;s made using an Arduino compatible [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=35099&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-35100" title="ski-pole-pov" src="http://hackadaycom.files.wordpress.com/2011/02/ski-pole-pov.jpg" alt="" width="470" height="349" /></p>
<p>[Powder4u] wanted to make a persistence of vision display for his bicycle but with 50 cm of snow on the ground it&#8217;s hard to get out and ride right now. Instead he made <a href="http://www.flickr.com/photos/powder4u/5438078593/">this persistence of vision ski-pole accessory</a>. We asked him to share some details and he obliged. It&#8217;s made using an Arduino compatible ATmega168, LEDs with resistors, and installed on some protoboard. The enclosure is a clear pencil case, which isn&#8217;t water tight but he&#8217;s tried to bolster that with some creative scotch tape placement. There&#8217;s no sensor to detect which direction the board is moving in so displaying alpha-numeric messages will have some issues, but as you can see <a href="http://www.flickr.com/photos/powder4u/5447329069/">he managed to display image data</a> without issue.</p>
<p>We&#8217;re used to night skiing with floodlights along the slopes. This would be a fun little thing to have along with you on those dark lift rides.</p>
<br />Filed under: <a href='http://hackaday.com/category/led-hacks/'>led hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/35099/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/35099/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/35099/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/35099/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/35099/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/35099/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/35099/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/35099/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/35099/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/35099/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/35099/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/35099/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/35099/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/35099/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=35099&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/02/16/ski-pole-persistence-of-vision/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/02/ski-pole-pov.jpg" medium="image">
			<media:title type="html">ski-pole-pov</media:title>
		</media:content>
	</item>
		<item>
		<title>Clap to remove this brassiere</title>
		<link>http://hackaday.com/2011/02/14/clap-to-remove-this-brassiere/</link>
		<comments>http://hackaday.com/2011/02/14/clap-to-remove-this-brassiere/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 18:02:42 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[wearable hacks]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[bra]]></category>
		<category><![CDATA[brassiere]]></category>
		<category><![CDATA[electromagnet]]></category>
		<category><![CDATA[relay]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=34997</guid>
		<description><![CDATA[Like some strange manga come to life, you can remove this brassiere with a clap of your hands. Under the red bow is a not-so-small mechanical clasp that replaces the original on the strapless front-clasping undergarment. We hate to criticize, but [Randofo] really went off the deep end of hardware overkill on this project. The clasp itself is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=34997&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-34998" title="the-clap-off-bra" src="http://hackadaycom.files.wordpress.com/2011/02/the-clap-off-bra-e1297703887637.jpg" alt="" width="470" height="312" /></p>
<p>Like some strange manga come to life, you can <a href="http://www.instructables.com/id/Clap-Off-Bra">remove this brassiere with a clap of your hands</a>. Under the red bow is a not-so-small mechanical clasp that replaces the original on the strapless front-clasping undergarment. We hate to criticize, but [Randofo] really went off the deep end of hardware overkill on this project. The clasp itself is the electromagnetic coil removed from the case of a mechanical relay. An ATmega168 listens for a spike in sound pressure from a microphone, then drives the relay to release the feminine support system.</p>
<p>It <em>is</em> Valentine&#8217;s day. The question being is this romantic or sleazy? Watch the NSFW video after the break and let us know your opinion in the comments.</p>
<p><span id="more-34997"></span><div class='embed-vimeo' style='text-align:center;'><iframe src='http://player.vimeo.com/video/19777275' width='470' height='264' frameborder='0'></iframe></div></p>
<p>[Thanks DMF]</p>
<br />Filed under: <a href='http://hackaday.com/category/wearable-hacks/'>wearable hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/34997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/34997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/34997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/34997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/34997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/34997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/34997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/34997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/34997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/34997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/34997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/34997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/34997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/34997/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=34997&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/02/14/clap-to-remove-this-brassiere/feed/</wfw:commentRss>
		<slash:comments>69</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/02/the-clap-off-bra-e1297703887637.jpg" medium="image">
			<media:title type="html">the-clap-off-bra</media:title>
		</media:content>
	</item>
		<item>
		<title>Fermentation temperature control</title>
		<link>http://hackaday.com/2011/02/01/fermentation-temperature-control/</link>
		<comments>http://hackaday.com/2011/02/01/fermentation-temperature-control/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 21:30:26 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[beer hacks]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[ds1820]]></category>
		<category><![CDATA[fermentation]]></category>
		<category><![CDATA[heating tape]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=33934</guid>
		<description><![CDATA[[Eric Friedrich] needed to keep the wort warm enough for yeast to ferment it into beer. To solve the problem he built his own fermentation temperature controler using a microprocessor to turn some heating tape on and off. You can see the heating element embracing that diminutive fermentation bucket in the picture above. This was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=33934&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-33935" title="beer-fermenter-termperature-control" src="http://hackadaycom.files.wordpress.com/2011/02/beer-fermenter-termperature-control.jpg" alt="" width="470" height="332" /></p>
<p>[Eric Friedrich] needed to keep the wort warm enough for yeast to ferment it into beer. To solve the problem <a href="http://www.twopossibilities.com/2011/01/26/homebrew-temperature-controller/">he built his own fermentation temperature controler</a> using a microprocessor to turn some heating tape on and off. You can see the heating element embracing that diminutive fermentation bucket in the picture above. This was originally meant for keeping reptile cages warm. It costs less than similar products meant just for brewing and works well for [Eric]. A DS1820 temperature sensor gives feedback to an ATmega168 which then uses a relay to switch the heat on and off. The target temperature can be changed using a potentiometer on the board, with the setting displayed on a character LCD screen on the project enclosure.</p>
<br />Filed under: <a href='http://hackaday.com/category/beer-hacks/'>beer hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/33934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/33934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/33934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/33934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/33934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/33934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/33934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/33934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/33934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/33934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/33934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/33934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/33934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/33934/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=33934&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/02/01/fermentation-temperature-control/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/02/beer-fermenter-termperature-control.jpg" medium="image">
			<media:title type="html">beer-fermenter-termperature-control</media:title>
		</media:content>
	</item>
		<item>
		<title>How to build a ping-pong ball display</title>
		<link>http://hackaday.com/2011/01/31/how-to-build-a-ping-pong-ball-display/</link>
		<comments>http://hackaday.com/2011/01/31/how-to-build-a-ping-pong-ball-display/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 19:00:13 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[clock hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[led hacks]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[ds3232]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[ping pong]]></category>
		<category><![CDATA[rtc]]></category>
		<category><![CDATA[shift register]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=33757</guid>
		<description><![CDATA[If you&#8217;ve been lusting after your own glowing display we&#8217;re here to help by sharing some simple building techniques that will result in an interesting project like the one you see above. This is a super-accurate clock That uses ping-pong balls as diffusers for LEDs, but with a little know-how you can turn this into [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=33757&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-33799" title="ping-pong-clock-banner-image" src="http://hackadaycom.files.wordpress.com/2011/01/ping-pong-clock-banner-image.jpg" alt="" width="470" height="364" /></p>
<p>If you&#8217;ve been lusting after your own glowing display we&#8217;re here to help by sharing some simple building techniques that will result in an interesting project like the one you see above. This is a super-accurate clock That uses ping-pong balls as diffusers for LEDs, but with a little know-how you can turn this into a full marquee display. Join me after break where I&#8217;ll share the details of the project and give you everything you need to know to build your own.</p>
<h2><span id="more-33757"></span>Planning</h2>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/pong-led-display.jpg"><img class="alignnone size-full wp-image-33784" title="pong-led-display" src="http://hackadaycom.files.wordpress.com/2011/01/pong-led-display.jpg" alt="" width="196" height="112" /></a></p>
<p>Take some time to sit down and figure out how many pixels you need in your display. Above you can see the sketch that I drew on the back of some junk mail. Since I need a clock for my shop I&#8217;m only going to include LEDs for a twelve-hour time display. But I did plan to populate the entire grid with diffusers (ping-pong-balls) because it will look a bit cooler that way. I also planned to include a ring round the entire display so my final pixel area will be 15&#215;7. Note the numbers below each digit, which are an LED count.</p>
<p>I also did quite a bit of planning at this point for the electronics. I need to make sure that I&#8217;m handling the current properly so that I don&#8217;t burn out any of the LEDs or chips that drive them. For now, let&#8217;s skip over the electrical issues and build the actual display.</p>
<h2>Materials</h2>
<p>First you need a box to host the project. I chose to use pegboard for the clock face because it already has accurately spaced holes that fit a 5mm LED quite snugly. The pegboard will be wrapped in a plywood frame which gives it strength, protection, and a place to mount the buttons and other hardware. You&#8217;ll also need all of the LEDs for the display (46 in my case) and ping-pong balls for the grid (105 in total).</p>
<p>From the start I wanted to complete this project with parts on hand. I already had the scrap of pegboard, and the plywood left over from building a wall-mounted desk for my office. Most of the electronic hardware was salvaged from another project (more on that later) and in the end I only had to buy ping-pong balls, hot glue, and some mounting hardware for the buttons. Here&#8217;s a list for the display itself, excluding the controller board and buttons:</p>
<ul>
<li>Pegboard for the face</li>
<li>Plywood for the frame</li>
<li>LEDs</li>
<li>Ribbon cable</li>
<li>22 gauge hookup wire</li>
<li>IDC connectors</li>
<li>KK connectors or another 0.1&#8243; pitch connector</li>
<li>Woodworking tools: table saw, circular saw, straight edge</li>
<li>Pocket screw jig and pocket screws</li>
<li>Hot glue gun and hot glue</li>
<li>Soldering supplies</li>
</ul>
<h2>Assembling the case</h2>
<p><span style="font-weight:normal;font-size:13px;"><img class="alignnone size-large wp-image-33762" title="IMG_1158" src="http://hackadaycom.files.wordpress.com/2011/01/img_1158.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></span></p>
<p><span style="font-weight:normal;font-size:13px;">I first started by taping out the digits on a piece of pegboard, then clamped a straight edge along the cut lines and used a circular saw to trim it to size.</span></p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1157.jpg?w=470"><img class="alignnone size-large wp-image-33761" title="IMG_1157" src="http://hackadaycom.files.wordpress.com/2011/01/img_1157.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Pegboard is usually a bit flimsy so you should build a frame around it to make it rigid. I&#8217;ve just got some rudimentary woodworking tools so I&#8217;ve ripped 3&#8243; plywood pieces, cut them to length with butt joints, and then cut a dado the width of the saw blade to receive the pegboard.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1160.jpg"><img class="alignnone size-large wp-image-33763" title="IMG_1160" src="http://hackadaycom.files.wordpress.com/2011/01/img_1160.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>I bought this Kreg pocket screw jig when I was building my desk and I love it. Here I&#8217;ve cut pocket screw holes into the ends of the long rails. They butt up to the side rails and two screws will hold them nice and tight. You can get this jig for around $20, but if you don&#8217;t want to spend the money just pre-drill and countersink some holes from the outside and use wood screws to hold your frame together.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1162.jpg"><img class="alignnone size-large wp-image-33764" title="IMG_1162" src="http://hackadaycom.files.wordpress.com/2011/01/img_1162.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Here&#8217;s the outside of the finished box. All-in-all I&#8217;ve put about 90 minutes into the project. The majority of the time was spent measuring carefully, which you should take seriously. One wrong cut could cause an impromptu field trip for more supplies.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1164.jpg"><img class="alignnone size-large wp-image-33765" title="IMG_1164" src="http://hackadaycom.files.wordpress.com/2011/01/img_1164.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>There&#8217;s plenty of room inside for the wiring and controller board. Now to start inserting the LEDs.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1166.jpg"><img class="alignnone size-large wp-image-33766" title="IMG_1166" src="http://hackadaycom.files.wordpress.com/2011/01/img_1166.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>I had a great time building the <a href="http://hackaday.com/2010/10/26/70-led-matrix-in-a-jack-o-lantern/">LED Jack-o-lantern</a> but that hardware has gone unused since Halloween night. Here I&#8217;ve desoldered all of the components from the protoboard and clipped apart all of the LEDs, separating them by color. I&#8217;ll reuse all of the green LEDs, the transistors, pin headers, some resistors, and many of the longer wires in this project.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1168.jpg"><img class="alignnone size-large wp-image-33767" title="IMG_1168" src="http://hackadaycom.files.wordpress.com/2011/01/img_1168.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Start by pressing the LEDs into place on the back of the pegboard. They&#8217;ll be quite tight and I found this process made my fingers hurt after a while. I checked each LED using a battery and resistor to make sure I had the polarity right and that they all worked and were the same color. Above I&#8217;ve started soldering all of the cathodes for each LED using ribbon wire. The cathodes are grouped by digit, and will be connected to ground by way of an NPN transistor.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1170.jpg"><img class="alignnone size-large wp-image-33769" title="IMG_1170" src="http://hackadaycom.files.wordpress.com/2011/01/img_1170.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Here all of the cathode connections have been made. I&#8217;ve used hook-up wire to run each of the four buses to one side, and inserted them together into a 4-channel KK connector. This will make it easy to plug the low end of the digits into a pin header on the control board. Don&#8217;t forget to hot-glue these wires to the pegboard as a form of strain relief.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1172.jpg"><img class="alignnone size-large wp-image-33770" title="IMG_1172" src="http://hackadaycom.files.wordpress.com/2011/01/img_1172.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Now it&#8217;s time to solder the anodes for the same pixel in each digit together. I used the waste pieces of ribbon cable from the last step in the process to do this. In the upper right you can see two ribbon cables which have IDC connectors hanging over the side. The top bundle drives seven of the 13 LEDs in each digit. The bottom bundle drives the remaining six. These will plug into double pin headers on the driver board, connecting the pixels through a resistor to a pair of shift register. The colon in between hours and minutes has been grouped with the hour-tens digit which only has pixels for the numeral 1.</p>
<p>Now it&#8217;s time to make sure everything works. We do need to add ping-pong balls as diffusers before the display will be finished but if there&#8217;s a problem you don&#8217;t want to have to remove the balls to fix it. Let&#8217;s build and test the control circuitry now.</p>
<h2>Electrical Design</h2>
<p>I wanted to use parts on hand for this project. I&#8217;ve got plenty of 595 shift registers but there&#8217;s one problem with those; the supply pin has a 70 mA absolute maximum rating. I can get around that limitation if I run my LEDs no higher than 10 mA each and split the 13 total pixels between two shift registers.</p>
<p>That takes care of the high side. To switch the low side of each digit I&#8217;ve sourced 2N3904 NPN transistors. They have a collector current limit of 200 mA which will have no issue sinking the 130 mA max coming off of a digit when the numeral 8 is displayed.</p>
<p>The multiplexing is handled by an ATmega168 running on the internal RC oscillator at 8 MHz. This makes it a breeze to drive the display without any visible artifacts, but it&#8217;s lousy at precision time keeping. I had a Maxim DS3232 real time clock on hand that will keep very accurate track of time. It has a backup battery which will keep time when power to the display is lost. This is perfect since I intend to power this from the bench outlets in my shop. I turn them off when I&#8217;m not working and that means the clock will only be illuminated when someone&#8217;s there to see it.</p>
<p>This how-to is intended to focus on the physical build and not the electronic design. If you make your own it would be much better to choose shift registers that offer constant current on each pin. This way the LEDs can be brighter and there&#8217;s no need to worry about pushing up against the current ratings of the shift registers. Most constant current drivers are low side, which means you would then use P-channel MOSFETS, PNP transistors, or similar to switch the high side of each digit. Basically the opposite of what I&#8217;ve done here.</p>
<p>Check out the <a href="http://hackaday.com/2010/10/26/70-led-matrix-in-a-jack-o-lantern/">LED pumpkin matrix</a> for more on designing your own multiplexed displays. As for constant current drivers, there&#8217;s some nice hardware used in <a href="http://hackaday.com/2011/01/27/conways-wall-of-life-and-whiteboard-emporium/">this whiteboard/LED marquee project</a>. Just don&#8217;t feel locked into Maxim parts as they can often be difficult to source.</p>
<h2>Building the controller</h2>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/ping-pong-clock.png"><img class="alignnone size-large wp-image-33809" title="ping-pong-clock" src="http://hackadaycom.files.wordpress.com/2011/01/ping-pong-clock.png?w=470&#038;h=286" alt="" width="470" height="286" /></a></p>
<p>Having designed the circuit it&#8217;s just a matter of wiring it up and writing some firmware.</p>
<p><img class="alignnone size-large wp-image-33807" title="edited-breadboard-circuit" src="http://hackadaycom.files.wordpress.com/2011/01/edited-breadboard-circuit.jpg?w=470&#038;h=453" alt="" width="470" height="453" /></p>
<p>Here&#8217;s the breadboarded circuit. You can see the two IDC connectors jumpered with resistors to the shift registers on the breadboard. The yellow wires to the right connect the digit cathodes to their respective transistors. In the foreground is the <a href="http://hackaday.com/2010/04/29/surface-mount-breakout-boards/">DS3232 on a breakout board</a>. You can see the <a href="http://hackaday.com/2011/01/11/button-cell-connectors-for-breadboarding/">coin cell in its hacked holder</a>. I&#8217;m using a multimeter to measure the frequency of the 1 Hz square wave this chip provides, and a Bus Pirate to see what&#8217;s going on with the i2c communications. Now that it&#8217;s working, I just needed to find a more permanent solution.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1180.jpg"><img class="alignnone size-large wp-image-33772" title="IMG_1180" src="http://hackadaycom.files.wordpress.com/2011/01/img_1180.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Voila! The top of the finished controller board. Note the two pin sockets to received the DS3232 breakout board.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1182.jpg"><img class="alignnone size-large wp-image-33773" title="IMG_1182" src="http://hackadaycom.files.wordpress.com/2011/01/img_1182.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>And the point-to-point soldering on the bottom. This took perhaps four hours to complete. It&#8217;s winter right now and I don&#8217;t like using Cupric Chloride inside to etch circuit boards so I went this route.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1184.jpg"><img class="alignnone size-large wp-image-33774" title="IMG_1184" src="http://hackadaycom.files.wordpress.com/2011/01/img_1184.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>The last piece of the puzzle is adding buttons. I knew I had this old circuit board from a Sony shelf stereo system.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1186.jpg"><img class="alignnone size-large wp-image-33775" title="IMG_1186" src="http://hackadaycom.files.wordpress.com/2011/01/img_1186.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>I needed four buttons so I used a Dremel to separate this segment from the larger board. I added two holes to use for mounting and soldered wires (reused from the pumpkin) terminating in another KK connector.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1188.jpg"><img class="alignnone size-large wp-image-33776" title="IMG_1188" src="http://hackadaycom.files.wordpress.com/2011/01/img_1188.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Here&#8217;s a view of the underside of the button board. I had to remove the resistors that connected the buttons into a matrix and I used hot glue for strain relief.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1191.jpg"><img class="alignnone size-large wp-image-33777" title="IMG_1191" src="http://hackadaycom.files.wordpress.com/2011/01/img_1191.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>After a trip to Ace Hardware I was able to install the button board. I started by tracing the location of the buttons on a piece of paper, then using that as a template to drill holes through the top of the plywood case. You can just make out the ragged hole above each button.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1193.jpg"><img class="alignnone size-large wp-image-33778" title="IMG_1193" src="http://hackadaycom.files.wordpress.com/2011/01/img_1193.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>While and the hardware store I picked up a dowel as well. Here I&#8217;ve cut it to length, eased the top edge with some sand paper (I spun the dowel in a power drill for that), and added a hole for a retaining pin.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1195.jpg"><img class="alignnone size-large wp-image-33779" title="IMG_1195" src="http://hackadaycom.files.wordpress.com/2011/01/img_1195.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Once installed I glued a finish nail into the hole of each button dowel so they won&#8217;t fall out.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1196.jpg"><img class="alignnone size-large wp-image-33780" title="IMG_1196" src="http://hackadaycom.files.wordpress.com/2011/01/img_1196.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Here&#8217;s the finished product. I love it!</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1198.jpg"><img class="alignnone size-large wp-image-33781" title="IMG_1198" src="http://hackadaycom.files.wordpress.com/2011/01/img_1198.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Everything&#8217;s working, time to add the diffusers. I originally planned to buy ping-pong balls from the dollar store but they only had six 9-packs. I ended up ordering a gross online. I drilled a hole in each ball for the LED to stick through, then used hot glue to attach them. Make sure the drill bits you use for this are nice and sharp.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1199.jpg"><img class="alignnone size-large wp-image-33782" title="IMG_1199" src="http://hackadaycom.files.wordpress.com/2011/01/img_1199.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>Here&#8217;s a test with the lights on.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1201.jpg"><img class="alignnone size-large wp-image-33783" title="IMG_1201" src="http://hackadaycom.files.wordpress.com/2011/01/img_1201.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>And another with the lights off.</p>
<h2>Conclusion</h2>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1225.jpg"><img class="alignnone size-large wp-image-33813" title="IMG_1225" src="http://hackadaycom.files.wordpress.com/2011/01/img_1225.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1221.jpg"><img class="alignnone size-large wp-image-33811" title="IMG_1221" src="http://hackadaycom.files.wordpress.com/2011/01/img_1221.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/01/img_1223.jpg"><img class="alignnone size-large wp-image-33812" title="IMG_1223" src="http://hackadaycom.files.wordpress.com/2011/01/img_1223.jpg?w=470&#038;h=353" alt="" width="470" height="353" /></a></p>
<p>I&#8217;m quite happy with the way things turned out. If you build one yourself take into consideration the use of constant current LED drivers as I mentioned before. Also, I had crystal clear LED packages, you may want to experiment with diffuse packages. You can see that there is a bright point on the top of each ping-pong ball because of this. On the other hand, in bright light you can still make out the time because of those bright spots, so test this out before you purchase all of your parts.</p>
<p>When all is said and done the display portion of this was easy and quick to build. It took much longer to solder the control board and to finish writing the firmware. A link the git repository is included in the resources section below.</p>
<h2>Resources</h2>
<p><a href="https://github.com/szczys/Ping-Pong-Clock">Source code repository</a></p>
<h2>Follow Me</h2>
<p><a href="http://twitter.com/szczys">@szczys</a></p>
<br />Filed under: <a href='http://hackaday.com/category/clock-hacks/'>clock hacks</a>, <a href='http://hackaday.com/category/how-to/'>how-to</a>, <a href='http://hackaday.com/category/led-hacks/'>led hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/33757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/33757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/33757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/33757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/33757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/33757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/33757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/33757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/33757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/33757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/33757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/33757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/33757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/33757/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=33757&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/01/31/how-to-build-a-ping-pong-ball-display/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/ping-pong-clock-banner-image.jpg" medium="image">
			<media:title type="html">ping-pong-clock-banner-image</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/pong-led-display.jpg" medium="image">
			<media:title type="html">pong-led-display</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1158.jpg?w=470" medium="image">
			<media:title type="html">IMG_1158</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1157.jpg?w=470" medium="image">
			<media:title type="html">IMG_1157</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1160.jpg?w=470" medium="image">
			<media:title type="html">IMG_1160</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1162.jpg?w=470" medium="image">
			<media:title type="html">IMG_1162</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1164.jpg?w=470" medium="image">
			<media:title type="html">IMG_1164</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1166.jpg?w=470" medium="image">
			<media:title type="html">IMG_1166</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1168.jpg?w=470" medium="image">
			<media:title type="html">IMG_1168</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1170.jpg?w=470" medium="image">
			<media:title type="html">IMG_1170</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1172.jpg?w=470" medium="image">
			<media:title type="html">IMG_1172</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/ping-pong-clock.png?w=470" medium="image">
			<media:title type="html">ping-pong-clock</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/edited-breadboard-circuit.jpg?w=470" medium="image">
			<media:title type="html">edited-breadboard-circuit</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1180.jpg?w=470" medium="image">
			<media:title type="html">IMG_1180</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1182.jpg?w=470" medium="image">
			<media:title type="html">IMG_1182</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1184.jpg?w=470" medium="image">
			<media:title type="html">IMG_1184</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1186.jpg?w=470" medium="image">
			<media:title type="html">IMG_1186</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1188.jpg?w=470" medium="image">
			<media:title type="html">IMG_1188</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1191.jpg?w=470" medium="image">
			<media:title type="html">IMG_1191</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1193.jpg?w=470" medium="image">
			<media:title type="html">IMG_1193</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1195.jpg?w=470" medium="image">
			<media:title type="html">IMG_1195</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1196.jpg?w=470" medium="image">
			<media:title type="html">IMG_1196</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1198.jpg?w=470" medium="image">
			<media:title type="html">IMG_1198</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1199.jpg?w=470" medium="image">
			<media:title type="html">IMG_1199</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1201.jpg?w=470" medium="image">
			<media:title type="html">IMG_1201</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1225.jpg?w=470" medium="image">
			<media:title type="html">IMG_1225</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1221.jpg?w=470" medium="image">
			<media:title type="html">IMG_1221</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/img_1223.jpg?w=470" medium="image">
			<media:title type="html">IMG_1223</media:title>
		</media:content>
	</item>
		<item>
		<title>The OpenServo Project</title>
		<link>http://hackaday.com/2011/01/28/the-openservo-project/</link>
		<comments>http://hackaday.com/2011/01/28/the-openservo-project/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 20:00:54 +0000</pubDate>
		<dc:creator>James Munns</dc:creator>
				<category><![CDATA[parts]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[openservo]]></category>
		<category><![CDATA[servo]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=33663</guid>
		<description><![CDATA[When it comes to using servos in projects, there is a definite distinction between the cheap ones and the expensive high power and precision models. The OpenServo project gives you a couple options for enhancing your servo experience. By replacing the control board with a new one based on a familiar microcontroller, a whole new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=33663&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-33669" title="tutorial_005" src="http://hackadaycom.files.wordpress.com/2011/01/tutorial_005.jpg" alt="" width="470" height="279" /></p>
<p>When it comes to using servos in projects, there is a definite distinction between the cheap ones and the expensive high power and precision models. The <a href="http://www.openservo.com/FrontPage">OpenServo project</a> gives you a couple options for enhancing your servo experience. By replacing the control board with a new one based on a <a href="http://hackaday.com/category/arduino-hacks/">familiar</a> microcontroller, a whole new <a href="http://www.openservo.com/DocAboutOpenServo">set of features</a> can be attained. For those of you out there with a need for servos like these, you can buy the pre-built replacement board (unfortunately sold out right now), or build your own from the provided schematic, BOM, and source code.</p>
<br />Filed under: <a href='http://hackaday.com/category/parts/'>parts</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/33663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/33663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/33663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/33663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/33663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/33663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/33663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/33663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/33663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/33663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/33663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/33663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/33663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/33663/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=33663&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/01/28/the-openservo-project/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jahmez</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/tutorial_005.jpg" medium="image">
			<media:title type="html">tutorial_005</media:title>
		</media:content>
	</item>
		<item>
		<title>Magnetic digital scale</title>
		<link>http://hackaday.com/2011/01/21/magnetic-digital-scale/</link>
		<comments>http://hackaday.com/2011/01/21/magnetic-digital-scale/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 18:29:58 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[hall effect]]></category>
		<category><![CDATA[magnet]]></category>
		<category><![CDATA[scale]]></category>
		<category><![CDATA[solenoid]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=33235</guid>
		<description><![CDATA[Above you see a solenoid being used as a digital scale. The magnetic field from the coil in the base levitates the platform above, where a load to be measured is place. This floating platform has a permanent magnet in it, hovering above a hall effect sensor in the base. As the distance between that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=33235&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-33236" title="magnetic-scale" src="http://hackadaycom.files.wordpress.com/2011/01/magnetic-scale-e1295626004635.jpg" alt="" width="470" height="353" /></p>
<p>Above you see <a href="http://dev.frozeneskimo.com/embedded_projects/levitating_digital_scale">a solenoid being used as a digital scale</a>. The magnetic field from the coil in the base levitates the platform above, where a load to be measured is place. This floating platform has a permanent magnet in it, hovering above a hall effect sensor in the base. As the distance between that magnet and the sensor changes, the measurable magnetic field changes as well. The hall effect sensor is linear so the measured value can easily be correlated with a weight. In the video after the break [Vsergeev] demonstrates the device using test weights to show off its 0.5 gram resolution. He thinks that with a few hardware improvements he could easily achieve 0.1g accuracy.</p>
<p><span id="more-33235"></span><span style="text-align:center; display: block;"><a href="http://hackaday.com/2011/01/21/magnetic-digital-scale/"><img src="http://img.youtube.com/vi/qcosP8ycwFo/2.jpg" alt="" /></a></span></p>
<br />Filed under: <a href='http://hackaday.com/category/tool-hacks/'>tool hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/33235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/33235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/33235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/33235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/33235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/33235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/33235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/33235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/33235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/33235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/33235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/33235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/33235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/33235/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=33235&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/01/21/magnetic-digital-scale/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/01/magnetic-scale-e1295626004635.jpg" medium="image">
			<media:title type="html">magnetic-scale</media:title>
		</media:content>
	</item>
		<item>
		<title>Ice Tube Clock, meet the ChronoDot</title>
		<link>http://hackaday.com/2010/12/09/ice-tube-clock-meet-the-chronodot/</link>
		<comments>http://hackaday.com/2010/12/09/ice-tube-clock-meet-the-chronodot/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 13:00:20 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[clock hacks]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[chronodot]]></category>
		<category><![CDATA[DS3231]]></category>
		<category><![CDATA[ice tube clock]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=31502</guid>
		<description><![CDATA[[Alex] ramped up the precision of his timepiece by adding a ChronoDot to the Ice Tube Clock. These two items are among our favorites; the Ice Tube Clock for its old-style multi-digit display, and the ChronoDot for combining a DS3231, battery, and components into a nice small package. There is a schematic link at the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=31502&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-31503" title="ice-tube-gets-chronodot" src="http://hackadaycom.files.wordpress.com/2010/12/ice-tube-gets-chronodot.jpg" alt="" width="470" height="392" /></p>
<p>[Alex] ramped up the precision of his timepiece by <a href="http://brainlubeonline.com/My_Modified_IceCube_Clock_with_TCXO/BrainLubeonlines_Modified_IceCube_Clock_with_a_TCXO.html">adding a ChronoDot to the Ice Tube Clock</a>. These two items are among our favorites; the <a href="http://hackaday.com/2009/08/25/learn-from-the-ice-tube-clock/">Ice Tube Clock</a> for its old-style multi-digit display, and the <a href="http://hackaday.com/2009/10/27/parts-chronodot-rtc-module-ds3231/">ChronoDot</a> for combining a DS3231, battery, and components into a nice small package.</p>
<p>There is a schematic link at the very bottom left of [Alex's] writeup. He mentions that he depopulated the clock crystal and its capacitor pair from the board and patched into the clock input on the AVR. A 100K pull-up resistor is included in the wiring as called for in the DS3231 datasheet. Although not specifically referenced, we assume that [Alex] reprogrammed the ATmega168 clock select fuses to use an external clock signal.</p>
<p>Now he can sit back knowing that the clock will be within 10 seconds per year accuracy.</p>
<br />Filed under: <a href='http://hackaday.com/category/clock-hacks/'>clock hacks</a>, <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/31502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/31502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/31502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/31502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/31502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/31502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/31502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/31502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/31502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/31502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/31502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/31502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/31502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/31502/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=31502&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/12/09/ice-tube-clock-meet-the-chronodot/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/12/ice-tube-gets-chronodot.jpg" medium="image">
			<media:title type="html">ice-tube-gets-chronodot</media:title>
		</media:content>
	</item>
		<item>
		<title>AVR Programming 04: Writing code, etc.</title>
		<link>http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/</link>
		<comments>http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 22:00:55 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[avr programming]]></category>
		<category><![CDATA[bicycle]]></category>
		<category><![CDATA[bike]]></category>
		<category><![CDATA[light]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=30193</guid>
		<description><![CDATA[Welcome back to this fourth and final installment of the series. The first three parts should have been enough to get you off the ground, but a few more learning examples wouldn&#8217;t hurt. It&#8217;s also a good time to discuss some of the other things these little chips can do. Join me after the break [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=30193&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-29579" title="avr-programming-for-everyone" src="http://hackadaycom.files.wordpress.com/2010/10/avr-programming-for-everyone.jpg" alt="" width="470" height="150" /><br />
Welcome back to this fourth and final installment of the series. The first three parts should have been enough to get you off the ground, but a few more learning examples wouldn&#8217;t hurt. It&#8217;s also a good time to discuss some of the other things these little chips can do. Join me after the break to:</p>
<ul>
<li>Expand the sample code, adding features to our simple program while I challenge you to write the code yourself.</li>
<li>Discuss AVR fuse bits, how to use them, and what to watch out for</li>
<li>Touch on some of the peripherals you&#8217;ll come across in these chips</li>
</ul>
<p>As a grand flourish to the series, I&#8217;ve used the example hardware from this final part to build a bicycle tail light. Hopefully this will inspire you to create something much more clever.</p>
<p><strong>Series roadmap:</strong></p>
<ul>
<li><a title="Permanent Link to AVR Programming 01: Introduction" rel="bookmark" href="http://hackaday.com/2010/10/23/avr-programming-introduction/">AVR Programming 01: Introduction</a></li>
<li><a title="Permanent Link to AVR Programming 01: Introduction" rel="bookmark" href="http://hackaday.com/2010/10/23/avr-programming-introduction/"></a><a title="Permanent Link to AVR Programming 02: The Hardware" rel="bookmark" href="http://hackaday.com/2010/10/25/avr-programming-02-the-hardware/">AVR Programming 02: The Hardware</a></li>
<li><a title="Permanent Link to AVR Programming 02: The Hardware" rel="bookmark" href="http://hackaday.com/2010/10/25/avr-programming-02-the-hardware/"></a><a title="Permanent Link to AVR Programming 03: Reading and compiling code" rel="bookmark" href="http://hackaday.com/2010/11/05/avr-programming-03-reading-and-compiling-code/">AVR Programming 03: Reading and compiling code</a></li>
<li><a href="http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/">AVR Programming 04: Writing code</a></li>
</ul>
<p><span id="more-30193"></span></p>
<h2>Adding to the Example Hardware</h2>
<p>The example code that I&#8217;ve been working with on the last two parts of this tutorial is a bit boring. It makes one LED blink on and off at a rate of about 1 Hz. That LED was connected to the pin for PD0, so let&#8217;s start out by adding an LED and resistor to the rest of the PORT D pins for a total of 8 LEDs. We should also talk about inputs, so let&#8217;s add a switch on PC0. Here&#8217;s a schematic showing our changes:</p>
<p><strong><a href="http://hackadaycom.files.wordpress.com/2010/11/m168_led_button.png"><img class="alignnone size-large wp-image-30819" title="m168_led_button" src="http://hackadaycom.files.wordpress.com/2010/11/m168_led_button.png?w=450&#038;h=192" alt="" width="450" height="192" /></a><br />
</strong></p>
<p>I moved the original LED over to some open space on the right side of the breadboard. I&#8217;m connecting the cathode to the ground rail on the bottom, jumping the trench with a resistor, and connecting a jumper from that resistor to the Port D pins on the microcontroller. I organized the LEDs in ascending order from right to left making it easy to address them when writing code:</p>
<p><img class="alignnone size-full wp-image-30812" title="avrtut-8leds" src="http://hackadaycom.files.wordpress.com/2010/11/avrtut-8leds.jpg" alt="" width="470" height="353" /></p>
<p>If you know your <a href="http://www.google.com/images?hl=en&amp;q=resistor+color+code&amp;um=1&amp;ie=UTF-8&amp;source=univ&amp;ei=WOziTOSAB8Hsngfqr7jODg&amp;sa=X&amp;oi=image_result_group&amp;ct=title&amp;resnum=2&amp;ved=0CDUQsAQwAQ&amp;biw=1024&amp;bih=441">resistor color codes</a> you&#8217;ll notice that the Brown-Green-Red resistors I&#8217;m using are 1.5 kOhms, strangling the current to a tiny trickle for LEDs. Well, I&#8217;m using super bright LEDs, and these resistors were the first that I pulled out. They work just fine for prototyping but should be replaced with a correctly calculated value on a finished product.</p>
<p>Next I hooked up a button. Digital inputs on microcontrollers need to have a value of 0V or VCC (input voltage which is 5V in our case). If they don&#8217;t have a clear value they are said to be &#8220;floating&#8221; which can lead to false button readings and other unhappy occurences. We need to set up hardware that will force a value of 0V or 5V at all times. This turns out to be quite simple. By connect the switch from the pin to ground and a resistor from the pin to VCC (called a pull-up resistor) there will always be a very small 5V current trickling into the pin, except when an unrestricted path to ground is created by pressing the button. We don&#8217;t even need our own resistor as there&#8217;s one inside the microcontroller that we&#8217;ll take advantage of. Here&#8217;s a schematic showing what this connection, along with the internal pull-up resistor, looks like:</p>
<p><img class="alignnone size-full wp-image-30818" title="button_conn_sch" src="http://hackadaycom.files.wordpress.com/2010/11/button_conn_sch.jpg" alt="" width="470" height="240" /></p>
<p>That description is a mouthful but all we&#8217;re really doing is placing a button between PC0 and Ground. Pin 23 is PC0 on the ATmega168 and the pin right next to that (pin 22) is GND. I&#8217;ve connected a switch accordingly. In the following image please note that Pin 22 is connected with a jumper wire to the ground rail above it, but is obscured by the black wire from the push button:</p>
<p><img class="alignnone size-full wp-image-30814" title="avrtut-btn-added" src="http://hackadaycom.files.wordpress.com/2010/11/avrtut-btn-added.jpg" alt="" width="470" height="353" /></p>
<p>And finally, I want to make connections to the chip for In-System Programming. I like to do this using <a href="http://hackaday.com/2010/05/07/5x2-patch-board/">a patch board that I created</a>. This lets me use a 10-pin IDC cable for easy connection to my programmer:</p>
<p><img class="alignnone size-full wp-image-30815" title="avrtut-btn-and-isp" src="http://hackadaycom.files.wordpress.com/2010/11/avrtut-btn-and-isp.jpg" alt="" width="470" height="353" /></p>
<p>That&#8217;s it. I plan to use this hardware with several different firmware examples so double-check your wiring and then start writing code.</p>
<h2>Writing Code</h2>
<p>Time to practice writing your own code. I have come up with <a href="https://github.com/Hack-a-Day/had_AVRtut_4">four firmware examples</a> ranging in difficulty from &#8220;Hello World&#8221; to &#8220;Damn That&#8217;s Slick&#8221;. I&#8217;ll discuss each of them briefly but along the way you should try to write your own code, using my examples as&#8230; examples. The best way to learn to code is to write a small portion of code, let the compiler yell at you for messing up, and then figure out how to fix it.</p>
<p><strong>Blinking all 8 (8led_1hz)</strong></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/"><img src="http://img.youtube.com/vi/ssBfFUoLjFI/2.jpg" alt="" /></a></span>
<p>First thing&#8217;s first, can <em><strong>you</strong></em> make the <a href="https://github.com/Hack-a-Day/had_AVRtut_2">example code from Part 2</a> blink all 8 LEDs instead of just one?</p>
<p>There&#8217;s really only two things that you need to change from the original to make this happen. First, when setting up the input/output, make all of the pins on Port D outputs, then turn them all on. Second, when toggling the bits in the Interrupt Service Routine use a bitmask that affects all eight bits.</p>
<p><a href="https://github.com/Hack-a-Day/had_AVRtut_4">The source package for this part</a> of the series includes this alteration. Grab a copy of it and look at the 8led_1hz code. In it you&#8217;ll find these changes:</p>
<p><pre class="brush: cpp; wrap-lines: false;">  DDRD |= 0xFF;			//Set PortD pins as an outputs
  PORTD |= 0xFF;		//Set PortD pins high to turn on LEDs
</pre></p>
<p><pre class="brush: cpp; wrap-lines: false;">  PORTD ^= 0xFF;		//Use xor to toggle the LEDs</pre></p>
<p>As you can see, both portions of code use 0xFF as a bit mask. This is a byte containing all ones, which will manipulate every pin on the registers to which we apply it. Before I had shifted a bit using this:</p>
<pre style="padding-left:30px;">'1&lt;&lt;0'</pre>
<p>It resulted in a bit mask of 0&#215;01, protected the upper seven bits from being changed during register manipulation.</p>
<p><strong>Make the LEDs do something interesting (m168_led_effects)</strong></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/"><img src="http://img.youtube.com/vi/d-wyP7iYaWg/2.jpg" alt="" /></a></span>
<p>Now I&#8217;m going to take a big step forward in C code difficulty. But I challenge you to develop three different types of LED effects by yourself:</p>
<ul>
<li>A binary counter which counts up at 1 bit per second</li>
<li>A flasher that alternates lighting every other LED</li>
<li><a href="http://www.youtube.com/watch?v=NPAqGgYpb4A">Larson scanner</a> (a simple one, doesn&#8217;t need to use PWM)</li>
</ul>
<p>You&#8217;ll find my example code in the m168_led_effects directory. Here&#8217;s some of the new things I&#8217;m using in my code:</p>
<p style="padding-left:30px;"><strong>Definitions:</strong> I&#8217;m using definitions for common settings and for I/O pins, ports, and direction registers. These are constants that the compiler will replace with appropriate values but they make your job much easier. If you get most of the way into a project and realize you need to change some of the hardware this will make it simple to do. Need to change from Port D to Port C? No problem, change the #define and the rest of the code will still work</p>
<p style="padding-left:30px;"><strong>Delay:</strong> AVR libc has a nice delay utility called delay.h. You can see that I&#8217;ve included it at the top of the source file and also written a function called delay_ms(). This is a moderately accurate way to mark the passage of time. The drawback to using this is that you are literally wasting time when the processor could be doing other things. Still, it&#8217;s simple and if you&#8217;re new to microcontrollers you&#8217;ll probably find yourself using this frequently at first.</p>
<p>Also notable in this version of the code is my use of functions to take the complexity out of MAIN. I like to do this when I can to make program flow more readable. If you use descriptive function names it will be easy for others to see how the firmware works just by looking at main. This is also why I comment my code quite a lot. Not just for others, but so I can read it quickly if I come back to it later and don&#8217;t remember what I originally wrote the program to do.</p>
<p>Before we move on here&#8217;s a quick synopsis of how I solved the three goals:</p>
<ul>
<li>When displaying a binary counter at 1Hz I simply start Timer 2 the same way I did for the blinking LED in Part 2 of the tutorial. Each time it fires I don&#8217;t toggle the pins, but set the entire port to an 8-bit variable value while incrementing it at the same time. The ++binary_counter increments that value just before it sets Port D. It is crucial that this value be a global variable using the keyword &#8216;volatile&#8217; because it is changed by both the ISR and in the main loop. If you don&#8217;t make it volatile the compiler might optimize the code in a way that disturbs or disrupts the intended functionality.</li>
<li>Creating an alternating flasher is much the same as toggling a single LED. I set up for the effect by instantiating a variable with every-other bit as 1. When using an exclusive OR operator (XOR) on this value, all of the bits will flip. I could have set up an interrupt with a shorter delay than the 1 Hz interrupt to take care of this but for learning purposes I used a delay instead.</li>
<li>The Larson scanner is a classic bit of blinky goodness. The core function is to illuminate one LED and sweep it back and forth. To do this I just created a loop to shift the bits, waiting after each change. Once the LED on the end is lit the program leaves the loop and enters another one to shift bits the other way. The same could have been accomplished with a variable that keeps track of which direction the LED is moving, testing during each iteration.</li>
</ul>
<p>When you&#8217;ve read and understood how this code works it is time to get the button up and running.</p>
<p><strong>Make the button do something (m168_led_button)</strong></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/"><img src="http://img.youtube.com/vi/N7AJeXsk_KQ/2.jpg" alt="" /></a></span>
<p>We brought a button to the party, let&#8217;s alter our LED effects so that the button is used to change between the three possibilities. If you&#8217;ve never written code for a button input before there&#8217;s little chance you&#8217;ll be able to pull this off yourself, so open up the code in the m168_led_button folder and lets walk through it.</p>
<p style="padding-left:30px;"><strong>Debounce:</strong> Buttons often register more than one press if not handled correctly, a process called debouncing. There is a hardware fix for this, but you can learn about that on your own time. Recently, I gathered a <a href="http://hackaday.com/2010/11/09/debounce-code-one-post-to-rule-them-all/">post full of different debounce code</a>, but <a href="http://hackaday.com/2010/10/13/open-call-send-us-your-debounce-code/">the one I almost always use</a> is based on code by [Peter Dannegger]. It relies on several parts:</p>
<ul>
<li>Code to start a timer with an overflow interrupt</li>
<li>An ISR to service the timer overflow, resetting the timer for 10ms interrupts and polling the button pin.</li>
<li>A bit mask and pin definitions that identify how the buttons are hooked up</li>
<li>A function used to check if a button press has been registered</li>
<li>Code to check that function and act when a button has been pressed.</li>
</ul>
<p>The magic is in the ISR debounce code. It flips bits in a binary counter to register four successive button press readings totalling 40ms. That signals a legitimate button press and when the get_key_press function is called it will return a populated key mask. To help understand how this debounce code works, I have included a code example called button_debounce. This has been slimmed down to include only the code used to debounce. Pressing the button will toggle the LEDs.</p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/"><img src="http://img.youtube.com/vi/PjI0GsT0bVI/2.jpg" alt="" /></a></span>
<p>During the hardware setup I talked about using the internal pull-up resistors. I have to remember to set those up at the beginning of the program or the input pin will be floating. The datasheet talks about this on page 71. When a pin is set to input using the Data Direction Register, writing a high value to the Port bit for that pin will enable the pull-up resistor. From there the current status of the pin can be grabbed from the appropriate Pin register. Notice the ISR used for debouncing reads KEY_PIN, which is defined as the PINC register at the top of the source code. You don&#8217;t have to read the Pin register because the ISR is doing it for you.</p>
<p>My implementation of button debouncing in the m168_led_button code is just fine, but my use of the button is a hack. I should have used a state machine and gotten rid of the delay functions in the code. For simplicity I just littered calls to get_key_press throughout the code whenever I was trapping the program in a loop. I used the detection of a key press to return to main from the function the program is stuck in.</p>
<p>Pick this apart, writing simple code that you understand and slowly you will build the knowledge base necessary to understand this code as a whole.</p>
<p><strong>Creating something useful (m168_bike_light)</strong></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/"><img src="http://img.youtube.com/vi/FxZPDY5Kf-Y/2.jpg" alt="" /></a></span>
<p>I wanted to finish the code writing section with a useful application for our test hardware. Behold, a bicycle tail light. It has a button to scroll through several different red light patterns, and it uses sleep mode to shut off the LEDs and conserve battery power.</p>
<p>I&#8217;ve changed the program flow to use a state machine. This is a bit of a juggling act. I use an interrupt to set a flag called &#8216;timer&#8217;. The main loop constantly polls that flag, as well as the button, and acts accordingly. Whenever that flag is set the next step of the LED effect is performed.</p>
<p>Sleep mode is also used in this example. One thing to note: when in sleep mode the chip uses almost no current, conserving batteries. But the linear power regulator still burns away like crazy. For this to be useful the code should be ported to a chip that operates at low voltages. For instance, you could use a tiny13 and two AA batteries without a regulator. Adjustments would need to be made for less pins and corrected LED resistor values, but these are not difficult changes to make. Have a look at the code in the m168_bike_light folder. The comments and your hard-earned AVR knowledge will help you understand how this works. Good luck!</p>
<p>Now I&#8217;ll move on to the discuss one of the most important parts of theses microcontrollers:</p>
<h2>AVR Fuse Bits</h2>
<p>The fuse bits are a set of registers that control some core features of the AVR line of chips. You can think of them as another type of memory, programmed separately from the code that you want to execute.</p>
<p><strong>Read the datasheet</strong></p>
<p>Fuse bits for the ATmega168 are covered starting on page 285 of <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf">the datasheet</a>. You should make yourself thoroughly familiar with this information. <span style="color:#ff0000;">Incorrectly programming these registers could render your chip useless<span style="color:#ffffff;"> unless</span></span><span style="color:#ffffff;"> you have a programmer capable of High Voltage Programming (HVP).</span></p>
<p>There are three fuse bit registers on our chip, the Extended fuse byte, the High fuse byte and the Low fuse byte. All of them use inverse logic, meaning that a &#8217;1&#8242; means the corresponding feature is NOT selected. I start every project with these registers set to the factory default, information I keep in a text file with the factory fuse defaults for all the chips I work with. At the beginning of every project I try to talk to the chip using the &#8216;-v&#8217; option of AVRdude to make sure the programmer and chip are both working correctly to save time on later debugging. Here are the ATmega168 defaults:</p>
<ul>
<li>efuse: 0b11111111 (0xFF)</li>
<li>hfuse: 0b11011111 (0xDF)</li>
<li>lfuse: 0b01100010 (0&#215;62)</li>
</ul>
<p>I&#8217;ll touch on most of these features in the next section. But of particular concern are the bits that select the clock source, and the reset disable bit. If you disable the reset pin, by accident or in order to use it as an I/O pin, you will need to use HVP or debugWire to use ISP programming again. If the clock pins are changed you will need the appropriate external clock signal, or HVP for the same reason.</p>
<p>You can program the fuse bits using AVRdude. In fact, <a href="http://www.nongnu.org/avrdude/user-manual/avrdude_6.html">there&#8217;s an example in the documentation</a>. This command will reset the fuses to the factory settings:</p>
<p><pre class="brush: cpp; wrap-lines: false;">avrdude -c dragon_isp -P usb -p m168 -U efuse:w:0xff:m -U hfuse:w:0xdf:m -U lfuse:w:0x62:m</pre></p>
<h2>AVR Peripherals (A Whirlwind Tour)</h2>
<p>Take a whirlwind tour of the features available to you on this chip. This is gonna be quick, but you already have the core skills you need. Just read the datasheet and using the Internet to connect the rest of the dots.</p>
<p><strong>EEPROM memory</strong></p>
<p>Most (if not all) of the AVR chips come with Electronically Erasable Programmable Read Only Memory. This is persistent memory that stores data between resets and when there is no power to the chip. This is where data loggers store information and often contains things like text strings, font data, etc. AVR-GCC will generate an .EEP file at compile time with any EEPROM data that you use in your programs. This needs to be programmed to the chip separately from flash data.</p>
<p><strong>Timers (Regular and Watchdog)</strong></p>
<p>Timers are where it&#8217;s at in terms of functionality. They go far beyond simply measuring time, and can be used to wake the chip up from sleep mode, to generate pulse width modulation frequencies, and much more. Some chips have asyncronous timers, like Timer/Counter 2 on the ATmega168, that can use an external clock signal separate from the other timers.</p>
<p>Also not to be missed is the Watchdog timer. These timers can save money, and even lives. They are a hardware timer enabled through the fuse bits that will reset the microcontroller if not handled in software. Why would you want to do that? Because nobody writes perfect code. When using a Watchdog timer you frequently reset its counter during successful code execution. That way if your code ever hangs or gets caught in a loop the Watchdog timer will automatically reset the device, getting you out of a software-caused bind. See <a href="http://www.ganssle.com/watchdogs.htm">what [Jack Ganssle] has to say</a> about them.</p>
<p><strong>Real time counter</strong></p>
<p>I mentioned above that Timer/Counter 2 can be run asynchronously from the rest of the timer/counters. Why is that valuable? One of the uses is as a Real Time Counter (RTC). This works in conjunction with a clock crystal to keep track of the time and date.</p>
<p><strong>Hardware PWM</strong></p>
<p>Continuing with the theme of timer/counter based featured, these chips have hardware-based pulse width modulation. PWM generates a signal between 0V and VCC by turning a pin output on and off frequently. The frequency used, and the duty cycle (ratio of high versus low over one period) are set in the registers and you don&#8217;t have to think about it again until you want to change them. This is useful for a slew of things, like dimming an LED, driving a servo motor, or generating sound on a piezo.</p>
<p><strong> </strong><strong>ADC</strong></p>
<p>If you want to measure an analog value you need an Analog-to-Digital Converter. Most AVR chips have several of these with varying degrees of precision. This enables you to do things like measure light levels using a photoresistor and reading the value of a potentiometer (using it like a settings knob).</p>
<p><strong>USART</strong></p>
<p>The ATmega168 has a Universal Synchronous and Asynchronous serial Receiver and Transmitter which allows it to communicate in many different ways. This includes serial communications like USB (by taking advantage of <a href="http://www.obdev.at/products/vusb/index.html">the V-USB stack</a>), as well as chip-to-chip communication standards like SPI, I2C, and TWI.</p>
<p><strong>SPI</strong></p>
<p>The AVR family often incorporates Serial Peripheral Interface bus communications protocols into its hardware. The USART on the ATmega168 offers master SPI functionality, used to control other chips that also use the protocol via three connections; two for data one for clock.</p>
<p><strong>I2C/TWI</strong></p>
<p>The USART also offers hardware I2C and Two Wire Interface features. Like SPI these are common chip-to-chip protocols but they use just two wires; one for data and the other for a clock signal.</p>
<p><strong>Analog comparator</strong></p>
<p>The analog comparator uses two input pins to compare analog signals. Based on their relation, the chip can be set to fire interrupts if one changes value compared to the other. The two inputs can be mapped to any of the ADC pins, but only two values can be compared at one time. I&#8217;ve never used this feature and I&#8217;m basing this description purely on what I&#8217;ve read in the datasheet. Sorry!</p>
<p><strong>Lock bits</strong></p>
<p>Any code you write to these chips can be read back and stored (albeit what comes back out is machine code, the C code we&#8217;ve been writing can never be reproduced perfectly from what you get off the chip). That can then be used to program other identical chips. But there is a feature called lock bits that can protect that code. Once set, the chip cannot be read, and depending on which bits are set it may not be able to be reprogrammed. That is, until the chip has been erased, which resets these lock bits.</p>
<p><strong>JTAG, debugWire, and High Voltage Programming</strong></p>
<p>In this tutorial we&#8217;ve been using In System Programming, but there are a few other ways to program AVR chips. JTAG is a standard hardware debugging (and programming) interface that some chips have, but the ATmega168 does not. Many of these chips can use the debugWire protocol to program and debug with just one wire communicating on the reset pin. Both JTAG and debugWire protocols are configured using the fuse bits.</p>
<p>High Voltage Programming is used to rescue chips that cannot be reached using other programming methods. There are two kinds, High Voltage Parallel Programming, like the ATmega168 uses, or High Voltage Serial Programming which chips with a low-pin count use. If you disable the Reset pin or enable debugWire, or set the clock source incorrectly in the fuse settings, HVPP or HVSP should be able to reset the fuses and rescue the &#8220;bricked&#8221; chip.</p>
<p><strong>Power and Sleep</strong></p>
<p>Microcontrollers operate so quickly there is often just wasted time as they scroll the infinite loop waiting for an interrupt to happen. If you are operating under battery power this just wastes juice. By using the power saving and sleep modes batteries can last longer. This is accomplished by turning off power hungry peripherals like the ADC, and shutting down the processor when not needed by putting it to sleep. They&#8217;re a bit tricky to understand, but often worth your while</p>
<h2>Conclusion</h2>
<p>That&#8217;s it really. I&#8217;ve had a great time writing about this. Fiddling with microcontrollers is my favorite hobby and I hope it has become yours as well. These are really very simple concepts that grow in complexity as you pile them atop each other. Just compare the original Part 2 source code with the bicycle tail light code. But that&#8217;s the fun of it. This is the inventor&#8217;s equivalent of a choose your own adventure novel. So come up with a challenge and see where it takes you!</p>
<h2>Follow Me</h2>
<p><a href="http://twitter.com/szczys">@szczys</a></p>
<h2>Resources</h2>
<p>Part 4 Firmware package: <a href="https://github.com/Hack-a-Day/had_AVRtut_4">Github repository</a></p>
<p>Atmel AVR <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf">ATmega168 Datasheet</a> (PDF)</p>
<p><a href="http://www.nongnu.org/avr-libc/user-manual/">AVR Libc manual</a></p>
<div id="_mcePaste" class="mcePaste" style="position:absolute;left:-10000px;top:1364px;width:1px;height:1px;"><a href="http://www.ganssle.com/watchdogs.htm">http://www.ganssle.com/watchdogs.htm</a></div>
<br />Filed under: <a href='http://hackaday.com/category/how-to/'>how-to</a>, <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/30193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/30193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/30193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/30193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/30193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/30193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/30193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/30193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/30193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/30193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/30193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/30193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/30193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/30193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=30193&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/10/avr-programming-for-everyone.jpg" medium="image">
			<media:title type="html">avr-programming-for-everyone</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/11/m168_led_button.png?w=450" medium="image">
			<media:title type="html">m168_led_button</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/11/avrtut-8leds.jpg" medium="image">
			<media:title type="html">avrtut-8leds</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/11/button_conn_sch.jpg" medium="image">
			<media:title type="html">button_conn_sch</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/11/avrtut-btn-added.jpg" medium="image">
			<media:title type="html">avrtut-btn-added</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/11/avrtut-btn-and-isp.jpg" medium="image">
			<media:title type="html">avrtut-btn-and-isp</media:title>
		</media:content>
	</item>
	</channel>
</rss>
