Level monitoring and leak detection

Level monitoring and leak detection

On these hot Summer days, we propose to discuss today two classical topics of remote monitoring: monitoring the level of a tank and detecting water leaks (or other liquid leaks). For these two applications, we are going to show you how you can interface existing sensors with Yoctopuce modules.



Level monitoring

We showed in a previous post how to regulate the level of a tank with a Yocto-RangeFinder. The principle consisted in measuring the distance between the top of the tank and the level of the liquid. The test project described in the post is by the way still in service and works perfectly: the solution which consisted in molding the telemeter into ultra-transparent resin revealed itself to be reliable and it withstood spending last Winter outside perfectly.

The solution that we propose today consists in using a resistive sensor dedicated to this task. We found the sensors on the Adafruit site, but they are in fact manufactured by the Milone Technologies company and they are sold on many sites. They are available in different sizes, from 13cm to 80cm.

The sensitive component of this sensor is a type of resistance, of which the value varies quasi-linearly depending on the submerged height. A five point calibration (empty, quarter, half-full, three-quarter, full) is however recommended if you work directly on the resistive output. You can also directly buy the sensor pre-calibrated, and mounted with an electronics providing a voltage signal (0-5V) or a signal to the 4-20mA standard.

The Milone eTape level sensor, with a 0-5V output, connected to a Yocto-0-10V-Rx
The Milone eTape level sensor, with a 0-5V output, connected to a Yocto-0-10V-Rx



We recommend that you use the 4-20mA version: it's always easier to use. You only need two wires between the sensor and a Yocto-4-20mA-Rx to power the sensor and to transmit a reliable measure.

If you decide for a 0-5V version, start by checking that it is indeed this version: Milone currently announces a stock shortage, and the one we bought through Adafruit as a 0-5V version was in fact a simple version with voltage divider (simple resistive output).

The output module from our sensor wasn't the expected one...
The output module from our sensor wasn't the expected one...


Then, you must tinker a little bit, as the 0-5V output module of the eTape sensor can be powered in 5V only. However, the power source output of the Yocto-0-10V-Rx provides 23V. You must therefore draw 5V directly from the USB bus, as we already did some time ago to interface a pitot probe:

Connection diagram to draw 5V from the USB bus
Connection diagram to draw 5V from the USB bus



And if you have, like we do, a resistive version, the simplest way is to use a Yocto-MaxiThermistor or Yocto-Thermistor-C module, as this sensor has a working behavior similar to that of a thermistor. This enables you to use the same resistance to temperature conversion table mechanism, but to convert resistance to liquid height. You can thus enter the number of calibration points that you want in the module configuration table, and the module automatically interpolates between the provided points.

The Milone eTape level sensor, with a resistive output, connected to a Yocto-Thermistor-C
The Milone eTape level sensor, with a resistive output, connected to a Yocto-Thermistor-C



In the end, apart from this issue with the incorrect output module, these sensors work quite well. The only flaw of this technique is the limitation of the possible depth, as the longest sensors are 80cm long. Beyond, there is another technique, almost limitless, to measure the height of a liquid: a pressure sensor at the bottom of the tank. To this day, we can only suggest you to use an external pressure sensor with for example a 4-20mA output, but potentially we could offer you a native Yoctopuce sensor in a little while...

Water leak detection

You could imagine that detecting a water leak could be done simply by a simple resistive measure between two wires. It works somewhat, but the method isn't really reliable, so usually for serious applications, we rather use a sensor based on an optical method.

There are very sensitive sensors using detection paper, but you generally must change the paper after each positive detection. There are also paperless sensors, based typically on the same principle as our rain sensor. We performed our own tests with a small optical sensor of this type, bought at DigiKey:

Our water leak sensor, connected to a Yocto-0-10V-Rx
Our water leak sensor, connected to a Yocto-0-10V-Rx



This type of sensor has a binary output: leak detected, yes or no. Industrial sensors with binary outputs generally use a PNP or NPN type output. We already showed you in a previous post how to connect PNP and NPN sensors to Yoctopuce modules, but we propose today a small variant. Indeed, this particular sensor needs a power source between 12 and 24 V. If we wanted to use it with a Yocto-IO, we would need an external power source. To avoid this, we used a Yocto-0-10V-Rx, which provides a 23V source derived from the USB bus, and added a small dividing bridge to convert our PNP output into a 0-10V output:

Diagram to connect the PNP sensor to a  Yocto-0-10V-Rx
Diagram to connect the PNP sensor to a Yocto-0-10V-Rx



And here is the result: the optical detection works perfectly well, even for faint traces of water on a irregular surface

Test of our leak sensor
Test of our leak sensor



Add a comment No comment yet Back to blog












Yoctopuce, get your stuff connected.