Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: HDL_CinC_Dragon on November 07, 2007, 03:12:15 PM
-
What would be the easiest way to detect the presence of water between two metal probes? Can I simply have it so that one probe is constantly supplied with regulated 5v and have a second probe About 5-10mm apart connected to an input pin that the software is constantly checking for a voltage level on the ATMega?
Heres an MSPaint example of what I mean for the most part - I think you'll get the idea =)
(http://img443.imageshack.us/img443/3412/autowaterscenario1smallrf7.th.png) (http://img443.imageshack.us/my.php?image=autowaterscenario1smallrf7.png)
Red "wire" = 5v regulated wires
Black "wire" = GND
Green "wire" = Input wire from probe to MCU
Blue "wire" = Input wire from probe to MCU
Basically when the MCU detects zero voltage from the Green wire input pin (The bottom probe) it tells the MCU to open the fluid valve to allow water into the tank. When the MCU detects voltage from the Blue wire input pin (The top probe) it tells the MCU to close the fluid valve again to cut off the flow of water into the tank.
It would also be nice if the MCU could keep track of how long the fluid valve is open for so that if its open for a ridiculous amount of time (say 10 minutes if its only supposed to take say 5 minutes to fill) it can go into an error mode where it just flashes an LED and/or pulses a piezodisc so the user knows something is wrong and can either reset on false alarm or after fixing the problem.
-
That should be fine for a normal CMOS input. You'll have to have a pulldown resistor of fairly high value on the input. Some quick R = resistivity * length / cross-sectional area calculations would sort out the details of electrode size and resistor value.
Also salt water is much more conductive than tap water.
I don't think damage due to elecyrolisis will be a problem because the voltage is too low when conducting. There may be some other corrosion/contamination mechanism but I can't think of any.
-
Just use the photoresistor schematic:
(http://www.societyofrobots.com/images/schematics_photoinc.jpg)
But instead of a photoresistor, let that circle be the tank of water. If the probes detect no water, Vout will be ground. If there is water, Vout will be some other voltage - depending on the resistance of the water.
(Vin is a probe connected to 5V and Vout is a probe connected to the ADC of your microcontroller)
-
Watch out since the resistance of spring/purified water can be very different from tap water.
This can range from very low resistances to very high (like an open circuit) resistances
-
If the resistance is too high, just put an op-amp on Vout to amplify the signal.
-
Yeah im aware that the resistance of water is different depending on its source and such and im also familiar with the corrosion that Electrolysis can do to metals and such.
I have 12 seperate "tanks" of water that need to be monitored and regulated but luckily they all get their water from the same source, I was planning on taking my DMM and just measuring the resistance value of the water with the probes at different lengths apart to find that "sweet spot"...
Thanks for the help and input guys =) I should be able to get this working =)
-EDIT-
Oh yeah, Admin: I thought if something had a direct route to ground it was a bad thing? doesn't that cause problems for the battery or anything? Or is that why there is a resistor in series?
-
why not do something like in car gas tanks?
there is a float at the end of a X length rod. and the rod is connected to a rotating pot
-
doesn't that cause problems for the battery or anything? Or is that why there is a resistor in series?
Yeap, thats why there is a resistor in series (but also to create a voltage divider). Select the resistor exactly the same way as if you were to use a photoresistor.
-
@Ed:
Thats a pretty good idea... Ill experiment with that idea a bit more too =) Thanks!