Automatic Wash Dispenser | Arduino Project Tutorial

Wave, dispense, done. In this Automatic Wash Dispenser, your hand becomes the button: an IR sensor detects motion and a servo presses the pump for a clean, measured shot of soap. 💦🧼 No touching, no mess, and fewer germs on shared surfaces.

Unlike store-bought units with proprietary refills, this DIY dispenser lets you keep the bottle you already use. You’ll tune the press strength and time yourself, so it works with liquid or foam pumps. The whole system runs on batteries and fits under or beside any sink.

We’ll keep it simple and robust: an Arduino reads the sensor, debounces the signal, then drives a high-torque servo with a safe cooldown so it won’t double-dispense while your hand is still nearby.

Why Build Automatic Wash Dispenser?

It supports better hygiene with less effort. Touch-free dispensing reduces cross-contamination at sinks and counters, which is especially valuable in classrooms, kitchens, and customer areas.

Second, it’s portable and independent. Running on simple batteries and a small controller, the unit fits anywhere—no mains wiring, no plumbing changes, and no app required for day-to-day use.

Third, it’s cost-smart and repairable. Standard parts, a 3D-printed frame, and off-the-shelf bottles keep long-term costs low. If something wears out, you can replace a component instead of the whole device.

What You’ll Learn

By building this Hand Wash Dispenser, you’ll:

  • You’ll see how sensing leads to action: detect presence, confirm, and deliver exactly one dose. That loop—sense → decide → act—underpins many practical automation projects.
  • You’ll explore human-centered behavior such as debounce, dwell time, and anti-double-dispense so the machine feels predictable and safe around splashes and busy hands.
  • You’ll gain insight into mechanism design: translating a small servo’s rotation into a straight push on a pump or valve, choosing materials that survive moisture, and planning clearances for bottles and refills.
See also  Arduino TFT Bubble Welcome Screen 3.5

What You’ll Need:

Circuit Diagram

  • 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.

Sample 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);
  }
}

How It Works?

In Hand Wash Dispenser, the IR proximity sensor watches the area in front of the spout. When a hand enters that zone for a brief moment, the controller treats it as a valid request and ignores tiny flickers from reflections or passing objects.

The controller then triggers a 270-degree gear servo that drives a short linkage or arm. That motion presses a pump head or opens a small valve for a fixed time, producing a consistent dose and then releasing smoothly so the mechanism resets.

Power comes from a battery pack sized for weeks of typical use. The electronics idle at very low current between activations, and the firmware enforces a cool-down window to prevent accidental double shots while the user moves away.

See also  Understanding the Arduino Sketch Build Process

Applications & Extension

Everyday hygiene: kitchens, bathrooms, clinic exam rooms, school sinks, and shop counters—anywhere a lot of hands meet a single pump. Touch-free operation keeps the station cleaner and more inviting.

Operations add-ons: add a Hand Wash Dispenser timer ring (LED or beeper) to coach the 20-second scrub, a low-soap indicator window, or a simple counter that logs activations for facility teams.

Future upgrades: swap to a rechargeable pack, seal the enclosure for splash resistance, tune dose time for liquid vs. foam soaps, or add wireless reporting (ESP-based) for refill alerts without changing the basic user experience.

📹 Watch the Full Demo Video

Here’s the Automatic Wash Dispenser in action