First Home Fixes logo

Home / Electrical Basics

Occupancy Sensor Switch: How to Install One Safely

4 min read · Updated 27 November 2026 ·

Part of: Electrical safety

Difficulty
Moderate
Time
30 to 60 minutes
Tools
Non-contact voltage tester, screwdrivers, wire strippers, wire nuts, phone for photos, masking tape, the new sensor switch
Call a pro if
there is no neutral wire in the box, the wiring is aluminum or damaged, or you find more wires than expected
In this guide
  1. Check the wiring first
  2. Step by step
  3. Choose the right sensor
  4. Set the timer and sensitivity
  5. Signs that point to each cause
  6. Three way circuits
  7. Prevention
  8. Dimmer and bulb compatibility
  9. Check for a spare neutral and the box size
  10. Where sensors work best
  11. Related guides
  12. FAQ
  13. When to call a pro
Safety. Turn off the breaker and confirm the circuit is dead with a tester before you touch a wire. A switch or outlet being off does not mean the wires are dead. Do not work with wet hands or in standing water. If you find aluminum wiring, damaged insulation, a burnt smell or scorch marks, stop and call a licensed electrician. Turn off the breaker and test every wire before you touch it. Do not rely on the old switch as the off point. Do not work on a wet floor. Do not use a sensor on a load higher than its rating. If wires are burned, brittle or aluminum, stop and call a licensed electrician. Close the box with a plate when done.

An occupancy sensor switch turns a light on when someone enters and off after the room is empty. It is handy in a laundry room, pantry, garage or hallway, where hands are often full. It also saves energy. Installing one is like replacing a regular switch, but you must check the wiring and the type of switch first. This guide shows the steps, and tells you when to stop and call an electrician.

This guide is part of our wider guide to electrical problems and safety.

Check the wiring first

Turn off the breaker for the light. Remove the switch plate and test the switch wires with a voltage tester. Pull the switch out of the box and look at the wires. Most sensor switches need a neutral wire, which is usually white and bundled with others in the back of the box. Some models do not need a neutral, but they work only with certain loads. Read the instructions for your model. See How to replace a light switch.

Step by step

1. Turn off the breaker and test that the switch has no power.

2. Take a photo of the wiring before you disconnect anything.

3. Label the wires with masking tape.

4. Disconnect the old switch.

5. Check the wire ends. Trim and strip if they are damaged.

6. Connect the new switch by following its wiring diagram. Often the ground goes to green, the neutral to white and the two switch wires to the black or red leads.

7. Join the wires with new wire nuts.

8. Fold the wires into the box and screw the switch in place.

9. Attach the cover plate.

10. Turn on the power and set the timer and sensitivity as the instructions say.

11. Walk into the room to test.

Choose the right sensor

A passive infrared sensor detects heat and motion. An ultrasonic sensor can detect small movements. Dual technology uses both. For a bathroom or a room where people sit still, choose a model with a vacancy mode or a long timer. Check that the switch handles the type of bulbs you use, such as LED. Some old sensors flicker with LED loads.

Set the timer and sensitivity

A time delay of 5 to 15 minutes is usual. Short delays save energy but can turn the light off while someone is still in the room. Set the sensitivity so it picks up people but not a pet in another room. Test by walking in the room and standing still.

Signs that point to each cause

A light that does not turn on may have a wiring problem or the sensor may be too shaded. A light that turns off while you are in the room has a short timer or low sensitivity. A light that stays on may have a sensor that sees a vent or a window. A light that flickers may need a compatible bulb. A hot or buzzing switch needs checking. See Light switch hot or buzzing: what it means and Three way switch not working.

Three way circuits

If the light is controlled by two switches, a regular sensor will not work. You need a model made for three way circuits. Wiring is more complicated, so ask an electrician if you are unsure.

Prevention

Clean the sensor window with a dry cloth. Do not paint over the sensor. Test the switch twice a year. Replace it if the relay clicks loudly or fails.

Dimmer and bulb compatibility

Check the package for dimmer or LED compatibility. A sensor that does not match the bulb can hum or flicker. If it does, try a different brand of bulb, or one that is rated for the sensor. Keep the spare switch box cover until you are sure the new switch works.

Check for a spare neutral and the box size

If you do not see a neutral wire, do not guess. A box that is small can also make it hard to fit a bulky sensor switch. Look at the box, and compare it with the switch size. If the wires are stiff and the box is tight, an electrician can fit a deeper box or run a neutral.

Where sensors work best

Place a sensor switch where the sensor can see the whole room, not where furniture or a door blocks it. Avoid putting it next to a heating vent that makes warm air rise in front of it. For a large room, you may need a ceiling sensor as well.

FAQ

Do I need a neutral wire? Many sensors do. Check your model.

Can I use it with LED lights? Yes, if it is rated for LED.

Why does the light turn off while I sit still? The delay is too short, or the sensor needs more sensitivity.

Is this a good project for a beginner? If you are comfortable turning off power and testing, yes.

occupancy sensor switchmotion sensor light switchinstall sensor switchelectrical basicsenergy saving

More from this topic

Flat illustration for the guide about outdoor light timer, showing the relevant item with simple toolsElectrical BasicsOutdoor Light Timer: How to Install One SafelyWant lights on at dusk? Install an outdoor light timer on a weatherproof outlet: pick the right type, check the load rating and set it up safely.Hand holding a wire connector at a ceiling light fixture with a screwdriver and voltage tester pen nearbyElectrical BasicsHow to Replace a Light Fixture SafelyLearn how to replace a light fixture safely: turn off power at the breaker, test the wires, connect the new fixture and know when to call an electrician.Illustration of a wall switch pulled out of its box with wires, a screwdriver, a new switch and a non-contact voltage testerElectrical BasicsHow to Replace a Light Switch Safely in 20 MinutesHow to replace a light switch safely: turn off the breaker, test for power, swap the switch and test it. Steps, tools and when to call an electrician.Illustration of an outdoor wall light with a motion sensor and detection arcs, a ladder, a screwdriver and wire nutsElectrical BasicsHow to Install a Motion Sensor LightHow to install a motion sensor light on an existing outdoor fixture: turn off power, wire it, set the sensor and test. Steps, tools and safety notes.Broken bulb base in a socket, needle-nose pliers, a rubber glove, half a potato, with a switch off and a breaker iconElectrical BasicsHow to Remove a Stuck or Broken Light Bulb SafelyHow to remove a stuck or broken light bulb safely: turn off power, use pliers on an intact bulb, protect your hands and know when to call an electrician.