Water detection circuit

Discussion in 'The Projects Forum' started by Uber_Goober, Feb 4, 2013.

  1. Uber_Goober

    Thread Starter Member

    Jan 19, 2013
    45
    4
    I need to build a water detection circuit. I'm using an 8bit PIC chip. I know enough electronics to think I'm dangerous, but am easily humbled by analog stuff. (I write software for a living, hack electronics for therapy)

    Anyway my friend Google helped my find some example circuits:
    http://www.bobsdata.com/moisture_detector/index.html
    http://www.mrroot.net/tag/darlington/

    I implemented a variation of these 2 circuits, and it works perfect. Actually, too perfect. It is so sensitive that just my finger touching the probe going to the darlington will trigger the circuit. In my project, a water leak will shut the whole thing down, so I really need to be sure that its not getting false triggers every time somebody walks by talking on their iphone (well, I haven't actually seen that happen).

    So I thought I might just try it with a 2N2222 instead of the darlington. To my surprise it works exactly the same. There isn't a perceptible difference.

    I was thinking that maybe a simple voltage divider would work better, where the water resistance would dramatically change one half of the divider, enough to trigger a logic level change on the PIC. Now, this is easy enough to test myself, except for the fact that I'm in Germany for a week. I brought my breadboard circuit with me but forgot to bring my box of resistors. lol my fail.

    From some research it looks like the normal resistance of water is about 180K ohms. It varies widely, but if paired up with a voltage divider using 10M ohm resistors, it seems that it should do the trick.

    So here's what I'm thinking:

    [​IMG]

    Now if I remember my math right, then the normal state of this divider will be 1.65V across both resistors. This should read as a '1' by the PIC (pullups disabled as that would change the divider). According to the specs the minimum voltage to reliably read as '1' is 1.625V. This is close-- is it too close?

    With the probes in water, again if I remember the math correctly, the bottom parallel resistance should drop considerably, changing the voltage drop to approx 3.23v on the top resistor and 0.07 on the bottom. This is well below the max value for a '0' on the PIC of 0.495v @3.3V Vdd.

    The catch I guess would be the resistor tolerances. In a worst case with 5% tolerance I could end up with a 1.57V '1' value- below the level needed to guarantee a reliable logic 1 (again I think I can't use pullups because they would throw off the voltage divider right?). But if I used 1% resistors then the worst case would be 1.63V, just over the minimum.

    OK I'm probably just saying a bunch of dumb stuff. Would this be any better (more stable, noise immune) than the transistor version? Any other ideas for a stable, reliable, easy to implement/interface water sensor?

    Thanks!
     
  2. Uber_Goober

    Thread Starter Member

    Jan 19, 2013
    45
    4
    Oh and the PIC I'm using has A/D and comparator features. Instead of depending on a logic '1' I could look for (for example) the voltage dropping below 1V or something like that. But I'm being lazy and want to live in the bliss of a binary world.
     
Loading...