The 4 simple light activated day night switch circuits explained here can all be used for controlling a load, normally a 220V lamp, in response to the varying levels of the surrounding ambient light.
The circuit can be used as a commercial automatic street light control system, as a domestic porch light or corridor light controller or simply can be used by any school kid for displaying the feature in his school fair exhibition.The following content describes four simple ways of making a light activated switch using different methods.
1) Light Activated Day Night Switch using Transistors
The first diagram shows how the circuit can be configured using transistors, the second and the third circuits demonstare the principle by using CMOS ICs while the last circuit explaines the same concept being implemented using the ubiquitous IC 555.
Let’s evaluate the circuits one by one with the following points:
The first figure shows the use of a couple of transistors in association with a few other components lke resistors for the construction of proposed design.
You will also Like: Automatic Street Light Circuit
The transistors are rigged as inverters, meaning when T1 switches, T2 is switched OFF and vice versa.
The transistors T1 is wired as a comparator and consists of an LDR across its base and the positive supply via a preset.
The LDR is used for sensing the ambient light conditions and is used for triggering T1 when the light level crosses a particular set threshold. This threshold is set by the preset VR1.
The use of two transistors particularly helps to reduce the hysteresis of the circuit which would have otherwise affected the circuit if only a single transistor would have been incorporated.
When T1 conducts, T2 is switched OFF ans so is the relay and the connected load or the light.
The opposite happens when the light over the LDR falls or when darkness sets in.
Parts List:
- R1, R2, R3 = 4k7 1/4 watt
- VR1 = 10k preset
- LDR = any small LDR with around 10k to 50k resistance in day light (under shade)
- C1 = 470uF/25V
- C2 = 10uF/25V
- All diodes = 1N4007
- T1, T2 = BC547
- Relay = 12V, 400 ohms, 5 amp
- Transformer = 0-12V/500mA or 1 amp
2) Light Activated Day Dark Switch using CMOS NAND gates and NOT Gates
The second and the third figure incorporates CMOS ICs for executing the above functions and the concept remains rather similar. The first circuit out of the two utilizes the IC 4093 which is quad two-input NAND gate IC.
Each of the gates are formed into inverters by shorting its both the inputs together, so that the input logic level of the gates now get effectively reversed at thie outputs.
Though a single NAND gate would be enough for implementing the actions, three gates have been engaged as buffers for getting better results and in a view of utilizing all of them as in any case three of them would be left idle.
The gate which is responsible for the sensing can be seen accompanied with the light sensing device LDR wired across its input and the positive via a variable resistor.
This variable resistor is used for setting the triggering point of the gate when the light falling over the LDR reaches the desired specified intensity.
As this happens, the gate input goes high, the output consequently becomes low making the outputs of the buffer gates high. The result is the triggering of the transistor and the relay assembly. The connected load over the relay now flips into the intended actions.
The above actions are exactly replicated using the IC 4049 which is also wired with similar configuration and is quite explanatory.
Parts List
- R1 = Any LDR with resistance of around 10k to 50k in day light (under shade)
- P1 = 1M preset
- C1 = 0.1uF ceramic disc
- R2 = 10k 1/4 watt
- T1 = BC547
- D1 = 1N4007
- Relay = 12V, 400 ohm 5 amp
- ICs = IC 4093 as in the first example or IC 4049 as in the second example
3) Light Activated Relay Switch using IC 555
The last figure illustrates how the IC 555 may be configured for executing the above responses.
Video Clip demonstrating the practical operation of the above IC555 based day night automatic lamp circuit
Parts List
- R1 = 100k
- R3 = 2m2
- C1 = 0.1uF
- Rl1 = 12V, SPDT,
- D1 = 1N4007,
- N1----N6 = IC 4049
- N1----N4 = IC 4093 IC1 = 555
4) Automatic Night Operated LED Lamp Circuit
This fourth circuit is not only simple but very interesting and very easy to build. You might have seen the new flashlights manufactured with new high bright high efficiency LEDs.
The idea is to achieve something similar but with an added feature.
Functioning Details
To make our circuit operative after dark, a phototransistor is employed, so that when the daylight is void, the LED gets switched ON.
To make the circuit extermely compact one button battery type is preferred here, quite akin to those used in calculators, watches, etc.
Understanding the diagram:
As long as ambient light illuminates the phototransistor, the voltage at its emitter lead is sufficiently high for the base of PNP transistor Q1 to keep it shut off.
However when darkness sets in, the phototransistor starts losing conduction and the voltage at its emitter diminishes causing the phototransistor to slowly switch OFF.
This prompts Q1 to begin getting the biasing via its base/ground resistor R and it starts to illuminate brightly as darkness gets deeper.
In order to control the level of the ambient light for which the LED may be desired to be switched ON, he resistor R values may be varied until the desired level is satisfied. Putting a potentiometer may not be recommneded, just to ensure a compact and sleek dimension of the unit.
The circuit may consume approximately 13 mA when the LED is illuminated and just a few hundred uA when its switched OFF.
Circuit Operation
Bill of material for the discussed automatic night operated LED lamp.
- 1 PNP BC557A
- One compatible phototransistor
- 1 super bright white LED
- 1 battery 3V coin
- One 1K resistor
PHOTO-ELECTRIC RELAY
You can find lots of applications in which photoelectric detection is employed to turn a circuit on/off. This below shown straightforward circuit is configured like a bistable multivibrator.
The Q1 base resistor is actually a photo-resistor with the number ORP12. In the absence of light, the resistance of the photo-resistor is high, this causes Q1 to conduct and Q2 is remains shut off. As the incident light on the photo-resistor OPR12 increases, its resistance falls to a point, until Q1 switches OFF and Q2 switches ON hard, activating the relay coil.In order to reset the circuit we can use the given push-button.
The freewheeling diode connected across the relay coil is to protect the transistor from relay coil reverse EMF spikes, and this diode could be any silicon diode such as the 1N4148 or 1N41007.
Automatic Light Sensitive Switch with Adjustable Dawn or Dusk Switching
This automatic ON/OFF light switch features a selector switch which facilitates the lamp (load) either to switch ON during night and switch OFF during day, or the opposite, that is switch ON during day and switch off at night or in darkness.
In other words the circuit can be used like a day activated automatic switch or a darkness activated automatic switch, depending upon the user preference or the specific application need.
The selection can be implemented simply with a flick of a DPDT switch.
WARNING: The circuit is not isolated from the AC mains supply and will be floating at the mains level, which can be fatal for anybody who touches the circuit in powered ON condition, without an insulated enclosure.
Circuit Description
- Parts List
- All resistors are 1/4 watt 5% CFR, unless, otherwise specified.
- R1 = 100K 1 watt
- R2, R3 = 100K
- R4 = 4.7K
- R5 = 220K
- R6 = 470K
- R7 = 68K
- R8 = 33K
- R9 = Any standard LDR
- P1 = 100K preset or trimpot
- Capacitor
- C1 = 100uF/25V Electrolytic
- Semiconductors
- D1 ----- D4 = 1N5408
- D5 = 10V 400 milliwatt zener diode
- T1 = BC547 Transistor
- Th1 = SCR C106
- IC1 = IC 741
Referring to the schematic above, the working of this dual function light activated switch can be understood with the following points:
The op amp 741 forms the heart of the circuit and is wired as a comparator.
Its non-inverting input pin#3 is clamped with a fix reference derived from the junction of the resistive divider formed by R2/R3.
R2, R3 being equal in value, the reference voltage is set at the 50% of the zener voltage D5 which is used for stabilizing the rectified 310 VDC to 10 V DC.
The input DC power is supplied directly from the AC mains via a bridge rectifier set up, while the rectified DC high current is dropped through R1 to suit the attached electronic circuitry.
Now, the non-inverting pin of the op amp being fixed at around 5 V reference, the inverting input pin#2 is used for the detection of the light level via another resistive network formed by R1/P1 and the LDR.
Using as Light Activated Switch
Since the pin#3 is fixed at 5 V, means, as long as the pin#2 remains below this reference level, the op amp output remains high, enabling the T1 to remain switched ON, and the SCR/load switched OFF.
This situation takes place when the R4 end is connected with the positive line, and the LDR is connected at point B which is the ground line, and illuminated by day light.
This is because, during day time the LDR resistance drops drastically causing the pin#2 potential to drop significantly and below pin#3 potential.
So with the selector switch contacts connected across points E and B, the light sensitive switch works like an automatic light activated switch.
Using as Night or Darkness Activated Switch
In order to flip the response, and enable the light sensitive switch to work like a darkness or night activated switch, we just have to toggle the selector switch such that the relevant contacts connect the points D with the positive line, and point C with the negative line.
Once this is implemented, the LDR now gets associated with the positive line, and the R4 end gets connected with the negative line.
In this situation, if the LDR is sufficiently illuminated, causes its resistance to drop, which in turn causes the pin#2 potential to rise over the pin#3 reference level. This instantly causes the op amp output pin#6 to go logic zero, and switch OFF the BJT driver.
With the BJT turned OFF, the SCR and the load are also turned OFF in the presence of day light on the LDR.
Next, when darkness sets in, the LDR resistance increases sufficiently, causing the pin#2 potential to drop below the pin#3 potential, switching ON the BJT, the SCR, and the load, during the night time.
The circuit is now transformed into a darkness activated switch for the load or the connected lamp.
Therefore, just by flipping the selector switch connections across the B-C and D-E points, the light sensitive switch can be quickly pushed into the desired modes, either as an automatic light activated or darkness activated switch.
Hysteresis Function
Resistor R5 introduces some level of hysteresis to the op amp response so that the output of the op amp does behave erratically during the twilight or the transition periods where the light level on the LDR is at the threshold points.
The R5 ensures that the op amp output switches ON or OFF firmly, only once the light level has convincingly crossed the switching threshold.
Nontobeko says
design and connect a low voltage 220/12v lighting circuit. the connecting sequence will consist of wiring up two,220v lamp via a daylight switch which also activates the timer that connect the second lamp of fluorescent light.
Sharan says
Swagatam,
Instead of c1 0.1 ceramic disk can I use 0.22uf?
Swagatam says
0.22uF will also work, make sure to connect it directly across the pin1 and pin8 of the IC or directly across the supply pins of the IC.
Sharan says
Hello swagatam,
Day night sensor light using ic 4049 and transistor bc 547 please tell me connection of emitter collector means where is connected voltage and ground
Swagatam says
Hello Sharan,
The emitter of the transistor is connected to the ground supply or the 0V supply, collector is connected to the relay coil. Pin number 1 of the IC 4049 will go to the positive supply, and pin 8 of the IC will go to the ground supply.
Sharan says
I have equalized all the connections as you said, but the circuit is not working. Only relay is working.
Swagatam says
The 4049 is a very simple circuit and should work, check all IC connections.
Sharan says
Please tell me ic 4049 pins 1-16 voltage
Swagatam says
Short circuit the LDR points, then pin2 should become 0V, and the all 4049 gates connected to R2 should become high or 12V. The opposite should happen when the LDR is removed or pin 3 is disconnected from the positive supply.
Big G says
In the first circuit:
The LDR is used for sensing the ambient light conditions and is used for triggering T1 when the light level crosses a particular set threshold. This threshold is set by the preset P1.
WHAT P1? NO P1 IS SHOWN!
Swagatam says
Thanks for pointing out the mistake. P1 is actually the variable resistor VR1. I will correct the mistake soon.
Ray says
What is the parts list for the
Automatic Light Sensitive Switch with Adjustable Dawn or Dusk Switching.
I am unable to see the diagram clearly
Swagatam says
I have added the parts list under the specified circuit diagram.
Leon says
Good day.
I have a tropical fish tank which has a 220v L.E.D UV light installed. I am running it on a timer at the moment.
Is there a possibility to have a day & night switch that only switches on during daytime ??
Regards
Leon
Swagatam says
Yes that’s possible. You can try the first circuit from the following article. Make sure to connect the bulb to N/O contact of the relay instead of N/C .
https://www.homemade-circuits.com/3-simple-automatic-street-light-circuits-explored/
papaciela (Claude) says
Hello Swag,
Long time since the last time I writte to you ! How are you?
Swag, I need your help to have a similar circuit as those showed here, but I like to use the system for LED’s (in DC then). So I do not need the AC transformer.
I’m sure you have a drawing for that,but I’m not able to find it in your numerous circuit.
Thanks in advance
Claude
Claude
Swagatam says
Hello Papaciela, for switching LEDs directly with a DC source you will have just remove the relay, and put LEDs in its place. The configuration of the LEDs and the driver transistor rating will depend on the specifications of the LED.
Dr. LUKE THOMAS says
Dear Mr. Swagatam,
I am a retired senior citizen, an ex – Government employee. Though a Registerd Medical Practitioner, at present I am spending my time to design an equipment to do ‘ Non invasive knee repairs. ‘ It is almost in the final stages. My equipment is intended to produce synovial fluid. One of the reasons for knee pain in elderly people is insufficient synovial fluid.
When I was searching for a simple oscillator circuit, I came across your website. I have gone through some of your circuits and explanations.
You are doing a great work in teaching practical electronics, simple and beautiful. Hats off. Please keep it up.
With love and regards
Dr. Luke Thomas
Paul says
Hello Swagatam,
In the above circuit 4) Automatic Night Operated LED Lamp Circuit, please could you explain to me why the Q1 emitter is connected to positive and the collector to the load and ground. All of the PNP circuits I have built so far have the collector to +V and the emitter and load to ground.
Thanks in advance.
Swagatam says
Hello Paul, the emitter of PNP is always with reference to the positive line, and its collector is always towards the negative or the ground line, and for NPN the emitter is always with reference to the ground or 0V line.
PNP collector can never be associated with the positive line, that can never work.
Paul says
Hello Swagatam and thanks for the quick reply.
I’m still confused as what you say is how I understood PNP transistors to work but digging deeper into this, I’ve found several articles which suggest that the arrangement where the collector is connected to V+ and the emitter to load and ground does work although with a greatly reduced gain factor, and I have constructed your circuit with the c and e connected in both directions with success. Odd!
Swagatam says
Hello Paul,
there’s no way you can make a PNP conduct by connecting its emitter with the negative line, and collector load with the positive line. It is like trying to use a diode by applying positive to its cathode and the load to its anode and negative line.
Paul says
Hello Swagatam
Rest assured I can prove this – I will send you a video if you wish. Please consider my earlier comment about loss of gain – this is documented here: https://electronics.stackexchange.com/questions/29756/bjt-in-reverse-active-mode-of-operation
I appreciate this document is for a NPN but the same applies for a PNP.
Thanks
Swagatam says
Hello Paul, No matter what anybody says, it’s no point discussing something which unnatural, abnormal and nontechnical. In electronics I will believe and follow only those concepts which makes sense and is recommended by the researcher and the manufacturer.
Sarwana says
Hello Mr. Swag , I use the 555 circuit and work fine can it be supplied with a transformerless power supply ? in this post https://www.homemade-circuits.com/cheap-yet-useful-transformerless-power/
Sorry my english is not good
Swagatam says
Hell Sarwana, yes that may be possible. You can try the first transformerless power supply design, but make sure to change the 50 ohm resistor to 5 ohms resistor, and use a 5 watt zener instead of 1 watt.
Umar says
I want to use it for providing light for 12-16 hrs per day requirement.
Hen actually needs 12-16 hrs of light for cycle that need for egg laying. During winters daylight is shorter and as sun set it will automatically switch on the light and switch it on till 12-16 hrs of total light (including natural sun light + artificial light) have been completed.
Ariv says
In project number 1 (with transformer), why using R3? What if only using R2 (R3 removed)?
Swagatam says
You can remove R3, it will still work
Seun says
Hello sir Swag, can this light sensor circuit respond to my neighbour’s light bulb source.
Swagatam says
Hello Seun, yes definitely, if the light source is bright enough, to prevent this you should put the LDR inside a pipe like enclosure so that it sees only the ambient light and no other artificial light
Rabah BOURETT says
Thank you Mr SWAGATAM for your fast replay and for the added listing of parts. So
while I was thinking about the execution of the project N°2, I have got the Idea to ask you what can we add to the diagram to get the special lights remote controled instead of its dependance to the day light, I mean to switch between ON and OFF at any time with a remote controle device, any one, of course something simple.
Salutations.
Swagatam says
Hello Rabah, Remote control is possible by integrating any preferred remote control circuit output with the relay driver stage.
You can find many remote circuits here:
https://www.homemade-circuits.com/?s=remote+control+simple
Rav Denver says
Good day sir swag? I’m here again and I need your help in regarding to 220v automatic street light by using of BT136/ BT138. Sir base on the project that I see in YOUTUBE. What do you think about the BT 136/ 138, this can work for 220v to ON n OFF the led bulb? Thank you
Swagatam says
Hi Rav, yes it should work but you must connect a triac correctly as indicated in the following example:
Rav Denver says
Hello sir swag, actually the circuit that I see is only 3 pcs parts or 4. A bt 136, resistor, and ldr which is connected to direct 220v. The ldr connected to T1 and Gate. While the bulb connected to T1 and T2. It is possible to switch on the bt136 in dark place/night? Thank you
Swagatam says
Hi Rav, you can try the following configuration, it should work.
It was designed by Mr. D MohanKumar
Rav Denver says
Thank you very much sir swag for your always free of time to answer my query. After I test this circuit you give, I’ll give you the feedback for the result of my test. Thank you again sir.
Swagatam says
No Problem Rav, wish you all the best!
papaciela says
Hi Swag,
A bad manip…. Here again my question:
Can I change R3 by a variable resistor or potentiometer if I want to use different light ambient intensity to adjust the threshold that will activate the relay. What would be the range value of this component to obtain this.
Thank’s and regards
Swagatam says
Hi Papa Ciela, thanks for posting your question again! If you are referring to the IC 555 circuit, you can replace R1 with a 1M pot for getting the required adjustments.
R3 and C1 are placed for implementing a slight delay in the operation, so that the relay does not vibrate during twilight transitions.
papaciela says
Hi Swag,
You answer at the light speed !!!
Thank you so much !!
Swagatam says
You are welcome Claude!
Faith Jumbo says
lease the pin 7 and 5 connected with a resistor are not taken to ground and the pin 1 again can i use preset in place of one connected to pin 2 thanks
Swagatam says
pin7 and 5 should be exactly as shown, they shouldn't be grounded.
Pin#1 line is the negative supply line.
1M preset can be used with pin#2
fasat2112 says
Hello,
Can you tell for the first diagram what are R1, R2, R3 and VR1 values?
Thank you
BR
Swagatam says
you can refer to this article for more info:
https://www.homemade-circuits.com/2011/12/super-simple-light-activated-switch.html
tristan pagdanganan says
can you help me how to make LDR opposite ? in a way that when the loght come through the LDR the electricity cant flow or turn off and when the LDR sense dark the electricity can flow or turn on…?
Swagatam says
in the above shown diagrams, you just need to change the position of the lDR from the upper arm of the preset to the lower arm of the preset or vice versa for getting the desired results
Sasa Hadia says
Hello swagatam
I know what is LDR function but I don't know how to buy it and what is its name in the market.
Can you please sho me its name in the market.
Thank you
Swagatam says
Hello Sasa,
It's called LDR everywhere, even the shopkeeper will know this and identify this component as LDR only, so you can tell him this name.
Keenmer Jon Serrano says
@Swagatam Majumdar what is the value of resistor and the variable (potentiometer) in figure no.1 please help my for my project to be submit in monday please
Swagatam says
Please check the following link for the details:
https://www.homemade-circuits.com/2011/12/super-simple-light-activated-switch.html
Mukesh says
hi can you elaborate please cant understand your reply..for LDR
Swagatam says
make the last 555 circuit given in the above article, interchange R1 and the LDR positions, remove the relay and use the positive supply coming out from its pin3 to power the flasher circuit meaning the flasher circuit's positive line will get powered from the above circuits pin3 and NOT from any external 12V source. This configuration will shut off the LEDs during day and vice versa.
Atigah Michael says
Please am constructing same automatic street light system using 555 timer circuit as my final year project work in school
Please I need your help.
Swagatam says
Please provide more details I will try to help!
Atigah Michael says
Thanks but please after u are done send me the link to watch
Swagatam says
I think the circuit is already given in the above article. Design no. 3)
Atigah Michael says
Please am constructing automatic street light system using,
1 IC NE555 1
2 Bipolar Transistor BT136 1
3 Diodes 1N4007 4
4 Zener diode 12V 1W 1
5 LDR – 1
6 AC Lamp 230V 1
7 Variable Resistor 10K 1
8 Resistor 470Ω, 1M/1W 1, 1
9 Ceramic Capacitor 330nF, 0.01µF 1, 1
10 Electrolytic Capacitor 330 µF 1
11 AC Power Supply or AC adapter 220V 1
Please I need the pdf or knowledge about of same project work to do mine
Swagatam says
Hi, I cannot provide the exact project with the exact parts details you have provided, however I can design it with my own knowledge and understanding.