Light activated switch circuit

A Simple Light activated switch

Description.

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

Notes.

  • 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

Show Comments

97 thoughts on “Light activated switch circuit

  1. habib

    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.

    Reply
  2. rohit

    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

    Reply
  3. Ronny

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

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

    Reply
  5. priya

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

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

    Reply
  7. Brian

    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!

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

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

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

      Reply
    • Mihai

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

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

    Reply
  11. vysakh

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

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

    Reply
  13. virender

    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.

    Reply
  14. joel

    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.

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

    Reply
  16. Jim Floyd

    Hi,

    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

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

    Reply
  18. 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
    http://www.national.com/ds/LM/LM311.pdf

    Reply
  19. Raji

    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.

    Reply
  20. Marvin

    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.

    Reply
  21. gahnkib

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

    WITH THE ABOVE I STILL CAN HERE THE CLICK BUT IT IS WEAK,THE LED DOES NOT LIGHT,PLEASE ADVISE,AM SUSPECTING THE CURRENT TO ENERGIZE RELAY IS SMALL,SHOULD I REPLACE THE RELAY OR THE BC107. PLEASE ADVISE,ONCE AGAIN THANK YOU FOR THE INITIAL ADVISE.

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

    Reply
  23. gahnkib

    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.

    Reply
  24. dave

    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…

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

    Reply
  26. SHUBHAM

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

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

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

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

    Reply
  30. Shubham

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

    Reply
  31. sajan

    looking for a circuit designer
    to design game circuit for my school kids.
    objective:-
    +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

    Reply
  32. sajan

    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

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

    Reply
  34. Satish

    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.

    Reply
  35. Shubham

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

    Reply
  36. saad

    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.

    Reply
  37. Shubham

    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

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

    Reply
  39. harold

    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.

    Reply
  40. harold

    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.

    Reply
  41. seetharaman

    Hi Walid solar system? solar energy projects?

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

    Reply
  42. 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
    Thanks

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

    Reply
  44. nawaz

    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

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

    Reply
  46. swati

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

    Reply
  47. swati

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

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

    Reply
  49. 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….

    Divya
    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.
    http://www.rev-ed.co.uk/picaxe/

    Reply
  50. sumith

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

    plezz reply me…

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

    Reply
  52. divya

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

    Reply
  53. aashique

    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

    Reply
  54. Dik

    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?

    Reply
    • admin Post author

      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.

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

      regards
      circuits today

      Reply
  55. John

    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.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>