Ideal water sensor circuit - Page 1
Forum section: electronics / projects

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 21, 2020, 09:38:12 pm
content: Sensing moisture isn't theoretically complicated. Given that I already have the sensor design (really just interleaving fingers on a PCB, standard stuff) what is your favorite design that:-has extremely low standby power consumption, <1uA-isn't overly ESD sensitive-runs from 2 to 3V-provides a logic-ish output (not terribly important it does this as a low power micro will monitor this output)-very sensitive, can detect a damp cloth and not only a water puddleI know there's a few ways to do this. Comparator, BJT and JFET come to mind. MOSFET is probably out due to the low voltage. BJT isn't going to be very sensitive. I'm not sure offhand what the reverse leakage of a standard Si diode is or the leakage of a TVS, but having these on the sensor lines will affect sensitivity and possibly cause more power consumption.Maybe this is a dumb question. But I feel it's one of those design decisions that seems simple yet easy to screw up.

author: NiHaoMike
author_rank: Super Contributor
timestamp: December 21, 2020, 11:22:28 pm
content: Quote from: jrmymllr on December 21, 2020, 09:38:12 pmDarlington transistors are so sensitive they can even detect minuscule ion currents!http://techlib.com/science/ion.html

author: Benta
author_rank: Super Contributor
timestamp: December 21, 2020, 11:25:18 pm
content: Quote from: jrmymllr on December 21, 2020, 09:38:12 pmWhat do you mean? Sensing tap water isn't complicated, as minerals and salts makes it conductive to a degree. Same goes for moisture in the earth of potted plants.But detecting pure water is no walk in the park.What exactly are you sensing/measuring?

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 22, 2020, 12:50:56 am
content: Quote from: Benta on December 21, 2020, 11:25:18 pmThis isn't for anything fancy like DI water. This is simply for water leaks in a house, so tap water, yes.I can design a moisture detector circuit that more or less functions, as that's trivial. What I'm asking is for opinions on one that ticks the boxes I posed, and any "lessons learned" because one thing I've learned is even apparently simple designs end up with at least one gotcha.

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 22, 2020, 12:51:44 am
content: Quote from: NiHaoMike on December 21, 2020, 11:22:28 pmHmmm, I thought about Darlington but didn't realize just how sensitive they are. And BJTs are pretty robust too!

author: Raj
author_rank: Frequent Contributor
timestamp: December 22, 2020, 01:47:44 pm
content: How about a single microcontroller? just put it to sleep between measurements...plus it can sense the water both capacitively and resistively.

author: Zero999
author_rank: Super Contributor
timestamp: December 22, 2020, 03:09:42 pm
content: If it's going to be dry, most of the time and used occasionaly, then use use DC. Something simple such as a BJT or MOSFET, with the base/gate connected to the power supply, via the electrodes can drive a small relay, siren, buzzer, lamp etc.https://bitsnblobs.com/a-simple-water-detector-circuit-b1p12/If the detecting electrodes will be frequently submersed, you should use AC to measure the resistance, as DC will cause corrosion. This makes it a little more complex, but it's still fairly simple.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: December 22, 2020, 03:43:49 pm
content: I would also go the capacitive route.Water has a high dielectric constant (I think around 1000) which makes capacitive sensing a good option.It's also very robust because there is no direct electrical contact with the water, so no electrolysis problems.I would be weary of any DC based conductive sensor, even for occasional use. They are inherently unreliable because the electrodes get dissolved.

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 22, 2020, 04:14:22 pm
content: Quote from: Raj on December 22, 2020, 01:47:44 pmI'll still need an analog front end of some type. That's the part I was asking about.EDIT: I do like the capacitive idea if I can eliminate the resistive sensing.

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 22, 2020, 04:19:04 pm
content: Quote from: Doctorandus_P on December 22, 2020, 03:43:49 pmSo two people have mentioned capacitive. That's an interesting idea and solves some problems, but is slightly more complex. Would ENIG coated electrodes (i.e. PCB pads) be fairly resilient against occasional water contact?

