PIR Sensor Pin Diagram
This is a free printable pir sensor pin diagram: download the diagram as SVG or open it and print to paper or PDF.
Reference pin diagram and wiring guide for pyroelectric passive infrared sensor modules covering VCC, GND, and OUT pin connections and adjustments.
A passive infrared (PIR) sensor detects motion by measuring changes in infrared radiation emitted by warm objects — principally humans and animals — passing through its detection field. It is 'passive' because it does not emit radiation itself; it only detects incoming IR energy changes.
A standard PIR sensor breakout module (the type commonly used in electronics projects and building security) presents three pins: VCC (power supply), GND (ground reference), and OUT (digital output signal).
VCC pin: The module power supply input. Most commonly 5 V DC, though some modules accept a range of 3.3 V to 12 V depending on the internal regulator design. Always verify the specific module's datasheet for supply voltage range.
GND pin: Circuit ground reference. Must be connected to the same ground as the microcontroller, relay module, or other downstream circuit to ensure a common reference.
OUT pin: The digital output. When the PIR detects motion, the OUT pin goes HIGH (typically to VCC potential). When no motion is detected, OUT remains LOW (at GND). Output voltage is typically the same as VCC for HIGH state. The duration the output stays HIGH after motion ceases is controlled by the sensitivity (Sx) trimmer potentiometer on the module. The detection distance range is controlled by a separate trimmer.
Module adjustments: Most HC-SR501-style PIR modules include two trimmer potentiometers on the PCB. One adjusts sensitivity (detection range, typically 3–7 metres). The other adjusts the output delay (how long the OUT pin remains HIGH after motion ceases, typically 5 seconds to 300 seconds). A jumper on the module selects between two trigger modes: L (single trigger — output goes LOW between each trigger event) and H (repeat trigger — output stays HIGH as long as motion is continuously detected).
The Fresnel lens dome covering the sensor element focuses IR from the detection zone onto the pyroelectric element. The lens design defines the detection angle (typically 100–120°).
This is an illustrative reference. Always verify pin assignments against the specific module's datasheet.
How to wire pir sensor pin diagram
- Verify module supply voltage and output voltage from datasheet Before connecting, confirm the specific PIR module's VCC range and OUT pin voltage level. Do not assume 5 V compatibility. Some modules accept 3.3 V–12 V; OUT voltage typically matches VCC. This determines whether a logic level shifter is needed.
- Connect GND to common reference Connect the module's GND pin to the GND of the microcontroller, relay board, or control circuit. A common ground reference is essential for correct signal interpretation.
- Connect VCC to an appropriate supply Supply the module's VCC pin with the correct regulated voltage (typically 5 V DC for most modules). Use a stable regulated supply — PIR modules are sensitive to voltage noise, which can cause false triggers.
- Connect OUT to a digital input or relay trigger Connect the OUT pin to a GPIO input pin on the microcontroller (with attention to logic voltage) or directly to a relay module's input pin. Add a 10 kΩ pull-down resistor on the receiving input if the module does not include one internally.
- Set trigger mode jumper Position the jumper on the module for either L (single trigger) or H (repeat trigger) mode depending on the application. For lighting automation, H mode keeps lights on while motion continues.
- Set sensitivity and delay trimmers After powering the circuit (allow 30–60 seconds stabilisation), adjust the sensitivity trimmer for the desired detection range and the time-delay trimmer for the desired output hold time. Test with actual human movement across the detection zone.
- Allow stabilisation time on power-up Implement a software delay of at least 30–60 seconds after power-up before the system acts on PIR output. Ignore multiple trigger events during this initialisation period to prevent false activation on start-up.
Specifications
| Typical supply voltage | 5 V DC (some modules: 3.3 V – 12 V; verify datasheet) |
|---|---|
| Output type | Digital: HIGH = motion detected, LOW = no motion |
| Typical detection range | 3 m – 7 m (adjustable via sensitivity trimmer) |
| Detection angle (Fresnel lens) | Approximately 100° – 120° |
| Output delay range (adjustable) | Approximately 5 seconds – 300 seconds |
| Stabilisation time after power-up | 30 – 60 seconds |
| Trigger modes | L (single trigger) or H (repeat trigger) — jumper selectable |
Safety warnings
- Verify module output voltage before connecting to a microcontroller GPIO. A 5 V output connected to a 3.3 V-only GPIO can permanently damage the microcontroller.
- Do not power the PIR module with unregulated or noisy supplies. Voltage ripple and noise cause false trigger events.
- If the PIR sensor is installed as part of a mains-connected security or lighting circuit, all mains wiring must be performed by a licensed electrician in compliance with NEC/NFPA 70, BS 7671, AS/NZS 3000, or IEC 60364.
- PIR modules contain no user-serviceable components. Do not disassemble the Fresnel lens assembly — the pyroelectric element is sensitive to physical damage.
- This is an illustrative reference only. Always verify pin assignments from the specific module's datasheet before connecting.
Tools needed
- Digital multimeter (voltage measurement)
- Small flat-blade screwdriver (for trimmer potentiometer adjustment)
- Breadboard or PCB for initial circuit assembly
- Oscilloscope or logic analyser (for OUT signal verification)
- Regulated 5 V DC bench power supply
- Jumper wires
Common mistakes
- Assuming a fixed 3-pin order (VCC, GND, OUT) across all PIR modules — pin order varies by manufacturer and module variant. Always check the PCB silkscreen or datasheet.
- Testing the sensor immediately after power-up without allowing the 30–60 second stabilisation period, misidentifying normal warm-up triggers as sensor faults.
- Supplying the module with an unregulated or excessively noisy 5 V source, causing constant false triggers.
- Connecting the 5 V OUT signal directly to a 3.3 V GPIO without voltage level conversion, damaging the microcontroller.
- Setting the time-delay trimmer to maximum (several minutes) during initial testing, making it appear the sensor is not resetting between motion events.
Troubleshooting
- PIR constantly triggers false positives (no visible movement present)
- Cause: Electrical noise on supply rail, HVAC air currents causing temperature gradients, or warm objects (radiators, direct sunlight) in the detection field Fix: Add decoupling capacitor on VCC. Reorient sensor away from heat sources, HVAC vents, and direct sunlight. Shield the Fresnel lens from airflow-driven temperature gradients.
- PIR output does not reset between motion events
- Cause: Time-delay trimmer set too high, or H (repeat trigger) mode selected with continuous occupancy Fix: Reduce the time-delay trimmer setting. If using H mode, note that output stays HIGH while motion continues — this is correct behaviour. Switch to L mode if discrete events are needed.
- No output signal even with confirmed motion in detection zone
- Cause: VCC not connected, GND reference missing, or module outside its warm-up period Fix: Verify VCC and GND connections with a multimeter. Allow 60 seconds from power-up. Test OUT pin voltage with a multimeter while moving in the detection zone.
Frequently asked questions
What do the three pins on a PIR sensor module represent?
The three pins are: VCC (power supply, typically 5 V DC), GND (ground reference), and OUT (digital output that goes HIGH when motion is detected). Pin ordering varies by module — verify against the specific module's datasheet or PCB silkscreen label before connecting.
How do I adjust the sensitivity and detection time on an HC-SR501 module?
Two trimmer potentiometers on the PCB control these parameters. The sensitivity trimmer adjusts detection range (typically 3–7 m). The time-delay trimmer adjusts how long the OUT pin stays HIGH after motion ceases (typically 5 s to 300 s). Rotate clockwise to increase each parameter.
What is the difference between L and H trigger mode on a PIR module?
In L (single trigger) mode, the output goes LOW briefly between consecutive motion events. In H (repeat trigger) mode, the output remains HIGH continuously as long as motion keeps being detected. H mode is preferred for lighting control; L mode for pulse-counted event detection.
Why does a PIR sensor trigger falsely when first powered on?
PIR sensors require a stabilisation period after power-up — typically 30–60 seconds — during which the pyroelectric element adjusts to the ambient IR level. The OUT pin may trigger multiple times during this warm-up period. Most control circuits implement a software or hardware delay before acting on PIR output.
Can I connect a PIR sensor directly to a 3.3V microcontroller GPIO?
It depends on the module. Some PIR modules are 3.3 V-compatible; others require 5 V and output HIGH at 5 V, which would damage a 3.3 V GPIO. Verify the module's supply voltage and output voltage specifications. Use a voltage divider or logic level shifter if the output voltage exceeds the GPIO's maximum input voltage.
Related diagrams
- 6 pin throttle position sensor wiring diagram
- ir sensor pin diagram
- pir motion sensor wiring diagram
- pir sensor circuit diagram
- pir sensor diagram
- ultrasonic sensor pin diagram