A Simple Light activated switch


This is the circuit diagram of a light activated switch based on National Semiconductors comparator IC LM 311 and a LDR.

The circuit is based on a voltage comparator circuit wired around IC 1.The non inverting in put of IC1 is given with a reference voltage of 6V using resistors R3 and R4. The input to the inverting input will be the voltage across the LDR that is light dependent. At darkness the resistance of the LDR will be high and so do the voltage across it. At this condition the voltage at the inverting input will be higher than the reference at non inverting pin and the out put of the comparator will be low(~o V). When the LDR is illuminated ,its resistance drops and so do the voltage across it.Now the voltage at inverting input will be lower than that at non inverting input and the out put of the comparator goes high (~12 V). This makes transistor Q1 on and it drives the relay.As a result we get a relay switching according to the intensity of the light falling on the LDR.

Light Activated Switch Circuit Diagram with Parts List .

Light Activated Switch Circuit
Light Activated Switch Circuit Diagram


  • Adjust POT R1 to set the desired light intensity for switching the relay.For this illuminate the LDR with the desire intensity light.The relay will be either on or off.Adjust POT R1 slowly so that the state of the relay changes.That’s it.Now the circuit is set for the given intensity of light.
  • Assemble the circuit on a good quality PCB or common board.
  • You can use either a 12 V battery or a well regulated & filtered 12V DC mains operated power supply.
  • The pin 5&6 (Balance & Balance/Strobe ) of IC LM311 are shorted to minimize the chance of oscillations.
  • The pin out of LM311 is also given together with the circuit diagram.

We have more Lighting Circuits that you may be interested in;

1. Touch Dimmer for Lamps

2. Automatic LED Emergency Light

3. Flasher Circuit

4. Two Mode Night Light

