This Automatic Hand Wash Dispenser makes hand washing easy, touch-free, and cleaner for the environment. It uses an IR Proximity Sensor to detect your hand instantly, so there’s no need to press any button. This helps reduce cross-contamination and waste. Making it perfect for homes, offices, and shops that want to stay hygienic and eco-conscious.
It runs on a Nano Arduino for smart, energy-efficient control and uses 6 AA batteries for portable power. The MG996 270-degree iron gear servo motor delivers reliable, smooth motion every time, built to last even with daily use. This durable design means less electronic waste over time and fewer replacements.
Simple but effective, this dispenser lowers contact with shared surfaces and supports better hygiene habits. It’s easy to refill, maintain, and move wherever you need it—no cords required. For anyone wanting a DIY-friendly, cost-effective, and greener way to add a touch-free soap dispenser, this project is an excellent choice.
Components:

- IR Proximity Sensor
- Servo Motor Iron Gear
- Arduino Nano
- Alkaline Battery AA
- Battery Holder 6xAA
- USB Cable Micro B
- Jumper Wires
Connection:
- IR Proximity Sensor Module
- VCC → Nano 3.3
- GND → Nano GND
- OUT → Nano D2
- MG996 Servo Motor
- Signal (yellow/white) → Nano D9
- VCC (red) → Nano 5v
- GND (black/brown) → 6x AA Battery (–) and Nano GND
- Power
- Nano Arduino → Can be powered via USB or shared from the battery pack (optional)
Tip:
- Connect all grounds together (battery GND to Nano GND) for a common ground.
Code:
#include <Servo.h>
Servo myServo;
int sensorPin = 2; // IR sensor OUT pin
int sensorState = 0;
void setup() {
myServo.attach(9); // Servo signal pin to D9
pinMode(sensorPin, INPUT);
myServo.write(0); // Initial position
}
void loop() {
sensorState = digitalRead(sensorPin);
if (sensorState == LOW) { // LOW kapag may object (depende sa sensor mo)
myServo.write(180); // Aangat to 90°
delay(1000); // Stay for 1 second
myServo.write(0); // Babalik sa 0°
delay(1000);
}
}