What this system does
An automatic tap water system starts the water pump the moment a hand comes near the tap, and stops it the moment the hand moves away. There is no microcontroller in the loop and no code to write: an infrared sensor watches for the hand, and a relay module does the switching.
Systems like this are used in homes, schools, offices and hospitals wherever touch-free water matters — for hygiene, for saving water, and for convenience. The version described here runs on a single 3.7V lithium-ion cell, so it is fully portable and easy to demonstrate.

Working principle
The system has three stages: sense, switch, pump.

1. Sense — the IR sensor. The infrared sensor module emits invisible IR light from its transmitter LED and looks for a reflection with its receiver. With nothing in front of it, the reflected light is weak and the module’s OUT pin stays in its idle state. When a hand comes within a few centimetres, the reflected IR becomes strong enough to cross the module’s threshold, and OUT changes state. A small potentiometer on the module sets that threshold — in other words, it sets the detection distance.
2. Switch — the relay module. The sensor’s OUT pin is wired to the IN pin of a 1-channel 5V relay module. When OUT changes state, the relay’s coil energises and its contacts close. The relay is doing the heavy work here: the sensor’s signal is tiny, but the relay can switch the full pump current. The module’s screw terminals are marked NO (Normally Open), COM (Common) and NC (Normally Closed). The pump is wired to NO, so it only receives power while the relay is energised.
3. Pump — the load. The 5V DC submersible pump sits in the water container. While the relay contacts are closed, battery power flows through the relay to the pump and water is pushed through the silicone pipe to the tap. When the hand moves away, the sensor output returns to idle, the relay opens, and the pump stops.
Components
- IR sensor module (infrared obstacle-avoidance type, 3 pins: VCC, GND, OUT)
- 1-channel relay module, 5V (with optocoupler isolation; screw terminals NO / COM / NC)
- Mini 5V DC submersible water pump
- Silicone pipe for the pump outlet
- 18650 lithium-ion cell, 3.7V, with a single-cell holder
- ON/OFF rocker switch
- Jumper wires
Circuit connections
The whole circuit runs on one 3.7V cell. The red wires carry the positive supply, the black wires are the common ground, and the blue wires carry the signals.
| From | To | Wire |
|---|---|---|
| Battery + | ON/OFF switch → relay COM | Red |
| Battery + | IR sensor VCC, relay module VCC | Red |
| Battery − | IR sensor GND, relay module GND, pump − | Black |
| IR sensor OUT | Relay module IN | Blue |
| Relay NO | Water pump + | Blue |
| Water pump − | Battery − | Black |
A note on the relay terminals: COM is the moving contact. With the relay off, COM is connected to NC and disconnected from NO. When the relay energises, COM moves to NO. That is why the pump must be wired to NO — wired to NC, it would run all the time and stop when a hand appears, which is the opposite of what is wanted.
Building it, step by step
Step 1: Power first
Fit the 18650 cell in its holder. Take the + wire through the ON/OFF switch — the switch is the master control for the whole system — and take the − wire to the common ground (sensor GND, relay GND and pump −). Leave the switch off while wiring the rest.
Step 2: Wire the sensor
Connect the sensor’s VCC to + (red), GND to − (black) and OUT to the relay IN (blue). Switch the system on briefly: the sensor’s power LED should light. If it does not, the VCC/GND pair is the first thing to check.
Step 3: Wire the relay
Connect the relay module’s VCC to + (red), GND to − (black) and IN to the sensor OUT (blue). On the screw terminals, connect COM to the + wire coming from the switch and NO to the pump + (blue).
Step 4: Wire the pump
Connect the pump’s + wire to relay NO and its − wire to battery −. Fit the silicone pipe on the pump outlet and place the pump in the water container, with the pipe end positioned over the basin.
Step 5: Test and calibrate
Switch on and hold a hand 5–10 cm in front of the sensor. You should hear the relay click and see the pump start. Remove the hand and the pump should stop within about a second.
If the behaviour is wrong, adjust the potentiometer on the sensor module with a small screwdriver: one direction increases the detection range, the other decreases it. Calibrate until the pump starts reliably at hand distance and stays off otherwise.
Design notes
- Why a relay at all? The sensor output cannot drive a pump directly — the pump draws far more current than the sensor can supply. The relay separates the low-power sensing side from the higher-power pump side, and the module’s optocoupler adds isolation between them.
- Why 3.7V? A single 18650 cell is enough for the sensor, the relay coil and the small pump, and it keeps the system portable for demonstrations. For a permanent installation, a regulated 5V adapter is the better choice.
- Sunlight matters. IR sensors respond to strong ambient infrared, so direct sunlight can false-trigger the system. Indoors, away from windows and shiny surfaces, the system is stable.
- Water and electronics do not mix. Keep the battery, sensor and relay dry and above the water line. Only the pump and the pipe go in or near the water.
Troubleshooting
- Nothing powers up: check the cell (a full 18650 reads ~4.2V, an empty one ~3.0V), the holder contacts and the switch.
- Sensor LED on, relay never clicks: the OUT → IN wire is loose, or the sensitivity is set too low. Check the blue wire and turn the potentiometer.
- Relay clicks, pump does not run: the pump is wired to NC instead of NO, or the pump − wire is not on battery −. Move the pump + wire to NO.
- Pump runs continuously: the sensor is over-sensitive or facing a reflective surface or sunlight. Reduce the sensitivity and reposition the sensor.
- Weak water flow: the cell is low, or the pipe is kinked or blocked. Charge the cell and check the pipe.
Where this is used
Touch-free water systems appear in washbasins, school labs, clinics, offices and public places. For students, the same circuit is a strong final-year project base: add a water-level sensor in the tank, a second IR sensor, or a small display showing pump status, and the project has a complete, demonstrable story.
Need this built for you?
Smart Circuit Hub builds custom Arduino, IoT and automation systems in Lahore — for homes, schools and final-year engineering projects. If you want this tap water system built, installed, or extended with extra features, get in touch:
- Email: smartcircuithub26@gmail.com
- Phone/WhatsApp: +92-336-4459320
- Address: Lahore, Pakistan
- Website: https://smartcircuithub.com
Parts for this project are available from our store. A detailed step-by-step build guide is also available.
Want a ready-made system? Contact us — Smart Circuit Hub can build the complete automatic tap water system for you. Components are also available — order the parts from our store.
FAQs
Does this system need an Arduino or any code?
No. The sensor output drives the relay directly. There is no microcontroller and nothing to program.
What powers the sensor and relay?
The same 3.7V cell. Its + line (through the switch) feeds the relay COM and the VCC pins of both modules; its − line is the common ground for the sensor, relay and pump.
How far away does the sensor detect a hand?
Typically 5–10 cm after calibration. The onboard potentiometer adjusts the range.
Why must the pump be wired to NO and not NC?
NO (Normally Open) only connects to COM when the relay is energised — that is, only when a hand is detected. Wired to NC, the pump would run when no hand is present and stop when one appears.
Can I run it from a 5V adapter instead of a battery?
Yes. A regulated 5V DC adapter is better for permanent use; the battery is best for portable demonstrations.
Can this be extended for a final-year project?
Yes. Common extensions are a tank water-level sensor with automatic refill, a second sensor, a flow display, or a mobile notification when the tank is low.