5. Modified Lamp Dimmer Circuit



  1. I have set everything the way it supposed to be, when ever light goes off pin 3 reads ~12volts and pin 2 reads ~6volts and when the light is available, pin 2 remain ~6volts while pin 3 changes to ~0.5 volts, however in each case pin 7 remain 0.00 and hence no result. Help me solve this problem.

  2. Hoa sen vàng

    Great circuit and easy to use, LM311 opm good point and also given together with the circuit diagram. thanks for share

  3. PLease somebody tell me the working of this ckt means that from where to where the current is flowing and how all the process is taking place.Please!!!!!!!!!!!! I have my board practicals tomorrow please

  4. I want to make a circuit in which after light is get ON then the switch also get ON.

  5. sir can u plese swend me a ckt daigram for laser operated relay with 24 v dc supply to my mail adress

  6. It’s nearly impossible to find well-informed people for this subject, however, you seem like you know what you’re talking about!

  7. Arend Brink

    I want to build a swimming pool heating system and want the pump to run only when the water heating panel in in full sunlight. What type of switch can I use for starting the pump when the panel is in full sunlight

  8. what will be the output?
    where will be the output produce?
    how to work the LDR?
    please tell me this circuit applications

  9. maryam afffaf

    it great and helped alot but it would be better if you tell the role of transistor ,comparator and meaning of term saturation

  10. i am trying to find a dark activated circuit that would operate off of 3-4.5 volts dc (battery)would this circuit work for this if not could you point me in the right direction.i am going to have 2 c cell 1.5 volt battery’s with a solar panel to charge during the day then at night switch would activate leds the leds already have there resistor and all think the amperage was .068 or .068 any help would be appreciated in advance thanks!

  11. markemanuel

    hi sir.. im mark.. i am wondering on how i could modify the circuit if i were to use a pnp transistor.. could you help me please.. thank you..

  12. Hi there, i have problem with the relay, the relay is ON and OFF but does not light up the bulb. Can anyone help me or give explanation more on the relay. Thanks


  13. Seetharaman

    Hi all interchange connection to pin 2 and 3, it should work with 741 power to 7 it worked but in LM311 2 is + and 3 is -.

    • Seetharaman

      Hi Jitin check the voltage at Pin3 when you shine a powerful torch beam to LDR the pin voltage should fall down, since the voltage at Pin 2 will become positive wrt pin no3 pin 7 will be positive thus switching on the relay. kindly check step by step your assemby as well test part by part.

  14. sir, i connect this circuit properly,but its not working, plz help me.

    • There is an error in this diagram which makes it nonfunctional. Base of Q1
      doesn’t receive bias current from supply(+12V). The resistor R5 should be tied
      from pin 7 to +12V and the base of Q1 tied to pin 7. That’s the way it should
      work. For better results try using BC337, BC338, BD135, 2SD882, etc, instead of
      BC107. The value of R5 can be 2.2kohm…6.8kohm. (1KΩ is too small!).
      And put a 10Kohm resistor in series with R1(47kΩ). This way the LDR is not subjected to 12V directly(when R1=zero!!!).

      Adding some hysteresis by means of a resistor(100kΩ…560kΩ) tied from collector
      of Q1 and noninverting(—) input would activate the relay firmly(no chatter).

      • I carried out the changes suggested by Mihai and the circuit works absolutely fine.

  15. vijay kumar

    hello sir i am vijay kumar.i connected this cicuit but it is not working.can u pls tell the connection of relay

  16. hey frendz tell me more about this circuit .
    also can you tell me application of this circuit.

  17. Hrishikesh A

    hey guys,please tell more about dis project wid synopsis,construction….

  18. oyedokun toheeb

    need proposal on 2KW lighting activated switch

  19. i already assemble this same ckt using bc107 . i think the op amp is not needed in this ckt. this make ckt little complex.

  20. seetharaman

    Hi Virender use a 12volt power supply connect + terminal of 12volt to the terminal indicated 12 volt and – terminal of 12 volt to common indicated as ground.

  21. Dear Sir, Plz. let me know How to supply the Light Activated Switch Circuit. I made this circuit but it is not working. Plaease help in this regard. With thanx.

  22. Gezahegn Demas

    I want to design A Dark an Am Transmitter using 555,please cuold you show me what Equipments Are needed to finish my works!

  23. i only use the tansistor and a 50k resistor it works perfectly and was very sensitive to even shadow. my Vcc was a reglated 12v supply. though i connected a 5V regulator at output with a 100 ohm resistor the potential divider voltage should 4V no problem should be entertain about the 5V regulator as the output is between 1.85 at bright and 0.35 at dark.

  24. Seetharaman

    Hi Jim total darkness >50K and with bright ambient lighting (not direct sunlight) around 1K. This will be available in 5mm or greater dia photo resistors.

  25. Jim Floyd


    Can you please tell me what ranges the resistance should be for when the LDR is both illuminated and in a “dark” environment.

    Thank you.

    Jim F

  26. Seetharaman

    Hi Jacob it is for switching on and off lights when external light is off or on. if you want to use as dusk on light and dawn off, use a capacitor between LM311 output and input such that the circuit does not respond too fast changing light (may be a passing car’s with head light may switch off this light. very useful circuit you can use it with the modifications suggested earlier.

  27. i just wanted to know the scope and limitation of the lights circuot above.

  28. Seetharaman

    Hi Kib LM311 IC is having open collector output. Hence you require a resistance to connect pin no 7 to supply through a load resistance 2.7k. i am yet to try this circuit. in my circuit i am using TL072 with pins connections as per 741. you may go through the application data of LM311

  29. I couldnt get bc107 so i used 108 but no result ie no clicking and LED doesnt light. Wat could be the prob? Pls reply. Thnks in advance.

  30. Thinking of using this circuit for game feeder control. There will not be any relay connected, pin 7 will be tied to the first 555 timer input (three 555s in series) that is now controlling a feed timer. Want the circuit to activate at near dark and in morning at low light. Don’t think there is any problems with this except one and here is the question. Can a feedback resistor be connected from pin 7 to pin 2 or 3 to make a small difference in light level required in operation so as not to be sensitive in small light levels. Also how high can resistor R3 and R4 be to lower power consumption for longer battery life. Currently using a 555 for this operation, not as a timer but as a switch with a circuit similar to R1 and R2 in above circuit. The problem with the 555 is the 1/3 and 2/3 trigger levels of the 555.

  31. I have done the following

    1. I have put a 100kΩ resistor between pin 2 and pin 7 of the IC lm311

    2. I removed the 1kΩ resistor between pin 7 and base of bc107 and connected it between pin7 and Vcc which is 12V

    3.I am using a 12v dc source. it is a 12v7ah/20hr sealed lead acid battery(the ones used in ups)

    i am using LM311N in place of IC-LM311

    i am using TL BC 108B IN PLACE OF BC107

    i am using JZC-23F(ZN4123) 10A/28V,5A/220V,DC 12V RELAY

    i am using LDR -resistance in direct sunlight 60Ω,in direct white energy saver bulb 500Ω to 1.6kΩ depending on proximity,in total darkness 2MΩ.


  32. Seetharaman

    Hi Gahnkib Mr John is correct, since IC311 output is open collector, hence it requires supply. The modification suggested by him is correct. 100uF need not be used. an 100K resistance can be connected between pin7 and pin2 of the ic to have positive feed back and a little hysteresis t avoid chatter at critical zone.

  33. hello Seetharaman, i have implemented the above circuit and i have some problems i need you to help me with:-

    1.The circuit produces a chatter and the LED doesn’t light.
    2.i tried modifying the circuit as per john but there was
    no change,i tried and replaced the bc107 transistor with 2n2222 and it didn’t work.

    3. all the resistor,ic,relay,input voltage are as per your circuit.

    i don’t want to continue modifying the circuitry as per the posts so i would kindly request your help and please include comments on the below posts,will be very grateful.

    1. Is the statement by John on :March 21, 2009 at 1:12
    am true?
    2. Seetharaman on: December 23, 2009 at 2:09 am
    ….add 100mfd 25 volt capacitor in parallel with the
    relay coil.

  34. i want to design a combination of light activated switch and a dark activated switch so when daytime..,one bulb is ON and when nighttime..,another bulb is ON..,

    someone help me please..,urgent project for thyristor application… thanks in advance…

  35. patza raniel

    please..give more explanation of light activated alarm

  36. Seetharaman

    Hi Shubham the automatic street light comes on, whenever the ambient becomes dark due to fall of night or sudden darkness during daytime due to rain carrying dark clouds. if you use a timer to switch on at 6pm and switch off at 6am, it may not really respond to ambient light level. hence it may be on when not required and may not be on when it is really required. automatic street light will take care of this and save energy.

  37. thanx bt i want to know that what is the scientific phenomena behind this circuit…. because of this circuit now i m going to represent north bengal cluster on 4th of oct. . and i need your blessings. thanx . .

  38. Seetharaman

    Hi Shubam the you require street light whenever the street becomes dark whether day or night(with dark rain carrying clouds, it will become quite dark even during daytime still you require street light). If you use a timer for on and off operation of street light whether the sourounding is dark or not the street lights will start glowing waste of electrical energy. Hence ambient light activated street light will be ideal.

  39. what is the scientific principle behind the automatic street light. . . ?? ?

  40. seetharaman

    Hi Shubham it is possible. with the day light falling on LDR the relay will be on you can use the NC contact for the light. when the day lights falls and night approaches the LDR will not get light the relay will switch of and the street light will come on. ensure that street light does not fall on LDR directly. if electronics fail relay will switch of and the lights will come. that will be fail safe operation.

    Hi Antony use your imagination you can find out yourself hundreds of usage for the above circuit.

  41. is it possible to make a automatic street light. .

  42. seetharaman

    Hi Shubham check the relay sound by feeding 12volt directly or by shorting collector and emitter of Q1 if the clicking sound is good replace Q1 with 2N2221 or 2222 high speed switching transistor. since the relay is now soft its contact may get damaged over a period of time. please take corrective action now itself.

  43. sir, my relay is not giving clicking sound. .though everything is working properly . .is it a big problem. .suggest a way to get out of this problem. .

  44. looking for a circuit designer
    to design game circuit for my school kids.
    +there will be six touch pads with led’s on it
    +the kid should be able to touch the pad which blinks for fraction of a second,when it blinks only.
    +which will get totalled on a counter with a number display.
    help god bless

  45. Hi can any one suggest me a game circuit which totals the touches at 6 different points. within a time frame of 5 minutes. if possible counted when the point’s led blings

  46. seetharaman

    Automatic garage door opener, you can switch on/off your bed room light lying in the bed without getting up with an LED torch.

  47. sir, when i connect the bulb to the relay, there is no output. shall i connect the bulb to another battery??? or i will get output from relay.

  48. thanks for this beautiful circuit. .it act as both dark activated and light activated when we connect bulb to relay pins. .will u please tell me some applicatios of this circuit . .

  49. can you please tell me what is the other application of this device..??

  50. Reply to Shubham
    hello,the bulb should be connected to the open end of the relay i.e N O(normally open end) ,which means you have to check the relay pins,which you can by simply using DMM.

  51. list any short way to implement this ckt. and how many light intensity requires for that…

  52. can i use this circuit on Dc power supply if yes then how it possible….

  53. Please tell me where should i connect the bulb in this circuit. I need it fast for my science exhibition .Please help me.. I will be very thankful to you..
    Thank YOu

  54. will you please tell me where to connect bulb in this circuit . . . . . . .

  55. Seetharaman

    Hi Harold it is not possible to design such a long duration timer using standard timer ICs. you can try using a processor based application or micro computer based application. We request the probable contributor to furnish such a circuit and help Mr.Narold..

  56. can you help me to make a circuit that use in self timer switch.i use a two self timer switch and the first timer on in 6 months then if the timer rich that, it will automatically turn off then the second timer will also turn on in 6 months also.

  57. can you help me to make a circuit that use in self timer switch.i use a two self timer switch and the first timer on in 6 months then it the timer rich that, it will automatically turn off then the second timer will also turn on.

  58. seetharaman

    Hi Walid solar system? solar energy projects?

    Hi Semiu What is the background you are looking for. is that the history or application

  59. semiu ahmed

    All i need is the HISTORICAL BACKGROUND OF LIGHT ACTIVATED SWITCH. All this while, i have been searching for the historical background of light activated switch but all my efforts have been proven to be abortive.
    please help me, this is my final year project, i am facing a lot of problems.
    You can send the reply to my e-mail address which is MEDOSTIC@YAHOO.CO.UK

  60. Can I get some projects on solar system???
    If it is less costly then it will be better

  61. seetharaman

    Hi Tomin you can replace the transistor Q1 with TIP122 medium power darlington and use a 12volt power relay for K1, to drive high current devices.

  62. can i connect a relay with more than 5 amp to drive a small motor? what should i do for that?

  63. sir plz help me where i have to connect the light on the relay so when the light falls on the LDR then the light ons so that my project will work

  64. I am semiu ahmed

    You are really doing a great job. Can you please help me on my project. I need everything on LIGHT ACTIVATED SWITCH. Thanks

  65. hello swati here,
    is there any problem with given circuit??
    because i am not getting its output even after trying itlot of times…
    is the suggestion suggestd by mr. john is correct??

  66. Send me the circuit diagram of light activated alarm switch

  67. may i get d details of voltage drop across each component n current flowing through them n mainly d voltage drop across the diode which makes the relay on. its very urgent so please kindly mail me as fast as u can… n can u tell me that whether this project is improvised project of aircraft warning light??

  68. umair hasan

    much thanx for this service.it has helped me v.much for understanding this circuit bcoz i have a project on it.thanx again

  69. Tomoko Eskaf

    Wow! You really covered this topic well. Are there other resources that I should check out?

  70. twits4twats

    hello myself divya…
    i was highly impressed by ur answering can u help me also in my project i want to make a project on path finder robot but i m nt able to get its PCB layout so can u help me in dat cause….i will be highly thankful if u will help me….

    Have a look at the following website. Browse for Microbot System. I think this might be what you are looking for. A very helpful website and highly recommended.

  71. ples tell me that is it enough amplified the output power of the transistor BC 107 to relay switch,….?

    plezz reply me…

  72. can dis circuit works correctly i need a good circuit for my mini project reply me my id ranjithjose3@gmail.com

    plz can u write me the voltage drops,currents its really urgent..

  73. Seetharaman

    Dear Dik
    you can interchange inver and non invert port connection of the comparator IC. The operation will get reversed. Light input to LDR will swich off the relay. If you get a relay chatter in some point of operation kindly add 100mfd 25 volt capacitor in parallel with the relay coil.

  74. hello myself divya…
    i was highly impressed by ur answering can u help me also in my project i want to make a project on path finder robot but i m nt able to get its PCB layout so can u help me in dat cause….i will be highly thankful if u will help me….

  75. i need a circuit which would turn on a light when light to the ldr is hidden for a second or so and would turn off the light again when the light to the ldr is hidden for a sec or so (ie) a circuit that would turn on a light if some person crosses its path and would turn off if some one crosses its path again for my project so please help me with a circuit

  76. moonstone

    plz can u write me the voltage drops,currents its really urgent..

  77. moonstone

    can u plz mention what r da voltades,currents,saturation points and drops here ?

  78. I want to design a circuit wherein a permanent beam of light is present in an equipment. When the user uses the equipment the beam of light is cut momentarily and a device is switched on. How should I go about designing such a circuit?

    • admin

      I will work on it and the circuit will be here as soon as possible.

  79. what is the difference between a light activated switch and a light activated alarm

    • admin

      light activated switch means a switch that becomes either ON or OFF when the light intensity crosses a set value.You can connect any device like bulb, motor, alarm etc through this switch.

      light activated alarm means the alarm will become either ON or OFF when the light intensity crosses the set value.

      If not , comment here. I will give you a very detailed description.

      circuits today

  80. This circuit will NOT work unless R5 is connected instead between Pin 7 and Vcc, leaving the base of the transistor directly connected to Pin 7.

    • babalwa saki

      dear sir

      would like to use dt cct on ma car,dnt knw o whr bt it cmz interesting,any ideas mayb