The problem
A touchless water tap with usage tracking and leak alerts opens itself when it senses a hand and closes when the hand leaves. It is built around an ESP32 microcontroller, an E18-D80NK infrared sensor under the spout, a 12 V DC normally-closed solenoid valve in the supply pipe, and a YF-S201 flow sensor that counts the water dispensed. Shared taps in colleges, hostels, offices and washrooms are touched by hundreds of hands daily, spreading germs, and are left running, wasting water nobody measures. A manual tap gives a building no record of how much water each washbasin uses, so a slow leak or a valve left open can run unnoticed for hours. This project answers it with actuation first: the sensor, not the user, controls the valve, the flow sensor turns each use into a logged volume, and the dashboard flags continuous flow as a leak. The result is a hygienic tap that makes water use visible.
A hand under the spout reflects infrared light to the sensor.
Follow the working sequence
How it works
The touchless water tap works as a short loop: hand detected, valve opens, flow measured, valve closes, usage logged. When a hand enters the infrared sensor's detection zone, the E18-D80NK pulls its digital output low and the ESP32 energises the solenoid valve through a relay driver, opening the water path to the tap. Water flows through the YF-S201 sensor, whose internal rotor spins a Hall-effect pickup that emits 450 pulses per litre, and the ESP32 counts those pulses to work out the flow rate and the volume of the current use. The valve stays open only while the hand is present and never longer than the 10-second auto shut-off, after which the ESP32 de-energises the solenoid and the spring-loaded valve snaps shut. Each finished use is written to the usage log with its duration and volume, the dashboard totals are updated, and the leak check runs: flow continuing past 60 seconds with no hand raises an alert.
- The E18-D80NK infrared sensor continuously watches the space under the spout; a hand within the trimmed detection range reflects modulated infrared light back to the receiver and the sensor output changes state.
- The ESP32 reads the sensor output and energises the 12 V DC solenoid valve through a relay driver, opening the water path to the tap.
- Water flows through the YF-S201 flow sensor, which emits 450 pulses per litre (datasheet value); the ESP32 counts pulses to measure flow rate in L/min and volume in litres.
- The valve stays open only while the hand is present; removing the hand, or reaching the 10-second auto shut-off (design target), de-energises the solenoid and the valve snaps shut.
- Each finished use is logged with its start time, duration in seconds and volume in litres, and the dashboard updates the daily total and the hourly usage chart.
- The leak check runs on every flow reading: continuous flow longer than 60 seconds with no hand detected raises a leak alert on the dashboard and forces the valve closed.
- The ESP32 serves the dashboard over Wi-Fi, so usage totals, the hourly chart and the leak status can be viewed from any phone or laptop on the same network.
Tech stack:
- ESP32 development board, Arduino IDE
- E18-D80NK infrared proximity sensor
- 12 V DC normally-closed solenoid valve
- YF-S201 Hall-effect flow sensor
- Relay driver module
- Wi-Fi with on-board HTTP web server
- HTML, CSS and JavaScript dashboard
- 12 V DC, 2 A power adapter
| Parameter | Value |
|---|---|
| Controller | ESP32 development board, dual-core Xtensa LX6 up to 240 MHz, 3.3 V logic (datasheet value) |
| Hand sensor | E18-D80NK infrared proximity sensor, 3–80 cm adjustable detection range (datasheet value) |
| Detection range in build | Approximately 8–12 cm (design choice, set by trimmer) |
| Valve | 12 V DC normally-closed solenoid valve, 1/2-inch ports (design choice) |
| Flow sensor | YF-S201 Hall-effect flow sensor, 450 pulses per litre, 1–30 L/min range (datasheet value) |
| Flow accuracy | Approximately ±10% (datasheet value; calibration against a known volume improves it) |
| Auto shut-off | 10 s per use (design target, adjustable in firmware) |
| Leak rule | Continuous flow longer than 60 s with no hand detected (design target) |
| Connectivity | Wi-Fi 2.4 GHz, 802.11 b/g/n, on-board web dashboard (datasheet value) |
| Power | 12 V DC, 2 A adapter for valve and board (design choice) |
| Dashboard | Daily total, current flow, hourly chart, per-use log and leak alerts in a browser |
Project features
The touchless water tap combines four capabilities that set it apart from a sensor tap: hands-free actuation, per-use water measurement, a usage dashboard, and automatic leak alerts. The E18-D80NK infrared sensor watches the space under the spout and the ESP32 opens the 12 V DC solenoid valve within milliseconds of detecting a hand, then closes it the moment the hand leaves or a 10-second timeout is reached, so water never runs unattended. While the valve is open, the YF-S201 flow sensor counts pulses — 450 pulses per litre by datasheet — and the ESP32 converts them into a volume for that single use, building a daily total and an hourly usage chart on the dashboard. The same flow reading powers the leak logic: if water keeps flowing for more than 60 seconds with no hand detected, the dashboard raises a leak alert and forces the valve closed. Together these make the tap hygienic, measurable and self-protecting in one build.
- [Touchless hand detection] The E18-D80NK infrared sensor detects a hand under the spout and signals the ESP32 with a digital output — no touch, no button, no handle. Detection range is adjustable from 3–80 cm (datasheet value) and is trimmed to approximately 8–12 cm in the build so the basin itself never triggers the tap.
- [Solenoid valve actuation with auto shut-off] The ESP32 energises a 12 V DC normally-closed solenoid valve through a relay driver to open the water path, and closes it the instant the hand leaves or a 10-second timeout is reached (design target, adjustable in firmware).
- [Per-use water measurement] The YF-S201 flow sensor counts 450 pulses per litre (datasheet value); the ESP32 converts the pulse count into the volume of each individual use and keeps a running daily total.
- [Live usage dashboard] A small web dashboard served by the ESP32 shows water used today, current flow rate, the last use, an hourly usage chart and a log of recent uses with duration, volume and status.
- [Continuous-flow leak alerts] If water flows for more than 60 seconds with no hand detected (design target), the dashboard raises a leak alert and forces the valve closed, so a stuck valve or an open tap cannot run unnoticed.
- [Fail-closed safety] The valve is normally closed, so a power cut shuts the water off instead of leaving it running — the tap fails safe by design.
- [Adjustable range and timeout] Detection range and shut-off time are set with the sensor trimmer and a firmware constant, so the same build can be tuned for a washbasin, a kitchen sink or a public washroom.
What is included
- Working prototype: tap assembly, IR sensor, solenoid valve, YF-S201 flow sensor, ESP32 board and wiring
- Firmware source code with comments (Arduino IDE)
- Usage dashboard web app (single-file HTML, CSS and JavaScript)
- Circuit and wiring diagram
- Component list with part numbers
- Project abstract PDF
- Project report, PPT presentation and viva Q&A preparation document
- Setup guidance and demonstration support over WhatsApp after delivery
Limitations & prerequisites
- Infrared detection depends on surface reflectivity: dark or matte hands may need to come closer than the set range, so the sensor must be calibrated at installation.
- The YF-S201 measures with approximately ±10% accuracy (datasheet value) — it is a usage indicator, not billing-grade metering, and needs calibration against a known volume for best results.
- The solenoid valve needs a minimum water pressure of approximately 0.02 MPa (design choice) to open reliably; a very low-pressure supply may not actuate it.
- The Wi-Fi dashboard needs a 2.4 GHz network; the tap still dispenses offline, but usage is only visible on the dashboard while connected.
- Rapid valve closure can cause a pressure knock (water hammer) in rigid pipes — a short flexible hose section is recommended in the build (builder note).
- Builder note from the build: the sensor can false-trigger on the shiny basin surface if aimed too low, so it is angled slightly upward and the range trimmed to approximately 8–12 cm; the basin then sits outside the detection zone and never trips the valve.
- The prototype is not certified for permanent mains plumbing — a plumber should check the fittings before it is installed as a fixed tap.
Frequently Asked Questions
Is this project suitable for a final-year project?
Yes — for IoT & Embedded, Electronics and Electrical Engineering programs. It demonstrates infrared sensing, solenoid actuation, flow measurement with pulse counting, ESP32 firmware and a live web dashboard in one working prototype, and the usage log plus leak logic give plenty of material for the report and the demonstration.
How is this different from a smart water flow meter project?
A flow meter only measures water passing through a pipe and reports it. This project controls dispensing at the tap: the infrared sensor and solenoid valve decide when water flows at all, and the flow sensor exists to measure each use and catch leaks. Actuation is the core here; measurement and alerts are built around it, so the demonstration, the code and the report are all different.
What happens if the power fails while the tap is running?
The tap stops safely: the solenoid valve is normally closed, so cutting power de-energises it and its spring shuts the water off immediately, leaving no state in which a power failure keeps water running. When power returns, the ESP32 restarts into the closed-valve state, so the tap stays off until a hand is detected again.
Does the tap need Wi-Fi to work?
No — hand detection, valve actuation, the 10-second auto shut-off and the leak check all run on the ESP32 itself, so the tap dispenses normally with no network at all. Wi-Fi is only needed to view the usage dashboard and the leak alerts from a phone or laptop on the same network.
Can the leak alert threshold be changed?
Yes — the 60-second continuous-flow rule is a single firmware constant, and the detection range is set with the trimmer screw on the E18-D80NK sensor. Both can be tuned for the installation without rewiring: a shorter threshold suits a public washroom, a longer one suits slow filling, and the change is documented in the report.
What will I receive with the project?
The working prototype with tap, sensor, solenoid valve, flow sensor and ESP32 board, the firmware source code, the dashboard web app, circuit and wiring diagrams, the component list, the abstract PDF, and the report, PPT and viva Q&A documents. Setup guidance and demonstration support over WhatsApp are included after delivery.
Components & software requirements
- ESP32 development board, Arduino IDE
- E18-D80NK infrared proximity sensor
- 12 V DC normally-closed solenoid valve
- YF-S201 Hall-effect flow sensor
- Relay driver module
- Wi-Fi with on-board HTTP web server
- HTML, CSS and JavaScript dashboard
- 12 V DC, 2 A power adapter
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 WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.