A light sensor circuit is a simple yet practical project, commonly used in applications like automatic night lights or brightness-sensitive devices. In this guide, we’ll create a circuit where an LED lights up in the dark using a PNP transistor.
How It Works
The circuit uses a Light Dependent Resistor (LDR) to detect light levels and a PNP transistor to control the LED. The LDR and a resistor form a voltage divider, which determines the voltage at the transistor’s base.
In darkness, the LDR’s resistance increases, lowering the base voltage below the emitter voltage by at least 0.7V. This turns the transistor on, allowing current to flow from the emitter to the collector, lighting up the LED. In bright light, the LDR’s resistance drops, raising the base voltage and turning the transistor off, so the LED remains off.
Components Needed
- 1 PNP Transistor (e.g., BC557)
- 1 LDR
- 1 LED
- Resistors: 10kΩ, 1kΩ x 2
- 9V Battery
- Breadboard and jumper wires
Step-by-Step Instructions
- Assemble the Voltage Divider: Connect the LDR and a 10kΩ resistor in series between the battery’s positive and negative terminals. The junction of (LDR & Resistor) components provides the base voltage.

- Connect the Transistor: Attach the base of the PNP transistor to the voltage divider output via a 1kΩ resistor. Connect the emitter directly to the positive terminal of the battery.

- Add the LED: Connect the collector of the transistor to the LED’s anode. The LED’s cathode goes to the battery’s negative terminal through a 1kΩ resistor.

- Power Up and Test: Observe how the LED lights up in darkness and turns off in bright light.
The two resistors form a voltage divider, setting the transistor’s base voltage VB. Since a BJT is current-controlled, a small base current IB flows, controlling a larger collector current IC based on IC = β IB. The LDR influences IB , making the transistor respond to light levels. This ensures proper biasing with VBE ≈ 0.7V, allowing the transistor to switch based on illumination.
Note: Click on LDR and use the slider to simulate dark and bright environment. CLICK HERE for tinkercad simulation
Things to Consider When Building a Practical Circuit
- Use Current-Limiting Resistors: Always include a resistor in series with the LED to prevent it from burning out.
- Account for Real-World Differences: Components may behave slightly differently in practice due to tolerances. Use a multimeter to verify voltages at key points like the base and collector.
- Start with a Simulation: Tools like Tinkercad help you test and debug the circuit before assembling it physically. Simulations can save time and prevent errors.
Conclusion
This simple light sensor circuit is a fantastic way to explore how transistors and sensors work together. By understanding the roles of the LDR and the PNP transistor, you can create a functional circuit that responds to changes in light. Begin with a simulation to refine your design, then build it on a breadboard to bring it to life. Once you’ve mastered this, try experimenting with other transistor types like NPN or FETs to expand your knowledge!








