Go Down

Topic: Water level Sensor (Read 22855 times) previous topic - next topic


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.


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


You could possibly try a pressure switch.

If you want to encourage cephalopods, don't use copper.


Jul 10, 2009, 09:50 pm Last Edit: Jul 10, 2009, 09:56 pm by biscuit495 Reason: 1
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?


Jul 10, 2009, 10:02 pm Last Edit: Jul 10, 2009, 10:03 pm by madworm Reason: 1
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).


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.


Tell me if you find a suitable pressure sensor :)

Coding Badly

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...


...detect the surface of the water?


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.


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
Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store


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.


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.


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.


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.


Jul 18, 2009, 04:45 pm Last Edit: Jul 18, 2009, 04:48 pm by SpikedCola Reason: 1
What about using some copper braid and a capacitance-sensing library like this one:

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?

Go Up