Detecting Water

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

If you just directly ground the pulled up input pin, do you see a low then? Maybe the problem is not the water.

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!

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.

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

Yes - wet your fingers & try it. Will make you more conductive & give better results.

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

Will the capacitive sensing work.??
http://arduino.cc/playground/Main/CapSense

Mark

For detecting water?

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

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.

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

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

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

Could you measure angular deflection of some dowsing rods?

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!

your entire body of water will be acting as a capacitor.

No just one plate of a capacitor.

Capacitive sensing is use a lot on boat water tanks. I'm in the process to see if I can create the same thing. As you will see in the PDF that on the last page it shows how the sensors are hooked up to the water tank. The sensors have a black box with 5 wires. I'm trying to figure out what those 3 wires do going back to the control head(in my case will be arduino). I'm sure 2 are ground and power and the third is the mystery. Could be a reference voltage or possibly a digital signal.

Anyone have a clue what it maybe ?

Grumpy_Mike:

your entire body of water will be acting as a capacitor.

No just one plate of a capacitor.

While a true statement, it doesn't make a functional difference whether it's acting as one plate or a whole thing, it'll have far more capacitance than the lead when it isn't in the water. The sensor itself only has one plate anyway, the world is the other plate (the un-grounded world, at least).

Not sure if this helps.
He talks (in the comments) about making sure the liquid isn't in contact.

Mark