ArrowtronElectronics Store
Free shipping over ₹999
100% genuine components
Dispatch in 1–2 days
Secure payments · UPI, Cards

PIR Motion Detector Alarm with Buzzer and LED

Build a simple intruder alarm in under an hour: a PIR sensor watches for movement and instantly sounds a buzzer and flashes a warning LED.

Beginner~45 minutes7 components

What you’ll build

The PIR sensor detects the infrared signature of a moving person up to several metres away. The Arduino Nano watches its output pin and, on any motion, drives an active buzzer and a red LED for a few seconds — the core of every burglar alarm.

Components you’ll need

ComponentQtyPrice
Arduino Nano ATmega328P Compatible Board1₹149
PIR Motion Sensor1₹129
Active Buzzer1₹299
5mm Red LED1₹149
220 Ohm 1/4W1₹49
400 Point Breadboard1₹299
Jumper Wires MM1₹299
Total₹1,373

Step-by-step guide

  1. Mount the PIR sensor on the breadboard: VCC to 5V, GND to GND, OUT to pin D2.
  2. Connect the active buzzer: positive leg to D8, negative leg to GND.
  3. Wire the red LED to D9 through the 220Ω resistor (long leg to resistor, short leg to GND).
  4. Keep the PIR’s two orange trim pots at minimum to start — one sets sensitivity, the other sets how long OUT stays high.
  5. Upload the sketch, then stay still for ~40 seconds while the PIR calibrates itself.
  6. Wave your hand in front of the sensor: the buzzer should beep and the LED flash for three seconds.

The code

The sketch waits for the PIR to pull D2 high, then runs the alarm pattern. A calibration delay on boot prevents false alarms.

const int pir=2, buzzer=8, led=9;
void setup(){
  pinMode(pir,INPUT); pinMode(buzzer,OUTPUT); pinMode(led,OUTPUT);
  delay(40000);            // PIR warm-up / self-calibration
}
void loop(){
  if(digitalRead(pir)==HIGH){
    for(int i=0;i<6;i++){                 // 3-second alarm burst
      digitalWrite(buzzer,HIGH); digitalWrite(led,HIGH); delay(250);
      digitalWrite(buzzer,LOW);  digitalWrite(led,LOW);  delay(250);
    }
  }
}

Build this project

Add all 7 required components to your cart in one click — total ₹1,373.

Add all components to cart
Scroll to Top