LDR Night Light
Photoresistor and NPN transistor switch an LED on when it gets dark.
Difficulty: Breadboard. Estimated build time: about 20 minutes. Estimated parts cost: about US$0.75. 6-line bill of materials. Compare supplier offers when available. A dark-sensing circuit with no active ICs: a light-dependent resistor (LDR) forms a voltage divider with a fixed resistor, and the midpoint voltage drives the base of an NPN transistor.
Build the voltage divider
Connect a 10 kΩ fixed resistor from Vcc (5–9 V) to one LDR terminal. Connect the other LDR terminal to GND. The midpoint node between the resistor and LDR is the sensor output. In bright light this node sits near GND; in darkness it rises toward Vcc as the LDR resistance increases.
Connect the transistor base
Connect a 10 kΩ base resistor from the voltage divider midpoint to the base of the NPN transistor. This limits base current and provides some hysteresis. The emitter goes to GND. Leave the collector unconnected for now.
Wire the LED load
Connect a 470 Ω current-limit resistor from Vcc to the LED anode. Connect the LED cathode to the transistor collector. When the transistor conducts, it pulls the collector low and current flows through the LED. Double-check LED polarity—flat side of the lens body is the cathode on most 5 mm LEDs.
Test and calibrate
Power the circuit and cover the LDR with your hand. The LED should turn on. Expose the LDR to bright light and the LED should turn off. If the switching threshold is wrong, swap the 10 kΩ fixed resistor for a larger or smaller value. A higher fixed resistor shifts the threshold toward brighter conditions; a lower one shifts it toward darker. A 10 kΩ trimpot in place of the fixed resistor lets you dial in the threshold precisely.