This article explains an automatic night lamp circuit diagram using LDR and LM358 OPAMP which automatically turns the LEDs ON at night and OFF when it is daytime. The sensing part which is being used for detecting the light is a Light Dependent Resistor (LDR). The resistance of LDR depends on the light incident on it. The greater the light, the lower will be the resistance. We are using a relay to control an AC lamp.
Components Required for Automatic Night Lamp:
- R1 LDR (light dependent Resistor)
- RP1 10k potentiometer
- R2 22k
- R3 10k
- Q1 BC547 (NPN Transistor)
- 1N4148 Diode
- 12V Relay SPDT
- LM358 OPAMP
- Bulb
For pin configurations of transistors and IC, see the datasheet.
Working of Automatic Night Lamp Circuit:
The working of the circuit is simple. OPAMP LM358 is used to switch the input of the transistor from high to low. The transistor is used as a switch to control the 12V relay module. When there is no light (at night), the resistance of LDR will increase. The voltage across LDR will increase, this voltage is applied at the non-inverting terminal of the opamp. When it reaches a voltage that is greater than the voltage at the inverting terminal of opamp output goes high. Transistor Q1 will turn ON, it will drive the relay. The relay will turn ON and it will switch the AC light bulb making glow.
In daytime due to sunlight resistance of LDR decreases hence the voltage across it also decreases. Eventually, the voltage at the non-inverting terminal of opamp becomes less than that of inverting terminal. Finally, the output of opamp becomes low which turns the BJT with relay OFF. This is how the circuit works.
Here is a little modification in the above circuit. The 500K variable resistor allows you to control hysteresis of the circuit. It improves noise immunity and reduces sensitivity of the circuit to small changes in lighting.
The whole circuit can be assembled on PCB. The whole circuit is powered by a 12V DC capacitor power supply. Components must be placed and arranged properly because there is no proper isolation in the capacitor power supply. Do not touch it while testing or operating you may get an electric shock.
12V Capacitor Power Supply to Power Above Circuit:
Components Required for Power Capacitor Power Supply:
Caution: This power supply circuit is dangerous and risky to use. Be careful if you are using it.
If you are inexperienced person, please use a DC 12V source instead of this circuit because it is connected to mains supply and there are high chances of getting electric shock.
- C1 1uF/400 X-Rated Capacitor
- R4 470kΩ/1W Resistor
- KBPC3510 Bridge Rectifier
- C2 220uF/25V capacitor
- LM7812 Voltage regulator
The above circuit can provide 20mA at 12V which is enough for the above circuit to work. The x rated capacitor along with a 470k resistor acts as a drooping resistance it reduces the 230V AC voltage to nearly 12V AC. By using a bridge rectifier circuit, we convert the AC to DC. A 220uF capacitor is used to further smooth out the output from the bridge rectifier circuit. Use a 12V Zener diode at the output of the bridge rectifier for voltage regulation it is not present in the circuit.
The disadvantage of this circuit is that the output current is very low and fluctuates with input AC. Also, the circuit is not isolated from mains power so there is a safety issue. Overall, this power supply can be used for automatic night lamp circuit.
There is no voltage regulation on your power supply circuit diagram, please fix the circuit, or people will destroy devices due to over-voltage.
Fixed 👍