Best choice for detecting water?


Closed Thread
Results 1 to 17 of 17
  1. #1
    Join Date
    Jun 2007
    Posts
    20

    Default Best choice for detecting water?

    All I want to do is create a sensor that beeps when water bridges a pair of contacts. However, I'm an electronics newbie and don't know how to evaluate which is the best method. The sensor will be battery powered and I would like to maximize battery life. I'm using a 16 series PIC and PBP. I realize that a PIC is overkill for this application, but I'm also using the chip for a couple of other things (serial I/O, etc).

    Some of the ideas that I've researched/considered:

    - Simply using digital I/O: one probe is connected to gnd, the other to a digital I/O pin though a 1M resistor. When the pin goes low, sound the alarm.

    - Using and ADC channel to read the resistance across the probes. Normal state should be infinite resistance; anything less and sound the alarm. However, I don't know how to use ADC to measure resistance. According to the datasheet, the max recommended impedance 10k for ADC is anyhow. So I don't know if this is a poor idea besides the point.

    - Using a comparator. It would make the coding portion easier since it's a simple bit (and one that I can use with an interrupt and sleep mode). However, I don't know how to design the necessary circuit. And I don't know if it would be flexible enough since the resistance of water varies with temperature and dissolved impurities.

    - Using an 555 IC and COUNT. This idea seems to be fairly popular several places online. However, it might be overkill for my needs. I only need a binary "water present" / "no water present" sensor.

    Anyhow... I've been at this for days and my head is spinning. Any help would be greatly appreciated. Thanks!
    Last edited by ShortBus; - 10th October 2009 at 22:36. Reason: clarification

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Personally I have had god luck detecting a high water level with the digital IO method.
    I have the PIC pin pulled low and apply a positive voltage to the probe. No current is used untill the water makes contact. When contact happens you will want to turn the power off to the probe to save power and to cut down on oxidation on the probe.

    You can use a timer off of the PIC to periodically turn the power on to the probes and check for conductivity.

    What kind of water is this? Potable, seawater, sewer? Decide what to use for the probe material? If it is sewer watch for sparks
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jun 2007
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply. It's just ordinary tap water; no worries about explosions. ;-)

    I was hoping that the simple solution would work. Can you explain your circuit a bit more? Are you using a resistor between the i/o pin and ground? If so, what value?

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I apologize. I failed to mention the LM339 comparator driving the PIC IO.
    It is still a simple solution. I built the one for my water system back in my basic stamp days. Still working.

    Again I am sorry for the misleading post.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jun 2007
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    No problem. I don't imagine that you have a schematic of your circuit? Could it be adapted to use the integrated comparator onboard the pic?

  6. #6
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    All I want to do is create a sensor that beeps when water bridges a pair of contacts
    You could use a simple floating switch. See an example @

    http://www.homesecuritystore.com/p-8...mac=4&zmap=SB2

    Al.
    All progress began with an idea

  7. #7
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    I was looking for something similar a few weeks back, except my requirement was more complex as I wanted to detect 10 different levels of water using a simple 2 wire probe.

    Anyway, while I cant pretend to have found the perfect solution, Arrati's suggestion in that thread (http://www.picbasic.co.uk/forum/showthread.php?t=11468) came pretty close.

    So, my vote would be stainless steel nut-bolts to make the actual contact, with a good resin epoxy sealant around the wire connected to the bolt. This coupled with a software arrangement to drive the sensor with a duty cycle of perhaps 1:10, or even 1:100 would give you years of maintenance-free use.

    Incidentally, I used the adc of the pic, rather than the comparator, although in your case the comparator (or even a digital input) should be fine.

    Regards,

    Anand Dhuru

  8. #8
    Join Date
    Jun 2007
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Arrati, thanks for the idea, but I'll need an electrical solution rather than mechanical in this application.

    Anand, any chance you could post an example circuit?

  9. #9
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ShortBus View Post
    - Using and ADC channel to read the resistance across the probes. Normal state should be infinite resistance; anything less and sound the alarm. However, I don't know how to use ADC to measure resistance. According to the datasheet, the max recommended impedance 10k for ADC is anyhow. So I don't know if this is a poor idea besides the point.
    You could use the ADC input, or use the input as a digital pin. Essentially, the resistor between the pin and ground, and the water body would form a potential divider. With no water, your ADC reading would be almost, or equal to zero. When water bridges the probe, it should get close to the full Vdd (200+, for the resistor value I have used).

    Alternately, if you're using the pin as a digital input, it would be low till water bridges the probe, and then swing high.

    The 2nd version of the schematic would be even better, where you control current going thru' the water, as you could reduce the corrosion by a very significant amount.

    BTW, please excuse the shabby drawing, thought it would be faster than drafting it.

    Regards,

    Anand
    Attached Images Attached Images   

  10. #10
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink the clever method ...

    Hi,

    I think a fair solution could be to use capacitive detection using the RC oscillator :

    The probe being the ... Capacitor.

    just compare the duration of, say 256 osc periods to an external RCTime result ...

    With water , the capacity of the probe is high ... Osc runs slow ...

    When dry, the capacity is low and osc runs faster ...


    Interest ??? can even run the 32 Khz clock for power saving, no direct contact of the electrodes and the water ( works with " pure" water also - no corrosion or dirt disturbing measurements )

    Some level MEASURES can also be made using the RCTime command, but less power savings ...

    Alain
    Last edited by Acetronics2; - 11th October 2009 at 19:19.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  11. #11
    Join Date
    Jun 2007
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Anand,

    Thank you for taking the time to sketch out your schematics! It's a big help.


    Alain,

    I'd have no idea how to implement something like that (I'm a software guy who's muddling through electronics); though it does sound interesting.

  12. #12
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    About 40 years ago, I needed electrodes for electrolyzing water. All the metal ones had problems, but I found a great solution in the carbon rods that go down the middle of zinc-carbon dry cell batteries. They even have a metal cap crimped on one end that you can solder to.

    If you can still find them.
    Charles Linquist

  13. #13
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    You should be fine with stainless bolts as sensors, as long as you've properly insulated / epoxied the connection between them and the wire. Plus, if you can, run the pic off a 3 volts supply, the probes will last that much longer.

    Regards,

    Anand

  14. #14
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    This device is extremely reliable (as long as it's not sewage which tends to coat the optics!) and is actually manufactured by Honeywell Microswitch in the USA. Connect with minimal components directly to your PIC (or even Relay).

    http://docs-europe.electrocomponents...6b8001adaf.pdf

    It is a little power-hungry for Battery applications though.

    You don't have to go Stainless Steel if you use AC exitation on your probes... PWM say a 1kHz signal to one probe (via a 100nF Capacitor, the other probe (again via a 100nF) can be used to detect the signal returning. To minimise power consumption, turn the PIC on only every few seconds (typical Rain Detector application to alert you to take the washing indoors).

  15. #15
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Talking

    Hi, Folks

    This one doesn't show any Pic ... is not a " Bling-Bling" device, but works perfectly ...

    Published in ... 1983 !!!

    DUS means: general use Silicon diode : 1N4148, BAW62 ...

    Alain
    Attached Images Attached Images  
    Last edited by Acetronics2; - 13th October 2009 at 13:30.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  16. #16
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    The " Bling Bling " device :

    http://a110a.free.fr/SPIP172/article.php3?id_article=29

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  17. #17
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Ive done two "water" sensors in my time. First was decades ago using a CMOS quad gate, 1 gate to detect rain, 2 to make a gated multivibrator, and 1 spare.

    Theory is CMOS has near infinite input resistance, so you use a megaohm pull-up resistor on the gate input, and the probe is the input and ground signals. Any liquid bridges the input pulling it to ground. I have not tested this with a PIC, but since the PIC is CMOS based I would expect this trick to still work. Even better would be to set the input as analog and use a A2D to sense (immune to half-VDD input level disasters). A baseline 10F part should work.

    The next version was a continuous level sensor similar to this: http://www.innovativesensing.com/htm...ucts.asp?id=18

    The probe is a tube within a tube to form a capacitor. Changing liquid heights change the dielectric which changes the capacitance linearly with level height. My "boss" used a 555 timer to convert the capacitance to a frequency, I used a PIC to measure the frequency, calibrate the levels for whatever fluid was being used, and drive the output.

Similar Threads

  1. water flow meter..
    By ecca in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th May 2010, 10:11
  2. PIC water sensor
    By The Master in forum Off Topic
    Replies: 28
    Last Post: - 24th October 2008, 18:29
  3. Electric water valve
    By Christopher4187 in forum Off Topic
    Replies: 2
    Last Post: - 6th April 2008, 21:41
  4. Water Level Detection using Ultrasonic Sensor
    By Balachandar in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th November 2007, 04:59
  5. hot water flow sensor
    By jessey in forum Off Topic
    Replies: 16
    Last Post: - 24th January 2007, 04:05

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts