0
Offline
Newbie
Karma: 0
Posts: 45
Arduino rocks
|
 |
« on: May 24, 2011, 02:41:40 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16566
Available for Design & Build services
|
 |
« Reply #1 on: May 24, 2011, 03:27:28 pm » |
If you just directly ground the pulled up input pin, do you see a low then? Maybe the problem is not the water.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 45
Arduino rocks
|
 |
« Reply #2 on: May 24, 2011, 03:32:05 pm » |
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!
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16566
Available for Design & Build services
|
 |
« Reply #3 on: May 24, 2011, 03:44:22 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 45
Arduino rocks
|
 |
« Reply #4 on: May 24, 2011, 04:20:14 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16566
Available for Design & Build services
|
 |
« Reply #5 on: May 24, 2011, 10:47:00 pm » |
Yes - wet your fingers & try it. Will make you more conductive & give better results.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #6 on: May 25, 2011, 10:41:49 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Swannanoa, New Zealand
Offline
Full Member
Karma: 1
Posts: 202
New To Arduino (and C)
|
 |
« Reply #7 on: May 26, 2011, 06:01:24 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16566
Available for Design & Build services
|
 |
« Reply #8 on: May 26, 2011, 07:23:53 pm » |
For detecting water?
|
|
|
|
|
Logged
|
|
|
|
|
Swannanoa, New Zealand
Offline
Full Member
Karma: 1
Posts: 202
New To Arduino (and C)
|
 |
« Reply #9 on: May 27, 2011, 02:34:36 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #10 on: May 27, 2011, 03:00:07 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Swannanoa, New Zealand
Offline
Full Member
Karma: 1
Posts: 202
New To Arduino (and C)
|
 |
« Reply #11 on: May 27, 2011, 03:15:01 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #12 on: May 27, 2011, 04:17:53 am » |
Physics...isn't that the subject of wobbly theory. No it's the sub branch of mathematics that happens to deal with reality. 
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #13 on: May 27, 2011, 05:25:45 am » |
Could you measure angular deflection of some dowsing rods?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Humboldt, CA
Offline
Full Member
Karma: 1
Posts: 220
Arduino BBB
|
 |
« Reply #14 on: May 27, 2011, 10:27:47 am » |
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!
|
|
|
|
|
Logged
|
|
|
|
|
|