SOCIAL DISTANCING BELT OR ID CARD
by Surajsuri in Circuits > Arduino
257 Views, 0 Favorites, 0 Comments
SOCIAL DISTANCING BELT OR ID CARD
THIS PROJECT HELPS TO AVOIDING OF VIRUSES FROM ONE PERSON TOP ANOTHER PERSON.
MATERIALS REQURIED:
1) ARDUINO UNO OR ANY ARDUINO BOARD
2) ULTRASOINIC SENSOR
3) BUZZER
4) BATTERY 9V OR 5V
5) ID CARD
6) SOME JUMPER WIRES
CONNECTIONS;
1) CONNECT TRIG PIN TO PIN 2 OF ARDUINO
2) CONNECT ECHO PIN TO 3 PIN OF ARDUINO
3) CONNECT BUZZER TO PIN 10
4) CONNECT VCC TO 5V OF ARDUINO
5) CONNECT GND TO GND OF ARDUINO
6) CONNECT BATTERY TO ARDUINO TO POWER JACK
" AFTER CONNECTING PINS, UPLOAD THE CODE GIVEN BELOW"
CODE :
int trigger_pin = 2; int echo_pin = 3; int buzzer_pin = 10; int time; int distance; void setup ( ) { Serial.begin (9600); pinMode (trigger_pin, OUTPUT); pinMode (echo_pin, INPUT); pinMode (buzzer_pin, OUTPUT); } void loop ( ) { digitalWrite (trigger_pin, HIGH); delayMicroseconds (10); digitalWrite (trigger_pin, LOW); time = pulseIn (echo_pin, HIGH); distance = (time * 0.034) / 2; if (distance <= 100) { Serial.println (" Door Open "); Serial.print (" Distance= "); Serial.println (distance); digitalWrite (buzzer_pin, HIGH); delay (500); } else { Serial.println (" Door closed "); Serial.print (" Distance= "); Serial.println (distance); digitalWrite (buzzer_pin, LOW); delay (100); } }