Projects / Darkness sensor with two transistors

Darkness sensor with two transistors

Beginner30 minGuided buildReviewed

Build it step by step

0 of 7 done
  1. 872 lux

    Build the divider

    Pot from +9 V to node A and the LDR from node A to ground.

  2. BC54719.3 mA

    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.

  3. BC547

    Add the second transistor

    Collector joined to Q1's collector, emitter to ground. This is a Darlington pair.

  4. 19.3 mA

    Add the LED

    Anode through 330 Ω to +9 V, cathode to the joined collectors.

  5. 875 lux

    Test

    Cover the LDR with your hand and the LED should light.

  6. 19.3 mA

    Set the threshold

    Turn the pot until the LED just turns on at the darkness you want.

  7. Measure

    With the meter note node A, the base voltage and the collector voltage in light and dark.

In short

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
See the electronics first. This build uses transistor switch. Try a transistor switch in the circuit builder and watch the voltages and currents before you wire it.

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
9 V battery +Top of the pot, and the LED resistorSupply
Pot (10 kΩ) wiper and endNode A, then to the LDRUpper leg of the divider
LDR other endGNDLower leg of the divider
Node A10 kΩ, then Q1 baseBase resistor
Q1 emitterQ2 baseDarlington connection
Q1 and Q2 collectorsJoined, to the LED cathodeLoad side
LED anode330 Ω to 9 V +Current limit
Q2 emitterGNDCommon 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.

CheckExpected
Room lightLED off, node A below 1 V
Hand over the LDRLED on, node A above 2 V
Collector voltage when onClose to 0.9 to 1.0 V (a Darlington does not saturate fully)
Turn the potMoves 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 →

Ask Lark AI

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.