Social Distancing Device ,Lets Fight Against Corona
by Voice Of Technology in Circuits > Arduino
95 Views, 0 Favorites, 0 Comments
Social Distancing Device ,Lets Fight Against Corona
This is a very interesting project for student to step against Corona Virus by maintaining "Social Distancing" using such gadgets even we can develop this small device into some more effective concern to make our Human Kind concern about the pandemic.Pleas like share follow our
FACEBOOK PAGE- Voice Of Technology | Facebook
For detailed video of making of any projects do subscribe and support us- YouTube- VOICE OF TECHNOLOGY - YouTube
Supplies
Components required-
1)Arduino uno/nano - https://amzn.to/3Bd3LYu
2)Ultrasonic sensor- https://amzn.to/2ZfDMmt
3)Jumper wires- https://amzn.to/3C8FUug
4)Battery- https://amzn.to/3EecvQb
5)Led light- https://amzn.to/3jvfcF7
6)cover- https://amzn.to/3EaMT6B
7)Resistance- https://amzn.to/3m7PA2z
8)Buzzer- https://amzn.to/3kVX719
Circuit diagram-
Its a very simple project ,so the circuit is also very normal but the effective is the representation with the practical wa to express,
so connect :1) TRIG PIN OF ULTRASONIC SENSOR TO PIN NO. -6 OF ARDUINO
2)ECHO PIN WILL BE CONNECTED TO - 7PIN OF ARDUINO
3)Now connect the +5 volt pin of Arduino to the positive pin of Ultrasonic sensor.
4)Ground pin of Arduino to the ground of Ultrasonic sensor
5)The positive of led will be connected to the 3rd pin of Arduino with a resistance of 1kohm .
6)Ground of led will be grounded in arduino ground pin.
Code to upload-
// constants won't change
const int TRIG_PIN = 6; // Arduino pin connected to Ultrasonic Sensor's TRIG pin
const int ECHO_PIN = 7; // Arduino pin connected to Ultrasonic Sensor's ECHO pin
const int LED_PIN = 3; // Arduino pin connected to LED's pin
const int DISTANCE_THRESHOLD = 50; // centimeters
// variables will change:
float duration_us, distance_cm;
void setup() {
Serial.begin (9600); // initialize serial port
pinMode(TRIG_PIN, OUTPUT); // set arduino pin to output mode
pinMode(ECHO_PIN, INPUT); // set arduino pin to input mode
pinMode(LED_PIN, OUTPUT); // set arduino pin to output mode
}
void loop() {
// generate 10-microsecond pulse to TRIG pin
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
// measure duration of pulse from ECHO pin
duration_us = pulseIn(ECHO_PIN, HIGH);
// calculate the distance
distance_cm = 0.017 * duration_us;
if(distance_cm < DISTANCE_THRESHOLD)
digitalWrite(LED_PIN, HIGH); // turn on LED
else
digitalWrite(LED_PIN, LOW); // turn off LED
// print the value to Serial Monitor
Serial.print("distance: ");
Serial.print(distance_cm);
Serial.println(" cm");
delay(500);
}
Connect Power to the Arduino by pc,or battery source.