light sensor switch circuit schematic

Light Sensor Switch Circuit

This light sensor switch circuit allows the automatic connection of a lamp when the light is low (at nightfall) and will maintain the lamp ON for a certain period of time.
This time can be adjusted with P1 between 1 and 5 hours. The switch is a semiconductor relay S202DS2 and the oscillator is 4060.

Sensor Light Switch Schematic

light sensor switch circuit schematic

From the moment that T4 and T5 are opened, relay’s LED start to light and powers the lamp. As soon as one of the transistors is blocked the lamp will go OFF. The phototransistor T3 will be the one that blocks T5 if there is light that falls on T3.

The T2’s base-emitter junction is connected in parallel with T3 and so will be blocked as long there is light. T2 will continuously reset IC1 whose counter outputs will be in “0” state.

When the night falls R7 provides base current for T2 and the transistor starts to conduct. The counter can now starts to count the impulses from the internal oscillator and in this time the light will bulb will stay lit. After a time, when the output of Q13 goes in state “1” T4 is blocked. This causes the relay’s LED to go off and the lamp too.

There is no need for external power supply because the light sensor switch is powered directly from the 220V mains. D1 … D5 diodes rectifies the voltage and C4 filters it.
C5 is working as a resistor so will need to have the working voltage of minimum 400V but the 630V is preferable.

S202DS2 is a Triac-Full-Wave-Output Optocoupler produced by Sharp Electronics in a TO-220 package.

The maximum peak-to-peak voltage is 600V, max on-state current is 8 Ampere and the input trigger current is 8 mA.

Caution! This circuit is powered directly from 220V. Attention will be given for appropriate isolation of the switch block.


Join the conversation!

Error! Please fill all fields.
  • kcarring

    With 200 ohms of 5W resistors in series with 12VDC input, the circuit draws about 60 mA. I have a measured 0.9V across the 5.1V Zener Diode. Instead of the Optocoupler device, I just have an LED for testing purposes. It never lights. If I lower the input resistors, draw increase, smoke. I don’t know. Maybe I should change out all transistors, the IC + double check everything. hmmm

  • kcarring

    It’d be helpful to know what the intended voltage is across the + and – of the bridge rectifier? I tried to modify this circuit for 12V, but instantly blew the Zener, which i used a 5.1V (did not have 5.6V).

    • Jim Keith

      Add a series resistor with the DC input to limit the current. 220 or 330Ω or so, or add a LM7806 3terminal regulator.

  • kcarring

    Does this entire circuit (The DC component) run on a maximum of 5.6V due to the Zener?

  • kcarring


    Pin 9. It’s tied to the positive (+) side of an electrolytic capacitor. That capacitors (-) negative side, is tied to the (-) of another, and then to ground. Is this what you’d call anti-serial, and the goal is to have a capacitance equal to 1/2 that of a non polarized cap, in it’s place? in this case 22uF non-polarized? Seems odd.

    • kcarring

      Interesting. I’ll be sure to fuse the whole circuit should I use it on mains. I’m 110 by the way. For now, I’m just trying to modify this circuit for solar. In that I mean, it’s *almost* perfect, and it will be a first online: 1.) 12V operation 2.)Dark Detector Ran 3.)Relay or Mosfet Delivery to load 4.) Timed run; not all night. The only other added bonuses would be a “delayed on-set” and “over-discharge protection”. If you think about, all these dinky little solar garden lights, they are good for what they are, but they are not robust enough of a circuit to properly manage a true high current outdoor automated solar light. And, LDR based “turn on” is too early. They come on before you actually need the light. And, they run all night. Plus, they’re all capable of over-discharging the battery, which is unacceptable for an expensive battery. So, as it turns out – NO ONE – online has published such a thing. A better mouse trap is needed, it’s re-inventing the wheel, but the current wheel is not round.

    • Jim Keith

      I have seen this done years ago on 115VAC capacitive limited supplies–may not be feasible for 230VAC.

      In power applications, anti-parallel rectifiers are connected across each cap to prevent reverse polarity inrush current–when charged, there is no diode interaction.

      This amounts to a continuous duty motor starting cap, but we all know that true motor start capacitors cannot take continuous duty.

      The main caution is to verify that the capacitor current rating is not exceeded–this spec is indicated on most electrolytic datasheets.

    • kcarring

      Neat trick. Can you use this in a capacitive power supply with mains, or is that not advised. This anti-serial configuration, I mean.

    • Jim Keith

      This is how to make and AC capacitor from polarized capacitors. NP (non-polarized) or Bi-Polar capacitors are available, but they are uncommon in the experimenter’s stash of components.

      Check out:

    • Popescu Marian

      Yes, you are right, that is the purpose of that type of connection. I know it seems odd but this is the schematic.

  • kcarring


    How does the IC4060 get power, when pin 16 is tied to ground?

    • kcarring

      Thanks brother, you rock. This looks like a great circuit. I am trying to adapt it to a standard relay though – th whole thing on 12Volts – no mains. REmoval of the capacitive power supply, and bridge rectifier – check – that’s obvious. The zener diode –> Does that just pull the whole right hand side down to 5.6V for the purpose of the LED inside the solid state relay? What changes need be done to replace that expensive S202DS2 with a cheap SPST relay – and run the load lamp off the same 12V supply. Then this can be a solar lamp that doesn’t run all night! Perfect for load intensive solar lighting, needed only for a few hours after dark! Thanks

    • kcarring

      Fantastic. I am working on it too and will stay up to date here. Great website, and even cooler how you guys stay engaged with the visitors. Impressive!

    • Popescu Marian

      I will ask Mr Jim Keith and see if he can do a project based on your request. I am pretty sure he can do this!

    • Popescu Marian

      I have updated the schematic and now pin 16 is connected to point A (positive). You should see 2 A points in the schematics, those must be connected. Refresh the page in case you do not see the update.

  • IVAN

    hi, can this night switch will work in 80 watts fluorescent lamps, please reply in my email, a big tnx.

  • Buhari Shehu

    what is the practical application of this project?

  • Dan

    can i ask a question… what would be the function of each transistor?

  • kamal

    how does the circuit sense the light

    • P. Marian

      It can sense light with the help of phototransistor T3 BPW40. Read the entire article in order to find out how the light sensor is working.

  • bob

    i do not think the circuit can work since you chose R7 resistance for 22k

Looking for the latest from TI?