Project Overview
The COVID-19 pandemic highlighted the critical importance of hygiene, specifically hand washing, in preventing the transmission of infectious diseases. This project presents a low-cost, effective solution: an Automatic Soap Dispenser powered by Arduino. By utilizing proximity sensing, this system allows users to dispense soap without touching the dispenser bottle, significantly reducing the risk of cross-contamination in shared environments.
The core concept is to use an ultrasonic sensor to monitor the space in front of the dispenser. When a user's hand is detected within a predefined range, a micro-servo motor is triggered to physically press the dispenser's pump, delivering a drop of soap.
Engineering & Working Principle
The system operates based on a continuous loop of distance measurement and conditional response:
- Proximity Sensing: The HC-SR04 Ultrasonic Sensor is the "eyes" of the project. It emits high-frequency sound waves and measures the time it takes for the echo to return after hitting an obstacle (the user's hand).
- Signal Processing: The Arduino UNO receives the pulse from the Echo pin of the HC-SR04. It calculates the distance using the speed of sound.
- Mechanical Actuation: If the calculated distance is less than a set threshold (e.g., 10 cm), the Arduino sends a Pulse Width Modulation (PWM) signal to the SG90 Micro-servo.
- Dispensing Mechanism: The SG90 servo is mounted such that its horn or an attached arm presses down on the soap bottle's nozzle. The servo rotates to a specific angle (e.g., 90 degrees) to push the pump and then returns to its idle position (e.g., 0 degrees) to wait for the next user.
Components Deep Dive
- Arduino UNO: Serves as the central microcontroller, handling timing for the ultrasonic sensor and control logic for the servo motor.
- HC-SR04 Ultrasonic Sensor: Provides non-contact distance measurement. It is highly reliable for simple proximity tasks like this.
- SG90 Micro-servo: A lightweight but powerful enough actuator to press most standard liquid soap pumps. It requires a 5V supply and a signal pin.
- 2x Arduino UNO: Note that while the original schematic lists two, a single Arduino UNO is usually sufficient for this project. If using two, one could handle the sensor while the other manages the motor, communicating via Serial or I2C.
Technical Concept: Proximity-Based Logic
The reliability of this project hinges on the trigger and echo timing. The Arduino must ensure the trigger pulse is exactly 10 microseconds to initiate the ultrasonic burst. The sensitive nature of soap dispensing requires careful calibration so that the servo doesn't trigger accidentally or get stuck in a "double dispensing" loop.
