The problem
A water tank left to fill by hand overflows and wastes water; a pump left to run against an empty source burns its motor out. Both failure modes are expensive and both are common in hostels, farms and apartment buildings where nobody watches the tank. This project builds an automatic guard on an ESP32: a level sensor reports the tank state, the controller switches the refill pump through a relay, and a 16x2 LCD continuously shows LEVEL (OK/LOW) and PUMP (ON/OFF) so the control decision is always visible. When the sensor reports the dry point, the pump is cut within the debounce window and a buzzer sounds a repeating pattern until the level recovers — the classic dry-run protection that makes the demo dramatic and the viva easy. Thresholds are configurable in firmware, and the report documents the debounce and state-machine design explicitly.
How it works
- The ESP32 polls the level sensor on a short cycle (design target ~1 s) and passes the reading through a debounce filter that rejects ripple-induced toggling.
- In normal state the controller holds the pump relay on (or off, depending on fill logic) according to the level band, updating the LCD each cycle with LEVEL and PUMP state.
- When the sensor reports the low point for the full debounce window, the firmware opens the pump relay immediately — dry-run protection takes priority over everything.
- The buzzer starts its repeating pattern and the LCD switches to the LOW indication, mirroring the fault state on both channels.
- The alarm persists until the sensor reports the resume point; refilling (or raising the probe) clears the buzzer and message automatically.
- Automatic control resumes from the recovered state with no button press needed; the state machine is designed to be demonstrated end to end by moving the sensor.
- The buyer tunes the cut and resume points once for their tank using the included procedure, so the demo runs against real geometry.
Tech stack:
- ESP32 development board
- Level sensor module (tank-mount)
- Relay module, opto-isolated
- DC refill pump
- 16x2 character LCD
- Piezo buzzer
- Arduino IDE (C/C++ firmware)
- Tank-mount sensor bracket
| Parameter | Value |
|---|---|
| Controller | ESP32 (dual-core 240 MHz, datasheet) |
| Level sensing | Single-point level sensor, debounced (design target ~1 s poll) |
| Pump control | 1 relay channel, NO/COM, opto-isolated |
| Display | 16x2 character LCD, LEVEL + PUMP state, refreshed ~1 Hz |
| Alert | Piezo buzzer, repeating pattern (design target) |
| Debounce window | Configurable (design target ~2–3 s) |
| Thresholds | Low-cut and resume points, firmware constants with hysteresis |
| Controller power | 5 V via USB or pump-supply buck converter |
Project features
- [Level-based pump control] The ESP32 reads the level sensor and runs the refill pump only while the level is in the safe band — no more manual switching, no more overflows.
- [Dry-run protection] A low-level event opens the pump relay within the debounce window and sounds the buzzer, protecting the pump from running against an empty source.
- [Live LCD status] A 16x2 LCD continuously shows LEVEL (OK/LOW) and PUMP (ON/OFF), so the system's state is readable at a glance without a serial console.
- [Buzzer alarm] A piezo buzzer raises a repeating-pattern alert on low level, silenced automatically when the level recovers — the alert path is demonstrated live.
- [Debounced sensing] The level input is debounced in firmware so ripples and splashes cannot chatter the relay, with the debounce window documented and tunable.
- [Configurable thresholds] Low-level cut point and resume point are set as firmware constants with hysteresis, tuned to the buyer's own tank geometry.
- [Auto-resume on refill] When the level rises back above the resume point, the alarm clears and automatic control continues — the full fault-recovery cycle is shown end to end.
What is included
- Wired prototype: ESP32, level sensor with tank-mount bracket, relay module, refill pump, 16x2 LCD, buzzer
- Complete Arduino firmware with debounce, hysteresis and dry-run protection state machine
- Wiring diagram and bill of materials with exact part numbers
- Sensor-mounting and threshold-tuning notes for the buyer's tank
- Project report PDF (background, level-sensing theory, relay protection, state-machine design)
- PPT presentation for final review
- Viva Q&A preparation document (debounce, hysteresis, dry-run failure modes, relay isolation)
Limitations & prerequisites
- Single-point level sensing: the controller knows LOW vs OK, not a continuous level percentage — multi-point or ultrasonic gauging is future scope.
- The dry-run cut protects the pump from running on an empty source; it does not protect against a blocked outlet or a seized pump.
- The debounce window adds a short delay to the cut decision; it is sized to reject ripples, not to catch sub-second events.
- The alert is local (buzzer + LCD) — there is no SMS or remote notification in the base build, since no GSM or cloud module is included.
- The pump and sensor are sized for the demo tank; a deep borewell or large overhead tank needs the sizing re-done per the notes.
Frequently Asked Questions
How is this different from a simple float switch wired to a pump?
A bare float switch chatters on ripples and gives no status. This controller debounces the sensor in firmware, adds hysteresis between cut and resume, guards the pump with priority logic, and shows the full state on an LCD — a designed control system, not a wired switch.
What exactly happens on dry-run?
The relay opens within the debounce window, the buzzer sounds its repeating pattern, and the LCD shows the LOW state. Refill clears everything automatically and the pump resumes — the entire sequence is demonstrated live by moving the level sensor.
Can the pump be run manually?
Yes — the firmware includes a manual override for priming and demonstration, with the dry-run cut still armed as a backstop.
How do I tune it to my tank?
The included procedure sets the low-cut and resume points for the buyer's tank geometry in about 15 minutes; both are firmware constants with hysteresis documented in the report.
Does it alert me remotely?
No. The alert is a local buzzer plus the LCD status — there is no GSM module or cloud service in this build, and the listing claims none.
Is this project suitable for a final-year project?
Yes — for Electronics, Electrical and IoT programs. It demonstrates sensing with debounce, relay actuation, protection state machines with hysteresis, and a live fault-recovery demo. Suitable for B.E./B.Tech final-year projects in Electronics, Electrical and IoT.
Components & software requirements
- ESP32 development board
- Level sensor module (tank-mount)
- Relay module, opto-isolated
- DC refill pump
- 16x2 character LCD
- Piezo buzzer
- Arduino IDE (C/C++ firmware)
- Tank-mount sensor bracket
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.