The problem
Households, hostels and small societies pay for every litre of water, yet most have no visibility into how much they actually use or where it silently goes. A leaking tap, a running toilet cistern or a cracked pipe can waste hundreds of litres a day without anyone noticing, and the loss only becomes visible when the water bill arrives. Municipal meters measure the whole building and cannot point at a specific line or time window, while smart utility meters are expensive, require utility cooperation and are rarely available for a single line or room. Students who want to build water monitoring for their final-year project usually stop at blinking an LED with a sensor, with no real flow measurement, no leak logic and no usable dashboard. This project closes that gap: a genuine flow-measurement instrument — pulse counting, datasheet-based conversion, configurable leak rules and a working usage dashboard — built on a low-cost ESP32, with honest accuracy limits stated up front.
Views usage on the dashboard and responds to leak alerts.
Follow the working sequence
How it works
- Water passes through the YF-S201 sensor, whose internal turbine spins a magnet past a hall-effect element, producing one pulse per rotor revolution on the yellow signal wire.
- The ESP32 counts these pulses with a hardware interrupt on a digital pin, computing the pulse frequency each second.
- Pulse frequency is converted to flow rate using the datasheet relation: Flow (L/min) = Frequency (Hz) / 7.5, i.e. 450 pulses per litre nominal.
- The firmware applies the leak rule: flow persisting through the configured no-usage window (e.g. 00:00–05:00), or daily usage above the configured baseline, raises a leak alert.
- The OLED refreshes with the current flow rate, the session total and any active alert, independent of the network.
- Every 2 seconds (design target) the ESP32's web server pushes the latest values to the dashboard: live gauge, daily and monthly usage bars, and the alert log.
- Totals are written to the ESP32's on-board flash (SPIFFS) so usage history survives restarts and is exportable as CSV.
Tech stack:
- ESP32 (dual-core, Wi-Fi) programmed in C++ via Arduino IDE
- YF-S201 hall-effect water flow sensor, 1/2-inch fittings (datasheet: 1–30 L/min, ±10% accuracy)
- 0.96-inch OLED display, 128×64, I2C
- ESP32-hosted HTTP web server + HTML/CSS/JavaScript dashboard
- SPIFFS on-board flash logging with CSV export
- 5 V DC power; buzzer + LED for local alerts
- Arduino IDE with ESP32 board package; SSD1306 OLED and Wi-Fi/web-server libraries; any browser for the dashboard
- Demo-loop hardware: breadboard or perfboard, jumper wires, 5 V DC supply (USB or adapter), short pipe stubs / vinyl tubing and clamps, active buzzer module and LED
| Parameter | Value |
|---|---|
| Controller | ESP32 development board, 240 MHz dual-core (datasheet) |
| Flow sensor | YF-S201 hall-effect, 1/2-inch fittings, 1–30 L/min working range (datasheet) |
| Pulse relation | 7.5 Hz per 1 L/min nominal, 450 pulses per litre (datasheet) |
| Sensor accuracy | ±10% of reading (datasheet; real accuracy depends on installation) |
| Pulse counting | Hardware interrupt on ESP32 digital input (firmware) |
| Local display | 0.96-inch OLED, 128×64 pixels, I2C interface |
| Dashboard | ESP32-hosted web page over Wi-Fi, refreshed every 2 s (design target) |
| Leak rules | Sustained flow in no-usage window or usage above baseline, configurable (firmware) |
| Power | 5 V DC, approximately 120–200 mA typical (expected) |
| Data retention | Usage history in on-board flash, CSV export (firmware) |
Project features
- [Interrupt-based flow measurement] The ESP32 counts YF-S201 pulses through a hardware interrupt and converts pulse frequency to L/min with the datasheet relation — 7.5 Hz per 1 L/min, 450 pulses per litre nominal — giving a genuine instrument reading rather than a guess.
- [Leak detection logic] A leak alert fires when low flow persists through the configurable no-usage window or when daily usage crosses a configurable baseline; thresholds are adjustable in firmware for different homes and hostels.
- [Live OLED readout] The 0.96-inch I2C OLED at the device shows the current flow rate, the running total and any active leak-alert text, so the meter is useful even with no phone or network nearby.
- [ESP32-hosted usage dashboard] A web dashboard served directly by the ESP32 over Wi-Fi shows the live flow gauge, daily and monthly usage bars and the leak-alert log — no cloud account, app install or internet needed for core use.
- [Usage logging to flash] Flow totals are stored in the ESP32's on-board flash and survive power cycles; the history is exportable as CSV for the project report and viva graphs.
- [On-device leak alert] A buzzer and LED signal a detected leak locally at the installation, independent of the dashboard or network.
- [Calibration factor] A single multiplier constant in the firmware trims the pulse-to-litre conversion to the actual installed pipe run, since the datasheet's ±10% figure assumes ideal straight pipe runs.
- [OPTIONAL ADD-ON — not in the base build: solenoid auto-shutoff] A relay-driven 12 V solenoid valve that closes the line automatically when a leak is confirmed. This is an optional customization, priced and built separately — the base project detects and alerts; it does not shut off water by itself.
What is included
- Working prototype: ESP32 + YF-S201 sensor + OLED on a demo pipe loop
- Complete firmware source code (pulse counting, leak logic, OLED, web dashboard)
- Wiring diagram and connection table
- Component list with exact part names
- Calibration procedure for trimming the pulse-to-litre factor
- Project report PDF (background, theory, methodology, results, limitations)
- PPT presentation for final review
- Viva Q&A preparation document (hall effect, interrupts, flow conversion, leak logic, ESP32 Wi-Fi)
Limitations & prerequisites
- The YF-S201 is an indicative instrument, not a certified billing meter: ±10% accuracy per datasheet, and real accuracy depends on straight pipe runs before and after the sensor, mounting orientation and water pressure.
- Readings below about 1 L/min fall outside the sensor's working range (datasheet 1–30 L/min); very slow drips may not register.
- The base build detects and alerts — it does not shut off water. Auto-shutoff needs the optional solenoid valve add-on.
- The dashboard is served by the ESP32 on the local Wi-Fi network; remote access from outside the home network needs a cloud or VPN layer (future scope).
- Leak detection is rule-based (flow pattern), not a second physical sensor — it flags suspicious flow, it cannot locate the leak.
Frequently Asked Questions
Is this project suitable for a final-year project?
Yes — for Electronics, E&TC, Electrical and IoT programs. It demonstrates a real sensor instrument (hall effect, interrupts, datasheet-based conversion), embedded firmware, rule-based anomaly detection and a working web dashboard, with honest accuracy limits that make strong viva material during the final review.
Which controller and sensor are used?
An ESP32 development board and a YF-S201 hall-effect water flow sensor. The YF-S201's datasheet specifies a 1–30 L/min range, ±10% accuracy and the conversion relation Flow (L/min) = Frequency (Hz) / 7.5 — the firmware implements exactly this relation with no deviation.
How does the leak detection actually work?
The firmware watches the measured flow pattern, not a second sensor. If flow continues through the configured no-usage window (typically night hours) or daily usage crosses a set baseline, it raises a leak alert on the OLED, buzzer and dashboard. Thresholds are configurable.
Does the dashboard need the internet?
No. The dashboard is a web page served directly by the ESP32 over the local Wi-Fi network — a phone or laptop on the same network opens it in a browser. Cloud backup or remote alerts from outside the home are optional future scope.
Is automatic water shutoff included?
No — the base project detects and alerts only. A relay-driven solenoid valve that closes the line on a confirmed leak is available as a clearly-priced optional add-on; it is not described anywhere as part of the base build or included in the base price.
What are the main limitations?
The sensor is accurate to ±10% per its datasheet and needs straight pipe runs for best results; flows below about 1 L/min are outside its range; the meter is indicative, not a certified billing meter; and the dashboard is local-network only.
Components & software requirements
- ESP32 (dual-core, Wi-Fi) programmed in C++ via Arduino IDE
- YF-S201 hall-effect water flow sensor, 1/2-inch fittings (datasheet: 1–30 L/min, ±10% accuracy)
- 0.96-inch OLED display, 128×64, I2C
- ESP32-hosted HTTP web server + HTML/CSS/JavaScript dashboard
- SPIFFS on-board flash logging with CSV export
- 5 V DC power; buzzer + LED for local alerts
- Arduino IDE with ESP32 board package; SSD1306 OLED and Wi-Fi/web-server libraries; any browser for the dashboard
- Demo-loop hardware: breadboard or perfboard, jumper wires, 5 V DC supply (USB or adapter), short pipe stubs / vinyl tubing and clamps, active buzzer module and LED
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.
Download free synopsis (PDF)
Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.