<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pwillard.com</title>
	<atom:link href="http://pwillard.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://pwillard.com</link>
	<description>Floobydust -- Open Source experimentation</description>
	<lastBuildDate>Fri, 16 Jul 2010 04:13:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Timekeeper</title>
		<link>http://pwillard.com/?p=121</link>
		<comments>http://pwillard.com/?p=121#comments</comments>
		<pubDate>Thu, 24 Jun 2010 22:14:32 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=121</guid>
		<description><![CDATA[Getting it working&#8230; but getting it wrong.
I lost the recycled Supercap I was going to use&#8230;  so I have a timekeeper with a daughterboard for battery backup.
My own code did not work&#8230; luckily I found a DS1302 library&#8230;  so at least that works&#8230;

]]></description>
			<content:encoded><![CDATA[<p>Getting it working&#8230; but getting it wrong.</p>
<p>I lost the recycled Supercap I was going to use&#8230;  so I have a timekeeper with a daughterboard for battery backup.</p>
<p>My own code did not work&#8230; luckily I found a DS1302 library&#8230;  so at least that works&#8230;</p>
<p><a href="http://pwillard.com/wp-content/uploads/2010/06/IMAGe11.jpg"><img src="http://pwillard.com/wp-content/uploads/2010/06/IMAGe11.jpg" alt="" title="clock1" width="699" height="660" class="alignleft size-full wp-image-120" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=121</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KILN  Continued&#8230;</title>
		<link>http://pwillard.com/?p=109</link>
		<comments>http://pwillard.com/?p=109#comments</comments>
		<pubDate>Tue, 13 Apr 2010 19:11:29 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Electronic Projects]]></category>
		<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=109</guid>
		<description><![CDATA[Kiln Project part II
I&#8217;m still thinking about what to do&#8230;  but I LIKE the PID solution.  I also like how PID controllers usually display both SETPOINT and CURRENT value.  So, with that in mind, I set about designing a dual display board (in a design that I can use a single 4 digit display board [...]]]></description>
			<content:encoded><![CDATA[<p>Kiln Project part II</p>
<p>I&#8217;m still thinking about what to do&#8230;  but I LIKE the PID solution.  I also like how PID controllers usually display both SETPOINT and CURRENT value.  So, with that in mind, I set about designing a dual display board (in a design that I can use a single 4 digit display board later).</p>
<p>It uses the HP 5082-7300 and HDSP 0960 series displays that I have had in my parts collection going on like 20 years or more.</p>

<a href='http://pwillard.com/?attachment_id=110' title='display1'><img width="150" height="150" src="http://pwillard.com/wp-content/uploads/2010/04/display1-150x150.jpg" class="attachment-thumbnail" alt="" title="display1" /></a>
<a href='http://pwillard.com/?attachment_id=111' title='1'><img width="150" height="150" src="http://pwillard.com/wp-content/uploads/2010/04/1-150x150.jpg" class="attachment-thumbnail" alt="" title="1" /></a>
<a href='http://pwillard.com/?attachment_id=112' title='TT'><img width="150" height="150" src="http://pwillard.com/wp-content/uploads/2010/04/TT-150x150.png" class="attachment-thumbnail" alt="" title="TT" /></a>
<a href='http://pwillard.com/?attachment_id=117' title='2'><img width="150" height="150" src="http://pwillard.com/wp-content/uploads/2010/04/2-150x150.png" class="attachment-thumbnail" alt="" title="2" /></a>

<p>So, just a little more code for the controller (adding Encoder and Displays) and I should be ready to fire up the KILN&#8230; with some nice temperature control and visual feedback.</p>
<p>I ended up with near perfect toner transfer to the PCB this time.</p>
<p>&#8230;</p>
<p>More as the project progresses&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=109</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Training Wheels before I mess with the KILN</title>
		<link>http://pwillard.com/?p=104</link>
		<comments>http://pwillard.com/?p=104#comments</comments>
		<pubDate>Fri, 19 Feb 2010 03:56:19 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Electronic Projects]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=104</guid>
		<description><![CDATA[You see,   I have a SKUTT 8 kiln for working with PMC (precious metal clay).  It&#8217;s a nice kiln and all bit it doesn&#8217;t have what I would call good temperature control.  This got me thinking&#8230; rather than spend $300-$800 dollars for a professional kiln controller&#8230; I could use the Arduino to make my [...]]]></description>
			<content:encoded><![CDATA[<p>You see,   I have a SKUTT 8 kiln for working with PMC (precious metal clay).  It&#8217;s a nice kiln and all bit it doesn&#8217;t have what I would call good temperature control.  This got me thinking&#8230; rather than spend $300-$800 dollars for a professional kiln controller&#8230; I could use the Arduino to make my own.  Seems simple enough&#8230;  I thought.  Well, the KILN draws over 15 amps and after a little research,  I realized that there was this thing called Proportional-Integral-Derivative feedback control systems&#8230; and if I were smart&#8230; (I try)  that&#8217;s what I would be using to control temperature over and undershoot.  PMC clay is rather particular about temperatures&#8230; and quite expensive&#8230; so there is little room for mistakes.</p>
<p>So&#8230; initially I need  to build a similar controller for my Toner Transfer laminator as a dry run.    Lower temperatures and current&#8230; so I can test my theory on something that won&#8217;t burn down the house.</p>
<p>The first step in that process is to build a breakoutboard&#8230; since the MAX6674 is a small surface mount package.  Here is the result:</p>
<p><img class="alignleft size-full wp-image-105" title="MAX6674" src="http://pwillard.com/wp-content/uploads/2010/02/MAX6674.jpg" alt="MAX6674" width="814" height="468" /></p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=104</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino&#8217;s know how to multiply</title>
		<link>http://pwillard.com/?p=99</link>
		<comments>http://pwillard.com/?p=99#comments</comments>
		<pubDate>Thu, 04 Feb 2010 19:09:28 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=99</guid>
		<description><![CDATA[So,  I just counted&#8230;   I now have 5 Arduino boards.    These little toys are just so useful.
By far the coolest add-on I picked up so far is the Arduino Ethernet shield.  This device is based on the Wiznet W5100 and it makes connecting to the wire a breeze with low Arduino overhead.  You see, I [...]]]></description>
			<content:encoded><![CDATA[<p>So,  I just counted&#8230;   I now have 5 Arduino boards.    These little toys are just so useful.</p>
<p>By far the coolest add-on I picked up so far is the Arduino Ethernet shield.  This device is based on the Wiznet W5100 and it makes connecting to the wire a breeze with low Arduino overhead.  You see, I made the mistake of trying to use the ENC28J60 Ethernet chip.  A nice chip and Guido Socher did a great write up about it at TUX GRAPHICS&#8230; (http://tuxgraphics.org/electronics/200606/article06061.shtml)  but you need to create the TCP/IP stack in software&#8230; that&#8217;s surely flexible&#8230; but not a very nice way to leave you some ram in your Arduino for what you ant it to do.  I got frustrated with the ENC28J60 (I&#8217;d built a break out board)  and just ordered the ETHERNET shield from NKC electronics.  (Nice purchasing experience from NKC,  and a real fine supporter of the Arduino community by the way)</p>
<p>Wow.  This board is well made, well designed and simple to use.  This opens up all sorts of neat possibilities.  I just need to figure out which one gets priority.</p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=99</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time on my hands&#8230;</title>
		<link>http://pwillard.com/?p=88</link>
		<comments>http://pwillard.com/?p=88#comments</comments>
		<pubDate>Sat, 04 Jul 2009 01:24:42 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Electronic Projects]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=88</guid>
		<description><![CDATA[Someone in the Arduino forums mentioned they were having troubles with their Single Sided Arduino board that they built on their own.   It reminded me that I wanted to make one for myself.  I needed an extra Arduino I could use for RS485 testing and a NON-USB one was preferred.
What a great afternoon project this [...]]]></description>
			<content:encoded><![CDATA[<p>Someone in the Arduino forums mentioned they were having troubles with their Single Sided Arduino board that they built on their own.   It reminded me that I wanted to make one for myself.  I needed an extra Arduino I could use for RS485 testing and a NON-USB one was preferred.</p>
<p>What a great afternoon project this is.  I took the toner transfer PNG file and printed it out so I could use the laminator to do a toner transfer. Once it was etched I could really see the benefit of having a silkscreen on the topside&#8230; the trouble is, I&#8217;ve never done a board with imagerey on top.   I first tried using a heat transfer&#8230;  just like I did with the copper side but I had no luck.  After 10 times through the laminator I still had no luck bonding the toner with the fiberglass side.  (I sort of figured that would happen&#8230;)</p>
<p>I remembered that I had some 8 1/2 by 11 blank decal sheet on hand and thought maybe I could float the silk screen  side decal onto the surface.   OK&#8230; having never done this  before I&#8217;m going to now admit I was a bit overconfident,  this is really not easy.</p>
<p>Eventually I got it applied.  I lost a few bits here and there, but the important parts didn&#8217;t tear off.  I wanted to coat the decal with FUTURE floor wax but I could not locate the bottle I had for this purpose.  It would be a good idea though.</p>
<p>Anyway&#8230; here are the results.  Powered it up and loaded a sketch&#8230;  Yippie.</p>
<p><img class="alignleft size-full wp-image-89" title="ssa1" src="http://pwillard.com/wp-content/uploads/2009/07/ssa1.jpg" alt="ssa1" width="800" height="527" /></p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=88</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Feeling kind of damp &#8211; The SHT-11 and Arduino</title>
		<link>http://pwillard.com/?p=81</link>
		<comments>http://pwillard.com/?p=81#comments</comments>
		<pubDate>Fri, 03 Jul 2009 11:46:28 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Electronic Projects]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=81</guid>
		<description><![CDATA[As a part of my ongoing project and seemingly never ending interest in what&#8217;s going on outside my window, I purchased a a PARALLAX humidity and temperature sensor.  Basically, the Parallax part is a surface mount  Sensirion Temperature/Humidity Sensor nicely mounted on a PC board that has 8-PIN DIL pin out for insertion into a [...]]]></description>
			<content:encoded><![CDATA[<p>As a part of my ongoing project and seemingly never ending interest in what&#8217;s going on outside my window, I purchased a a PARALLAX humidity and temperature sensor.  Basically, the Parallax part is a surface mount  <span id="dnn_ctr617_ProductPage_ProductName">Sensirion Temperature/Humidity Sensor nicely mounted on a PC board that has 8-PIN DIL pin out for insertion into a solder-less breadboard. </span></p>
<p><span>It&#8217;s available from MOUSER and from PARALLAX directly.</span></p>
<p>To get it working, the circuit itself is dead easy.  The Parallax part has additional SMD pullups and capacitors right in the 8-pin DIL package so we are only dealing with a few wires.  I don&#8217;t even need to really show a schematic&#8230; the details are in the code.</p>
<p>The code is not really my own creation at all.  It is a collection of good ideas from others who have already dealt with this device.</p>
<div class="codecolorer-container arduino dawn" style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="arduino codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co1">//==========================================================================//</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">//   SHT-11 Humidity &amp;amp; Temperature      Version 1.00     December 2008      //</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">//   Written for the Arduino ATmega168 Diecimila and installed &amp;amp; tested     //</span><br />
<span class="co1">//   on December 12,2008                                                    //</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">//   Multiple Internet references were used, combined and modified          //</span><br />
<span class="co1">//   for this example, such as Arduino forums and nuelectronics.com         //</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">//==========================================================================//</span><br />
<span class="co1">// Devices Used:                                                            //</span><br />
<span class="co1">// Boarduino:  USB Powered - Diecimila                                      //</span><br />
<span class="co1">// http://www.ladyada.net/make/boarduino/index.html                         //</span><br />
<span class="co1">// The Boarduino is a Solderless Breadboard compatible Arduino              //</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">// Parallax Sensirion SHT-11 module                                         //</span><br />
<span class="co1">// http://www.parallax.com   (Look for -&amp;gt; &quot;SensirionDocs.pdf&quot; )             //</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">//                  The parallax module is a breadboard compatible carrier  //</span><br />
<span class="co1">//                  with the SMD sensor installed by parallax               //</span><br />
<span class="co1">//                  NOTE: Different Pinout than SMD sensor from Sensirion   //</span><br />
<span class="co1">//==========================================================================//</span><br />
<span class="co1">// Notes:                                                                   //</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">// The Parallax module contains built-in Pullup &amp;amp; Data Pin resistors        //</span><br />
<span class="co1">// Sensor Carrier     Boarduino                                             //</span><br />
<span class="co1">// Data Pin 1   --&amp;gt;   Arduino pin 10                                        //</span><br />
<span class="co1">// Clock Pin 3  --&amp;gt;   Arduino pin 11                                        //</span><br />
<span class="co1">// Vss Pin 4    --&amp;gt;   Arduino GND                                           //</span><br />
<span class="co1">// Vdd Pin 8    --&amp;gt;   Arduino 5V                                            //</span><br />
<span class="co1">//==========================================================================//</span><br />
<br />
<span class="co1">//==========================================================================//</span><br />
<span class="co1">//                            Preamble                                      //</span><br />
<span class="co1">//==========================================================================//</span><br />
<span class="co2">#define  LED 13</span><br />
<br />
<span class="co2">#define  T_CMD  0x03                // See Sensirion Data sheet</span><br />
<span class="co2">#define  H_CMD  0x05</span><br />
<span class="co2">#define  R_STAT 0x07</span><br />
<span class="co2">#define  W_STAT 0x06</span><br />
<span class="co2">#define  RST_CMD 0x1E</span><br />
<br />
<span class="co1">//==========================================================================//</span><br />
<span class="co1">// SHT11 Sensor Coefficients from Sesirion Data Sheet</span><br />
<span class="kw4">const</span> <span class="kw4">float</span> C1<span class="sy0">=-</span><span class="nu16">4.0</span><span class="sy0">;</span>               <span class="co1">// for 12 Bit</span><br />
<span class="kw4">const</span> <span class="kw4">float</span> C2<span class="sy0">=</span> <span class="nu16">0.0405</span><span class="sy0">;</span>            <span class="co1">// for 12 Bit</span><br />
<span class="kw4">const</span> <span class="kw4">float</span> C3<span class="sy0">=-</span><span class="nu16">0.0000028</span><span class="sy0">;</span>         <span class="co1">// for 12 Bit</span><br />
<span class="co1">//const float D1=-40.0;              // for 14 Bit @ 5V</span><br />
<span class="co1">//const float D2=0.01;               // for 14 Bit DEGC</span><br />
<span class="kw4">const</span> <span class="kw4">float</span> T1<span class="sy0">=</span><span class="nu16">0.01</span><span class="sy0">;</span>               <span class="co1">// for 14 Bit @ 5V</span><br />
<span class="kw4">const</span> <span class="kw4">float</span> T2<span class="sy0">=</span><span class="nu16">0.00008</span><span class="sy0">;</span>            <span class="co1">// for 14 Bit @ 5V</span><br />
<span class="co1">//==========================================================================//</span><br />
<span class="co1">// Sensor Variables</span><br />
<span class="kw4">int</span> shtClk   <span class="sy0">=</span>  <span class="nu0">11</span><span class="sy0">;</span>                <span class="co1">// Clock Pin</span><br />
<span class="kw4">int</span> shtData  <span class="sy0">=</span>  <span class="nu0">10</span><span class="sy0">;</span>                <span class="co1">// Data Pin</span><br />
<span class="kw4">int</span> ioByte<span class="sy0">;</span>                        <span class="co1">// data transfer global -  DATA</span><br />
<span class="kw4">int</span> ackBit<span class="sy0">;</span>                        <span class="co1">// data transfer glocal  - ACKNOWLEDGE</span><br />
<span class="kw4">float</span> retVal<span class="sy0">;</span>                      <span class="co1">// Raw return value from SHT-11</span><br />
<span class="kw4">float</span> temp_degC<span class="sy0">;</span>                   <span class="co1">// working temperature</span><br />
<span class="kw4">float</span> temp_degF<span class="sy0">;</span>                   <span class="co1">// working tempeature</span><br />
<span class="kw4">float</span> r_temp<span class="sy0">;</span>                      <span class="co1">// raw working temp</span><br />
<span class="kw4">float</span> r_humid<span class="sy0">;</span>                     <span class="co1">// Raw working humidity</span><br />
<span class="kw4">float</span> dew_point<span class="sy0">;</span><br />
<span class="kw4">float</span> dew_pointF<span class="sy0">;</span><br />
<span class="co1">//==========================================================================//</span><br />
<span class="co1">// coding variables</span><br />
<span class="kw4">int</span> dly<span class="sy0">;</span><br />
<span class="kw4">int</span> timewait<span class="sy0">;</span><br />
byte bitmask<span class="sy0">;</span><br />
<br />
<span class="co1">//==========================================================================//</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">//                            Code Body                                     //</span><br />
<span class="co1">//                                                                          //</span><br />
<span class="co1">//==========================================================================//</span><br />
<br />
<span class="kw4">void</span> setup<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/pinmode.html"><span class="kw3">pinMode</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> OUTPUT<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span>     <span class="co1">// Clock</span><br />
<br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/pinmode.html"><span class="kw3">pinMode</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> OUTPUT<span class="br0">&#41;</span><span class="sy0">;</span>        <span class="co1">// Data</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/pinmode.html"><span class="kw3">pinMode</span></a><span class="br0">&#40;</span>LED<span class="sy0">,</span> OUTPUT<span class="br0">&#41;</span><span class="sy0">;</span>        <span class="co1">// LED</span><br />
Serial.<span class="me1">begin</span><span class="br0">&#40;</span><span class="nu0">9600</span><span class="br0">&#41;</span><span class="sy0">;</span>         <span class="co1">// open serial Port for 9600 Baud</span><br />
<br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.println.html"><span class="kw3">Serial.<span class="me1">println</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;Resetting Sensor..&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
SHT_Connection_Reset<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
<span class="co1">// Fast Flash LED to say we are ready</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>LED<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span><br />
delay<span class="br0">&#40;</span><span class="nu0">500</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>LED<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
delay<span class="br0">&#40;</span><span class="nu0">500</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>LED<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span><br />
delay<span class="br0">&#40;</span><span class="nu0">500</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>LED<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co1">//-----------------------------</span><br />
<br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.println.html"><span class="kw3">Serial.<span class="me1">println</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;Starting Temperature &amp;amp; Humidity reading every 5 seconds.&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//==========================================================================//</span><br />
<span class="kw4">void</span> loop<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="co1">//==========================================================================//</span><br />
<span class="br0">&#123;</span><br />
<br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.println.html"><span class="kw3">Serial.<span class="me1">println</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;------------------------------------------------------------------------------&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co1">// SHT-11 Get Temperature</span><br />
SHT_Measure<span class="br0">&#40;</span>T_CMD<span class="br0">&#41;</span><span class="sy0">;</span>                    <span class="co1">// retVal = Temperature reading</span><br />
r_temp <span class="sy0">=</span> retVal<span class="sy0">;</span><br />
<br />
temp_degC <span class="sy0">=</span> SHT_calc_tempC<span class="br0">&#40;</span> retVal<span class="br0">&#41;</span><span class="sy0">;</span>  <span class="co1">// Convert to Celcius</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;Temperature: &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
serialPrintFloat<span class="br0">&#40;</span>temp_degC<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;C&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">'<span class="es1">\t</span>'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
temp_degF <span class="sy0">=</span> SHT_calc_tempF<span class="br0">&#40;</span> retVal<span class="br0">&#41;</span><span class="sy0">;</span>  <span class="co1">// Convert to Fahrenheit</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;| Temperature: &quot;</span><span class="br0">&#41;</span><span class="sy0">;;</span><br />
serialPrintFloat<span class="br0">&#40;</span>temp_degF<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;F&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">'<span class="es1">\t</span>'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.println.html"><span class="kw3">Serial.<span class="me1">println</span></span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co1">// SHT-11 Get Humidity</span><br />
SHT_Measure<span class="br0">&#40;</span>H_CMD<span class="br0">&#41;</span><span class="sy0">;</span>                     <span class="co1">// retVal = humidity reading</span><br />
r_humid <span class="sy0">=</span> retVal<span class="sy0">;</span>                         <span class="co1">// Store raw humidity value</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;Humidity: &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co1">// Linear conversion</span><br />
<span class="kw4">float</span> rh_lin <span class="sy0">=</span> C3 <span class="sy0">*</span> retVal <span class="sy0">*</span> retVal <span class="sy0">+</span> C2 <span class="sy0">*</span> retVal <span class="sy0">+</span> C1<span class="sy0">;</span><br />
<span class="co1">// Temperature compensated RH</span><br />
<span class="kw4">float</span> rh_true <span class="sy0">=</span> <span class="br0">&#40;</span>temp_degC <span class="sy0">*</span> <span class="br0">&#40;</span>T1 <span class="sy0">+</span> T2 <span class="sy0">*</span> retVal<span class="br0">&#41;</span> <span class="sy0">+</span> rh_lin<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span>rh_true<span class="sy0">&amp;</span>gt<span class="sy0">;</span><span class="nu0">100</span><span class="br0">&#41;</span>rh_true<span class="sy0">=</span><span class="nu0">100</span><span class="sy0">;</span>       <span class="co1">// deal with rh being outside</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span>rh_true<span class="sy0">&amp;</span>lt<span class="sy0">;</span><span class="nu16">0.1</span><span class="br0">&#41;</span>rh_true<span class="sy0">=</span><span class="nu16">0.1</span><span class="sy0">;</span>       <span class="co1">// a physical possible range</span><br />
serialPrintFloat<span class="br0">&#40;</span>rh_true<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;%&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">'<span class="es1">\t</span>'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co1">// calculate Dew Point</span><br />
dew_point<span class="sy0">=</span>calc_dewpoint<span class="br0">&#40;</span>rh_true<span class="sy0">,</span>temp_degC<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">//calculate dew point</span><br />
dew_pointF <span class="sy0">=</span> <span class="nu0">9</span> <span class="sy0">*</span> dew_point<span class="sy0">/</span><span class="nu0">5</span> <span class="sy0">+</span> <span class="nu0">32</span><span class="sy0">;</span><br />
<br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;| Dew point:   &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
serialPrintFloat<span class="br0">&#40;</span>dew_point<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;C&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;   &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
serialPrintFloat<span class="br0">&#40;</span>dew_pointF<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;F&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.println.html"><span class="kw3">Serial.<span class="me1">println</span></span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
<span class="co1">// Slow Flash activity LED and create pause between scans</span><br />
<span class="co1">//  ...in this case, 5 secs)</span><br />
timewait <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span><br />
<span class="kw1">while</span> <span class="br0">&#40;</span>timewait <span class="sy0">&amp;</span>lt<span class="sy0">;</span> <span class="nu0">5</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>LED<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span><br />
delay<span class="br0">&#40;</span><span class="nu0">500</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>LED<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
delay<span class="br0">&#40;</span><span class="nu0">500</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
timewait<span class="sy0">++;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--[ Subroutines ]---------------------------------------------------</span><br />
<span class="kw4">void</span> SHT_Write_Byte<span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/pinmode.html"><span class="kw3">pinMode</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> OUTPUT<span class="br0">&#41;</span><span class="sy0">;</span><br />
shiftOut<span class="br0">&#40;</span>shtData<span class="sy0">,</span> shtClk<span class="sy0">,</span> MSBFIRST<span class="sy0">,</span> ioByte<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/pinmode.html"><span class="kw3">pinMode</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> INPUT<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span><br />
ackBit <span class="sy0">=</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalread.html"><span class="kw3">digitalRead</span></a><span class="br0">&#40;</span>shtData<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="kw4">int</span> shiftIn<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw4">int</span> cwt<span class="sy0">;</span><br />
cwt<span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span><br />
bitmask<span class="sy0">=</span><span class="nu0">128</span><span class="sy0">;</span><br />
<span class="kw1">while</span> <span class="br0">&#40;</span>bitmask <span class="sy0">&amp;</span>gt<span class="sy0">;=</span> <span class="nu0">1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span><br />
cwt <span class="sy0">=</span> cwt <span class="sy0">+</span> bitmask <span class="sy0">*</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalread.html"><span class="kw3">digitalRead</span></a><span class="br0">&#40;</span>shtData<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
bitmask<span class="sy0">=</span>bitmask<span class="sy0">/</span><span class="nu0">2</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="kw1">return</span><span class="br0">&#40;</span>cwt<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">void</span> SHT_Read_Byte<span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
ioByte <span class="sy0">=</span> shiftIn<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> ackBit<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/pinmode.html"><span class="kw3">pinMode</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> OUTPUT<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/pinmode.html"><span class="kw3">pinMode</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> INPUT<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> LOW<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">void</span> SHT_Start<span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="co1">// generates a sensirion specific transmission start</span><br />
<span class="co1">// This where Sensirion is not following the I2C standard</span><br />
<span class="co1">//       _____         ________</span><br />
<span class="co1">// DATA:      |_______|</span><br />
<span class="co1">//           ___     ___</span><br />
<span class="co1">// SCK : ___|   |___|   |______</span><br />
<br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span>     <span class="co1">// Data pin high</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/pinmode.html"><span class="kw3">pinMode</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> OUTPUT<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span>  HIGH<span class="br0">&#41;</span><span class="sy0">;</span>     <span class="co1">// clock high</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span>  LOW<span class="br0">&#41;</span><span class="sy0">;</span>     <span class="co1">// data low</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span>   LOW<span class="br0">&#41;</span><span class="sy0">;</span>     <span class="co1">// clock low</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span>  HIGH<span class="br0">&#41;</span><span class="sy0">;</span>     <span class="co1">// clock high</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtData<span class="sy0">,</span> HIGH<span class="br0">&#41;</span><span class="sy0">;</span>     <span class="co1">// data high</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalwrite.html"><span class="kw3">digitalWrite</span></a><span class="br0">&#40;</span>shtClk<span class="sy0">,</span>  LOW<span class="br0">&#41;</span><span class="sy0">;</span>      <span class="co1">// clock low</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">void</span> SHT_Connection_Reset<span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="co1">// connection reset: DATA-line=1 and at least 9 SCK cycles followed by start</span><br />
<span class="co1">// 16 is greater than 9 so do it twice</span><br />
<span class="co1">//      _____________________________________________________         ________</span><br />
<span class="co1">// DATA:                                                     |_______|</span><br />
<span class="co1">//          _    _    _    _    _    _    _    _    _        ___    ___</span><br />
<span class="co1">// SCK : __| |__| |__| |__| |__| |__| |__| |__| |__| |______|   |__|   |______</span><br />
<br />
shiftOut<span class="br0">&#40;</span>shtData<span class="sy0">,</span> shtClk<span class="sy0">,</span> LSBFIRST<span class="sy0">,</span> <span class="nu12">0xff</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
shiftOut<span class="br0">&#40;</span>shtData<span class="sy0">,</span> shtClk<span class="sy0">,</span> LSBFIRST<span class="sy0">,</span> <span class="nu12">0xff</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
SHT_Start<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">void</span> SHT_Soft_Reset<span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
SHT_Connection_Reset<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
ioByte <span class="sy0">=</span> RST_CMD<span class="sy0">;</span><br />
ackBit <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span><br />
SHT_Write_Byte<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
delay<span class="br0">&#40;</span><span class="nu0">15</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">void</span> SHT_Wait<span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="co1">// Waits for SHT to complete conversion</span><br />
delay<span class="br0">&#40;</span><span class="nu0">5</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
dly <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span><br />
<span class="kw1">while</span> <span class="br0">&#40;</span>dly <span class="sy0">&amp;</span>lt<span class="sy0">;</span> <span class="nu0">600</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.opengroup.org/onlinepubs/009695399/functions/digitalread.html"><span class="kw3">digitalRead</span></a><span class="br0">&#40;</span>shtData<span class="br0">&#41;</span> <span class="sy0">==</span> <span class="nu0">0</span><span class="br0">&#41;</span> dly<span class="sy0">=</span><span class="nu0">2600</span><span class="sy0">;</span><br />
delay<span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
dly<span class="sy0">=</span>dly<span class="sy0">+</span><span class="nu0">1</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">void</span> SHT_Measure<span class="br0">&#40;</span><span class="kw4">int</span> SHT_CMD<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
SHT_Soft_Reset<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
SHT_Start<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
ioByte <span class="sy0">=</span> SHT_CMD<span class="sy0">;</span><br />
<br />
SHT_Write_Byte<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>          <span class="co1">// Issue Command</span><br />
SHT_Wait<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>                <span class="co1">// wait for data ready</span><br />
ackBit <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span>               <span class="co1">// read first byte</span><br />
<br />
SHT_Read_Byte<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw4">int</span> msby<span class="sy0">;</span>                  <span class="co1">// process it as Most Significant Byte (MSB)</span><br />
msby <span class="sy0">=</span> ioByte<span class="sy0">;</span><br />
ackBit <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span><br />
<br />
SHT_Read_Byte<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>          <span class="co1">// read second byte</span><br />
retVal <span class="sy0">=</span> msby<span class="sy0">;</span>           <span class="co1">// process result to combine MSB with LSB</span><br />
retVal <span class="sy0">=</span> retVal <span class="sy0">*</span> <span class="nu12">0x100</span><span class="sy0">;</span><br />
retVal <span class="sy0">=</span> retVal <span class="sy0">+</span> ioByte<span class="sy0">;</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span>retVal <span class="sy0">&amp;</span>lt<span class="sy0">;=</span> <span class="nu0">0</span><span class="br0">&#41;</span> retVal <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">int</span> SHT_Get_Status<span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
SHT_Soft_Reset<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
SHT_Start<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
ioByte <span class="sy0">=</span> R_STAT<span class="sy0">;</span><br />
<br />
SHT_Write_Byte<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
SHT_Wait<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
ackBit <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span><br />
<br />
SHT_Read_Byte<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw1">return</span><span class="br0">&#40;</span>ioByte<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">int</span> SHT_calc_tempC<span class="br0">&#40;</span> <span class="kw4">float</span> w_temperature<span class="br0">&#41;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="br0">&#123;</span><br />
<span class="co1">// calculate temp with float</span><br />
<br />
<span class="kw4">float</span> temp1<span class="sy0">;</span><br />
<br />
<span class="co1">// Per the data sheet, these are adjustments to results</span><br />
temp1 <span class="sy0">=</span> w_temperature <span class="sy0">*</span> <span class="nu16">0.01</span><span class="sy0">;</span>  <span class="co1">// divide by 100</span><br />
temp1 <span class="sy0">=</span> temp1 <span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span><span class="nu0">40</span><span class="sy0">;</span>       <span class="co1">// Subtract 40</span><br />
<span class="kw1">return</span> <span class="br0">&#40;</span>temp1<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">int</span> SHT_calc_tempF<span class="br0">&#40;</span> <span class="kw4">int</span> w_temperature<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="co1">// calculate temp with float</span><br />
<span class="kw4">int</span> temp1<span class="sy0">;</span><br />
temp1 <span class="sy0">=</span> w_temperature <span class="sy0">*</span> <span class="nu16">0.018</span><span class="sy0">;</span><br />
temp1 <span class="sy0">=</span> temp1 <span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span><span class="nu0">40</span><span class="sy0">;</span><br />
<span class="kw1">return</span> <span class="br0">&#40;</span>temp1<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">float</span> calc_dewpoint<span class="br0">&#40;</span><span class="kw4">float</span> h<span class="sy0">,</span><span class="kw4">float</span> t<span class="br0">&#41;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="co1">// calculates dew point</span><br />
<span class="co1">// input:   humidity [%RH], temperature [°C]</span><br />
<span class="co1">// output:  dew point [°C]</span><br />
<span class="br0">&#123;</span> <span class="kw4">float</span> logEx<span class="sy0">,</span>dew_point<span class="sy0">;</span><br />
logEx<span class="sy0">=</span><span class="nu16">0.66077</span><span class="sy0">+</span><span class="nu16">7.5</span><span class="sy0">*</span>t<span class="sy0">/</span><span class="br0">&#40;</span><span class="nu16">237.3</span><span class="sy0">+</span>t<span class="br0">&#41;</span><span class="sy0">+</span><span class="br0">&#40;</span>log10<span class="br0">&#40;</span>h<span class="br0">&#41;</span><span class="sy0">-</span><span class="nu0">2</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
dew_point <span class="sy0">=</span> <span class="br0">&#40;</span>logEx <span class="sy0">-</span> <span class="nu16">0.66077</span><span class="br0">&#41;</span><span class="sy0">*</span><span class="nu16">237.3</span><span class="sy0">/</span><span class="br0">&#40;</span><span class="nu16">0.66077</span><span class="sy0">+</span><span class="nu16">7.5</span><span class="sy0">-</span>logEx<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw1">return</span> dew_point<span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="kw4">void</span> serialPrintFloat<span class="br0">&#40;</span> <span class="kw4">float</span> f<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<span class="co1">//--------------------------------------------------------------------</span><br />
<span class="co1">// print results properly with float decimal value</span><br />
<span class="kw4">int</span> i<span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span>f<span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span><span class="st0">&quot;.&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
i <span class="sy0">=</span> <span class="br0">&#40;</span>f <span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span>f<span class="br0">&#41;</span> <span class="sy0">*</span> <span class="nu0">100</span><span class="sy0">;</span><br />
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/serial.print.html"><span class="kw3">Serial.<span class="me1">print</span></span></a><span class="br0">&#40;</span> abs<span class="br0">&#40;</span>i<span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div></div>
<p><span><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=81</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RS485 with Automatic Transmit Enable</title>
		<link>http://pwillard.com/?p=60</link>
		<comments>http://pwillard.com/?p=60#comments</comments>
		<pubDate>Wed, 01 Jul 2009 01:01:33 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Electronic Projects]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=60</guid>
		<description><![CDATA[Here is a simple RS232-485 converter for the PC serial port I developed with the help of a Circuit Cellar article by  Jan Axelson about RS485 interfacing.
It uses a 555 as a monostable to enable the transmit mode only when &#8220;sending&#8221;.
It&#8217;s a pretty basic circuit and nothing special is really happening here other than the [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple RS232-485 converter for the PC serial port I developed with the help of a Circuit Cellar article by  Jan Axelson about RS485 interfacing.</p>
<p>It uses a 555 as a monostable to enable the transmit mode only when &#8220;sending&#8221;.</p>
<p>It&#8217;s a pretty basic circuit and nothing special is really happening here other than the portion involving the LM555 timer.  The termination jumpers allow the 120 OHM termination on the master node as well as the balancing termination resistors connected to +5V and GND.</p>
<p>There were only minor changes throughout development.  For example, originally the indicator LED&#8217;s were ON unless sending since they were tied to GND.  Now then go LIT when sending, which is more intuitive, I suppose.</p>
<p>Here is the circuit:</p>
<p><img class="alignleft size-full wp-image-70" title="my-drawing5" src="http://pwillard.com/wp-content/uploads/2009/07/my-drawing5.jpg" alt="my-drawing5" width="820" height="605" /></p>
<p>Here is the board Layout:</p>
<p><img class="alignleft size-full wp-image-71" title="485brd" src="http://pwillard.com/wp-content/uploads/2009/07/485brd.jpg" alt="485brd" width="1009" height="411" /></p>
<p>PCB Design:</p>
<p><img class="alignleft size-large wp-image-72" title="board" src="http://pwillard.com/wp-content/uploads/2009/07/board-1024x426.jpg" alt="board" width="1024" height="426" /></p>
<p>Completed board:</p>
<p><img class="alignleft size-large wp-image-73" title="complete" src="http://pwillard.com/wp-content/uploads/2009/07/complete-1024x420.jpg" alt="complete" width="1024" height="420" /></p>
<p>Overall this was an Easy Project.</p>
<p>And yes, this is a HOMEBREW toner transfer method PC board.  The DRAWING package is NOT EAGLE but rather ABACOM SPRINT LAYOUT and ABACOM SPLAN.</p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=60</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More on Serial Ports</title>
		<link>http://pwillard.com/?p=50</link>
		<comments>http://pwillard.com/?p=50#comments</comments>
		<pubDate>Tue, 30 Jun 2009 16:42:17 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[ramblings]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=50</guid>
		<description><![CDATA[(Please note: None this applies to LINUX.  Linux is much smarter about &#8220;devices&#8221; IMHO)
When testing out an idea, it sometimes a lot easier to write a little tidbit of code in PERL to do some concept verification.
Case in point:  I&#8217;m developing a a protocol to run over a RS485 bus and need to &#8220;act&#8221; like [...]]]></description>
			<content:encoded><![CDATA[<p><em>(Please note: None this applies to LINUX.  Linux is much smarter about &#8220;devices&#8221; IMHO)</em></p>
<p>When testing out an idea, it sometimes a lot easier to write a little tidbit of code in PERL to do some concept verification.</p>
<p>Case in point:  I&#8217;m developing a a protocol to run over a RS485 bus and need to &#8220;act&#8221; like a master host from my PC.  Now I haven&#8217;t got the MASTER host code written yet and getting a protocol tested from a Serial Terminal program is tedious so I needed a quick way to send oddball strings.  PERL to the rescue&#8230;  and then I hit the brick wall.</p>
<p>I tested the code with stationary PC that has a &#8220;real&#8221; serial port on the motherboard.  It worked as planned so I went to the LAB table where I have a laptop (with no built in serial) and I tried the code.  I have an IOGEAR 2-port USB to SERIAL adapter on that laptop but I had not until then tried to access the device with PERL.</p>
<p>I am using the PERL module WIN32::SerialPort(0.19) and I kept getting &#8220;can&#8217;t open port&#8221; error messages.  I was not getting these on the other PC.  The only difference was that the IOGEAR USB-RS232 adapter was now using COM ports 13 &amp; 14.   When I changed the PERL code to read COM13, it broke.</p>
<p>Here is the fix:</p>
<pre class="code" style="margin: 0px; overflow: auto; width: 90%;"><span style="color: #0000ff;">my $myPort = 11;</span></pre>
<pre><span style="color: #0000ff;">
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;width:535px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace"># COM PORT</div></div>

# Deal with ports higher than 9
if($myPort &lt; 10){
 $myPort_Str = "COM".$myPort;
  print "low port: $myPort_Str\n";
  } else {
 $myPort_Str = "\\\\.\\COM".$myPort;
 print "high port: $myPort_Str\n";
}</span></pre>
<p>I guess Microsoft never imagined you would have more than 9 serial ports.</p>
<p>Ports 10 and Higher will not respond to being called &#8220;COMx&#8221;.  You need to use the following naming method: &#8220;\\.\COMxx&#8221;.</p>
<p>So when I open the port, I use:</p>
<pre><span style="color: #0000ff;">my $port = Win32::SerialPort-&gt;new($myPort_Str);</span></pre>
<p>This way, you can use higher number ports that would by default have the system saying, &#8220;sorry, port doesn&#8217;t exist&#8221; .   USB-RS232 drivers have a tendency to assign ports higher than COM9.</p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=50</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serial Ports  &amp; User Interfaces</title>
		<link>http://pwillard.com/?p=45</link>
		<comments>http://pwillard.com/?p=45#comments</comments>
		<pubDate>Fri, 22 May 2009 14:10:33 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[ramblings]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=45</guid>
		<description><![CDATA[Serial Ports
The Arduino, the Basic Stamp2 and other similar development tools often use the Serial Interface for communicating with attached computers.  This is clearly the most efficient and cost effective method since it requires very little overhead, unlike using ETHERNET or Radio Communications, etc.
Creating a user interface for these devices with either a Linux [...]]]></description>
			<content:encoded><![CDATA[<h1>Serial Ports</h1>
<p>The Arduino, the Basic Stamp2 and other similar development tools often use the Serial Interface for communicating with attached computers.  This is clearly the most efficient and cost effective method since it requires very little overhead, unlike using ETHERNET or Radio Communications, etc.</p>
<p>Creating a user interface for these devices with either a Linux or Windows PC is as simple as writing a terminal program that drives a custom GUI.  I could use Visual Basic or C if I wanted stick with windows.  To be really flexible, I could use a language like Perl, Python or TCL/TK.</p>
<p>So I did some research.  I really like the way TCL/TK works.  It understands that you might want to interact directly with the operating system.  It has not forgotten that we love our serial ports.  In essence,  I think TCL/TK is ideal for working with PC&#8217;s and micro-controllers via the serial port.</p>
<p>On the other hand, the serial port seems to be destined to become a legacy item.  While the Arduino now uses a built in USB-Serial bridge on board, getting connected to the communications port that the USB creates is sometimes a little tricky.  You see, serial ports were historically considered to be physically part of a machine.  Why would you even need more than 4 or so, right?  Now, with the USB, you could easily have many more than 4 since the USB port needs to avoid the potential of stepping on physical ports.</p>
<p>Many Microsoft programming languages and API&#8217;s had built in support for up to 9 serial ports.  If your USB-Serial bridge created COM11&#8230; you might run into trouble writing code to access it.  Another problem, many of the freely available terminal programs have limited support for high com ports.  Some actually stop at COM4.</p>
<h1><strong>Back to TCL/TK</strong></h1>
<p>This scripting language is mature and just plain cool.  Few scripting language solutions let you take Graphical User Interface  code written for a UNIX platform and plop it unchanged on a Windows platform (with TCL/TK installed) and have it run&#8230; with no modifications.  There is also a solution that wraps the &#8220;interpreter&#8221;  and script into and executable so a system doesn&#8217;t really have to have TCL/TK installed.</p>
<p>TCL/TK is available on the PC for Windows as well a Linux.  This amount of flexibility is really interesting to me.  Being able to use either with practically the same code means that I don&#8217;t  have to decide immediately which platform I&#8217;m coding for.</p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=45</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barometric Pressure</title>
		<link>http://pwillard.com/?p=31</link>
		<comments>http://pwillard.com/?p=31#comments</comments>
		<pubDate>Thu, 21 May 2009 02:47:57 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Electronic Projects]]></category>

		<guid isPermaLink="false">http://pwillard.com/?p=31</guid>
		<description><![CDATA[While looking at low cost pressure sensors in the Mouser Electronics catalog,  I located the FREESCALE MPXAZ6115A as a possible sensor for my project.  The sensor has the following statistics;  Device: MPX6115,   MAX PSI   16.7,    MAX kPa 115.
Since barometric pressure here hovers at around 100kPa or so,  this sensor would do just fine.  [...]]]></description>
			<content:encoded><![CDATA[<p>While looking at low cost pressure sensors in the Mouser Electronics catalog,  I located the FREESCALE MPXAZ6115A as a possible sensor for my project.  The sensor has the following statistics;  <strong>Device: MPX6115,   MAX PSI   16.7,    MAX kPa 115</strong>.</p>
<p>Since barometric pressure here hovers at around 100kPa or so,  this sensor would do just fine.  The analog output of the sensor is relative to the min/max pressure range of the sensor.</p>
<p>According to my initial tests, the sensor would output about 4.06 volts at 100kPa.</p>
<p>The built-in analog input on the Arduino would also keep the circuit simple and after a few tests I was able to determine the offset value I needed to get correct readings for the localized barometric pressure.</p>
<p>Here is the Arduino Code:</p>
<pre>
<div class="codecolorer-container c dawn" style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="c codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co1">// Nominal Transfer Value:</span><br />
<span class="co1">// Vout = VS x (0.009 x P – 0.095)</span><br />
<span class="co1">// ± (Pressure Error x Temp. Factor x 0.009 x VS)</span><br />
<span class="co1">// VS = 5.1 ± 0.25 Vdc</span><br />
<br />
<span class="kw4">float</span> Vin<span class="sy0">;</span><br />
<span class="kw4">float</span> P<span class="sy0">;</span><br />
<br />
<span class="kw4">void</span> setup<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
Serial.<span class="me1">begin</span><span class="br0">&#40;</span><span class="nu0">9600</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="kw4">void</span> loop<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<br />
Vin <span class="sy0">=</span> <span class="br0">&#40;</span><span class="nu16">5.0</span><span class="sy0">/</span><span class="nu16">1024.0</span><span class="br0">&#41;</span> <span class="sy0">*</span> analogRead<span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
Vin <span class="sy0">=</span> Vin <span class="sy0">+</span> <span class="nu16">0.11</span><span class="sy0">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// Offset Adjustment</span><br />
Serial.<span class="me1">print</span><span class="br0">&#40;</span>Vin<span class="br0">&#41;</span><span class="sy0">;</span><br />
Serial.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot; Volts&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
P<span class="sy0">=</span><span class="br0">&#40;</span><span class="br0">&#40;</span>Vin<span class="sy0">/</span><span class="nu16">5.0</span><span class="br0">&#41;</span><span class="sy0">+</span><span class="nu16">0.095</span><span class="br0">&#41;</span><span class="sy0">/</span><span class="nu16">0.009</span><span class="sy0">;</span><br />
Serial.<span class="me1">print</span><span class="br0">&#40;</span>P<span class="br0">&#41;</span><span class="sy0">;</span><br />
Serial.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot; kPa&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
Vin <span class="sy0">=</span> <span class="br0">&#40;</span>P <span class="sy0">*</span> <span class="nu16">0.2952999</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
Serial.<span class="me1">print</span><span class="br0">&#40;</span>Vin<span class="br0">&#41;</span><span class="sy0">;</span><br />
Serial.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot; Inches of Mercury&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
delay<span class="br0">&#40;</span><span class="nu0">2000</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div></div>
</pre>
<p>I&#8217;m using a LADYADA Boarduino on a solder-less breadboard for testing.   The sensor hookup is dead simple with only one exception that makes it tricky.  The part I selected is designed to be surface mounted.       I decided to create  a carrier board using the board layout software I prefer called SprintLayout  from ABACOM in Germany.   Other than 5V power and ground connections, the Vout from the carrier board goes directly to the Arduino Analog(0) pin.</p>
<p><img class="alignnone size-medium wp-image-42" title="sensor1" src="http://pwillard.com/wp-content/uploads/2009/05/sensor1-300x182.png" alt="sensor1" width="300" height="182" /></p>
<p>To create the PCB board, I use the GOOTIE toner transfer method to apply the layout on the PCB for etching.   <em>(google search &#8220;gootie  PCB&#8221; for more info)</em></p>
<p>Having developed a dislike for the chemical etchant that Radio Shack sells; Ferric Chloride, I have also adopted the etchant that Gootie describes.   It is based on the swimming pool chemical Muratic Acid and Hydrogen Peroxide in a 1 to 2 ratio.   It&#8217;s fast, non-opaque and does not require heating or excessive agitation.</p>
<p><em>Note: I also recently picked up a used GBC Creative Laminator at the local Goodwill for $14.00.  It does an excellent job of applying the toner to the copper on the PCB to be etched.  Using an hand iron was OK, but the results were not always predictable.<br />
</em></p>
<p>Here is the Layout:</p>
<p><img class="alignnone size-full wp-image-32" title="mpx6115" src="http://pwillard.com/wp-content/uploads/2009/05/mpx6115.gif" alt="mpx6115" width="472" height="130" /></p>
<p>This is the Component side view  or &#8220;TOP VIEW&#8221; through the board and &#8220;yes&#8221;, the sensor is actually underneath on the copper side&#8230; so the pin out is upside down in this view for that part.</p>
<p>The layout file is here: <a href="/files/pressure.zip"> Pressure.zip</a></p>
<p>I used  0.100 spaced right angle pins so the board actually sits vertical in the breadboard.</p>
<p>The parts and schematic used are directly from the manufacturers data sheet.</p>
<p>The test program output looks like this:</p>
<pre>4.10 Volts
101.65 kPa
30.02 Inches of Mercury</pre>
<p>Results:   <strong>Complete success.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://pwillard.com/?feed=rss2&amp;p=31</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
