<?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; tc74</title>
	<atom:link href="http://hackaday.com/tag/tc74/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Fri, 10 Feb 2012 10:01:11 +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; tc74</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: I2C digital thermometer (TC74)</title>
		<link>http://hackaday.com/2009/01/02/parts-i2c-digital-thermometer-tc74/</link>
		<comments>http://hackaday.com/2009/01/02/parts-i2c-digital-thermometer-tc74/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 15:00:25 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[parts]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[microchip]]></category>
		<category><![CDATA[tc74]]></category>
		<category><![CDATA[temperature]]></category>
		<category><![CDATA[thermometer]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=7382</guid>
		<description><![CDATA[Microchip&#8217;s TC74 is an inexpensive digital temperature sensor with a simple I2C interface. It has a resolution of 1 degree Celsius, and a range of -40 to +125 degrees. This is an easy way to add temperature measurement to a project without an analog to digital converter. We&#8217;ll show you how to use the TC74 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=7382&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-7411" title="tc74" src="http://hackadaycom.files.wordpress.com/2009/01/tc74.jpg" alt="tc74" width="450" height="325" /></p>
<p>Microchip&#8217;s <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010749">TC74</a> is an inexpensive digital temperature sensor with a simple I2C interface. It has a resolution of 1 degree Celsius, and a range of -40 to +125 degrees. This is an easy way to add temperature measurement to a project without an <a href="http://en.wikipedia.org/wiki/Analog-to-digital_converter">analog to digital converter</a>. We&#8217;ll show you how to use the TC74 below.</p>
<p><span id="more-7382"></span><strong>Microchip TC74 digital temperature sensor (<a href="http://octopart.com/search?q=microchip+tc74a&amp;s=avail_desc">Octopart search</a>, starting at $0.88)</strong></p>
<p>The TC74 comes in five pin through-hole and surface mount packages, see the <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/21462c.pdf">TC74 datasheet</a> (PDF). We couldn&#8217;t find a <a href="http://www.cadsoft.de">Cadsoft Eagle</a> footprint for any version of this part, if you know of one please link to it in the comments.</p>
<p><img class="alignnone size-full wp-image-7397" title="tc74" src="http://hackadaycom.files.wordpress.com/2008/12/tc74.png" alt="tc74" width="451" height="273" /></p>
<p>Different versions of the TC74 are calibrated for specific voltages, but all work from 2.7-5volts. The TC74A5 we used is most accurate when operating at 5volts, but we powered it from a 3.3volt supply. The I2C connection needs 2 <a href="http://en.wikipedia.org/wiki/Pull-up_resistor">pull-up resistors</a> to hold the bus high (R1, R2), 2K-10K should work. C1 is a 0.1uF decoupling capacitor.</p>
<p>We used the <a href="http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/">Bus Pirate universal serial interface</a> in I2C mode to test drive the TC74, but the same principals apply to any microcontroller. We powered the TC74 from the Bus Pirate&#8217;s 3.3volt supply, and used the on-board pull-up resistors to hold the I2C bus high.</p>
<table border="0">
<tbody>
<tr>
<td><strong>Command</strong></td>
<td><strong>Value</strong></td>
</tr>
<tr>
<td>Select temperature register</td>
<td>0&#215;00</td>
</tr>
<tr>
<td>Select configuration register</td>
<td>0&#215;01</td>
</tr>
</tbody>
</table>
<p>The TC74&#8242;s write address is 0x9a, and the read address 0x9b. It has two, one-byte registers. Register address 0 holds the temperature reading, register 1 holds the configuration settings.</p>
<p><strong>Configuration register</strong></p>
<p>Bit 6 of the configuration register is 0 at power-on, and changes to 1 when the first valid temperature reading is available. Bit 7 is writable, and puts the TC74 in a power saving standby mode. Reading the register involves two steps: use a partial write command to select the register, then use the read command to retrieve the value.</p>
<blockquote><p>I2C&gt;{0x9a 1}<br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0x9A GOT ACK: YES <strong>&lt;&#8211;write address</strong><br />
220 I2C WRITE: 0&#215;01 GOT ACK: YES <strong>&lt;&#8211;select config register</strong><br />
240 I2C STOP CONDITION</p></blockquote>
<p>First, we select the configuration register with a partial write command. This doesn&#8217;t actually write a value, it selects the register to read and write. { creates the I2C start condition, followed by the TC74 write address (0x9a) and the select configuration register command (0&#215;01). } issues the I2C stop condition and ends the transaction.</p>
<p>Now we can read the contents of the register.</p>
<blockquote><p>I2C&gt;{0x9b r}<br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0x9B GOT ACK: YES <strong>&lt;&#8211;read address</strong><br />
230 I2C READ: 0&#215;40 <strong>&lt;&#8211; register value (01000000)</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p>The read address (0x9b) returns the one byte register value (r). The configuration register value, 0&#215;40 or 01000000, shows that the device is out of standby (bit 7=0), and a valid temperature reading is available (bit 6=1).</p>
<p>The TC74 has a low-power standby mode. Enable it by writing 1 to bit 7 of the configuration register.</p>
<blockquote><p>I2C&gt;{0x9a 1 0b10000000}<br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0x9A GOT ACK: YES <strong>&lt;&#8211;write address</strong><br />
220 I2C WRITE: 0&#215;01 GOT ACK: YES <strong>&lt;&#8211;select config register</strong><br />
220 I2C WRITE: 0&#215;80 GOT ACK: YES <strong>&lt;&#8211;value to write (01000000)</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p>The register is written with single three-byte command. First we send the write address (0x9a), followed by the register to select (0&#215;01), and finally the value to write (0&#215;80). Only bit 7 of the configuration register is writable, the values of bits 6-0 are ignored.</p>
<p>Read the register again to verify that the command worked.</p>
<blockquote><p>I2C&gt;{0x9a 1}{0x9b r}<br />
210 I2C START CONDITION <strong>&lt;&#8211;first command sets register</strong><br />
220 I2C WRITE: 0x9A GOT ACK: YES <strong>&lt;&#8211;write address</strong><br />
220 I2C WRITE: 0&#215;01 GOT ACK: YES <strong>&lt;&#8211;config register (1)</strong><br />
240 I2C STOP CONDITION <strong>&lt;&#8211;end first command</strong><br />
210 I2C START CONDITION <strong>&lt;&#8211;begin second command</strong><br />
220 I2C WRITE: 0x9B GOT ACK: YES <strong>&lt;&#8211;read address</strong><br />
230 I2C READ: 0&#215;80 <strong>&lt;&#8211; register value (10000000)</strong><br />
240 I2C STOP CONDITION<strong> &lt;&#8211;end second command</strong><br />
I2C&gt;</p></blockquote>
<p>The register value, 10000000, now shows that the device is in standby (bit 7=1). Notice that bit 6 is now 0, no temperature data is available.</p>
<p>Clear bit 7 to exit standby, then wait for bit 6 to return to 1 before reading the temperature register.</p>
<blockquote><p>I2C&gt;{0x9a 1 0b00000000}<br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0x9A GOT ACK: YES <strong>&lt;&#8211;write address</strong><br />
220 I2C WRITE: 0&#215;01 GOT ACK: YES<strong>&lt;&#8211;select config register</strong><br />
220 I2C WRITE: 0&#215;00 GOT ACK: YES<strong>&lt;&#8211;value to write (00000000)</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p>Temperature data is ready when the configuration register value returns to 0&#215;40 (01000000).</p>
<p><strong>Temperature</strong></p>
<p>The temperature register is read in two steps. First, a partial write command selects the temperature register (0), then a read sequence returns the contents.</p>
<blockquote><p>I2C&gt;{0x9a 0}{0x9b r}<br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0x9A GOT ACK: YES <strong>&lt;&#8211;write address</strong><br />
220 I2C WRITE: 0&#215;00 GOT ACK: YES <strong>&lt;&#8211;select temperature register</strong><br />
240 I2C STOP CONDITION<br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0x9B GOT ACK: YES <strong>&lt;&#8211;read address</strong><br />
230 I2C READ: 0&#215;18 <strong>&lt;&#8211;grab one byte</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p>The temperature is an integer value of degrees Celsius, negative numbers are represented as a <a href="http://en.wikipedia.org/wiki/Twos_Compliment">twos complement</a>. Positive values from 0 to 127 degrees Celsius are simply represented by that value. Negative temperatures have bit 7 set, and range from -1 to -65 (255-128), see table 4.4 on page 8 of the datasheet. The hexadecimal value 0&#215;18 is equal to 24 in decimal, so the temperature reading is 24C (<a href="http://www.google.com/search?q=24c+to+f">75F</a>).</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/7382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/7382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/7382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/7382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/7382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/7382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/7382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/7382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/7382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/7382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/7382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/7382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/7382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/7382/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=7382&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2009/01/02/parts-i2c-digital-thermometer-tc74/feed/</wfw:commentRss>
		<slash:comments>14</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/01/tc74.jpg" medium="image">
			<media:title type="html">tc74</media:title>
		</media:content>

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