Akshay Joseph
Published © GPL3+

COVID - 19 Touchless Hand Wash Timer

A simple timer to ensure the duration of hand washing is 20 seconds

BeginnerFull instructions provided12,877
COVID - 19 Touchless Hand Wash Timer

Things used in this project

Story

Read more

Custom parts and enclosures

blackandwhite_LP4eeolEaK.psd

blackandwhite_eoyu66spg0.psd

Schematics

dazzling_snicket_(1)_VxO9zpKika.png

Code

Untitled file

Arduino
//Sketch created by Akshay Joseph
#include<Servo.h>
#define echoPin 4
#define trigPin 5
Servo Myservo;
int pos;
int long duration;
int distance;
void setup(){ 
Myservo.attach(3);
pinMode(echoPin,INPUT);
pinMode(trigPin,OUTPUT);
void setup(){ 
Myservo.attach(3);
pinMode(echoPin,INPUT);
pinMode(trigPin,OUTPUT);

}
void loop()
{
digitalWrite(trigPin,LOW);
delayMicroseconds(2); 
digitalWrite(trigPin,HIGH);
delayMicroseconds(10); 
digitalWrite(trigPin,LOW);
duration=pulseIn(echoPin,HIGH);
distance=(duration*0.034/2);
  
  if(distance<=80){
    for(pos=180;pos>=0;pos--){
      Myservo.write(pos);
      delay(111.1);
    }
    
}
  else{
      Myservo.write(180);
  }
  delay(200);

}

Credits

Akshay Joseph

Akshay Joseph

25 projects • 155 followers
B.Sc. Electronics Student at Govt. College Tanur

Comments