Covid19 Project Contactless Doorbell With Arduino
by Rachna Aggarwal in Circuits > Arduino
1673 Views, 3 Favorites, 0 Comments
Covid19 Project Contactless Doorbell With Arduino
In this project, aiming at present crisis of Covid19 nobody wants to touch foreign objects. Keeping that in mind, I found this project, contact less doorbell using arduino.
I have used an ultrasonic sensor in this project which will calculate the distance of the object from the doorbell and a buzzer as doorbell when hand of the visitor is 7 or less than 7 cm away from the doorbell.
You can check my project : - Doorbell using pushbutton also.
Formula for calulating distance using ultrasonic sensor is: -
d = (s*t )/2
d= distance
s= speed of sound in air 340 m/s
t= time
Components Required
In this project we require:-
1. Arduino - https://amzn.to/32jAMUA
2. Ultrasonic sensor - https://amzn.to/3bSReyg
3. buzzer - https://amzn.to/3k8PGTG
4. Jumper wires - https://amzn.to/3iqdBxM
Circuit Schematic
Pin 13 --> Buzzer positive
Pin 7 --> trigger
Pin6 --> echo
5V --> Vcc of ultrasonic sensor
GND --> negative of buzzer, GND of ultrasonic senor
Arduino Code
In this code we will take speed of light unit as 0.034cm/us because distance measured by ultrasonic sensor is in cm and wave sent by trigger is sent in us . at first, we will low trigger for 2 us to clear the trigger. If we take wave length greater than 3 mins then we will not get accurate measurement. We prefer wave time in us.
const int trigPin = 10;
const int echoPin = 9;
float duration, distance;
void setup() {
pinMode(13, OUTPUT);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration*.0343)/2;
Serial.print("Distance: ");
Serial.println(distance);
if((distance<=7.00)&&(distance>=2.00)){
digitalWrite(13, HIGH);
}else{
digitalWrite(13,LOW);
}
delay(100);
}