• Register
  • Login
  • looking for something?

    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
    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.

    Find more projects
    

    32 Responses to "Light Sensor Switch Circuit"

    subscribe to newsletter
    1. i do not think the circuit can work since you chose R7 resistance for 22k

    2. how does the circuit sense the light

      • 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.

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

    4. Buhari Shehu says: on February 29, 2012 at 4:22 pm

      what is the practical application of this project?

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

    6. kcarring kcarring says: on March 6, 2013 at 7:33 am
        member

      @popescu

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

      • 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.

      • kcarring kcarring says: on March 6, 2013 at 9:56 am
          member

        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

      • 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!

      • kcarring kcarring says: on March 6, 2013 at 10:10 am
          member

        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!

    7. kcarring kcarring says: on March 6, 2013 at 7:39 am
        member

      @popescu

      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.

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

      • 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:
        http://www.digikey.com/product-detail/en/UVP1C220MDD/493-6077-ND/2539556

        http://www.nichicon.co.jp/english/products/pdfs/e-vp.pdf

      • kcarring kcarring says: on March 6, 2013 at 7:27 pm
          member

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

      • @kcarring
        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 kcarring says: on March 6, 2013 at 10:05 pm
          member

        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.

    8. kcarring kcarring says: on March 6, 2013 at 10:24 pm
        member

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

    9. kcarring kcarring says: on March 6, 2013 at 11:25 pm
        member

      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).

    10. kcarring kcarring says: on March 7, 2013 at 12:44 am
        member

      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

    11. kcarring kcarring says: on March 7, 2013 at 12:45 am
        member

      I had originally tried an LM3805 and it just smoked that in like 20 seconds.

    12. kcarring kcarring says: on March 7, 2013 at 12:50 am
        member

      Even with only a 10W / 39 ohm resistor, I still get less than 2 volts on the rails, and it draws over 200 mA

    13. kcarring kcarring says: on March 7, 2013 at 2:23 am
        member

      Just to be sure I replaced every transistor with new ones, and the IC too. Then I checked the value of every resistor again, and all connections.

      This time I got 5+ volts on the rail. And about 35 mA draw on the circuit with 200 ohms, and about double that with 100 ohms.

      No operation though. I have an LED in place of the optocoupler.

      This HD demo should be live 3/7/2013
      http://youtu.be/4IRmEJBMaaI

      • I was looking at your video and want to ask you some things:
        1 – is the ground connected as shown in the schematic on the website? at pin 8 and the line that connects the emitters of T4 and T2?
        BTW: you show at 5:25 that there is no connection to ground on a certain place. My answer is there shouldn’t be any. That network of R3, R4, P1, C1 and C2 are necessary for the internal oscillator of 4060 IC (sets the time).
        2 – is the R2 connected from pin 3 to the base of T5 (BC557 PNP transistor)? I am asking because in the video is unclear.

    14. kcarring kcarring says: on March 7, 2013 at 2:33 am
        member

      The odd thing, is, that, when I turn on the circuit, nothing happens. If, though, I take a very intense light and shine it on the photo-transistor, the LED (that represents the optocoupler) DOES come on. Is this what I want? I expected it would come on in the dark, and disappear in the light…

    15. kcarring kcarring says: on March 7, 2013 at 2:41 am
        member

      Excuse me.. I just tested it by using an infrared emitter, and it effectively, immediately shuts down the output LED. I guess the “room light” contained no real infrared spectrum, and thus had me fooled?

    16. kcarring kcarring says: on March 7, 2013 at 2:55 am
        member

      I think it’s just the wrong kind of phototransistor, unable to perform with visible light, I guess.

    17. kcarring kcarring says: on March 7, 2013 at 10:46 am
        member

      @Popescu Thanks for looking into it. I went over your concerns, in this video which will be live 3/8/2013. (uploading now) I think I may have the wrong sort of photo-transistor, i tmay not work properly with visible life, as demonstrated using an infrared emitter LED – in this video…

      http://youtu.be/A4lkhYmrb0o

      Thanks

    18. kcarring kcarring says: on March 7, 2013 at 10:49 am
        member

      i forgot to answer one thing: R2, is, indeed used to tie P3 to T5 @ 22k ohms

    19. Please show me the circuit for stairs which will turn on at human presence nearby, and turn off 30 seconds after the person leave.

    What do you think about this article? Leave a comment!