Introduction
The rainwater harvesting storage tank has a nominal capacity of 5,000 litres and all the water used for flushing toilets and in the washing machine comes from that tank. Daily usage is typically around 50 litres so if the tank is full that’s about 100 days of capacity before it all gets used. Once the tank is nearly empty there’s an automated mains water top-up which kicks in (controlled by a float switch attached to the pump housing) so the tank should never run dry (which could damage the pump – although the pump controller provides some protection against that).
Monitoring the water level in the tank is therefore a nice-to-have, rather than being something which is required for successful operation, but it’s interesting in terms of tracking how much rainfall is being captured and how well the tank is servicing the usage. (The rainwater consumption is measured by M-Bus-connected water meters – one inside the House and one in the Outbuildings.)
Liquid Level Sensor Technology Options
There are several different ways of measuring the level of liquid in a tank.
Clock-type Float Gauges
The traditional way of measuring fluid levels – such as within an oil storage tank – is to use a float attached to a spring-loaded line, with a readout on a ‘clock’-style indicator similar to a vehicle fuel gauge display. These are simple, cheap devices which work well but rely on visual inspection of the clock indicator attached to the top of the tank.

Ultrasonic Distance Measurement Gauges
An evolution of the float-based gauges are the ultrasonic devices which measure the distance from a fixed point at the top of the tank to the surface of the liquid, using an ultrasonic distance sensor. These have the advantage that the display can be remote from the tank – such as inside a house – but they need a power supply, typically provided by batteries.
The actual sensor is typically an ultrasonic ‘horn’ with a short cable attached. The presence of electronics in close proximity to the sensor can cause issues – especially when operating in ‘condensing’ environments such that everything is always wet.


Pressure Sensing Gauges
Pressure increases progressively as the depth of a liquid increases so another option is to measure the pressure exerted on a sensor located near the bottom of the tank. Changes in atmospheric pressure can influence these readings so it is important to take account of atmospheric pressure – typically by using a thin tube to carry atmospheric pressure down to the location of the pressure-sensing diaphragm.

Other people have reported good success with these sensors – a key benefit is that with a long cable, the electronics that process the readings can be kept well out of the way, in a warm and dry location.
Sensor Technology Selection
Based on feedback from people using ultrasonic sensors, even the ones said to be ‘waterproof’ do not seem to last very long in condensing environments. While there are ultrasonic sensors designed for hostile environments (such as explosive atmospheres) those are very expensive; hundreds of GBP.
Overall, the pressure sensors look like the best option. These are available with different ‘interface’ options, typically:
Of these, 4-20mA is generally considered to be the most reliable interface standard, being largely immune to electrical interference (such as from the submerged water pump) and well able to tolerate long cable runs. It is also inherently able to detect a power supply or circuit failure, since a current of less than 4mA is a well-defined error condition.
4-20mA sensors also need a DC power supply, connected in series with the sensor using just 2 wires. This is typically 24V DC, although for short cable runs some sensors are able to work with lower voltages, such as 12V DC. (Any ‘excess’ voltage needs to be dissipated as heat within the sensor.)
Integration Technology Selection
The next question is, how to ‘read’ a 4-20mA signal and present it as (ideally) a stored liquid volume measurement rather than a height-of-liquid measurement.
KNX Interface
The easy-but-not-cheap option – given that there will already be a KNX installation available – is to use a commercial KNX module to receive the 4-20mA signal and present that to a KNX Group Address. MDT offer an Analog Input / Output Module which can handle 4-20mA signals (each input is also configurable as 0-20mA, 0-10V or 2-10V). This is available as a 2-channel, flush-mounting unit (75 GBP) or a 4-channel. DIN Rail-mounting unit (100 GBP).
It would make for a neat installation to use a DIN rail mounting 24V DC power supply alongside a DIN rail mounting KNX interface module, inside a 3- or 4-module DIN rail enclosure, such as the WYLEX WBE3 IP65 3-MODULE UNPOPULATED DIN ENCLOSURE (which has a nice splash-proof cover).
ESPHome
The cheaper-but-not-as-easy option is to integrate a set of components that will take a 4-20mA input and present this to Home Assistant, probably using ESPHome, consisting of:
- An ESP32 or simular microcontroller
- Ideally with a wired Ethernet port
- Even more ideally with Power-over-Ethernet (PoE)
- Something to make the 4-20mA input accessible to the ESP32
There’s a long discussion of various options for ESPHome-based water level sensors here: https://community.home-assistant.io/t/esphome-water-level-sensor/126504/133 (including the pros and cons of ultrasonic versus hydrostatic pressure sensor technologies etc.)
See also:
- https://markus-haack.com/watertank-esphome
- https://nachbelichtet.com/en/measure-water-level-in-cisterns-and-tanks-with-homeassistant-esphome-and-tl-136-pressure-sensor-update-2
Implemented Solution
I finally settled on using this submersible pressure sensor (4-20ma interface, 5m range and 10m cable) for £40.29 from Aliexpress. It’s a substantial piece of kit, with the stainless steel sensor head measuring 28mm x 110mm. 10m of cable is more than enough to reach from the bottom of the tank to the interface box, and while 5m range is much more than required (1m would have been just enough) it was the smallest measurement range available with 10m of cable.
For processing the readings, I decided on using a DIN-rail-mount KNX interface. Since that has 4 channels available, it seemed sensible to also install a water pressure sensor that will track how well the expansion vessel handles water draw-off and how often the pump runs. That’s a G1/2 pressure transmitter (4-20ma interface, 0-10bar range) for £23.19 from Aliexpress.
Rain Water Tank Level Monitoring by Marsh Flatts Farm Self Build Diary is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.