Water level measurement

Category: Articles
Published on Monday, 31 August 2020 18:49
Written by AltonaLab
Hits: 79

Experiment: Measuring the water level in a tank.

AltonaLab diagram: KIT_TankLevel.nsm

Used hardware:

This is the first experiment with a water. For this very simple experiment, we will use the Soil humidity sensor, which converts the resistance of a Soil humidity probe to a voltage in range 0..5V. The sensor is supported in AltonaLab diagram with a block SoilHumiditySenror. The block shows how much is the actual resistance of the Soil probe at its RSoil output. The idea is that the deeper the Probe is in the water, the lower is its resistance. As it is visible, at this experiment we will use the Soil humidity probe as a Water level probe. According to the resistance of the Probe, we will calculate the water level in the tank.

The hardware diagram is shown below. GPIO 0 of a Numato board is used to read the values of a Soil humidity sensor. The sensor is sensitive in range 50 ohms to 50,000 ohms.

 

 

 The used AltonaLab diagram is:

The Numato block reads the sensor's value in range 0..1023 by its 10 bit ADC. On every read its output OnRead becomes to a high level for a short time and signals the next block SoilHumiditySensor to convert the read ADC value to ohms on its output RSoil. Because the relation between a Probe resistance and a water level is not linear, we will make an easy preliminary experiment.

1. Run the diagram and just touch the Probe to a water. Then look at how much resistance is shown on the running diagram. In this case in AltonaLab laboratory it is around 10,000 ohms;

2. Insert the sensor deeper into the water so that it covers it halfway. The probe resistance is around 6,700 ohms.

3. Insert the sensor so that it is completely covered with water. Its resistance now is around 5,700 ohms;

As is visible from the measurements, the relation between a resistance and a water level is really not linear. Because the Probe is short, three points are enough.

Now double click on the block Approximation with the mouse and set its property Settings with three points, as is shown below:

XValue, YValue:

10000  0

6700  50

5700  100

The Approximation block will convert the Probe resistance in range 10,000 ohms .. 5,700 ohms to a water level 0..100%. The actual water level will be shown in a Tank control on a running AltonaLab diagram.

For the experiment, fill a container with at least 10 cm of water, then start moving the Probe slowly into the water, then slowly remove it, so you will simulate the change of the water level in the tank. Observe the level of the vessel on the computer screen visualized by the Tank control.

Of course, the Probe available in the KIT is not suitable for real measurements because to its short size. But for real tanks, you can easily make your own Probe with two long cables located close to each other. If you have made a Probe with a length of 1 meter, it is good to find the approximation points on every 5 or 10 cm along the length of the Probe.