Arduino Forum

Forum 2005-2010 (read only) => Hardware => Interfacing => Topic started by: biscuit495 on Jul 10, 2009, 07:40 pm

Title: Water level Sensor
Post by: biscuit495 on Jul 10, 2009, 07:40 pm
I have a system set up that will automatically change the water on my fish tank. It works well and I am using wires in the water as electrodes and have them plugged into the analog ports on the arduino. It senses water fine but the problem is that the wires disintegrate and every metal i have tried emits a milky white substance into the water when it is sensing. Can someone suggest an alternative for sensing water? Is there a different kind of metal I can use that will not mess up the water and disintegrate? Thanks.
Title: Re: Water level Sensor
Post by: jpgr87 on Jul 10, 2009, 09:33 pm
Running a current through the water like that is causing the metal to corrode, which is the white stuff you see.  To avoid this, you might try using a float switch like this one: http://www.virtualvillage.com/liquid-water-level-sensor-right-angle-float-switch/sku009700-026?utm_source=googlebase&utm_medium=shcomp&utm_campaign=Liquid%20Water%20Level%20Sensor%20Right%20Angle%20Float%20Switch
Title: Re: Water level Sensor
Post by: AWOL on Jul 10, 2009, 09:40 pm
You could possibly try a pressure switch.

If you want to encourage cephalopods, don't use copper.
Title: Re: Water level Sensor
Post by: biscuit495 on Jul 10, 2009, 09:50 pm
Are there any conductors that do not corrode during electrolysis? If not i will probably just use a float switch. Won't the contacts for each terminal corrode inside the switch?
Title: Re: Water level Sensor
Post by: madworm on Jul 10, 2009, 10:02 pm
A first improvement would be to lower the current by lowering the voltage with a voltage divider (potentiometer). The sensor will still work if the Arduino only reads e.g. 200 instead of 1023. If you used an operational amplifier, this could go even further.

The 2nd step would be to just read the level every e.g. 2 seconds for a very short time. So activate the sensor by using a digital pin as the voltage source and turn it to an output and set it to HIGH. Then read the analog value and turn the sensor off by setting the pin to input (internal pullups must be off).
Title: Re: Water level Sensor
Post by: biscuit495 on Jul 10, 2009, 10:19 pm
I have a 1.6Kohm resistor as voltage divider is this enough resistance? I like the idea of having a digital pin provide the current for the analog read. I think that will reduce the problem greatly. Thanks.
Title: Re: Water level Sensor
Post by: rFree on Jul 11, 2009, 08:38 am
Tell me if you find a suitable pressure sensor :)
Title: Re: Water level Sensor
Post by: Coding Badly on Jul 11, 2009, 09:46 am
Would a light sensor work?  Will water "break" a light beam?


I know lasers are used for tank guaging.  Will an optical proximity sensor work in a similar fasion?  Would something like this...

http://www.sparkfun.com/commerce/product_info.php?products_id=8959

...detect the surface of the water?
Title: Re: Water level Sensor
Post by: macegr on Jul 11, 2009, 09:50 am
I've used these fluid level sensors before. They're optical, there is no electrical or mechanical interaction with the water. The LED and photodiode detect a change in refraction out of the sensing cone.

http://www.fluidswitch.com/pages/Optical-Liquid-Level-Sensors.htm

If you know anything about optics, you know that they work due to the index of refraction, which involves changes in material. Water to air, or air to glass, or glass to different types of glass...they'll all change the angle of light a different way. Also consider prisms; due to the index of refraction, light hitting a surface at a certain angle on an internal glass-air interface will reflect.

The angle of the cones on these fluid sensors appears to be close to the limit of refraction in air. Once water or some other fluid contacts the surface of the plastic, the light will probably no longer reflect off both walls of the cone and return to the photodiode.

You could either find some of these sensors or do some experiments and figure out
Title: Re: Water level Sensor
Post by: biscuit495 on Jul 12, 2009, 03:46 am
Does anyone know where to find these optical sensors or how to make them? I have some cds photocells but I dont know how I would make one from that. Now i have it set for the analog input to receive power from a digital pin and I only have it check every 40 seconds. It works well and even after left for hours in a small container of water the corrosion is not visible at all. Also I now use graphite rods insted of wire ends. I dont think the corrosion is at a harmful level now but if i could find an optical sensor I would switch. Thanks.
Title: Re: Water level Sensor
Post by: Dougl on Jul 12, 2009, 07:22 am
those float switches are probably nothing more than a simple reed switch with a magnet in the moving float section. So, you could make one yourself too and have the reed switch on the outside of the tank nice and dry and the magnet sealed in a float on the inside of the tank.
Title: Re: Water level Sensor
Post by: peterloron on Jul 17, 2009, 02:14 am
Lower the current and voltage to reduce electrolysis. Also, you could generate and send an AC signal instead of DC.

Alternately, try putting a capacitive sensor on the outside of the tank.
Title: Re: Water level Sensor
Post by: zooto68 on Jul 17, 2009, 03:45 pm
Sure Electronics have some too - http://www.sureelectronics.net/search.php?encode=YTozOntzOjg6ImtleXdvcmRzIjtzOjU6IndhdGVyIjtzOjg6ImNhdGVnb3J5IjtzOjE6IjAiO3M6MTg6InNlYXJjaF9lbmNvZGVfdGltZSI7aToxMjQ3ODM4MzI4O30=
Title: Re: Water level Sensor
Post by: pluggy on Jul 17, 2009, 05:13 pm
If the water level doesn't change very fast, I'd use the wires and turn them on just long enough to get a reading every few minutes.  If they were on for say 1 second every five minutes, the electrolysis would be very slow and the wires would last a long time.
Title: Re: Water level Sensor
Post by: SpikedCola on Jul 18, 2009, 04:45 pm
What about using some copper braid and a capacitance-sensing library like this one:
http://www.arduino.cc/playground/Main/CapSense

Ive been looking at a water level sensor for measuring water in a rain gauge and this was something I came across. Perhaps its possible to measure the change in capacitance and relate that to water level?
Title: Re: Water level Sensor
Post by: sjbotha on Aug 15, 2010, 03:26 am
I'm no expert in electronics, but I was wondering about this same thing and researched it a bit.

One problem I thought of was oxidation (rust in the case of iron). Apparently Zinc is one of the slowest oxidizing metals out there and it also conducts electricity. If you solder Zinc to the copper wire and only expose the Zinc to the water it should help it oxidize slower.

I was also interested in measuring the level of the liquid pretty closely. I don't want to just know if it's full/empty or not, but have maybe 5 different levels. I was thinking of using the mechanism of the float switch, but with a longer pipe that goes all the way up. Then inside the pipe put a bunch of resistors and reed/hall switches. Then depending on how much current is flowing through the circuit we can tell how many resistors are in play and what the fluid level is.

A reed switch like this could work:
http://www.newark.com/hamlin-electronics/mdcg-4/reed-switch/dp/50F7985

Title: Re: Water level Sensor
Post by: zoomkat on Aug 15, 2010, 06:33 am
I think I would have tried gold plated wire, or stainless steel wire like you make salt water fishing tackle out of.