Nafisa Anjum
Published © CC BY

Smart touch-less Doorbell

To avoid contamination of COVID-19 we can use a touchless smart doorbell using cost-friendly sensors.

BeginnerFull instructions provided4 hours3,746
Smart touch-less Doorbell

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Buzzer
Buzzer
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

connection

Code

Code

Arduino
/*
'DISTANCE SENSOR:
Vcc goes to 5V on arduino
Gnd goes to ground pin on arduino.
Trigger goes to pin 10 on the arduino.
Echo goes to pin 9 on the arduino.

BUZZER:
Positive leg goes to pin 6 on the arduino.
Negative leg goes to GND on arduino.
*/
int trigPin = 10;    
int echoPin = 9;    
int bell=6
 
void setup() {
  digitalWrite(bell, LOW);
  pinMode(trigPin, OUTPUT);
  pinMode(bell,OUTPUT)
  pinMode(echoPin, INPUT);
  delay(100);
}
 
void loop() {
 
  digitalWrite(trigPin, LOW);
  delayMicroseconds(5);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  int duration = pulseIn(echoPin, HIGH);
  delay(50);
  
  if (duration <= 600){
     digitalWrite(bell, HIGH);

  }

  else{
      digitalWrite(bell, LOW);

    
  }
}

Credits

Nafisa Anjum

Nafisa Anjum

2 projects • 4 followers
Computer science student who loves electronics

Comments