Case study
Water tank monitor
An HC-SR04 measures the empty height from the tank top to the water surface; a Python preprocessor turns that gap and the known tank height into fill level on the dashboard.
Tank board
ultrasonic
Distance
MQTT reading
Python preprocessor
distance → level %
Dashboard
tank widget
Why
We needed tank level without climbing the tank. Measuring the air space above the water was the first approach we tried on a cylindrical tank.
How
The ESP32 ranges the water surface from the top of the tank and publishes distance over MQTT.
A Python preprocessor subtracts that reading from the configured tank height and sends fill level to the dashboard.
Where Python sits on the MQTT path — How it All Works.
Also: Foam and geometry made echoes unreliable here; see water tank monitor v2 for the approach we use now.
ESP32 + HC-SR04 ultrasonic sensor