<?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; howto</title>
	<atom:link href="http://hackaday.com/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Fri, 10 Feb 2012 06:18:04 +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; howto</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>How to put your logo in a QR code</title>
		<link>http://hackaday.com/2011/08/11/how-to-put-your-logo-in-a-qr-code/</link>
		<comments>http://hackaday.com/2011/08/11/how-to-put-your-logo-in-a-qr-code/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 01:00:22 +0000</pubDate>
		<dc:creator>Brian Benchoff</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[qr code]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=51962</guid>
		<description><![CDATA[After writing this post on somone hacking QR codes, Hack A Day commenters came out in full force posting some really cool links about modifying QR codes to include a logo. I&#8217;ll fully admit I geeked out a little, but in the process I figured out some of the theory behind embedding logos in QR [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=51962&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-51976" title="Go ahead. Scan it." src="http://hackadaycom.files.wordpress.com/2011/08/banner2.png" alt="" width="470" height="250" /></p>
<p>After writing <a href="http://wp.me/pk3lN-drT">this post</a> on somone hacking QR codes, <a href="http://hackaday.com/2011/08/09/hacking-qr-codes-for-fun-and-profit/#comments">Hack A Day commenters</a> came out in full force posting some <a href="http://2d-code.co.uk/bbc-logo-in-qr-code/">really cool links</a> about modifying QR codes to include a logo. I&#8217;ll fully admit I geeked out a little, but in the process I figured out some of the theory behind embedding logos in QR codes.</p>
<p>After getting my hands on the ISO 18004 specification for QR codes, I decided to try embedding the Hack A Day skull &amp; wrenches inside a QR code. The tools I used were Photoshop, <a href="http://www.racoindustries.com/barcodegenerator/2d/qr-code.aspx">this QR code generator</a>, and Microsoft Paint (I&#8217;ve never seen a program to edit individual pixels that has a better UI, so don&#8217;t laugh).</p>
<p><span id="more-51962"></span></p>
<p>For this &#8216;how-to,&#8217; I&#8217;m going to walk through the process of modifying a Version 6 QR code. The Version 6 QR code is 41 pixels square, and is a very good balance between the amount of data that can be presented and the physical size of the code itself. The graphic below shows what is absolutely required of a Version 6 QR code standard. In practice, what is actually necessary is a little different, but I&#8217;ll just go with the specs for now.</p>
<p><img class="alignnone size-full wp-image-52046" title="blankbanner" src="http://hackadaycom.files.wordpress.com/2011/08/blankbanner1.png" alt="" width="450" height="150" /></p>
<p>Black in this graphic will <em>always</em> be black, white pixels in this graphic will <em>always</em> be white, red is a &#8220;keep out zone,&#8221; and gray is &#8220;don&#8217;t care.&#8221; The alternating black and white band on the top and left side of the QR code is the &#8216;timing pattern.&#8217; This is the little bit that divides everything on the QR code into columns and rows. The gray part of this graphic is separated into 172 8-pixel zones, as shown below:</p>
<p><img class="alignnone size-full wp-image-52031" title="coloredblankbanner" src="http://hackadaycom.files.wordpress.com/2011/08/coloredblankbanner.png" alt="" width="450" height="300" /></p>
<p style="text-align:center;"><em>If anyone wants to 4-color map theorem this, I&#8217;ll gladly update it.</em></p>
<p>Some of these zones are non-contiguous, so I drew black lines connecting the corresponding parts. Each of these 8-pixel parts translate into one byte of data in an alphanumeric QR code. Now, the million dollar question: why is knowing how the bytes are arranged in a QR code important? The answer is with a high level of error correction, about 30% of these bytes can be complete gibberish, and your phone will still be able to read the QR code. with 172 areas, that means about 51 of them can be altered in any way, shape or form.</p>
<p>So, how do we implement this? First, we start out with a crappily-drawn Hack A Day logo:</p>
<p><img class="alignnone size-full wp-image-52109" title="SMALL LOGO" src="http://hackadaycom.files.wordpress.com/2011/08/small-logo.png" alt="" width="450" height="115" /></p>
<p>It&#8217;s important to include both positive and negative space when designing this logo. If there wasn&#8217;t a white border going around the logo, the random black and white pixels would be placed right against the logo. Of course, I&#8217;m sure someone will come up with a great design that ignores this technique, but <em>I&#8217;ll just do it this way for now</em>. After overlaying the Hack A Day logo on top of the color map of the QR code, we get this:</p>
<p><img class="alignnone size-full wp-image-52110" title="overlay" src="http://hackadaycom.files.wordpress.com/2011/08/overlay1.png" alt="" width="450" height="150" /></p>
<p>Then we <em>physically count</em> the number of 8 pixel cells that are obscured by the logo. Since we&#8217;re doing a Version 6 QR code, about 51 of these cells can be covered up. It looks like this graphic is okay, so we move onto the next step: putting a real QR code in this thing.</p>
<p>I used <a href="http://www.racoindustries.com/barcodegenerator/2d/qr-code.aspx">this site</a> to generate all my QR codes for this post. It allows you to select the QR version number and the error correction level. After typing in &#8220;http://www.hackaday.com&#8221; as the code I want embedded, I ended up with this:</p>
<p><img class="alignnone size-full wp-image-51982" title="small banner" src="http://hackadaycom.files.wordpress.com/2011/08/larger-banner.png" alt="" /></p>
<p style="text-align:center;"><em>This little guy is going on our business cards.</em></p>
<p>That&#8217;s all well and good, but what if you want to put a logo in a QR code that a little bit larger than what would &#8216;normally&#8217; be permitted? What if, for example, you wanted to tread into the timing area on the top and left side of a QR code? This is where design comes in. If a logo already has alternating black and white pixels, like the AT&amp;T &#8216;Death Star&#8217; for example, it&#8217;s fairly easy to have that logo overlap the timing pattern.</p>
<p><a href="http://hackadaycom.files.wordpress.com/2011/08/ibm-biggest-final1.png"><img class="alignnone size-full wp-image-52158" title="IBM biggest final" src="http://hackadaycom.files.wordpress.com/2011/08/ibm-biggest-final1.png" alt="" width="470" height="325" /></a></p>
<p>Yes, I used a Version 14 QR code for this, meaning it&#8217;s 73 pixels on a side. I did come up with <a href="http://hackadaycom.files.wordpress.com/2011/08/ibm-logo1.png">smaller one</a>, but it really doesn&#8217;t look as good.</p>
<p>Notice the blue bars. QR code interpreters don&#8217;t care if a pixel is white, black, red, orange, or maroon - only contrast matters. Since the blue in Big Blue is fairly dark, it registers as a dark pixel. This can be exploited by adding both visual contrast and getting rid of the 1-pixel border that is required of a 1-bit graphic.</p>
<p><img class="alignnone size-full wp-image-52093" title="FireQR" src="http://hackadaycom.files.wordpress.com/2011/08/fireqr.png" alt="" width="450" height="175" /></p>
<p>If the Firefox logo had a white border, the logo would cover more than 30% of the QR code. Putting in a full color graphic &#8211; especially one that defines itself from a background with a dark edge like an icon &#8211; gets around the need for a white border all the way around a logo. I&#8217;m sure there are more clever ways of toying with the palette of a logo, but I&#8217;ll let that go for another time.</p>
<p>But wait, there&#8217;s more. I&#8217;m not limited to the resolution of the QR code &#8211; I can overlay stuff at a higher resolution than the QR. This observation led me to this:</p>
<p><img class="alignnone size-full wp-image-52191" title="HADbanner" src="http://hackadaycom.files.wordpress.com/2011/08/hadbanner.png" alt="" width="470" height="300" /></p>
<p>Yes, it works.</p>
<p>I&#8217;m hoping this how-to was at least a little helpful in demonstrating how logos can be put into QR codes. If you&#8217;ve got a neat example of this, leave a note in the comments or send it in on the <a href="http://hackaday.com/contact-hack-a-day/">tip line</a>.</p>
<br />Filed under: <a href='http://hackaday.com/category/how-to/'>how-to</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/51962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/51962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/51962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/51962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/51962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/51962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/51962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/51962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/51962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/51962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/51962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/51962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/51962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/51962/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=51962&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/08/11/how-to-put-your-logo-in-a-qr-code/feed/</wfw:commentRss>
		<slash:comments>121</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/08/banner2.png" medium="image">
			<media:title type="html">Go ahead. Scan it.</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/blankbanner1.png" medium="image">
			<media:title type="html">blankbanner</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/coloredblankbanner.png" medium="image">
			<media:title type="html">coloredblankbanner</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/small-logo.png" medium="image">
			<media:title type="html">SMALL LOGO</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/overlay1.png" medium="image">
			<media:title type="html">overlay</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/larger-banner.png" medium="image">
			<media:title type="html">small banner</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/ibm-biggest-final1.png" medium="image">
			<media:title type="html">IBM biggest final</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/fireqr.png" medium="image">
			<media:title type="html">FireQR</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/hadbanner.png" medium="image">
			<media:title type="html">HADbanner</media:title>
		</media:content>
	</item>
		<item>
		<title>How-To: Web server on a business card (Part 2)</title>
		<link>http://hackaday.com/2008/09/25/web-server-on-a-business-card-part-2/</link>
		<comments>http://hackaday.com/2008/09/25/web-server-on-a-business-card-part-2/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 01:26:41 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[24fj64ga002]]></category>
		<category><![CDATA[business card]]></category>
		<category><![CDATA[enc28j60]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[microchip]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[pic24f]]></category>
		<category><![CDATA[sd card]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://www.hackaday.com/?p=7672</guid>
		<description><![CDATA[This mini web server is slightly smaller than a business card. There are a lot of tiny one-board servers out there, but this is probably the smallest you can etch and solder at home. Unlike many embedded web servers, files are stored on a PC-readable SD card, not in a difficult-to-write EEPROM. Read on for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=5&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;"><img class="alignnone size-full wp-image-3749" title="wsbcv3-450" src="http://hackadaycom.files.wordpress.com/2008/09/wsbcv3-450.jpg" alt="" width="450" height="315" /></p>
<p style="text-align:left;">This mini web server is slightly smaller than a business card. There are a lot of tiny one-board servers out there, but this is probably the smallest you can etch and solder at home. Unlike many embedded web servers, files are stored on a PC-readable SD card, not in a difficult-to-write EEPROM. Read on for the web server design, or catch up on PIC 24F basics in the previous article: <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">Web server on a business card (part 1)</a>.</p>
<p style="text-align:left;">
<p style="text-align:left;"><span id="more-5"></span></p>
<p style="text-align:left;"><strong>Concept overview</strong></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-3702" title="web-server-on-a-business-ca1" src="http://hackadaycom.files.wordpress.com/2008/09/web-server-on-a-business-ca1.jpg" alt="" width="450" height="155" /></p>
<p style="text-align:left;">The goal of this project is to build a web server on a business card that serves web pages and files from a FAT formatted SD card. The server is based on a PIC 24F that connects to a TCP/IP network using the <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en022889">ENC28J60</a> ethernet <a href="http://en.wikipedia.org/wiki/MAC_Address">MAC</a>/<a href="http://en.wikipedia.org/wiki/Ethernet#Physical_layer">PHY</a>. Network layers and low-level services, such as <a href="http://en.wikipedia.org/wiki/Domain_Name_System#Address_resolution_mechanism">DNS</a> and <a href="http://en.wikipedia.org/wiki/DHCP">DHCP</a>, are handled by the Microchip TCP/IP stack. A <a href="http://en.wikipedia.org/wiki/File_Allocation_Table">FAT 12/16/32</a> formatted <a href="http://en.wikipedia.org/wiki/Sd_card">SD card</a> contains web pages and files.  A very simple <a href="http://en.wikipedia.org/wiki/Web_server">HTTP server</a> ties everything together by handling page requests on port 80, searching the SD card for requested, and serving them with the correct <a href="http://en.wikipedia.org/wiki/Content_type#Content-Type">content type</a>.</p>
<p style="text-align:left;"><strong>Hardware</strong></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-3679" title="cct-4502" src="http://hackadaycom.files.wordpress.com/2008/09/cct-4502.jpg" alt="" width="450" height="123" /></p>
<p style="text-align:left;">(<a href="http://hackadaycom.files.wordpress.com/2008/09/cct-large1.png">full size schematic .png</a>)</p>
<p style="text-align:left;"><em>Microcontroller (Microchip PIC 24FJ64GA002)</em></p>
<p style="text-align:left;">The brain of the server is a 16-bit <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en026374">PIC 24FJ64GA002</a> (IC1), a 28pin microcontroller available in several hobbyist friendly packages. Check out our <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">PIC 24F introduction</a> for more about working with this chip.</p>
<p style="text-align:left;">PIC 24Fs operate between 2 and 3.8volts, which is perfect because the ethernet chip (IC2) and SD card both run at 3.3volts. This chip has 8K of RAM, plenty for the TCP/IP stack and a few K for working with a full FAT file system. The 24FJ64 has two <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a> modules, so the SD card and ethernet IC each get a dedicated data bus.</p>
<p style="text-align:left;">The PIC processor core operates at 2.5volts, and requires a 10uF capacitor (C2) for the on-chip voltage regulator. The datasheet specifies a tantalum capacitor, but we used a low-ESR electrolytic in a prototype without incident. Every power pin needs a 0.1uF decoupling capacitor (C4,5).</p>
<p style="text-align:left;">The internal 8MHz oscillator provides a 32MHz clock source with the 4x PLL multiplier enabled. We&#8217;re also using an external 32.768KHz crystal (Q1) with 2 x 27pF capacitors (C17,18) to enable the real time clock calendar.</p>
<p style="text-align:left;">Programming connections are brought to a header (SV1). We chose to use programming pin pair three (PGx3). The master clear and reset (MCLR) function is enabled with a 2K resistor (R1) from V+  to the MCLR pin. Optionally, add <a href="http://hackaday.com/2008/09/15/tact-switches-for-your-next-project/">a button </a>(S1) from MCLR to ground for a manual reset switch.</p>
<p style="text-align:left;"><em>Ethernet connection (ENC28J60)</em></p>
<p style="text-align:left;">An <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en022889">ENC28J60</a> (IC2) handles the network physical connection (PHY) and MAC layer. The ENC28J60 needs a number of support parts beyond the typical 0.1uF decoupling capacitors (C6,7,9,10). A 25MHz crystal (Q2) and 2 x 27pf capacitors (C15,16) provide a clock signal. The internal core voltage regulator requires a 10uF tantalum capacitor (C1), but an electrolytic capacitor also worked fine. Two LEDs (LED1,2) with 330ohm resistors (R2,3) display link and data status.</p>
<p style="text-align:left;">A bias resistor (R12) is required; the value will depend on the ENC28J60 version you&#8217;re using. Current chips should be <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/80264d.pdf">B5</a> (PDF) or <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/80349b.pdf">B7</a> (PDF), and require a 2.32K 1% resistor.</p>
<p style="text-align:left;">The PHY I/O portion specifies 4 x 49.9ohm 1% resistors (R8-11), and a ferrite bead (L1).</p>
<p style="text-align:left;">The most difficult-to-find part for the ENC28J60 is the correct RJ-45 jack with integrated magnetics (RJ1). We used a J1006F21 PulseJack from Pulse Engineering. Be sure to check the pin configuration and connections if you use a different jack, they will probably be different than ours. A Cadsoft Eagle part library for the JP1006F21 is included in the project archive. This was a $4 part, but it&#8217;s gone up to $7. If you know of other jacks that work we&#8217;ll add them here.</p>
<p style="text-align:left;"><em>microSD card</em></p>
<p style="text-align:left;">We used a <a href="http://en.wikipedia.org/wiki/MicroSD">microSD/transflash card</a> in this design because SD cards waste a lot of board space under the holder. microSD cards are smaller versions of SD cards with the same data interface, and most come with an adapter for use in standard SD card readers. The card needs a holder (SD1) and a 0.1uF decoupling capacitor (C8).</p>
<p style="text-align:left;">If you want to use a full-size SD card, take a look at our version one prototype in the project archive. We used Alps SD card holder <a href="http://www.mouser.com/Search/ProductDetail.aspx?R=SCDA1A0901virtualkey68800000virtualkey688-SCDA1A0901">#SCDA1A0901</a>. Unfortunately, this part is has been discontinued and we&#8217;ve yet to find a suitable replacement. Don&#8217;t try <a href="https://www.mouser.com/Search/ProductDetail.aspx?R=SCDA5A0201virtualkey68800000virtualkey688-SCDA5A0201">#SCDA5A0201</a>, that&#8217;s for sure. If you have a favorite, we&#8217;ll add it here. <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=136">Sparkfun has one</a>, and a matching <a href="http://www.opencircuits.com/SFE_Footprint_Library_Eagle">Cadsoft Eagle part library</a>.</p>
<p style="text-align:left;"><em>Power supply</em></p>
<p style="text-align:left;">An <a href="http://hackaday.com/2008/09/22/parts-lm317-adjustable-voltage-regulator/">adjustable LM317 voltage regulator</a> (IC3) is set to 3.3volts using a 390ohm (R6) and 240ohm (R7) resistor. We considered several 3.3volt regulators, but nothing was cheaper than a LM317 and two resistors. There&#8217;s a 0.1uF decoupling capacitor (C13,14) and a 10uF capacitor (C3,19) on both sides to help support the power hungry Ethernet transceiver. The LM317 will output 3.3volts from an input of 5 to 20volts+, but it gets really hot with greater than 9volts supply. The specified input capacitor is only rated 16volts, so consider an upgrade if you plan to use a supply greater than about 9volts.</p>
<p style="text-align:left;">For the first time ever, we incorporated a power jack (J1) into a design. A jack with a 2.1mm diameter internal pin seems to be <a href="http://en.wikipedia.org/wiki/DC_connector#Cylindrical_types">the most common DC connector</a>. We used a cheap through-hole DC power jack, like SparkFun <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=119">#PRT-00119</a> or Mouser <a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=8xMK%252bwDsXhcfMNb%2fYnnwLQ%3d%3d">#163-7620-E</a>. It mates with a plug like Mouser <a href="http://www.mouser.com/Search/ProductDetail.aspx?R=1710-0721virtualkey11180000virtualkey1710-0721">#1710-0721</a>.</p>
<p style="text-align:left;"><strong>Circuit board</strong></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-3678" title="24fj-bcserver-v3" src="http://hackadaycom.files.wordpress.com/2008/09/24fj-bcserver-v3.jpg" alt="" width="450" height="244" /></p>
<p style="text-align:left;">The PCB (<a href="http://hackadaycom.files.wordpress.com/2008/09/pcb-full1.png">full size placement .png</a>) was designed in <a href="http://www.cadsoft.de/">Cadsoft Eagle 5.0</a>. Freeware versions are available for all major platforms. Renderings were done with <a href="http://www.matwei.de/doku.php?id=en:eagle3d:eagle3d">Eagle3D</a>, <a href="http://www.diylife.com/2008/06/06/cadsoft-eagle-5-test-drive/">beta version</a>. Schematic and board files are included in the <a href="http://blog.mahalo.com/hackaday/howto/wsbcv3.zip">project archive</a> (ZIP).</p>
<p style="text-align:left;">We designed the project with large SOIC chips and 0805 surface mount (SMD) parts, but haters can rest assured that chips are available in a through-hole package. We prefer to use SMD parts because the resulting circuit boards are smaller, cheaper, and faster to produce. 0805 parts are dirt cheap, and easy to solder with a normal iron. Don&#8217;t expect this project to work on a breadboard, there&#8217;s probably too much capacitance for this circuit.</p>
<p style="text-align:left;">We took full advantage of the PIC&#8217;s programmable pin placement to get the simplest trace routings possible. Just four jumper wires are needed on an otherwise single-sided board.</p>
<p style="text-align:left;">The traces are large and clean, DIY <a href="http://www.hackaday.com/2008/07/28/how-to-etch-a-single-sided-pcb/">toner transfer boards</a> should be easy. We made our PCB using an inkjet printer transparency mask over an UV sensitive circuit board.</p>
<p style="text-align:left;">In addition to the final design, the project archive contains our v1 prototype design. The prototype uses a full size SD card (<a href="http://www.mouser.com/Search/ProductDetail.aspx?R=SCDA1A0901virtualkey68800000virtualkey688-SCDA1A0901">SCDA1A0901</a>) and all electrolytic 10uF capacitors. We also put the RJ45 Ethernet jack on a daughterboard to better accommodate different pinouts.</p>
<p style="text-align:left;"><em>Partslist</em></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-3681" title="pcb-4501" src="http://hackadaycom.files.wordpress.com/2008/09/pcb-4501.png" alt="" width="448" height="334" /></p>
<table style="text-align:left;" border="0">
<tbody>
<tr>
<td>#</td>
<td>Count</td>
<td>Part</td>
<td>Size</td>
<td>Mouser#</td>
</tr>
<tr>
<td>IC1</td>
<td>1</td>
<td><a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en026374">PIC 24FJ64GA002-SO</a></td>
<td>SOIC-28</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=V%2fyyTCAHA4D%2fh5r3CRQDtA%3d%3d">579-PIC24FJ64GA002SO</a></td>
</tr>
<tr>
<td>IC2</td>
<td>1</td>
<td>ENC28J60</td>
<td>SOIC-28</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=8nGS%2fuaWW3uX0KPZZN505g%3d%3d">579-ENC28J60-I/SO</a></td>
</tr>
<tr>
<td>IC3</td>
<td>1</td>
<td>LM317 voltage regulator</td>
<td>D2Pack</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=LM317D2T-TRvirtualkey51120000virtualkey511-LM317D2T-TR">511-LM317D2T-TR</a></td>
</tr>
<tr>
<td>C1-3</td>
<td>3</td>
<td>10uF tantalum capacitor</td>
<td>A case</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=293D106X96R3A2TE3virtualkey61320000virtualkey74-293D106X96R3A2TE3">74-293D106X96R3A2TE3</a></td>
</tr>
<tr>
<td>C4-14</td>
<td>11</td>
<td>0.1uF capacitor</td>
<td>0805</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=C0805C104M5RACTUvirtualkey64600000virtualkey80-C0805C104M5R"><span>80-C0805C104M5R</span></a></td>
</tr>
<tr>
<td>C15-18</td>
<td>4</td>
<td>27pF capacitor</td>
<td>0805</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=0ZUpllj3bsbA9A7Pajx4jA%3d%3d">140-CC501N270J-RC</a></td>
</tr>
<tr>
<td>C19</td>
<td>1</td>
<td>10uF  capacitor</td>
<td>0805</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=UWF1C100MCL1GBvirtualkey64700000virtualkey647-UWF1C100MCL1GB">647-UWF1C100MCL1GB</a></td>
</tr>
<tr>
<td>R1</td>
<td>1</td>
<td>2K0ohm resistor</td>
<td>0805</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=jBethxrBxZb5NLDetw123g%3d%3d">292-2.0K-RC</a></td>
</tr>
<tr>
<td>R2-6</td>
<td>5</td>
<td>390ohm resistor</td>
<td>0805</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=2BMLUTrrT4P7Xm58YbKmPg%3d%3d">71-CRCW0805-390</a></td>
</tr>
<tr>
<td>R7</td>
<td>1</td>
<td>240ohm resistor</td>
<td>0805</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=B6sMDe4C%252beDvUrZZzlhhcA%3d%3d">71-CRCW0805-240</a></td>
</tr>
<tr>
<td>R8-11</td>
<td>4</td>
<td>49.9ohm 1% resistor</td>
<td>0805</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=CRCW080549R9FKEAvirtualkey61300000virtualkey71-CRCW0805-49.9-E3">71-CRCW0805-49.9-E3</a></td>
</tr>
<tr>
<td>R12</td>
<td>1</td>
<td>2K32ohm 1% resistor</td>
<td>0805</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=CRCW08052K32FKEAvirtualkey61300000virtualkey71-CRCW0805-2.32K-E3">71-CRCW0805-2.32K-E3</a></td>
</tr>
<tr>
<td>L1</td>
<td>1</td>
<td>Ferrite bead</td>
<td>0805</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=BLM21BB600SN1Dvirtualkey64800000virtualkey81-BLM21BB600SN1D">81-BLM21BB600SN1D</a></td>
</tr>
<tr>
<td>LED1-4</td>
<td>4</td>
<td>LED</td>
<td>0805</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=7JStj%2fjQ2SElGv%2fp7IzKlg%3d%3d">645-598-8110-107F</a></td>
</tr>
<tr>
<td>Q1</td>
<td>1</td>
<td>32.768KHz crystal</td>
<td>SMD</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=CM200S-32.768KDZF-UTvirtualkey69500000virtualkey695-CM200S-327KF-U">695-CM200S-327KF-U</a></td>
</tr>
<tr>
<td>Q2</td>
<td>1</td>
<td>25MHz crystal</td>
<td>HC49</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=ABLS-25.000MHZ-B2F-Tvirtualkey52750000virtualkey815-ABLS-25-B2">815-ABLS-25-B2</a></td>
</tr>
<tr>
<td>RJ1</td>
<td>1</td>
<td>Pulse  J1006F21</td>
<td>-</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=J1006F21virtualkey67300000virtualkey673-J1006F21">673-J1006F21</a></td>
</tr>
<tr>
<td>S1</td>
<td>1</td>
<td>Tactile switch</td>
<td>DTS-6</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=101-0164-EVvirtualkey12040000virtualkey101-0164-EV">101-0164-EV</a></td>
</tr>
<tr>
<td>SV1,2</td>
<td>11</td>
<td>.1&#8243; male pin header</td>
<td>-</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=4-103329-0virtualkey57100000virtualkey571-41033290">571-41033290</a></td>
</tr>
<tr>
<td>J1</td>
<td>1</td>
<td>Power jack</td>
<td>-</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=8xMK%252bwDsXhcfMNb%2fYnnwLQ%3d%3d">163-7620-E</a></td>
</tr>
<tr>
<td>SD1</td>
<td>1</td>
<td>microSD card holder</td>
<td>-</td>
<td>SparkFun: <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=127">PRT-00127</a></td>
</tr>
</tbody>
</table>
<p style="text-align:left;"><strong>Firmware</strong></p>
<p style="text-align:left;">Three firmware examples are included in the <a href="http://blog.mahalo.com/hackaday/howto/wsbcv3.zip">project archive</a> [zip]. The examples compile with Microchip&#8217;s demonstration C30 compiler. Learn more about working with the PIC 24F in our previous article:  <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">Web server on a business card (part 1)</a>.<em> </em>MPLAB isn&#8217;t great about project portability, you may need to locate all the project files again if your path doesn&#8217;t match the &#8216;c:wsbc&#8217; format that we used.</p>
<p style="text-align:left;"><em>FAT12/16/32 disk library</em></p>
<p style="text-align:left;"><em></em></p>
<p style="text-align:left;">Our first step was to get the FAT library reading from a SD card. FAT 12/16/32 are simple disk storage formats that work with PCs, MACs, digital cameras, music players, and other electronics. Here&#8217;s our favorite <a href="http://www.digitalspirit.org/file/index.php/obj-download/docs/fat/appnote_fat16.pdf">FAT tutorial/teardown</a> (PDF).</p>
<p style="text-align:left;"><a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1824&amp;appnote=en532040">Microchip&#8217;s FAT 12/16/32 library</a> gives us simple functions for working with SD cards.  The included demo application creates some files and directories to demonstrate each function. Here&#8217;s how we configured it to work on our custom hardware, you can find these changes by searching for the tag &#8216;HACKADAY&#8217; in the code:</p>
<ul style="text-align:left;">
<li>HardwareProfile.h assigns actual PIC hardware to generic references in the code library. For the SD card this is an SPI interface, and pins for chip select and card detect. First, we deleted all the unused hardware profiles to make the code more manageable. Next, we configured the FAT library to communicate with the SD card using an SPI module (line 132). Finally, we defined the SPI pin assignments (line 152). Pin setup is shown in the table below.<br />
<table border="0">
<tbody>
<tr>
<td><strong>Pin</strong></td>
<td><strong>Port</strong></td>
</tr>
<tr>
<td>Chip select</td>
<td>B0</td>
</tr>
<tr>
<td>SD card detect</td>
<td>A2</td>
</tr>
<tr>
<td>SPI clock</td>
<td>B2</td>
</tr>
<tr>
<td>SPI MOSI</td>
<td>B1</td>
</tr>
<tr>
<td>SPI MISO</td>
<td>B3</td>
</tr>
</tbody>
</table>
</li>
<li> Demonstration.c. On line 48 we set a custom oscillator fuse configuration, as described in our <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">PIC 24F introduction</a>. This is also the logical place to configure pin assignments with peripheral pin select (line 63).</li>
<li>FSConfig.h. This file enables various components of file system library, affecting the amount of memory and program space used. A read-only library is very small, a full write configuration is bigger. We didn&#8217;t have to make any changes for the demonstration, but this is an important file to note.</li>
</ul>
<p style="text-align:left;">At first, the library failed to recognize our SD card. It only supports disks with a <a href="http://en.wikipedia.org/wiki/Master_boot_record">master boot record</a> (MBR). Windows XP formats SD cards as a DOS disk: a single partition with no MBR. To verify this, open a Windows-formatted disk with a utility like <a href="http://mh-nexus.de/en/hxd/">HxD</a> and inspect sector 0 of the physical disk. Byte 446 should be the location of the first MBR partition entry, but instead it&#8217;s the NTLDR executable code.</p>
<p style="text-align:left;">To format the disk in the &#8216;correct&#8217; FAT format, use a digital camera&#8217;s format function or a utility like <a href="http://panasonic.jp/support/global/cs/sd/download/sd_formatter.html">Panasonic&#8217;s SD card formatter</a>. We also considered using a different FAT library that reads DOS disks, like <a href="http://www.larwe.com/zws/products/dosfs/index.html">DOSFS</a>, or adding similar features to the Microchip firmware.</p>
<p style="text-align:left;"><em>TCP/IP stack</em></p>
<p style="text-align:left;">Microchip&#8217;s free <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1489">TCP/IP stack</a> performs the convoluted configuration and networking functions needed to run a web server. You can read all about the stack in various <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=2505&amp;param=en535724">application notes and documentation</a>. Wikipedia is our favorite <a href="http://en.wikipedia.org/wiki/TCPIP">TCP/IP learning resource</a>; we wrote our first TCP/IP stack using only Wikipedia.</p>
<p style="text-align:left;">Microchip&#8217;s TCP/IP stack used to be  messy and confusing. Now it&#8217;s just confusing. The last few versions of have improved considerably in code clarity and structure. Here&#8217;s what we did to to configure the base TCP/IP stack example for our hardware, you can find these changes by searching for the tag &#8216;HACKADAY&#8217; in the code:</p>
<ul style="text-align:left;">
<li> HardwareProfile.h assigns actual PIC hardware resources to generic references in the code library. We added our custom oscillator configuration (line 68), and configured the server status LED to use the LED attached to PORTB7 (line 83).  We defined the SPI interface to the ENC28J60 as follows (line 116):<br />
<table border="0">
<tbody>
<tr>
<td><strong>Pin</strong></td>
<td><strong>Port</strong></td>
</tr>
<tr>
<td>Reset</td>
<td>B8</td>
</tr>
<tr>
<td>Chip select</td>
<td>B9</td>
</tr>
<tr>
<td>SPI clock</td>
<td>B10</td>
</tr>
<tr>
<td>SPI MOSI</td>
<td>B11</td>
</tr>
<tr>
<td>SPI MISO</td>
<td>B12</td>
</tr>
<tr>
<td>Wake on lan</td>
<td>B13</td>
</tr>
<tr>
<td>Interrupt</td>
<td>B14</td>
</tr>
</tbody>
</table>
</li>
<li>MainDemo.c. We eliminated a bunch of unused code, and added the peripheral pin select configuration code to the <em>InitializeBoard()</em> function (line 332).</li>
<li>TCPIPConfig.h defines the TCPIP stack components included in a compile. We&#8217;ve enabled DNS, DHCP, the IP announcer, and the ping server (line 56):</li>
</ul>
<p><pre class="brush: cpp;">
#define STACK_USE_DNS            // Domain Name Service Client
#define STACK_USE_DHCP_CLIENT    // Get DNS automagically
#define STACK_USE_ANNOUNCE       // Microchip Ethernet Device Discoverer
#define STACK_USE_ICMP_SERVER    // Enable the PING server</pre></p>
<p style="text-align:left;">After loading this firmware, we&#8217;re ready to connect the server to a network for the first time. During initialization, the TCP/IP stack negotiates with the network router for an IP address using DHCP. We need to know this address to communicate with the device. If the device had a screen we could display the IP address, but instead we use the MCHPDetect.exe utility from Microchip.</p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-7946" title="mchpdetectexe450" src="http://hackadaycom.files.wordpress.com/2008/09/mchpdetectexe450.png" alt="" width="450" height="169" /></p>
<p style="text-align:left;">When the TCP/IP stack finishes initializing, it broadcasts an announcement packet to port 30303 of all locally connected computers. MCHPDetect extracts the IP address from these packets. A new announce packet is sent on every PIC reset.</p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-2912" title="ipaddress-watch-450" src="http://hackadaycom.files.wordpress.com/2008/09/ipaddress-watch-450.png" alt="" width="450" height="246" /></p>
<p style="text-align:left;">It&#8217;s also possible to read the IP address directly from memory with a debugger. The address is stored in the <em>AppConfig.MyIPAddr</em> variable, the <em>.byte</em> form follows the standard x.x.x.x IP notation.</p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-7947" title="ping-450" src="http://hackadaycom.files.wordpress.com/2008/09/ping-450.png" alt="" width="450" height="202" /></p>
<p style="text-align:left;">Once we have the IP address, we can ping the server and test its responsiveness.</p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-3765" title="wireshark" src="http://hackadaycom.files.wordpress.com/2008/09/wireshark.png" alt="" width="449" height="279" /></p>
<p style="text-align:left;">If ping shows high latency or malformed packets, you can use <a href="http://www.wireshark.org/">Wireshark</a> to inspect network traffic at the byte level. Unless you&#8217;re in Germany, because <a href="http://www.theregister.co.uk/2007/08/13/german_anti-hacker_law/">it might be criminal</a>.</p>
<p style="text-align:left;"><em>Building the custom HTTP server</em></p>
<p style="text-align:left;">The custom web server looks for requested files on the SD card, and sends them with the correct content type. We used the Microchip HTTP example server v1 (HTTP.c) as a base for our FAT file server (FATHTTP.c).</p>
<p style="text-align:left;">Microchip&#8217;s HTTP server used a simple file system called MPFS to index web pages on an EEPROM chip. We replaced calls to MPFS functions with calls to functions in the FAT library (see the <em>HTTPProcess</em> and <em>Sendfile</em> functions in FATHTTP.c). Our changes demonstrate the concept as simply as possible, without adding confusing pointers and other handy C obfuscations. The code leaves a ton of room for improvements, have at it. File writes are disabled in the default compilation, but there&#8217;s enough program space to enable them if you want to write to the SD card (see FSConfig.h).</p>
<p style="text-align:left;">It&#8217;s necessary to registered our custom FATHTTP server with the rest of the TCP/IP stack. We did a search and replace for the original HTTP server components, and added calls to our new FATHTTP server as needed. That turned out to be these places:</p>
<ul style="text-align:left;">
<li> TCPIPConfig.h. First we inserted some definitions that enable the FATHTTP server (line 70), and added a TCP socket for the FATHTTP server (line 248).</li>
<li>TCPIP.h. Next, we added FATHTTP to the list of services that require the TCP/IP stack (line 170) and then included the necessary headers (line 351).</li>
<li>StackTSK.c. We added the FATHTTP server initialization (line 138) and processing (line 340) functions to the list of TCP/IP stack tasks.</li>
<li>Helpers.c. We also needed to include a few helper functions for working with URLs (line 259).</li>
</ul>
<p style="text-align:left;">At long last, it&#8217;s time to put some files on an SD card and test this thing. Make sure your files follow the <a href="http://en.wikipedia.org/wiki/8.3_filename">8.3 file name format</a>. The project archive contains a sample website with a test image and zip file.</p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-2913" title="fathttp-450" src="http://hackadaycom.files.wordpress.com/2008/09/fathttp-450.png" alt="" width="449" height="328" /></p>
<p style="text-align:left;">After grabbing the server&#8217;s IP address with MCHPDetect, we pointed a browser at it. The IP address entered alone will redirect the browser to <em>index.htm</em>, whether or not it exists. Web pages and images stored on the SD card display in the browser, but unknown binary types trigger a download prompt.</p>
<p style="text-align:left;"><strong>Taking it further</strong></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-3750" title="wsbcv3-450ii" src="http://hackadaycom.files.wordpress.com/2008/09/wsbcv3-450ii.jpg" alt="" width="450" height="397" /></p>
<p style="text-align:left;">We see a lot of potential projects using this tiny web platform.</p>
<ul style="text-align:left;">
<li>Add hooks in the FATHTTP.c source for special URLs that trigger events or configure pins.</li>
<li>Build a remotely accessible data logger. Use the extra pins to read sensors and log data to the SD card. Logs are retrievable from a web browser, or directly from the FAT readable SD card.</li>
<li>Get remote access to an ancient serial terminal or BBS, optionally log the console output. Use two external pins as a serial port, and forward commands from the Internet using Microchip&#8217;s Telnet server and Ethernet-to-serial bridge examples.</li>
<li>Your suggestions?</li>
</ul>
<p style="text-align:left;">Next time, we&#8217;ll use the mini server to make an Internet connected, electronic indoor graffiti wall. This will be an interactive project where everyone can contribute graffiti and animations on-line.</p>
<p style="text-align:left;">Schematic, board, and firmware files are included in the <a href="http://blog.mahalo.com/hackaday/howto/wsbcv3.zip">project archive</a> (ZIP). Use the freeware version of <a href="http://www.cadsoft.de">Cadsoft Eagle</a> to view the schematic and PCB. The firmware is written in C, and compiled with the <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010065">Microchip demonstration C30 compiler</a>.</p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-3748" title="graffiti-wall-diagram-previ" src="http://hackadaycom.files.wordpress.com/2008/09/graffiti-wall-diagram-previ.jpg" alt="" width="450" height="179" /></p>
<p style="text-align:left;"><a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fhackaday.com%2F2008%2F09%2F25%2Fweb-server-on-a-business-card-part-2%2F&amp;title=How-To%3A+Web+server+on+a+business+card+%28Part%26nbsp%3B2%29"></a></p>
<br />Posted in classic hacks, how-to, misc hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=5&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/09/25/web-server-on-a-business-card-part-2/feed/</wfw:commentRss>
		<slash:comments>129</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Ian</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/wsbcv3-450.jpg" medium="image">
			<media:title type="html">wsbcv3-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/web-server-on-a-business-ca1.jpg" medium="image">
			<media:title type="html">web-server-on-a-business-ca1</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/cct-4502.jpg" medium="image">
			<media:title type="html">cct-4502</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/24fj-bcserver-v3.jpg" medium="image">
			<media:title type="html">24fj-bcserver-v3</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/pcb-4501.png" medium="image">
			<media:title type="html">pcb-4501</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/mchpdetectexe450.png" medium="image">
			<media:title type="html">mchpdetectexe450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/ipaddress-watch-450.png" medium="image">
			<media:title type="html">ipaddress-watch-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/ping-450.png" medium="image">
			<media:title type="html">ping-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/wireshark.png" medium="image">
			<media:title type="html">wireshark</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/fathttp-450.png" medium="image">
			<media:title type="html">fathttp-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/wsbcv3-450ii.jpg" medium="image">
			<media:title type="html">wsbcv3-450ii</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/graffiti-wall-diagram-previ.jpg" medium="image">
			<media:title type="html">graffiti-wall-diagram-previ</media:title>
		</media:content>
	</item>
		<item>
		<title>How-to: Windows Media Center on a Leopard network</title>
		<link>http://hackaday.com/2008/09/23/how-to-windows-media-center-on-a-leopard-network/</link>
		<comments>http://hackaday.com/2008/09/23/how-to-windows-media-center-on-a-leopard-network/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 01:30:56 +0000</pubDate>
		<dc:creator>Joey Celis</dc:creator>
				<category><![CDATA[home entertainment hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[htpc]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac mini]]></category>
		<category><![CDATA[mce]]></category>
		<category><![CDATA[media center]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[mini]]></category>
		<category><![CDATA[plex]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=2989</guid>
		<description><![CDATA[We&#8217;ve been using Microsoft&#8217;s Media Center for a few years now and have grown to like it a lot. We&#8217;ve also noticed that more and more Apple computers have shown up on our home network and decided it was time to get everything working together smoothly. Follow along as we walk you through the hoops [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2989&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-3140" title="mce_leopard" src="http://hackadaycom.files.wordpress.com/2008/09/mce_leopard.jpg" alt="" width="450" height="253" /></p>
<p>We&#8217;ve been using <a href="http://www.microsoft.com/WindowsXP/mediacenter/default.mspx">Microsoft&#8217;s Media Center</a> for a few years now and have grown to like it a lot. We&#8217;ve also noticed that more and more Apple computers have shown up on our home network and decided it was time to get everything working together smoothly. Follow along as we walk you through the hoops we jumped through to get everything cooperating.<span id="more-2989"></span></p>
<p>To make things really easy, we could have ditched Media Center and used Macs all around. One thing that the Macs lacked was a complete 10’ interface for the television. Sure, you have <a href="http://elan.plexapp.com/">Plex</a>, <a href="http://en.wikipedia.org/wiki/Front_Row">Front Row</a>, and <a href="http://www.mahalo.com/Eyetv">EyeTV</a> available; while each has their merits none of them were able to give a user a complete single TV viewing experience like Microsoft’s Media Center.</p>
<p>MCE, as it’s commonly referred to, can play back DVDs, music, videos, and broadcast TV all from one interface using a single remote. We wanted to build a home network that would centralize all our media, provide <a href="http://www.apple.com/macosx/features/timemachine.html">Time Machine</a> backups for the Apple computers, and also act as a bittorrent client and print server.</p>
<p>We knew we could easily set up another Windows machine to act like a server, but Time Machine only supports writing to Mac formatted drives. There is information out there that shows <a href="http://www.macosxhints.com/article.php?story=20071028173642747">how to get around this</a>, but we didn’t want to risk our backups using unsupported methods. <a href="http://hackaday.com/2008/07/05/hackit-network-attached-storage/">Running a NAS box</a> was out as well for the same reason.</p>
<p>A <a href="http://www.mahalo.com/Apple_Time_Capsule">1TB Time Capsule</a> could have been the answer to our problem since that would support Time Machine backups, and we could plug in a FAT32 formatted USB drive for the Windows computer. The issue here would be with the <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;314463">4GB file size limitation</a>, as most of the HD shows recorded are between 6-15GB. We would need a file system that would support larger file sizes like <a href="http://en.wikipedia.org/wiki/NTFS">NTFS</a> or <a href="http://en.wikipedia.org/wiki/HFS%2B">HFS+</a>.</p>
<p>We decided to base our server on a Mac running Leopard. All the drives would be Mac formatted to deal with the large file sizes and this would allow native Time Machine backups. As long as we enabled SMB support in Leopard, the Windows computers would be able to read and write to the Mac drives without any issues.</p>
<p>Since this would be a fully functioning computer we can configure it as a print server as well as a bittorrent client. Our list is rather simple and shows that it doesn’t take much to get a mixed computer network up and running.</p>
<p><strong>Hardware</strong></p>
<ul>
<li>Mac desktop</li>
<li>Client computers running Leopard and Windows Media Center</li>
<li>4 hard drives</li>
<li>USB printer</li>
</ul>
<p><strong>Software</strong></p>
<ul>
<li><a href="http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx">Tweak UI</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=3400190A-511A-4A3A-9B89-524511A76F58&amp;displaylang=en">Tweak MCE</a></li>
<li><a href="http://www.transmissionbt.com/">Transmission</a></li>
<li><a href="http://troelsbay.eu/software/reader">Reader Notifier</a></li>
<li><a href="http://www.microsoft.com/mac/products/remote-desktop/default.mspx">Microsoft Remote Desktop Client</a></li>
</ul>
<p><span><strong>Additional setup information</strong></span></p>
<ul>
<li>Working home network</li>
<li>Static IP assigned to the server and MCE computers</li>
<li>Wired connection from the router to the server and MCE computers</li>
<li>Media Center computers should be setup with the same admin login and password and have auto login enabled.</li>
<li><a href="http://hackaday.com/2008/07/11/hackit-ripping-dvds/">DVD movies ripped using the VIDEO_TS structure</a></li>
</ul>
<p>Since our server would mainly be used to host the network drives, we really didn’t need the latest and the greatest computer. Our digital media hub is a <a href="http://www.mahalo.com/Mac_Mini">first generation 1.42 GHz PPC Mac mini</a> complete with 1GB of Ram, an 80GB hard drive, bluetooth and AirPort Extreme.</p>
<p>We used 3 375GB Seagate drives that we had laying around, each in their own FireWire enclosure. We also picked up a 500GB Iomega FireWire drive on clearance to act as our Time Machine disk. The reason we <a href="http://en.wikipedia.org/wiki/USB#USB_compared_with_FireWire">went with FireWire over USB</a> was a matter of processor load. Since USB required the CPU to dictate where the data went unlike FireWire&#8217;s peer to peer method we felt it was best to unload as much strain from the CPU as possible.</p>
<p><img class="alignnone size-full wp-image-3142" title="mini-server" src="http://hackadaycom.files.wordpress.com/2008/09/mini-server.jpg" alt="" width="450" height="253" /></p>
<p>We also thought about using a Power Mac G4/G5 but liked the size of the Mac mini. Even with the 4 external drives, the whole thing fits nicely in our bookshelf. Whatever Mac you decide to use, just make sure it meets the <a href="http://www.apple.com/macosx/techspecs/">minimum specifications to run Leopard</a>.</p>
<p>After the initial OS install and updates, we started on formatting the drives one by one. Using Leopard’s Disk Utilities we formatted each external drive as <em>GUID Partition, Mac OS Extended (Journaled)</em></p>
<p><img class="alignnone size-full wp-image-3014" title="disk-utility" src="http://hackadaycom.files.wordpress.com/2008/09/disk-utility.jpg" alt="" width="450" height="253" /></p>
<p>Next each drive was given a logical name in the order they were installed under the mini: <em>HDD001</em>, <em>HDD002</em>, <em>HDD003</em>, and Time Machine.  <em>HDD001</em> would serve as one of our DVD drives, as well as the drive used to keep our shared music, photos, and torrents, so we created the following folders: <em>My DVDs</em>, <em>My Music</em>, <em>My Pictures</em>, and <em>Torrents</em>. <em>HDD002</em> would be only used for DVDs, so that drive only had one folder labeled <em>My DVDs</em>. That left <em>HDD003</em> to serve as the drive for recording MCE shows, so a folder labeled RecordedTV was created. No folders were made on the Time Machine drive as each Mac connecting to it would be making their own folder when doing their backups.</p>
<p>We then proceeded to create the different user profiles that would be accessing the drives. To make it easier on ourselves we used the same admin login and passwords from the MCE computers, but instead of making them part of the Admin group we made them part of the <em>Standard</em> user group. Since we used the same login for each MCE computer we only had to make one user on the server. For the Mac computers we used individual login names and password that were in use on the computers themselves and gave them only sharing accounts.</p>
<p><img class="alignnone size-full wp-image-3016" title="file-sharing" src="http://hackadaycom.files.wordpress.com/2008/09/file-sharing.jpg" alt="" width="450" height="253" /></p>
<p>From here we moved onto enabling file sharing setting, adding each of the 4 drives, and assigning the different users to each drives. The reason why we created different logins for the Mac accounts instead of using one generic one like the MCE account was to give different access to each user. Some only needed Time Machine access while others needed access to other drives. With the different accounts we were able to specify which accounts had access to which drives. Since we wanted to be able to map drives under Windows we enabled SMB support for the MCE user by clicking the <em>Options</em> button.</p>
<p>We also wanted to log into the computer remotely since this setup would be running without a monitor, keyboard or mouse connected directly to it. By enabling the <em>Remote Management</em> service we can now manage the computer via another mac or a computer running a <a href="http://www.mochasoft.dk/iphone_vnc.htm">VNC client, like on an iPhone</a>.</p>
<p>Our Mac came with a built in WiFi card that we used as a secondary WiFi access point when guests come to visit. It’s an easy way to get them online without us having to give out the password to our main WiFi connection.</p>
<p><img class="alignnone size-full wp-image-3017" title="internet-sharing" src="http://hackadaycom.files.wordpress.com/2008/09/internet-sharing.jpg" alt="" width="450" height="253" /></p>
<p>Under Internet Sharing we selected the <em>Ethernet</em> as the connection we wanted to share and <em>Airport</em> for the guest connection. Under the Airport options we gave it <a href="http://en.wikipedia.org/wiki/SSID">a different SSID</a> than our main connection. Now when guest visit, we can remote into the server and enable the connection, when they leave we disable the service.</p>
<p>The last things we wanted our server to do was automate the download of torrents. This required the installation of Reader Notifier and Transmission. Reader Notifier works with <a href="http://www.mahalo.com/Google_Reader">Google Reader</a> and will automatically download the torrent file based on our RSS subscription to our torrent directory. Transmission was then set to automatically monitor this directory for new torrent files, once Reader Notifier downloads the torrent, Transmission starts downloading.</p>
<p><img class="alignnone size-full wp-image-3018" title="rss-reader" src="http://hackadaycom.files.wordpress.com/2008/09/rss-reader.jpg" alt="" width="450" height="253" /></p>
<p>If we wanted to add a new torrent feed we just have to add it to Google Reader. Because Transmission is set to monitor the torrent directory if anyone manually places a torrent file in that directory from any computer the download will start automatically as well.</p>
<p>Both 2005 and Vista versions of MCE do not support writing to a network attached drive. With a few changes in the registry, via TweakMCE, we corrected this and added a few enhancements along the way.</p>
<p><img class="alignnone size-full wp-image-3024" title="mce-service" src="http://hackadaycom.files.wordpress.com/2008/09/mce-service.jpg" alt="" width="450" height="253" /></p>
<p>We started by locating the 3 media center services and stopping them for the time being. One at a time we double clicked each service and under the Log On tab changed the default setting to the “This account box” and entered in the admin name and password for the computer.</p>
<p><img class="alignnone size-full wp-image-3025" title="recordedtv" src="http://hackadaycom.files.wordpress.com/2008/09/recordedtv.jpg" alt="" width="450" height="253" /></p>
<p>With the services still stopped we launched TweakMCE and navigated to <em>TV &gt; Storage Location For Recorded TV</em> and replaced the current path with <a href="http://en.wikipedia.org/wiki/Path_(computing)">the UNC path</a> to our new server (\\OSXServer\HDD003\RecordedTV). We did this as well to the <em>Watched Folder For Recorded TV</em>.</p>
<p><img class="alignnone size-full wp-image-3026" title="my-dvds" src="http://hackadaycom.files.wordpress.com/2008/09/my-dvds.jpg" alt="" width="450" height="253" /></p>
<p>In order to take advantage of having our DVDs stored on the server we also enabled the <em>My DVDs</em> option under the <em>DVD</em> menu of TweakMCE.</p>
<p>After saving each of our changes and exiting out of TweakMCE, we proceed to map each of the network drives we would be using making sure to use the same user name and password and selecting the reconnect at log on option. This will ensure that the drives will always be reconnected in case of reboot.</p>
<p>We then rebooted the computer and once back, launched MCE. Under the <em>Videos</em> menu we added the new drives making sure to include the 2 <em>My DVDs</em> folders as MCE will use this information to populate the new <em>My DVDs</em> menu on the home screen. Adding the network paths to the <em>My Music</em> and <em>My Pictures</em> directory also allowed the MCE computers to have access to the same content.</p>
<p>Like the server, we wanted to manage these computers remotely so we enabled the <em>Remote Desktop Service</em>. Microsoft makes a free client for the Mac and XP MCE/Pro has the remote client built in. Except for the different codecs needed to playback the various files that we wanted no further configurations were needed.</p>
<p>Setting up the Mac was rather quick since we would be connecting to another Mac for the drives. After launching Finder, we located the server to the left of the window. Selecting the server, we entered the shared user name we created on the server saving our login information to the keychain.</p>
<p><img class="alignnone size-full wp-image-3019" title="time-machine" src="http://hackadaycom.files.wordpress.com/2008/09/time-machine.jpg" alt="" width="450" height="253" /></p>
<p>Enabling Time Machine to use a network drive is the same as selecting a locally connected drive. In the Time Machine preference screen select the <em>Change Disk</em> option to display all the connected drives. After selecting the drive labeled <em>Time Machine</em> we exited the screen, no hacks needed.</p>
<p>Unlike a Windows computer, OS X won’t automatically mount network drives on reboots. If we fail to mount the drives, Time Machine wouldn&#8217;t be able to perform it&#8217;s backups.. The easiest way we found was to create an Automator script at login to mount the drives.</p>
<p><img class="alignnone size-full wp-image-3020" title="automator" src="http://hackadaycom.files.wordpress.com/2008/09/automator.jpg" alt="" width="450" height="253" /></p>
<p>Our first step was having Automator call out each drive we wanted to mount via IP. Once we had specified which drives we wanted, the next step was to have Automator connect to the server to mount the drives. Once we had verified that it was connecting to the correct drives, via the <em>Run</em> button, we saved it as an application and placed it in our applications folder. We then added this to the login items for each user we wanted to have access to the drives. Now on login, the script will automatically run and connect to the drives.</p>
<p>With our server now up and running, the MCE computers can now access the drives for movies, music, pictures, and share recorded shows. If our living room computer records an episode of Battlestar Galatica, all the MCE computers in the house can access it. Also, with MCE we now have access to all our DVDs anywhere in the house.</p>
<p>Because we chose to go with a Mac as a server, the Macs on our network can now back up wirelessly with Time Machine and share a printer as well.</p>
<p>If we had to do it over again, we would have gone with an Intel based mini as it comes with the Gigabit ethernet unlike the G4’s fast ethernet. In addition to that we should have gone with larger drives and tried Leopard&#8217;s built in software RAID. Other than that, we are please with our new home network.</p>
<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fhackaday.com%2F2008%2F09%2F23%2Fhow-to-windows-media-center-on-a-leopard-network%2F&amp;title=How-to%3A+Windows+Media+Center+on+a+Leopard%26nbsp%3Bnetwork"></a>
<br />Posted in home entertainment hacks, how-to  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/2989/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/2989/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/2989/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/2989/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/2989/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/2989/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/2989/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/2989/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/2989/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/2989/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/2989/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/2989/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/2989/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/2989/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2989&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/09/23/how-to-windows-media-center-on-a-leopard-network/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Joey Celis</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/mce_leopard.jpg" medium="image">
			<media:title type="html">mce_leopard</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/mini-server.jpg" medium="image">
			<media:title type="html">mini-server</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/disk-utility.jpg" medium="image">
			<media:title type="html">disk-utility</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/file-sharing.jpg" medium="image">
			<media:title type="html">file-sharing</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/internet-sharing.jpg" medium="image">
			<media:title type="html">internet-sharing</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/rss-reader.jpg" medium="image">
			<media:title type="html">rss-reader</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/mce-service.jpg" medium="image">
			<media:title type="html">mce-service</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/recordedtv.jpg" medium="image">
			<media:title type="html">recordedtv</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/my-dvds.jpg" medium="image">
			<media:title type="html">my-dvds</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/time-machine.jpg" medium="image">
			<media:title type="html">time-machine</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/automator.jpg" medium="image">
			<media:title type="html">automator</media:title>
		</media:content>
	</item>
		<item>
		<title>How-to: Thermite hard drive destruction</title>
		<link>http://hackaday.com/2008/09/16/how-to-thermite-based-hard-drive-anti-forensic-destruction/</link>
		<comments>http://hackaday.com/2008/09/16/how-to-thermite-based-hard-drive-anti-forensic-destruction/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 01:50:00 +0000</pubDate>
		<dc:creator>Jason Rollette</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[security hacks]]></category>
		<category><![CDATA[burn]]></category>
		<category><![CDATA[Chemistry]]></category>
		<category><![CDATA[Experiments]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[fire]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Magnesium Ribbon]]></category>
		<category><![CDATA[Potassium Permanganate]]></category>
		<category><![CDATA[Thermite]]></category>
		<category><![CDATA[Thermite Ingredients]]></category>
		<category><![CDATA[Thermite Pictures]]></category>
		<category><![CDATA[Thermite Reaction]]></category>
		<category><![CDATA[Thermite Video]]></category>
		<category><![CDATA[Types of Thermite]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/08/25/how-to-thermite-based-hard-drive-anti-forensic-destruction/</guid>
		<description><![CDATA[After the overwhelming response to the Hackit we posted about automated hard drive destruction last fall, we finally decided to test out some thermite hard drive destruction ourselves. This has been done on The Screen Savers but they did not show up close results of the platters. So, aluminum and black iron oxide were procured [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2507&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="thermite" src="http://hackadaycom.files.wordpress.com/2008/08/dsc02559a.jpg?w=450&#038;h=357" alt="" width="450" height="357" /></p>
<p>After the overwhelming response to the Hackit we posted about <a href="http://www.hackaday.com/2007/12/25/holiday-hackit-automated-hard-drive-destruction/">automated hard drive destruction</a> last fall, we finally decided to test out some thermite hard drive destruction ourselves. This has been done on <a href="http://video.google.com/videoplay?docid=-4147847319296070400">The Screen Savers</a> but they did not show up close results of the platters. So, aluminum and black iron oxide were procured through eBay, and until it arrived we watched some YouTube videos that showed a lot of fire and no real results. We decided to see what it would take to completely obliterate a drive.</p>
<p>With the amount of personal data stored on your computer, we all understand the importance of destroying the data that is stored on the platters of a hard drive before disposing of it. There are many ways to destroy a hard drive; software, physical disassembly, drills, hammers, magnets/electromagnets, and acid, but none are quite as outrageous and dangerous as thermite. That&#8217;s what we&#8217;re going to do here today. Follow along for pictures and videos of the results.</p>
<p><span id="more-2507"></span></p>
<p>A couple different methods of containing the thermite above the hard drive were tried and we quickly found the best way is a clay flower pot with the drip tray for a lid. An Altoids tin was also tried, but it burned up to quickly. Molding a cement container was also attempted. Since thermite is extremely hard to ignite, sparklers that were left over from the 4th of July were used, and offered a very reliable method of ignition.</p>
<p>Our goal was to completely destroy the drive while it was still in the computer case. The theoretical application is to destroy the disk at a moments notice so it won&#8217;t fall into the wrong hands. After testing multiple methods, placing about 1 pound of thermite in a clay flower pot and lighting from the drain hole in the bottom yielded the best results. This could easily be placed in the 5.25&#8243; bays above the drive.</p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2008/09/16/how-to-thermite-based-hard-drive-anti-forensic-destruction/"><img src="http://img.youtube.com/vi/k-ckechIqW0/2.jpg" alt="" /></a></span>
<p>A thermite reaction is a process in which the correct mixture of metallic fuels are combined with a metal oxidizer and ignited. Ignition itself requires extremely high temperatures, but once ignited, thermite supplies its own source of oxygen. It can potentially burn underwater when mixed properly. Thermite is usually used to <a href="http://www.youtube.com/watch?v=nR6K90cR8Lg&amp;feature=related">weld railroad ties together</a>.</p>
<p>The most common thermite is &#8220;<a href="http://en.wikipedia.org/wiki/Thermite">black or blue iron oxide (Fe3O4), produced by oxidizing iron in an oxygen-rich environment under high heat</a>&#8221; and Aluminum(Al). Red iron(III) oxide (Fe2O3), commonly known as rust, can also be used. There are <a href="http://www.nakka-rocketry.net/thermites.html">many chemicals that can make thermite</a>; the mixtures used to make thermite therefore vary, causing confusing and <a href="http://amazingrust.com/Experiments/how_to/Thermite.html">changing mixture ratios</a>.</p>
<p><img class="alignnone size-medium wp-image-7850" src="http://hackadaycom.files.wordpress.com/2008/09/alum-powder1.jpg?w=222&#038;h=165" alt="" width="222" height="165" /><img class="alignnone size-medium wp-image-7851" src="http://hackadaycom.files.wordpress.com/2008/09/fe304.jpg?w=222&#038;h=165" alt="" width="222" height="165" /></p>
<p>Since the oxidation of one substance involves the reduction of another, this type of reaction is often called redox reaction. In the following <a href="http://www.webqc.org/balance.php">balanced reaction</a>, 8Al + 3fe3O4 = 4Al2O3 + 9Fe + Heat. The element Al is oxidized, but Fe is reduced. This reaction is also called a displacement reaction because Al displaces Fe in the oxide. Because of the nature of this reaction, the correct ratio of substances is important to ensure the optimum amounts of fuel (aluminum) and oxygen (iron oxide) within the mixture. Thermite is very safe to handle because of the high ignition temperatures required, sparklers were used in this instance, however magnesium ribbon can also be used. We think an electric <a href="http://members.aol.com/kappadx/kappa.html#Pyrogen">pyrogen igniter</a> would be a far better choice for ignition, instead of <a href="http://www.youtube.com/watch?v=5IJw5qwWlNI">unreliable methods</a>.</p>
<p>There are two important aspects to ensure a successful reaction. Thorough/even mixing and smallest possible powder particle size. If thermite is not adequately mixed, it may be difficult to ignite or maintain the reaction. One problem when mixing thermite is the difference in weight between the aluminum and the iron oxide. This causes them to separate out rendering the thermite useless. The process used here with great success was five minutes in a rock tumbler. Powder particle size is measured with a <a href="http://www.espi-metals.com/tech/mesh.htm">measurement called mesh</a>. Passing the powder through a mesh will determine the largest particle size, this reaction performs best with the smallest obtainable mesh size. The mesh size for aluminum was 1200 mesh and black iron oxide was 300 mesh.</p>
<p>The total enthalpy or heat content released is -3.677 kJoule per gram of Fe3O4/AL thermite. The ratio of Fe3O4 to aluminum powder by weight is about 3.22 to 1, according to the <a href="http://www.science.uwaterloo.ca/~cchieh/cact/c120/stoichio.html">reaction&#8217;s stoichiometry</a>.  The reaction photographed was 200 grams of Aluminum and 644 grams of black iron oxide yielding 2368 kJoules of heat. This was more than was required to adequately destroy the hard drive, a smaller amount could have been used, and still destroyed the platters. It would have even been better controlled, or better yet contained within the computer case. What fun is that?</p>
<p><img class="alignnone size-medium wp-image-7880" src="http://hackadaycom.files.wordpress.com/2008/09/dsc025581.jpg?w=450&#038;h=348" alt="" width="450" height="348" /></p>
<p>Using thermite to destroy a hard drive is a very violent and destructive process. Great care should be taken as the molten metal can splash and sputter for a long distance.</p>
<p><img class="alignnone size-medium wp-image-7877" src="http://hackadaycom.files.wordpress.com/2008/09/dsc02560.jpg?w=450&#038;h=330" alt="" width="450" height="330" /></p>
<p>The reaction begins to sputter.</p>
<p><img class="alignnone size-medium wp-image-7876" src="http://hackadaycom.files.wordpress.com/2008/09/dsc02561.jpg?w=450&#038;h=383" alt="" width="450" height="383" /></p>
<p>The thermite has just contacted the hard drive.</p>
<p><img class="alignnone size-medium wp-image-7872" src="http://hackadaycom.files.wordpress.com/2008/09/dsc02565.jpg?w=450&#038;h=352" alt="" width="450" height="352" /></p>
<p>Things are really hot now!</p>
<p><img class="alignnone size-medium wp-image-7871" src="http://hackadaycom.files.wordpress.com/2008/09/dsc02570.jpg?w=450&#038;h=356" alt="" width="450" height="356" /></p>
<p>Most of the reaction is completed.</p>
<p><img class="alignnone size-medium wp-image-7869" src="http://hackadaycom.files.wordpress.com/2008/09/dsc02591.jpg?w=450&#038;h=331" alt="" width="450" height="331" /></p>
<p>The molten thermite, platters and most of the aluminum frame from the hard drive in the bottom of the case.</p>
<p><img class="alignnone size-medium wp-image-7861" src="http://hackadaycom.files.wordpress.com/2008/09/dsc02657a.jpg?w=450&#038;h=316" alt="" width="450" height="316" /></p>
<p>Above are the molten hard drive platters destroyed with 844 grams of thermite. It takes about this much thermite contained directly above the drive to get the job done, if it is not you will just get a <a href="http://revision3.com/thebroken/ep3/">superficial fire</a>.</p>
<p><img class="alignnone size-medium wp-image-7862" src="http://hackadaycom.files.wordpress.com/2008/09/dsc02743a.jpg?w=450&#038;h=304" alt="" width="450" height="304" /></p>
<p>Over all the destruction of the drive and platters was accomplished in all cases in a matter of seconds. This is by far a guaranteed method of destroying data in a time of need. We&#8217;re pretty sure this will prevent most forensic data recovery methods.</p>
<p>Below is a video of Brainiac using thermite to burn cars and trying to stop the reaction with liquid nitrogen.</p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2008/09/16/how-to-thermite-based-hard-drive-anti-forensic-destruction/"><img src="http://img.youtube.com/vi/WrCWLpRc1yM/2.jpg" alt="" /></a></span>
<p>Here&#8217;s the directors cut of the thermite video which contains 4 extra minutes:</p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2008/09/16/how-to-thermite-based-hard-drive-anti-forensic-destruction/"><img src="http://img.youtube.com/vi/a7Kn3phALkY/2.jpg" alt="" /></a></span>
<p>Finally, please do not try this.</p>
<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fhackaday.com%2F2008%2F09%2F16%2Fhow-to-thermite-based-hard-drive-anti-forensic-destruction%2F&amp;title=How-to%3A+Thermite+hard+drive%26nbsp%3Bdestruction"></a>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/2507/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/2507/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/2507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/2507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/2507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/2507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/2507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/2507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/2507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/2507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/2507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/2507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/2507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/2507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/2507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/2507/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2507&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/09/16/how-to-thermite-based-hard-drive-anti-forensic-destruction/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Jason Rollette</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/dsc02559a.jpg" medium="image">
			<media:title type="html">thermite</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/alum-powder1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/fe304.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/dsc025581.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/dsc02560.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/dsc02561.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/dsc02565.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/dsc02570.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/dsc02591.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/dsc02657a.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/dsc02743a.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: Hack a ThingamaKIT</title>
		<link>http://hackaday.com/2008/08/19/how-to-hack-a-thingamakit/</link>
		<comments>http://hackaday.com/2008/08/19/how-to-hack-a-thingamakit/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 01:30:00 +0000</pubDate>
		<dc:creator>loganwilliams</dc:creator>
				<category><![CDATA[digital audio hacks]]></category>
		<category><![CDATA[home entertainment hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[bleeplabs]]></category>
		<category><![CDATA[circuitbending]]></category>
		<category><![CDATA[circuitbent]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[photoresistor]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[thingamagoop]]></category>
		<category><![CDATA[thingamakit]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/08/19/how-to-hack-a-thingamakit/</guid>
		<description><![CDATA[The ThingamaKIT is an anthropomorphic analog synthesizer kit from Bleep Labs. Using &#8220;LEDacles&#8221;, photoresistors, knobs, and switches, it generates interesting high pitched vocalizations. Bleep Labs sent us a review unit and this article shares our experiences building and using the kit. We&#8217;ve also included a tutorial on making some hacks, modifications, and circuit bends to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2470&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div align="left"><img width="450" vspace="4" hspace="4" height="303" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/08/header.jpg?w=450&#038;h=303" /></div>
<p>The <a href="http://bleeplabs.com/thingamakit/">ThingamaKIT</a> is an anthropomorphic analog synthesizer kit from <a href="http://bleeplabs.com/">Bleep Labs</a>. Using &#8220;LEDacles&#8221;, photoresistors, knobs, and switches, it generates interesting high pitched vocalizations. Bleep Labs sent us a review unit and this article shares our experiences building and using the kit. We&#8217;ve also included a tutorial on making some hacks, modifications, and circuit bends to it. Skip to the end to see a video of our hacked kit in action.</p>
<p><span id="more-2470"></span></p>
<h2>Using the ThingamaKIT</h2>
<p>While it may not be that useful for serious musical composition, the ThingamaKIT makes some nice bleeps and blips, even without modification.The LED to photoresistor input/feedback method is enjoyable to play with, by repointing the LEDacles and waving hands around the photoresistor. The ThingamaKIT is very easy to start using; just twiddle knobs, and it starts making its characteristic ridiculous sounds.</p>
<p>The ThingamaKIT is an simple but fun circuit, and <a href="http://bleeplabs.com/thingamakit/extra-2/">schematics</a> are provided. Three Schmitt trigger oscillators, like the ones used in the <a href="http://www.hackaday.com/2008/05/01/how-to-make-a-digital-synthesizer/">previous Hack a Day synth article</a> are used to control the first LEDacle. Because they have different frequencies, the LEDacle blinks in an interesting manner. A Schmitt trigger and op amp generate a triangle wave for the other LEDacle, with controllable waveshape and speed. Another Schmitt trigger generates the modulating wave, with a frequency based on either Photocell 2 or a potentiometer. The main oscillator, the XR2206, has a pitch controlled by Photocell 1, except when the output from the modulation is high, then it switches to a different pitch.</p>
<p><object width="450" height="364"><param name="movie" value="http://www.youtube.com/v/vIiqGVKPgPE&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/vIiqGVKPgPE&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" type="application/x-shockwave-flash" allowfullscreen="true" width="450" height="364"></embed></object><br />Embedded above is Bleep Labs official demo video.</p>
<h2>Building the ThingamaKIT</h2>
<p><object width="450" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1370175&amp;server=www.vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=23C50B&amp;fullscreen=1" /><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1370175&amp;server=www.vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=23C50B&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="450" height="338"></embed></object><br />The instructions for building the ThingamaKIT are printed well and easy to follow. [Surachai]&#8216;s build time lapse, shown above, gives a nice overview of the process. We had no problem finding components and soldering them to the board. Though troubleshooting instructions are provided in the manual, our device worked fine, and we did not need them.</p>
<p>If you are assembling the ThingamaKIT with the intent to hack it as shown in the rest of this article, there are a couple things you should do differently than shown in the instructions.</p>
<ul>
<li>Cut the 4&#8221; wires a little longer, closer to 6&#8221;. You&#8217;ll need the extra length when fitting components.</li>
<li>Do not install the waveshape switch, unless you want to test the default ThingamaKIT unit without modifications.</li>
<li>Do not proceed to the casing steps until you have made modifications.</li>
</ul>
<p><img width="450" vspace="4" hspace="4" height="347" border="0" id="img2" src="http://hackadaycom.files.wordpress.com/2008/08/board.jpg?w=450&#038;h=347" alt="" /></p>
<h2>Hacking the ThingamaKIT</h2>
<p>Bleep Labs has designed the ThingamaKIT to be easily <a href="http://en.wikipedia.org/wiki/Circuit_bending">circuit bendable</a>, and there are many fun hacks that can be done with this unit. A few are briefly presented in the extra information given with the kit. While playing around with it and assembling it, we also discovered several more. We&#8217;ll show you a few different hacks and circuit bends that you can do with an assembled ThingamaKIT.</p>
<h2>Adding an audio input</h2>
<p>Our favorite hack for the ThingamaKIT is to add an audio input. The ThingamaKIT will completely warp any audio input, crushing it to lo-fi fuzz and crunches. Here is its emotional rendition of The Police&#8217;s &#8220;Every Breath You Take&#8221;:</p>
<p><embed width="450" height="27" type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://blog.mahalo.com/hackaday/howto/ThingamaKIT_sample.mp3" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded"></embed><img width="450" vspace="4" hspace="4" height="285" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/input_1.jpg?w=450&#038;h=285" id="img3" alt="" /><br />To do this, you&#8217;ll need a 3.5mm audio jack, like the kind used in the <a href="http://www.hackaday.com/2008/05/01/how-to-make-a-digital-synthesizer/">previous synthesizer how-to article</a> and a SPDT (three way) switch. Solder a wire to the signal lug and a wire to the ground lug on the jack. Then, solder the signal wire (the blue wire) to the left hand pad of the .01 uF capacitor, which is outlined above in red. Our solder joints look like a warzone, but it all works. We swear.</p>
<p><img width="450" vspace="4" hspace="4" height="267" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/input_2.jpg?w=450&#038;h=267" id="img4" alt="" /><br />There are two places the ground wire can be soldered, and each has a different sound; we installed a switch so that both could be used. Solder the ground wire to the center lug on the SPDT switch. Solder one of the outside lugs to the board&#8217;s ground, and another to the other pin of the .01 uF capacitor, as outlined in red above.</p>
<p>To use the audio input, flip the SPDT switch to either outside position, then patch some audio to the input. Music, drum machines, other synthesizers and more all work to make an interesting sound.</p>
<h2>Adding a waveshaper knob</h2>
<p>In its default configuration, the ThingamaKIT only has a switch to select between triangle and square wave main oscillators. By replacing this knob with a potentiometer, you can transition smoothly between the two waveforms. However, there will be a significant attenuation (decrease in volume) when the potentiometer is near its center, as both outputs will have increased impedance. This is not easily corrected, except with active amplification, or a dual potentiometer with two different tapers, which we have been unable to find.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/knob_1.jpg?w=450&#038;h=300" id="img5" alt="" /><br />To do this mod, you first need to remove the waveshape switch if you have already attached it. The easiest way to remove it is with a <a href="http://www.radioshack.com/product/index.jsp?productId=2062731&amp;cp=&amp;sr=1">desoldering iron</a>. Simply squeeze the bulb, place the hot iron over each pad (pads to remove are outlined in red on the image above), and release the bulb. Do this for each pad until all solder is removed, then remove the switch. Keep the switch, as it will be useful if you want to do the sine wave hack.</p>
<p><img width="450" vspace="4" hspace="4" height="288" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/knob_2.jpg?w=450&#038;h=288" id="img6" alt="" /><br />Next, solder three wires to a 10K potentiometer, such as the one pictured above. The red wire goes to the middle lug, and the other two go to either end on the board. </p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/knob_3.jpg?w=450&#038;h=300" id="img7" alt="" /><br />The waveshaper knob is complete, and you can now easily fade between square and triangle waves.</p>
<h2>Adding a sine wave switch</h2>
<p>While reading the <a href="https://www.jameco.com/Jameco/Products/ProdDS/34972.pdf">datasheet</a> (PDF) for the XR2206, the signal generator that the ThingamaKIT uses, we noticed a very easy way to change the triangle wave output into a sine wave, which has a softer sound.</p>
<p><img width="450" vspace="4" hspace="4" height="225" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/sine_1.jpg?w=450&#038;h=225" id="img8" alt="" /><br />If you are doing this with the waveshaper hack above, start by taking the old switch, and removing one lug from its side. Then bend the other two down slightly, as shown. This will allow the switch to fit where the old one did on the panel, without being in contact with the board. Solder two short wires to the remaining lugs. Then, stick a piece of electrical tape over the top of the pads on the board where the potentiometer is now wired, and put the switch there, using a bit of hot glue to hold it in place.</p>
<p><img width="450" vspace="4" hspace="4" height="257" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/sine_2.jpg?w=450&#038;h=257" id="img9" alt="" /><br />To one wire, solder a 220 ohm resistor inline; an extra is helpfully provided in the kit. Wrap the resistor in electrical tape to cover the exposed leads, then solder the two wire ends to pins 13 and 14 of the XR2206 as outlined in red above. The sine wave mod is complete!</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/sine_3.jpg?w=450&#038;h=300" id="img10" alt="" /></p>
<h2>Adding a spike wave switch</h2>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/spike_1.jpg?w=450&#038;h=300" id="img11" alt="" /><br />Another bend we found while poking around in the unit caused the main oscillator to create a &#8220;spike&#8221; waveform. It produces a nice lo-fi, glitchy sound. To add this bend, take any normal SPST (two way on-off switch) and solder a wire to each lug.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/spike_2.jpg?w=450&#038;h=300" id="img12" alt="" /><br /> Then, connect it to pins 8 and 6 on the XR2206, as outlined in red. The spike wave mod is done.</p>
<h2>Packaging it all up</h2>
<p>To finish up our ThingamaKIT, we followed the instructions provided with the kit, but with a few modifications. A couple of extra holes had to be drilled for the new potentiometer (5/16&#8221;), the spike wave switch (5/16&#8221;), and the audio input (1/4&#8221;).</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/case_1.jpg?w=450&#038;h=300" id="img1" alt="" /><br />We had some difficulty getting all of the new components fitted into the case, but with some rearranging we managed. Be sure not to push the photoresistors up higher on the face then is shown on the drill jig, or you will have trouble fitting them around the LEDacles. The volume potentiometer was also mounted a little low, and we had to put the speaker toward the controls side rather then the LEDacle side of the case to fit it in.</p>
<p><img width="450" vspace="4" hspace="4" height="675" border="0" src="http://hackadaycom.files.wordpress.com/2008/08/case_2.jpg?w=450&#038;h=675" id="img2" alt="" /><br />Check out the demo video below to see our glorious leader in action.</p>
<p><object type="application/x-shockwave-flash" width="450" height="338" data="http://www.flickr.com/apps/video/stewart.swf?v=58825" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=97e4947114&amp;photo_id=2752387990"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=58825"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=58825" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&amp;photo_secret=97e4947114&amp;photo_id=2752387990" height="338" width="450"></embed></object> </p>
<h2>Further hacks</h2>
<p>To hack your ThingamaKIT further, Dr. Bleep has some <a href="http://bleeplabs.com/thingamakit/extra-2/">recommendations</a> in the manual: using the extra oscillators on the board to add effects, replacing the variable photocells with resistors and buttons to make a keyboard, making a patchbay, and getting complete control over LEDacle 1 with potentiometers.</p>
<p>That concludes our ThingamaKIT hacking. Have any of you built one? To see other custom ThingamaKITs, check out the <a href="http://www.flickr.com/groups/772348@N24/">Flickr group</a>.<br /><script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/2470/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/2470/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/2470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/2470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/2470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/2470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/2470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/2470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/2470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/2470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/2470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/2470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/2470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/2470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/2470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/2470/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2470&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/08/19/how-to-hack-a-thingamakit/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">loganwilliams</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/header.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/board.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/input_1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/input_2.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/knob_1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/knob_2.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/knob_3.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/sine_1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/sine_2.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/sine_3.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/spike_1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/spike_2.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/case_1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/08/case_2.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: The Hacker&#8217;s Soldering Station</title>
		<link>http://hackaday.com/2008/08/05/how-to-the-hackers-soldering-station/</link>
		<comments>http://hackaday.com/2008/08/05/how-to-the-hackers-soldering-station/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 12:20:00 +0000</pubDate>
		<dc:creator>Adam Harris</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[extractor]]></category>
		<category><![CDATA[fume extractor]]></category>
		<category><![CDATA[fumes]]></category>
		<category><![CDATA[hackaday]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[soldering iron]]></category>
		<category><![CDATA[solderingiron]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/08/05/how-to-the-hackers-soldering-station/</guid>
		<description><![CDATA[A good soldering station and fume extractor is a must for anyone interested in hacking and modding, but not everyone can afford the expensive professional models on the market. This How-To and the tips within it will guide you through the process of building an inexpensive homebrew fume hood complete with built-in time and temperature [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2393&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img width="450" vspace="4" hspace="4" height="338" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/window.jpg?w=450&#038;h=338" /><br />A good soldering station and fume extractor is a must for anyone interested in hacking and modding, but not everyone can afford the <a href="http://www.wassco.com/Products/Fume-Extractor--MG100S--Filtronic__WAS-06-641007.aspx">expensive</a> <a href="http://www.howardelectronics.com/Quatro/solderpure.html">professional</a> <a href="http://www.sentryair.com/winged-sentry.htm">models</a> on the market. This How-To and the tips within it will guide you through the process of building an inexpensive homebrew fume hood complete with built-in time and temperature controlled soldering station and all the soldering tools you need.</p>
<p><span id="more-2393"></span></p>
<p>We&#8217;ll begin by building the solder fume hood. Yes, we said &#8220;hood&#8221;, not just &#8220;extractor&#8221;. While there have been some <a href="http://www.instructables.com/id/Window-mounted-solder-fume-extractor-not-just-for/">nice</a> <a href="http://www.raphnet.net/divers/fume_extractor/index_en.php">fume</a> <a href="http://lab.melodolic.com/index_FumeExtractor.php">extractors</a> hacked together, this system integrates all of your soldering tools into and around the fume hood. </p>
<p>The purpose of a fume hood is to draw solder fumes away from the person soldering. Besides the health risks, these fumes are really annoying as they follow that pesky law of the universe: &#8220;No matter where you happen to be sitting, solder fumes will float directly towards your face.&#8221;</p>
<p>To start, let&#8217;s gather materials:</p>
<table style="text-align: left; margin-left: 0px; margin-right: auto;">
<tbody>
<tr>
<th>Part</th>
<th>Supplier </th>
<th>Cost</th>
</tr>
<tr>
<td>18 Gallon clear Rubbermaid Container (about 18&#8243;x18&#8243;x16&#8243;)</td>
<td>Super Store </td>
<td> $7.00 </td>
</tr>
<tr>
<td>4&#8243; Metal Fan </td>
<td> Super Store</td>
<td>$5.00</td>
</tr>
<tr>
<td>12&#8243; Fluorescent Under-Cabinet Lamp</td>
<td> Super Store</td>
<td>$9.00</td>
</tr>
<tr>
<td>Surge Protector</td>
<td> Super Store</td>
<td>$3.00</td>
</tr>
<tr>
<td>Activated Carbon Filter</td>
<td> Super store or Online Electronics Boutique</td>
<td>$3.00</td>
</tr>
<tr>
<td>Small Sheet of Acrylic (7&#8243;x15&#8243;) (optional)</td>
<td> Scrap</td>
<td>Free</td>
</tr>
</tbody>
</table>
<p>Once all the materials are gathered, we can begin cutting the plastic of the Rubbermaid container. To cut this material, use a plastic scoring tool. When you make your cuts, make sure to repeatedly score the line you want to cut until the blade goes all the way through the plastic. Do not try to score it and snap it like acrylic. This material has a bad tendency to crack in places you didn&#8217;t intend. If your plastic cracks, all is not lost. Since the plastic is soft, you can weld the cracks back together by touching it with the tip of a high temperature hot glue gun.</p>
<p><img width="450" vspace="4" hspace="4" height="293" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/fan_hole.png?w=450&#038;h=293" /><br />First, we need to cut a hole for the fan in the top of the hood. Take off the cover of the fan and use it to make a hole slightly smaller than the inside diameter of the fan cover in the top center of the hood. The fan is actually going to hang from the top of the hood and pull the fumes out of the hood when turned on.</p>
<p> <img width="450" vspace="4" hspace="4" height="303" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/fan.png?w=450&#038;h=303" /><br />Once the big hole is made, drill smaller holes for the screws used to hold the fan together. With the nuts on the outside, screw the fan assembly to the top of the hood.</p>
<p> <img width="450" vspace="4" hspace="4" height="364" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/twist-tie.png?w=450&#038;h=364" /><br />To reattach the top cover of the fan, use some scrap solid core wire or twist-ties to connect the spars on the top cover to the spars on the bottom fan assembly. We used only three twist ties as this is plenty to keep the fan cover in place.</p>
<p> <img width="450" vspace="4" hspace="4" height="447" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/lamp_shim.png?w=450&#038;h=447" /><br />Now we are ready to mount the light. Mark a good place to attach the light in the back top of the hood. It is likely that the mounting screws that came with the lamp are too long. Additionally, the lamp might get too hot. To prevent the lamp from melting the plastic, we cut about five half-inch spacers out of some of the plastic cut off earlier. To make life easier, pre-drill holes in the center of each of the spacers. Use a couple of the spacers on the inside to lower the lamp away from the top of the hood, and then use a few on the outside to cover the sharp points of the protruding screws. Alternatively, encapsulating the screw points on the outside of the hood with hot glue works just as well.</p>
<p> <img width="450" vspace="4" hspace="4" height="260" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/first_window.png?w=450&#038;h=260" /><br />Next, cut the main window of the fume hood. Ours goes all the way across the front and is about 7 inches high. It&#8217;s a good idea to start with a smaller hole and expand it to see what feel comfortable for you to use. Make sure it is easy to reach the top back wall of the hood. This is where the controls will go later.</p>
<p><img width="450" vspace="4" hspace="4" height="382" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/filter.png?w=450&#038;h=382" /><br />At this point, you can use zip ties to attach the active carbon filter to the top of the fan.</p>
<p><img width="450" vspace="4" hspace="4" height="338" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/stock.jpg?w=450&#038;h=338" /><br />Plug the fan and the light into a powerstrip. Make sure the fan and the light are turned on so you can turn the entire hood on and off from the strip. Plug in the soldering iron and you are ready to go. The adjustable base of the fan is used here to hold the excess wire from the soldering iron; keeping it out of the way.</p>
<p><img width="450" vspace="4" hspace="4" height="338" border="0" src="http://hackadaycom.files.wordpress.com/2008/07/window.jpg?w=450&#038;h=338" id="img1" alt="" /><br />A slightly more advanced option for the front is to cut another smaller window (about 6.5 by 13.5 inches) just above the first one and add a piece of acrylic. This greatly improves visibility. Make sure to cut the acrylic about a half inch larger than the window to give yourself a surface to glue. Attach the acrylic on the inside of the fume hood with hot glue. </p>
<p> To improve your soldering iron set-up, you can get a professional soldering station. But why spend $50 on a <a href="http://www.afrotechmods.com/cheap/iron/iron.htm">temperature controlled soldering station</a> when you can build your own for cheaper! Afrotechmods has a rough guide to <a href="http://www.afrotechmods.com/cheap/iron/iron.htm">building a great adjustable temperature soldering station</a>.</p>
<p><img width="450" vspace="4" hspace="4" height="184" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/socket_face.png?w=450&#038;h=184" /><br />To install this soldering station into the fume hood, simply cut a hole in the back of the hood large enough to stuff the dimmer and the socket through it from the front side and small enough to make sure the mounting holes still have some plastic to mount to. The box will be attached to the back of the hood, but the faceplate needs to be on the inside.</p>
<p>You&#8217;ll notice that there is a different knob on the dimmer switch. We used a scrap knob with a flat bottom (comes complete with cool numbers) on the dimmer switch instead of the stock knob.</p>
<p>Regardless of what soldering station you use, if it doesn&#8217;t have auto turn off (which is good for fire prevention), put a grounded AC appliance timer inline with the iron. These timers allow you to automatically turn on or off any AC appliance at any time you want within a 24 hour period, but don&#8217;t rely on it to keep your iron turned off, as it will turn it back one every 24 hours. It&#8217;s better than nothing and is a cheap option, as they run between 5 and 10 bucks at local hardware and super stores. The one we use has increments of about 15 minutes. Setting it for 30-45 minutes works well.</p>
<p><img width="450" vspace="4" hspace="4" height="478" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/timer.png?w=450&#038;h=478" /><br />For some reason, the designers of these timers want to take up all the plug space they can by placing the plug practically in the center on the back of the timer. Luckily, the scrap dimmer knob we found has a low profile, and allows the timer to plug in with little interference to the dimmer. A better option is to get an <a href="http://www.petco.com/product/100385/Marineland-Aquarium-Light-Timer.aspx">aquarium timer</a>. These are designed with a better form factor and generally only cover one socket.</p>
<p>Many cheap soldering irons come with a sponge to clean the tip. If you think about it, it&#8217;s not really the best idea to use a sponge to clean your soldering iron; it works, but it also cools down the tip of the iron every time you clean it. If you are doing delicate work and clean your tip once every couple of soldering points, this can lead to cold solder joints and bad connections.</p>
<p>Professionals use a <a href="http://www.itcelectronics.com/product_info.php?products_id=6146">flux covered wire mesh</a> to clean the tip. This method draws off the solder and uses flux to clean the tip. Every now and then, you just kind of stab the mesh with your iron a couple of times to clean it off. The problem is that this method costs around $10.</p>
<p><img width="450" vspace="4" hspace="4" height="506" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/scourer.png?w=450&#038;h=506" /><br />Instead of buying some job specific wire mesh, just use a copper coated scourer to clean your soldering iron tip. Usually used for cleaning pots and pans, these little guys can be picked up at your local grocery store for $1 or so a pack. The copper mesh isn&#8217;t coated with flux, but the copper itself will draw the excess solder from the tip of the iron. Do not get the steel scourers, as they are only good for cleaning dishes.</p>
<p><img width="450" vspace="4" hspace="4" height="167" border="<br />
0&#8243; alt=&#8221;" src=&#8221;http://hackadaycom.files.wordpress.com/2008/07/holder.png&#8221; /><br />A great addition to our ti<br />
p cleaner is the use of a simple $1 &#8220;locker organizer&#8221; picked up from the dollar aisle of the local super store. Just shove the scourer into the organizer to keep it from sticking to the iron. The magnet on the bottom will also weigh it down enough to keep it on the table when you make spastic stabs at the scourer in frenzied hacking sessions.</p>
<p>Surface mount soldering is becoming more common amongstl hackers and hobbyists. This work is notorious for being one of the most tedious and annoying practices known to man. Of course, having the right tools for the job helps. The cheapest surface mount rework stations cost upwards of $100. In the past, our own [Will O'Brien] showed how to make your own <a href="http://www.engadget.com/2006/03/07/how-to-make-a-surface-mount-soldering-iron/ ">surface mount reflow iron</a>.</p>
<p>A reflow iron or pen isn&#8217;t the only tool you need for surface mount soldering. Sometimes you&#8217;ll need a <a href="http://www.synopticlabs.com/blog/index.php/2008/04/18/my-breakfast-with-reflow/">hot plate</a> or <a href="http://www.ustr.net/smt/oven.htm">oven</a>.</p>
<p><img width="450" vspace="4" hspace="4" height="369" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/07/warmer.png?w=450&#038;h=369" /><br />For smaller jobs we&#8217;ve found that using a <a href="http://www.thewicklesscandle.com/prodWarmer01.htm">candle warmer</a> can be useful. We got ours for $5 from a super store. The plate might not get completely hot enough to melt the solder by itself, but it does help a lot when you use a soldering iron or a reflow iron by decreasing the time and effort it takes to warm the joints. The sweet spot on these warmers is usually directly in the middle of the black steel plate.</p>
<p>Simply place a PCB in the center of the candle warmer and allow it to raise the temp of the solder joints. Use a reflow pen or soldering iron to heat the particular joint you want the rest of the way. It will take a lot less time to melt the solder this way. This is especially useful when placing surface mount parts, but can also be useful when taking them off of a PCB.</p>
<p>Placing all of these components together inside the fume hood, the Hacker&#8217;s Soldering Station is complete. With this project we set out to make a simple, cheap solder fume hood complete with a time and temperature soldering station. We ended up with a great soldering station and fume extractor set up. In fact, this has now replaced one of the <a href="http://www.hmcelectronics.com/cgi-bin/scripts/query.cgi?query=wlc100&amp;gclid=CLmkh8Od6JQCFQKcFQod_XiGRw">WLC100 soldering stations</a> we usually use.</p>
<p><script type="text/javascript"> digg_url = 'http://digg.com/mods/Build_a_soldering_station'; </script> <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/2393/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/2393/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/2393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/2393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/2393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/2393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/2393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/2393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/2393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/2393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/2393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/2393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/2393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/2393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/2393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/2393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2393&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/08/05/how-to-the-hackers-soldering-station/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Adam Harris</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/window.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/fan_hole.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/fan.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/twist-tie.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/lamp_shim.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/first_window.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/filter.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/stock.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/window.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/socket_face.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/timer.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/scourer.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/warmer.png" medium="image" />
	</item>
		<item>
		<title>How-To: Make an RGB combination door lock (Part 2)</title>
		<link>http://hackaday.com/2008/06/20/how-to-make-an-rgb-combination-door-lock-part-2/</link>
		<comments>http://hackaday.com/2008/06/20/how-to-make-an-rgb-combination-door-lock-part-2/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 05:00:00 +0000</pubDate>
		<dc:creator>Will O'Brien</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[cnc hacks]]></category>
		<category><![CDATA[home hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[led hacks]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[doorlock]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[keypad]]></category>
		<category><![CDATA[laser]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[rgb]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/06/20/how-to-make-an-rgb-combination-door-lock-part-2/</guid>
		<description><![CDATA[In part 1 we showed you how to build your own prototype RGB keypad. Today we&#8217;ll show off some new ideas we worked on to create the project and turn it from prototype to fully functional battle station er door lock. To replace the old door strike with our new electric unit, we had to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2066&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/laser-cutting-button-cover-plate.jpg?w=450&#038;h=300" alt="" /><br />In <a href="http://www.hackaday.com/2008/06/12/how-to-make-an-rgb-combination-door-lock-part-1/">part 1</a> we showed you how to build your own prototype RGB keypad. Today we&#8217;ll show off some new ideas we worked on to create the project and turn it from prototype to fully functional <strike>battle station</strike> er door lock.</p>
<p><span id="more-2066"></span></p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/06/trace-around-strike.jpg?w=450&#038;h=300" /><br />To replace the old door strike with our new electric unit, we had to align it with the old one. Once it was set, we traced around the mounting plate with a pen and got to work. We grabbed a 3/8 inch bit and drilled out the width and depth of the hole to match the body of the strike. Then we cleaned up things a bit with a wood chisel until the hole was just big enough. The strike requires 12 volts to release, so we had to feed some wire to it. We dug up a fairly long drill bit and drilled through the wall and into the strike mounting hole.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/03/solder-strike-wires.jpg?w=425&#038;h=283" /><br />The strike wiring is low voltage, so the wire doesn&#8217;t have to be anything special. We used some 18 gauge speaker wire &#8211; it&#8217;s cheap and we already had it in our parts bin. Pulling the wire is pretty easy. Just feed the wire through and grab the end with a pair of needle nose pliers. Since we had 50 feet of wire to work with, we pulled the wire over to our bench and did a quick soldering job to the strike leads. Once the connections were solid, we insulated them with electric tape. There&#8217;s no polarity to worry about, so just get things connected and ready to rock.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/03/installed-electric-strike.jpg?w=425&#038;h=283" /><br />The strike has a thick mounting flange, so we had to remove some wood from the surface of the door frame. After some quality time with a hammer, flat headed screw driver, and a wood chisel, we managed to cut a decent mounting slot. Once the wiring was insulated, we pulled in the slack and mounted the strike with a pair of three inch screws.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/03/old-work-boxandplate.jpg?w=425&#038;h=283" /><br />We&#8217;ll be wall mounting the keypad, so we picked up an &#8220;old-work&#8221; two gang electrical box and a two gang blank wall plate. Mounting the box is pretty easy, but we&#8217;ll walk you through it.</p>
<p><img width="425" vspace="4" hspace="4" height="286" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/03/corel-draw-template-keypad1.jpg?w=425&#038;h=286" /><br />To make the bezel, we laid out the buttons in CorelDraw and scaled up each button by a few percent. Once the size was correct, we rounded off the corners to match the buttons better.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/03/laser-cutting-button-cover-plate.jpg?w=425&#038;h=283" /><br /> After a few test fits made by cutting paper, we put the wall plate into our ever handy laser cutter. We realize that most of you don&#8217;t have one of these <a href="http://epiloglaser.com/mini24_overview.htm">awesome machines</a> &#8211; you can create your own with some careful drilling and dremel work (it might be easier to bribe the local sign shop with some beer). If you do have it laser cut, make sure you get a nylon wall plate and not a PVC plate. The fumes from burning PVC are toxic and air filters will not neutralize them.</p>
<p> <img width="450" vspace="4" hspace="4" height="290" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/button-test-fit-bezel.jpg?w=450&#038;h=290" alt="" /><br /> When we test fit the new bezel, we found that the flex at the base of each button was impeded. It&#8217;s hard to see here, but the wall plate is only about 1/32 of an inch thick. Since it&#8217;s so thin, the buttons stick out too far. </p>
<p><img width="450" vspace="4" hspace="4" height="211" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/buttons-spacer-plate.jpg?w=450&#038;h=211" alt="" /><br />To solve both problems, we created a sub-bezel. We used the same laser template, but expanded each hole a bit further. The 1/8 inch acrylic provided perfect depth for the buttons and the larger holes in the sub-bezel provide an area for the buttons to flex.</p>
<p> <img width="450" vspace="4" hspace="4" height="300" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/06/old-work-box-screw-mechanism.jpg?w=450&#038;h=300" /><br /> &#8220;Old-work&#8221; boxes are designed to be installed into existing drywall. You just have to cut a hole for the box and when the screws are tightened, these tabs will flip up to grip the inside of the wall.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/box-mounted-rgb-howto.jpg?w=450&#038;h=300" alt="" /><br />Once the hole&#8217;s cut, just insert the box and check the fit. Don&#8217;t tighten the screws just yet &#8211; we&#8217;ll be pulling it back out for a quick mod. Since we&#8217;re mounting all the hardware on the other side of the wall, we drilled a hole into the workshop side to run the keypad wiring.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/pcb-fit-test-rgb-howto.jpg?w=450&#038;h=300" alt="" /><br />It just happens that Spark Fun&#8217;s PC Board is the same width as the 2 gang box. In order to fit the bezel flush, we need to trim back the edge of the box.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/grind-box-fit-pcb.jpg?w=450&#038;h=300" alt="" /><br />You can use your favorite tool, but we grabbed our rotary tool and a small drum sanding bit. Then we ground the edge of the box down to allow for approximately two times the thickness of the keypad PC board. (You might want to adjust this depending on your bezel design.)</p>
<p><img width="450" vspace="4" hspace="4" height="278" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/board-fit-thickness.jpg?w=450&#038;h=278" alt="" /><br />The final fit is just about perfect. The edges of the drywall keep the board from shifting while the box supports the board from behind.</p>
<p><img width="450" vspace="4" hspace="4" height="224" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/install-pcb-box-wiring.jpg?w=450&#038;h=224" alt="" /><br />Now that the bezels are ready to go, mark your wiring so you can identify it post install. We used some colored electrical tape and noted the connections. Since we used Cat-5, you could easily use RJ-45 connectors to add some modularity. We didn&#8217;t need it, so we just pulled the wires through to the workshop side.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/installed-button-pad.jpg?w=450&#038;h=300" alt="" /><br />To finish up the key pad, we installed the PC board, the keypad, the acrylic sub-bezel, and finally the keypad. Everything actually floats under the keypad. The design has worked perfectly for the past few months &#8211; with one exception. One visitor pushed too hard and popped the PC board back into the wall box. If needed, you can add a support strut of some kind behind the PC board.</p>
<p><img width="450" vspace="4" hspace="4" height="271" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/eagle-schematic-rgb.jpg?w=450&#038;h=271" alt="" /><br />To create a permanent board for the keypad, we laid everything out in <a href="http://www.cadsoftusa.com/">Eagle</a>. Since we wanted to try out some interesting etching ideas, we used extra wide traces and expanded the pads to provide plenty of copper.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/spray-paint-pcbs.jpg?w=450&#038;h=300" alt="" /><br />After making the keypad bezel, we wanted to try some new tricks with the laser cutter. We coated some copper clad PC Boards with spray paint and let it harden for a few days.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/laser-etch-pcb-design.jpg?w=450&#038;h=300" alt="" /><br />To We exported the design from eagle and sent it to the Epilog via CorelDraw. In order to remove all of the paint, we had to run the etching jo<br />
b twice on the laser. Here, the laser is mid way through the second run. </p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://ww<br />
w.hackaday.com/media/2008/06/clean-residue-final.jpg&#8221; alt=&#8221;" /><br />Even after two jobs, a fine residue was still on the copper. Lightly scrubbing the board with acetone (nail polish remover) removed the left over residue. The traces remained intact and the copper was bared for the etching solution.</p>
<p><img width="450" vspace="4" hspace="4" height="340" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/etching-materials.jpg?w=450&#038;h=340" alt="" /><br />Radio Shack doesn&#8217;t bother to carry ferric chloride anymore, but we wanted local chemicals. We picked up some muriatic acid (hydrochloric acid), hydrogen peroxide, a cereal container air pump, bubble block, and some hose. The acid is readily available at the hardware store. We suggest finding the smaller container &#8211; it&#8217;s the perfect amount for a one time fill.</p>
<p><img width="450" vspace="4" hspace="4" height="400" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/etching-the-board.jpg?w=450&#038;h=400" alt="" /><br />Etching the board is the usual show. The bubbles help agitate the solution around the copper and speed up the process.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/finished-etch-rgb.jpg?w=450&#038;h=300" alt="" /><br />The finished etch came out pretty decent, if slightly over-etched. Holding the board up to a light is an easy way to check for top/bottom layer alignment. The board was slightly over-etched, but after spending a couple of weeks mucking around with the process, we decided that it was time to get on with it already.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/pcb-drilling-button-if.jpg?w=450&#038;h=300" alt="" /><br />To drill the board, we used a #59 tungsten carbide drill bit. Instead of a drill press, we manually ran our CNC mini mill to drill the board. We only broke one bit and that was when we fat-fingered a direction key.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/drilled-board-check.jpg?w=450&#038;h=300" alt="" /><br />One more quick check and the board looks perfect. The milling machine made it easy to keep the holes in line for the build.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/build-pcb-wired-arduino.jpg?w=450&#038;h=300" alt="" /><br />Finishing the build is pretty easy (the red wire going over the board was a quick design fix). We added jumpers for all of the Arduino connections and soldered the Cat-5 from the keypad directly to the new board. We won&#8217;t bore you with step by step soldering pics. If you prototyped the circuit, you should be intimately familiar with the thing by now. If you need some help soldering, be sure to check out our <a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=2&amp;url=http%3A%2F%2Fwww.hackaday.com%2F2007%2F10%2F26%2Fhow-to-introduction-to-soldering%2F&amp;ei=B-dZSIqaEoryiQH3692bDA&amp;usg=AFQjCNELRsGxMt0eh2uKmFzz8x9-gIRgdQ&amp;sig2=SXPS-hycfK03YDgeuOpO5Q">introduction to soldering</a>.</p>
<p><img width="450" vspace="4" hspace="4" height="300" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/06/final-button-entry-denied.jpg?w=450&#038;h=300" /><br />The bezel&#8217;s built, the PC Board etched, the circuit soldered, and the keypad&#8217;s installed. The only thing left to do is enjoy the new keypad&#8230; or develop more code and teach it some new tricks.</p>
<p><img width="450" vspace="4" hspace="4" height="323" border="0" src="http://hackadaycom.files.wordpress.com/2008/06/arduino-rgb-code-upload.jpg?w=450&#038;h=323" alt="" /></p>
<p>We promised to explain the code a bit, so we&#8217;ll give you a quick walk through. The meffect keypad code (available <a href="http://biobug.org/rgb-keypad/">here</a>) was written to simplify the keypad routines for the project. The first several lines initialize the various variables we&#8217;ll need to make things work. We added comments regarding pin assignment to help simplify wiring and help people change things around as needed.</p>
<p>The code to drive the digital potentiometer comes directly from <a href="http://www.arduino.cc/en/Tutorial/SPIDigitalPot">this tutorial</a>.</p>
<p>The setup() function is run one time when the controller is powered on or reset. Variables are set and i/o pins are set to their initial states as needed. </p>
<p>The loop() function is the never ending loop where the controller will perform a few tasks. The main order of business is to read the button states for input. Second, the potentiometers are set and each LED is lit temporarily, based on the values in the matrix defined for each LED state. If no action is detected, then the values are set by an effect function. However, if an action is detected, the effect is halted and the button color is set based on the number of inputs keyed in. Next, the loop counts all the button presses that are detected. If the lock exceeds the defined number (in this case, 20) then the pad glows red, state is reset and it locks the user out for about 30 seconds. The final test is the actual lock code. If the keypad state matches the predefined code, then the pad glows green and the door lock is opened for about 5 to 10 seconds.</p>
<p>The code is pretty simple, but the framework is there to produce a more secure lock. The easiest way to up your security would be to create a rolling fade effect and possibly blip the LED color when a key press is detected. Probably the coolest feature of the lock is that you can program it to behave and lock in any way you want.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/2066/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/2066/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/2066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/2066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/2066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/2066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/2066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/2066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/2066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/2066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/2066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/2066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/2066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/2066/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/2066/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/2066/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2066&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/06/20/how-to-make-an-rgb-combination-door-lock-part-2/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Will O&#039;Brien</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/laser-cutting-button-cover-plate.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/trace-around-strike.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/03/solder-strike-wires.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/03/installed-electric-strike.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/03/old-work-boxandplate.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/03/corel-draw-template-keypad1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/03/laser-cutting-button-cover-plate.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/button-test-fit-bezel.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/buttons-spacer-plate.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/old-work-box-screw-mechanism.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/box-mounted-rgb-howto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/pcb-fit-test-rgb-howto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/grind-box-fit-pcb.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/board-fit-thickness.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/install-pcb-box-wiring.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/installed-button-pad.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/eagle-schematic-rgb.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/spray-paint-pcbs.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/laser-etch-pcb-design.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/etching-materials.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/etching-the-board.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/finished-etch-rgb.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/pcb-drilling-button-if.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/drilled-board-check.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/build-pcb-wired-arduino.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/final-button-entry-denied.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/arduino-rgb-code-upload.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: Make an RGB combination door lock (Part 1)</title>
		<link>http://hackaday.com/2008/06/12/how-to-make-an-rgb-combination-door-lock-part-1/</link>
		<comments>http://hackaday.com/2008/06/12/how-to-make-an-rgb-combination-door-lock-part-1/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 18:30:00 +0000</pubDate>
		<dc:creator>Adam Harris</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[home hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[led hacks]]></category>
		<category><![CDATA[door]]></category>
		<category><![CDATA[entry]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[keypad]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[rgb]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/06/12/how-to-make-an-rgb-combination-door-lock-part-1/</guid>
		<description><![CDATA[Part 2 can be found here Putting a custom designed electronic lock on your space seems like a geek right of passage. For our latest workspace, we decided to skip the boring numbered keypad and build a custom RGB backlit keypad powered by an Arduino. Instead of typing in numbers, your password is a unique [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1975&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://hackadaycom.files.wordpress.com/2008/06/final-button-code-entry.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
<a href="http://hackaday.com/2008/06/20/how-to-make-an-rgb-combination-door-lock-part-2/"><em>Part 2 can be found here<br />
</em></a><br />
Putting a custom designed electronic lock on your space seems like a geek right of passage. For our latest workspace, we decided to skip the boring numbered keypad and build a custom RGB backlit keypad powered by an Arduino. Instead of typing in numbers, your password is a unique set of colors. In today&#8217;s How-To, we&#8217;ll show you how to build your own and give you the code to make it all work.</p>
<p><span id="more-1975"></span></p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/jmg-octinct.jpg?w=450&#038;h=231" border="0" alt="" hspace="4" vspace="4" width="450" height="231" /><br />
The basic design for the RGB keypad came from [JMG]&#8216;s <a href="http://www.upwardnotnorthward.com/2008/01/my-first-project-full-colour-rgb-monome.html">Arduino based Monome clone</a>. He used an Arduino, and multiplexed RGB LEDs with some digital potentiometers to create a color mixing keypad. Since we couldn&#8217;t fit the complete 4&#215;4 keypad into a standard 2 gang wall box, we chopped the design down to a 2&#215;4 matrix. This cuts down significantly on the cost to build the keypad and makes the code that much easier to digest.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/whiteboard-keypad-diag.jpg?w=450&#038;h=320" border="0" alt="" hspace="4" vspace="4" width="450" height="320" /></p>
<p>To build your own RGB keypad, you&#8217;ll need the following:</p>
<ul>
<li>An electric door strike (<a href="http://www.smarthome.com/519012.html">Smarthome.com</a>)</li>
<li>A locking door handle (Any hardware store)</li>
<li>An Arduino or compatible clone (<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=666">Sparkfun</a>, <a href="http://www.adafruit.com/index.php?main_page=product_info&amp;cPath=17&amp;products_id=50&amp;zenid=d0a2bb958e7ceaf5afaf51f33dab3a1d">adafruit</a> and others)</li>
<li>1 TIP120 transistor</li>
<li>1 1N4001 diode</li>
<li>10 1N4148 diodes</li>
<li>4 2n2222 transistors</li>
<li>1 Monome style keypad (<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=7835">Sparkfun Electronics</a>)</li>
<li>1 Keypad PC board (<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8033">Sparkfun Electronics</a>)</li>
<li>8 RGB LEDs (<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=105">Sparkfun Electronics</a>)</li>
<li>1 7805 voltage regulator</li>
<li> 4 100 ohm resistors</li>
<li>2 150 ohm resistors</li>
<li>8 1 kohm resistors</li>
</ul>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/new-strike-lock-mechanism.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
To reliably lock and unlock the door, we ordered an electric door strike. We scored this one as an open box item from <a href="http://www.smarthome.com/">Smarthome.com</a>. It&#8217;s a 12 Volt DC unit designed just for Schlage commercial door locks. The edge of the strike is slightly recessed from the mounting plate, so it might not work with certain locks. It features a thinner body than the non-recessed version, which will allow us to cut a smaller but deeper hole in the door frame. Without power, the strike stays locked, keeping the locking door shut. When 12 volts is applied to the coil, the strike releases, allowing the door to be pulled open. For the prototype build, you don&#8217;t have to purchase a strike just yet; you can use a LED and a resistor to indicate the door lock state for testing your code.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/whiteboard-key-matrix-rgbhowto.jpg?w=450&#038;h=261" border="0" alt="" hspace="4" vspace="4" width="450" height="261" /><br />
The keypad is actually built from two separate circuits that physically overlap. The input circuit is a simple keypad matrix. To read each button push, the Arduino brings one keypad input line high and checks the voltage of the four output lines in order. The diodes on the PC board prevent feedback across the rows and columns.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/whiteboard-led-pot-diag.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
The RGB LEDs are lit via a completely separate set of circuits. Each row of like colored LEDs is brightness controlled by a digital potentiometer. The digital pot works just like a normal pot, but it&#8217;s digitally controlled by the Arduino. Meanwhile, each column of LEDs is activated by a separate transistor. By quickly changing the resistance and stepping through the columns, each LED will appear to be individually controlled.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/whiteboard-door-lock-diag.jpg?w=450&#038;h=272" border="0" alt="" hspace="4" vspace="4" width="450" height="272" /><br />
The door strike circuit is pretty simple. Since it contains a coil, we&#8217;ll treat it like the coil of a stepper motor and use a TIP120 transistor to supply the power. When power is removed from a coil, the collapsing magnetic field creates a current within the coil. To keep the TIP120 from burning out, we&#8217;ll add a diode to handle the surge created by the field breakdown.</p>
<p>update: [Triffid] pointed out that the diode is better placed in parallel with the coil to handle the transient surge. He&#8217;s correct, but the circuit here has operated perfectly for several months, so you&#8217;ll be fine either way.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/sparkfun-pcb-buton.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
The traces for the buttons looked a bit challenging to etch at home, so we ordered this PC board that Sparkfun produces for their keypads. Sparkfun helpfully provides the layout for these keys in their eagle library, so you can make your own PCB if you prefer. For reliability, you&#8217;ll probably want to have it commercially produced. The board wasn&#8217;t really designed to break apart, but after a review of the traces and vias we decided that we could get away with trimming a couple of rows from the board.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/cut-button-pcb.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
We carefully split the board down the middle with a band saw. If you look closely, you can see where some of the vias were actually cut in half. (A paper cutter might work in a pinch) Don&#8217;t forget to put on a mask to keep the dust out of your lungs.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/spark-fun-button-pad.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
Cutting the button pad is much easier. The pads have pre-scored lines that just need a quick swipe of a sharp knife or scissors to separate them.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/button-pcb-parts.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
The new shorter PCB only needs a few parts: some 1N4148 diodes and the RGB LEDs. The silkscreen on the board indicates the direction and position of diodes and LEDs.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/cut-diode-legs-short-rgb-howto.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
Once you solder on the 1n4148 diodes, cut them as close to the PC board as you can. Flat head cutters like these work extremely well. The keypad will sit on this side of the board and we want to make sure that it can sit as flat as possible.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/led-installation-rgb-howto.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
Install the LEDs in the orientation indicated by the silk screen. Carefully push them down into the board until they&#8217;re inserted just like this. If you let them stick up too high, they&#8217;ll interfere with the keypad buttons being pushed.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/button-pcb-wired-rgb-howto.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
Once you&#8217;ve soldered all the LEDs in place, clip them flush as well. Then you&#8217;ll need to add some cable to jumper from the keypad to the interface board we&#8217;ll build. We used some old CAT-5 wiring. Since each axis of the board has eight pins, it&#8217;s perfect for the application.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/sacrificed-led-rgb-howto.jpg?w=450&#038;h=226" border="0" alt="" hspace="4" vspace="4" width="450" height="226" /><br />
Each RGB LED has three LEDs inside the package. They share a common terminal and have a single separate lead coming out. Because they have different characteristics &#8211; that is brightness, current and voltage requirements, we spent some time testing out various combinations. We even murdered a couple of innocent $2 LEDs just for you. Hey, the other two colors are still usable&#8230;</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/color-balance-leds.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
After some experimentation, we managed to find the right combination to create some fairly white light. The requirements will vary between manufacturers, but for the Sparkfun LEDs we found that a pair of 100 ohm resistors and a single 150 ohm resistor blended the red, green and blue fairly well.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/color-balance-test-rgb-howto.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
The color combination was hard on the eyes until we put the keypad over the LED to double check our findings. In real life, you can see some blending lines from the offset of each LED, but it still looks great.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/keypad-schematic-small.jpg?w=450&#038;h=242" border="0" alt="" hspace="4" vspace="4" width="450" height="242" /><br />
The circuit has plenty of components, but it&#8217;s pretty easy to build. We&#8217;ll break everything up by section to keep things easy. You can download the all of the schematics, Eagle project files, and code for the Arduino <a href="http://biobug.org/rgb-keypad/">here</a>.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/ad5206-schematic.jpg?w=450&#038;h=234" border="0" alt="" hspace="4" vspace="4" width="450" height="234" /><br />
The digital pot has six outputs. Each of these will power a row of red, green or blue LEDs, via a color matching resistor. The digital potentiometer wiring comes directly from <a href="http://www.arduino.cc/en/Tutorial/SPIDigitalPot">this how-to</a>. You can read it if you need more information, or use our quick version:</p>
<ul>
<li> Connect AD5206 pins 3, 6, 10, 13, 16, 21 and 24 to 5v.</li>
<li> Connect pins 1, 4, 9, 12, 15, 18, 19, and 22 to ground.</li>
<li> Connect pot pin 5 to Arduino pin 10</li>
<li> Connect pot pin 7 to Arduino pin 11</li>
<li> Connect pot pin 8 to Arduino pin 13</li>
</ul>
<p>Grab four 100 ohm resistors and two 150 ohm resistors. Place them in the breadboard in a row with each end in a separate bus. (Across the center of the board is easiest) Connect the six LED leads from the keypad to one end of each resistor &#8211; reds get the 150&#8242;s and blue and green into the 100&#8242;s. Here&#8217;s the connection order we used.</p>
<ul>
<li>RED3 to a 150 ohm resistor to pot pin 14</li>
<li>GREEN3 to a 100 ohm resistor to pot pin 11</li>
<li>BLUE3 to a 100 ohm resistor to pot pin 2</li>
<li>RED4 to a 150 ohm resistor to pot pin 23</li>
<li>GREEN4 to a 100 ohm resistor to pot pin 20</li>
<li>BLUE4 to a 100 ohm resistor to pot pin 17</li>
</ul>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/transistors-schematic1.jpg?w=450&#038;h=241" border="0" alt="" hspace="4" vspace="4" width="450" height="241" /><br />
To ground the LED busses, we&#8217;ll be using four 2N2222 transistors. The Arduino will trigger each transistor individually through a 1Kohm resistor. The collector of each transistor connects to a ground line from the keypad. The emitter of each transistor is connected to the ground. The four transistor select lines connect to Arduino pins 0, 1, 2, and 3. Yes, they&#8217;re marked Analog in, but it doesn&#8217;t matter.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/switches-schematic.jpg?w=350&#038;h=423" border="0" alt="" hspace="4" vspace="4" width="350" height="423" /><br />
The keypad switch matrix is connected in four columns and two rows. Each of the four columns gets a pull-down resistor. We used 1Kohm resistors for R11, R12, R13, and R14; one lead connects to the columns and the other is grounded.</p>
<p>Arduino pins 2 and 3 should connect to the two ungrounded lines, which are marked SWITCH3 and SWITCH4 on the PC board (5 and 6 on the schematic).</p>
<p>Arduino pins 6, 7, 8, and 9 should connect to the four output lines marked SWT-GND1, SWT-GND2, SWT-GND3, and SWT-GND4 (1-4 on the schematic).</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/7805-schematic.jpg?w=365&#038;h=213" border="0" alt="" hspace="4" vspace="4" width="365" height="213" /><br />
The final version of the board takes a 12VDC input to drive the door lock. We added a 7805 to drop the 12V down to 5V for the Arduino. You don&#8217;t need it for the prototype version unless you want to test the striker. The Arduino has an on-board regulator, but 7805&#8242;s are cheap and it helps reduce the load on the Arduino&#8217;s built in regulator. For code development, we just connected an LED with a resistor to the output line that will control the door lock.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/prototyped-board-rgb-howto.jpg?w=450&#038;h=250" border="0" alt="" hspace="4" vspace="4" width="450" height="250" /><br />
With everything wired in the prototyping board, it&#8217;s time to test things out. With any luck, you&#8217;ll soon be rewarded by the pulsing, glowing sight of several RGB LEDs under your tender digits.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/arduino-rgb-code-upload.jpg?w=450&#038;h=323" border="0" alt="" hspace="4" vspace="4" width="450" height="323" /><br />
Programming the Arduino is a snap. Just download the software for your OS <a href="http://www.arduino.cc/en/Main/Software">here</a>. Now follow the <a href="http://www.arduino.cc/en/Guide/HomePage">Getting Started guide</a> to get the Arduino software talking to the Arduino board. Once you&#8217;ve enjoyed the blinking LED demo, come back here and get your keypad rolling.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/serial-console-arduino-test.jpg?w=450&#038;h=214" border="0" alt="" hspace="4" vspace="4" width="450" height="214" /><br />
Once you&#8217;ve set up and tested your Arduino, it&#8217;s time to test out your prototype. Download the button_test code from <a href="http://biobug.org/rgb-keypad/">here</a>. Paste it into a new sketch and upload it to the Arduino. Click the serial console button and you should start seeing dots accumulating in the window. If you press a button on the pad, the Arduino should print a message to the console and toggle the lock output state.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/rgb-fade-led-test.jpg?w=450&#038;h=276" border="0" alt="" hspace="4" vspace="4" width="450" height="276" /><br />
Once your buttons are tested, you&#8217;ll probably want to try out your LEDs. Grab the RGB_light_fade routine from the <a href="http://biobug.org/rgb-keypad/">same page</a> and upload it to your Arduino. You should get treated to a nice little light show. This is our favorite demo because it really shows off the color mixing capabilities of the digital potentiometer.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/final-button-green-entry.jpg?w=450&#038;h=212" border="0" alt="" hspace="4" vspace="4" width="450" height="212" /><br />
With your LEDs and buttons working, you can grab the row_entry_pad_meffect lock code from the same place and upload it. Now the keypad should start flashing blue buttons while it&#8217;s idle. On key presses, the keys will change colors. By entering the correct color code, the pad will flash green and unlock the door for 10 seconds. If you go over the limit counter, it will flash red for 30 seconds.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/06/final-button-code-entry.jpg?w=450&#038;h=300" border="0" alt="" hspace="4" vspace="4" width="450" height="300" /><br />
Next time we&#8217;ll show you how to make the permanent version of the keypad, walk through the code for the Arduino, make the PC board, cut a custom wall plate, and install the lock strike.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1975/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1975/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1975/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1975&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/06/12/how-to-make-an-rgb-combination-door-lock-part-1/feed/</wfw:commentRss>
		<slash:comments>52</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Adam Harris</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/final-button-code-entry.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/jmg-octinct.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/whiteboard-keypad-diag.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/new-strike-lock-mechanism.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/whiteboard-key-matrix-rgbhowto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/whiteboard-led-pot-diag.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/whiteboard-door-lock-diag.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/sparkfun-pcb-buton.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/cut-button-pcb.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/spark-fun-button-pad.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/button-pcb-parts.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/cut-diode-legs-short-rgb-howto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/led-installation-rgb-howto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/button-pcb-wired-rgb-howto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/sacrificed-led-rgb-howto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/color-balance-leds.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/color-balance-test-rgb-howto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/keypad-schematic-small.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/ad5206-schematic.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/transistors-schematic1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/switches-schematic.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/7805-schematic.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/prototyped-board-rgb-howto.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/arduino-rgb-code-upload.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/serial-console-arduino-test.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/rgb-fade-led-test.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/final-button-green-entry.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/06/final-button-code-entry.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: Super simple serial terminal</title>
		<link>http://hackaday.com/2008/05/29/how-to-super-simple-serial-terminal/</link>
		<comments>http://hackaday.com/2008/05/29/how-to-super-simple-serial-terminal/#comments</comments>
		<pubDate>Fri, 30 May 2008 03:00:00 +0000</pubDate>
		<dc:creator>Adam Harris</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[peripherals hacks]]></category>
		<category><![CDATA[hackaday]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/05/29/how-to-super-simple-serial-terminal/</guid>
		<description><![CDATA[This hack shows how to make a dumb terminal out of a keyboard, LCD screen, and an 8-bit microcontroller. From time to time, a portable dumb terminal can be handy for when you have to rescue a headless server that&#8217;s acting up or if you are building a minicomputer out of a WRT, or if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1895&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;"><img src="http://hackadaycom.files.wordpress.com/2008/05/root.png?w=450&#038;h=338" border="0" alt="" hspace="4" vspace="4" width="450" height="338" /></div>
<p>This hack shows how to make a dumb terminal out of a keyboard, LCD screen, and an 8-bit microcontroller. From time to time, a portable dumb terminal can be handy for when you have to rescue a headless server that&#8217;s acting up or if you are building a minicomputer out of a WRT, or if you just want to learn how to run a keyboard and LCD screen with a microcontroller. This super simple serial terminal will use RS-232 to control a headless linux system. Additionally, you might want to check into some of the <a href="http://tuxtraining.com/2008/05/15/welcome-to-the-linux-command-line-interface-desktop/">command line interface programs</a> that allow web browsing, AIM and IRC chatting and more directly from the terminal, but nothing beats being able to <a href="http://random.noflashlight.com/">track your pizzas</a> with this device.</p>
<p>The Linux system in question here will be <a href="http://www.linuxmint.com/">Linux Mint</a>. It&#8217;s a young distro based on Ubuntu that&#8217;s gaining a lot of attention lately, though the principles can be used for other Linux distros.</p>
<p><span id="more-1895"></span></p>
<p>The Hardware:<br />
For this How-To we&#8217;ll be using an ATMEGA128 running at 16MHz. Since this device will be communicating through RS-232, we&#8217;re going to need a level shifter. RS-232 uses 12 volt signals which will fry our 5V microcontroller. To fix this problem, we&#8217;re going to use a MAX233 chip.</p>
<div style="text-align:center;"><img src="http://hackadaycom.files.wordpress.com/2008/05/max233%28single%29.png?w=450&#038;h=202" border="0" alt="MAX233 schematic" hspace="4" vspace="4" width="450" height="202" /></div>
<p>This is the schematic of the level shifter circuit.</p>
<div style="text-align:center;"><img src="http://hackadaycom.files.wordpress.com/2008/05/max233_layout.png?w=377&#038;h=369" border="0" alt="Max233 layout" hspace="4" vspace="4" width="377" height="369" /></p>
<div style="text-align:left;">This is an example layout.</div>
</div>
<p>I&#8217;m using the <a href="http://www.futurlec.com/ET-AVR_Stamp.shtml">ET-AVR stamp module </a>with the <a href="http://www.futurlec.com/ET-AVR_Stamp_Board.shtml">stamp board </a>for this project. This dev board is cheap and has the essentials built in. I&#8217;ll be using the on board power supply and the MAX232 RS-232 level converter.</p>
<p>The LCD chosen for this project is a very common 4&#215;20 character LCD. These LCDs are really easy to control <a href="http://www.maxmon.com/lcd2.PDF">with a microcontroller</a>(PDF), and <a href="http://www.maxmon.com/lcd1.PDF">even without one</a>(PDF). The HD44780 chip allows for several bit widths for parallel programming, as well as commands, and even custom characters. This LCD has nice software library, which makes it even easier to use.</p>
<p>A more attractive choice would have been to go with a graphical LCD, which are also supported by our library, however, we only had the character LCD on hand.</p>
<p>A common AT keyboard will be used for character input, again these aren&#8217;t hard to find, you probably have an extra one laying around somewhere .</p>
<p>If you don&#8217;t want to buy the ET-AVR, you can build the circuit for this hack yourself. (Click for larger pic).</p>
<div style="text-align:center;"><a href="http://hackadaycom.files.wordpress.com/2008/05/full_schematic.png"><img src="http://hackadaycom.files.wordpress.com/2008/05/full_schematic_sm.png?w=450&#038;h=386" border="0" alt="" hspace="4" vspace="4" width="450" height="386" /></a></div>
<p>A full parts list of above circuit: :</p>
<table border="0">
<tbody>
<tr>
<th>Part</th>
<th> Jameco Part #</th>
<th> Futurlec Part #</th>
</tr>
<tr>
<td>Atmega128 IC</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=1406045">1406045</a></td>
<td><a href="http://www.futurlec.com/Atmel/ATMEGA128.shtml">ATMEGA128-16AC</a></td>
</tr>
<tr>
<td>16MHz Crystal</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=14453&amp;productId=14453">14453 </a></td>
<td><a href="http://www.futurlec.com/Crystals/CRY16000.shtml">CRY16.000</a></td>
</tr>
<tr>
<td>DB9 Connector (female)</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=15771&amp;productId=15771">15771 </a></td>
<td><a href="http://www.futurlec.com/Connectors/DSUBSCF9.shtml">DSUBSCF9</a></td>
</tr>
<tr>
<td>DB9 Hood</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=1719922">1719922</a></td>
<td><a href="http://www.futurlec.com/Connectors/DSUBCH9.shtml">DSUBCH9</a></td>
</tr>
<tr>
<td>MAX233 Level Converter</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=106163&amp;productId=106163">106163</a></td>
<td><a href="http://www.futurlec.com/Maxim/MAX233CPP.shtml">MAX233CPP</a></td>
</tr>
<tr>
<td>22pF Capacitor (x&#8217;s2)</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=332340">332340</a></td>
<td><a href="http://www.futurlec.com/Capacitors/C022PC.shtml">C022PC</a></td>
</tr>
<tr>
<td>0.1uF Ceramic Capacitor</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=151118&amp;productId=151118">151118</a></td>
<td><a href="http://www.futurlec.com/Capacitors/C100UC.shtml">C100UC</a></td>
</tr>
<tr>
<td>220 ohm Resistor</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=690700&amp;productId=690700">690700</a></td>
<td><a href="http://www.futurlec.com/Res14W.shtml">R220R14W</a></td>
</tr>
<tr>
<td>10k ohm Resistor</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=691104&amp;productId=691104">691104</a></td>
<td><a href="http://www.futurlec.com/Res14W.shtml">R010K14W</a></td>
</tr>
<tr>
<td>10k Potentiometer</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=255522&amp;productId=255522">255522</a></td>
<td><a href="http://www.futurlec.com/Potentiometers/TRIM10K.shtml">TRIM10K</a></td>
</tr>
<tr>
<td>6 Pin Minidin (optional)</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=310789">310789 </a>(cut)</td>
<td><a href="http://www.futurlec.com/DIN-S-VHS.shtml">MINIDIN6PC</a></td>
</tr>
<tr>
<td>4&#215;20 Character LCD</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=658873&amp;productId=658873">658873</a></td>
<td><a href="http://www.futurlec.com/LED/BLUELCD16x2BL.shtml">BLUELCD20X4BL</a></td>
</tr>
<tr>
<td>AT Keyboard</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=319812&amp;productId=319812">319812</a></td>
</tr>
</tbody>
</table>
<p>If you would like to use the ET-AVR or some other dev board, you can use this parts list:</p>
<table border="0">
<tbody>
<tr>
<th>Part</th>
<th> Jameco Part #</th>
<th> Futurlec Part #</th>
</tr>
<tr>
<td>ET-AVR stamp module</td>
<td></td>
<td><a href="http://www.futurlec.com/ET-AVR_Stamp.shtml">ET-AVR STAMP</a></td>
</tr>
<tr>
<td>ET-AVR stamp board</td>
<td></td>
<td><a href="http://www.futurlec.com/ET-AVR_Stamp.shtml">ET-AVR STAMP </a></td>
</tr>
<tr>
<td>ET-AVR programmer</td>
<td></td>
<td><a href="http://www.futurlec.com/ET-AVR_Stamp.shtml">ET-AVR ISP</a></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>DB9 Connector (female)</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=15771&amp;productId=15771">15771 </a></td>
<td><a href="http://www.futurlec.com/Connectors/DSUBSCF9.shtml">DSUBSCF9</a></td>
</tr>
<tr>
<td>DB9 Hood</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=1719922">1719922</a></td>
<td><a href="http://www.futurlec.com/Connectors/DSUBCH9.shtml">DSUBCH9</a></td>
</tr>
<tr>
<td>220 ohm Resistor</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=690700&amp;productId=690700">690700</a></td>
<td><a href="http://www.futurlec.com/Res14W.shtml">R220R14W</a></td>
</tr>
<tr>
<td>10k ohm Resistor</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=691104&amp;productId=691104">691104</a></td>
<td><a href="http://www.futurlec.com/Res14W.shtml">R010K14W</a></td>
</tr>
<tr>
<td>10k Potentiometer</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=255522&amp;productId=255522">255522</a></td>
<td><a href="http://www.futurlec.com/Potentiometers/TRIM10K.shtml">TRIM10K</a></td>
</tr>
<tr>
<td>6-Pin Minidin (optional)</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=310789">310789</a> (cut)</td>
<td><a href="http://www.futurlec.com/DIN-S-VHS.shtml">MINIDIN6PC</a></td>
</tr>
<tr>
<td>4&#215;20 Character LCD</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=658873&amp;productId=658873">658873</a></td>
<td><a href="http://www.futurlec.com/LED/BLUELCD16x2BL.shtml">BLUELCD20X4BL</a></td>
</tr>
<tr>
<td>AT Keyboard</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;pa=319812&amp;productId=319812">319812</a></td>
</tr>
</tbody>
</table>
<p><span style="font-weight:bold;">The Software</span>:<br />
We used <a href="http://winavr.sourceforge.net/">WinAVR</a> with <a href="http://hubbard.engr.scu.edu/avr/avrlib/">AVRlib</a> installed. AVRlib is a set of libraries that can run servos, set up A/D conversions, etc. It can do pretty much anything else you need it to do. To install WinAVR, <a href="http://sourceforge.net/project/showfiles.php?group_id=68108&amp;package_id=66543&amp;release_id=598832">get the newest version here</a> and follow the directions on the installer. We generally don&#8217;t follow the directions here for installing AVRlib and place it into the include folder of WinAVR installation found at C:/WinAVR/avr/include/AVRlib. This way your included headers are easier to see and find.</p>
<p>eg. #include &lt;AVRlib/servo.h&gt;</p>
<p>Once this is done, you can open up Programmer&#8217;s Notepad and begin coding. We&#8217;ve already written <a href="http://projectbloc.com/Terminal.zip">the code for this project</a> (with room left over for some adventurous readers to modify).</p>
<p><span style="font-weight:bold;">The Keyboard Protocol:</span><br />
Keyboards use a simple serial communication setup. There are only 2 lines, the DATA and the CLOCK. Generally, nothing is happening on these lines (both the CLOCK and DATA lines are high) until you hit a key. Once a key is pressed, the DATA line goes low. Shortly thereafter, the CLOCK falls. The clock will go for a total of 11 cycles. As this happens, data must be read form the DATA line on the falling edge of the clock. The data is sent from the keyboard in reverse (least significant bit first) with a parity and a stop bit.</p>
<p>The overall data package is:</p>
<table border="1">
<tbody>
<tr>
<td style="text-align:center;">Start Bit</td>
<td style="text-align:center;">D0</td>
<td style="text-align:center;">D1</td>
<td style="text-align:center;">D2</td>
<td style="text-align:center;">D3</td>
<td style="text-align:center;">D4</td>
<td style="text-align:center;">D5</td>
<td style="text-align:center;">D6</td>
<td style="text-align:center;">D7</td>
<td style="text-align:center;">Parity</td>
<td style="text-align:center;">Stop Bit</td>
</tr>
</tbody>
</table>
<p>The Start bit, Parity bit, and Stop bits are going to be ignored in this simple hack.</p>
<p>After the keyboard sends a key&#8217;s scancode, it also sends a 0xF0 when the key has been released.</p>
<p>Looking at an example, it is easier to understand. Imagine the &#8216;m&#8217; key has been hit on the keyboard. The data line goes low to make a start bit, then the scancode is sent with the LSB first, then the parity (odd parity) and a stop bit. Since the scancode for &#8216;m&#8217; is 0x3A, we should get that value in the data portion of the package. Again, the keyboard sends data LSB first, so since we are expecting 0x3A (binary 00111010) we will actually get the reverse of that (binary 010111100). Just remember to read the data bits from right to left to make it easier to see the scancode. After the data, we&#8217;ll receive a 1 in the parity bit to make the package odd parity, then the stop bit. After the scan code has been sent, the keyboard will send another scancode when the button has been released. This release code is always 0xF0 and can be ignored, and it gets handled in the code.</p>
<p>So when &#8216;m&#8217; is hit, the keyboard sends :</p>
<table border="1">
<tbody>
<tr>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">= &#8216;m&#8217; or 0x3A</td>
</tr>
<tr>
<td style="text-align:center;">Start Bit</td>
<td style="text-align:center;">D0</td>
<td style="text-align:center;">D1</td>
<td style="text-align:center;">D2</td>
<td style="text-align:center;">D3</td>
<td style="text-align:center;">D4</td>
<td style="text-align:center;">D5</td>
<td style="text-align:center;">D6</td>
<td style="text-align:center;">D7</td>
<td style="text-align:center;">Parity</td>
<td style="text-align:center;">Stop bit</td>
<td style="text-align:center;"></td>
</tr>
</tbody>
</table>
<table border="1">
<tbody>
<tr>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">0</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">1</td>
<td style="text-align:center;">= Release (0xF0)</td>
</tr>
<tr>
<td style="text-align:center;">Start Bit</td>
<td style="text-align:center;">D0</td>
<td style="text-align:center;">D1</td>
<td style="text-align:center;">D2</td>
<td style="text-align:center;">D3</td>
<td style="text-align:center;">D4</td>
<td style="text-align:center;">D5</td>
<td style="text-align:center;">D6</td>
<td style="text-align:center;">D7</td>
<td style="text-align:center;">Parity</td>
<td style="text-align:center;">Stop bit</td>
<td style="text-align:center;"></td>
</tr>
</tbody>
</table>
<p>A more advanced explanation on how this works can be found <a href="http://www.beyondlogic.org/keyboard/keybrd.htm">elsewhere</a>.</p>
<p>We must only read the data line as the clock falls to make sure we get good data. We attempted to do this using an external interrupt on the ATMEGA128 and AVRlib&#8217;s external interrupts routines. This proved more complicated than it needed to be. We then remembered that not too long ago Sparkfun had posted about some kind of keyboard widget on their site that used an AVR. The code for their keyboard reading routine was really simple and didn&#8217;t use external interrupts at all. We modified the &#8220;getkey&#8221; routine from the one [Nathan] at Sparkfun wrote for their <a href="http://www.sparkfun.com/commerce/present.php?p=Key-Counter">key-counter widget</a>.</p>
<p>Once the scancodes have been read, they must be converted into something useful. As far as we could tell, keyboard scancodes have no mathematical relation to ASCII code so we set up two ASCII lists. Each list is actually an array of ASCII characters. One list has all the values for shifted characters, and another list has the values for unshifted characters. We looked up the ASCII value for each scancode and placed them in the array in order. This allows for a simple way to return the ASCII value of a given scancode.</p>
<p>When you hit the &#8216;h&#8217; key for instance, the program catches the scancode 0&#215;33 and goes to the 0&#215;33 rd value in that array, which happens to be 0&#215;68, the ASCII value of &#8216;h&#8217;. The resulting ASCII character is sent to the LCD and to the UART, both being controlled by AVRlib to make them easier to deal with.</p>
<p>There are a lot of 0s used as placeholders in the arrays. This is because AVRlib automatically loads the LCD&#8217;s CG RAM address 0&#215;00 (the ASCII code for NULL) with a character. Basically, if those codes are send to the LCD, it will just look like garbled mess. We used &#8217;0&#8242; so we could tell what was going in if that were the case.</p>
<p>Extended keys are not currently supported. The Function keys (F1-F12) have been given normal functions used in Linux, but not supported by the rest of the program. For example, pressing F1 sends the same command as &#8220;Ctrl+X&#8221; in Linux. See the code for the other function keys. Not all the keys are used (purposely) so if you want to add custom functions to the terminal, there&#8217;s plenty of space to.</p>
<p><span style="font-weight:bold;">The UART:</span><br />
The ATMEGA128 has two UART ports. Using the first one (UART0) characters can be sent from the AVR to the terminal, and vice versa. The UART is initialized and set to 9600 baud, 8-bits, no parity, one stop bit. Make sure to set the terminal program to the same settings. We&#8217;ll modify Linux later to make sure the settings match.</p>
<p>With AVRlib, using the UART is a breeze. Simply initialize it, give it a baud rate, and you can start sending and receiving data.</p>
<p><span style="font-weight:bold;">Fiddling with Linux:</span><br />
You&#8217;ll either need a monitor and keyboard on the Linux machine, or SSH into the machine and set this up.</p>
<p>There are <a href="http://www.howtoforge.com/setting_up_a_serial_console">several</a> <a href="http://znark.com/tech/serialconsole.html">good</a> <a href="http://www.vanemery.com/Linux/Serial/serial-console.html">guides</a> on the internet for setting up a Linux machine to use a serial console. However, Linux Mint is based off of Ubuntu, which is a bit different than most OSs when it comes to setting up serial access at boot. <a href="http://www.debuntu.org/how-to-set-up-a-serial-console-on-ubuntu">This guide explains the basics</a>, but we&#8217;ll need to tweak that a little to make it work for us.</p>
<p>First you need to find out if you even have a serial port on your machine. Look at the back and try to find a DB9 connector.</p>
<div style="text-align:center;"><img src="http://hackadaycom.files.wordpress.com/2008/05/serial_port.png?w=241&#038;h=396" border="0" alt="" hspace="4" vspace="4" width="241" height="396" /></div>
<p>Now you will need to figure out what that serial port is referenced on your machine. Open a terminal window on the machine and enter the following command:</p>
<p>======================================<br />
<code>$ dmesg | grep tty</code><br />
======================================</p>
<p>The output will be something like this:<br />
======================================<br />
<code>[ 35.742036] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A<br />
[ 35.742435] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A</code><br />
======================================<br />
This shows that we have 1 serial port on this particular machine. And it is called &#8220;ttyS0&#8243;.</p>
<p>Now we must set up a way of logging into the serial console. This is handled by the getty process. This process will open the tty port you specify and send a login prompt.</p>
<p>To set this up, we need to create a file in /etc/event.d called ttyS0. Open up your favorite text editor and type in the following:</p>
<p>======================================<br />
<code>start on runlevel 2<br />
start on runlevel 3<br />
start on runlevel 4<br />
start on runlevel 5</code></p>
<p>stop on runlevel 0<br />
stop on runlevel 1<br />
stop on runlevel 6</p>
<p>respawn<br />
exec /sbin/getty -L 115200 ttyS0 vt102<br />
======================================</p>
<p>Now save this file as /etc/event.d/ttyS0.</p>
<p>Now, that&#8217;s fine for the regular users on the machine, but to do things as root, there will have to be a pass in the /etc/securetty file. Go to /etc and use a text editor to open the securetty file. (That&#8217;s &#8220;securetty&#8221;, not &#8220;security&#8221; ).In this file, type &#8220;ttyS0&#8243;. This allows that port to have root access. Save the file and close the editor.<br />
Now the final step is to have the console available when the machine boots. To do this, we must modify the grub bootloader. You have to go to /boot/grub and edit the menu.lst file. First go there and make a clean copy of the menu.lst file:</p>
<p>======================================<br />
<code>cp /boot/grub/menu.lst /boot/grub/menu_orig.lst</code><br />
======================================</p>
<p>Now open menu.lst in a text editor and type the following</p>
<p>======================================<br />
<code>serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1<br />
terminal --timeout=10 serial console</code><br />
======================================</p>
<p>This first line tells grub that you want ttyS0 to be used (&#8211;unit=0) with a baud rate of 9600 (&#8211;speed=9600) using 8n1 (&#8211;word =8&#8211;parity=no &#8211;stop=1)</p>
<p>The second line says to display the terminal on both the serial console as well as the screen, if there is one.</p>
<p>If you want to watch the boot messages on the serial console, you can add the following line to the end of the &#8220;kernel&#8221; line in this file:</p>
<p>======================================<br />
<code>console=ttyS0,9600n8 console=tty0</code><br />
======================================</p>
<p>Save this file.</p>
<p>Now you should have access to the serial console when you boot, but the default shell is bash. This is bad because bash sends a lot of extra characters when it executes commands. On many terminals, these characters are stripped from displaying, however, it is hard to do that on an LCD, and with only 80 characters, we don&#8217;t have much room to spare on our screen. We need to use something a little simpler.</p>
<p>[Fabienne] suggested using sh as the shell to get rid of bash&#8217;s weird characters. This worked during tests, so we made it the default shell on the machine. This allows it to automatically load during the boot, making it much easier to use with the device we&#8217;ve just made.To do this, simply open a terminal window and type:</p>
<p>======================================<br />
<code>chsh</code><br />
======================================</p>
<p>This will ask you for your password. Once you enter it, you will see a screen like this:</p>
<p>======================================<br />
<code>Changing the login shell for &lt;username&gt;<br />
Enter the new value, or press ENTER for the default.<br />
Login shell [/bin/bash]</code><br />
======================================</p>
<p>At this point you need to type the following:</p>
<p>======================================<br />
<code>/bin/sh<br />
</code>======================================</p>
<p>Hitting ENTER again will save this new setting.</p>
<p>Now you are ready to connect the device and see it in action!</p>
<p><span style="font-weight:bold;">Connecting the device:</span><br />
You can play with this on a windows machine, but its real power is with a Linux machine. If you have a Windows machine, you can now communicate to the device through hyperterminal or some other <a href="http://realterm.sourceforge.net/">terminal</a> <a href="http://hp.vector.co.jp/authors/VA002416/teraterm.html">program</a>. Just plug in a serial cable to the DB9 plug and set the terminal to 8n1 as mentioned above. Typing on the keyboard will display on the terminal and on the LCD.</p>
<p>To use it with the Linux machine, plug in the DB9 to the serial port on the computer, and turn the machine on. The first that that should happen is that the system will ask you to &#8220;Press any key to continue&#8221;. Hit anything on the keyboard to begin loading the OS. After pressing the key, you should see all the boot information scrolling on the screen. Once this stops, hit &#8220;enter&#8221;. This will bring up the logon screen (remember setting up the getty?).</p>
<div style="text-align:center;"><img src="http://hackadaycom.files.wordpress.com/2008/05/login.png?w=450&#038;h=338" border="0" alt="" hspace="4" vspace="4" width="450" height="338" /></div>
<p>Type your login name, and hit enter, then your password. As with most Linux systems, typing in the password field will NOT print to the screen. Go ahead and get an &#8220;ls&#8221; of your home directory. Notice that the screen isn&#8217;t large enough to show all the files and folders. We&#8217;ve written in a simple single screen buffer that will show the previous 4 lines displayed on the screen. So this kind of emulates a &#8220;Page Up&#8221; function.</p>
<p>Now you have the code, and the hardware lists, lets see what you can do with it.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1895/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1895/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1895/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1895/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1895&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/05/29/how-to-super-simple-serial-terminal/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Adam Harris</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/root.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/max233%28single%29.png" medium="image">
			<media:title type="html">MAX233 schematic</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/max233_layout.png" medium="image">
			<media:title type="html">Max233 layout</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/full_schematic_sm.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/serial_port.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/login.png" medium="image" />
	</item>
		<item>
		<title>How-To: Expand your camera with CHDK</title>
		<link>http://hackaday.com/2008/05/27/how-to-expand-your-camera-with-chdk/</link>
		<comments>http://hackaday.com/2008/05/27/how-to-expand-your-camera-with-chdk/#comments</comments>
		<pubDate>Tue, 27 May 2008 18:00:00 +0000</pubDate>
		<dc:creator>loganwilliams</dc:creator>
				<category><![CDATA[digital cameras hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[chdk]]></category>
		<category><![CDATA[digicam]]></category>
		<category><![CDATA[digitalcamera]]></category>
		<category><![CDATA[dslr]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[hdr]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[intervalometer]]></category>
		<category><![CDATA[lifehacker]]></category>
		<category><![CDATA[pointandshoot]]></category>
		<category><![CDATA[powershot]]></category>
		<category><![CDATA[timelapse]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/05/27/how-to-expand-your-camera-with-chdk/</guid>
		<description><![CDATA[As anyone who has lusted over the technical specifications for Canon&#8217;s new Digital Rebel XSi knows, the capabilities of the average point and shoot camera are severely limited. Using the CHDK firmware hack, the features of Canon point and shoot cameras can be significantly expanded, allowing for ultra-high speed photography, very long exposures, time lapse [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1883&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="450" height="338" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=32caf6d56b&amp;photo_id=2492006969" /><param name="bgcolor" value="#000000" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.flickr.com/apps/video/stewart.swf?v=49235" /><embed type="application/x-shockwave-flash" width="450" height="338" src="http://www.flickr.com/apps/video/stewart.swf?v=49235" allowfullscreen="true" bgcolor="#000000" flashvars="intl_lang=en-us&amp;photo_secret=32caf6d56b&amp;photo_id=2492006969"></embed></object></p>
<p>As anyone who has lusted over the technical specifications for Canon&#8217;s new <a href="http://www.mahalo.com/Canon_EOS_Rebel_XSi_DSLR">Digital Rebel XSi</a> knows, the capabilities of the average point and shoot camera are severely limited. Using the <a href="http://chdk.wikia.com/wiki/Main_Page">CHDK firmware hack</a>, the features of Canon point and shoot cameras can be significantly expanded, allowing for ultra-high speed photography, very long exposures, time lapse photography, and RAW capture. This How-To provides a guide to our experiences using the CHDK firmware, and shows just how easy it is to get more out of a point and shoot than ever thought possible.</p>
<p><span id="more-1883"></span></p>
<h2>Installing CHDK</h2>
<p>The first step is to install the CHDK software. Our friends at Lifehacker <a href="http://lifehacker.com/387380/turn-your-point+and+shoot-into-a-super+camera">recently ran an article covering exactly that</a>, so we won&#8217;t bother repeating the instructions. Be sure to install the Allbest build, it has all of the nice features.</p>
<p>After installing, you&#8217;ll want to have the firmware autoload when you boot up your camera. To do so, open up the main CHDK menu by pressing your ALT button, then the MENU button. Scroll down to &#8220;Debug parameters&#8221;, then click on &#8220;Make card bootable&#8230;&#8221; After it is done, turn off your camera, remove the SD card, and toggle the write protect switch. When this switch is toggled, the camera will automatically boot into CHDK (you&#8217;ll still be writing to it).</p>
<h2>Taking long exposures</h2>
<p>Long exposure photography is appreciated for its soft, sometimes surreal images of (usually) night scenes. Many point and shoot cameras only allow exposures of 15 seconds, but with CHDK, you can take photos at up to 64 seconds.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/sss_example.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>Navigate to CHDK&#8217;s main menu and find Extra Photo Operations. In Extra Photo Operations, change the Override Shutter Speed value to the shutter speed you wish to shoot at, such as 64 seconds. Scroll down and change the Value Factor from OFF to 1.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/sss_menu.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>Though the camera will not indicate the modified shutter speed, the changes will take place. Just take a picture as you normally would. Be sure to have your camera set to manual mode. Taking photos of moving things works best for long exposures: try subjects like the ocean, windy trees, and traffic. Additionally, using <a href="http://www.cs.mtu.edu/~shene/DigiCam/User-Guide/filter/filter-ND.html">neutral density filters</a>, you can even take long exposures in the day time!</p>
<h2>Taking ultra-fast exposures</h2>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/fss_example.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>Just as you can override the shutter speed for long exposures, you can take ultra-fast exposures as well, at up to 1/100,000 of a second with some cameras. Flash will sync at up to 1/60,000 of a second, and you&#8217;ll need flash with such short exposures. We were unsure how useful or easy this would be to use, but the results surprised us: in just a few minutes we were able to capture nice looking water droplets, without a hint of motion blur.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/fss_menu.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>Navigate to CHDK&#8217;s main menu and find Extra Photo Operations. In Extra Photo Operations, change the Override Shutter Speed value to the shutter speed you wish to shoot at, such as 1/16,000 of a second. Scroll down and change the Value Factor from OFF to 1. Be sure to have your camera set to manual mode.</p>
<p>Note that the minimum shutter speed is restricted by the aperture value you have selected in the camera&#8217;s manual settings. The wide end (lower numbers), can usually only shoot at down to 1/8000 of a second, while the narrower end (higher numbers) can shoot for the full range.</p>
<p>Prefocus before taking the picture, either by using manual focus mode, or by holding the shutter button halfway down. Though the camera will not indicate the modified shutter speed, it will use the short shutter speed. There are many different things that can be done with high speed photography: capture water droplets, capture explosions, or even capture a bullet leaving a gun. All of these are possible with CHDK.</p>
<h2>Running scripts</h2>
<p>The real power in CHDK comes from running user made scripts. The first script we will look at is an intervalometer, which allows you to take many photos over a period of time. We used it to easily create a time-lapse video.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="450" height="338" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=32caf6d56b&amp;photo_id=2492006969" /><param name="bgcolor" value="#000000" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.flickr.com/apps/video/stewart.swf?v=49235" /><embed type="application/x-shockwave-flash" width="450" height="338" src="http://www.flickr.com/apps/video/stewart.swf?v=49235" allowfullscreen="true" bgcolor="#000000" flashvars="intl_lang=en-us&amp;photo_secret=32caf6d56b&amp;photo_id=2492006969"></embed></object></p>
<p>Copy and paste <a href="http://chdk.wikia.com/wiki/UBASIC/Scripts:_Ultra_Intervalometer">this script</a> into a new document, and save as ult_intrvl.bas to your computer. Then, plug in your camera&#8217;s SD card, and copy ult_intrvl.bas to /CHDK/SCRIPTS/.</p>
<p>To use the intervalometer, navigate to the main CHDK menu, find &#8220;Scripting parameters&#8221;, and click &#8220;Load script from file&#8221;. Find ult_intrvl.bas, and press set. Then, scroll down and adjust the script parameters: the delay until the first shot is taken, the number of shots you wish to take, the interval between each shot, and whether or not you want it to take an &#8220;endless&#8221; number of photos. Then, exit the menu, but leave your camera in ALT mode, and press the shutter button to start the script.</p>
<p>The video above was created by taking approximately 700 shots at 15 second intervals over 2 hours and 45 minutes. Just set your camera on a tripod or another steady surface, and start the intervalometer. Using QuickTime Pro, go to File&gt;Open Image Sequence to convert the hundreds of separate images into a movie. For space and processing considerations, we recommend setting your camera to a low-resolution mode before starting the intervalometer.</p>
<h2>Exposure bracketing</h2>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/exbrack_ex2.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>Exposure bracketing allows you to take many pictures at slightly different exposures nearly simultaneously. You  can use this to correct errors in the camera&#8217;s autoexposure, or merge exposures for <a href="http://www.flickr.com/groups/hdr/discuss/40580/">HDR photography</a>. Many higher end Canon PowerShot&#8217;s have exposure bracketing built in, but for those that don&#8217;t, CHDK has the answer.</p>
<p>Like with the intervalometer script, simply copy and paste <a href="http://chdk.wikia.com/wiki/UBASIC/Scripts:_Bracketing_and_EV_correction">this</a> script into a new text file. Name it bracketing.bas, and place it in the /CHDK/SCRIPTS/ folder of your SD card.</p>
<p>Then navigate to the main CHDK menu, find &#8220;Scripting parameters&#8221;, and click &#8220;Load script from file&#8221;. Find bracketing.bas, and press set. Then, scroll down and adjust the script parameters. The step size is the difference between each image taken, in 1/3 EV steps, the correction is the EV of the middle image taken. The only slightly tricky part here is that first parameter is the (number of images &#8211; 1)/2. This means that if you want three pictures, it must be 1, five is 2, seven is 3, and so on. To run the script, exit the menu, leave the camera in alt mode, and press the shutter button.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/exbrack_example.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>With these different exposures, you can create HDR tone-mapped images, that show very bright and very dark regions exposed properly. For example, taking the seven different images of the lighthouse above into an HDR program such as <a href="http://www.hdrsoft.com/">Photomatix</a>, optimizing settings for realism, produces this result:</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/hdr_ex1.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>You can also use HDR to produce more dramatic photos, such as this train. It is all in how you process the images.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/hdr_ex2.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>There is a lot that can be done with HDR, from <a href="http://flickr.com/photos/stuckincustoms/2351246463/">extremely vibrant photos</a>, to the scarily surreal, such as this one  below from <a href="http://flickr.com/photos/extranoise/278465198/">Till Krech</a>.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/hdr_ex3.jpg" border="0" alt="" hspace="4" vspace="4" />..</p>
<p>For more information on HDR photography, Stuck In Customs has an <a href="http://stuckincustoms.com/2006/06/06/548/">excellent tutorial</a>.</p>
<h2>Taking RAW photos</h2>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/raw_example.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>RAW photos can be extremely useful to digital photographer. They enable you to extract more information from bright highlights in an image, and RAW gives the you complete control over white balance. For example, in the above photo the JPG had an incorrect white balance, which was easily corrected using the RAW image. While DSLRs offer 12 bits of data in RAWs, most point and shoot cameras can only provide 10, meaning that even with CHDK, you won&#8217;t be able to extract as much information from highlights as you could with a DSLR. Still, RAWs are very useful for having precise white balance control.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/raw_menu.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>In the Raw Parameters menu, enable &#8220;Save RAW&#8221;, and adjust the other parameters as shown. Now, you can take photos as normal, and a RAW will be automatically saved with your JPG. The RAW file will take quite a bit a more space than the standard JPG, so your camera will not be able to correctly display remaining space on the SD card.</p>
<h3>Processing RAW photos</h3>
<p>To process your RAW photos, you&#8217;ll need to convert them to the Digital Negative format, DNG. The <a href="http://dng4ps2.chat.ru/index_en.html">DNG4PS-2</a> software can do this for these cameras: A610, A620, A630, A640, A710 IS, S2 IS, S3 IS, A700, G7, A560, A570 IS, IXUS 700, IXUS 70, IXUS 800, A720 IS, S5 IS, IXUS 950, A650 IS, A460, SD800 IS, A530, A540. You can also process the files using <a href="http://ufraw.sourceforge.net/">UFRaw</a> or <a href="http://www.cybercom.net/~dcoffin/dcraw/">dcraw</a>, though that is much more difficult.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/dng4ps2.png" border="0" alt="" hspace="4" vspace="4" /></p>
<p>Open DNG4PS-2, then go to settings. Adjust the model settings based on how many megapixels your camera is. Next, press OK, and find the path to RAW files option. This is not the location of the file that you wish to convert, but the folder that contains the files. When you have selected the correct folder, press &#8220;Convert&#8221;.</p>
<p>The DNGs will be in a folder marked with today&#8217;s date, and from there, you can process them in Lightroom, Aperture, Photoshop, or whichever RAW processing software you prefer.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/photoshop_process.png" border="0" alt="" hspace="4" vspace="4" /></p>
<h2>Adding a battery meter</h2>
<p>Tired of have the low battery warning sneak up on you? CHDK can add a battery meter to your camera, though the configuration depends on what type of camera you have.</p>
<p><img src="http://hackadaycom.files.wordpress.com/2008/05/osd_menu.jpg" border="0" alt="" hspace="4" vspace="4" /></p>
<p>To enable it, go to OSD parameters in the main menu, then to Battery. Edit the parameters so that they are as they appear above, if you have a camera with 4 AA rechargeable batteries. Cameras with 2 AA rechargeable batteries should be about half of that. For other power sources, experiment to find the best value.</p>
<h2>Writing your own scripts</h2>
<p>CHDK uses a very simple BASIC-like language called UBASIC. It has all of the features that one would expect from any language, but there are many camera specific features.</p>
<h3>Input/output</h3>
<p>Each script begins with a special header, that provides information and control to the user.</p>
<p><code> @title Intervalometer</p>
<p>@param a Number of shots</p>
<p>@default a 10</p>
<p>@param b Interval (Minutes)</p>
<p>@default b 1</p>
<p></code></p>
<p>In this header, the title of the script is declared, as are two user adjustable parameters. The syntax is simple: <code>@title</code> declares a title, <code>@param par</code> declares the name and label of a parameter, and <code>@default [par]</code> declares the default value of a parameter. Scripts can only receive input through the header, at the beginning of their execution.</p>
<p>To output information to the user, the <code>print</code> command is used: <code>print "Num shots: ", a</code> will print the number of shots, as inputted in the script header. Note the use of the comma to seperate text from variables. The <code>print</code> command is limited to 25 characters of text. To clear what has been printed, use the <code>cls</code> command.</p>
<h3>Standard program flow</h3>
<p><code>let a = 2</p>
<p>for x=1 to 10</p>
<p><span style="margin-left: 15px;">gosub "display"</span></p>
<p>next x</code></p>
<p>:display</p>
<p><span style="margin-left: 15px;">rem print even numbers</span></p>
<p><span style="margin-left: 15px;">if x % a = 0 then print x</span></p>
<p>return</p>
<p>This block of code demonstrates many of the logic features of the UBASIC language. To assign values to variables, use the <code>let</code> command. You can also see a <code>for</code> loop and a subroutine. Note the use of the <code>rem</code> command to insert comments, and the single line <code>if</code> statement. UBASIC supports most standard mathematical comparisons, including <code>+, -, *, /, %, &lt;, &gt;, =, &lt;=, &gt;=, &lt;&gt; </code>(not equal to)<code>, &amp;, |, ^</code> (xor).</p>
<h3>Camera control</h3>
<p>The meat of UBASIC is in its many commands for controlling the camera:</p>
<dl>
<dt style="font-weight: bold;"><code>shoot</code></dt>
<dd style="margin-left: 15px;">Takes a photo</dd>
<dt style="font-weight: bold;"><code>click<code>/<code>press<code>/<code>release "button"</code> </code></code></code></code></dt>
<dd style="margin-left: 15px;">Clicks (press and release), presses, or releases on the cameras buttons. The following are available: <code>up, down, left, right, set, shoot_half</code> (depresses the shutter halfway)<code>, shoot_full, zoom_in, zoom_out, menu, display, print, erase, iso, flash, mf</code> (manual focus)<code>, macro, video, timer</code>.</dd>
<dt style="font-weight: bold;"><code>wait_click <em>timeout</em></code></dt>
<dd style="margin-left: 15px;">Waits for a button to be pressed, then continues. The timeout value is optional.</dd>
<dt style="font-weight: bold;"><code>is_key x "button"</code></dt>
<dd style="margin-left: 15px;">Immediately follows a <code>wait_click</code> command. If the last button pressed is <code>"button"</code>, then the variable x is set with the value of 1. If <code>wait_click</code> timed out, then <code>"no_key"</code> is used as the button name.</dd>
<dt style="font-weight: bold;"><code>set_tv val</code></dt>
<dd style="margin-left: 15px;">Sets the shutter speed to <code>val</code>. Note that <code>val</code> is not &#8220;1/1000&#8243; or something similar, but rather an integer value. Each increase in the integer value corresponds to a 1/3 EV increase. The absolute mapping between integer values and shutter speeds varies between cameras, but tables are available <a href="http://chdk.wikia.com/wiki/UBASIC/TutorialScratchpad#The_set_tv.2C_get_tv.2C_etc_commands">here</a>. This, and all following commands must be used with the camera in manual mode.</dd>
<dt style="font-weight: bold;"><code>set_tv_rel val</code></dt>
<dd style="margin-left: 15px;">Sets the shutter speed relative to the current shutter speed. Example: <code>set_tv_rel 0-1</code> increases the shutter speed by 1/3 EV.</dd>
<dt style="font-weight: bold;"><code>get_tv target</code></dt>
<dd style="margin-left: 15px;">Sets <code>target</code> equal to the current shutter speed.</dd>
<dt style="font-weight: bold;"><code>set_av val, set_av_rel val, get_av target</code></dt>
<dd style="margin-left: 15px;">With the same syntax as shutter speed commands, these adjust aperture settings.</dd>
<dt style="font-weight: bold;"><code>set_zoom val, set_zoom_rel val, get_zoom target</code></dt>
<dd style="margin-left: 15px;">Just like <code>set_tv/set_tv_rel</code> commands. In <code>set_zoom_rel</code>, <code>val</code> is +/- the relative change. Zoom values range from 0 to 8 or 14 for A-series cameras, and 0 to 128 for S-series cameras.</dd>
<dt style="font-weight: bold;"><code>set_zoom_speed x</code></dt>
<dd style="margin-left: 15px;">S-series only. Sets the zoom speed, at <code>x</code>% of maximum speed. <code>x</code> may vary between 5 and 100.</dd>
<dt style="font-weight: bold;"><code>set_focus x, get_focus target</code></dt>
<dd style="margin-left: 15px;"><code>x/target</code> is distance in millimeters.</dd>
<dt style="font-weight: bold;"><code>set iso x, get iso target</code></dt>
<dd style="margin-left: 15px;"><code>x/target</code> is one of the following values: <code>0 (Auto ISO), 1 (50/80), 2 (100), 3 (200), 4 (400), 5 (800), -1 (High ISO)</code>.</dd>
</dl>
<h2>Where to go from here</h2>
<p>Try checking out the <a href="http://chdk.wikia.com/wiki/CHDK">CHDK wiki</a>, for more features then are even printed here. Finally, take photos! The most important thing that you can do to improve your photography skills is to take lots of photos.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1883/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1883/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1883/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1883/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1883/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1883/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1883/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1883/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1883/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1883/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1883/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1883/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1883/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1883/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1883/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1883/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1883&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/05/27/how-to-expand-your-camera-with-chdk/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">loganwilliams</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/sss_example.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/sss_menu.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/fss_example.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/fss_menu.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/exbrack_ex2.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/exbrack_example.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/hdr_ex1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/hdr_ex2.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/hdr_ex3.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/raw_example.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/raw_menu.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/dng4ps2.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/photoshop_process.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/osd_menu.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: Go green with lead free solder</title>
		<link>http://hackaday.com/2008/05/22/how-to-go-green-with-lead-free-solder/</link>
		<comments>http://hackaday.com/2008/05/22/how-to-go-green-with-lead-free-solder/#comments</comments>
		<pubDate>Thu, 22 May 2008 19:30:00 +0000</pubDate>
		<dc:creator>Jason Rollette</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[california]]></category>
		<category><![CDATA[eu]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[hackaday]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[lead]]></category>
		<category><![CDATA[leadfree]]></category>
		<category><![CDATA[rohs]]></category>
		<category><![CDATA[solder]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[solderingiron]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/05/22/how-to-go-green-with-lead-free-solder/</guid>
		<description><![CDATA[We covered many of [Jason Rollette]&#8216;s personal projects in the past and are happy to welcome him as our newest Hack-A-Day contributor. The electronics industry has shifted to lead free compliance, but most hobbyists haven&#8217;t even considered the personal impact of using lead. Today&#8217;s How-To will cover what it takes to switch from tin/lead solder [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1858&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoPlainText"><span style=""><img width="450" vspace="4" hspace="4" height="337" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/05/dscn1462.jpg?w=450&#038;h=337" /></span></p>
<p class="MsoPlainText"><span style="font-style: italic;">We covered many of [Jason Rollette]&#8216;s personal projects in the past and are happy to welcome him as our newest Hack-A-Day contributor.</span><span style=""><span style=""></span></span></p>
<p class="MsoPlainText"><span style=""><span style=""></span>The electronics industry has shifted to lead free compliance, but most hobbyists haven&#8217;t even considered the personal impact of using lead. Today&#8217;s How-To will cover what it takes to switch from tin/lead solder to completely lead free. Our previous posts <a href="http://www.hackaday.com/2007/10/26/how-to-introduction-to-soldering/">Introduction to soldering</a> and <a href="http://www.hackaday.com/2007/10/28/followup-soldering-how-to/">the follow-up</a> still apply to lead free. You may have never considered switching to lead free before, but we hope to help you make an informed decision. <o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></span></p>
<p><span id="more-1858"></span></p>
<div style="text-align: center;">
<div style="text-align: left;"><span style="">The reason we are even talking about this is because of the Restriction of Hazardous Substances directive. RoHS was adopted in February 2003 by the European Union; all electronics sold there must comply. The substances restricted are: <span style="font-weight: bold;">lead</span>, mercury, cadmium, chromium VI also known as hexavalent chromium plating, and pbb, pbde flame retardants used in plastics. We will focus on lead. Solder joints must contain less than 0.1% lead</span><span style=""> to be compliant</span><span style="">. RoHS is not currently required in the US, but California RoHS, effective September 2003, had a compliance deadline of January 2007.</p>
<p>Although the electronics industry has been directly targeted it only accounts for a small percentage of the lead used in manufacturing. The battery industry consumes nearly 80% of manufactured lead. Tire wheel weights also account for a larger percentage.<br /></span><span style=""><br />There are some good reasons for the hobbyist to convert to lead free solder, both personal safety and environmental. Lead poisoning can occur when lead enters the body through inhalation, ingestion or dermal contact such as direct contact to mouth, nose, eyes, and skin lesions. Even if you keep using tin/lead solder, wash your hands before and after you do anything. Most poisoning cases are from lead building up over time. The main environmental issue is lead leaching into drinking water or watersheds when disposed of improperly. </p>
<p></span></div>
<div style="text-align: left;"><span style=""></span><span style=""><o:p></o:p></span><span style=""></span><span style=""><img width="450" vspace="4" hspace="4" height="338" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/05/dscn1486.jpg?w=450&#038;h=338" /> <o:p></o:p></span></div>
</div>
<p class="MsoPlainText"><span style=""><span style=""> </span>There are many different varieties of lead free solder. Two alloys seem be the most popular: SAC305 contains 96.5% tin, 3% silver, and 0.5% copper and melts at ~217C, SN100 contains 99.3% tin, 0.6% copper, and some nickel and silver and melts at ~228C. Choose whatever alloy and brand you feel is appropriate for you. Compare those alloys to traditional 63% tin and 37% lead melts that melts at ~183C. The higher melting point is part of what makes lead free harder to work with. We use SAC305 with a &#8220;no clean&#8221; flux core.<o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><img width="406" vspace="4" hspace="4" height="259" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/05/solderflux2.jpg?w=406&#038;h=259" /><o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><span style=""> </span>In addition to picking an alloy, you also need to decide on the diameter. We recommend for through hole .032&#8243;,.020&#8243; and .015&#8243; for SMT. Choosing the right diameter solder is very important to success.</span><span style=""> A finished joint viewed from the side should look like a little Hershey&#8217;s kiss, not an inflated balloon. The correct diameter solder makes this much easier to control. </span><span style=""> <o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><img width="450" vspace="4" hspace="4" height="337" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/05/dscn1471.jpg?w=450&#038;h=337" /><o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><span style=""> </span>A high wattage soldering iron with temperature adjustment is the best choice for precision work. Get a soldering iron with several sizes of replaceable tips for different soldering applications. Having a good iron makes soldering with lead free easier because of the higher melting point. It also helps to keep the dwell time as short as possible reducing damage to components caused by excessive heat. <o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><img width="450" vspace="4" hspace="4" height="337" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/05/dscn1427.jpg?w=450&#038;h=337" /><o:p></o:p></span></p>
<p class="MsoPlainText"><span style="">Choosing the correct size tip for the job is perhaps the most important part for a new person learning to solder. Lead-free is less forgiving and the right tip will go a long way in preventing defects.<o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><!--[if !supportEmptyParas]--> <o:p></o:p></span></p>
<p class="MsoPlainText"><span style="">Using a tip that is too small will take longer, abuse the tip, and will not efficiently transfer heat to the joint. A small tip will seem too cold or too slow. <o:p></o:p></span></p>
<p class="MsoPlainText"><span style="">Using a tip that is too large will damage the circuit board, over heat and damage the parts, and burn off the flux too soon causing a bad joint.</span></p>
<p class="MsoPlainText"><span style="">Use tips that are designed for lead-free. Tips designed for lead free will have the longest life. The iron temperature should be set to 700-800F. Do not use pressure to compensate for lack of wetting and heat transfer; this will cause damage to the circuit board. Heat transfer is optimized by providing the best contact area. <br /></span></p>
<p class="MsoPlainText"><img width="450" vspace="4" hspace="4" height="184" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/05/tips.jpg?w=450&#038;h=184" /><span style=""><o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><span style="font-weight: bold;">Differences from tin/lead soldering</span><o:p></o:p></span></p>
<p class="MsoPlainText"><span style="">Tin/lead solder should not be mixed with lead free solder because it decreases the strength of the joint. Lead free parts can be used with tin/lead solder. You should try ordering all parts, ICs, resistors, caps, proto boards, etc. lead free even if you are not using lead free solder yet. This will ease the conversion for you in the future.</span><span style=""> Consumables such as flux and tip cleaner should be certified for lead free soldering. Flux will need to withstand higher temperatures and longer dwell times, and some tip cleaners have tin/lead solder in them that could contaminate the lead free solder joints.</span><span style=""> <o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><!--[if !supportEmptyParas]--> <img width="450" vspace="4" hspace="4" height="337" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/05/dscn1433.jpg?w=450&#038;h=337" /><!--[endif]--><o:p></o:p></span></p>
<p class="MsoPlainText"><span style="">Not all fluxes are capable of sustaining high soldering temperatures. Flux charring, called &#8220;black tip syndrome&#8221;, occurs when thermally incapable fluxes turn the tip black and make re-tinning nearly impossible. Heat transfer is severely reduced when this happens. Buying compatible flux is key. <o:p></o:p><br /><span style=""></span></span></p>
<p class="MsoPlainText"><span style=""><img width="450" vspace="4" hspace="4" height="337" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2008/05/dscn1502a.jpg?w=450&#038;h=337" /><br /></span></p>
<p class="MsoPlainText"><span style="">As we&#8217;ve said many times: you&#8217;ll need to set your solder iron slightly higher temperature than you are used to. You will also notice that slightly longer dwell times are needed because of higher melting points. Wetting or spread is also a little slower when compared to tin/lead. The resulting lead free solder joints will appear slightly grainy and dull compared to shiny tin/lead. <br /></span></p>
<p class="MsoPlainText"><span style="">The iron must be kept clean and fully coated with the solder alloy, otherwise at the higher temps oxidation can occur. Solder tips will need to be cleaned and tinned more frequently. Use a wet sponge for cleaning and keep your tip tinned by adding a small amount of solder. In general, all tips will have a reduced life when using lead free alloys. <o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><!--[if !supportEmptyParas]--> <o:p></o:p></span></p>
<p class="MsoPlainText"><span style="">Lead free solder is more prone to solder bridges (shorts). <a href="http://www.metalwhiskers.com/moxie/articles/metal-whiskers.shtml">Tin whisker</a> growth is also possible with high tin alloys, but is poorly understood. <br /></span></p>
<p class="MsoPlainText"><span style="">The temperatures required make lead free soldering a different experience, but not out of reach. If you can solder with tin/lead solder, you can solder lead free. If you are having problems soldering, maybe some of the tips here will help. Remember, soldering takes practice; solder, desolder, resolder some old circuit boards from computers or consumer electronics before attempting a project. Otherwise you can&#8217;t expect a perfect outcome. Knowledge, practice and experience will provide the consistency required for excellent hand soldering results. Please share any experiences you have working lead free. <o:p></o:p></span></p>
<p class="MsoPlainText"><span style=""><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1858/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1858/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1858/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1858/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1858/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1858/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1858/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1858/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1858/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1858/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1858/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1858/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1858/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1858/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1858/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1858/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1858&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/05/22/how-to-go-green-with-lead-free-solder/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Jason Rollette</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/dscn1462.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/dscn1486.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/solderflux2.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/dscn1471.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/dscn1427.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/tips.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/dscn1433.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/dscn1502a.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: Scavenge a mouse for parts</title>
		<link>http://hackaday.com/2008/05/16/how-to-scavenge-a-mouse-for-parts/</link>
		<comments>http://hackaday.com/2008/05/16/how-to-scavenge-a-mouse-for-parts/#comments</comments>
		<pubDate>Sat, 17 May 2008 01:00:00 +0000</pubDate>
		<dc:creator>chriskiick</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[peripherals hacks]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[hackaday]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[ps2]]></category>
		<category><![CDATA[salvage]]></category>
		<category><![CDATA[scavenge]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/05/16/how-to-scavenge-a-mouse-for-parts/</guid>
		<description><![CDATA[Chris Kiick posted about swarm robotics earlier in the week and today publishes his first Hack-A-Day How-To. Old computer mice are being abandoned in droves. They&#8217;re tossed out because of dirt, obsolescence, or for being entirely too beige. Anyone who has a computer usually has more than one mouse and you can get them for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1838&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img width="450" vspace="4" hspace="4" height="262" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/open.jpg?w=450&#038;h=262" alt="ps2 mouse opened" /><br /><em>Chris Kiick posted about <a href="http://www.hackaday.com/2008/05/13/swarm-robotics/">swarm robotics</a> earlier in the week and today publishes his first Hack-A-Day How-To.</em></p>
<p>Old computer mice are being abandoned in droves. They&#8217;re tossed out because of dirt, obsolescence, or for being entirely too beige. Anyone who has a computer usually has more than one mouse and you can get them for pennies, if not free just for asking. Fortunately for the discriminating (read: cheap) hacker, these little widgets are chock-full of project parts. Today&#8217;s How-To will dissect a computer mouse, extract the useful parts, and give some ideas about how to use them.</p>
<p><span id="more-1838"></span></p>
<p><img width="200" vspace="4" hspace="4" height="150" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/start.jpg?w=200&#038;h=150" alt="plan ps2 mouse" /> <img width="193" vspace="4" hspace="4" height="150" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/bottom.jpg?w=193&#038;h=150" alt="ps2 mouse underside" /><br />Here we have a standard PS2 mouse; a USB mouse will look pretty much the same. We&#8217;ll talk about optical mice later on.</p>
<p>Lets open it up. First, take out the mouse ball. Then there will be one or more screws on the bottom side that need to come out. Screws are sometimes hidden under the rubber pads.</p>
<p><img width="450" vspace="4" hspace="4" height="262" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/open.jpg?w=450&#038;h=262" alt="ps2 mouse opened" /><br />The first thing to notice is the cable connector. Most mice have a very convenient plug for the cable, instead of soldering it onto the board. That&#8217;s the first usable part: a 4 (or 6) conductor cable with a nice plug on one end. The socket can be removed from the PCB and used in other projects.</p>
<p><img width="450" vspace="4" hspace="4" height="367" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/open2.jpg?w=450&#038;h=367" alt="" /><br />With the cord out of the way, we can start pulling out parts. First thing that pops off is the mouse wheel. Yes, it&#8217;s just a big rubber wheel. If you&#8217;re annoyed by the mouse wheel&#8217;s clicking noise, <span style="text-decoration: underline;"></span><a href="http://www.hackaday.com/2007/12/04/silence-your-mouse-no-clicky/">you can silence it</a>. There are at least two micro-switches and usually a third one under the mouse wheel which can be used for bump sensors or buttons.</p>
<p><img width="120" vspace="4" hspace="4" height="118" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/encoders.jpg?w=120&#038;h=118" alt="encoder wheels" /><br />Next thing to take out are the two plastic slotted discs. They&#8217;re the encoder wheels. They turn whenever the mouse moves and interrupt an IR beam, producing pulses. It used to be that precision encoder wheels were pretty expensive, but not anymore. Every single (non-optical) mouse comes with a pair built in.</p>
<p>On either side of the encoder wheel are some little boxes. One side is an IR emitter, and the other side is a pair of IR detectors. Sometimes the emitters and detectors will be one complete unit. A pair of detectors is used because with 2 detectors slightly offset, it generates <a href="http://en.wikipedia.org/wiki/Rotary_encoder#Incremental_rotary_encoder">quadrature encoding</a>, so that mouse knows the direction of rotation.</p>
<p>These IR emitters and detectors are fairly modular pieces when it comes to hacking and can be removed with some careful desoldering. It is a good idea to use a multimeter to see what kind of voltage is going to them before removing them. They are probably TTL parts, because mice are powered by 5v, but sometimes they are an even lower voltage. The emitter/detector pair by itself can be <a href="http://www.societyofrobots.com/schematics_infraredemitdet.shtml">interfaced</a> directly. Those parts alone can be used for a <a href="http://www.ikalogic.com/ir_prox_sensors.php">proximity sensor</a> or for a <a href="http://www.kmitl.ac.th/~kswichit/ROBOT/Robo5.html">line following robot</a>.</p>
<p>Add an encoder wheel and this sensor setup has lots of uses. From a tachometer, to a wind speed indicator, to sensing a robot&#8217;s speed, this will do it. The quadrature output (with some decoding) can be used to measure distance, direction, and speed.</p>
<p> <img width="200" vspace="4" hspace="4" height="119" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/onpcb2.jpg?w=200&#038;h=119" id="img14" alt="IR pair on PCB" /><img width="200" vspace="4" hspace="4" height="110" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/chunk.jpg?w=200&#038;h=110" alt="encoder with PCB and shell" /><br />One tricky thing about using the encoder with the IR sensor is getting the emitter to line up with the detector(s). No problem: instead of desoldering the parts from the PCB, use a rotary tool to cut off the little piece of PCB that has the sensors on it (already lined up). Wires can then be soldered to the pins/traces on the other side. If holding the encoder wheel in place is a problem, a hunk of the mouse casing can be used with it. Be sure to leave enough PCB to keep it stable on the mouse casing.</p>
<p><img width="450" vspace="4" hspace="4" height="327" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/robot.jpg?w=450&#038;h=327" alt="encoder in a robot" /><br />This is a picture of an encoder wheel with quadrature from a PS2 mouse on a small robot. Rather than make custom parts, the mouse is carved up and the whole assembly is fitted to the motor axis.</p>
<p><img width="225" vspace="4" hspace="4" height="230" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/parts.jpg?w=225&#038;h=230" alt="parts salvage from mouse" /><br />What&#8217;s left to salvage on the mouse? The sensors for the mouse wheel. Depending on the model, the mouse wheel movement may be sensed with switches or a low resolution encoder, suitable for measuring slow rotation.</p>
<p>The final bit is the mouse controller chip. At first thought it seems pretty useless: it&#8217;s a single purpose part made specifically to run a computer mouse and nothing else. However, if your controller chip isn&#8217;t an anonymous blob, the datasheet could be very enlightening. <a href="http://octopart.com/">Octopart</a> can help find datasheets based on the chip&#8217;s part number. <a href="http://www.digchip.com/datasheets/download_datasheet.php?id=297606&amp;part-number=EM84510F">This</a> (PDF) is a typical datasheet for a mouse controller.</p>
<p>This specific part does a number of useful things: </p>
<ul>
<li>decodes the quadrature input from the encoders</li>
<li> keeps a running count of the number of encoder pulses in a set of registers</li>
<li>filters out jitter</li>
<li> debounces the micro-switches and keeps track of their state</li>
<li>packetizes the information and sends it up the cord.</li>
</ul>
<p>For a PS2 mouse, getting at these features is not too difficult. The <a href="http://www.computer-engineering.org/ps2mouse/">PS2 protocol</a> is pretty friendly, even for microcontrollers. Here&#8217;s an example of <a href="http://www.arduino.cc/playground/ComponentLib/Ps2mouse">interfacing a microcontroller with a mouse</a>. For USB mice, check the controller&#8217;s datasheet to see if it can do both PS2 and USB; with older mice there&#8217;s a decent chance it does. While pure USB is not very easy to talk to with a microcontroller, it&#8217;s really easy to hook to a PC (with the right software).</p>
<p><img width="450" vspace="4" hspace="4" height="325" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/optical.jpg?w=450&#038;h=325" alt="optical mouse - no wheels" style="width: 305px; height: 220px;" /> <img width="250" vspace="4" hspace="4" height="143" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/opcb.jpg?w=250&#038;h=143" alt="" /><br />We promised a look at optical mice. Optical mice do not have any rotary encoders. There are still some switches and a low-res encoder for the mouse wheel. What an optical mouse has in it is a mini-camera, lights, and lenses. The light is probably a fairly standard LED, although they tend to be bright, and the lenses are purpose built. However, it is possible to <a href="http://www.martijnthe.nl/optimouse/arduino-optical-mouse.html">interface directly to the mini-camera</a> or <a href="http://spritesmods.com/?art=mouseeye">use it as a really poor scanner</a>.</p>
<p>We hope this How-To has sparked some ideas and that your obsolete mouse won&#8217;t seem as useless anymore.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1838/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1838/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1838/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1838/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1838/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1838/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1838/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1838/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1838/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1838/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1838/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1838/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1838/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1838/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1838/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1838/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1838&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/05/16/how-to-scavenge-a-mouse-for-parts/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">ckiick</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/open.jpg" medium="image">
			<media:title type="html">ps2 mouse opened</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/start.jpg" medium="image">
			<media:title type="html">plan ps2 mouse</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/bottom.jpg" medium="image">
			<media:title type="html">ps2 mouse underside</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/open.jpg" medium="image">
			<media:title type="html">ps2 mouse opened</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/open2.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/encoders.jpg" medium="image">
			<media:title type="html">encoder wheels</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/onpcb2.jpg" medium="image">
			<media:title type="html">IR pair on PCB</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/chunk.jpg" medium="image">
			<media:title type="html">encoder with PCB and shell</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/robot.jpg" medium="image">
			<media:title type="html">encoder in a robot</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/parts.jpg" medium="image">
			<media:title type="html">parts salvage from mouse</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/optical.jpg" medium="image">
			<media:title type="html">optical mouse - no wheels</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/opcb.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: Make a digital synthesizer</title>
		<link>http://hackaday.com/2008/05/01/how-to-make-a-digital-synthesizer/</link>
		<comments>http://hackaday.com/2008/05/01/how-to-make-a-digital-synthesizer/#comments</comments>
		<pubDate>Thu, 01 May 2008 18:55:00 +0000</pubDate>
		<dc:creator>loganwilliams</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[digitalsynth]]></category>
		<category><![CDATA[digitalsynthesizer]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[lfo]]></category>
		<category><![CDATA[lowfrequencyoscillator]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[synth]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/05/01/how-to-make-a-digital-synthesizer/</guid>
		<description><![CDATA[This week&#8217;s How-To comes from our newest contributor: Logan Williams. This simple guide will show you how to build a digital synthesizer that generates and manipulates square waves. Your synthesizer will have one oscillator, which produces a variable pitch controlled by a potentiometer, as well as an LFO which modulates that pitch at a variable [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1748&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img width="450" vspace="4" hspace="4" height="512" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/lfo_breadboard.jpg?w=450&#038;h=512" alt="" />
<p><span style="font-style: italic;">This week&#8217;s How-To comes from our newest contributor: Logan Williams.</span></p>
<p>This simple guide will show you how to build a digital synthesizer that generates and manipulates square waves. Your synthesizer will have one oscillator, which produces a variable pitch controlled by a potentiometer, as well as an LFO which modulates that pitch at a variable frequency. The part count for this project is quite low, and it can be built for under $20.</p>
<p><span id="more-1748"></span></p>
<h2>Finding the Parts</h2>
<p>The first step in building this digital synthesizer is to <a href="http://www.hackaday.com/2007/11/16/how-to-where-to-find-parts-for-your-projects/">procure the parts</a> that you will need. Most of these can be bought at <a href="http://www.radioshack.com/category/index.jsp?categoryId=2032230">RadioShack</a>, but RadioShack&#8217;s prices are often much more expensive than ordering online. All of the parts for this project can be purchased at <a href="http://www.jameco.com/">Jameco</a>, <a href="http://digikey.com/">Digi-Key</a>, or <a href="http://mouser.com/">Mouser</a>. We&#8217;ve provided Jameco part numbers below. If you don&#8217;t mind waiting, this is the best way to order parts.</p>
<p><img width="450" vspace="4" hspace="4" height="605" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/parts.jpg?w=450&#038;h=605" alt="" /></p>
<table>
<tbody>
<tr>
<th>Item</th>
<th>Name</th>
<th colspan="2">RadioShack</th>
<th colspan="2">Jameco</th>
</tr>
<tr>
<td>9V Battery Clip</td>
<td> </td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062219">270-325</a></td>
<td>$1.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=11280">11280</a></td>
<td>$0.30</td>
</tr>
<tr>
<td>100K Linear Potentiometer</td>
<td>R2</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062287">271-092</a></td>
<td>$2.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=255696">255696</a></td>
<td>$1.35</td>
</tr>
<tr>
<td>1M Linear Potentiometer</td>
<td>R3</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062297">271-211</a></td>
<td>$2.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=255582">255582</a></td>
<td>$1.35</td>
</tr>
<tr>
<td>50K Linear Potentiometer</td>
<td>R4</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062355">271-1716</a></td>
<td>$2.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=255549">255549</a></td>
<td>$1.35</td>
</tr>
<tr>
<td>10K Linear Potentiometer</td>
<td>R5</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062354">271-1715</a></td>
<td>$2.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=255522">255522</a></td>
<td>$1.35</td>
</tr>
<tr>
<td>9V Battery</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>IRF 510 MOSFET Transistor</td>
<td>Q1</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062618">276-2072</a></td>
<td>$1.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=209234">209234</a></td>
<td>$0.69</td>
</tr>
<tr>
<td>3.5mm Audio Connector</td>
<td> </td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062618">274-333</a></td>
<td>$2.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=109496">109496</a></td>
<td>$0.53</td>
</tr>
<tr>
<td>7805 5V Voltage Regulator</td>
<td>IC1</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062599">276-1770</a></td>
<td>$1.59</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=51262">51262</a></td>
<td>$0.20</td>
</tr>
<tr>
<td>0.1 uF capacitor</td>
<td>C1</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062365">272-135</a></td>
<td>$1.49</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=151118">151118</a></td>
<td>$0.20</td>
</tr>
<tr>
<td>1.0 uF capacitor</td>
<td>C2</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2102515">272-1055</a></td>
<td>$1.59</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=544956">544956</a></td>
<td>$0.20</td>
</tr>
<tr>
<td>40106 Hex Inverter</td>
<td>IC2</td>
<td><a href="http://www.fairchildsemi.com/ShoppingExperience/action/displayItems?gpn=CD40106BC&amp;itemType=SAMPLE">Fairchild</a></td>
<td>$0.00</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=785071">785071</a></td>
<td>$0.47</td>
</tr>
<tr>
<td>47K Resistor</td>
<td>R1</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062349">271-1342</a></td>
<td>$0.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=690540">690540</a></td>
<td>$1.00</td>
</tr>
<tr>
<td>1N4148 Diode</td>
<td>D1</td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2062587">276-1620</a></td>
<td>$2.59</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=1537969">1537969</a></td>
<td>$0.27</td>
</tr>
<tr>
<td>Solderless breadboard</td>
<td> </td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2734154">276-002</a></td>
<td>$14.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=20723">20723</a></td>
<td>$9.85</td>
</tr>
<tr>     </tr>
</tbody>
</table>
<h3>Not Pictured</h3>
<table>
<tbody>
<tr>
<th>Item</th>
<th>Name</th>
<th colspan="2">RadioShack</th>
<th colspan="2">Jameco</th>
</tr>
<tr>
<td>22AWG Solid-core</td>
<td> </td>
<td><a href="http://www.radioshack.com/product/index.jsp?productId=2049742">278-1221</a></td>
<td>$5.99</td>
<td><a href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10001&amp;productId=36792">36792</a></td>
<td>$6.59</td>
</tr>
<tr>
<td>Amplified speakers</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<h3>Tools</h3>
<table>
<tbody>
<tr>
<td>Wire strippers</td>
</tr>
</tbody>
</table>
<p><strong>Note</strong>: The potentiometers and audio jack must be either taped or soldered to 22 AWG solid core wire. <a href="http://www.hackaday.com/2007/10/26/how-to-introduction-to-soldering/">Soldering</a> is highly recommended, as it produces a more secure connection.</p>
<h2>Creating an oscillator</h2>
<p>Before we can begin with the digital synthesizer, we must generate the correct voltage. Most of you will be familiar with using a 7805 5V voltage regulator. It is very simple; connect the +9V from the battery to the left hand pin, ground the middle pin, and the right hand is +5V.</p>
<p>The most basic circuit in any synthesizer is the oscillator. A square wave oscillator constantly alternates between two voltages, in this case +5V and 0V. We have a logic inverter to create this, which operates quite simply; if it is given +5V in (a logic 1), it give<br />
s 0V out<br />
(a logic 0) and if it is given a logic 0, it gives a logic 1 as output. When the input and output are connected together, it will oscillate rapidly between those two values: a 0 goes in, comes out as a 1, goes in, comes out as a 0, and so on.</p>
<p>The problem is that it oscillates much too fast. A resistor capacitor (RC) delay circuit can be added to slow it down. This forces the output current to charge the capacitor before it can pass through to the input. The resulting brief delay slows the oscillations to audible frequencies.</p>
<p>To build the oscillator, assemble the schematic below on a breadboard.</p>
<p><img width="450" vspace="4" hspace="4" height="393" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/osc.png?w=450&#038;h=393" alt="" /></p>
<p>When done, the oscillator should look something like this:</p>
<p> <img width="450" vspace="4" hspace="4" height="754" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/osc.jpg?w=450&#038;h=754" alt="" />
<p>Connect one side of the audio jack to 0V and the other side to the output, and it will sound like this:</p>
<p> <embed width="450" height="27" type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://media.libsyn.com/media/markjeffrey/had_dsynth_oscillator_no_control.mp3" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded"></embed>
</p>
<h2>Controlling the oscillator</h2>
<p>We can make things more interesting by allowing the user to change the frequency. We replace the constant resistor R1 with a potentiometer, such as the 100K R2. This is a simple change to do, and is reflected in this altered schematic.</p>
<p><img width="450" vspace="4" hspace="4" height="481" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/osc_var.png?w=450&#038;h=481" alt="" /></p>
<p><img width="450" vspace="4" hspace="4" height="493" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/osc_var.jpg?w=450&#038;h=493" alt="" /></p>
<p>Now the oscillator sounds like this:</p>
<p> <embed width="450" height="27" type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://media.libsyn.com/media/markjeffrey/had_dsynth_oscillator_control.mp3" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded"></embed><br />Much more interesting. Try playing an actual song, if you dare.
</p>
<h2>Duty cycle adjustment</h2>
<p>We can add some basic timbre control to make the oscillator more interesting. The duty cycle of a square wave is how long it spends at logic 1 vs. at logic 0. For example, a wave that spends 1 ms at +5V and 1ms at 0V per cycle would have a 50% duty cycle. 1.5 ms at +5V and 0.5 ms at 0V would be a 75% duty cycle. To adjust the wave&#8217;s duty cycle, we can add another potentiometer and diode to the circuit. When the input is high and the output is low, current will be able to flow through both potentiometers, decreasing the amount of time it takes to charge the capacitor, and increasing the duty cycle.</p>
<p><img width="450" vspace="4" hspace="4" height="628" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/osc_duty.png?w=450&#038;h=628" alt="" /></p>
<p><img width="450" vspace="4" hspace="4" height="394" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/osc_duty.jpg?w=450&#038;h=394" alt="" /></p>
<p>It should sound like this when completed:</p>
<p> <embed width="450" height="27" type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://media.libsyn.com/media/markjeffrey/had_dsynth_oscillator_pwm_control.mp3" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded"></embed>
</p>
<h2>Creating an LFO</h2>
<p>A low-frequency oscillator (LFO) is an oscillator that oscillates very slowly, from 1 to 100 cycles per second. We will use an LFO to alternate the pitch of our oscillator between two different frequencies. This can be used for siren like sound effects, timbre control, or musical sequences.</p>
<p>The circuit to control the LFO is slightly more complex than the ones we have used before. Because it uses a capacitor with 10x the capacitance, and a potentiometer with 10x the resistance, the oscillations are 100x slower than our first oscillator. The LFO connects to the gate of the IRF 510 MOSFET transistor. When the output of the LFO is +5V, the transistor connects its source and drain pins. With these pins connected, current can flow through the second potentiometer, increasing the pitch. When the LFO returns to 0V, the potentiometer is disconnected, and the pitch drops back to its original level.</p>
<p><img width="451" vspace="4" hspace="4" height="686" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/lfo.png?w=451&#038;h=686" alt="" /></p>
<p><img width="450" vspace="4" hspace="4" height="512" border="0" src="http://hackadaycom.files.wordpress.com/2008/04/lfo_breadboard.jpg?w=450&#038;h=512" alt="" /></p>
<p>There are quite a number of sounds that can be produced with the LFO, such as this:</p>
<p> <embed width="450" height="27" type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://media.libsyn.com/media/markjeffrey/had_dsynth_lfo1.mp3" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded"></embed><br />and this:<br /><embed width="450" height="27" type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://media.libsyn.com/media/markjeffrey/had_dsynth_lfo2.mp3" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded"></embed>
</p>
<h2>Conclusion</h2>
<p>You have now made your own simple digital synthesizer. Keep experimenting with different control methods. The frequency is adjusted with just resistance, so almost anything can be used for an input. Try a <a href="http://www.engadget.com/2006/07/05/thingamagoop-the-synth-with-personality/">photocell</a>, or a <a href="http://createdigitalmusic.com/2005/08/08/hypersense-complex-gestural-gloves-for-music/">flex sensor</a>. Try combining the LFO and the duty cycle adjustment. Try using it to actually make music! We&#8217;d love to see what you come up with.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1748/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1748/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1748/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1748&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/05/01/how-to-make-a-digital-synthesizer/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">loganwilliams</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/lfo_breadboard.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/parts.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/osc.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/osc.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/osc_var.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/osc_var.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/osc_duty.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/osc_duty.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/lfo.png" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/04/lfo_breadboard.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: Where to find parts for your projects</title>
		<link>http://hackaday.com/2007/11/16/how-to-where-to-find-parts-for-your-projects/</link>
		<comments>http://hackaday.com/2007/11/16/how-to-where-to-find-parts-for-your-projects/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 00:59:00 +0000</pubDate>
		<dc:creator>Will O'Brien</dc:creator>
				<category><![CDATA[cnc hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[digikey]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mouser]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[radioshack]]></category>
		<category><![CDATA[salvage]]></category>
		<category><![CDATA[sparkfun]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2007/11/16/how-to-where-to-find-parts-for-your-projects/</guid>
		<description><![CDATA[Hunting down the right parts usually takes more time than soldering everything together. I can&#8217;t count the number of projects that I tried to build and couldn&#8217;t find some key component that&#8217;s no longer made. You can help put together a list of suppliers at the end, but the idea is to have a quick [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1541&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/11/parts.jpg?w=425&#038;h=283" alt="" /><br />Hunting down the right parts usually takes more time than soldering everything together. I can&#8217;t count the number of projects that I tried to build and couldn&#8217;t find some key component that&#8217;s no longer made. You can help put together a list of suppliers at the end, but the idea is to have a quick reference to get your projects rolling (saving your money for important things, like espresso). Even if you&#8217;re familiar with the usual electronics parts shops, chime in to help me create a list of the best suppliers to fuel those hardware hacking projects.</p>
<p><span id="more-1541"></span></p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2007/11/radio-shack-bits.jpg?w=425&#038;h=283" /><br />If you want to keep your money, I&#8217;d avoid <a href="http://www.radioshack.com/category/index.jsp?categoryId=2032058">RadioShack</a> as much as possible. When you&#8217;re stuck because you can&#8217;t find a freaking 10kohm resistor, it&#8217;s fine, but the markup on their low quality parts is insane-their clearance prices aren&#8217;t too bad. As much as people bag on RadioShack, just remember that nobody else bothers to sell electronic parts in the middle of nowhere.</p>
<p>Shipping can eat your project budget quicker than anything else. It&#8217;s the reason that I&#8217;m sometimes willing to pay $1 for $.05 in resistors at RadioShack. When I&#8217;m buying parts, I try to buy from a single supplier if possible to maximize my parts budget. </p>
<p>Stocking up on parts in bulk can help make projects extra affordable later on. Buying a quantity of resistors, capacitors, PNP and NPN transistors and a decent supply of linear voltage regulators will save you a fair amount of money later on. I love it when I can build a $30 project for the cost of a proto-board and an odd capacitor.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2007/11/samples-1.jpg?w=425&#038;h=283" /><br />Just about every electronics component manufacturer will provide free samples on request. That&#8217;s right &#8211; free. It&#8217;s usually just a matter of creating an account on the manufacturers web site and selecting the components you need. As a rule, I don&#8217;t mention when I&#8217;ve sampled parts for a project. Seriously, they&#8217;ll get a little suspicious if 100 people suddenly sample the exact same parts. Samples aren&#8217;t limited to semiconductor companies. [ladyada] has a <a href="http://www.ladyada.net/resources/procure/samples.html">nice list </a>of sample providers, including enclosures and connectors.</p>
<p> <img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2007/11/digikey.jpg?w=425&#038;h=283" /><br /><a href="http://digikey.com/">Digi-Key</a> carries just about every part you can think of. These guys prefer to sell large quantities, but they&#8217;re happy to take small orders. Orders are shipped out fast, but they&#8217;ll tack on an extra $5 fee if your order is under $25. Even if you&#8217;re not ordering, they usually have data sheets linked for every part they carry online. If you&#8217;re wiling to jump through the hoops, you can even create a parts order that&#8217;s linkable from your website &#8211; it can make it much easier to share a project with others, but I usually find that a few part numbers get deprecated as time goes by. Oh, and they&#8217;ll send you a massive parts catalog that&#8217;s handy for parts hunting and brain storming.</p>
<p><a href="http://mouser.com/">Mouser Electronics</a> is one of my favorite suppliers these days. They have reasonable shipping options and are fast with UPS ground orders showing up at my house within two days. Their inventory isn&#8217;t always the best, but substitution parts are usually easy to find because the online catalog links to web enabled PDF pages from their print catalog. It makes cross-referencing very easy. Like Digi-Key, they&#8217;ll send you a massive parts catalog to shove under your monitor.</p>
<p><a href="http://www.futurlec.com">Futurlec</a> is a great place to get incredibly cheap parts, but you won&#8217;t be seeing your order for about a month (ok, so my last order showed up after three weeks). I suggest stocking up on connector headers and resistors. I haven&#8217;t had to make a late night resistor run in a couple of years thanks to these guys.</p>
<p><a href="http://www.sparkfun.com">Sparkfun electronics</a> is like a candy shop for Hack-A-Day readers. They carry higher end parts like GPS units, GMRS modules and micro controller programmers. Pricing varies a bit, but I can always find something interesting there. If you prefer professionally made PC Boards, they even put together an <a href="http://www.batchpcb.com/">inexpensive PC Board service</a>.</p>
<p><a href="http://ebay.com">ebay</a> is one of my favorite places to shop for parts. It&#8217;s a great place to buy brand new $150 stepper motors for $20 or hunt down funky, hackable hardware. People certainly try to sell single components, but it&#8217;s usually not worth the effort.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2007/11/steppers-from-printers.jpg?w=425&#038;h=283" /><br />Salvaging parts is the absolute cheapest method for parts shopping. Thanks to custom ICs and SMD parts, newer electronics don&#8217;t normally have much in the way of salvage value. On the other hand, older hardware is a great source for parts. My current favorite salvage source is the dot matrix printer. They&#8217;re easy to take apart, have nice power supplies, and they&#8217;re loaded with quality heat sinks, wiring, connectors, hardened steel rods, and stepper motors. The bigger the dot matrix printer, the bigger the stepper motor. If you can score a few of the same model, you&#8217;ll end up with a few matched sets. People hate throwing them away, so they&#8217;re easy to get for free.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2007/11/obsolete-bit.jpg?w=425&#038;h=283" /><br />Lack of availability can be a problem, but obsolete parts are another way to keep costs down. Originally, the UCN5804B stepper driver I used for the <a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.engadget.com%2F2006%2F06%2F29%2Fhow-to-build-your-own-cnc-machine-part-1%2F&amp;ei=xE8-R8CFM6HkigG2luSYCA&amp;usg=AFQjCNGi60aiIoyo30Pr-kCT9c6GO_6rUQ&amp;sig2=Tf2TT0if1rEBIC-fofLxzQ">cutting board CNC machine</a> cost about $16 each. Now that they&#8217;re deprecated, they can be had for about $5 each.</p>
<p>Grab bags are another good way to save money. They&#8217;re usually full of loose parts that&#8217;ll have to be identified, but they&#8217;re cheap. The guys over at uchobby put together <a href="http://www.uchobby.com/index.php/2007/08/09/grab-bag-sorting-how-to/">a nice how-to</a> on sorting them.</p>
<p>Thanks to the movement from mail order to internet suppliers, the parts company scene is huge. There are loads of production part and surplus companies around. Here&#8217;s a quick list of shops that&#8217;ll probably be useful if you&#8217;re looking for parts.</p>
<p><a href="http://digikey.com/">Digi-Key electronics</a><br /><a href="http://mouser.com/">Mouser electronics</a><br /><a href="http://www.futurlec.com">Futurlec</a><br /><a href="http://www.sparkfun.com">Sparkfun electronics</a><br /><a href="http://www.ebay.com">eBay</a><br /><a href="http://www.allelectronics.com/">All Electronics</a><br /><a href="http://www.bgmicro.com/">BG Micro</a><br /><a href="http://www.sciplus.com/">American Science &amp; Surplus</a><br /><a href="http://www.goldmine-elec.com/">Goldmine Electronics</a><br /><a href="http://www.mpja.com/">MPJA Online</a><br /><a href="http://www.mcmelectronics.com/">MCM Electronics</a><br /><a href="http://www.partsexpress.com">Parts Express</a></p>
<p>Got a favorite shop? Drop the link in the comments and I&#8217;ll add it to the list.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1541/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1541/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1541/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1541&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2007/11/16/how-to-where-to-find-parts-for-your-projects/feed/</wfw:commentRss>
		<slash:comments>71</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Will O&#039;Brien</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2007/11/parts.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/11/radio-shack-bits.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/11/samples-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/11/digikey.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/11/steppers-from-printers.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/11/obsolete-bit.jpg" medium="image" />
	</item>
		<item>
		<title>How-To: Introduction to soldering</title>
		<link>http://hackaday.com/2007/10/26/how-to-introduction-to-soldering/</link>
		<comments>http://hackaday.com/2007/10/26/how-to-introduction-to-soldering/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 18:00:00 +0000</pubDate>
		<dc:creator>Will O'Brien</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[amp]]></category>
		<category><![CDATA[breadboard]]></category>
		<category><![CDATA[circuit]]></category>
		<category><![CDATA[headphoneamp]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[solder]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[solderingiron]]></category>
		<category><![CDATA[wire]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2007/10/26/how-to-introduction-to-soldering/</guid>
		<description><![CDATA[It&#8217;s been a while since we&#8217;ve had a fresh How-To on the Hack-A-Day, and frankly we&#8217;ve missed them. To get things rolling, [Eliot] and I wanted to build a good knowledge base to help you hack your own stuff. I know that soldering won&#8217;t be new to many of our readers, but everyone has to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1514&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img width="425" vspace="4" hspace="4" height="217" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0476-1.jpg?w=425&#038;h=217" alt="" /><br />It&#8217;s been a while since we&#8217;ve had a fresh How-To on the Hack-A-Day, and frankly we&#8217;ve missed them. To get things rolling, [Eliot] and I wanted to build a good knowledge base to help you hack your own stuff. I know that soldering won&#8217;t be new to many of our readers, but everyone has to start sometime. Our hope is simple: that this new series of How-To&#8217;s will help inspire new and experienced hackers alike.</p>
<p><span id="more-1514"></span></p>
<p>Having the right tools and workspace are key to successful soldering. The actual technique is pretty simple. We will cover all the basic tools you need, the key to good soldering, and how to undo your mistakes or harvest components from old hardware.</p>
<p><img width="425" vspace="4" hspace="4" height="154" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0518.jpg?w=425&#038;h=154" alt="" /><br />The first thing you&#8217;ll need is a decent soldering iron. <a href="http://www.cooperhandtools.com/brands/weller/">Weller</a> makes a decent product, but <a href="http://www.radioshack.com/family/index.jsp?categoryId=2032313&amp;cp=2032058.2032236">RadioShack&#8217;s</a> are dirt cheap if you&#8217;re in a hurry. My favorite iron was a temperature controlled <a href="http://www.mcmconnect.com/tenma/category/181400000/181400000/Soldering%20Equipment">Tenma</a> with LED temp display (sadly lost from a crappy storage unit along with my oscilloscope).</p>
<p><img width="425" vspace="4" hspace="4" height="270" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0519.jpg?w=425&#038;h=270" alt="" /><br />Most soldering stations come with a sponge; they get lost and they tend to hold onto bits of solder. I actually prefer to use a paper towel instead. Either way, wet it down and give it a squeeze so it&#8217;s not sopping wet. If it dries out, it&#8217;ll burn when you wipe your iron on it.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0477-1.jpg?w=425&#038;h=283" id="img6" alt="" /><br />Buying the right kind of solder is just as important. It comes in various thicknesses, metal alloys, and core types. I won&#8217;t get very deep into the alloys. Generally, you want 60/40 (60% tin, 40% lead). Most modern electronics are lead free, but for hobby work lead is fine. Just wash your hands when you&#8217;re done! The solder produced for plumbing work is usually very thick (left hand side) and has a solid metal core (or worse: acid core). For electronics work, you&#8217;ll definitely need rosin core. The rosin acts as flux for the solder, allowing it to flow onto and attach to the metal. You can certainly use liquid flux/rosin, but it&#8217;s usually not easy to find locally. For thickness, I always buy the thinnest rosin core I can find. To sum up: you want thin, rosin core, 60/40 solder.</p>
<p><img width="425" vspace="4" hspace="4" height="225" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0481-1.jpg?w=425&#038;h=225" id="img7" alt="" /><br />Not all iron tips are created equal. For fine work, I always reach for my 15 watt Weller pencil iron. It has the smallest tip I could find, and I ground an even finer point on the tip with my rotary tool. The bigger iron is an inexpensive RadioShack station that I keep in my office to handle favors for coworkers.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0482-1.jpg?w=425&#038;h=283" id="img8" alt="" /><br />Every so often, the tip of a soldering iron needs a little maintenance. If the end of the iron isn&#8217;t tinned, as in bright and shiny when you wipe it down, you&#8217;ll have a hard time getting solder to melt. Think of this stuff as a sort of pumice stone for your iron. Heat the iron up and rub the tip in the cleaner. The cleaner will melt a bit and your soldering iron should work better than ever.</p>
<p><img width="425" vspace="4" hspace="4" height="312" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0486-1.jpg?w=425&#038;h=312" id="img11" alt="" /><br />Securely holding the work piece is important, but your hands will be busy with the iron and solder. My current favorite tool is this <a href="http://www.panavise.com/f/vises/vises_combo.html">Panavise Jr.</a> which runs about $25. Props to <a href="http://www.adafruit.com/">Ladyada</a> for unknowingly turning me onto Panavise products. If you need something cheaper, you can score a set of helping hands &#8211; it&#8217;s set of alligator clips connected to a weighted base. They work great and I still use them for smaller soldering projects.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0487-1.jpg?w=425&#038;h=283" id="img12" alt="" /><br />Some projects require extra fine attention to detail. A giant magnifying glass lamp comes in handy when visually inspecting for shorts and dealing with surface mount problems (I inherited this one one from my grandmother). You&#8217;ll be fine without one, but they&#8217;re great when you need to work on really small components or when your eyes are getting tired.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0488-1.jpg?w=425&#038;h=283" id="img13" alt="" /><br />For one-off projects, prototyping boards from RadioShack are handy. They&#8217;re cheap, easy to get, and making a connection is as simple as bridging your solder across the copper pads.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0513-1.jpg?w=425&#038;h=283" id="img3" alt="" /><br />Before investing your time soldering parts together, it&#8217;s a good idea to prototype your circuit. Breadboards like these are great for preventing frustration later on. When I tried to buy my first one, I was about 10 years old. Nobody knew what the hell I was talking about and the local RadioShack apparently didn&#8217;t keep them in stock. People at RadioShack kept trying to sell me kitchen cutting boards. After about a year of wondering if [<a href="http://www.forrestmims.com/">Forrest Mims</a>] was insane, I finally visited another RadioShack that actually had them.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0514-1.jpg?w=425&#038;h=283" id="img4" alt="" /><br />Don&#8217;t bake your bits. Passive components like resistors or small ceramic capacitors don&#8217;t usually suffer any problems from being heated up, but you should still pay attention to how long you&#8217;ve been cooking them with your soldering iron. If you&#8217;re having problems getting a solder joint just right, let the parts rest for a few minutes so they have a chance to cool off between soldering rounds.</p>
<p><img width="425" vspace="4" hspace="4" height="164" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2007/10/img_0517-1.jpg?w=425&#038;h=164" id="img5" /><br />Integrated circuits like this logic chip are usually far more sensitive to heat and static than passive components. Sockets are cheap insurance against blowing a chip. </p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" alt="" src="http://hackadaycom.files.wordpress.com/2007/10/img_0490-1.jpg?w=425&#038;h=283" id="img15" /><br />RadioShack sells the small red handled clip as a heat sink. It&#8217;s okay, but a generic hemostat like the one above works and holds on even better. They&#8217;re also great for saving your finger tips from burns by holding wires in place while you solder them.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0495-1.jpg?w=425&#038;h=283" id="img17" alt="" /><br />To successfully solder a component, don&#8217;t melt the solder on the iron. Put the iron against the copper on the board (solder pad) and the component you want to attach. Give the iron a moment to heat up both of them. Then melt the solder on the component and, if needed the copper pad.</p>
<p>Do not melt the solder on the tip of the iron. Sometimes it&#8217;s necessary to melt a small amount on the iron to facilitate heat transfer, but to achieve a good connection, you want the solder to melt and flow onto the component leads.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0498-1.jpg?w=425&#038;h=283" id="img20" alt="" /><br />Heat up the component with the iron just before applying solder!</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0500-1.jpg?w=425&#038;h=283" id="img21" alt="" /><br />Once the joint is good, the soldering iron can be used to remove small amou<br />
nts of excess solder from the joint.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://www.hackaday<br />
.com/media/2007/10/img_0511-1.jpg&#8221; id=&#8221;img31&#8243; alt=&#8221;" /><br />Wipe the solder and burn rosin off by pulling the tip across your wet sponge or paper towel.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0501-1.jpg?w=425&#038;h=283" id="img22" alt="" /><br />The joint should be good if the solder flowed onto both the copper pad and the wire lead of the component.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0502-1.jpg?w=425&#038;h=283" id="img23" alt="" /><br />Now you&#8217;ll need to trim down the excess wire lead of the component. If you use diagonal cutters, the piece you cut off will probably fly through the air. These flat cutters are my favorite: the metal wire stays still and the resulting edge isn&#8217;t nearly as sharp.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0483-1.jpg?w=425&#038;h=283" id="img9" alt="" /><br />Nobody&#8217;s perfect. Sometimes we need to remove a bad component or undo a mistake. Desoldering braid works sort of like a sponge for excess solder.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0506-1.jpg?w=425&#038;h=283" id="img27" alt="" /><br />To desolder something, just place the braid over the target and apply your soldering iron over the top. The heat should transfer through the braid and the melted solder will flow onto the the copper like oil though a wick. For larger amounts of solder, I normally pull out my bigger iron. For small amounts, even the pencil iron does the trick.</p>
<p><img width="425" vspace="4" hspace="4" height="163" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0484-1.jpg?w=425&#038;h=163" id="img10" alt="" /><br />For larger desoldering jobs, like recovering components, a desoldering iron works wonders. The hotter the better, so let it warm up for a while before using it.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0509-1.jpg?w=425&#038;h=283" id="img29" alt="" /><br />Compress the bulb with your thumb before you touch the board with the iron.</p>
<p><img width="425" vspace="4" hspace="4" height="283" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/img_0510-1.jpg?w=425&#038;h=283" id="img30" alt="" /><br />Once it&#8217;s in position, give it a moment the heat the solder and release the bulb. The bulb with suck up the solder through the hollow tip. Larger components might take a few hits, but smaller ones usually only take a single pull.</p>
<p><img width="425" vspace="4" hspace="4" height="319" border="0" src="http://hackadaycom.files.wordpress.com/2007/10/headphone-amp-guts.jpg?w=425&#038;h=319" alt="" /><br />We&#8217;ve covered all the basics: the tools, soldering and desoldering. If you&#8217;re looking for a good starter project, I highly suggest taking a shot at making your own headphone amplifier. I built <a href="http://biobug.org/audio/cmoy/">this one</a> from RadioShack parts (I had some high end opamps in my parts bin). It&#8217;s a rewarding, low cost project. If you want an even more illustrated guide, check out these basic <a href="http://radiojove.gsfc.nasa.gov/telescope/soldering.htm">videos from NASA</a> or even this <a href="http://www.solder.net/technical/tips.asp">collection of videos from Solder.net</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1514/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1514/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1514/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1514&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2007/10/26/how-to-introduction-to-soldering/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Will O&#039;Brien</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0476-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0518.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0519.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0477-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0481-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0482-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0486-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0487-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0488-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0513-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0514-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0517-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0490-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0495-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0498-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0500-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0501-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0502-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0483-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0506-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0484-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0509-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/img_0510-1.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2007/10/headphone-amp-guts.jpg" medium="image" />
	</item>
	</channel>
</rss>
