<?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; monday parts</title>
	<atom:link href="http://hackaday.com/tag/monday-parts/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Sun, 12 Feb 2012 06:24:26 +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; monday parts</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>Parts: 4&#215;4 RGB button pad controller SPI</title>
		<link>http://hackaday.com/2009/03/09/parts-4x4-rgb-button-pad-controller-spi/</link>
		<comments>http://hackaday.com/2009/03/09/parts-4x4-rgb-button-pad-controller-spi/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 18:38:22 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[parts]]></category>
		<category><![CDATA[peripherals hacks]]></category>
		<category><![CDATA[blinkenlights]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[button pad]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[leds]]></category>
		<category><![CDATA[massive fail]]></category>
		<category><![CDATA[monday parts]]></category>
		<category><![CDATA[RGB LED]]></category>
		<category><![CDATA[sparkfun electronics]]></category>
		<category><![CDATA[spi]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=8609</guid>
		<description><![CDATA[We covered SparkFun&#8217;s new RGB button pad controller a few weeks ago. This is a full-color clone of the monome interface; a 4&#215;4 grid of buttons with tri-color LEDs underneath. Each LED has 24bits of color control, for more than 16million color combinations. Up to 10 panels can be chained together to create huge button [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=8609&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-8850" title="cover" src="http://hackadaycom.files.wordpress.com/2009/03/cover.jpg" alt="cover" width="450" height="315" /></p>
<p>We covered SparkFun&#8217;s new <a href="http://hackaday.com/2009/02/05/sparkfun-releases-rgb-button-controller/">RGB button pad controller</a> a few weeks ago. This is a full-color clone of the <a href="http://monome.org/">monome</a> interface; a 4&#215;4 grid of buttons with tri-color LEDs underneath. Each LED has <a href="http://en.wikipedia.org/wiki/Truecolor">24bits of color control</a>, for more than 16million color combinations. Up to 10 panels can be chained together to create huge button grids, like <a href="http://www.youtube.com/watch?v=G9RPLtAvXlE">SparkFun&#8217;s Tetris table</a>. We previously used a smaller version in our <a href="http://hackaday.com/2008/06/12/how-to-make-an-rgb-combination-door-lock-part-1/">RGB combination lock</a>.</p>
<p>We asked SparkFun to send us the SPI version of the button controller to test. This is a new product developed in-house at SparkFun, with open source hardware and software. Read about our experience interfacing this board below.</p>
<p><span id="more-8609"></span><strong>4&#215;4 RGB button pad controller SPI (SparkFun #<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9022">WIG-09022</a>, $39.95)</strong></p>
<p>The button pad controller is a bare PCB, we also received a button pad cover (SparkFun #<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=7835">COM-07835</a>, $9.95), and two of each bezel (SparkFun #<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8747">COM-08747</a>, #<a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8746">COM-08746</a>, $3.95).  The SPI version we&#8217;re working with can be driven directly by a microcontroller, or by a USB &#8216;master&#8217;. The USB controller version has an additional microcontroller and FTDI USB-&gt;serial converter for PC connectivity.</p>
<p>When the button pad arrived, we immediately sat down with the datasheet and tried to interface the board with our <a href="http://hackaday.com/the-bus-pirate-universal-serial-interface/">Bus Pirate universal serial interface</a>. The protocol described in version 1 of the datasheet didn&#8217;t work, at all.</p>
<p>SparkFun open sourced this project, so we determined the correct interface protocol from the source code for the <a href="http://www.sparkfun.com/Code/ButtonPadControllerSPI_v15.zip">button pad SPI</a> (ZIP) and the <a href="http://www.sparkfun.com/Code/ButtonPadControllerUSB_v15.zip">button pad USB controller</a> (ZIP). We figured out most of the protocol from the source, but it still took help from SparkFun&#8217;s engineers to uncover some of the undocumented, finer points of interfacing the board. Version 2 of the <a href="http://www.sparkfun.com/datasheets/Widgets/ButtonPadControllerSPI_UserGuide_v2.pdf">datasheet</a> (PDF) accurately depicts the interface protocol.</p>
<p><em>Connections</em></p>
<table border="0">
<tbody>
<tr>
<td><strong>Bus Pirate</strong></td>
<td><strong>Button pad</strong></td>
</tr>
<tr>
<td>MISO</td>
<td>MISO</td>
</tr>
<tr>
<td>MOSI</td>
<td>MOSI</td>
</tr>
<tr>
<td>Clock</td>
<td>SCK</td>
</tr>
<tr>
<td>CS</td>
<td>CS</td>
</tr>
<tr>
<td>+5volts</td>
<td>VCC</td>
</tr>
<tr>
<td>GND</td>
<td>GND</td>
</tr>
</tbody>
</table>
<p>The button pad&#8217;s SPI signals are described as they relate to the on-board microcontroller, which is opposite the usual notation. The MOSI (master out, slave in) signal is actually the board&#8217;s data output, and MISO (master in, slave out) is the data input.</p>
<p>We tested the button pad with the Bus Pirate, but the same basic principals apply to any custom microcontroller code. The board runs at 5volts, so we powered it from the Bus Pirate&#8217;s on-board 5volt power supply. The SPI interface operates at 5volt logic levels, so we connected the Bus Pirate&#8217;s <a href="http://en.wikipedia.org/wiki/Pull-up_resistor">pull-up resistors</a> to the 5volt power supply and enabled them on all signal lines.</p>
<p>We interfaced the button board using the Bus Pirate&#8217;s raw3wire library. Raw3wire is a software SPI library with bit-wise operations. The hardware SPI library only allows full byte operations which aren&#8217;t granular enough to interface the board. We put the Bus Pirate in raw3wire mode (menu option M), and chose the HiZ pin option because the pull-up resistors will hold the bus at 5volts.</p>
<blockquote><p>RAW3WIRE&gt;l <strong>&lt;&#8211;configure bit order</strong><br />
1. MSB first<br />
2. LSB first<br />
MODE&gt;2<strong> &lt;&#8211;least significant bit first</strong><br />
LSB SET: LEAST SIG BIT FIRST<br />
RAW3WIRE&gt;W <strong>&lt;&#8211;enable power supply</strong><br />
VOLTAGE SUPPLIES ON<br />
RAW3WIRE&gt;</p></blockquote>
<p>The button pad communicates least significant bit first, so we also configured the library to communicate LSB first. Finally, we hit capital &#8216;W&#8217; to enable the Bus Pirate&#8217;s power supplies. The button board will flash each color momentarily as part of its power-on self-test.</p>
<p><em>Single/multiple button board setup</em></p>
<p><img class="alignnone size-full wp-image-8966" title="config2" src="http://hackadaycom.files.wordpress.com/2009/03/config2.png" alt="config2" width="450" height="110" /></p>
<p>Each board needs to be configured for single or multi-board use. Boards come pre-programmed for single-board operation, but it might be a good idea to set the configuration anyways. The board configuration is permanently stored in EEPROM, so it only has to be done once.</p>
<blockquote><p>RAW3WIRE&gt;[\_ <strong>&lt;--take all signals low</strong><br />
CS ENABLED <strong>&lt;--CS enabled is 0volts</strong><br />
CLOCK, 0<br />
DATA OUTPUT, 0<br />
RAW3WIRE&gt;</p></blockquote>
<p>A special sequence places the board in configuration mode. Begin with all signal lines low (]\_).</p>
<blockquote><p>RAW3WIRE&gt;-^ 1 1 <strong>&lt;&#8211;set single board operation</strong><br />
DATA OUTPUT, 1 <strong>&lt;&#8211;data high</strong><br />
0&#215;01 CLOCK TICKS <strong>&lt;&#8211;one clock tick</strong><br />
WRITE: 0&#215;01 <strong>&lt;&#8211;config option 1, number of boards</strong><br />
WRITE: 0&#215;01 <strong>&lt;&#8211;set the number of boards</strong><br />
RAW3WIRE&gt;w <strong>&lt;&#8211;small &#8216;w&#8217;, power off</strong><br />
VOLTAGE SUPPLIES OFF<br />
RAW3WIRE&gt;W <strong>&lt;&#8211;capital &#8216;W&#8217;, power on</strong><br />
VOLTAGE SUPPLIES ON<br />
RAW3WIRE&gt;</p></blockquote>
<p>To enter configuration mode, take the data line high (-) and send one clock pulse (^), but <em>leave chip select low</em>. The board is now ready to accept configuration settings.</p>
<p>The first byte sent after entering configuration mode tells the board which setting to modify. Currently, only the number of boards can be configured (0&#215;01). Next, send the number of connected boards, between 1 and 10. we sent 1 because we&#8217;re interfacing a single board. Reset the board and it will light a LED corresponding to the programmed number of boards.</p>
<p><em>Set colors and read button status</em></p>
<p>Now we&#8217;re ready to send color data to the board and read the button status. First, note that the CS (chip select) signal is opposite normal conventions. Usually CS activates a chip when the signal is low (0volts), and idles it when the signal is high (5volts); this is usually denoted by /CS, #CS, or !CS. Instead, the button controller is active when CS is high.</p>
<p><img class="alignnone size-full wp-image-8960" title="frames" src="http://hackadaycom.files.wordpress.com/2009/03/frames.png" alt="frames" width="450" height="62" /></p>
<p>A 64byte transaction sets the LED colors and retrieves the button status. The first 16bytes program the red level for each LED, followed by 16bytes of green, and 16bytes of blue. Finish by reading 16bytes from the board to get the status of each button. Buttons data is sent as 0&#215;00 if pressed, and 0xff if not pressed. The datasheet recommends a 400us delay between writing the color frames and reading the button data, but the Bus Pirate is slow enough that we won&#8217;t worry about that.</p>
<p><img class="alignnone size-full wp-image-8961" title="inter" src="http://hackadaycom.files.wordpress.com/2009/03/inter.png" alt="inter" width="450" height="130" /></p>
<p>The protocol is simple enough, but there&#8217;s one <em>major</em> catch. The clock line <strong><em>must</em></strong> be high before raising CS, or the bytestream will be off by 1 bit. For this reason, many hardware SPI modules won&#8217;t work with the board.  This isn&#8217;t a problem if your microcontroller lets you twiddle  pins that are controlled by a hardware module, but the micros we&#8217;ve worked with <em>don&#8217;t</em> allow this.</p>
<p><img class="alignnone size-full wp-image-8848" title="white" src="http://hackadaycom.files.wordpress.com/2009/03/white.jpg" alt="white" width="450" height="338" /></p>
<blockquote><p>RAW3WIRE&gt;/]255:16 255:16 255:16 r:16[<br />
CLOCK, 1 <strong>&lt;--clock <em>must</em> be high prior to raising CS</strong><br />
CS DISABLED <strong>&lt;--CS to 5volts, opposite normal use</strong><br />
BULK WRITE 0xFF , 0x10 TIMES <strong>&lt;--red LEDs</strong><br />
BULK WRITE 0xFF , 0x10 TIMES <strong>&lt;--green LEDs</strong><br />
BULK WRITE 0xFF , 0x10 TIMES <strong>&lt;--blue LEDs</strong><br />
BULK READ 0x10 BYTES: <strong>&lt;--read button state</strong><br />
0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF<br />
CS ENABLED <strong>&lt;--CS to 0volts, opposite normal use</strong><br />
RAW3WIRE&gt;</p></blockquote>
<p>This command sets every color of each LED to full, and reads back the 16 button status bytes.</p>
<p>We first set clock high (/), and only then can we raise CS to 5volts (]) and begin the data transaction. 255:16 is a repeated command that sends the value 255  sixteen times. As each color channel has 8bits of intensity control, 255 is 100% on. We send 255 a total of 48 times, once for each color of each LED. Finally, we retrieve one 16byte frame of button data (r:16) and lower CS to end the transaction ([). The button values are all 0xff, indicating that no buttons are pressed.</p>
<p><img class="alignnone size-full wp-image-8849" title="blue" src="http://hackadaycom.files.wordpress.com/2009/03/blue.jpg" alt="blue" width="450" height="310" /></p>
<blockquote><p>RAW3WIRE&gt;/] 0:16 0:16 128:16 r:16[<br />
CLOCK, 1<br />
CS DISABLED<br />
BULK WRITE 0x00 , 0x10 TIMES<br />
BULK WRITE 0x00 , 0x10 TIMES<br />
BULK WRITE 0x80 , 0x10 TIMES <strong>&lt;--all blue to 50%</strong><br />
BULK READ 0x10 BYTES:<br />
0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF<br />
CS ENABLED<br />
RAW3WIRE&gt;</p></blockquote>
<p>Here, we set the blue level of every LED to 50% (128) and turn off all other colors. The button output now shows that button 0 is pressed.</p>
<p><img class="alignnone size-full wp-image-8851" title="red" src="http://hackadaycom.files.wordpress.com/2009/03/red.jpg" alt="red" width="450" height="324" /></p>
<blockquote><p>RAW3WIRE&gt;/] 0 0 0 0 255 255 255 255 0 0 0 0 0 0 0 0 0:16 0:16 r:16[<br />
CLOCK, 1<br />
CS DISABLED<br />
WRITE: 0&#215;00 <strong>&lt;&#8211; red LED 0, off</strong><br />
&#8230;<strong> &lt;&#8211;more of the same</strong><br />
WRITE: 0&#215;00 <strong>&lt;&#8211; red LED 3, off</strong><br />
WRITE: 0xFF <strong>&lt;&#8211; red LED 4, 100% on</strong><br />
WRITE: 0xFF <strong>&lt;&#8211; red LED 5, 100% on</strong><br />
WRITE: 0xFF<strong> &lt;&#8211; red LED 6, </strong><strong>100% </strong><strong>on</strong><br />
WRITE: 0xFF<strong> &lt;&#8211; red LED 7, </strong><strong>100% </strong><strong>on</strong><br />
WRITE: 0&#215;00 <strong>&lt;&#8211; red LED 8, off</strong><br />
&#8230; <strong>&lt;&#8211;more of the same</strong><br />
WRITE: 0&#215;00<strong> &lt;&#8211; red LED 15, off</strong><br />
BULK WRITE 0&#215;00 , 0&#215;10 TIMES <strong>&lt;&#8211; all green LEDs off</strong><br />
BULK WRITE 0&#215;00 , 0&#215;10 TIMES <strong>&lt;&#8211;all blue LEDs off</strong><br />
BULK READ 0&#215;10 BYTES: <strong>&lt;&#8211;read button status</strong><br />
0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF<br />
CS ENABLED<br />
RAW3WIRE&gt;</p></blockquote>
<p>This example shows how to address single LEDs. This time we actually write out all 16 bytes of the red color frame. Buttons 0-3 and 8-15 have a red value of 0 (red off), buttons 4-7 are set to 100% red (255). All green and blue LEDs are off (0, 0%).</p>
<p><em>Conclusion</em></p>
<p>It was really frustrating to get this board working because the first version of the datasheet had so many errors. SparkFun&#8217;s engineers and support were really helpful, and posted a corrected datasheet within days. As long as you have the updated datasheet, this is an easy board to work with.</p>
<p>We&#8217;d like to see a firmware update that eliminates the need to keep the clock signal high before raising CS. This quirk makes the board incompatible with many hardware SPI modules, leaving slow bit-bang routines as the only interface option. Fortunately, the source code is open and available to anyone who wants to make this change.</p>
<p>The button pad controller is a really neat board, and we look forward to using it in a future project.</p>
<p><strong>Hack a Day review disclosure</strong>: We asked for a free board and SparkFun sent it to us. We had a terrible time getting it to work with the instructions in the first version of the datasheet, we documented that experience here.</p>
<br />Posted in parts, peripherals hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/8609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/8609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/8609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/8609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/8609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/8609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/8609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/8609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/8609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/8609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/8609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/8609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/8609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/8609/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=8609&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2009/03/09/parts-4x4-rgb-button-pad-controller-spi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Ian</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/03/cover.jpg" medium="image">
			<media:title type="html">cover</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/03/config2.png" medium="image">
			<media:title type="html">config2</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/03/frames.png" medium="image">
			<media:title type="html">frames</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/03/inter.png" medium="image">
			<media:title type="html">inter</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/03/white.jpg" medium="image">
			<media:title type="html">white</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/03/blue.jpg" medium="image">
			<media:title type="html">blue</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/03/red.jpg" medium="image">
			<media:title type="html">red</media:title>
		</media:content>
	</item>
		<item>
		<title>Parts: Precision humidity and temperature sensor (SHT1x/7x)</title>
		<link>http://hackaday.com/2008/12/29/parts-precision-humidity-and-temperature-sensor-sht1x7x/</link>
		<comments>http://hackaday.com/2008/12/29/parts-precision-humidity-and-temperature-sensor-sht1x7x/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 18:03:14 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[parts]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[2 wire interface]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[interfacing]]></category>
		<category><![CDATA[monday parts]]></category>
		<category><![CDATA[sensirion]]></category>
		<category><![CDATA[sht11]]></category>
		<category><![CDATA[sht1x]]></category>
		<category><![CDATA[sht71]]></category>
		<category><![CDATA[sht7x]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=7279</guid>
		<description><![CDATA[Sensirion&#8217;s SHTxx is a digitally interfaced humidity and temperature sensor. Accurate humidity measurements usually require careful analog design, but the SHTxx moves all that complicated stuff into a single chip. Through-hole (SHT7x) and surface mount (SHT1x) versions are available, we used the surface mount SHT11 with +/-3% accuracy. We&#8217;ll show you how to use the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=7279&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-7334" title="sht11" src="http://hackadaycom.files.wordpress.com/2008/12/sht11.jpg" alt="sht11" width="450" height="322" /></p>
<p>Sensirion&#8217;s <a href="http://www.sensirion.com/en/01_humidity_sensors/00_humidity_sensors.htm">SHTxx</a> is a digitally interfaced humidity and temperature sensor. Accurate humidity measurements usually require careful analog design, but the SHTxx moves all that complicated stuff into a single chip. Through-hole (SHT7x) and surface mount (SHT1x) versions are available, we used the surface mount SHT11 with +/-3% accuracy. We&#8217;ll show you how to use the SHTxx below.</p>
<p><span id="more-7279"></span></p>
<p><strong>Sensirion SHT1x/SHT7x precision humidity and temperature sensor (<a href="http://octopart.com/search?q=sht*">Octopart search</a>, starting at $25).</strong></p>
<p>This isn&#8217;t a cheap sensor. Octopart lists <a href="http://octopart.com/search?q=sht*">a few places to buy it</a>. Several smaller hobby electronics stores carry it; Hobby Engineering has it for $29 (#<a href="http://www.hobbyengineering.com/H1509.html">H01509-01C</a>). We found compatible PCB footprints in <em>sht10_11_15.lbr</em> and <em>sht11.lbr</em> on the <a href="http://www.cadsoftusa.com/cgi-bin/download.pl?page=/home/cadsoft/html_public/download.htm.en&amp;dir=eagle/userfiles/libraries">Cadsoft library download page</a>. Pin connections for the different package types are in the datasheet: <a href="http://www.sensirion.com/en/pdf/product_information/Datasheet-humidity-sensor-SHT1x.pdf">SHT1x</a> (PDF), <a href="http://www.sensirion.com/en/pdf/product_information/Datasheet-humidity-sensor-SHT7x.pdf">SHT7x</a> (PDF).</p>
<p><img class="alignnone size-full wp-image-7314" title="sht11" src="http://hackadaycom.files.wordpress.com/2008/12/cct1.png" alt="sht11" width="452" height="337" /></p>
<p>The SHTxx has a two-wire serial interface that requires pull-up resistors (R1,2), values between 2K and 10K should work. Sensirion recommends a decoupling capacitor (C1) only if the sensor is powered over a length of wire, but we think it&#8217;s always a good idea to include one.</p>
<p>We&#8217;ll demonstrate the SHTxx using the <a href="http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/">Bus Pirate universal serial interface</a> in raw2wire mode with Hi-Z outputs. The SHTxx is powered from the Bus Pirate&#8217;s 3.3volt supply. The Bus Pirate&#8217;s on-board pull-up resistors hold the bus high, eliminating the need for external resistors R1 and R2.</p>
<p><strong>Interface</strong></p>
<p>The SHTxx communicates over two wires using a simple serial protocol. The protocol isn&#8217;t compatible with I2C, but a single SHTxx can exist on a bus with I2C peripherals.</p>
<table border="0">
<tbody>
<tr>
<td><strong>Command</strong></td>
<td><strong>Code</strong></td>
</tr>
<tr>
<td>Measure Temperature</td>
<td><em>000</em>00011</td>
</tr>
<tr>
<td>Measure Relative Humidity</td>
<td><em>000</em>00101</td>
</tr>
<tr>
<td>Read Status Register</td>
<td><em>000</em>00111</td>
</tr>
<tr>
<td>Write Status Register</td>
<td><em>000</em>00110</td>
</tr>
<tr>
<td>Soft reset</td>
<td><em>000</em>11110</td>
</tr>
</tbody>
</table>
<p>Five commands control the SHTxx, these are outlined in the table. The first 3 bits are the address (always 000), the remaining 5 bits are a unique command code.</p>
<p><strong>Reset</strong></p>
<p>Start a transaction by clearing any partial commands or data from a previous use. A minimum of nine clock ticks while data is high will clear the SHTxx interface. The Bus Pirate syntax to for this is <em>-^:9</em>; data high (-), 9 clock ticks (^:9).<strong><br />
</strong></p>
<p>Commands to the SHT11 begin with a unique start condition. Like an <a href="http://www.esacademy.com/faq/i2c/busevents/i2cstast.htm">I2C start condition</a>, this is the only time when the data signal changes with the clock signal high. This illegal condition causes the chip to prepare for a new command. The SHTxx start condition is different than I2C, allowing both types of devices to exist on the same bus.</p>
<p>The Bus Pirate code to generate an SHTxx style start condition is<em> -/_\/-\ </em>; data starts high (-), clock up (/), data goes low (_), clock low (\), clock high (/), data goes high (-), and a final clock low transition (\) ends the sequence.</p>
<p>A soft reset is a good idea because it puts the chip in a default state. Prior to the first temperature or humidity conversion, we send the soft reset command.</p>
<blockquote><p>RAW2WIRE&gt;-^:9 -/_\/-\ 0b00011110 !<strong>&lt;&#8211;command</strong><br />
4xx RAW2WIRE DATA OUTPUT, 1 <strong>&lt;&#8211;clear interface</strong><br />
4xx RAW2WIRE 0&#215;09 CLOCK TICKS<br />
4xx RAW2WIRE DATA OUTPUT, 1 <strong>&lt;&#8211;start condition</strong><br />
4xx RAW2WIRE CLOCK, 1<br />
4xx RAW2WIRE DATA OUTPUT, 0<br />
4xx RAW2WIRE CLOCK, 0<br />
4xx RAW2WIRE CLOCK, 1<br />
4xx RAW2WIRE DATA OUTPUT, 1<br />
4xx RAW2WIRE CLOCK, 0<br />
420 RAW2WIRE WRITE: 0x1E <strong>&lt;&#8211;soft reset code</strong><br />
4xx RAW2WIRE READ BIT: 0 <strong>&lt;&#8211;acknowledge</strong><strong> bit, OK</strong><br />
RAW2WIRE&gt;</p></blockquote>
<p>First, we clear the interface (-^:9), then send the start condition (<em>-/_\/-\). </em>The reset command (0b00011110=0x1E) follows. The SHTxx acknowledges (acks) commands by pulling the data line low for one bit after a command is transmitted. We read one bit (!) to get the acknowledgment status; 0 is success, 1 signals an error.</p>
<p><strong>Temperature</strong></p>
<p>Now we can read the temperature<strong>. </strong>This happens in two steps, with a delay for the temperature conversion.<strong><br />
</strong></p>
<blockquote><p>RAW2WIRE&gt;-^:9 -/_\/-\ 0b00000011 !<br />
4xx RAW2WIRE DATA OUTPUT, 1  <strong>&lt;&#8211;clear interface</strong><br />
4xx RAW2WIRE 0&#215;09 CLOCK TICKS<br />
4xx RAW2WIRE DATA OUTPUT, 1 <strong>&lt;&#8211;start condition</strong><br />
&#8230;<br />
4xx RAW2WIRE CLOCK, 0<br />
420 RAW2WIRE WRITE: 0&#215;03 <strong>&lt;&#8211;start temperature conversion</strong><br />
4xx RAW2WIRE READ BIT: 0 <strong>&lt;&#8211;ack bit, OK</strong><br />
RAW2WIRE&gt;</p></blockquote>
<p>First, we send a start condition and the temperature conversion command (00000011=0&#215;03). The SHTxx replies to a successful command by pulling the data line low for one bit (ack). After the ack bit, the data line goes high until the conversion finishes.</p>
<blockquote><p>RAW2WIRE&gt;.<br />
4xx RAW2WIRE DATA INPUT, STATE: 0 <strong>&lt;&#8211;data low when done</strong><br />
RAW2WIRE&gt;</p></blockquote>
<p>When the data line goes low, the temperature conversion is finished. &#8216;.&#8217; is the Bus Pirate command to read the data state without a clock tick. Now we can grab the result.</p>
<blockquote><p>RAW2WIRE&gt;r_^ r_^ r_^<br />
430 RAW2WIRE READ: 0&#215;17 <strong>&lt;&#8211;data byte 1</strong><br />
4xx RAW2WIRE DATA OUTPUT, 0 <strong>&lt;&#8211;data low</strong><br />
4xx RAW2WIRE 0&#215;01 CLOCK TICKS <strong>&lt;&#8211;send ack bit</strong><br />
430 RAW2WIRE READ: 0xCC <strong>&lt;&#8211;data byte 2</strong><br />
4xx RAW2WIRE DATA OUTPUT, 0<br />
4xx RAW2WIRE 0&#215;01 CLOCK TICKS<br />
430 RAW2WIRE READ: 0x0C <strong>&lt;&#8211;crc</strong><br />
4xx RAW2WIRE DATA OUTPUT, 0<br />
4xx RAW2WIRE 0&#215;01 CLOCK TICKS<br />
RAW2WIRE&gt;</p></blockquote>
<p>Each byte read (r) requires an I2C style acknowledgment bit with the data low. We do this with the _^ sequence; data low (_), one clock tick (^).</p>
<p>The first two bytes are the temperature reading (0x17cc), followed by a CRC (0x0c). The raw value (0x17cc=6092) is converted to degrees Celsius using the equation and coefficients on page 9 of the datasheet. Temperature readings are 14bits by default:</p>
<p style="padding-left:30px;">T = -39.7 + 0.01*<em>X</em></p>
<p style="padding-left:30px;"><span style="text-decoration:underline;">21.22C</span> = -39.7 + (0.01*<em>6092</em>)</p>
<p><strong>Humidity</strong></p>
<p>Humidity conversions are started with code 00000101 (0&#215;05 hex).<strong><br />
</strong></p>
<blockquote><p>RAW2WIRE&gt;-^:9 -/_\/-\ 0b00000101 ! <strong>&lt;&#8211;command</strong><br />
4xx RAW2WIRE DATA OUTPUT, 1 <strong>&lt;&#8211;clear interface</strong><br />
4xx RAW2WIRE 0&#215;09 CLOCK TICKS<br />
4xx RAW2WIRE DATA OUTPUT, 1 <strong>&lt;&#8211;start condition</strong><br />
&#8230;<br />
4xx RAW2WIRE CLOCK, 0<br />
420 RAW2WIRE WRITE: 0&#215;05 <strong>&lt;&#8211;start humidity conversion</strong><br />
4xx RAW2WIRE READ BIT: 0<strong>&lt;&#8211;ack bit, OK</strong></p></blockquote>
<p>As before, a ninth acknowledgment bit is low if the SHTxx processed the command.</p>
<blockquote><p>RAW2WIRE&gt;.<br />
4xx RAW2WIRE DATA INPUT, STATE: 0 <strong>&lt;&#8211;data low when done</strong></p></blockquote>
<p>The data line goes high and then returns low when the humidity conversion is done.</p>
<blockquote><p>RAW2WIRE&gt;r_^ r_^ r_^<br />
430 RAW2WIRE READ: 0&#215;05 <strong>&lt;&#8211;data byte 1</strong><br />
4xx RAW2WIRE DATA OUTPUT, 0 <strong>&lt;&#8211;data low</strong><br />
4xx RAW2WIRE 0&#215;01 CLOCK TICKS <strong>&lt;&#8211;ack bit</strong><br />
430 RAW2WIRE READ: 0&#215;80 <strong>&lt;&#8211;data byte 2</strong><br />
4xx RAW2WIRE DATA OUTPUT, 0<br />
4xx RAW2WIRE 0&#215;01 CLOCK TICKS<br />
430 RAW2WIRE READ: 0&#215;46 <strong>&lt;&#8211;crc</strong><br />
4xx RAW2WIRE DATA OUTPUT, 0<br />
4xx RAW2WIRE 0&#215;01 CLOCK TICKS<br />
RAW2WIRE&gt;</p></blockquote>
<p>A complete conversion generates a three byte response. The first two bytes are the raw humidity reading (0&#215;0580=1408), the final byte is a CRC (0&#215;46) that can be used to verify data integrity.</p>
<p>Humidity readings have 12bits of resolution by default, convert to humidity using this equation:</p>
<p style="padding-left:30px;">RH = -2.0468 + 0.0367(<em>X</em>) + (-0.0000015955*(<em>X</em>^2))</p>
<p style="padding-left:30px;"><span style="text-decoration:underline;">46.46%RH</span> = -2.0468 + 0.0367(<em>1408</em>) + (-0.0000015955*(<em>1408</em>^2))</p>
<p><strong>Conclusion</strong></p>
<p>This isn&#8217;t a cheap sensor, but it doesn&#8217;t require careful analog design like the <a href="http://content.honeywell.com/sensing/prodinfo/humiditymoisture/">Honeywell HIH series</a>. Have you worked with a humidity sensor?</p>
<p>Like this post? Check out the <a href="http://hackaday.com/category/parts/">parts posts</a> you may have missed.</p>
<br />Posted in parts, tool hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/7279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/7279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/7279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/7279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/7279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/7279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/7279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/7279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/7279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/7279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/7279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/7279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/7279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/7279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=7279&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/12/29/parts-precision-humidity-and-temperature-sensor-sht1x7x/feed/</wfw:commentRss>
		<slash:comments>19</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/12/sht11.jpg" medium="image">
			<media:title type="html">sht11</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/cct1.png" medium="image">
			<media:title type="html">sht11</media:title>
		</media:content>
	</item>
		<item>
		<title>Parts: 1-Wire temperature sensor (DS1822)</title>
		<link>http://hackaday.com/2008/12/10/parts-1-wire-temperature-sensor-ds1822/</link>
		<comments>http://hackaday.com/2008/12/10/parts-1-wire-temperature-sensor-ds1822/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:35:05 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[home hacks]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[1-wire]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[dallas]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[maxim]]></category>
		<category><![CDATA[monday parts]]></category>
		<category><![CDATA[temperature]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=6706</guid>
		<description><![CDATA[Download: buspirate.v0d.zip Dallas/Maxim&#8217;s 1-Wire protocol is the most requested addition to the Bus Pirate.  We finally got some 1-Wire parts, and today we&#8217;ll demonstrate the DS1822 1-Wire digital thermometer. Grab the datasheet (PDF) and follow along. This post is accompanied by release v.0d of the Bus Pirate firmware for hardware version 0. This includes the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6706&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-6812" title="1wire" src="http://hackadaycom.files.wordpress.com/2008/12/1wire.jpg" alt="1wire" width="447" height="207" /></p>
<p><strong>Download:</strong> <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0d.zip">buspirate.v0d.zip</a></p>
<p>Dallas/Maxim&#8217;s <a href="http://en.wikipedia.org/wiki/1-Wire">1-Wire</a> protocol is the most requested addition to the <a href="http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/">Bus Pirate</a>.  We finally got some 1-Wire parts, and today we&#8217;ll demonstrate the<a href="http://www.maxim-ic.com/quick_view2.cfm?qv_pk=2795"> DS1822 1-Wire digital thermometer</a>. Grab the <a href="http://datasheets.maxim-ic.com/en/ds/DS1822.pdf">datasheet</a> (PDF) and follow along.</p>
<p>This post is accompanied by release v.0d of the Bus Pirate firmware for hardware version 0. This includes the new 1-Wire protocol library, more configuration options, and other improvements.</p>
<p><span id="more-6706"></span><strong><a href="http://www.maxim-ic.com/quick_view2.cfm?qv_pk=2795">DS1822</a> Economy Digital Thermometer (Digikey #<a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=DS1822%2B-ND">DS1822+-ND</a>, $3.87)</strong> We found a footprint in the 1-wire library for <a href="http://www.cadsoft.de/freeware.htm">Eagle</a> on the <a href="http://www.cadsoft.de/cgi-bin/download.pl?page=/home/cadsoft/html_public/download.htm.en&amp;dir=pub/userfiles/libraries">Cadsoft download page</a>.</p>
<p>The 1-Wire protocol uses a single wire for data transfer, and sometimes power. Data is transferred in <a href="http://en.wikipedia.org/wiki/1-Wire#Example_communication_with_a_device">time-sensitive &#8216;slots&#8217;</a> because there isn&#8217;t a separate clock to delineate bit periods.</p>
<p><img class="alignnone size-full wp-image-6755" title="ds1822cct" src="http://hackadaycom.files.wordpress.com/2008/12/ds1822cct.png" alt="ds1822cct" width="452" height="224" /></p>
<table border="0">
<tbody>
<tr>
<td>
<div><strong>Bus Pirate</strong></div>
</td>
<td><strong>DS1822</strong></td>
</tr>
<tr>
<td>
<div><strong>SDA</strong></div>
</td>
<td>DQ</td>
</tr>
<tr>
<td><strong>+5volts</strong></td>
<td>Vdd</td>
</tr>
<tr>
<td>
<div><strong>Ground</strong></div>
</td>
<td>GND</td>
</tr>
</tbody>
</table>
<p>The DS1822 connections are shown in the table. We used the Bus Pirate&#8217;s 5volt supply to power the DS1822, but it also works at 3.3volts. A resistor (R1, ~5K) holds the bus high.</p>
<p>All 1-Wire commands start with a reset procedure, followed by one of five ROM commands.</p>
<table border="0">
<tbody>
<tr>
<td><strong>Command</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>0&#215;33</td>
<td>READ ROM. Read single device address.</td>
</tr>
<tr>
<td>0&#215;55</td>
<td>MATCH ROM. Match device address, followed by 64bit address.</td>
</tr>
<tr>
<td>0xCC</td>
<td>SKIP ROM. Address all devices together.</td>
</tr>
<tr>
<td>0xEC</td>
<td>ALARM SEARCH. Search for alarm condition.</td>
</tr>
<tr>
<td>0xF0</td>
<td>SEARCH ROM. Part of address enumeration procedure.</td>
</tr>
</tbody>
</table>
<p>ROM commands are described on page 10 of the datasheet. All ROM commands are available as macros in the Bus Pirate 1-Wire library, see (0) for a menu. ROM command macros <em>include the 1-Wire bus reset procedure</em>.</p>
<p><strong>Single device</strong></p>
<p><strong><img class="alignnone size-full wp-image-6759" title="singli-4501" src="http://hackadaycom.files.wordpress.com/2008/12/singli-4501.jpg" alt="singli-4501" width="450" height="325" /><br />
</strong></p>
<p>All 1-Wire devices have a unique 64bit (8 byte) address, and some 1-Wire devices are used exclusively to give electronics a unique tracking number. When a single device is connected to a 1-Wire bus, the READ ROM command will extract its address.</p>
<blockquote><p>1-WIRE&gt;{ 0&#215;33 r:8 <strong>&lt;&#8211;command</strong><br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE: 0&#215;33 <strong>&lt;&#8211;READ ROM</strong><br />
xxx 1WIRE BULK READ, 0&#215;08 BYTES:<br />
0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29 <strong>&lt;&#8211;ID#</strong><br />
1-WIRE&gt;</p></blockquote>
<p>The command sends a bus reset ({), the READ ROM command (0&#215;33), and reads the 64bit address (r:8, 8 bytes *8bits/byte=64bits).</p>
<p>The first byte (0&#215;22) identifies this as a DS1822 thermometer. The next 6 bytes are unique to this device, and the final byte is a <a href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check">CRC</a> of the previous 7 bytes.</p>
<p>Now we can address the device with the MATCH ROM command and send it further instructions.</p>
<blockquote><p>1-WIRE&gt;{ 0&#215;55 0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29 0&#215;44<br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE: 0&#215;55<strong>&lt;&#8211;MATCH ROM command</strong><br />
xxx 1WIRE WRITE: 0&#215;22<strong>&lt;&#8211;start address</strong><br />
xxx 1WIRE WRITE: 0&#215;47<br />
xxx 1WIRE WRITE: 0&#215;45<br />
xxx 1WIRE WRITE: 0&#215;22<br />
xxx 1WIRE WRITE: 0&#215;00<br />
xxx 1WIRE WRITE: 0&#215;00<br />
xxx 1WIRE WRITE: 0&#215;00<br />
xxx 1WIRE WRITE: 0&#215;29<br />
xxx 1WIRE WRITE: 0&#215;44 <strong>&lt;&#8211;start conversion</strong><br />
1-WIRE&gt;</p></blockquote>
<p>First, we send the MATCH ROM command (0&#215;55) and the device address (8 bytes).  Next is the CONVERT T command (0&#215;44, datasheet page 11) that starts the temperature conversion.</p>
<p>A second command sequence retrieves the temperature reading from the DS1822.</p>
<blockquote><p>1-WIRE&gt;{ 0&#215;55 0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29 0xbe r:9<br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE: 0&#215;55<br />
xxx 1WIRE WRITE: 0&#215;22<br />
<em>&#8230;long 1-Wire address&#8230;</em><br />
xxx 1WIRE WRITE: 0&#215;29<br />
xxx 1WIRE WRITE: 0xBE <strong>&lt;&#8211;read scratchpad command</strong><br />
xxx 1WIRE BULK READ, 0&#215;09 BYTES:<br />
0&#215;71 0&#215;01 0xFF 0&#215;00 0x7F 0xFF 0x0F 0&#215;10 0xF8<br />
1-WIRE&gt;</p></blockquote>
<p>The READ SCRATCHPAD command (0xBE, datasheet page 11) returns 9 bytes. We only care about the first two bytes, the rest can be decoded according the the table on page 7 of the datasheet. Temperature is calculated according to page 4 of the datasheet: 0&#215;0171 HEX=369 DEC, 369*0.0625=23C  (74F).</p>
<p><strong>Multiple devices</strong></p>
<p><img class="alignnone size-full wp-image-6756" title="multi-450" src="http://hackadaycom.files.wordpress.com/2008/12/multi-450.jpg" alt="multi-450" width="450" height="340" /></p>
<p>When multiple 1-Wire devices share a bus it&#8217;s more difficult to determine all the addresses. The fastest way to find attached devices is with the SEARCH ROM command (0xF0) and a binary branching procedure. The Bus Pirate automates this with macro (240).</p>
<blockquote><p>1-WIRE&gt;(240) <strong>&lt;&#8211;macro 240</strong><br />
xxx 1WIRE ROM COMMAND: SEARCH (0xF0)<br />
Found devices at:<br />
Macro     1-WIRE address<br />
1.0&#215;22 0&#215;50 0&#215;28 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0x0A <strong>&lt;&#8211;address</strong><br />
*DS1822 Econ Dig Therm <strong>&lt;&#8211;type according to family code</strong><br />
2.0&#215;22 0xD0 0xC7 0x1A 0&#215;00 0&#215;00 0&#215;00 0&#215;01<br />
*DS1822 Econ Dig Therm<br />
3.0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29<br />
*DS1822 Econ Dig Therm<br />
Found 0&#215;03 devices.<br />
The first 10 device IDs are available by MACRO, see (0).<br />
1-WIRE&gt;</p></blockquote>
<p>The SEARCH ROM command shows the devices it found, and the type according to the family code.</p>
<p>We think typing 8 byte 1-Wire addresses is really tedious, so the first 10 device addresses are stored in memory and can be accessed with the macros (1)&#8230;(10). A buffer for up to 50 device addresses can be defined in the 1-Wire library at compile time. Ideally, this data will be stored in a global scratch buffer shared by all modules in a future firmware update.</p>
<blockquote><p>1-WIRE&gt;(0) <strong>&lt;&#8211;show macro list</strong><br />
0.Macro menu<br />
Macro     1-WIRE address <strong>&lt;&#8211;enumerated device addresses</strong><br />
1.0&#215;22 0&#215;50 0&#215;28 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0x0A<br />
*DS1822 Econ Dig Therm<br />
2.0&#215;22 0xD0 0xC7 0x1A 0&#215;00 0&#215;00 0&#215;00 0&#215;01<br />
*DS1822 Econ Dig Therm<br />
3.0&#215;22 0&#215;47 0&#215;45 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0&#215;29<br />
*DS1822 Econ Dig Therm<br />
1-WIRE ROM COMMAND MACROs:<strong>&lt;&#8211;normal commands</strong><br />
51.READ ROM (0&#215;33) *for single device bus<br />
85.MATCH ROM (0&#215;55) *followed by 64bit address<br />
204.SKIP ROM (0xCC) *followed by command<br />
236.ALARM SEARCH (0xEC)<br />
240.SEARCH ROM (0xF0)<br />
1-WIRE&gt;</p></blockquote>
<p>The macro menu (0) will also include the device addresses stored in the roster. Now we can just address devices by macro, rather than typing the whole 64bit address every time.</p>
<blockquote><p>1-WIRE&gt;(85) (1) 0&#215;44 <strong>&lt;&#8211;start conversion</strong><br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE ROM COMMAND: MATCH (0&#215;55) *follow with 64bit address<br />
xxx 1WIRE ADDRESS MACRO 1: 0&#215;22 0&#215;50 0&#215;28 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0x0A<br />
xxx 1WIRE WRITE: 0&#215;44<br />
1-WIRE&gt;(85) (1) 0xbe r:9 <strong>&lt;&#8211;fetch reading</strong><br />
xxx 1WIRE BUS RESET OK<br />
xxx 1WIRE WRITE ROM COMMAND: MATCH (0&#215;55) *follow with 64bit address<br />
xxx 1WIRE ADDRESS MACRO 1: 0&#215;22 0&#215;50 0&#215;28 0&#215;22 0&#215;00 0&#215;00 0&#215;00 0x0A<br />
xxx 1WIRE WRITE: 0xBE<br />
xxx 1WIRE BULK READ, 0&#215;09 BYTES:<br />
0&#215;81 0&#215;01 0x4B 0&#215;46 0x7F 0xFF 0x0F 0&#215;10 0&#215;71<br />
1-WIRE&gt;</p></blockquote>
<p>(85) is a shortcut for a bus reset and MATCH ROM command. (1) is the device address macro, and 0&#215;44 is the command to begin a temperature conversion. Retrieving the reading involves the same macros, but substitutes the command to read the device (0xBE) and grabs 9 bytes (r:9). The temperature is 0&#215;0181, or 24C next to the PC fan.</p>
<p><strong>Taking it further</strong></p>
<p>We used the Bus Pirate to give a visual demonstration of the 1-Wire protocol, but the real challenge is integrating it into your own design. Maxim provides <a href="http://www.maxim-ic.com/products/ibutton/software/1wire/wirekit.cfm">example code</a>, Microchip has an <a href="http://ww1.microchip.com/downloads/en/AppNotes/01199a.pdf">app note</a> (PDF), and you can check out the <a href="http://www.microchipc.com/sourcecode/#heater">example code</a> we used.</p>
<p><strong>Firmware download:</strong> <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0d.zip">buspirate.vod.zip</a></p>
<br />Posted in home hacks, parts, tool hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/6706/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/6706/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/6706/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6706&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/12/10/parts-1-wire-temperature-sensor-ds1822/feed/</wfw:commentRss>
		<slash:comments>16</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/12/1wire.jpg" medium="image">
			<media:title type="html">1wire</media:title>
		</media:content>

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

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/singli-4501.jpg" medium="image">
			<media:title type="html">singli-4501</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/multi-450.jpg" medium="image">
			<media:title type="html">multi-450</media:title>
		</media:content>
	</item>
		<item>
		<title>Parts: 3.5mm stereo audio jacks</title>
		<link>http://hackaday.com/2008/10/13/parts-35mm-stereo-audio-jacks/</link>
		<comments>http://hackaday.com/2008/10/13/parts-35mm-stereo-audio-jacks/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 16:45:53 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[audio connector]]></category>
		<category><![CDATA[audio jacks]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[headphone plug]]></category>
		<category><![CDATA[microphone plug]]></category>
		<category><![CDATA[monday parts]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=3937</guid>
		<description><![CDATA[3.5mm stereo connectors for headphones and microphones are almost mandatory for audio projects. X1 (left) is a simple plug with connections for the audio channels (pin 2,3), and ground (pin 1). X2 (right) has pass-through contacts (pin 2,3) that divert audio to an internal speaker when headphones aren&#8217;t connected. Here’s a breakdown of the audio [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=3937&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-4665" title="audio-smd-450" src="http://hackadaycom.files.wordpress.com/2008/10/audio-smd-450.jpg" alt="" width="450" height="283" /></p>
<p><a href="http://pinouts.ru/Home/Tele35s_pinout.shtml">3.5mm stereo connectors</a> for headphones and microphones are almost mandatory for audio projects. X1 (left) is a simple plug with connections for the audio channels (pin 2,3), and ground (pin 1). X2 (right) has pass-through contacts (pin 2,3) that divert audio to an internal speaker when headphones aren&#8217;t connected.</p>
<p>Here’s a breakdown of the audio connectors illustrated above.<span id="more-3937"></span> We found footprints for these parts, and several other SMD audio connectors, in the <em>con-cuistack</em> part library on the <a href="http://cadsoft.de/cgi-bin/download.pl?page=/home/cadsoft/html_public/download.htm.en&amp;dir=eagle/userfiles/libraries">Cadsoft download page</a>.</p>
<p><strong>X1 3.5mm stereo audio jack</strong> (Mouser #<a href="http://www.mouser.com/Search/ProductDetail.aspx?R=161-3334-Evirtualkey11180000virtualkey161-3334-E">161-3334-E</a>, $1.16) This is a simple stereo audio jack with no internal pass-through. Fits footprint SJ-3523 in the <em>con-cuistack</em> library.</p>
<p><strong>X2 3.5mm stereo audio jack with internal pass-through </strong>(Mouser #<a href="http://www.mouser.com/Search/ProductDetail.aspx?R=161-3335virtualkey11180000virtualkey161-3335">161-3335</a>, $1.25) This is our favorite audio jack, but it looks like it&#8217;s going to be discontinued soon. Can anyone recommend an equivalent? Fits footprint SJ-3515 in the <em>con-cuistack</em> part library.</p>
<p>Don&#8217;t forget to check out our previous <a href="http://hackaday.com/category/parts/">parts</a> posts.</p>
<br />Posted in classic hacks, misc hacks, parts  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/3937/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/3937/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/3937/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/3937/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/3937/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/3937/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/3937/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/3937/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/3937/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/3937/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/3937/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/3937/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/3937/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/3937/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=3937&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/10/13/parts-35mm-stereo-audio-jacks/feed/</wfw:commentRss>
		<slash:comments>21</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/10/audio-smd-450.jpg" medium="image">
			<media:title type="html">audio-smd-450</media:title>
		</media:content>
	</item>
		<item>
		<title>Parts: microSD memory card holders</title>
		<link>http://hackaday.com/2008/10/06/parts-microsd-memory-card-holders/</link>
		<comments>http://hackaday.com/2008/10/06/parts-microsd-memory-card-holders/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 19:24:50 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[card connector]]></category>
		<category><![CDATA[card holder]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[microsd]]></category>
		<category><![CDATA[monday parts]]></category>
		<category><![CDATA[sd card]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=4360</guid>
		<description><![CDATA[SD cards add cheap persistent memory to your project, but the holder takes a lot of board space. A smaller option is the microSD flash format. MicroSD cards are compatible with regular SD cards, and most come with a free adapter. We looked at four holders for our mini web server. Which should you choose? [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=4360&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-4361" title="usd-holder-header-450" src="http://hackadaycom.files.wordpress.com/2008/10/usd-holder-header-450.jpg" alt="" width="450" height="138" /></p>
<p>SD cards add cheap persistent memory to your project, but the holder takes a lot of board space. A smaller option is the <a href="http://en.wikipedia.org/wiki/MicroSD">microSD</a> flash format. MicroSD cards are compatible with regular SD cards, and most come with a free adapter. We looked at four holders for our <a href="http://hackaday.com/2008/09/25/web-server-on-a-business-card-part-2/">mini web server</a>. Which should you choose? Read about our experience below.<span id="more-4360"></span></p>
<p><img class="alignnone size-full wp-image-4362" title="usd-holders450" src="http://hackadaycom.files.wordpress.com/2008/10/usd-holders450.jpg" alt="" width="450" height="147" /></p>
<p>Here&#8217;s a breakdown of the microSD card holders illustrated above:</p>
<p>Alps <a href="http://www.mouser.com/Search/ProductDetail.aspx?R=SCHA1B0100virtualkey68800000virtualkey688-SCHA1B0100">SCHA1B0100</a> $1.27 &#8211; Can you see pins through the holes in the first holder? They &#8216;re hard to see, and almost inaccessible. We didn&#8217;t find this holder very useful for prototyping.</p>
<p>JAE <a href="http://www.mouser.com/Search/ProductDetail.aspx?R=ST6S008V4AR1500virtualkey65610000virtualkey656-ST6S008V4AR1500">ST6S008V4AR1500</a> $1.46 &#8211; This is another model with pins located at the front, but these are further forward for easier access. It&#8217;s still going to be a pain to solder, avoid if possible.</p>
<p>SparkFun <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=127">PRT-00127</a> $3.95 &#8211; Finally, a holder with pins at the back. This is a fairly easy-to-solder part, but it&#8217;s not ideal. The soldering tabs are very small and slightly recessed under the shield. It&#8217;s also the most expensive microSD holder we&#8217;ve seen. SparkFun has a <a href="http://www.cadsoft.de">Cadsoft Eagle</a> footprint for this part in <a href="http://www.opencircuits.com/SFE_Footprint_Library_Eagle">their library</a>. We think Molex <a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=xbccQsLEe0ep5GA560fwAA%3d%3d">538-502702-0891</a> ($3.58) is probably very similar. We used this holder with the mini web server.</p>
<p>Alps <a href="http://www.mouser.com/Search/ProductDetail.aspx?R=SCHA2B0300virtualkey68800000virtualkey688-SCHA2B0300">SCHA2B0300</a> &#8211; $1.27 &#8211; The long pins along both sides of this holder are easy to solder. The holder is reversed, meaning the card inserts upside-down. Reversed holders seem weird on an all surface mount board, but they fit nicely in through-hole designs. There&#8217;s no Eagle footprint yet, but we&#8217;ll send an SCHA2B0300 to the first person who <a href="http://www.instructables.com/id/How-to-make-a-custom-library-part-in-Eagle-CAD-too/">makes one</a>; here&#8217;s the <a href="http://www3.alps.com/WebObjects/catalog.woa/E/PDF/Connector/microSD_Card/SCHA/SCHA.PDF">datasheet</a> (pdf).</p>
<p>Check out our previous <a href="http://hackaday.com/category/parts/">parts</a> posts: <a href="http://hackaday.com/2008/09/29/parts-01uf-decoupling-capacitors/">0.1uF decoupling capacitors</a>, the <a href="http://hackaday.com/2008/09/22/parts-lm317-adjustable-voltage-regulator/">LM317 adjustable regulator</a>, and <a href="http://hackaday.com/2008/09/15/tact-switches-for-your-next-project/">tactile switches</a>.</p>
<br />Posted in news, parts  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/4360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/4360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/4360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/4360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/4360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/4360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/4360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/4360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/4360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/4360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/4360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/4360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/4360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/4360/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=4360&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/10/06/parts-microsd-memory-card-holders/feed/</wfw:commentRss>
		<slash:comments>16</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/10/usd-holder-header-450.jpg" medium="image">
			<media:title type="html">usd-holder-header-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/usd-holders450.jpg" medium="image">
			<media:title type="html">usd-holders450</media:title>
		</media:content>
	</item>
		<item>
		<title>Parts: 0.1uF decoupling capacitors</title>
		<link>http://hackaday.com/2008/09/29/parts-01uf-decoupling-capacitors/</link>
		<comments>http://hackaday.com/2008/09/29/parts-01uf-decoupling-capacitors/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 20:30:00 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[capacitors]]></category>
		<category><![CDATA[decoupling capacitors]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[monday parts]]></category>
		<category><![CDATA[smd]]></category>
		<category><![CDATA[smt]]></category>
		<category><![CDATA[surface mount]]></category>
		<category><![CDATA[through hole]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=3962</guid>
		<description><![CDATA[Most ICs need to be decoupled from their power supply, usually with a 0.1uF capacitor between each power pin and ground. Decoupling is usually used to remove noise and to smooth power fluctuations. Every project will need a few decoupling capacitors; our mini web server project has three ICs that require a total of 11. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=3962&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-3948" title="caps1" src="http://hackadaycom.files.wordpress.com/2008/09/caps1.jpg" alt="" width="450" height="330" /></p>
<p>Most <a href="http://en.wikipedia.org/wiki/Integrated_circuit">IC</a>s need to be <a href="http://en.wikipedia.org/wiki/Decoupling_capacitor">decoupled</a> from their power supply, usually with a 0.1uF capacitor between each power pin and ground. Decoupling is usually used to remove noise and to smooth power fluctuations. Every project will need a few decoupling capacitors; our <a href="http://hackaday.com/2008/09/25/web-server-on-a-business-card-part-2/">mini web server project</a> has three ICs that require a total of 11.  This can be an expensive part to buy in singles, so it&#8217;s crucial to stock up online. Read more about our favorite bulk through-hole and surface mount decoupling capacitors after the break.<span id="more-3962"></span></p>
<p><img class="alignnone size-full wp-image-3949" title="caps2" src="http://hackadaycom.files.wordpress.com/2008/09/caps2.jpg" alt="" width="450" height="159" /></p>
<p>The capacitors we selected should be sufficient for most projects. All three parts are rated for 50volts, far more than most digital circuits. We used cheap 20% <a href="http://en.wikipedia.org/wiki/Capacitor_(component)#Capacitor_construction">tolerance</a> parts because it&#8217;s not critical that decoupling capacitors be exactly 0.1uF. Higher or lower tolerance capacitors will also work, but there&#8217;s no advantage to using high quality decoupling capacitors. Here&#8217;s a breakdown of the 0.1uF capacitors pictured above:</p>
<p><strong>C1</strong> <em>through-hole 0.1uF capacitor</em>, such as Mouser #<a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=9AX3phJxokWIpR5WRGtIJw%3d%3d">594-K104M15X7RF53L2</a>, ($4 per 100 ) &#8211; This cheap 0.1uF capacitor will fit almost any design that calls for through-hole decoupling capacitors. Leads are spaced 2.5mm apart, and fit footprints such as C-EU025-025&#215;050 in the default <a href="http://www.cadsoft.de">Cadsoft Eagle</a> <em>rcl</em> library. Part number -L2 has straight legs, <a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=UCu6Cfgah1uC1E9iZgY2%2fQ%3d%3d">-K2</a> has an outside kink as shown in the picture.</p>
<p><strong>C2</strong> <em>1206 SMD 0.1uF capacitor</em>, such as Mouser #<a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=9XTvUtu7mEZMjhCWA3iWrg%3d%3d">77-VJ12Y50V104K</a>, ($4 per 100) &#8211; You might be tempted to try 1206 size parts in your first surface mount experiments. We urge you to skip 1206 and head right on down to 0805. 1206 parts have very little cost benefit over through-hole parts because they&#8217;re no longer an industrial favorite. 0805 is just a bit smaller, but costs half as much. Fits Eagle footprint C-EUC1206 in the default <em>rcl</em> library.</p>
<p><strong>C3</strong> <em>0805 SMD 0.1uF capacitor</em>, such as Mouser #<a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=VOOUd%252bza08qHu13WgNByHQ%3d%3d">80-C0805C104M5R</a>, ($2 per 100) &#8211;  An 0805 capacitor fits between two pins on a through-hole DIP chip, and aligns nicely with pins on an surface mount SOIC chip. All our new designs, surface mount and through-hole, incorporate this dirt-cheap decoupling capacitor. Fits footprint C-EUC0805 in the default Eagle <em>rcl</em> library.</p>
<p>Check out our previous <a href="http://hackaday.com/category/parts/">parts</a> posts on the <a href="http://hackaday.com/2008/09/22/parts-lm317-adjustable-voltage-regulator/">LM317 adjustable regulator</a> and <a href="http://hackaday.com/2008/09/15/tact-switches-for-your-next-project/">tactile switches</a>. Are there any parts you&#8217;d like us to cover?</p>
<br />Posted in classic hacks, misc hacks, parts  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/3962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/3962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/3962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/3962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/3962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/3962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/3962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/3962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/3962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/3962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/3962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/3962/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/3962/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/3962/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=3962&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/09/29/parts-01uf-decoupling-capacitors/feed/</wfw:commentRss>
		<slash:comments>28</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/caps1.jpg" medium="image">
			<media:title type="html">caps1</media:title>
		</media:content>

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