Wiring a 3-wire passive infrared (PIR) motion sensor light works like this: the live wire L from the breaker goes to the sensor's L terminal, the neutral N goes to its N terminal, and the switched output L' (often marked as load or with an arrow) goes to one side of the lamp, with the other side of the lamp returning to N; the sensor acts as an automatic switch on the live conductor. Once it is wired, you set three knobs: TIME (how long the light stays on), LUX (how dark it must be before the light can switch on) and SENS (sensitivity, or detection range). Most complaints of "the light never turns off", "can't test it in daytime" or "the LED flickers" come from a wrong LUX setting, a sensor aimed at a heat source, or a 2-wire sensor used with low-power LED lamps. This lesson goes from how it works, the diagrams and the settings to a worked example of a townhouse corridor with load and electricity cost calculated.
By the end of this lesson, you will be able to:
- Explain what a PIR sensor detects, why the light goes off when someone sits still, and when to use a microwave radar sensor instead.
- Wire a 3-wire L, N, L' sensor correctly, adding a bypass switch for permanent on and a switch to turn it fully off.
- Choose the mounting position and height, and set TIME, LUX and SENS with a step-by-step test procedure.
- Check the LED load against the sensor rating and work out the electricity saved with figures that add up.
- Diagnose 5 common faults: light stays on, won't come on, glows faintly, flickers, or goes off while someone is still in the room.
Learning residential electrical work? Installing motion sensor lights belongs to the step "Lighting circuits, switches and sockets" in Level 1, after electrical safety and using a multimeter and voltage tester. See the 4-level residential electrician roadmap to learn in the right order.
How does a PIR motion sensor light work?
Every warm object gives off infrared radiation; a human body at about 36–37 °C gives off more than walls and floors. A PIR (passive infrared) sensor emits nothing; it only "watches" for changes in heat radiation within its field of view.
PIR detects movement, not a person standing still
The Fresnel lens at the front (the white plastic cover divided into many facets) splits the field of view into many beams. When someone walks across the beams, the heat reaching the sensor keeps changing and the circuit switches the light on. A person sitting still reading creates no change, so when TIME runs out the light goes off. Someone walking straight toward the sensor is also harder to detect than someone walking across, because fewer beams are crossed.
What is inside the sensor
Open a sensor module (Figure 1) and you see: the pyroelectric sensor (a round metal can with a window), a light-dependent resistor that measures brightness for the LUX function, trimmers for TIME and LUX, a power supply circuit running from 220 V, and a relay that switches the live wire to the lamp. The relay has its own current rating; LED lamps draw a large inrush current, so their allowed load is usually much lower than for incandescent bulbs.
Photo: Tympanus / Wikimedia Commons, CC BY-SA 4.0
PIR or microwave radar
A microwave radar sensor emits waves and measures the reflection; it detects small movements and sees through thin plastic and glass, but it also easily "sees" people in the next room or outside the door. PIR is cheap and stable, suiting corridors, stairs, toilets and gates. Rooms where you must detect people sitting still (offices) need a dedicated presence detector.
Types of sensor lights: which to choose?
Lights with a built-in sensor
Ceiling lights, wall lights and LED bulbs with a built-in sensor: wire L and N like a normal light and leave the wall switch on. Quick and cheap, suited to replacing a single light.
Separate 3-wire ceiling or wall sensors
These have separate L, N and L' terminals and can control a group of lights. They are what electricians fit most often in corridors, stairwells and garages. There are surface ceiling types, recessed types for plasterboard ceilings, and weatherproof outdoor types.
Wall-box sensor switches
These replace a normal switch in the wall box directly (Figure 2), and many have an OFF – AUTO – ON slider. The 3-wire type needs a neutral in the switch box; the 2-wire type needs only L and L' and powers itself through the lamp, so small LED lamps can glow faintly or flicker.
Photo: Z22 / Wikimedia Commons, CC BY-SA 4.0
| Type | Wires needed | Controls | Suits | Watch out for |
|---|---|---|---|---|
| Light with built-in sensor | L, N | That light only | Replacing one light at a gate or toilet | A failed sensor means replacing the whole light |
| Separate 3-wire sensor | L, N, L' | A group of lights | Corridors, stairs, garages | Check the LED load rating |
| 3-wire sensor switch | L, N, L' in the switch box | The old switch's lights | New homes wired with neutral | Low viewpoint, easily blocked by furniture |
| 2-wire sensor switch | L, L' | The old switch's lights | Older homes with no neutral at the switch | Needs a minimum load, LEDs may flicker |
PIR motion sensor light wiring diagram
The principle is the same as a normal switch: the sensor switches only the live wire, and the neutral goes straight to the lamp. Sensor lead colours vary by maker; many use brown for L in, blue for N and red for the output to the lamp, but always read the diagram printed on the body or the instructions. In Vietnam the supply is 220 V, 50 Hz.
Basic 3-wire diagram
- Live L after the lighting circuit breaker → sensor terminal L.
- Neutral N → sensor terminal N (to power the sensor).
- Sensor output L' → one side of the lamp (or the group of lamps in parallel).
- Other side of the lamp → N.
- Earth to the metal body of the light if it has an earth terminal.
Figure 3 shows a sensor wired into the terminal block inside an outdoor light: supply in, common neutral and lamp output all pass through the terminal block, with the connections enclosed in the light housing.
Photo: Dmitry G / Wikimedia Commons, CC BY-SA 3.0
Adding a bypass switch and an off switch
- Bypass switch (permanent on): a normal switch connected in parallel between the sensor's L and L'. Switched on, the lights stay on regardless of the sensor, handy for cleaning or guests.
- Off switch: a switch on the L wire before the sensor's L terminal (and before the bypass branch). Switched off, both sensor and lights lose power, for when the home is empty or the light is being repaired.
Two sensors for one group of lights
For a long corridor or a stairwell with two ends: take L for both sensors from the same breaker and join both L' outputs in parallel to the group of lights. Either sensor detecting someone turns the lights on. Never parallel the L' outputs of two sensors fed from different phases or different breakers.
Large loads: use a contactor
Every sensor states a maximum load for incandescent bulbs and usually a much lower one for LED and compact fluorescent lamps. If the group exceeds the LED rating on the label, or for high-power floodlights, let the sensor switch a contactor coil and the contactor switch the lights.
Mounting position and setting TIME, LUX, SENS
Height and direction
- Ceiling sensors: usually about 2.2–4 m high with a circular detection zone; the diameter depends on the model's label.
- Wall sensors and sensor switches: about 1.1–2.5 m depending on type, aimed so people walk across the field of view rather than straight at it (Figure 4).
- Avoid aiming at air conditioner outdoor units, heaters, water heaters, sunlit windows, trees and curtains moving in the wind, or a street with traffic.
Photo: Air fans / Wikimedia Commons, CC BY-SA 4.0
Step-by-step setup
- Turn LUX to the "sun" (brightest) setting so you can test in daylight; turn TIME to minimum (often about 10 seconds); set SENS to the middle (Figure 5).
- Switch on and wait for the sensor to warm up (often about 30–60 seconds; the light may switch on then off).
- Walk across the edge of the area to be covered and see whether the light comes on; raise or lower SENS until it detects the right area without catching people outside the door.
- Set TIME to suit: corridors and stairs about 1–3 minutes; toilets longer so someone sitting inside is not left in the dark.
- Set LUX at dusk: turn it from the "sun" side toward the "moon" side until the light starts to respond, so it does not switch on in daylight.
Photo: .mw-parser-output .template-designermadsen-source{border:1px solid #a2a9b1;background-color:#f8f9fa;display:grid;padding-left:4em;padding-right:4em;grid-template-columns:1fr 8fr;grid-template-rows:1fr / Wikimedia Commons, CC BY-SA 4.0
After setting up
Record the knob positions on the handover sheet and tell the owner: the light not coming on in daytime is correct, and the bypass switch keeps it on when needed.
Safety when installing sensor lights
Safety warning: switch off the lighting circuit breaker (not just the wall switch), hang a "Work in progress – do not switch on" tag, and use a voltage tester or meter proven on a live source to confirm there is no voltage on both L and N in the light box and switch box. An old switch may be wrongly breaking the neutral, so a switch in the off position does not mean the wires are dead. Work from an A-frame ladder with locked legs, never stand on the top step, and never hold on to plasterboard ceiling framing. Outdoor lights and sensors must be weatherproof types with connections inside a sealed box; outdoor circuits should have RCD protection. Never switch on to test with exposed connections.
Checks before switching on
- No bare copper outside the terminals; wires tightened, a gentle pull does not loosen them.
- L goes to L, not mixed up with L': swapped, the light stays on permanently or the sensor gets no power.
- Total lamp power within the LED load rating on the sensor label.
When to call a more experienced electrician
No neutral in the switch box but the customer wants a 3-wire sensor, old wiring running hot, blackened connections, or a breaker that keeps tripping: stop, and have a lead electrician check the whole circuit before fitting new devices.
Worked example: a ground-floor corridor in a townhouse
A ground-floor corridor in a townhouse is 8 m long and 1.2 m wide with a 3 m plasterboard ceiling and 4 recessed 9 W LED downlights, currently left on about 12 hours a night. The owner wants the lights to come on automatically when someone walks through. Choose one recessed 360-degree PIR ceiling sensor placed mid-corridor (4 m from the end); according to its label, at 3 m height the detection zone is about 8 m in diameter, covering the full corridor length.
Load check
- Total power: 4 × 9 = 36 W.
- Approximate current: 36 ÷ 220 ≈ 0.16 A (slightly higher in practice because of the LED drivers' power factor).
- The sensor's LED load rating (assumed on the label) is 200 W, far above 36 W: wire it directly, no contactor needed.
Wiring and settings
Take L and N from the lighting junction box in the ceiling, connect L and N to the sensor, and L' to the group of 4 lights. Keep the old wall switch as a bypass switch in parallel across L – L'. Set TIME to about 1 minute, SENS to the middle, and LUX so the lights only come on after dark.
Electricity saved
| Option | Calculation | Energy per month |
|---|---|---|
| On all night | 36 W × 12 hours × 30 days | 12.96 kWh |
| Sensor: lights on | 36 W × 1.5 hours × 30 days | 1.62 kWh |
| Sensor: standby power | 0.5 W × 24 hours × 30 days | 0.36 kWh |
| Saving | 12.96 − 1.62 − 0.36 = 10.98 kWh | |
Vietnam's tiered household electricity price is about 2,000–3,500 VND/kWh (2026 reference, depending on the tier). At 3,000 VND/kWh: 10.98 × 3,000 = 32,940 VND per month. Installation cost: sensor 250,000 VND + wire and junction box 80,000 VND + bypass switch 60,000 VND + labour 300,000 VND = 690,000 VND (about US$27). Payback is about 690,000 ÷ 32,940 ≈ 21 months. The saving is modest; the main benefits are convenience, safety at night and longer lamp life from fewer hours on. Telling the owner these real numbers earns more trust than promising to "cut the bill".
Common sensor light faults and how to fix them
The light never turns off
Sign: the light stays on, or comes back on as soon as it goes off. Cause: L and L' swapped or the bypass switch left on; the sensor sees a heat source, curtains or trees moving; TIME set too long. Fix: check the wiring, switch off the bypass, re-aim or mask part of the lens, lower SENS, shorten TIME.
Won't come on in daytime, so the electrician thinks it is faulty
Sign: walking past during a daytime test does nothing. Cause: LUX set to "only when dark". Fix: turn LUX to the sun side for testing, and set it again at dusk.
LED glows faintly or flickers when off
Sign: the lamp glimmers or flashes every few seconds. Cause: a 2-wire sensor switch passes a small current through the lamp to power itself, and a low-power LED lamp is not enough load. Fix: use a 3-wire type with neutral, or fit an anti-flicker capacitor in parallel with the lamp as the maker instructs (the same principle as in No-neutral smart switch: wiring it right and fixing common faults).
The light goes off with someone still in the room
Sign: sitting in the toilet, the light goes off. Cause: PIR cannot see someone sitting still, TIME is short, or a door or partition blocks the sensor. Fix: lengthen TIME, place the sensor where it can see the seated position, or switch to a radar or presence sensor.
The sensor dies after a few weeks
Sign: the relay sticks, so the light stays on or never comes on again. Cause: total load above the LED rating; the inrush current of many LED drivers burns the contacts. Fix: replace the sensor, split the load or use a contactor.
Frequently asked questions
Does a PIR motion sensor light need a neutral wire?
The 3-wire type needs N to power the sensor. The 2-wire switch-replacement type does not, but it is fussy about load and can make small LED lamps flicker. New homes should run a neutral to every switch box.
Can one sensor control several lights?
Yes, with the lights in parallel after L', as long as the total power stays within the LED load rating on the label. Above that, use a contactor.
Why does the sensor light switch on with nobody there?
Usually a changing heat source in its view: warm air from an air conditioner, sun through glass, curtains or trees moving in the wind, pets, or traffic outside. Re-aim it, lower the sensitivity or mask part of the lens.
Does a motion sensor light use much electricity?
The sensor circuit draws very little standby power, usually under 1 W. Total energy use normally falls compared with leaving lights on all night, as in the corridor example above.
Practice exercises and self-assessment
- On a training board, wire a 3-wire sensor controlling 2 LED lamps, with a bypass switch and an off switch; draw the diagram before wiring.
- Set TIME, LUX and SENS using the 5-step procedure, and record the knob positions and the test result at the edge of the detection zone.
- Work out the load and electricity saved for a 3-storey stairwell with 6 LED lamps of 7 W, on 11 hours a night, that are on for only 1 hour a night in total after fitting a sensor.
Self-assessment criteria
- Pass: the sensor switches the live wire, N runs straight to the lamps, the bypass is in parallel across L – L', and connections are enclosed in terminals.
- Pass: the lights come on when you walk across the edge of the zone, not when you stand outside the door, and do not come on in daylight once LUX is set.
- Pass: the stairwell calculation gives 6 × 7 = 42 W and a saving of 42 × (11 − 1) × 30 ÷ 1000 = 12.6 kWh per month before subtracting standby.
- Not yet: the sensor switching the neutral, not confirming the circuit is dead before working, or exceeding the LED load on the label.
A sensor light is a good practical exercise to review the whole Lighting circuits, switches and sockets step. Review two-way switch and earthed socket wiring in Installing two-way switches and earthed sockets the right way, then move on to the next roadmap step: Level 1 complete – Electrician's helper, followed by Reading diagrams and calculating household loads.
Keep learning residential electrical work: after Level 1 come reading diagrams, load calculation, home distribution boards and fault finding, then three-phase power, rooftop solar and smart homes. See the 4-level residential electrician roadmap.






