How to Make Automatic Hand Sanitizer Dispenser with Arduino

how to make hand sanitiser dispenser

The automatic hand sanitizer dispenser has emerged as one of the crucial technological devices employed in the global effort to combat the spread of the COVID-19 contagion. Since the virus first broke out in late 2019, a multitude of measures have been implemented to contain its spread. Although vaccines for COVID-19 have been developed and are being distributed worldwide, additional measures continue to be necessary to further curtail the transmission of the virus.

In response to this ongoing need, numerous technology companies have made significant innovations in designing and developing gadgets aimed at preventing the spread of COVID-19. These innovations are particularly vital in light of the emergence of new variants of the virus, such as the highly transmissible Delta variant.

The automatic hand sanitizer dispenser exemplifies these innovations. It allows for hands-free operation, thereby reducing physical contact and minimizing the risk of viral transmission through surfaces.
This technology has been widely adopted in various settings, including hospitals, schools, offices, and public places. The widespread implementation of automatic hand sanitizer dispensers represents just one aspect of the multifaceted approach required to manage and ultimately overcome the COVID-19 pandemic. It underscores the importance of integrating technological advancements with public health strategies to safeguard communities and mitigate the impact of the virus.

In addition to the development of automatic hand sanitizer dispensers, tech companies are continuously exploring other innovative solutions to support public health efforts. These include touchless payment systems, remote health monitoring devices, and advanced air filtration systems, all designed to reduce the spread of infectious diseases.

As the global community continues to navigate the challenges posed by COVID-19 and its variants, the role of technology in enhancing safety measures and promoting public health cannot be overstated. The commitment of tech companies to innovate and adapt to the evolving situation is a testament to the critical role of technology in addressing contemporary public health crises.

How the Automatic Hand Sanitizer Works

An automatic hand sanitizer dispenser is a device designed to dispense hand sanitizer without the need to press a button or turn a lever. It operates using a proximity sensor that detects the presence of a hand. When a hand is placed close enough to the dispensing nozzle, the sensor triggers the device to release a small amount of sanitizer, sufficient for effective hand sanitization.

How to Make DIY Automatic Hand Sanitizer Dispenser

In this tutorial, you will learn how you can make your own DIY automatic hand sanitizer dispenser.
The parts you need for the design of the project are shown below:

  1. Arduino board (1)
  2. Ultrasonic sensor (1)
  3. 5V DC pump (1)
  4. Lithium-ion Batteries (3)
  5.  Battery casing (1)
  6. NPN BJT Transistor (1)
  7. LED (1)
  8. 330R Resistor (1)
  9. Power Jack (1)
  10. Switch
  11. Hose
  12. Sensor support
  13. Container for sanitizer
  14. Jumper wires
  15. Twist strips
  16. Device casing
  17. Screws

Circuit Diagram for the Project

Arduino Code for the Project

Below is the Arduino code for the design, copy and paste this code in your Arduino IDE and upload to your Arduino board. Make sure you unplugged the Arduino from the battery before uploading the code to the board.

int trigPin = 9;      
int echoPin = 8;     

int to_transistor=12;    

long duration;
 int distance;
 int led=2;

void setup() 
{
 
  Serial.begin(9600);
  
  delay(random(500,2000));  
  
  pinMode( to_transistor, OUTPUT);
        pinMode( trigPin, OUTPUT);
        pinMode( echoPin, INPUT);
              pinMode( led, OUTPUT);
               digitalWrite(led ,HIGH);
              
}

void loop() {

  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);   
  digitalWrite(trigPin, HIGH);    
  delayMicroseconds(10);
   digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = duration*0.034/2;   
  delay(10);

   Serial.println(distance);
    
  if (distance <=8)            
  {
    digitalWrite(to_transistor, HIGH);                    
     delay(300); 
     digitalWrite(to_transistor,LOW);
     delay(2000);    
                                             
  }
else 
{
  
   digitalWrite(to_transistor, LOW);                    
      
                          
}
       
  }
  

The Finished Project

Leave a Reply

Your email address will not be published. Required fields are marked *