divyeshepandav1999sidhdhapurabhargav99
Created August 17, 2020

Distance restricted covid19

when people come close more than 1m then buzzer beeping and start vibrate ,so people can understand that do not close more than 1m

Distance restricted covid19

Things used in this project

Hardware components

Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Buzzer
Buzzer
×1
Solar Cockroach Vibrating Disc Motor
Brown Dog Gadgets Solar Cockroach Vibrating Disc Motor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Schematics

PROJECT-1

Code

PROJECT CODE

C/C++
RUN AND UPLOAD TO ARDUINO NANO BOARD
int trigPin1 = 2;
int echoPin1 = 3;
int buzzer1 = 6;
int motor1 = 7;
int duration,distance;
void setup()
{
  Serial.begin(9600);
  pinMode(trigPin1,OUTPUT);
  pinMode(echoPin1,INPUT);
   pinMode(buzzer1,OUTPUT);
   pinMode(motor1,OUTPUT);
}
void loop()
{
  digitalWrite(trigPin1,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin1,LOW);
  duration = pulseIn(echoPin1,HIGH);
  distance = (duration/2)/40.1;
  if (distance>=200||distance<=0)
  {
    Serial.println("no object detected");
    digitalWrite(buzzer1,LOW);
    digitalWrite(motor1,LOW);
  }
  else
  {
    Serial.println("object detected");
    Serial.print("distance=");
    Serial.print(distance);
    digitalWrite(buzzer1,HIGH);
    digitalWrite(motor1,HIGH);
  }
}

Credits

divyeshepandav1999

divyeshepandav1999

0 projects • 0 followers
sidhdhapurabhargav99

sidhdhapurabhargav99

1 project • 1 follower

Comments