PIR Sensor Wiring Diagram: 3-Wire Connection and Circuit Integration
This is a free printable pir wiring diagram: download the diagram as SVG or open it and print to paper or PDF.
A PIR (Passive Infrared) sensor typically has three wires — positive supply (V+), ground (GND), and signal output (OUT) — and detects human motion by sensing changes in infrared radiation emitted by moving warm bodies.
A PIR (Passive Infrared) sensor detects motion by measuring changes in infrared radiation across its sensing zone. The sensor contains a pyroelectric element (typically lithium tantalate or similar) split into two halves. When a warm body moves across the field of view, it sequentially warms one half of the element and then the other, generating a differential signal that the sensor's built-in comparator interprets as motion.
The three-wire interface is standard across virtually all module-type PIR sensors: V+ (supply, typically 5V or 3.3V DC for module types, or 5–20V for standalone sensors), GND (supply negative), and OUT (signal output, typically logic-level active high during detection). Some standalone PIR sensors designed for mains-powered security lighting use a different interface — they contain a triac or relay output and are wired into the load circuit rather than a microcontroller.
The signal output on module PIR sensors is generally an open-drain or push-pull digital output that goes high (to V+) when motion is detected and returns low after a configurable hold-off time. Two key adjustments are common on module PIR boards: sensitivity (a potentiometer adjusting the detection threshold and therefore range, typically 3–7 metres) and time delay (a potentiometer adjusting how long the output remains high after the last motion event, typically 0.3 seconds to several minutes). Some modules also offer a retriggering jumper: non-retriggering mode holds the output high for a fixed period regardless of continued motion; retriggering mode restarts the timer with each detected motion event.
PIR sensors have a detection angle of approximately 90–120 degrees horizontal and 90 degrees vertical. They cannot see through glass (glass blocks infrared). They also produce false triggers from heat sources — air conditioning vents, heaters, or sunlight patches moving across the floor — which must be considered when positioning the sensor.
For mains-voltage security lighting applications, the PIR unit contains an internal relay or triac rated to switch the lamp load directly and is wired in series with the live conductor feeding the luminaire — a licensed electrician must install and connect mains-voltage PIR units.
How to wire pir wiring diagram
- Identify the three PIR sensor pins Consult the specific sensor or module datasheet to identify V+, GND, and OUT pin positions — pin order varies between manufacturers and module types. Never assume pin order from position alone.
- Connect the supply voltage Connect V+ to the appropriate regulated supply voltage for your sensor (typically 5V DC for HC-SR501 type modules, or 3.3V for low-voltage variants). Connect GND to the supply negative. Ensure the supply can provide the sensor's quiescent current (typically 50–65mA during detection, less while idle).
- Connect the signal output to your controller Connect the OUT pin to a digital input on your microcontroller, relay module, or control circuit. For a direct LED indicator, connect OUT through a 470Ω series resistor to an LED, with the LED cathode returning to GND.
- Allow the sensor warm-up period After power-on, PIR sensors require 30–60 seconds to stabilise thermally before producing reliable output. During this period, the output may pulse randomly. Design your system to ignore the sensor output for at least 60 seconds after power-on.
- Adjust sensitivity and time-delay With the sensor mounted in its intended position, walk through the detection zone and use a small screwdriver to adjust the sensitivity potentiometer until reliable detection occurs at the desired range. Adjust the time-delay potentiometer to the required hold-on time.
- Select retriggering mode if required Set the retriggering jumper to H (retriggering) if the output should remain high during continuous motion. Set it to L (non-retriggering) for a fixed output pulse duration regardless of continued motion.
- Test and refine sensor placement Walk through the full intended detection zone and verify consistent triggering. Check for false triggers by leaving the area clear for several minutes while the sensor runs. Reposition or shade the sensor if false triggers from heat sources occur.
Specifications
| Typical supply voltage (HC-SR501 module type) | 4.5V – 20V DC |
|---|---|
| Quiescent current (idle, no detection) | < 60µA (module-level, supply-dependent) |
| Output voltage (logic high) | 3.3V (some modules) or ~V+ (others) — check datasheet |
| Detection range (adjustable) | 3m – 7m typical |
| Detection angle (horizontal) | Approximately 120° |
| Warm-up time after power-on | 30–60 seconds |
| Output hold-on time (adjustable) | ~0.3 seconds – 5 minutes (potentiometer-controlled) |
| Operating temperature range (typical) | -20°C to +80°C |
Safety warnings
- Module-type PIR sensors operate at low voltage (3.3V or 5V DC) and are safe to handle during installation, but ensure the DC supply is off before making or changing connections to avoid short circuits.
- Never connect a low-voltage PIR module directly into a mains-voltage circuit. For mains-voltage motion-activated lighting, use only a mains-rated PIR unit designed and approved for that purpose, installed by a licensed electrician.
- Mains-voltage PIR security sensors must be installed in accordance with local electrical codes (BS 7671, NEC, AS/NZS 3000, or equivalent). The live conductor to the lamp must be interrupted, not the neutral.
- Do not exceed the maximum supply voltage for the PIR module — overvoltage will permanently damage the sensor IC. Check the datasheet before connecting power.
- PIR sensor placement near heat sources, HVAC outlets, or windows exposed to direct sunlight can cause persistent false triggers that may activate unintended load switching.
Tools needed
- Digital multimeter (for verifying supply voltage and confirming output logic levels)
- Breadboard or PCB for prototyping connections
- Small flat-head screwdriver for adjusting the sensitivity and time-delay potentiometers
- Wire strippers and jump wires
- Computer or microcontroller with serial monitor (for logging detection events during testing)
- Regulated 5V DC power supply or USB power bank
Common mistakes
- Reversing the V+ and GND connections, which applies reverse polarity to the sensor IC and permanently damages it — always verify pin assignments from the datasheet before applying power.
- Testing the sensor immediately after power-on without allowing the 30–60 second warm-up period, causing false alarms that lead to incorrect conclusions about sensor behaviour.
- Mounting the sensor on a vibrating surface, such as a door frame or industrial enclosure, which can generate sufficient physical shock to cause false triggering via mechanical vibration of the pyroelectric element.
- Placing the sensor within line of sight of a heat source or air conditioning vent, causing continuous false triggering that cannot be resolved by reducing sensitivity alone.
- Connecting the OUT pin to a 3.3V GPIO pin when using a 5V-supply module — the output can reach 5V logic high, which exceeds the 3.3V maximum rating of many microcontroller GPIO inputs and can damage the device.
Troubleshooting
- PIR output never goes high — no detection
- Cause: Insufficient supply voltage, reversed supply polarity, or sensor in warm-up phase; alternatively, sensitivity set too low or detection zone misaligned Fix: Verify supply voltage at the V+ pin with a multimeter. Confirm GND is connected. Wait 60 seconds after power-on. Walk slowly through the sensor's field of view. Increase sensitivity potentiometer by one-quarter turn and retest.
- PIR output triggers continuously with no one present
- Cause: Heat sources (HVAC vent, heater, sunlight) in the detection zone, or sensitivity set too high, or RFI interference Fix: Identify and shield or reorient the sensor away from heat sources. Reduce sensitivity potentiometer. Move sensor away from Wi-Fi routers or high-power RF sources. Add a 100nF decoupling capacitor between V+ and GND at the sensor.
- Output goes high but immediately drops without holding for the expected time
- Cause: Time-delay potentiometer set to minimum (fast reset) or sensor in non-retriggering mode with a very short time setting Fix: Increase the time-delay potentiometer clockwise. If retriggering is needed, change the jumper to the H (retriggering) position.
Frequently asked questions
What are the three wires on a PIR sensor and what does each do?
V+ (or VCC) is the positive supply voltage, typically 5V or 3.3V for module types. GND is the supply negative and signal reference. OUT (or SIGNAL or DATA) is the digital output — it goes to a logic-high voltage when motion is detected and returns to logic-low when detection times out. Always check your specific sensor's datasheet as pin order varies.
Why does my PIR sensor trigger repeatedly even with no one present?
Common causes are heat sources in the detection zone (HVAC vents, direct sunlight, heaters), which cause infrared changes that mimic motion. Radio frequency interference can also cause false triggers on some modules. Shield the sensor from direct sunlight, reposition away from heat sources, and reduce the sensitivity potentiometer setting.
Can I connect a PIR sensor directly to a 5V Arduino or Raspberry Pi GPIO?
Most HC-SR501-type PIR modules operate on 5V supply and output a 3.3V or 5V logic signal, making them compatible with Arduino GPIO directly. For 3.3V GPIO systems (Raspberry Pi), use a 3.3V-supply PIR module or a level-shifting resistor divider on the output to avoid exceeding the 3.3V GPIO input maximum.
How do I wire a PIR sensor to switch a mains lamp directly?
Do not use a module PIR for mains switching — module PIRs output a low-voltage logic signal only. For mains lamp switching, use a dedicated mains PIR security sensor designed for the purpose. These contain an internal relay or triac, connect to the mains supply, and switch the lamp live conductor. A licensed electrician must install mains-voltage PIR units.
What is the difference between the sensitivity and time-delay potentiometers on a PIR module?
The sensitivity potentiometer adjusts the threshold of the pyroelectric comparator, effectively controlling detection range — turning it down reduces sensitivity and range, which helps eliminate false triggers from distant heat sources. The time-delay potentiometer controls how long the output remains high after the last motion event before returning to low, from fractions of a second up to several minutes.
Related diagrams
- pir motion sensor wiring diagram
- pir sensor circuit diagram
- pir sensor diagram
- pir sensor pin diagram
- wiring diagram for outside light with pir