Close Menu
Circuit of Things
  • Home
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • About Us
  • Get In Touch
  • 3D Print
  • Shop Now !
  • Electro Calc

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

Instagram WhatsApp
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
Circuit of Things Circuit of Things
  • Home
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • About Us
  • Get In Touch
  • 3D Print
  • Shop Now !
  • Electro Calc
Hire us
Circuit of Things
Home»Arduino Projects»PIR Motion Sensor with Arduino: Smart Security Alarm System
Arduino Projects

PIR Motion Sensor with Arduino: Smart Security Alarm System

Sai Preetham KoyyalaBy Sai Preetham KoyyalaMay 4, 2026No Comments2 Mins Read
Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
Share
Facebook Twitter LinkedIn Pinterest Email
Contents
  • Introduction
  • Components Needed
  • Wiring
  • Project 1: Basic Motion Detector
  • Project 2: Motion Alarm with Buzzer
  • Important Notes
  • Conclusion

Introduction

The PIR (Passive Infrared) motion sensor detects movement by sensing changes in infrared radiation emitted by warm objects like humans and animals. It is the same technology used in commercial burglar alarms and automatic hallway lights. In this tutorial, we build a complete motion-activated alarm system.

Components Needed

  • Arduino Uno
  • HC-SR501 PIR Sensor
  • Buzzer
  • LED
  • Resistor (330-ohm)

Wiring

PIR Pin Arduino
VCC 5V
GND GND
OUT Digital Pin 2

Project 1: Basic Motion Detector

#define PIR_PIN 2
#define LED_PIN 13
void setup() {
  Serial.begin(9600);
  pinMode(PIR_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
  Serial.println("Warming up PIR sensor... please wait 30 seconds.");
  delay(30000);
  Serial.println("Ready!");
}
void loop() {
  if (digitalRead(PIR_PIN) == HIGH) {
    digitalWrite(LED_PIN, HIGH);
    Serial.println("Motion Detected!");
    delay(1000);
  } else {
    digitalWrite(LED_PIN, LOW);
  }
}

Project 2: Motion Alarm with Buzzer

#define PIR_PIN 2
#define BUZZER_PIN 8
#define LED_PIN 13
void setup() {
  pinMode(PIR_PIN, INPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(LED_PIN, OUTPUT);
  delay(30000); // Warm-up
}
void loop() {
  if (digitalRead(PIR_PIN) == HIGH) {
    for (int i = 0; i < 5; i++) {
      digitalWrite(LED_PIN, HIGH); tone(BUZZER_PIN, 1000); delay(200);
      digitalWrite(LED_PIN, LOW); noTone(BUZZER_PIN); delay(200);
    }
  }
  delay(100);
}

Important Notes

  • The HC-SR501 needs a 30-second warm-up period after power-on before it reliably detects motion.
  • Adjust the sensitivity and delay potentiometers on the sensor to tune its range and response time.

Conclusion

With just a PIR sensor and Arduino, you can build a professional-grade security alarm system for a fraction of the cost of commercial solutions!

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleArduino Servo Motor Control: Sweep, Potentiometer and Button Projects
Next Article ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud
Sai Preetham Koyyala
  • Website
  • Facebook
  • X (Twitter)
  • Instagram
  • LinkedIn

Hello, I am Sai Preetham Koyyala. I'm an electronics engineer by profession, a DIY enthusiast by passion. ESP32 and Arduino are the main topics of my work.

Related Posts

Arduino Projects

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026
Arduino Projects

Arduino Servo Motor Control: Sweep, Potentiometer and Button Projects

May 4, 2026
Arduino Projects

LDR Light Sensor with Arduino: Auto Night Light Project

May 4, 2026
Add A Comment
Leave A Reply Cancel Reply


KSP Electronics
✓ Trusted Store
Everything for Your
Next IoT Build
Boards, sensors, modules & kits delivered fast across India.
ESP32 Arduino Sensors Modules DIY Kits
500+
Products
Fast
Delivery
★★★★★
Rated
🛒 Shop Now →
kspelectronics.in
💻
● Available for Projects
Hire Me for
IoT Projects
ESP32, LoRaWAN, cloud dashboards & custom hardware — end-to-end IoT solutions for your needs.
ESP32 LoRaWAN MQTT Arduino Cloud PCB Design
3+
Yrs Exp
20+
Projects
★★★★★
Rated
💬 Chat on WhatsApp
View services →
Top Posts

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Follow Us
  • Telegram

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

Most Popular

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Our Picks

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

NodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform

May 4, 2026

ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud

May 4, 2026

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

© 2026 Circuit of Things. All Rights Reserved. Built with ❤️ for the Maker Community.

  • About
  • Privacy
X (Twitter) Instagram YouTube WhatsApp
  • Book an Appointment
  • My Bookings
  • Support Us
© 2026 Circuit of Things. Designed by Sai Preetham Koyyala.

Type above and press Enter to search. Press Esc to cancel.