Project showcase
Social Distance Detector

Social Distance Detector

Social distancing is a new way of life globally. Clip this device on ur belt and maintain social distancing.

  • 7,969 views
  • 6 comments
  • 33 respects

Components and supplies

Necessary tools and machines

arduino ide

About this project

Social distancing is a new way of life globally. Clip this device on ur belt and maintain social distancing. This device will buzz an alarm when you are less than 6 feet away from any humans. A bright LED glows when the alarm beeps.

Code

Social Distance DetectorC/C++
const int trigPin = 9;
const int echoPin = 10;
long duration;
int distanceCm, distanceInch;
void setup()
{
Serial.begin(9600); 
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(11,OUTPUT);
pinMode(12,OUTPUT);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distanceCm= duration*0.034/2;
distanceInch = duration*0.0133/2;
Serial.println("Distance: ");
Serial.println(distanceCm);

if(distanceCm < 100)
{
  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
}
else 
{
  digitalWrite(11,LOW);
  digitalWrite(12,LOW);
}
}

Comments

Similar projects you might like

Arduino EMF Detector A.K.A Ghost Detector

Project showcase by Patel Darshil

  • 14,317 views
  • 9 comments
  • 23 respects

Motion Direction Detector

Project showcase by sergioluz

  • 3,374 views
  • 1 comment
  • 6 respects

Healthcare Skin Pressure Detector

Project tutorial by David Escobar

  • 10,861 views
  • 3 comments
  • 21 respects

Proximity Alarm Distance Meter

by Hassan Shettima Lawan

  • 5,159 views
  • 2 comments
  • 23 respects

DIY Ultra Sensitive EMF Detector

Project tutorial by Mirko Pavleski

  • 4,445 views
  • 4 comments
  • 30 respects

Motion Detector Clock

Project in progress by Frazer Reid

  • 3,138 views
  • 1 comment
  • 5 respects
Add projectSign up / Login