author: Raj
author_rank: Frequent Contributor
timestamp: December 22, 2020, 04:44:56 pm
content: Quote from: jrmymllr on December 22, 2020, 04:19:04 pmHow about like my example...pin 5 and pin 8 go high and low alternatively and opposite to each other... when pin 8 is high, measure current at caused by voltage drop at pin 8 and when pin 5 is high, measure current at caused by voltage drop at pin 6.

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 22, 2020, 05:01:15 pm
content: Quote from: Raj on December 22, 2020, 04:44:56 pmThis assumes there's enough current flow caused by water to reliably detect with the micro's A/D. I'd also need some ESD protection on there. The input impedance of a PIC for example is in the kilohms, which might be too low.

author: Raj
author_rank: Frequent Contributor
timestamp: December 22, 2020, 05:08:47 pm
content: Oh...and if the probes are capacitive....you can instead increase the resistor's resistance and measure time taken for like, pin 7 to go to pin 8 level when pin 8 is high and measure time taken for like, pin 6 to go to pin 5 level when pin 5 is high.

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 22, 2020, 05:42:16 pm
content: Quote from: Raj on December 22, 2020, 05:08:47 pmTrue, that's something to think about.

author: Zero999
author_rank: Super Contributor
timestamp: December 22, 2020, 05:46:24 pm
content: I thought I'd have a play with LTSpice. R_water represents the water's resistance and isn't needed in the real circuit. RL is the load. It's there to make plotting the output easier, as R_water is a voltage controlled resistor and 600kV and 3V won't fit on the same scale. It isn't needed in real life.

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 22, 2020, 07:15:28 pm
content: Quote from: Zero999 on December 22, 2020, 05:46:24 pmI added a resistor divider on the output V1 so I could graph this voltage along with everything else and I see generally how it works. What is the advantage of this over a simple DC sensing circuit? Is it to prevent corrosion? I thought that would require reversing polarity.I may try this later as I'm fairly certain I have a 74HC14 around.

author: Zero999
author_rank: Super Contributor
timestamp: December 22, 2020, 09:28:42 pm
content: Quote from: jrmymllr on December 22, 2020, 07:15:28 pmYes, AC prevents corrosion. C2 blocks the DC on A1's output, so not DC flows through the water. If you probe R_water you'll find, the voltage is AC, once C2 has charged up. Changing the value of R2 will alter the sensitivity.If you plot the current through RL, you need a potential divider, for it to fit on the same scale as R_water. Another option is to simply plot the actual resistance of R_water, by telling it to plot V/L. Note, if it gives a negative resistance, reverse the connections to the resistor, by rotating it by 180oand it'll be positive.

author: jrmymllr
author_rank: Regular Contributor
timestamp: December 23, 2020, 01:32:06 am
content: Quote from: Zero999 on December 22, 2020, 09:28:42 pmI'm wondering though if I even need to worry about corrosion as these will be water leak sensors. They will be in locations that are normally bone-dry, primarily on the floor under a dishwasher, clothes washer, water heater, etc. They should also be very sensitive to not only a puddle, but a damp cloth should I use something like that to effectively increase the detection area. So I'm starting to wonder if a simple DC resistive circuit is best, as opposed to a capacitive sensor as others have suggested. Thoughts?

author: Zero999
author_rank: Super Contributor
timestamp: December 23, 2020, 09:06:18 pm
content: Quote from: jrmymllr on December 23, 2020, 01:32:06 amThat's really what I was alluding toabove. If it's just going to occasionally get wet, then use DC, as it's much simpler. If you want latching, then use an SCR, rather than a BJT or MOSFET, but you'll need to connect the gate to the cathode, via a capacitor, to filter out any mains hum, which could cause nuisance triggering.