Social Distancing Device (Safety Card)

Social Distancing Device (Safety Card) © GPL3+

How to make social distancing warner device with Arduino uno, Ultrasonic sensor, Buzzzer

  • 9,682 views
  • 4 comments
  • 26 respects

Components and supplies

About this project

In case you were living under a rock for the past couple of months, you are most likely aware of the deadly Virus roaming the world right now. The government officials are advising everybody to keep social distances (1 meter). But I get it, keeping track of your surrounding while you are buried in your devices can be frustrating, that's why I built this system to help people with this.

Circuit Diagram

After getting all supplies now you can start connecting all the components in the right way accorging to the circuit diagram given above

Now after completing the above steps you can start glueing components in the right place as shown in the above pictures

you can also do it in your way I liked it in this way

Then upload the code which is given below

int const trigPin = 6;
int const echoPin = 5;
int const buzzPin = 13;
void setup()
{
pinMode(trigPin, OUTPUT); // trig pin will have pulses output
pinMode(echoPin, INPUT); // echo pin should be input to get pulse width
pinMode(buzzPin, OUTPUT); // buzz pin is output to control buzzer
}
void loop()
{
// Duration will be the input pulse width and distance will be the distance to the obstacle in centimeters
int duration, distance;
// Output pulse with 1ms width on trigPin
digitalWrite(trigPin, HIGH);
delay(1);
digitalWrite(trigPin, LOW);
// Measure the pulse input in echo pin
duration = pulseIn(echoPin, HIGH);
// Distance is half the duration devided by 29.1 (from datasheet)
distance = (duration/2) / 29.1;
// if distance less than 0.5 meter and more than 0 (0 or less means over range)
if (distance <= 100 && distance >= 0) {
// Buzz
digitalWrite(buzzPin, HIGH);
} else {
// Don't buzz
digitalWrite(buzzPin, LOW);
}
// Waiting 60 ms won't hurt any one
delay(60);
}
int const trigPin = 4;
int const echoPin = 3;
int const buzzPin = 2;
void setup()
{
pinMode(trigPin, OUTPUT); // trig pin will have pulses output
pinMode(echoPin, INPUT); // echo pin should be input to get pulse width
pinMode(buzzPin, OUTPUT); // buzz pin is output to control buzzer
}
void loop()
{
// Duration will be the input pulse width and distance will be the distance to the obstacle in centimeters
int duration, distance;
// Output pulse with 1ms width on trigPin
digitalWrite(trigPin, HIGH);
delay(1);
digitalWrite(trigPin, LOW);
// Measure the pulse input in echo pin
duration = pulseIn(echoPin, HIGH);
// Distance is half the duration devided by 29.1 (from datasheet)
distance = (duration/2) / 29.1;
// if distance less than 0.5 meter and more than 0 (0 or less means over range)
if (distance <= 100 && distance >= 0) {
// Buzz
digitalWrite(buzzPin, HIGH);
} else {
// Don't buzz
digitalWrite(buzzPin, LOW);
}
// Waiting 60 ms won't hurt any one
delay(60);
}

YEH!!!!!

YOU HAVE MADE IT SO NOW PROMOTE SOCIAL ISTANCING USING THIS DEVICE AND DON'T FORGET TO LIKE THIS PAGE AND DO SUBSCRIBE MY CHANNEL

Comments

Similar projects you might like

A Device Which Help Us To Maintain Social Distancing

Project tutorial by Rohan Barnwal

  • 8,074 views
  • 13 comments
  • 19 respects

Social Distancing Reminder – Coronavirus

Project tutorial by arcaegecengiz

  • 17,907 views
  • 7 comments
  • 21 respects

How to Make Arduino Social Distancing Device with PIR

Project tutorial by DKARDU

  • 3,702 views
  • 0 comments
  • 4 respects

Safe Home Smart Home: Safety Device For Every Family Member

Project tutorial by Patel Darshil

  • 7,458 views
  • 0 comments
  • 13 respects

Social Distancing with Automatic Door Control System

Project tutorial by Rucksikaa Raajkumar

  • 6,247 views
  • 0 comments
  • 16 respects

I Made A Cap That Doesn't Allows You To Touch Your Face!!!

Project tutorial by Dynamic Innovator

  • 13,535 views
  • 41 comments
  • 58 respects
Add projectSign up / Login