What Is a PIR Sensor? How Passive Infrared Motion Detection Works
A PIR sensor (Passive Infrared Sensor) is an electronic device that detects motion by sensing changes in infrared radiation emitted by objects within its field of view. Unlike active sensors that emit energy (like ultrasonic sensors), a PIR sensor is entirely passive — it measures heat energy naturally radiating from people, animals, and warm objects. This makes PIR sensors ideal for security systems, automatic lighting, and occupancy detection in both residential and industrial environments. The sensors work by detecting temperature differences as small as 0.1–0.3°C between a moving object and its background, triggering a digital output signal that can interface with microcontrollers like Arduino or Raspberry Pi, or drive external loads like lights and alarms directly.
Key Takeaways
- PIR sensors detect motion by measuring changes in infrared radiation from warm objects, not by emitting energy
- Standard detection range is 5–10 meters (15–30 feet) with a 110–180° field of view
- Most hobbyist modules (HC-SR501) operate at 3–12V DC and output a digital HIGH/LOW signal
- A Fresnel lens focuses infrared energy onto a pyroelectric dual-element sensor, creating detection zones
- Warm-up time of 30–60 seconds is required for the sensor to stabilize after power-on
- False triggers commonly come from HVAC drafts, sunlight through glass, and small pets
What You Need to Know Before Starting
Before working with PIR sensors, understand that they detect changes in infrared radiation, not stationary heat sources. A person standing still in front of a PIR sensor will eventually disappear from detection — only movement across the sensor’s field of view produces a signal. This is a fundamental design choice that stems from how pyroelectric elements work: they generate charge only during temperature transitions, not at steady-state temperatures.
For most hobbyist projects, you’ll encounter the HC-SR501 module, which is manufactured by the millions and costs $1–3 in bulk. These modules use the BISS0001 signal processor chip, a 14-pin DIP IC that handles all the amplification and threshold detection internally. The module requires 3–12V DC power, ground, and produces a 3.3V/5V-compatible digital output signal that connects directly to any microcontroller GPIO pin.
What the Datasheet Doesn’t Tell You
Professional-grade PIR sensors and budget modules like the HC-SR501 share the same basic architecture but differ significantly in performance. The Fresnel lens focal length — typically 10–15mm on hobbyist modules — directly controls detection range and zone size. Shorter focal lengths create wider, shorter detection zones; longer focal lengths produce narrower, longer zones. Budget sensors use molded plastic lenses with optical imperfections that reduce effective range by 20–30% compared to precision-ground lenses in professional sensors.
Temperature performance is another critical gap. Most HC-SR501 modules experience increased false triggers when ambient temperatures exceed 35°C (95°F), because the temperature differential between the background and a human body decreases from ~12°C at 20°C ambient to only ~5°C at 35°C. Professional sensors use temperature compensation circuits that maintain stable detection up to 45°C. For outdoor applications in hot climates, this specification matters more than detection range.
How a PIR Sensor Works: The Technical Details
A PIR sensor detects motion through three interconnected components: the Fresnel lens, the pyroelectric sensing element, and the signal processing circuit.
The Pyroelectric Sensing Element
At the heart of every PIR sensor is a pyroelectric material — typically a ceramic like barium titanate or a polymer film — that generates an electrical charge when its temperature changes. The material has a spontaneous electric polarization that varies with temperature. When infrared radiation strikes the pyroelectric element, it heats up slightly, changing the polarization and creating a measurable voltage across the material’s electrodes.
Most PIR sensors use two rectangular pyroelectric elements wired in series but with opposite polarization directions. This dual-element design enables differential detection: when both elements receive equal infrared radiation, their signals cancel out. When a warm object moves across one element but not the other, the differential signal spikes above the noise floor, triggering detection. This arrangement also provides some immunity to vibrations, rapid ambient temperature changes, and electromagnetic interference.
The sensor’s spectral response is controlled by an optical filter — typically a 5–14μm bandpass filter that blocks visible light and focuses the sensor on the 8–14μm wavelength range where human bodies emit peak infrared radiation (following Wien’s displacement law). According to Murata’s technical documentation, the 5μm cut-on filter has high transmittance precisely where human body radiation peaks around 10μm.
The Fresnel Lens
Without a lens, a PIR sensor has a detection range of only a few centimeters. The Fresnel lens — the white plastic dome visible on most PIR modules — dramatically extends this range to 5–10 meters by focusing infrared energy from a wide area onto the small pyroelectric element (typically 2mm × 2mm).
A Fresnel lens is essentially a compact version of a conventional convex lens, with concentric annular grooves that bend light toward a focal point. On a PIR sensor, each groove acts as a separate lens segment, creating multiple focal points across the sensor’s field of view. This produces the characteristic “beam pattern” with distinct detection zones. When a warm object moves from one zone to another, the sensor sees a sharp change in infrared energy, triggering the output.
The lens material is specifically chosen for infrared transparency — standard acrylic or polycarbonate plastics transmit 8–14μm wavelengths effectively while blocking visible light. The lens design also determines the field of view: standard HC-SR501 modules have a 110° detection arc, while ceiling-mounted sensors use wide-angle lenses up to 360°.
The Signal Processor (BISS0001)
The raw pyroelectric signal is only millivolts — far too weak for digital logic. The BISS0001 chip (or equivalent) amplifies the signal by 70–80 dB, applies low-pass filtering to remove high-frequency noise, and compares the result against an adjustable threshold. When the differential signal exceeds the threshold, the chip’s output transistor switches, pulling the OUT pin HIGH.
The BISS0001 also handles two timing parameters controlled by potentiometers on the HC-SR501 module:
| Parameter | Range | Function |
|---|---|---|
| **Sensitivity (Hx)** | 3–7m | Adjusts detection threshold — higher values detect smaller temperature changes (and more false triggers) |
| **Time Delay (Tx)** | 1.8s–200s | How long the output stays HIGH after initial detection |
Additionally, the chip supports two output modes:
- H-mode (retriggerable): Each new motion detection resets the time delay timer, keeping the output HIGH as long as motion continues
- L-mode (non-retriggerable): The time delay runs once; subsequent detections during the delay period are ignored until the output returns LOW
Popular PIR Sensor Modules Compared
For hobbyists and prototype developers, three modules dominate the market:
| Module | Voltage | Detection Range | Detection Angle | Special Features | Typical Price |
|---|---|---|---|---|---|
| **HC-SR501** | 3–12V | 3–7m (adjustable) | 110° | Dual potentiometers, jumper for retrigger mode | $1–3 |
| **AM312** | 2.7–12V | 3–5m | 100° | Low power (1mA), smaller form factor | $2–4 |
| **RCWL-0516** | 4–28V | 3–7m | 360° | Microwave дополнение for better through-wall detection | $2–5 |
The HC-SR501 remains the most popular choice despite age because its through-hole construction makes prototyping straightforward and its potentiometer adjustments don’t require code changes. The AM312 is preferred for battery-powered applications due to its 1mA current draw (vs. 3–5mA for HC-SR501). The RCWL-0516 adds microwave detection alongside infrared, reducing false triggers from non-moving heat sources like sunlight.
How to Connect a PIR Sensor to Arduino
Connecting a PIR sensor to an Arduino takes less than five minutes and requires only three wires.
Required components:
- Arduino Uno (or compatible)
- HC-SR501 PIR sensor module
- Jumper wires
- (Optional) 10K pull-up resistor if using L-mode
Wiring:
| HC-SR501 Pin | Arduino Pin | Description |
|---|---|---|
| VCC | 5V | Power supply |
| GND | GND | Ground |
| OUT | Digital Pin 2 | Signal output |
Do not power the HC-SR501 from the Arduino’s 3.3V rail unless you bypass the onboard voltage regulator — the module’s L78L05 regulator requires at least 7V input to function properly. Alternatively, solder a jumper across the regulator’s input/output pins to use 5V directly (see SparkFun hookup guide for pin locations).
Arduino code:
const int pirPin = 2; // Digital pin connected to PIR OUT
const int ledPin = 13; // Built-in LED on most Arduino boards
void setup() {
Serial.begin(9600);
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.println("PIR Sensor Calibrating...");
delay(60); // Allow 30-60 seconds for warm-up/calibration
Serial.println("PIR Sensor Active");
}
void loop() {
int motion = digitalRead(pirPin);
if (motion == HIGH) {
digitalWrite(ledPin, HIGH);
Serial.println("Motion Detected!");
} else {
digitalWrite(ledPin, LOW);
Serial.println("No Motion");
}
delay(500);
}
Critical step: After powering on, the HC-SR501 enters a 30–60 second calibration period during which it “learns” the ambient infrared baseline. Any motion during this period will not trigger the output, and the sensor will produce false negatives immediately after. Plan for this warm-up time in your projects — you can add a status LED or serial message to indicate when calibration is complete.
Troubleshooting Common PIR Sensor Problems
False Triggers
False triggers are the most common complaint with PIR sensors, and they usually stem from environmental factors rather than hardware defects.
The most frequent cause is HVAC airflow. Even though air itself emits minimal infrared radiation, a cold or warm draft striking the sensor’s plastic dome changes its surface temperature slightly. This thermal change propagates through the housing to the pyroelectric element, registering as a false detection. The fix is straightforward: reposition the sensor so the dome faces away from air vents, or mount the sensor at an angle that deflects airflow.
Direct sunlight through glass is another culprit. Strong infrared radiation from sunlight — even filtered through a window — can overwhelm the pyroelectric element and cause saturation. Professional security installers recommend mounting PIR sensors at least 1.5 meters from windows and angling them away from glass surfaces.
Small pets trigger sensors designed for human detection because dogs and cats also emit infrared radiation in the detection band. Pet-immune sensors use smaller pyroelectric elements, narrower detection zones, or elevated sensitivity thresholds. Alternatively, mounting the sensor higher (2.1–2.4m above floor level) and tilting it downward creates a detection zone that excludes the floor where pets move.
No Output Signal
If the sensor produces no output despite motion, the most likely cause is insufficient warm-up time. Some modules, especially older HC-SR501 revisions, require up to 2 minutes at 25°C ambient temperature before producing reliable output. If the sensor works after a long delay, the problem is calibration, not detection range.
Wrong jumper position between H-mode and L-mode can also create the illusion of failure. In L-mode, the sensor triggers once and then ignores subsequent motion for the duration of the time delay setting. If you wave your hand repeatedly and see only one detection, switch the jumper to H-mode for retriggerable operation.
Sensitivity Too Low
If the sensor fails to detect at the rated range (3–7m for HC-SR501), adjust the sensitivity potentiometer clockwise to increase the detection threshold. However, note that increasing sensitivity also increases false triggers from ambient temperature fluctuations. A practical test: have a person walk toward the sensor from the maximum intended detection distance while adjusting the potentiometer to the minimum setting that reliably triggers at that range.
Why PIR Sensors Matter for Electronic Design
PIR sensors are one of the most cost-effective ways to add awareness to electronic projects and products. At $1–3 per module, they provide a detection capability that would cost hundreds of dollars to replicate with thermal cameras or radar sensors. This cost efficiency explains their ubiquity in everything from $5 solar garden lights to million-dollar security systems.
For PCB designers and hardware engineers, the PIR sensor module presents both opportunities and constraints. The module’s analog front-end requires careful PCB layout to avoid noise coupling from digital switching — the pyroelectric element produces microvolt-level signals that are easily overwhelmed by EMI from nearby microcontrollers or power regulators. Professional PIR modules often include shielding cans and dedicated analog ground planes that hobbyist modules lack.
Thermal design is equally critical. The sensor’s optical filter and Fresnel lens are temperature-sensitive — excessive heat warps the lens and changes the focal length, degrading detection zone consistency. For enclosed applications, thermal simulation should account for the sensor’s operating temperature range (typically -10°C to +45°C for standard modules) and include ventilation if the enclosure will experience elevated ambient temperatures.
For custom electronics manufacturing, using standard PIR modules like the HC-SR501 is cost-effective for prototyping but introduces reliability concerns in production. Through-hole connectors vibrate loose over time, and the potentiometer adjustments are prone to drift. For production runs, consider pin-compatible SMD PIR modules or professional sensors with digital interfaces (I²C/SPI) that eliminate analog variability.
Need help designing a product that incorporates motion detection? Our engineering team has experience integrating PIR sensors into consumer electronics, industrial equipment, and IoT devices. We can review your schematic, thermal design, and firmware to ensure reliable detection across your target operating environment.
[Get a Free Design Review → https://www.wellcircuits.com/contact-2/]
Frequently Asked Questions
How does a PIR sensor detect motion?
A PIR sensor detects motion by measuring changes in infrared radiation across its field of view. The sensor contains pyroelectric elements that generate a small voltage when exposed to temperature changes as small as 0.1–0.3°C. A moving warm object (like a human body at 37°C) creates a differential temperature signal between two pyroelectric elements, which the signal processor amplifies and converts into a digital HIGH output. The sensor cannot detect stationary objects because pyroelectric materials produce charge only during temperature transitions.
Can a PIR sensor detect through walls?
Standard PIR sensors cannot detect through walls because building materials like drywall, brick, and concrete block infrared radiation in the 8–14μm wavelength range. However, the RCWL-0516 module combines PIR sensing with 5.8GHz microwave detection, which can penetrate thin walls and detect motion through drywall. Microwave-based detection is more prone to false triggers from moving objects outside the building, so the dual-technology approach is preferred for through-wall applications.
What’s the difference between PIR and ultrasonic sensors?
PIR sensors detect warm moving objects (people, animals) by measuring infrared radiation, while ultrasonic sensors emit high-frequency sound waves (40kHz) and measure echo time-of-flight to detect any object regardless of temperature. PIR sensors use less power, work at longer ranges (up to 10m), and are insensitive to sound; ultrasonic sensors can measure precise distances and detect stationary objects but consume more power and are affected by acoustic noise. For presence detection and occupancy sensing, PIR is the dominant choice; for distance measurement and object avoidance, ultrasonic is preferred.
What causes PIR sensor false triggers?
False triggers in PIR sensors most commonly come from HVAC airflow striking the sensor dome, direct sunlight through glass, rapid ambient temperature changes, small pets (for standard human-detecting sensors), and electromagnetic interference from nearby motors or power supplies. Professional installations avoid false triggers by mounting sensors away from windows and air vents, using pet-immune sensors for animal-present environments, and selecting modules with appropriate temperature compensation circuits for outdoor or industrial applications.
How long does a PIR sensor take to calibrate?
Most PIR sensors require 30–60 seconds of warm-up time after power-on to calibrate to ambient infrared baseline levels. During this calibration period, the sensor’s internal circuitry learns the steady-state infrared radiation pattern of the environment and adjusts its detection threshold accordingly. Any motion during calibration is ignored. Some modules in high-temperature environments may require up to 2 minutes. Always include a warm-up period in your firmware initialization sequence.
Conclusion
A PIR sensor is a versatile, low-cost motion detection solution that works by passively measuring infrared radiation changes from warm objects. Its dual-element pyroelectric design, Fresnel lens optics, and integrated signal processing enable reliable human and animal detection at ranges up to 10 meters for under $3. For hobbyists, the HC-SR501 remains the go-to module; for production designs, consider modules with digital interfaces and temperature compensation for improved consistency.
The key to reliable PIR operation is understanding its limitations: it detects motion, not presence; it needs warm-up time; and it false-triggers from thermal drafts and direct sunlight. With proper mounting, sensitivity adjustment, and environmental isolation, PIR sensors provide years of maintenance-free detection in security systems, smart lighting, occupancy sensing, and countless embedded applications.
For engineers designing products that require motion awareness, the PIR sensor offers a compelling combination of cost, simplicity, and effectiveness — trade-offs that explain its 50+ year dominance in the motion detection market. The physics haven’t changed; only the packaging and integration have evolved.