Our Project is all about to make people to maintain social distancing.
Actually after the covid crisis many people were not following social distancing in many public places. So, we thought to do something on it. Then I made research how to use these arduino's and sensors.
You will be having a question! How does it works? let me explain by an example" if two people were standing in a line infront of a ticket counter by following 6ft distance then, the buzzer does not sound. If the person moves front by crossing social distance of 6ft then the buzzer makes alert the person by beeping as he is not following social distance.
The circuit:
Code:
int const trigPin = 10;
int const echoPin = 9;
int const buzzPin = 2;
void setup()
{
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzPin, OUTPUT);
Serial.begin(9600);
digitalWrite(10, HIGH);
}
void loop()
{
int duration;long int distance;
int (sensor(int trigPin,int echoPin));
digitalWrite(trigPin, HIGH);
delay(100);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
if (distance <= 183 && distance >= 16) {
digitalWrite(buzzPin, HIGH);
} else {
digitalWrite(buzzPin, LOW);
}
Serial.print("Distance:");
Serial.print(distance);
digitalWrite(10, 9);
Serial.println();
delay(100);
}
Tinker cad arduino project link:
https://www.tinkercad.com/things/f0AOKJrBRbD?sharecode=H5SOCTc5oYYSxGbBzlX1pf5BZ23MjDifmT0TJnXjL-s


_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)



Comments