<?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:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>This and That &#187; darlington</title>
	<atom:link href="http://www.mrroot.net/tag/darlington/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mrroot.net</link>
	<description>What else would it be?</description>
	<lastBuildDate>Fri, 03 Sep 2010 15:56:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Water Detection Circuit</title>
		<link>http://www.mrroot.net/2009/10/water-detection-circuit/</link>
		<comments>http://www.mrroot.net/2009/10/water-detection-circuit/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 05:14:33 +0000</pubDate>
		<dc:creator>nisburgh</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[darlington]]></category>
		<category><![CDATA[schematic]]></category>

		<guid isPermaLink="false">http://www.mrroot.net/?p=120</guid>
		<description><![CDATA[So one of the first sensors I would like to implement for the sensor mesh is a simple water detector.Â  You know, for washer machines, refrigerators, water heaters, etc.Â  Let&#8217;s you know when you&#8217;ve got a leak.Â  I wanted the circuit to be simple and low power, since it would almost certainly be run off [...]]]></description>
			<content:encoded><![CDATA[<p>So one of the first sensors I would like to implement for the sensor mesh is a simple water detector.Â  You know, for washer machines, refrigerators, water heaters, etc.Â  Let&#8217;s you know when you&#8217;ve got a leak.Â  I wanted the circuit to be simple and low power, since it would almost certainly be run off a battery, and the RF gear alone was going to suck most of the available juice.Â  I also wanted a circuit external to the microcontroller to remember ( latch! ) if we had a leak condition, that way I could let the microcontroller and RF module sleep for a few minutes between checks, but still capture transient leak conditions ( What if a droplet hit the sensor, but then rolled off due to slope? ).</p>
<p>Anyhow, water is not nearly as conductive as you would think.Â  Rudimentary testing of water droplets indicated about 200k-500k of resistance.Â  My first, simple attempt at a water detection circuit did not take this into consideration.</p>
<div id="attachment_121" class="wp-caption alignleft" style="width: 310px"><a href="http://www.mrroot.net/wp-content/uploads/2009/10/DSC_5975.JPG"><img class="size-medium wp-image-121" title="DSC_5975" src="http://www.mrroot.net/wp-content/uploads/2009/10/DSC_5975-300x200.jpg" alt="Simplistic water detection circuit" width="300" height="200" /></a><p class="wp-caption-text">Simplistic water detection circuit</p></div>
<p>Here&#8217;s a snapshot of the test circuit I built.Â  It works great using that little tactile switch.Â  But it doesn&#8217;t have the capability to pull the S input on the S-R flip flop to ground when running through water.Â  That&#8217;s simply because the path to ground for the VCC pullup has too high a resistance ( 200k-500k through water ) to drop the voltage below 0.8V, necessary for a TTL low signal.Â  I didn&#8217;t bother putting together an eagle schematic for this design since it didn&#8217;t work.Â  <img src='http://www.mrroot.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Â  The astute will notice I don&#8217;t actually have it wired up to an R-S flip flop ( 74279 ).Â  I didn&#8217;t have one on hand, so I built one with a 7400 I had in stock.</p>
<p>At his point, I figured that I needed some amplification of the current I was able to push through a drop of water, so obviously a transistor came to mind.Â  A standard NPN transistor ( 2N2222 ) wouldn&#8217;t do, though, since it doesn&#8217;t provide adequate amplification of the base current produced by 5V pushing across 200k-500k resistance.Â  What I needed was a Darlington transistor!Â  Amplify the amplification!</p>
<div style="clear: left"></div>
<div id="attachment_122" class="wp-caption alignleft" style="width: 310px"><a href="http://www.mrroot.net/wp-content/uploads/2009/10/Water-detector.png"><img class="size-medium wp-image-122" title="Water-detector" src="http://www.mrroot.net/wp-content/uploads/2009/10/Water-detector-300x282.png" alt="Working water detector!" width="300" height="282" /></a><p class="wp-caption-text">Working water detector!</p></div>
<p>Here&#8217;s the circuit I put together using a Darlington NPN transitor to amplify the current that could be pushed through a drop of water at 5VDC.Â  When the power turns on, the microcontroller needs to reset the S-R flip flop by cycling the Reset line low then hold it high.Â  We have the S-R flip flop to &#8220;remember&#8221; when we have a moisture condition for the sleeping microcontroller.Â  The S input has a pullup resistor R1 just because it&#8217;s bad practice to leave a TTL input floating.Â  We connect that same signal to one end of our sensor probe ( SENSOR1 ), as well as the collector on our Darlington, T1.Â  The other side of our sensor ( SENSOR2) connects to the base of T1.Â  If we can push a mere fraction ( think millionths ) of an amp through that sensor, the Darlington is going to open up and dump all of the collector current through it&#8217;s emitter into ground.Â  This will draw the S input to ground, flipping the water signal on.Â  The water signal will not turn off until the Reset line ( RÂ  on the S-R flip flop ) is pulled low by the microcontroller.  Speaking of which, R2 is a pullup to make sure we don&#8217;t accidentally reset the flip flop during sleep/wake-up cycles, because on some microcontrollers, like the Stamp used here, the pins switch to inputs for 18 ms until the interpreter takes control.</p>
<div style="clear: left"></div>
<div id="attachment_124" class="wp-caption alignleft" style="width: 310px"><a href="http://www.mrroot.net/wp-content/uploads/2009/10/DSC_5983.JPG"><img class="size-medium wp-image-124" title="DSC_5983" src="http://www.mrroot.net/wp-content/uploads/2009/10/DSC_5983-300x200.jpg" alt="Working water detector prototype!" width="300" height="200" /></a><p class="wp-caption-text">Working water detector prototype!</p></div>
<p>I put this design together and tested it &#8211; it couldn&#8217;t work better!Â Â  In fact, it&#8217;s able to detect the microamps that were able to push through my *body*.Â  The Hfe on the BC517 Darlington is 30k.Â  *Serious amplification!*  Now I had a simple circuit that could remember a closed condition ( leak ) and could detect current flowing through megaohms ( necessary for detecting the presence of water ).  Mission accomplished.  </p>
<div style="clear: left"></div>
<p><div id="attachment_125" class="wp-caption alignleft" style="width: 310px"><a href="http://www.mrroot.net/wp-content/uploads/2009/10/DSC_5984.JPG"><img src="http://www.mrroot.net/wp-content/uploads/2009/10/DSC_5984-300x200.jpg" alt="Messy, but functional!" title="DSC_5984" width="300" height="200" class="size-medium wp-image-125" /></a><p class="wp-caption-text">Messy, but functional!</p></div><br />
Here&#8217;s a final shot of my work area.  Prototype, circuit, Jack Daniels, power supply, mess and all!  <img src='http://www.mrroot.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div style="clear: left"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.mrroot.net/2009/10/water-detection-circuit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
