Darkness sensor with two transistors
Build it step by step
0 of 7 doneBuild the divider
Pot from +9 V to node A and the LDR from node A to ground.
Add the first transistor
Node A through 10 kΩ to the base of Q1, collector to the LED cathode, emitter to the base of Q2.
Add the second transistor
Collector joined to Q1's collector, emitter to ground. This is a Darlington pair.
Add the LED
Anode through 330 Ω to +9 V, cathode to the joined collectors.
Test
Cover the LDR with your hand and the LED should light.
Set the threshold
Turn the pot until the LED just turns on at the darkness you want.
Measure
With the meter note node A, the base voltage and the collector voltage in light and dark.
How do you build a darkness sensor with two transistors?
An LDR and a Darlington pair turn on an LED when it gets dark, no chip needed. You need LDR Photoresistor, BC547 NPN transistor × 2, Resistor 10 kΩ, Potentiometer 10 kΩ, LED 5 mm red, Resistor 330 Ω, Breadboard 830 Tie Points, 9 V battery, 9 V battery snap with DC jack and Digital multimeter. It takes 7 steps and about 30 minutes.
- Level
- Beginner
- Time
- About 30 min
- Parts
- 10
Parts list
- SensorsBuy
- SemiconductorsBuy
- PassivesBuyResistor 10 kΩ × 1
- PassivesBuy
- SemiconductorsBuyLED 5 mm red × 1
- PassivesBuyResistor 330 Ω × 1
- PrototypingBuy
- BatteriesBuy9 V battery × 1
- PowerBuy
- Tools & InstrumentsBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 9 V battery + | Top of the pot, and the LED resistor | Supply |
| Pot (10 kΩ) wiper and end | Node A, then to the LDR | Upper leg of the divider |
| LDR other end | GND | Lower leg of the divider |
| Node A | 10 kΩ, then Q1 base | Base resistor |
| Q1 emitter | Q2 base | Darlington connection |
| Q1 and Q2 collectors | Joined, to the LED cathode | Load side |
| LED anode | 330 Ω to 9 V + | Current limit |
| Q2 emitter | GND | Common ground |
No code needed
No code. In the dark the LDR resistance is very high, so node A rises above the 1.4 V that the two base-emitter junctions need and the LED lights. In light the LDR is a few kΩ, so node A stays low.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Room light | LED off, node A below 1 V |
| Hand over the LDR | LED on, node A above 2 V |
| Collector voltage when on | Close to 0.9 to 1.0 V (a Darlington does not saturate fully) |
| Turn the pot | Moves the darkness at which the LED switches |
If it does not work
LED never lights
Transistor pins are wrong. For a BC547 facing flat side you, the order is collector, base, emitter from left to right.
LED always on
The pot is set too high, or the LDR is shorted. Turn the pot down.
LED dim
Normal for a Darlington at 9 V. Use 220 Ω for brighter.
Switches back and forth in half-light
There is no hysteresis. That is a good lesson for the comparator lab.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the darkness sensor with two transistors?
LDR Photoresistor, BC547 NPN transistor × 2, Resistor 10 kΩ, Potentiometer 10 kΩ, LED 5 mm red, Resistor 330 Ω, Breadboard 830 Tie Points, 9 V battery, 9 V battery snap with DC jack and Digital multimeter.
How long does the darkness sensor with two transistors take to build?
About 30 minutes for a beginner maker, in 7 steps.
How do I know the darkness sensor with two transistors works?
Room light: LED off, node A below 1 V. Hand over the LDR: LED on, node A above 2 V. Collector voltage when on: Close to 0.9 to 1.0 V (a Darlington does not saturate fully).
LED never lights: what should I check?
Transistor pins are wrong. For a BC547 facing flat side you, the order is collector, base, emitter from left to right.
LED always on: what should I check?
The pot is set too high, or the LDR is shorted. Turn the pot down.
LED dim: what should I check?
Normal for a Darlington at 9 V. Use 220 Ω for brighter.
Switches back and forth in half-light: what should I check?
There is no hysteresis. That is a good lesson for the comparator lab.
