An Arduino pin in OUTPUT mode can source about 20 milliamperes before damage. That's enough for an LED, marginal for a small servo, and laughably short of what a fan, a heater, a solenoid, or a motor needs. The bridge between "logic pin" and "real-world load" is the bipolar transistor — and once you've built one transistor switch, you've built every transistor switch.

The pattern

An NPN transistor has three pins: Base, Collector, Emitter. When the base sees a small current flowing into it (from a HIGH logic pin through a base resistor), the collector-emitter path closes and current flows from C to E. When the base sees no current, C-E is open. So the load sits between V+ and the collector; the emitter goes to ground; the base is nudged by the chip.

This is the low-side arrangement — the transistor is on the ground side of the load. The other arrangement, high-side, uses a PNP transistor (next article) and is trickier because the base reference voltage is no longer ground.

Why the two resistors are not optional

The base resistor (1 kΩ in the demo) is there because the base looks like a forward-biased diode — V_BE ≈ 0.7 V. Without the resistor, the pin would try to push 5 V into a 0.7 V drop, frying both the pin and the transistor. With it, base current is (5 V − 0.7 V) / 1 kΩ ≈ 4.3 mA. A 2N2222 has β ≈ 100, so collector current can be up to 430 mA — way more than the LED needs.

The collector-side resistor (220 Ω) is the LED's normal current-limit resistor: (5 V − 2 V_LED − 0.2 V_CE_sat) / 220 Ω ≈ 13 mA. Without it the LED burns out. The transistor doesn't protect downstream loads; you still calculate their current draw normally.

Why this matters

Replace the LED + 220 Ω with a fan + flyback diode and you have a fan controller. Replace it with a relay coil and you have a relay driver (which is what most "relay modules" already include on board). Replace it with a power MOSFET's gate and you have a high-current digital switch. Every battery-powered device with a sleep mode does this: tiny CPU stays awake, big peripherals get gated through transistors that the CPU activates only when needed. The transistor switch is the foundational pattern for distributed power.