Level 3 · Sense · project 19 of 19 · 30 min · ●●●○○
Busy/Free Sign
One slide switch, two lamps that always disagree: red BUSY when the slide is on, green FREE when it is off. A transistor does the flipping.
new here? Start with First Light — one battery, one resistor, one LED. It teaches the loop, LED direction, and why the 220 Ω resistor matters.
What you need
- 1× 3×AA battery pack (4.5 V) L1
- 1× Solderless breadboard L1
- 8× Jumper wires L1
- 1× Slide switch the one input: on means BUSY L1
- 1× Red LED (5 mm) BUSY L1
- 1× Green LED (5 mm) FREE L1
- 2× 220 Ω resistor red-red-brown; one per lamp L1
- 2× 10 kΩ resistor brown-black-orange; base resistor and pull-down L1
- 1× NPN transistor (2N2222) flat face toward you: legs are E-B-C
you'll learn: Transistor switching · Switches · Ohm's law
Circuit map
The circuit you'll build, running on the Workbench right now.
simulating…
If it doesn't work
The boring ways this circuit actually breaks — check these first before you unwire everything.
- Green stays lit even with the slide on. The transistor isn’t turning on. Check E-B-C order (flat face toward you), that the emitter reaches the − rail, and that the 10 kΩ from row S lands on the middle leg.
- Green never lights, slide on or off. Pull the transistor out. If green lights now, the transistor was wired on all the time: usually the base is tied to + somewhere. If it’s still dark, the green LED is backwards or its short leg isn’t on the − rail.
- Red never lights. The red lane hangs off the slide. Check the slide actually connects the + rail to row S when on, and that the red LED’s long leg faces the 220 Ω.
- Both lamps are lit at the same time. The transistor’s collector isn’t in row G. It has to share a row with the green LED’s long leg so it can steal its current.
- Red BUSY lights, but only faintly. A 10 kΩ (brown-black-orange) ended up in the red lane and a 220 Ω (red-red-brown) went to the base. Swap them: at 10 kΩ the red LED gets about a quarter of a milliamp.
What you're building
A sign for your bedroom door with one slide switch and two lamps. Slide it on: red BUSY lights and green FREE goes dark. Slide it off: red goes dark and green lights. There's never a moment when both are on or both are off.
A slide switch on its own can't do that. It has two states, connected and not connected, so it can light a lamp, but it can't also put a second lamp out at the same moment. For that you need a part whose output is the opposite of its input. Digital electronics calls that a NOT gate, or an inverter. Here you'll make one from a single transistor.
The plan
- Red BUSY lamp: slide → 220 Ω → red LED → −. When the slide is on, it lights. Nothing new.
- Green FREE lamp: + → 220 Ω → green LED → −. It has no switch at all, so on its own it's always lit.
- The transistor: its collector is wired to the point between the green lamp's 220 Ω and the green LED, and its emitter goes to −. So the transistor sits across the green LED, side by side with it. Its base is fed from the slide through 10 kΩ, with a second 10 kΩ pull-down from the base to −.
When the transistor turns on, it gives the green lamp's current a much easier way to reach − than going through the LED. The LED gets nothing and goes dark. You did this by hand in Short Cut with a slide switch across an LED. This time the "switch" across the LED is a transistor, and it's controlled from somewhere else.
Slide off: FREE
The slide is open, so nothing feeds the base. The pull-down holds it at 0 V, which keeps the transistor firmly off. (Without the pull-down the base would be floating, connected to nothing useful, and a floating base can pick up stray charge and half switch on.)
With the transistor off, the green lamp is a plain LED and resistor loop. A green LED drops about 2.1 V:
I_green = (4.5 − 2.1) V ÷ 220 Ω ≈ 10.9 mA
Green is lit, red is dark, and the battery supplies about 10.9 mA.
Slide on: BUSY
Red lamp. The slide puts 4.5 V on the red lane. A red LED drops about 2.0 V:
I_red = (4.5 − 2.0) V ÷ 220 Ω ≈ 11.3 mA
The base. The slide also feeds the base through 10 kΩ while the pull-down tries to hold it at 0 V. The base settles at about 0.73 V, and two currents meet there:
in through the 10 kΩ: (4.5 − 0.73) V ÷ 10 000 Ω ≈ 0.38 mA
out through the pull-down: 0.73 V ÷ 10 000 Ω ≈ 0.07 mA
The difference, about 0.30 mA, goes into the base.
The green LED goes dark. With a gain of about 200, 0.30 mA in the base lets up to 200 × 0.30 ≈ 60 mA through the collector. The only thing limiting it is the green lamp's 220 Ω, so the transistor saturates and its collector drops to about 0.12 V. That's the voltage across the green LED now, and a green LED needs around 1.8 V before it gives any visible light. So it's dark.
The green lamp's current didn't stop, though. It now flows through the 220 Ω and the transistor instead:
(4.5 − 0.12) V ÷ 220 Ω ≈ 19.9 mA
That's almost double what the LED was getting, because the transistor drops 0.12 V where the LED dropped 2.1 V, which leaves more voltage across the resistor. In BUSY the battery supplies 11.3 + 19.9 + 0.38 ≈ 31.6 mA, about three times as much as in FREE. Keep that number in mind for the challenges.
The truth table
| Slide | Base | Transistor | Red BUSY | Green FREE | Battery |
|---|---|---|---|---|---|
| off | 0 V | off | dark | lit (≈ 10.9 mA) | ≈ 10.9 mA |
| on | ≈ 0.73 V | saturated | lit (≈ 11.3 mA) | dark | ≈ 31.6 mA |
Read the transistor on its own: the input is the slide, the output is the collector. Input high gives output low. Input low gives output high, because the green lamp's resistor pulls the collector up. That's a NOT gate. The CD4011 chip you'll meet at Level 6 has NOT logic inside it too, built from transistors.
What if the transistor is a weak one?
Real 2N2222s vary. The datasheet promises a gain of at least 75 at currents like these. With a gain of 75, 0.30 mA allows about 23 mA, still more than the 19.9 mA on offer, so it saturates. Even if it didn't quite, the collector would sit at a few tenths of a volt, far below the 1.8 V the green LED needs. The sign works either way.
Build it
- Rails. Battery + to the top rail, − to the bottom rail.
- Red lane. Slide switch from the + rail to a free row, call it S. From S, a 220 Ω to the red LED's long leg; short leg to the − rail.
- Green lane. A second 220 Ω from the + rail to a free row, call it G. Green LED long leg in G, short leg to the − rail. Power up now and green should already be lit.
- The transistor. Flat face toward you, legs E-B-C. Jumper E to the − rail and C to row G.
- The base. A 10 kΩ from row S to B, and a second 10 kΩ from B to the − rail.
- Slide on: red lights, green goes out. Slide off: they swap back.
Debug like an engineer
Build in halves, as above: the green lamp should light on its own before the transistor goes in. If green stays lit with the slide on, the transistor isn't turning on. Touch a jumper from B to the + rail for a second through the 10 kΩ (never without it). If green goes out, the transistor is fine and the problem is between the slide and the base.
🧠 Your challenge
No single right answer. That's the point.
- Stop the waste. In BUSY the battery works three times harder than in FREE, and most of it goes through the transistor doing nothing visible. Can you redesign so the green lamp's current stops instead of being rerouted? (One way: move the transistor so it sits in series with the green lamp, under the LED, and use a second transistor to turn the slide's signal upside down for it. How much would BUSY draw then?)
- Swap the colours. What would you change so the transistor puts out the red lamp instead, and the slide lights green? Is it a wiring change, a parts change, or just a labelling change?
- Remove the pull-down. Take out the 10 kΩ between the base and −. Does the sign still work on your breadboard? Why might it misbehave sometimes even if it looks fine now?
- Replace the slide with a sensor. Put an LDR where the slide was and a 10 kΩ from S to −. Which lamp is lit in a bright room, and which in a dark one? You've built a day/night indicator.
For grown-ups: safety notes
- Battery power only. Three AA cells give 4.5 V, which can't shock you.
- Each LED keeps its own 220 Ω. Without it, the LED sits straight across the battery and burns out in a flash.
- The green lamp's 220 Ω also protects the transistor. In BUSY it limits the collector current to about 20 mA. If you ever wire C straight to the + rail, the transistor will try to pass as much as the battery can give and gets hot fast.
- Never connect the base straight to + or − without its 10 kΩ. The resistors keep the base current under half a milliamp.
- Nothing here should get warm. If the transistor does, pull the battery and check its E-B-C order.
- Small parts are a swallowing hazard for younger siblings and pets.
Checked against
Keep building
You might also like
shares ideas with this one