Related Terminologies

Table of Contents

What is automatic night lamp and How it’s work?


Table of Contents

As the name suggests, an automatic night lamp can automatically turn the light on and off without the need for human intervention. It determines whether it is day or night by sensing the surroundings’ light intensity. Additionally, it automatically turns ON when it detects darkness and OFF when it detects light. A sensor called LDR is utilized to distinguish the light force. This task finds wide outside applications in roads, nurseries and public spots where it tracks down trouble to select an individual to work the lights.

Components Required

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

Circuit Diagram


The light dependent resistor, or LDR, is the circuit’s most important component. A particular kind of resistor known as a sensor has a resistance that decreases when it is exposed to light. In the dark, it also has a high resistance. From a few hundred ohms to the mega ohm range, the resistance value changes. A potential divider network houses the LDR. Therefore, light intensity influences voltage across the LDR. The positive terminal of a comparator receives voltage from the LDR. Now, to compare the voltage across LDR with a reference voltage, The pot or preset is used to determine that reference voltage. As a result, the circuit’s sensitivity can be modified with this preset. The comparator, which is made with an LM358 op-amp, compares the voltage levels at its two inputs and produces an appropriate output. The output will be high if the voltage at the positive terminal is higher, while the voltage at the negative terminal will be lower. That is, if it is dark, the voltage at the positive terminal will be higher than the reference voltage due to the high resistance across the LDR. As a result, the comparator’s output will be high. The result of comparator is given to a semiconductor wired as a switch. The transistor conducts and current flows through the relay coils when there is sufficient voltage across the base-emitter junction. As a result, the bulb turns on as the relay switches its contact. Since the bulb should be off when the relay coils are not energized, it is connected to the relay’s NO (Normally Open) pin. In the event that the result of comparator is low, semiconductor will be in OFF stage. So no ongoing courses through the hand-off and bulb stays in OFF stage.

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.

Power Supply

A power supply with a capacitor dropper is my choice. I used the 12V, 40mA supply in the following circuit to accomplish that. For more information, please refer to the article, Transformerless Capacitor Power Supply.

  • 12V Relay

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Whatsapp

Leave a comment

Over 1.2 Million+ learners impacted worldwide

Learners from 170+ countries have grown in their career through our programs

Explore Programs  

Global Presence

Get in touch to learn more about how you can make the best of your talent

Spend less time worrying about job availability, and more time growing your knowledge. Join DIYguru Program today.

If you’re a current student, please get in touch through the DIYguru dashboard to ask about more details of this Program.

Please note, eligibility for this course is reserved to students who have done related projects and have relevant profiles matching with the pre-requisite of this course.

The DIYguru team hold the right to cancel your admisssion into the program without any explanation via email if found unsuitable and unfit.

Our 7-day money-back guarantee starts from the moment of signup and runs through the free week. Cancellations between days 7 and 30 will get a prorated refund.

Fees for the program is charged only when the admission is approved.


Colleges and Institutions

We're growing rapidly across the country, don’t miss out.

Partner with Us


Corporates and Industries

Have workforce requirement or employee upskilling!

Get in Touch



Work with a team that’s transforming future mobility.

DIY with Us

Book Your Free Session Now

Avail free Guidebook and Expert Mentorship in EV domain curated by Industry experts.

Register to continue..

× Need help?