Site icon Circuit Ideas for You

PIR Motion Detector Circuit using Arduino

Turn Arduino into a motion spy! with just a PIR sensor, buzzer and LED we can detect movement easily.

Whenever someone passes, it spots movement and warns us with light and sound; this PIR Motion Detector Circuit using Arduino is for beginners and makers.

Also, it is fast to build, fun to use and full of learning.

Arduino Code:

int pirPin = 2;
int buzzer = 3;
int led = 4;
int pirState = LOW;
int val = 0;

void setup() {
pinMode(pirPin, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
Serial.begin(9600);
}

void loop() {
val = digitalRead(pirPin);
if (val == HIGH) {
digitalWrite(buzzer, HIGH);
digitalWrite(led, HIGH);
if (pirState == LOW) {
Serial.println("Motion detected!");
pirState = HIGH;
}
} else {
digitalWrite(buzzer, LOW);
digitalWrite(led, LOW);
if (pirState == HIGH) {
Serial.println("Motion ended!");
pirState = LOW;
}
}
}

Coding Explanation:

Circuit Working:

PIR Motion Detector Circuit Diagram using Arduino

Parts List:

ComponentsQuantity
Resistor 220Ω 1/4 watt1
Arduino UNO1
PIR Sensor Module1
Any LED 5mm 20mA1
Buzzer1

The above circuit diagram shows the Arduino motion detector using PIR sensor, LED and buzzer.

Then PIR sensor detect infrared from human body and if motion detects, it send HIGH signal to Arduino pin 2 and Arduino then turn ON buzzer and LED.

After some seconds it turn them OFF again and if there is no motion then buzzer and LED stays OFF.

Formula:

Below is the formula for PIR Motion Detector Circuit:

Use Ohm Law formula : R = V/I

where,

How to Build:

To build a PIR Motion Detector Circuit using Arduino follow the below steps for connections:

Conclusion:

Overall, this project is simple PIR Motion Detector Circuit using Arduino, it uses PIR to sense human movement.

Furthermore, Arduino control buzzer and LED alarm and this circuit is also good for home security and for automation.

Exit mobile version