The transistor may be the most important invention of the twentieth century. Every processor in your phone contains billions of them. But its basic idea is very simple: a small current controls a large current.
The idea
Imagine a tap: a small turn of your hand controls a large flow of water. A transistor is the same: a small signal on the control pin opens or closes a path for a much larger current.
The pins of a BJT
- Base: the control pin.
- Collector: the large current flows in here (in an NPN).
- Emitter: the current flows out here, usually connected to ground.
The ratio between collector current and base current is called the current gain (hFE or β), usually between 100 and 300. But it varies a lot from one transistor to the next, so the datasheet gives you the minimum.
The three states a transistor can be in
- Cutoff: the base is less than about 0.6 V above the emitter, there's no base current, and the transistor is completely off. Like a closed tap.
- Active region: collector current = β × base current. If β = 100, every 1 mA into the base lets 100 mA through. Here the transistor amplifies, and there's a voltage between collector and emitter, so it heats up.
- Saturation: the base current is more than needed, so the transistor is fully on and can't pass any more, and the collector–emitter voltage drops to about 0.1–0.3 V. Like a tap opened all the way. This is the state we want when using it as a switch.
Example: a BC547 driving a 20 mA LED from a 5 V Arduino pin. If we calculated with β = 100, the base current would be 0.2 mA, and the transistor could stay in the active region if the real β is lower. That's why for switches we calculate with β ≈ 10: a base current of 2 mA, and a resistor = (5 − 0.7) ÷ 0.002 ≈ 2.2 kΩ. That way we're sure it's saturated.
NPN and PNP
- NPN: turns on when the base is about 0.7 V higher than the emitter. The most common, placed between the load and ground (low-side). Examples: BC547 and 2N2222.
- PNP: the opposite, turns on when the base is lower than the emitter, placed between the supply and the load (high-side). Examples: BC557 and 2N2907.
Pin order varies from transistor to transistor and from manufacturer to manufacturer. Always check the datasheet before soldering.
Popular transistors
Every popular NPN has a PNP "twin" with roughly the same specs, which helps when you need both in the same circuit:
| NPN | PNP | Approx. current | Note |
|---|---|---|---|
| BC547 | BC557 | 100 mA | For signals and LEDs |
| 2N2222 | 2N2907 | 600 mA | For relays and small loads |
| S8050 | S8550 | 500 mA | Common in Chinese modules |
| TIP120 | TIP125 | 5 A | Darlington for large loads |
The difference between them and the right use for each type is in the NPN or PNP article.
Packages
- TO-92: the small black half-round plastic body with three legs. The most common package for small transistors.
- SOT-23: a very small SMD version, marked with a short code (like 1P) you have to look up in a table to identify the transistor. The difference between through-hole and SMD parts is in the SMD vs THT article.
- TO-220: the bigger body with a metal tab and a hole, for large loads; the tab is bolted to a heatsink. Note that it's usually electrically connected to the collector.
Other types you'll meet
- Darlington: two transistors in one package, the second amplifying the output of the first. The gain is in the thousands, so a tiny base current switches large loads, but it drops about 1–2 V when on, so it runs hotter. Examples: the TIP120, and the ULN2003 chip, which contains 7 of them and drives small stepper motors.
- Phototransistor: the base is controlled by light instead of current. Found inside light sensors, remote-control receivers and optocouplers.
- IGBT: a hybrid of a BJT and a MOSFET for very high voltages and currents, in inverters, welding machines and inverter air conditioners.
BJT and MOSFET
| BJT | MOSFET | |
|---|---|---|
| Controlled by | Base current | Gate voltage |
| Control current | Continuous while on | Almost zero |
| Loss when on | About 0.2 V | A very small resistance |
| Suitable for | Signals and small loads | Large loads and switching |
Details are in the MOSFET article.
Two basic uses
As a switch
Either fully on (saturated) or off. That's what we do when driving a relay or motor from a microcontroller. The step-by-step calculation is in the transistor as a switch article.
As an amplifier
It works in the region between the two, and any small change in base current produces a larger change in collector current. That's the basis of audio amplifiers and radio. But today we usually use a ready-made op-amp chip instead of designing the amplifier with transistors.
Test it with a multimeter
In diode mode: between the base and each of the other two pins you should read about 0.6–0.7 V in one direction, and "OL" in reverse. If you read conduction between collector and emitter in both directions, the transistor is probably dead.
This method also tells you its type and pins if the marking has worn off:
- Find the pin that reads 0.6 V to both other pins. That's the base.
- If the red probe is on the base during the reading, it's NPN. If it's the black probe, it's PNP.
- The slightly higher reading (say 0.68 vs 0.65) is usually base–emitter, and the lower one base–collector.
A dead transistor usually fails short between collector and emitter, so the load stays on permanently and won't switch off. The cause is usually too much current, a coil without a protection diode, or heat. If you're repairing a device, find the cause before replacing it, or the new one will die the same way.
FAQ
Can I substitute a different transistor? Yes, if it's the same type (NPN or PNP), with current and voltage ratings equal to or higher than the original, and mind the pin order because it varies. For audio and radio amplification it's a bit more delicate.
Why does my transistor get hot when used as a switch? Usually it's not saturated: the base current is too low. Reduce the base resistor, or make sure the load isn't beyond its rating. The calculation is in the transistor as a switch article.