PIR Sensor Circuit Diagram: Wiring, Output Modes, and Connections
This is a free printable pir sensor circuit diagram: download the diagram as SVG or open it and print to paper or PDF.
A PIR (Passive Infrared) sensor detects motion by measuring changes in infrared radiation from warm bodies. This guide covers sensor wiring, relay output connections, supply voltage, and common configuration pitfalls.
A Passive Infrared (PIR) sensor does not emit any radiation — it is entirely passive. It contains a pyroelectric sensor element (typically lithium tantalate or a similar material) that generates a small voltage when the level of infrared radiation falling on it changes. Because a human body at approximately 37°C emits infrared radiation in the 8–14 micrometre range, movement of a person through the sensor's field of view causes the infrared level to change, triggering the output.
The sensing element consists of two or more pyroelectric cells arranged differentially. Stationary objects at a constant temperature produce no differential signal. A moving warm body creates a sequential change — first illuminating one cell, then the other — generating the differential signal the circuit detects. This is why a PIR does not trigger on a static warm object and why very slow movement can sometimes avoid detection.
Fresnel lens design governs the detection pattern. The segmented lens focuses infrared from different spatial zones onto the sensor element and determines whether the pattern is wide-angle (120°–180°), curtain (narrow vertical zones), or long-range (narrow cone to 20+ metres). The correct lens type matters as much as the sensor placement.
Most PIR modules — from discrete through-hole circuits to integrated PCB assemblies — provide three connections: supply voltage (VCC), ground (GND), and a digital output pin (OUT). The output is typically open-collector or push-pull 3.3V/5V logic, or a relay output on higher-power modules. The output goes HIGH (or the relay energises) when motion is detected and returns LOW (or de-energises) after the configured hold time.
Two key adjustable parameters appear on most PIR modules: sensitivity (which adjusts the amplifier gain and therefore the detection distance) and time delay (which sets how long the output remains active after the last detected motion). These are typically set via small potentiometers on the PCB.
Output modes vary: retriggerable (H mode) resets the hold-time countdown on every new detection event, keeping the output active as long as motion continues; non-retriggerable (L mode) produces a fixed-duration pulse per trigger regardless of continued motion. Retriggerable mode is standard for lighting control; non-retriggerable is common in alarm pulse generation.
For mains-voltage lighting control, the PIR's logic output drives a relay or triac output stage — the low-power logic output never directly switches mains current.
How to wire pir sensor circuit diagram
- Determine supply voltage and output type Check the PIR module's datasheet for VCC range (typically 3.3V, 5V, or 12V DC depending on module) and output type (logic level, open-collector, or relay). Ensure your power supply matches the module's requirements. Do not apply 12V to a 5V module or 5V to a 3.3V-only MCU input without level shifting.
- Make the three primary connections Connect VCC to the module's positive supply pin, GND to the module's ground pin, and the output pin to your load control circuit (relay module input, microcontroller GPIO, or directly to a relay coil if the output is rated for it). Keep VCC and GND wires short and decoupled — place a 100nF ceramic capacitor between VCC and GND directly at the module pins.
- Set sensitivity and time-delay potentiometers Locate the two preset potentiometers on the PCB (if present). The sensitivity potentiometer adjusts detection distance — turn clockwise to increase range, counter-clockwise to reduce. The time-delay potentiometer adjusts how long the output remains active after the last detection event — range is typically 5 seconds to several minutes. Set both before mounting the sensor in its final position.
- Select output mode (H or L) If the module has an H/L mode jumper (a three-pin header with a jumper), position it for the required mode. H mode (retriggerable) is appropriate for lighting control where the light should remain on while occupancy continues. L mode (non-retriggerable) is appropriate for alarm pulse generation where a single event should produce one discrete timed output.
- Mount the sensor with correct orientation and coverage Mount the PIR sensor so its Fresnel lens covers the intended detection zone. Corner mounting at ceiling height (2.1–2.4m) provides wide area coverage. Avoid pointing the sensor toward windows, HVAC vents, or heat sources. Ensure no physical obstructions break the line of sight across the detection zone. Glass and most plastics block infrared — do not mount behind them.
- Wire the relay or triac output to the load If using a relay module: connect the relay's NO (normally open) and COM (common) contacts in series with your load circuit. The relay contact is isolated from the PIR logic circuit — it can switch mains voltage if the relay is rated for it, but the PIR module itself must never be connected to mains. If using a triac-based mains PIR switch (an integrated unit designed for mains installation), follow the manufacturer's mains wiring diagram exactly.
- Power on, calibrate, and test Apply power and allow 30–60 seconds for the PIR element to stabilise and auto-adjust to ambient infrared levels (most modules have an initialisation period during which false triggers are normal). After the initialisation period, walk through the detection zone from different angles to verify coverage. Adjust sensitivity if detection distance is insufficient or excessive.
Specifications
| Sensor element type | Dual-element differential pyroelectric sensor |
|---|---|
| Typical supply voltage | 5V DC (MCU modules) or 12V DC (panel-mount modules); verify per product |
| Output type | Digital logic (3.3V or 5V push-pull or open-collector); relay contact on some models |
| Typical detection distance | 3–7 metres (adjustable via sensitivity potentiometer on most modules) |
| Typical detection angle | 100°–120° horizontal (lens-dependent); narrower for long-range Fresnel configurations |
| Initialisation time after power-up | 30–60 seconds (element thermal stabilisation period) |
| Time delay adjustment range (typical) | 5 seconds to approximately 5 minutes (module-dependent) |
| Infrared sensitivity band | 8–14 micrometres (peak human body emission range) |
Safety warnings
- Never connect the PIR module's logic output or supply pins to mains voltage. PIR modules are low-voltage devices. Mains voltage control requires a relay or triac module rated for mains use, with the mains circuit fully isolated from the low-voltage control circuit.
- Mains-voltage PIR switches (integrated units designed for direct mains installation) must be wired by a licensed electrician in accordance with applicable wiring codes (IEC 60364, BS 7671, NEC/NFPA 70, AS/NZS 3000). These devices interrupt live mains conductors and carry the same safety requirements as any mains switch.
- Isolate and verify dead any mains circuit before working on it. Use a calibrated voltage tester before touching any conductor. Confirm the tester is functioning on a known live source before and after each dead test.
- Ensure any relay used to switch mains loads is rated for the mains voltage and current. A relay rated for DC loads has a lower AC switching current rating due to arc quenching differences — do not interchange ratings.
- This guide is for illustrative and reference purposes. Installations involving mains voltage must comply with applicable standards and be performed by suitably qualified persons.
Tools needed
- Digital multimeter (DC voltage and continuity functions)
- Small flat-blade screwdriver (for potentiometer adjustment)
- Wire stripper
- Soldering iron and solder (if soldering connections to PCB headers)
- Non-contact voltage tester (for mains circuits)
- Drill and fixings (for sensor mounting)
Common mistakes
- Mounting the sensor directly facing a window: sunlight, vehicle headlights, or radiant heat from the glass causes constant false triggering.
- Applying 12V directly to a 5V module: over-voltage destroys the signal conditioning IC and possibly the pyroelectric element. Always verify and match supply voltage.
- Connecting the relay coil directly to the PIR logic output without a flyback diode: the inductive kickback from the relay coil when it de-energises can exceed the output transistor's voltage rating and damage the PIR module.
- Skipping the initialisation wait period: PIR modules produce false triggers for 30–60 seconds after power-up as the pyroelectric element settles to ambient. Triggering an alarm during this period does not indicate a fault.
- Pointing the sensor at an HVAC vent: air movement itself does not trigger PIR, but the thermal gradient from warm or cold air rapidly changing the infrared scene does — the result is continuous or random triggering.
Troubleshooting
- Sensor triggers constantly with no movement present
- Cause: Heat source or infrared-emitting object (HVAC vent, sunlight, warm equipment) in the field of view; supply voltage noise causing false triggers; or defective module Fix: Re-orient the sensor away from heat sources and windows. Add a 100nF ceramic capacitor between VCC and GND at the module. Reduce sensitivity via the sensitivity potentiometer. Test in a stable environment with no HVAC or sunlight to isolate whether the issue is environmental or electronic.
- Sensor does not trigger even when walking directly in front of it
- Cause: Sensitivity set too low; supply voltage too low or outside specified range; Fresnel lens blocked or dirty; or sensor in initialisation period Fix: Verify supply voltage is within the module's specified range. Increase sensitivity via the potentiometer. Clean the Fresnel lens with a dry cloth. Wait 60 seconds after power-up before expecting normal operation. Confirm the sensor is not behind glass or a material that blocks infrared.
- Output activates but connected relay does not energise
- Cause: Relay coil voltage or current requirement exceeds the PIR output's drive capability; or relay module's input polarity is active-low but being driven high Fix: Measure the PIR output voltage when active and compare to the relay module's input trigger voltage. If the PIR output is insufficient to drive the relay directly, interpose a transistor switch (NPN, base resistor ~1kΩ) to provide sufficient coil current. Check relay module's trigger polarity requirement.
Frequently asked questions
What does passive mean in PIR sensor?
Passive means the sensor does not emit any signal. It only receives ambient infrared radiation. This contrasts with active sensors (such as ultrasonic or microwave sensors) that emit a signal and detect the reflection. The PIR simply measures changes in received infrared energy caused by a warm moving body entering or crossing its field of view.
Why does my PIR sensor trigger randomly with no one present?
Common causes include: HVAC vents blowing warm air that rapidly changes the infrared scene; sunlight or vehicle headlights sweeping across the sensor's field of view; small animals or insects crossing the detection zone; or electrical interference on the supply causing noise on the output. Shield the sensor from direct sunlight and heat sources, and decouple the supply with a 100nF ceramic capacitor close to the VCC pin.
Can I connect a PIR sensor output directly to a mains light fitting?
No. A PIR sensor's logic output is a low-voltage, low-current signal — typically 3.3V or 5V at a few milliamps. Mains voltage (230V AC or 120V AC) must never be connected to a logic output pin. To control a mains load, the PIR output drives a relay module or a triac-based switching circuit rated for mains current and voltage.
What is the difference between H mode and L mode on a PIR module?
H mode (retriggerable): the output's hold-time countdown resets every time a new motion event is detected. The output stays high as long as motion continues plus the hold time after the last detection. L mode (non-retriggerable): each detection triggers a single fixed-duration output pulse; further motion during that pulse is ignored until the output returns low. H mode is standard for lighting control.
How do I prevent a PIR sensor from triggering on daytime light?
Most PIR sensor modules include a light-dependent resistor (LDR) on the PCB that inhibits the output in daylight. If your module lacks this, add an external LDR voltage divider to a microcontroller input and gate the PIR output in software, or use a dedicated PIR module that combines both a PIR element and a light sensor with built-in inhibit logic.
Related diagrams
- light sensor circuit diagram
- motion sensor circuit diagram
- pir motion sensor wiring diagram
- pir sensor diagram
- pir sensor pin diagram
- proximity sensor circuit diagram