ESP32 water tank level meter: HC-SR04 and OLED
Open in the lab ▸Make my own copy
An HC-SR04 at the top of a water tank measures the gap down to the water; the ESP32 turns that into a level from 0 to 100 % and shows it on an OLED with a little gauge. The sensor runs on 5 V, so its ECHO goes through a 1k/2k divider to keep the ESP32 pin at 3.3 V. A red LED lights below 20 %. Click the sensor and change the distance. Open it and press Run: the sketch is inside the board (click the board, then Code). Every part, pin and resistor matches what you would build on a real breadboard; the guided build of the same name has the test sheet and hidden faults.
What is on the bench
8 parts, 16 wires, with a sketch (the program runs in the lab). Boards: ESP32 DevKit.
| Resistor | 3 |
|---|---|
| ESP32 DevKit | 1 |
| Bench power supply | 1 |
| Ultrasonic distance sensor | 1 |
| OLED display (I²C) | 1 |
| LED | 1 |
Put it on your page
The project runs live inside the frame: readers can press buttons, turn knobs and read the meters.
<iframe src="https://zencircuitlab.com/embed/zclctank" width="100%" height="560" style="border:1px solid #2f363a;border-radius:10px" loading="lazy" title="ESP32 water tank level meter: HC-SR04 and OLED on Zen Circuit Lab"></iframe>
Link
https://zencircuitlab.com/p/zclctank
Published by its author under the lab's community terms: it may be opened, copied and changed by anyone. Simulation results are for learning; check a real build against the parts' datasheets.