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 |
---|---|
VCC | Power supply input (4.5V to 20V DC) |
OUT | Digital output signal (High/Low) |
GND | Ground connection |
Some PIR sensors may also include additional features such as sensitivity and delay time adjustment knobs.
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's output and turns on an LED when motion is detected.
int pirPin = 2; // PIR sensor output pin
int ledPin = 13; // Built-in LED pin on Arduino
void setup() {
pinMode(pirPin, INPUT); // Set PIR pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int motionDetected = digitalRead(pirPin); // Read PIR sensor output
if (motionDetected == HIGH) { // If motion is detected
digitalWrite(ledPin, HIGH); // Turn on LED
Serial.println("Motion detected!");
} else {
digitalWrite(ledPin, LOW); // Turn off LED
Serial.println("No motion.");
}
delay(100); // Small delay to stabilize readings
}
Sensor Not Detecting Motion:
False Triggers:
Output Signal Stuck HIGH or LOW:
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: Use the sensitivity adjustment knob (if available) or ensure the sensor is mounted at an optimal height and angle.
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: Why does the sensor take time to stabilize after powering on?
A4: The sensor requires a warm-up period (~30 seconds) to calibrate its internal circuitry and avoid false triggers.