Narisetti Akshay
Published © CERN-OHL

Touch less hand sanitizer

A arduino based touchless hand sanitizer, so that when a person uses the sanitizer he doesn’t fall a prey for cross-contamination.

AdvancedFull instructions provided1 hour552
Touch less hand sanitizer

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Custom parts and enclosures

Any push sanitiser bottle

can bought from any medical store

Schematics

schematics

connect them according to the diagram

Code

code

C/C++
used in arduino ide
#include <Servo.h>

const int trigPin = 7; // Trigger Pin of Ultrasonic Sensor
const int echoPin = 6; // Echo Pin of Ultrasonic Sensor
Servo Myservo;


void setup() 
{
Serial.begin(9600); // Starting Serial Terminal

Myservo.attach(5);  // Signal Pin of Servo      
                                       
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.print("  Distance    ");
Serial.print("  Measurement  ");
delay(1000);
delay(1000);
Serial.print("Made By :");

Serial.print(" OverAll Technical Gyan");
delay(2000);

}

void loop()
{
  long duration, cm;
  pinMode(trigPin, OUTPUT);
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  pinMode(echoPin, INPUT);
  duration = pulseIn(echoPin, HIGH);
  cm = microsecondsToCentimeters(duration);
  

Serial.print("Distance:");
  Serial.print(cm);
  Serial.print("cm");
  delay(100);
  
    if(cm >= 20){
Myservo.write(0);
}
else {
Myservo.write(90);


}

  Serial.println();
delay(100);

}


long microsecondsToCentimeters(long microseconds)
{
   return microseconds / 29 / 2;
}

Credits

Narisetti Akshay
1 project • 2 followers

Comments