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.

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

Circuit Coding:

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:

Parts List:

ComponentQuantity
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.

PIR sensor detect infrared from human body.

If motion detects it send HIGH signal to Arduino pin 2.

Arduino then turn ON buzzer and LED.

After some seconds it turn them OFF again.

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:

This project is simple PIR Motion Detector Circuit using Arduino.

It uses PIR to sense human movement.

Arduino control buzzer and LED alarm.

It is good for home security and for automation.

References:

Arduino Based Security System using Passive Infrared (PIR) Motion Sensor

Exit mobile version