How to make automatic hand sanitizer using arduino

How to make automatic hand sanitizer using arduino

How to make automatic hand sanitizer

Hey guys , welcome back to the techa tronic . in this project we will make automatic hand sanitizer using Arduino and Ultrasonic sensor. as we at this time we need the sanitizer everywhere at home, offices, travel vehicles, etc. So we are making a machine like which can automatically sanitize your hand when you put your hand in front of the machine.  As we all know in this extreme time of Covid-19 it may be useful for all. which would auto be able to automatic hand sanitize till your hand below the machine?

we are making one more precise and different automatic hand sanitizer. which can assist you with giving the time for hand sanitizing.  a significant number of the individuals additionally making different undertakings to help in this circumstance we did likewise something that can be useful. We made it with the Arduino, water pump, and the ultrasonic. there is just 1 sensor that recognizes the individual and gives the sanitizer to that individual. so this is extremely simple and easy to make. along these lines, when you will begin the task you will naturally feel how it is simple as our more project like an automatic soap dispenser. Presently, we are going to impart to you how can it work in the following section.

automatic hand sanitizer

How does it work?

In this paragraph, we will talk about how does the automatic hand sanitizer works. so you need to put your hand in front of the sanitizer machine only and the sanitizer machine will give you the sanitizer in your hand till your hand present at the same location. there is an ultrasonic sensor in the machine which detects your presence there. the ultrasonic sensor has two terminal one is a transmitter and another is a receiver. the transmitter transmits the ultrasonic waves and the receiver receives the signal when it comes back and then it will calculate the distance of the object by the ultrasonic sensor distance calculation formula.  then the distance send to the Arduino and there is some database for comparison with the present value and according to the threshold the Arduino will send the command to the water pump. so if there any person put their hand then the water pump gets on and sanitizer release to that hand. and when the person pulls back their hand the sanitizer gets to stop.

Material required to make automatic hand sanitizer

  • Arduino Uno
  • Ultrasonic Sensor
  • Water pump 9v
  • Battery
  • Wires
  • Sanitizer
  • Plastic box

automatic hand sanitizer circuit diagram

 automatic hand sanitizer circuit diagram

Code for Automatic hand sanitizer:-

int duration_front=0;
long distance_front=0;
void setup() {
// put your setup code here, to run once:

pinMode(2,OUTPUT);
pinMode(3,INPUT);
pinMode(7,OUTPUT);

Serial.begin(9600);
}

void loop() {

digitalWrite(2, HIGH);
delayMicroseconds(10);
digitalWrite(2, LOW);
delayMicroseconds(2);
duration_front= pulseIn(3,HIGH);
distance_front=duration_front*0.034/2;
Serial.println(distance_front);

if(distance_front<=10)
{

digitalWrite(7,HIGH);

}

else
{
digitalWrite(7,LOW);
}

}

Upload the given code in Arduino with Arduino IDE.