Part 7 built a light that came on when you covered its LDR. It worked, but it was not quite something you would leave on a landing. It faded in slowly as the room darkened, the darkness at which it switched was fixed, and a passing car’s headlights could switch it off. The finished version fixes all three, using an idea from almost every part of the series:
- A divider sets the trigger (part 3). The LDR sits at the bottom, as before. At the top, a 100 kΩ potentiometer used as a variable resistor, plus a fixed 10 kΩ, replaces the old 47 kΩ. Turn the knob and you choose how dark it must get. The 10 kΩ stops the base from being connected straight to + when the knob is turned right down.
- Two transistors make a sharper switch (part 7). A Darlington pair multiplies the gain to about 40,000, so the light goes from off to fully on over a much smaller change in light.
- A capacitor adds a delay (part 5). 100 µF from the base to − means the base voltage can only change slowly, over a few seconds, with R × C again setting the pace. A flash of headlights is over before the voltage has moved far.
- Two white LEDs, each with its own resistor (part 4). A white LED takes about 3.1 volts, the Darlington’s output transistor about 0.2, which leaves about 1.2 volts for a 100 Ω resistor: 12 mA per LED.
- Put the two BC547s on the board, flat faces towards you. Join the first one’s emitter to the second one’s base, the first one’s collector to the + rail, and the second one’s emitter to the − rail.
- From the + rail, fit two branches, each a 100 Ω resistor and a white LED, long leg towards the resistor. Join both LEDs’ short legs to the second transistor’s collector.
- Use the potentiometer’s middle leg and one outer leg as a variable resistor, from the + rail to a 10 kΩ resistor. The other end of the 10 kΩ is the trigger point.
- Connect the LDR from the trigger point to the − rail, and the trigger point to the first transistor’s base.
- Add the 100 µF electrolytic from the trigger point to the − rail, striped leg to −.
- Connect the battery, cover the LDR with your hand and turn the knob until the LEDs come on. Uncover it: after a few seconds they go out.
One more thing, easy to forget: the LEDs must not shine on their own LDR. If they do, the light comes on, the LDR sees it and decides it is daytime, the light goes off, the LDR sees darkness again, and so on, for ever. Point the LDR away from the LEDs, or put it at the end of a short tube of black card. That loop is a kind of feedback, the same effect that makes a microphone howl when it hears its own loudspeaker.
From dusk to dark
Start the evening and watch the light at the LDR fall. Set the level knob, send a car past, and try it without the capacitor, and without the shield. Reset puts everything back as it was.
Start the evening and watch the light come on as it gets dark.
One evening, from 18:00 to midnight, in 36 seconds, with the clock moving on ten minutes at a time. The circuit itself is simulated in real time, so the capacitor's delay and any flicker run at their true speed.
The night light is a good example of a circuit designed rather than just assembled. Each part is there for a reason you have met before, and taking any of them out brings back a problem: no capacitor and it blinks at headlights; no shield and it flickers; one transistor instead of two and it creeps on gradually as dusk falls.
The second project is one of the oldest circuits in electronics. Two French physicists, Henri Abraham and Eugène Bloch, invented it during the First World War using two vacuum valves, and described it in 1919. They called it a . The version that runs on its own, flipping back and forth for ever, is the astable multivibrator, “astable” because it has no stable state to rest in. Built from two transistors, it is the classic first project that does something by itself.
You need two BC547s, two red LEDs, two 330 Ω resistors, two 47 kΩ resistors and two 10 µF electrolytic capacitors. Built on the breadboard, it is perfectly symmetrical: a left half and a right half, each the mirror of the other.
- Put the two transistors on the board, flat faces towards you, and connect both emitters to the − rail.
- For each transistor, put an LED and a 330 Ω resistor in series from the + rail to its collector, the LED’s short leg towards the collector.
- For each transistor, put a 47 kΩ resistor from the + rail to its base.
- Cross-couple them with the capacitors: one from the left collector to the right base, the other from the right collector to the left base. The + leg goes to the collector each time.
- Connect the battery. The LEDs blink in turn, about twice a second.
If both LEDs stay on, or both stay off, check the capacitors’ stripes and the transistors’ pins: the circuit only flips if both halves are complete.
Suppose the left transistor has just switched on. Its collector drops suddenly from about 2.9 volts to about 0.2. The left capacitor passes that sudden drop straight across to the right transistor’s base, which was sitting at 0.7 volts, and drags it down to about −2 volts. The right transistor switches hard off, and its LED goes out.
Now the right base climbs back up, as its 47 kΩ resistor slowly charges the capacitor, in the familiar curve from part 5. When it reaches about 0.6 volts, the right transistor switches on. Its collector drops, and the right capacitor kicks the left base below zero in exactly the same way. Now the left side waits while its own capacitor charges. And so it goes on, each side holding the other off for a time set by R × C.
Textbooks give each half as about 0.69 × R × C, which for 47 kΩ and 10 µF would be a third of a second. With LEDs in the collector circuits it comes out a little shorter, about half of R × C, because the LEDs stop the collectors from swinging all the way up to the supply. Either way, double the capacitors and the blink is half as fast; make one capacitor bigger than the other and its LED stays on longer.
Tune the blink
Watch the left transistor's base on the oscilloscope: the drop below zero, the slow climb, the switch at 0.6 V. The shaded half-cycle is the one happening now. Then change the resistors and the capacitors, one at a time.
The left LED stays on for 240 ms, the right one for 240 ms. A full cycle takes 480 ms: about 2.1 cycles a second.
Two BC547s on 4.5 V with red LEDs and 330 Ω collector resistors. The timing is worked out from the capacitor charging curve, with the collector swing reduced by the LEDs. Real capacitors are often up to 20 % off their marked value, so blink times on the bench are approximate.
Ten parts ago this series began with a bare breadboard and a meter. You now know how to measure safely, how to use Ohm’s law to choose a resistor for anything, how to read and combine resistors, how diodes and LEDs behave, what capacitors store and what R × C means, how a transistor switches and amplifies, and how to drive a motor without destroying the transistor.
From here, four directions are worth exploring:
- Logic gates. The next series, Logic on a Breadboard, puts transistors to work as switches inside logic chips, and builds circuits that decide, remember, count and add, with the same breadboard, LEDs and resistors.
- The 555 timer. A single chip that does what the blinking pair does, and much more, with one resistor and capacitor setting the time. Part 6 told its story, and Adding a Clock builds one as the clock for a logic circuit.
- Operational amplifiers. Chips that amplify with a gain set by two resistors, just as Rc and Re set it in part 8, but far more precisely.
- Microcontrollers. Small programmable chips such as the ones on Arduino and Raspberry Pi Pico boards. A transistor or MOSFET from part 7 or 9, with the base or gate resistor you now know how to choose, lets one switch anything from an LED to a motor.
Whichever you choose, the parts in your shoebox will be there: a resistor to set a current, a capacitor to store a little charge, and a transistor to let a small signal take charge of a big one.
Sources for this part
The multivibrator
Night lights and LDRs