Go Down

Topic: Detecting Water (Read 1 time) previous topic - next topic

bfrye

I have seen a number of circuits that detect water. I am looking for one that is SUPER simple and hooked to a digital IO line of an Arduino. If I put one end of a volt meter on a batteries +5, and the other end of the DMM in the water along with the negative side of the battery - I can measure the voltage of that battery. However, with the Arduino, if I put ground in the water, and a digital I/O line (internally pulled up) in the water also the I/O line does not go down. I assume it can't overcome the internal resistor? (pardon my complete ignorance here, I'm a software guy trying to learn this). Can I instead use some other external resistor to make this work? Thanks all,
Brandon

CrossRoads

If you just directly ground the pulled up input pin, do you see a low then? Maybe the problem is not the water.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bfrye

Yes - if I directly ground the pin it works as expected. For grins and giggles I put in a 1M Ohm resistor - this seems to work as I would expect/want it to now. However, I am not confident in it because I simply don't understand all that is going on!

CrossRoads

Really? (as in, "wait, what?") 1M gave you a low?
With 5V source and 25K internal pullup, Vpin = 5V*(1M/(1M+25K)) = 4.8V, I wouldn't have expected to see that as a Low.
I would expect water with any impurities in it to have lower resistance.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bfrye

Sorry, my bad - I should have been more clear. I changed my setup a little bit. So here is my current setup...

PIN0 pulled to ground with 1M Ohm resistor.
+5V (from Arduino board) placed in bowl of tap water.

PIN0 put in water - it goes HIGH
PIN0 out of water - it goes LOW

Touch PIN0 to my finger and 5 Volts to my finger, PIN0 goes HIGH/LOW unpredictably (this is why I am concerned this 'circuit' is not reliable. ANy thoughts?
Brandon

CrossRoads

Yes - wet your fingers & try it. Will make you more conductive & give better results.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

Quote
PIN0 goes HIGH/LOW unpredictably (this is why I am concerned this 'circuit' is not reliable. ANy thoughts?

Yes it will, 1M is too high to pull a floating pin low.
See:-
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

markB


CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

markB

Thats what the ?? was.
As I understood the writeup about how it works, the capacitance makes the receiving pin slower to reach the high, and the processor detects this.

In theory if the touchpad is in water, then it should also impart some capacitance.

The spa pools I dealt with used AC and a opamp to detect that it was getting 'shorted out' by the presence of water, and would therefore allow the heating elements to work.

The other option is to use ADC and detect a lower voltage when it gets 'shorted out' by water.
In this case you wouldn't necessarily want the internal pull-ups turned on.

Mark

Grumpy_Mike

Quote
then it should also impart some capacitance.

A bit wobbly on the physics there.

However a connection to the water will allow it to act like one side of a capacitor.

markB

Physics...isn't that the subject of wobbly theory.

Yes the impart isn't quite the right term.
I think the ADC bit is probably easier to process if there is a pin free.


Mark

Grumpy_Mike

Quote
Physics...isn't that the subject of wobbly theory.

No it's the sub branch of mathematics that happens to deal with reality.  :P

AWOL

Could you measure angular deflection of some dowsing rods?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Bobnova

Capacitive sensing out to work, I haven't tried it for that use specifically, but when it's in contact your entire body of water will be acting as a capacitor.  That ought to have at least a bit more capacitance than just the leads!

Go Up