sensors - leak and level - how?

The title of the thread is weird, but here is what I would like to know.
I am looking for 2 different kinds of sensors:

  • 1 to detect water leak on the floor
  • 1 to detect water level, but something prettier and less noticeable than a float sensor.

For the water leak sensor, I have no idea at all ...

For the water level, I saw several solutions, but I would really like something like a proximity detector (sharp), ultra sound or laser ... I do not like moving parts :slight_smile:

The water level sensor would be use inside a fish tank to maintain a water level between 2 marks.

Any help, schema, links is welcome.
Thank you!

A leak sensor can be made easily by measuring conductivity between to electrodes in a catch basin. A very simple method that I've been using with a different microcontroller in my basement is simply a 100k resistor from +5v to a digital input pin and to a wire with a bare end. Another wire with a bare end goes to the controller's ground. The bare ends are held about 1/2 inch apart at a low point where water will collect. When water is present, the digital input pin will read a low. BTW: this method is NOT good for INSIDE a fish tank or for long term contact with water because the DC voltage on the wires will cause them to corrode. But it's fine OUTSIDE of the tank for detection of occasional leaks.

As far as level... there are many ways to measure level. It sounds like you just want to know if the level reaches two discrete points (high or low). Unless you need to measure the actual level in between these points, I wouldn't suggest the complexity & expense of ultrasound. You could mount a magnet on a float inside a tube against the glass in the back of the tank, then place a pair of reed switches or hall-effect sensors on the outside of the tank at your high & low points. Just make sure that the magnet is water proof so it doesn't rust.

check out the capacitive tape at sparkfun or parallax

If you want something more fun, maybe I can give you some tip:
On the outside of the tank, put 2 or 3 dallas 1wire temp semsors!
Not only is the waterlevel detected by temp-limits, you also get the temperature in the tank. I am planning to do that in my sons 720 l tank. If water dissapears, I would like to know that as soon as possible! We have already opened the floor once...
To detect outside the tank, I am thinking of using a humidity/temp sensor on the floor. Also dual functions, a slight higher humidity or temp might indicate a forgotten coverglass.
Cost? About 3 dollars each for the 1wire temp, and about 10 dollars for the humidity/temp sensor.
And much funnier coding!

I couldn't find capacitive tape on Sparkfun, but that is an interesting idea. a substitute could be made easily with a couple strips of flat copper (possibly just a PCB with two parallel strips etched on it) or strips of just about any convenient flat metal. I'm assuming you're thinking of running on the outside of the glass. Could possibly also use enameled wire in a small tube in the tank if better sensitivity is needed.

The temperature probes could work as well, as long as air temp is different from the water temp. If the ambient air temp gets close to the water temp on a warm day, it would be difficult to sense the water level. Also, the glass and air currents will carry some warmth up from the water level. The technique can work (I've seen it used on boiler drain pipes), it's just sometimes a bit tricky.

Humidity can vary considerably through the day. HVAC cycling will cause it to vary quite a bit in a short period. A conductivity probe is very cheap to build (wire and a resistor) and quite reliable. If a catch basin is inconvenient, probe wires can be as long as necessary. It's possible to run a loop around the tank and even cover them with a porous material to hide them and to wick water to the wires.

I live in the north of Sweden... :wink: Its always cold here.
Yes you might consider the rooms air temp and fluctating humidity.
On my sons tanks, on the outside, there is a self adhesive lcd termometer. He have used them for many years and on all his tanks. Very accurate, even when its hot in the air.

Lol... ok. I still wouldn't trust humidity for leak detection though.

I’d use conductivity sensors for both. Assuming the level isn’t going to change dramatically very quickly, I’d hook the ‘hot’ end up to a digital output pin and then turn it on for a fraction of a second, every few seconds / minute / hour (delete as applicable) take a reading and then turn it off again. It then drastically reduces the corrosion thing going on when its powered. Having a look at the contacts every month or 3 should suffice to keep it working.

It might actually be possible to detect the water level with lasers.

Air and water have different indices of refraction. If you shoot a laser diagonally through a corner of the tank, it should refract slightly differently at an air/glass boundary and a water/glass boundary. If you aim it at a really small target (a photocell or phototransistor with a pinhole in front of it), the difference might be enough to deflect the beam away from it when water is present/absent.

A capacitive proximity sensor will detect water level:-
Not cheap but more reliable than a DIY approach.

Industrial water level probes using conductivity use a low voltage AC to drastically reduce probe corrosion. Intermittently powering with DC would certainly reduce the corrosion problem, but I'd be more concerned about the fish than the probes. I don't know how sensitive they might be to trace amounts of dissolved copper compounds.

A capacitive method wouldn't have any energized metals in contact with water. Likewise for an optical or ultrasonic method. If you wanted to get a bit Rube Goldbergian you could also use a bubble tube, but it would require a pretty sensitive differential/gauge pressure sensor.

OK thanks for the tips.
If I want to go with the ultrasound sensor solution. Is it an issue for the sensor to be:

  1. under the lights
  2. near the water
  3. in the 'fog' produced by the water evaporating

Do you think it will resist?
Do you know 'IP67' compatible ultrasound sensors?