Automatic Water Tap in 5 Easy Steps | Fun Arduino STEM Project
Smart Flow: Build Your Own Automatic Water Tap Using an IR Sensor
Imagine washing your hands without touching a tap! Automatic water taps are commonly used in hospitals, shopping malls, airports, and smart homes to improve hygiene and reduce water wastage.
In this hands-on STEM activity, you’ll build an Automatic Water Tap using an Arduino Uno, an IR sensor, a relay module, and a mini water pump. The IR sensor detects a hand, and the Arduino activates the relay to turn on the water pump, allowing water to flow automatically. This project is a fun way to learn about sensors, automation, and embedded systems while creating a useful real-world solution
Learning Objectives
By completing this project:
- Understand how an IR sensor detects nearby objects.
- Learn the basics of embedded systems and automation.
- Explore how sensors, controllers, and actuators work together.
- Develop logical thinking and problem-solving skills.
- Gain hands-on experience with Arduino programming.
Materials Required for Automatic Water Tap
- Arduino Uno
- IR Obstacle Sensor Module
- 5V Relay Module
- Mini DC Water Pump (5V)
- Plastic Tube
- Water Container or Bottle
- Breadboard
- Jumper Wires
- USB Cable
- Laptop with Arduino IDE installed
- Glue or tape
- Cardboard or PVC Pipe (for the tap model)
- Scissors/Craft Knife (adult supervision required)
Step-by-Step Instructions to build Automatic Water Tap
Step 1: Build the Water Tap Model
Create a simple tap model using cardboard or PVC pipe. Connect the plastic tube to the mini water pump and place the pump inside the water container. Fix the tube so that water flows through the tap model.
Step 2: Connect the Components
Connect the IR Sensor
- VCC → 5V
- GND → GND
- OUT → Digital Pin 2
Connect the Relay Module
- VCC → 5V
- GND → GND
- IN → Digital Pin 8
Connect the Water Pump
- Connect the pump to the Normally Open (NO) and Common (COM) terminals of the relay.
- Connect an external 5V power supply to operate the water pump.
Double-check all wiring before powering the Arduino.
Arduino Program
| const int irSensor = 2;
const int relayPin = 8; void setup() { pinMode(irSensor, INPUT); pinMode(relayPin, OUTPUT); digitalWrite(relayPin, HIGH); // Relay OFF Serial.begin(9600); } void loop() { int sensorValue = digitalRead(irSensor); if(sensorValue == LOW) // Object detected { digitalWrite(relayPin, LOW); // Pump ON Serial.println(“Water ON”); } else { digitalWrite(relayPin, HIGH); // Pump OFF Serial.println(“Water OFF”); } delay(100); } |
Step 3: Upload the Program
Open the Arduino IDE and upload the program that reads the IR sensor and controls the relay module.
The logic is simple:
- Wait for a hand to come near the sensor.
- If a hand is detected, switch ON the relay.
- The relay powers the water pump.
- Water flows through the tap.
- When the hand is removed, the relay switches OFF and the pump stops.
Step 4: Test Your Project
- Upload the program to the Arduino.
- Place your hand close to the IR sensor.
- The relay should switch ON.
- The water pump should start pumping water.
- Remove your hand.
- The relay switches OFF and the water flow stops.
Step 5: Improve Your Design
Try these ideas:
- Decorate the tap model.
- Adjust the sensing distance using the IR sensor’s potentiometer.
- Add an LED that glows while the pump is running.
- Use a larger water container.
- Build a stronger stand for the tap.
How Does It Work?
The IR sensor continuously emits infrared light. When a hand comes close to the sensor, the infrared light reflects back to the receiver. The sensor detects this reflection and sends a signal to the Arduino.
The Arduino then activates the relay module, which acts like an electronic switch. The relay turns ON the water pump, allowing water to flow through the tube. When the hand is removed, the relay turns OFF, stopping the pump and the water flow.
This project demonstrates how sensors detect objects, the Arduino processes information, the relay controls electrical devices, and the water pump performs the action.
Why Is This Project Special?
This project combines electronics, programming, and engineering into one hands-on STEM activity. It helps students understand automation while building a working model that promotes hygiene and water conservation.
Students also learn about technologies used in:
- Smart homes
- Hospitals
- Shopping malls
- Public washrooms
- Automatic water-saving systems
Safety Tips
- Check all wiring before powering the Arduino.
- Keep water away from the Arduino, relay module, and breadboard.
- Use a separate power supply for the water pump if required.
- Disconnect the power before changing any wiring.
- Ask an adult for help while assembling the model.
- Keep the workspace clean and dry.
Variations of Automatic Water Tap to Try
- Add an LED to indicate when the pump is ON.
- Add a buzzer when the tap is activated.
- Display “Wash Your Hands” on a 16×2 LCD.
- Replace the Arduino Uno with an ESP32 for Wi-Fi control.
- Add a water level sensor to monitor the water tank.
Real-World Applications of Automatic Water Tap
Automatic water taps are commonly used in:
- Hospitals
- Airports
- Shopping malls
- Hotels
- Restaurants
- Schools
- Smart homes
- Public washrooms
These systems improve hygiene, reduce water wastage, and provide a touch-free experience.
Conclusion
Building an automatic water tap using an IR sensor, relay module, and water pump is a fun and practical STEM project. It introduces students to sensors, Arduino programming, relays, and automation while encouraging creativity and problem-solving. This project also demonstrates how simple technology can improve hygiene and conserve water in everyday life.
Frequently Asked Questions (FAQ)
- What is an IR sensor?
An IR (Infrared) sensor detects nearby objects by transmitting infrared light and sensing its reflection. - Why is a relay module used?
A relay acts as an electronic switch, allowing the Arduino to safely control the water pump. - Why is a water pump used instead of a servo motor?
The water pump moves water through the tube automatically, making it suitable for a touch-free tap system. - Can this project be built using an ESP32?
Yes. The ESP32 can also be used and provides additional features such as Wi-Fi and Bluetooth. - How can this project be improved?
You can add an LCD display, buzzer, LED indicator, water level sensor, or Wi-Fi control to make it more advanced.

















