PIR Based Theft Alert System Using Arduino Uno (Beginner Project)

PIR Theft Alert System | MakeMindz
Arduino Project · Intermediate

PIR Theft Alert
System

Build a real motion-detection security alarm with Arduino UNO — step by step, with a live simulator included.

⏱ 45 min 🧠 Arduino UNO 👁 PIR Sensor 🖥 Tinkercad Sim
1
Introduction
What you'll build and what you need
🚀 What You'll Build

A PIR-based Theft Detection System using an Arduino UNO. When someone moves into the sensor's field, the system instantly triggers a buzzer (audio alert) and an LED (visual alert) — just like a real security alarm.

Perfect for school science exhibitions and beginners. You can simulate it entirely in Tinkercad — no hardware required to start!

🧰 Components Required

Gather these 7 items — or just open the free Tinkercad simulation in Step 5.

🧠 Arduino UNO
👁 PIR Motion Sensor
🔔 Buzzer
💡 LED (Red)
220Ω Resistor
🍞 Breadboard
🔌 Jumper Wires
Working of PIR Sensor
2
How a PIR Sensor Works
Understand the science before you build
📡 The Science

A PIR (Passive Infrared) Sensor detects infrared radiation (body heat) from warm objects. It contains two IR-sensitive slots. When both see equal radiation — nothing happens. When a person walks by, one slot picks up more IR than the other, creating a differential signal that triggers a HIGH output.

No Motion

Both IR slots detect equal radiation → No difference → OUT stays LOW

Motion Detected

One slot detects more IR → Differential signal → OUT goes HIGH

🔁 System Flow
1 PIR sensor continuously scans for infrared radiation (body heat)
2 Person moves → PIR outputs HIGH signal → Arduino reads it on Digital Pin 2
3 Arduino turns ON the LED (Pin 8) + Buzzer (Pin 9) — alarm triggered!
4 Motion stops → PIR outputs LOW → Arduino turns everything OFF
⚙️ Live Demo — Try It

Click the button to simulate a person walking past the sensor.

PIR OUT
LOW
Arduino
IDLE
LED
OFF
🔕
Buzzer
OFF
No motion detected — system is idle
🔌 Pin Connections
ComponentTerminalConnects ToNotes
PIR SensorVCCArduino 5VPower supply
GNDArduino GNDCommon ground
OUTDigital Pin 2Motion signal input
LEDAnode (+)Pin 8 via 220ΩResistor protects LED
Cathode (–)GND
BuzzerPositive (+)Digital Pin 9Alarm output
Negative (–)GND
⚠️ Tips Before You Build
After powering on, wait 30–60 seconds for the PIR to calibrate before testing.
🔧Use the PIR's onboard potentiometer to adjust detection sensitivity and range.
💡Always use a 220Ω resistor with the LED — connecting it directly can burn it out.
📍Double-check that the PIR OUT pin goes to Digital Pin 2, not to 5V or GND.
4
Arduino Code
Copy into Arduino IDE or Tinkercad's code editor
theft_alert.ino
// ──────────────────────────────────────────
// PIR Theft Alert System
// MakeMindz makemindz.com
// ──────────────────────────────────────────

int pirPin    = 2;   // PIR sensor OUT → Digital Pin 2
int ledPin    = 8;   // LED            → Digital Pin 8
int buzzerPin = 9;   // Buzzer         → Digital Pin 9

void setup() {
  pinMode(pirPin,    INPUT);   // PIR sends data IN to Arduino
  pinMode(ledPin,    OUTPUT);  // LED is controlled by Arduino
  pinMode(buzzerPin, OUTPUT);  // Buzzer is controlled by Arduino
}

void loop() {

  int motion = digitalRead(pirPin);  // Read the PIR sensor

  if (motion == HIGH) {
    // 🚨 Motion detected — sound the alarm!
    digitalWrite(ledPin,    HIGH);  // LED ON
    digitalWrite(buzzerPin, HIGH);  // Buzzer ON
  } else {
    // ✅ No motion — stay quiet
    digitalWrite(ledPin,    LOW);   // LED OFF
    digitalWrite(buzzerPin, LOW);   // Buzzer OFF
  }

}
Variables (Lines 7–9)

We store pin numbers in named variables like pirPin so the code is readable and easy to update.

setup() — Runs Once

Tells Arduino which pins receive data (INPUT) and which send power (OUTPUT). Runs once on startup.

loop() — Runs Forever

digitalRead checks the PIR every millisecond. HIGH = alarm on, LOW = alarm off.

5
Simulate in Tinkercad
Test your circuit online — free, no hardware needed
📋 How to Use the Simulator
1 Click "Open in Tinkercad" above. Sign in or create a free account.
2 Click the green "Start Simulation" button in the top-right corner.
3 Click on the PIR sensor in the circuit and use the Motion slider to trigger it.
4 Watch the LED light up and buzzer activate in real time!
Bonus: Try changing pin numbers in the code and update the wiring to match. What happens?
🌍 Real-World Applications
🏠
Home Security
🏢
Office Intrusion
🚫
Restricted Zones
🌐
IoT Projects
💡
Auto Lights
6
Knowledge Check
Answer 3 questions to complete the module
Question 1 of 3
What signal does the PIR sensor output to the Arduino when it detects motion?
A LOW signal (0V)
B HIGH signal (5V)
C An analog value between 0–1023
D No signal — it directly powers the buzzer
Question 2 of 3
Which Arduino digital pin is the PIR sensor's OUT pin connected to?
A Pin 8
B Pin 9
C Pin 2
D The 5V power pin
Question 3 of 3
Why must the LED be connected through a 220Ω resistor?
A To limit current and prevent the LED from burning out
B To make the LED blink faster
C To boost the LED's brightness
D To connect the LED directly to the PIR sensor
🏆

Module Complete!

You've finished the PIR Theft Alert System module. You know the theory, the wiring, the code — now go build it!

Made with ❤️ for makemindz.com  ·  Summer Online Class 2025  ·  PIR Theft Alert System · Arduino UNO

Comments

try for free