

A Passive Infrared (PIR) motion sensor detects motion by measuring changes in infrared radiation, typically emitted by warm bodies. It is a low-cost, low-power device widely used in motion detection applications. PIR sensors are commonly found in security systems, automatic lighting, and energy-saving devices. They are ideal for detecting human or animal movement within a specific range.








Below are the key technical details of a typical PIR motion sensor:
The PIR motion sensor typically has three pins. Below is the pinout description:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (4.5V to 20V DC). Connect to the positive terminal of the power source. |
| 2 | OUT | Digital output pin. Outputs HIGH (3.3V/5V) when motion is detected, LOW (0V) otherwise. |
| 3 | GND | Ground pin. Connect to the negative terminal of the power source. |
Some PIR sensors may also include adjustable potentiometers for sensitivity and delay time settings.
Below is an example of how to connect and use a PIR motion sensor with an Arduino UNO:
// PIR Motion Sensor Example with Arduino UNO
// This code reads the PIR sensor output and turns on an LED when motion is detected.
const int pirPin = 2; // PIR sensor output pin connected to Arduino pin 2
const int ledPin = 13; // Built-in LED pin on Arduino
void setup() {
pinMode(pirPin, INPUT); // Set PIR sensor pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication for debugging
}
void loop() {
int motionDetected = digitalRead(pirPin); // Read PIR sensor output
if (motionDetected == HIGH) { // If motion is detected
digitalWrite(ledPin, HIGH); // Turn on the LED
Serial.println("Motion detected!"); // Print message to serial monitor
} else {
digitalWrite(ledPin, LOW); // Turn off the LED
Serial.println("No motion."); // Print message to serial monitor
}
delay(100); // Small delay to stabilize readings
}
Sensor Not Detecting Motion
False Triggers
Output Stuck HIGH or LOW
Interference with Other Devices
Q1: Can the PIR sensor detect motion through glass?
A1: No, PIR sensors cannot detect motion through glass as infrared radiation does not pass through it effectively.
Q2: How do I increase the detection range?
A2: Adjust the sensitivity potentiometer (if available). Alternatively, use a lens with a wider field of view.
Q3: Can I use the PIR sensor outdoors?
A3: Yes, but ensure it is housed in a weatherproof enclosure to protect it from rain and extreme temperatures.
Q4: What is the typical lifespan of a PIR sensor?
A4: PIR sensors are highly reliable and can last for several years under normal operating conditions.