Arduino Automatic Tank Refill | Ultrasonic Level & Pump Control
An Arduino can use ultrasonic distance to a liquid surface to decide when a tank needs refilling. The air gap decreases as the tank fills.
The key idea
The distance reading needs a known mounting reference to represent liquid level. Separate start and stop levels allow a refill cycle to finish without repeatedly switching the pump near a single threshold.
What to remember
- Convert air gap to level using a fixed reference.
- Treat invalid or missing echoes as a separate condition.
Check your understanding
If the measured air gap shrinks, what usually happened to the liquid level?
Show the explanation
It rose toward the sensor, assuming the mounting position stayed fixed.