A photocell is the oldest piece of automation in the electrical trade and still one of the most useful: it switches a light on when the sun goes down and off when it comes up, forever, with no timer to reset and nothing to program. Every street light you have ever walked under works this way. Here is how to wire one at home.
Photocell or motion sensor?
They solve different problems and people mix them up constantly:
- A photocell responds to daylight. The light stays on all night whether anyone is there or not. That is what you want for a gate light, a street light, a shop sign or a boundary wall.
- A motion sensor responds to people. The light is off most of the night and only comes on when someone arrives. That is what you want for a driveway or a corridor.
If you want both — off in daylight and only on when someone is there — you do not need two devices. Most of our motion sensors already have a day/night (LUX) setting built in.
The wiring diagram

The colour code on these units has been the same for decades, which makes them easy to work with: black in, white neutral, red out.
Step by step
- Turn off the breaker feeding the light and verify with a tester.
- Connect the black wire to your incoming live.
- Connect the white wire to neutral, and join the lamp’s neutral to the same point.
- Connect the red wire to the lamp’s live terminal.
- Mount the photocell with its dome facing up and slightly north, where nothing shades it during the day.
- Seal the entry if it is outdoors — water getting into the gland is what kills these, not the electronics.
- Test it by covering the dome with your hand or a cup for 30–60 seconds. There is a deliberate delay before it switches, so be patient.
⚠ 220V mains. Switch off at the breaker before you start, and if the light is outdoors on a pole, have an electrician do it.
The one mistake everybody makes
Pointing the sensor at the lamp it controls. It gets dark, the photocell switches the lamp on, the lamp shines on the photocell, the photocell decides it is daytime and switches off — and now you have a flashing light and a relay wearing itself out.
Mount the dome so it faces away from the lamp, or shield it. It should see the sky, not your bulb.
Why the delay exists
A good photocell waits before it acts, and that is deliberate. Without a delay, a passing car’s headlights or a cloud would flick your light on and off all night. So when you test it, cover the dome and wait — if it switches within a minute, it is working correctly.
Sizing the load
Ours is rated 10A at 220V, which is roughly 2000W of lighting. In practice you will never approach that:
| Lamp | Typical wattage | How many on one photocell |
|---|---|---|
| LED bulb | 9–12 W | Dozens — the relay is the limit, not the watts |
| Energy saver | 20–25 W | Plenty |
| LED flood light | 50–100 W | Ten or more |
| Old filament | 60–100 W | Keep it under about fifteen |
One caution: a large bank of cheap LED drivers has a high inrush current at switch-on, which is hard on any relay. If you are switching a whole row of flood lights, drive a contactor from the photocell instead of switching them directly.
Frequently asked questions
Can I use it indoors?
You can, but there is rarely a reason to. Indoors, a motion sensor is almost always the better device.
Is it weatherproof?
The body is made for outdoor use, but the cable entry is what matters — seal it and mount it so water runs away from it, not into it.
Can I adjust when it triggers?
This model has a fixed threshold set at normal dusk level. If you need an adjustable one, a motion sensor with a LUX dial gives you that control.
Why does my light come on in the evening but not switch off in the morning?
Something is shading the dome at sunrise — a wall, a parapet, a tree. Move it somewhere that gets early light.
Related guides
- How to wire a 220V PIR motion sensor light switch
- Build the same idea with an Arduino and an LDR
- Smart home upgrades that need no Wi-Fi
Get the parts
The 220V Photocell Auto Day/Night Light Sensor Switch is in stock at Smart Home | Arduino Corner — Shaheen Market, DAV College Road, Rawalpindi — with same-day delivery in the twin cities and cash on delivery across Pakistan.