1. Introduction
Touchless automation systems are becoming increasingly important in modern environments such as hospitals, schools, and public places. One simple and useful automation project is an IR-based automatic water tap system.
In this project, an IR sensor detects the presence of a hand placed near the tap. When the sensor detects the hand, it sends a signal to the Arduino, which activates a relay module. The relay then turns ON a water pump or solenoid valve, allowing water to flow automatically. When the hand is removed, the system turns OFF the water supply.
This project is simple to build and is very useful for learning Arduino automation and sensor interfacing.
2. Components
-
Arduino UNO
-
IR Sensor Module
-
Relay Module
-
Mini Water Pump / Solenoid Valve (Any one required)
-
Jumper Wires
-
Breadboard
-
External Power Supply
3. Circuit and Connections
Pump Connection
-
Pump positive → Relay NO terminal
-
Pump negative → Power supply negative
-
Relay COM → Power supply positive
4. Circuit Working
The IR sensor continuously emits infrared light and monitors reflections from nearby objects.
-
When a hand is placed near the sensor, the IR light reflects back to the receiver.
-
The IR module sends a digital signal to Arduino pin 2.
-
Arduino processes the signal and activates pin 8, which is connected to the relay module.
-
The relay switches ON the water pump or solenoid valve.
-
When the hand is removed, the sensor output changes and the pump turns OFF automatically.
This creates a touchless water dispensing system.
5. Code
int sensorPin = 2;
int relayPin = 8;
void setup()
{
pinMode(sensorPin, INPUT);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH);
}
void loop()
{
int sensorValue = digitalRead(sensorPin);
if(sensorValue == LOW)
{
digitalWrite(relayPin, LOW);
}
else
{
digitalWrite(relayPin, HIGH);
}
}
6. Code Working
-
sensorPin reads the signal from the IR sensor.
-
relayPin controls the relay module.
In the loop:
-
If the IR sensor detects a hand, the sensor output becomes LOW.
-
Arduino activates the relay by setting relayPin LOW.
-
The relay switches ON the water pump.
If no object is detected:
-
Arduino sets relayPin HIGH.
-
The pump turns OFF.
7. Tips
-
Adjust the sensitivity potentiometer on the IR module for proper detection.
-
Keep the sensor away from direct sunlight to avoid false detection.
-
Use a separate power supply if the pump requires more current.
-
Ensure proper relay wiring for safe operation.
We can use solenoid valve also
8. Uses
-
Automatic wash basin systems
-
Touchless water dispensers
-
Smart home automation
-
Public hygiene systems
-
School and Hospital washrooms
9. Conclusion
The IR-based automatic water tap system using Arduino is a simple and practical automation project. It demonstrates how sensors and microcontrollers can be used to create touchless control systems. Such projects are very useful for beginners learning Arduino programming and automation techniques.