MOTION DETECTOR
This project is used to detect the movement of Human (living organisms). When
there is a movement the RED LED will Turn ON also the Buzzer. If not the Green
LED turn ON.
FOR VIDEO :
CIRCUIT DIAGRAM
WIRING
PIR SENSOR TO ARDUINO
- Connect the VCC to VCC Rail.
- Connect the GND to GND Rail.
- Connect the OUTPUT pin to pin 7 of arduino.
LED TO ARDUINO
- Connect the Green led to pin 5 of arduino.
- Connect the Red led to pin 4 of arduino.
BUZZER TO ARDUINO
- Connect the Buzzer to pin 3.
Code
//(PIR)Motion Detector //scientist BENIELS LAB int PIR_Sensor = 7; int Led_G = 5; int Led_R = 4; int Buzzer = 3; void setup() { Serial.begin(9600); Serial.println("Motion Detector"); Serial.println("PIRSensor"); pinMode(PIR_Sensor, INPUT); pinMode(Led_G, OUTPUT); pinMode(Led_R, OUTPUT); pinMode(Buzzer, OUTPUT); } void loop() { int Motion = digitalRead(PIR_Sensor); // if motion is detected if(Motion){ Serial.println("Motion detected"); digitalWrite(Led_R,HIGH); digitalWrite(Led_G,LOW); digitalWrite(Buzzer,HIGH); } // if motion is not detected else{ Serial.println("Nothing is Moving"); digitalWrite(Led_R,LOW); digitalWrite(Led_G,HIGH); digitalWrite(Buzzer,LOW); } delay(500); }
Comments
Post a Comment