class: center, middle, inverse, title-slide .title[ # The Transistor as a Switch ] .subtitle[ ## Programmable Electronics — Unit 1 ] .date[ ### Class 9 ] --- # Learning Targets .lt-box[ - Explain how a transistor lets a small control current switch a larger load current. - Identify a transistor's pins and wire it as a switch. - Build a transistor-switched circuit and explain why a resistor is needed on the base. ] .eu-label[Essential Understanding:] Every switch you've used so far needed a finger. A transistor is a switch a *circuit* can flip — a tiny current decides whether a much bigger current flows. That idea is what makes the automatic nightlight automatic. --- # Agenda .agenda-box[ 1. Why we need an electrically controlled switch 2. The transistor: three pins, one big idea 3. Not all transistors are the same 4. Why the base needs a resistor — a familiar problem 5. What the 2N2222A can take — reading the datasheet 6. Quick check 7. **Build (30+ min):** wire and test a transistor switch 8. Homework ] --- # Why we need a different kind of switch - The mechanical switch from Class 5 works great — but a person has to flip it. - Your nightlight needs to decide *by itself*, based on a sensor's output, whether to turn the LED on. - We need a component that can be switched **electrically** — by a voltage or a small current, not by a finger. --- # The transistor .pull-left.w40[ <img src="assets/schematics/bjt-npn-symbol.svg" alt="NPN transistor symbol: Base on the left, Collector on top, Emitter on the bottom with an outward-pointing arrow" style="width:100%;max-height:320px;"/> ] .pull-right.w55[ - Three pins: **Base**, **Collector**, **Emitter**. - A small current flowing **into the base** allows a much larger current to flow from **collector to emitter**. - No base current → the collector-to-emitter path is effectively open (off). Base current flowing → the path closes (on). - This is the "small controls large" idea — a whisper of current at the base switches a shout of current through the load. - Pin order varies by part. **Check your kit's transistor datasheet** before wiring — don't assume. ] --- # Not all transistors are the same .pull-left.w42[ <img src="assets/schematics/transistor-symbols.svg" alt="NPN and PNP bipolar transistor symbols side by side; the emitter arrow points outward for NPN and inward for PNP" style="width:100%;max-height:230px;"/> ] .pull-right.w54[ - **NPN vs PNP** — same pins, emitter arrow flips. NPN switches the **low side**, PNP the **high side**. Yours is NPN. - **BJT vs MOSFET** — a BJT needs a small *current* into the base; a **MOSFET** needs only a *voltage* on its gate. MOSFETs run the logic chips (Unit 2) and the motors (Unit 4). - **Signal vs power** — the 2N2222A handles ~0.6 A. A motor wants a *power* transistor — Unit 4. ] All of them do one job: a small thing at the control pin switches a big thing through the other two. --- # Why the base needs a resistor Sound familiar? It should — it's the exact same problem as your very first LED circuit. - The base-to-emitter connection behaves a lot like a diode: push too much current through it with nothing limiting it, and you'll destroy the transistor. - A **base resistor** limits that base current to a safe value — just like the resistor that protected your LED back in Class 2 and 3. - Same failure mode, same fix, different component. --- class: small-font # What the 2N2222A can take The datasheet's **Maximum Ratings** — cross one and the part can fail: | Limit | Rating | Our circuit | Headroom | |---|---|---|---| | `\(V_{CEO}\)` — collector-to-emitter | **40 V** | ≤ 6 V | huge (but watch it in Unit 4 — motor kickback) | | `\(V_{EBO}\)` — **emitter-to-base** | **6 V** | up to 6 V | **almost none** | | `\(I_C\)` — collector current | **600 mA** | ~18 mA | plenty (a motor pulls 10× more) | | `\(P_D\)` — power dissipated | **625 mW** | a few mW | plenty — *while it's fully on*, not half-on | The surprising one is `\(V_{EBO} = 6\,\text{V}\)`. Every other limit is far above anything we do — but the emitter–base junction breaks down at only **6 V in reverse**, the same as our whole supply. That's why the base always gets current pushed *in*, never a reverse voltage across it. Also on the sheet: DC current gain (`\(h_{FE}\)`) is spec'd anywhere from **100 to 300** — a 3× spread. You never design around an exact gain; you shove in extra base current so it's fully on no matter which one you got. .footnote[Datasheet: ON Semiconductor P2N2222A — the modern TO-92 version of the 2N2222A.] --- # A transistor-switched LED .center[ <img src="assets/schematics/transistor-switch.svg" alt="NPN transistor Q1: base fed through a 4.7 kohm resistor from a signal input, collector through an LED and 220 ohm resistor to +6 V, emitter to ground" style="max-height:390px;"/> ] The LED's resistor limits current through the LED. The base resistor limits current into the base. Two separate current-limiting jobs, two separate resistors. --- # Quick check 1. Where in this circuit would you place a multimeter to measure the **base current**? 2. Where would you place it to measure the **collector (load) current**? 3. Which one do you expect to be bigger? Talk it over with your partner. --- class: center, middle # Build (30+ min): wire and test a transistor switch --- # Build instructions With your partner, using your breadboard, 6 V battery pack, and multimeter: 1. Check your kit's transistor datasheet and identify which physical pin is Base, Collector, and Emitter. 2. Build the circuit from this deck: LED + 220 Ω resistor on the collector side, a 4.7 kΩ base resistor on the base, emitter to ground. 3. For the "signal" input, connect a jumper wire from the base resistor to +6 V to turn the transistor **on**, and disconnect it to turn it **off**. Confirm the LED follows your connection. 4. Measure the current into the base and the current through the LED (collector current) with the multimeter. Compare the two — how much smaller is the base current? 5. Try a noticeably larger base resistor — swap the 4.7 kΩ for 100 kΩ. Does the LED still turn on? What does that tell you about how much base current is actually required? --- class: center, middle # Homework .hw-box[ - In your notebook, sketch how your Class 6 photoresistor divider could connect to this transistor's base instead of a jumper wire — that's the circuit you'll build next class. - Explain in your own words: why can't you just wire the LED straight to a sensor without a transistor in between? ]