Electronics from Zero · EPISODE 6 · 2:46

The Transistor as a Switch (series finale)

How can a tiny Arduino pin switch on a motor that needs ten times more current? With a transistor — a tiny switch with no moving parts. Learn how it works, how to wire it, and why billions of them run your phone, in under 3 minutes.

// CHAPTERS · TAP TO JUMP
// IN THIS EPISODE

What you'll learn

  • An Arduino pin can give only about 20 mA; a small motor or fan wants about 200 mA (10× more).
  • A transistor has 3 legs: base, collector, emitter (BC547, flat side facing you: C · B · E). Like a water tap: the base is the handle — a tiny base current lets a current about 100× bigger flow from collector to emitter. No base current = off.
  • NPN is the most common kind (BC547, 2N2222).
  • The switch circuit: + supply → motor → collector, emitter → ground, Arduino pin → 1 kΩ resistor → base. Never skip the base resistor: (5 V − 0.7 V) ÷ 1 kΩ ≈ 4.3 mA — more than the 2 mA needed (200 mA ÷ 100), so it's fully on.
  • Pin high → motor spins. Pin low → motor stops. Half on = weak motor and a hot transistor, so always switch fully on or off.
  • Put a diode across a motor: it catches the voltage kick when it switches off.
  • A relay clicks a few times a second; transistors in a chip switch billions of times a second, and a phone chip has billions of them, each about 1,000× thinner than a hair. On / off = 1 / 0: that's how computers think.
// 30-SECOND SHORTS ON THIS

Quick refreshers