Tutorial 20: Automatic Light

Created on: 6 August 2012
Updated on: 31 January 2023

In this automatic light electronic circuit, when the ambient light level drops below a certain level, the LED switches on automatically. The circuit uses an operational amplifier, or op-amp IC. In addition, a LDR, or light dependent resistor detects the current light level.

The following video shows the automatic light electronic breadboard project operating. When a piece of cardboard is placed in front of the LDR, the light to the LDR decreases. As a result, the op-amp switches the white LED on. This simulates a night light that switches on automatically when the ambient light becomes dark enough.


Know how to use an 8-pin DIP IC, e.g. from tutorial 5. Read about operational amplifiers (op-amps). Read about LDRs if you have not used one yet.

Automatic Light Circuit Components

In addition to a breadboard, wire links, 9V battery and battery clip, you will need:

Qty Part Designator Notes Type
2 100k resistors (brown - black - yellow) R2, R7 1/4W 5% or better Resistors
1 56k resistor (green - blue - orange) R1
1 33k resistor (orange - orange - orange) R6
1 10k resistor (brown - black - orange) R5
1 4k7 resistor ( yellow - violet - red) R8
1 1k resistor (brown - black - red) R3
1 100uF capacitor C1 Electrolytic capacitor, 16V or more Capacitor
1 LM741 U1 LM741 op-amp IC (8 pin DIP) Semiconductors
1 PN2222 or KSP2222 Q1 NPN transistor
1 1N4148 D2 Diode
1 LED D1 E.g. 5mm white LED
1 LDR R4 LDR (Light Dependent Resistor) LDR

To make the light level at which the LED switches on adjustable, you will also need a 100k trimpot.

Automatic Light Circuit Diagram

Two automatic light circuit diagrams have been included. The first diagram shows the automatic light circuit using a fixed light level to automatically switch the LED on. The second circuit adds a trimpot to make the level at which the LED switches on adjustable.

Automatic Light Circuit Diagram with Fixed Trigger Threshold
Automatic Light Circuit Diagram with Fixed Trigger Threshold
Automatic Light Circuit with Adjustable Trigger Threshold
Automatic Light Circuit with Adjustable Trigger Threshold

Building the Automatic Light Circuit

The LM741 IC is housed in a 8-pin DIP, so normal DIP IC pin numbering applies to it. If using a bright LED, place the LED away from the LDR. A photo of the completed breadboard circuit is shown below. Click the photo for a bigger image.

The automatic light circuit on breadboard
Automatic Light Circuit on a Breadboard

Operating the Circuit

Cover the LDR to restrict light to it and the LED will switch on. If you have built the circuit with the trimpot, then adjust the trimpot so that the LED switches on at the desired light level. Do this by covering the LDR so that the desired level of light is reaching it. Now adjust the trimpot until the LED just switches on.

Keep the LED away from the LDR. If the light from the LED is bright enough and it reaches the LDR, then the automatic light circuit will switch off because there will be enough light reaching the LDR. After the circuit switches off, the light from the LED will no longer reach the LDR which will cause the circuit to switch the LED on again. The circuit will carry on "oscillating" like this until there is enough ambient light, or the light from the LED is prevented from reaching the LDR.

End of this Tutorial Series

We have reached the end of this tutorial series for beginners in electronics. I hope that you enjoyed building the circuits in this series. The subject of electronics is so vast that there is always something new to learn. Go back to the beginner's section to look for more beginner's tutorials and articles.