Automatic Hand Sanitizer Dispenser
Arduino · IR Sensor · Servo Motor · EEE 372
A hardware project built for the Microprocessors & Microcontrollers Laboratory (EEE 372) course. An Arduino-driven automatic hand sanitizer that detects a hand with an IR sensor and dispenses sanitizer via a servo motor — no contact, no buttons, no manual pump.
Project Overview
This project was built as part of the Microprocessors & Microcontrollers Laboratory course (EEE 372). The goal was to apply the microcontroller concepts from the course to a real, working embedded system — a touchless hand sanitizer dispenser. When a hand enters the detection range of an IR sensor, the Arduino reads the sensor's digital output, confirms a valid hand presence, and drives a servo motor to press the dispenser pump for a fixed interval before returning to rest. The entire circuit is assembled on a breadboard with jumper wires, and the firmware runs on an Arduino board. The project combines sensor input, microcontroller logic, and mechanical actuation into a single self-contained device that improves on the manual pump it replaces — no physical contact means better hygiene in shared spaces.
Key Features
- Touchless hand detection via IR sensor — no physical contact required
- Arduino microcontroller reads sensor input and controls the dispenser
- Servo motor actuates the sanitizer pump for a fixed dispensing interval
- Entire circuit built on a breadboard with jumper wires
- Self-contained embedded system — sensor, controller, and actuator in one
- Built for the Microprocessors & Microcontrollers Laboratory (EEE 372)
Challenges & Solutions
The IR sensor occasionally triggered on nearby objects (chairs, passing people) rather than only on a hand placed directly in front of the nozzle — causing the pump to dispense when no one was there.
Added a short confirmation delay in the Arduino firmware: the sensor reading must stay valid for a brief window before the servo fires, filtering out transient or peripheral triggers.
The servo motor needed to press the pump with enough force and for the right duration — too little and nothing comes out, too much and it dispenses excess sanitizer or strains the motor.
Calibrated the servo's press angle and hold time empirically, then encoded both as fixed constants in the firmware so the dispense amount stays consistent every time.
Wiring the sensor, Arduino, and servo together on a breadboard without loose connections or cross-talk between the power and signal lines.
Kept signal wiring short and separated from power, used a common ground across all components, and tested each subsystem in isolation (sensor alone, then servo alone) before integrating them into a single working circuit.
Bridging the gap between the microcontroller theory taught in class and a physically working device — the code that looks right on paper can still fail when real-world sensor noise and motor load are involved.
Iteratively tested the firmware against the physical hardware, logging sensor readings during each run and adjusting thresholds and timing constants until the dispenser behaved reliably across many trials.
Project Info
- RoleHardware & Firmware Developer (Course Project — Solo)
- StatusCompleted / Live