Yara Alharbi
Published © GPL3+

Automatic Door Handle/Knob Sanitizer for COVID-19🚫🦠🚪😷

A self-sanitizing door handle that works by spraying the handle area with the sanitizing liquid whenever the door handle has been used.

BeginnerFull instructions provided621
Automatic Door Handle/Knob Sanitizer for COVID-19🚫🦠🚪😷

Things used in this project

Hardware components

IR Sensor
×1
Servo Motor
×1
Arduino UNO
×1
Jumper wires and Breadboard
×1
4 AA Battery Holder
×1
AA Batteries
×4

Software apps and online services

Arduino IDE

Hand tools and fabrication machines

Box
Small Plastic Spray Bottle
Rubbing Alcohol/ Sanitizer

Story

Read more

Code

Automatic Door Handle Sanitizer Code

C/C++
#include <Servo.h>

Servo myservo; 
int pos;
int Signal = 8;
int LastState = LOW; 
int SensorState;

void setup() 
{
  pinMode(Signal, INPUT);         //Sensor set as digital input
  myservo.attach(9);              //Server set as output
}

void loop()
{

  
  SensorState = digitalRead(Signal); 
  delay(1); 

   if (SensorState != LastState) //if it changed and it's high
  {
    if (SensorState == HIGH) 
    {
      Spray();                  //Sanitize the door handle
    }
  }
LastState = SensorStat;
//save current sensor input value for next comparison 

}

void Spray()                    //spray operation function 
{   
   delay(200);
   for ( ;pos >= 40; pos -= 1) 
   { 
    myservo.write(pos);             
    delay(15);                        
   } 
   
    for ( ;pos <= 80; pos += 1) 
  { 
    myservo.write(pos);             
    delay(5);                        
  }
}
//end program

Credits

Yara Alharbi
1 project • 0 followers
Computer Engineering Student :)
Contact

Comments

Please log in or sign up to comment.