The problem
A ten-minute shower uses roughly 80–100 litres of water, yet nobody standing under one has any idea how much is going down the drain — there is no feedback, so there is no behavior change. Commercial smart showers are luxury fixtures costing tens of thousands of rupees. This project brings the same feedback loop to an ordinary bathroom line for the price of student-grade parts: a YF-S201 flow sensor in the pipe measures actual flow, an ESP32 integrates it into litres and tracks elapsed time, and an OLED shows both numbers live with a progress bar against the chosen budget. Three preset buttons (quick 5 min / 40 L, normal 8 min / 70 L, long 12 min / 100 L) set the budget; when either limit is hit, the relay-driven solenoid valve closes the water line and the display shows the session total. A manual override reopens the valve, and the last-session total stays on screen as a gentle nudge.
How it works
- The user presses a preset button; the ESP32 starts the session timer and opens the solenoid valve.
- The YF-S201 emits pulses proportional to flow; firmware counts them on an interrupt pin and converts to litres using the sensor's pulses-per-litre constant.
- Every 500 ms the OLED refreshes: elapsed time, litres used, live flow rate and a progress bar against the tighter of the two budgets.
- At 30 seconds (or 10 litres) before the limit, the buzzer warns; at the limit the relay de-energizes and the solenoid closes the water line.
- The session total stays on screen, is written to flash memory, and the manual override button grants a 2-minute extension if pressed.
- Background leak-watch runs always: unexpected flow outside a session triggers valve closure and a leak flag.
Tech stack:
- ESP32 dev board
- YF-S201 flow sensor (hall-effect)
- 12 V solenoid valve · 5 V relay module
- 0.96 inch OLED display (I2C)
- Waterproof pushbuttons · piezo buzzer
- Arduino IDE · C/C++ firmware
| Parameter | Value |
|---|---|
| Flow sensor | YF-S201, approx. 450 pulses/litre (datasheet) |
| Flow range | Approximately 1–30 L/min (sensor datasheet) |
| Presets | 5 min/40 L · 8 min/70 L · 12 min/100 L (configurable) |
| Display refresh | Approximately 2 Hz (design target) |
| Session memory | Last 20 sessions in flash |
| Valve | 12 V DC normally-closed solenoid, relay driven |
| Override | 2-minute manual extension per press |
| Supply | 12 V DC 2 A adapter (valve + logic) |
Project features
- [Live flow measurement] YF-S201 hall-effect flow sensor (datasheet approx. 450 pulses/litre) gives real litres-per-minute, not an estimate — the display counts actual water used.
- [Dual-limit shutoff] Session ends when EITHER the time or the volume budget is reached; a 12 V solenoid valve closes the line through an optoisolated relay, with a 30-second warning beep first.
- [Three one-button presets] Quick, normal and long shower presets set sensible time/volume budgets instantly; a custom mode allows keypad-free adjustment via long-press.
- [OLED session display] Live elapsed time, litres used, current flow rate and a budget progress bar, plus a session-total screen that lingers after shutoff.
- [Manual override] A waterproof pushbutton reopens the valve for 2 extra minutes when the shutoff catches someone mid-rinse — safety and comfort are not sacrificed for savings.
- [Session memory] The ESP32's flash stores the last 20 sessions (time, volume, preset) so weekly usage can be reviewed and demonstrated.
- [Leak guard] If flow is detected with no active session for over 60 seconds, the valve closes and the display flags a possible leak.
What is included
- Working smart shower timer prototype (flow sensor, solenoid valve, ESP32, OLED, buttons)
- Complete firmware source with presets, shutoff logic and leak guard
- Plumbing connection diagram and wiring documentation
- Flow-sensor calibration procedure (bucket-and-stopwatch method)
- Project report PDF (background, flow sensing theory, control logic, testing)
- PPT presentation for final review
- Viva Q&A preparation document (hall sensors, interrupts, relay driving, solenoid valves)
Limitations & prerequisites
- Flow accuracy follows the YF-S201's datasheet constant (approx. 450 pulses/litre); the report gives a buyer-run bucket calibration procedure instead of claiming a measured accuracy figure for the built unit.
- Designed for standard 1/2-inch residential lines at municipal pressure; high-pressure or very low-flow lines are outside the sensor's rated range.
- The solenoid valve needs continuous 12 V to stay open — a power cut mid-shower closes the valve (fail-safe) but ends the session.
- Installation touches the actual water line; fitting the sensor and valve must be done with proper plumbing seals and, where required, a plumber's help.
- Not a water purifier or heater — it measures and limits flow only.
Frequently Asked Questions
How does it measure water usage?
The YF-S201 has a tiny turbine with a magnet; each rotation pulses a hall sensor. Counting pulses per second gives flow rate, and integrating over the session gives total litres.
What happens when the limit is reached mid-shower?
You get a 30-second warning beep, then the solenoid closes. Pressing the override button reopens it for 2 minutes so nobody is stranded mid-rinse.
Can the presets be changed?
Yes — long-pressing a preset button enters adjust mode, and the new time/volume budget is saved to flash.
Does it need Wi-Fi or an app?
No. Everything runs locally on the ESP32 with physical buttons and the OLED — no cloud, no account, no phone needed.
Is it safe around water?
The logic side is low-voltage (5 V/12 V DC) with the relay optoisolated; the valve and buttons are the only wet-side parts, and the enclosure guidance in the docs keeps electronics dry.
Is this project suitable for a final-year project?
Yes — for Electronics and IoT & Embedded programs. It combines sensor interfacing, interrupt-driven measurement, actuator control and genuinely useful resource conservation. Suitable for B.E./B.Tech final-year projects in Electronics and IoT & Embedded.
Components & software requirements
- ESP32 dev board
- YF-S201 flow sensor (hall-effect)
- 12 V solenoid valve · 5 V relay module
- 0.96 inch OLED display (I2C)
- Waterproof pushbuttons · piezo buzzer
- Arduino IDE · C/C++ firmware
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.