A Passive Infrared (PIR) Motion Sensor detects motion by measuring changes in infrared radiation, typically emitted by objects in its field of view. These sensors are widely used in security systems, automatic lighting, and home automation due to their ability to detect human or animal movement efficiently. PIR sensors are cost-effective, low-power, and easy to integrate into various electronic projects.
Below are the key technical details of a typical PIR motion sensor:
Parameter | Value |
---|---|
Operating Voltage | 3.3V to 5V |
Current Consumption | < 60 µA (standby) |
Detection Range | 3 to 7 meters (adjustable) |
Detection Angle | 110° to 120° |
Output Signal | Digital (High: 3.3V/5V, Low: 0V) |
Warm-up Time | 30 to 60 seconds |
Operating Temperature | -20°C to 50°C |
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply pin. Connect to 3.3V or 5V. |
2 | OUT | Digital output pin. Outputs HIGH (3.3V/5V) when motion is detected, LOW (0V) otherwise. |
3 | GND | Ground pin. Connect to the ground of the circuit. |
Below is an example of how to connect and use a PIR motion sensor with an Arduino UNO to control an LED:
// PIR Motion Sensor with Arduino Example
// This code turns on an LED when motion is detected by the PIR sensor.
const int pirPin = 2; // PIR sensor output pin connected to digital pin 2
const int ledPin = 13; // LED connected to digital pin 13
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 Stays HIGH or LOW Constantly:
Interference with Other Devices:
Q: Can the PIR sensor detect stationary objects?
A: No, PIR sensors detect motion by sensing changes in infrared radiation. Stationary objects will not trigger the sensor.
Q: How do I increase the detection range?
A: Adjust the sensitivity potentiometer on the sensor. Note that increasing sensitivity may also increase false triggers.
Q: Can I use the PIR sensor outdoors?
A: Yes, but ensure it is protected from direct sunlight, rain, and extreme temperatures for reliable operation.
Q: What is the warm-up time, and why is it needed?
A: The warm-up time (30-60 seconds) allows the sensor to stabilize and calibrate to its environment after powering on.