Chapter · Electricity
Transistors and switching
A pin can drive 20 mA. Everything bigger needs a part in between — three legs, two flavours, and one number to get right.
- 24What a transistor is6 minA transistor is a tap you turn with electricity instead of your hand. A trickle into one leg lets a hundred times as much through the other two, which is how a pin that can only give 20 milliamps ends up running a motor.
- 25Inside a transistor7 minA transistor is two diode junctions with a sliver of silicon between them, and one of those junctions is always pointing the wrong way. The reason current gets through anyway is that the sliver is too thin to catch it.
- 26NPN and PNP7 minThere are two kinds of transistor, made from the same silicon in the opposite order. One turns on when you drive its base high and the other when you pull it low, and choosing the wrong one gives you a circuit that will not switch off.
- 27A transistor as a switch8 minA GPIO pin can give you about 20 milliamps. A motor wants three hundred. A transistor is the part that lets a small current control a large one — and the base resistor is the one number you have to get right.
Start at 24 and read down — the order is the order things get easier in. Or take the one with your part in it; every article stands on its own, and links back to whatever it needs.