In this project, you will learn to design an automatic hand sanitizer.
1. Arduino Uno: - automatic hand sanitizer
#ArduinoUno board is used for interfacing the input-output elements to construct a project. It is an open-source microcontroller board that can be programmed according to user requirements.
2. Ultrasonic Sensor:
This sensor measures the distance of an object by emitting ultrasonic waves through a transmitter. Its receiver receives the reflected signal and converts it into an electrical signal.
In this project, we use an ultrasonic sensor to recognize the presence of the hand near the nozzle of the sanitizer.
3. Servo Motor:
A servomotor is a linear or a rotatory actuator that aids in the precise control of velocity, acceleration, and angular position. It works on the principle of Pulse Width Modulation.
In this project, the servomotor is used to control the flow of the sanitizer through the nozzle or an outlet.
To learn to interface a servomotor with Arduino, click here: INTERFACING SERVO MOTOR WITH ARDUINO
Connect the Vcc of the ultrasonic sensor to the 5V of the Arduino.
Connect the trigger pin of the ultrasonic sensor to the D2 of the Arduino.
Connect the echo pin of the ultrasonic sensor to the D3 of the Arduino.
Connect the ground pin of the ultrasonic sensor to the ground of the Arduino.
Connect the power pin of the servomotor to the 5V of the Arduino board.
Connect the signal pin of the servomotor to the D9 of the Arduino.
Connect the ground pin of the servomotor to the ground of the Arduino
Include the servo.h library in the Arduino IDE.
Define the variables myservo, duration, and distance, and define the ultrasonic sensor pins used.
In void setup(), set the pin modes for the trigger pin and the echo pin. Start the serial monitor output with a 9600 baud rate.
Using the digitalWrite() function, set the trigger pin to low and high alternatively by giving a suitable delay.
Store the value of the echo pin the duration variable.
Convert the value in the duration variable to the distance value.
Using the if-else condition, set the servomotor shaft to a neutral position if the distance between the hand and the sensor is not between 2cm to 4cm. Set the motor shaft to rotate otherwise.
The distance between the sensor and the object is measured and processed by the ultrasonic sensor. When the object comes within the range of the sensor, the shaft of the servomotor is made to rotate and, the sanitizer is dispensed from the container.
Check the Project Working video here - Automatic Hand Sanitizer - DIY
Video by- Sowmya G
Name- Nagashree R Nadig
Portfolio Link- https://www.learnelectronicsindia.com/team/nagashree-r-nadig
Follow us -
Please do follow us i.e #learnelectronicsindia to get daily updates about new blogs, videos, courses, quizzes, and contests.
Want us to help you with the projects, write your inquiry here - Order Projects
Check out our Free Arduino Projects Playlist - Arduino Projects
Check out our Free Raspberry Pi Projects Playlist - Raspberry Pi Projects
Check out our Free TinkerCAD Projects Playlist - TinkerCAD Projects
Check out our Free IoT Projects Playlist - IoT Projects
Check out our Free Home Automation Projects Playlist - Home Automation Projects
Check out our Free NodeMCu Projects Playlist - NodeMCu Projects