Motion detection is a fundamental requirement in many embedded and IoT applications such as security systems, automatic lighting, energy management, and smart homes.In this project, we build a motion detection system using a PIR (Passive Infrared) sensor and Arduino. When motion is detected, the Arduino triggers an output (LED and serial alert).
This project is beginner-friendly, low-cost, and widely used in real-world systems.
2. How PIR Motion Sensor WorksA PIR sensor detects infrared radiation changes emitted by warm objects like humans or animals.
Key points:
- It does not emit radiation
- It senses changes in IR levels
- Best for detecting human movement
- Typical range: 3–7 meters
int pirPin = 2; // PIR sensor output pin
int ledPin = 13; // LED pin
int motionState = 0;
void setup() {
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
Serial.println("PIR Motion Sensor Initialized");
}
void loop() {
motionState = digitalRead(pirPin);
if (motionState == HIGH) {
digitalWrite(ledPin, HIGH);
Serial.println("Motion Detected!");
delay(1000);
} else {
digitalWrite(ledPin, LOW);
Serial.println("No Motion");
delay(500);
}
}6. Working Explanation
PIR sensor continuously monitors infrared changes.
When a human moves in front of the sensor
- Output pin goes HIGH
- Arduino detects motion
- LED turns ON
- Message displayed on Serial Monitor
When no motion is present:
- Output pin remains LOW
- LED stays OFF
- Home Security Systems
- Automatic Door Lights
- Smart Street Lighting
- Intruder Alarm Systems
- Energy Saving Systems
- IoT-based Surveillance
- Allow 30–60 seconds warm-up time after powering the PIR sensor
- Adjust Sensitivity and Delay using onboard potentiometers
- Avoid placing near heat sources or direct sunlight
- Integrate with buzzer or relay
- Send alerts via Wi-Fi (ESP8266/ESP32)
- Log motion data to cloud
- Add LCD/OLED display
- Combine with camera module
This project demonstrates a reliable and practical motion detection system using Arduino and a PIR sensor. It serves as a strong foundation for security, automation, and IoT applications and is well-suited for beginners and intermediate makers alike.



_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)





Comments