Automatic Night Lamp using LDR

Automatic Night Lamp using LDR

Automatic night lamp as the name suggests is for turning ON and OFF the lamp automatically without the need of human interventions. It senses the light intensity from surroundings and find whether its day or night. And it automatically turns ON when the surrounding is dark and it turns OFF when it receives light from surroundings. A sensor called LDR is used to detect the light intensity. This project finds wide outdoor applications in streets, gardens and public places where it finds difficulty to appoint a person to operate the lights.

Components Required

  • Light Dependent Resistor (LDR)
  • LM358 Op-Amp
  • Resistor 22KΩ
  • Resistor 10KΩ
  • Preset 10KΩ
  • BC547 transistor
  • 1N4148 diode
  • 12V Relay

Circuit Diagram

Automatic Night Lamp - Circuit Diagram

Automatic Night Lamp – Circuit Diagram

Working

The main part of this circuit is the light dependent resistor (LDR). It is a sensor which is a particular kind of resistor whose resistance decreases when exposed to light. Likewise it offers high resistance in dark. The resistance value changes from few 100 ohms to mega ohm range. The LDR is placed in a potential divider network. So voltage across LDR changes with intensity of light. Voltage across the LDR is given to the positive terminal of a comparator. Now a reference voltage is required to compare with the voltage across LDR. That reference voltage is made by using the pot or preset. So this preset can be used to adjust the sensitivity of the circuit. Next is the comparator made using LM358 op-amp which compares the voltage levels at its two inputs and gives output accordingly. If the voltage at positive terminal is greater, the output will be high and if the voltage at negative terminal is greater, the output will be low. That is if it is dark, resistance across LDR is high, so voltage drop across the LDR is high and voltage at positive terminal will be greater than the reference voltage. Therefore output of comparator will be high. The output of comparator is given to a transistor wired as a switch. Since enough voltage appears across the base emitter junction, the transistor conducts and current passes through the relay coils. So relay switches its contact and the bulb glows. Bulb is connected to the NO (Normally Open) pin of relay as it should be off when the relay coils are not energized. If the output of comparator is low, then transistor will be in OFF stage. So no current flows through the relay and bulb remains in OFF stage.

Automatic Night Lamp Working Animation

Automatic Night Lamp Working Animation

You can choose a voltage between 3 to 32V for powering this circuit depending of the relay coil voltage. I choose 12V since 12V relays are very common in the market.

Note : You should keep the LDR in such a way that light from lamp L1 (connected to this circuit) will not fall on it.


Power Supply

I prefer to use a capacitor dropper power supply. I used the following circuit for that, it is a 12V, 40mA supply. Please read the article, Transformerless Capacitor Power Supply for more details about it.

Transformerless Capacitor Power Supply 12V 40mA

Transformerless Capacitor Power Supply 12V 40mA

Video

Share this post

Comments (18)

  • Golam Rasul Chowdhury

    In the evening during the conducting time light is blinking. How can I reduce this?

    September 8, 2016 at 9:19 am
  • Ligo George

    Try changing the value of R1, such that it will reduce the effect of LDR resistance.

    September 10, 2016 at 10:19 pm
  • Mark

    Can i use 12v led in series with this.instead of a normal 230 bulb.and what will i change from the power supply?
    Tnx…

    December 18, 2016 at 9:05 pm
  • Sowmya Dhumale

    i have connected the circuit on the bread board.
    but, bulb is glowing always irrespective of the darkness around.
    suggest some solution for this.

    December 19, 2016 at 4:49 pm
  • Kai Kai

    Where to connect the com of the relay?

    March 10, 2017 at 10:39 pm
  • MarkSH

    The circuit needs a high value resistor between the output and the non-inverting input of the LM358 to create some amount of hysteresis otherwise the relay will chatter at the threshold of switching. Try putting a resistor value of between 100k and 1M. The higher the resistor value will reduce the the hysteresis.

    April 13, 2017 at 12:45 am
  • MarkSH

    The common of the relay is connected to the live of the mains. The neutral of the mains is connected to the bulb then to the Normally Open (NO) side of the relay. The relay and this side of the circuit MUST BE isolated from from the rest of the circuit to avoid electrocution.

    April 13, 2017 at 12:54 am
  • MarkSH

    Add a high value resistor (between 100k and 1M) between the output (pin 1) and the non-inverting input (pin 3) of the LM358. This will create some hysteresis in the circuit and the switching then should not flicker. Try experimenting with different values of resistors. The higher the resistor value, the reduction in hysteresis.

    April 13, 2017 at 1:02 am
  • MarkSH

    Yes, but you do not need R2, Q1, D1 or RL1. Use a 1k and LED in series between the output (pin 1) of the LM358 and the Ground rail.

    April 13, 2017 at 1:10 am
  • shawon

    i am using 684 pf , 400v capacitor instead of 680 nf, 400v capacitor, have to change anaything of circuit??

    November 18, 2017 at 11:10 pm
  • shawon

    i am using 684 pf , 400 v capacitor..and i got 9.54 output voltage in multimeter.. for that i m using 6v relay bt my circuit is not working.. relay is not working and bulb is not glowing… what i have to do now? pls ans asap .. 🙂

    November 18, 2017 at 11:15 pm
  • Akshay Kumar

    My project is working opposite
    When its bright the lamp is on and when there is dark then the lamp is off

    March 26, 2018 at 4:59 pm
  • Ligo George

    Please check the position of LDR and Resistor R1. Also check whether you connected inverting and non-inverting terminal of the opamp correctly.

    April 2, 2018 at 12:32 pm
  • Akshay Kumar

    Sir can i get the PCB design for the circuit please!

    April 14, 2018 at 7:30 am
  • Ligo George

    Hi,
    Sorry currently we don’t have the PCB design of the above circuit. You can drop a mail to [email protected] if you need it to be developed.

    April 21, 2018 at 12:26 pm
  • Steve

    It’s simple, just reverse connection between relay and lamp. (NO to NC / NC to NO)

    May 9, 2018 at 6:08 pm
  • Dan Baconga

    HI! PLEASE HELP ME I WANT THIS KIND OF PROJECT FOR MY FINALS IN MY ELCTRONICS SUBJECT AND I WANT PUT A MORNING ALARM. BUT THE PROBLEM IS IT MUST NOT USE AN IC BUT ALL AUTOMATIC NIGHT LAMP WITH MORNING ALARM CIRCUIT USE AN IC. ARE THERE ANY AUTOMATIC NIGHT LAMP WITH MORNING ALARM CIRCUIT THAT DOES NOT USE AN IC?? PLEASE HELP. THANK YOU

    October 4, 2018 at 5:06 pm
  • joshi

    plz tell me,the working when we have to use ic 741 as a comparator in automatic night lamp & when we have to use transistor as a switch tell me its range in active as well as saturation region ???

    December 18, 2018 at 12:15 am

Leave a Reply

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