PIR Sensor Circuit Diagram: Wiring, Output Modes, and Connections

Pir Sensor Circuit Diagram — circuit diagram showing component connections+12V/24V SupplyPIRPIR Motion SensorPull-up RARDUINOUNOMCU / ReaderIndicatorPIR Motion Sensor Circuit
PIR Sensor Circuit Diagram: Wiring, Output Modes, and Connections — interactive diagram. Open it in the editor to customise components and wiring.

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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 typeDual-element differential pyroelectric sensor
Typical supply voltage5V DC (MCU modules) or 12V DC (panel-mount modules); verify per product
Output typeDigital logic (3.3V or 5V push-pull or open-collector); relay contact on some models
Typical detection distance3–7 metres (adjustable via sensitivity potentiometer on most modules)
Typical detection angle100°–120° horizontal (lens-dependent); narrower for long-range Fresnel configurations
Initialisation time after power-up30–60 seconds (element thermal stabilisation period)
Time delay adjustment range (typical)5 seconds to approximately 5 minutes (module-dependent)
Infrared sensitivity band8–14 micrometres (peak human body emission range)

Safety warnings

Tools needed

Common mistakes

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

Free electrical calculators

Edit this diagram free in the online editor