If you are switching a load with a microcontroller, the direct answer is this: use an NPN transistor for low-side switching (connecting the load to ground) and a PNP transistor for high-side switching (connecting the load to the positive supply). For 95% of hobbyist and prototyping tasks under 200mA, your safe default part numbers are the 2N3904 (NPN) and 2N3906 (PNP).
Understanding the practical differences between these two Bipolar Junction Transistor (BJT) types goes beyond memorizing schematic symbols. It requires knowing how to calculate base resistors for saturation, how to protect the silicon from inductive kickback, and how to verify a suspect part on the bench. Here is your working guide to selecting, biasing, and testing bipolar transistors.
NPN vs PNP: Core Differences and Safe Default Part Numbers
The fundamental difference lies in the semiconductor doping and the direction of conventional current flow. In an NPN transistor, current flows from the Collector to the Emitter when the Base is pulled high relative to the Emitter. In a PNP transistor, current flows from the Emitter to the Collector when the Base is pulled low relative to the Emitter.
On a schematic, the Emitter pin is always the one with the arrow. A common mnemonic is that the NPN arrow Never Points iN (it points outward), while the PNP arrow Points iN (toward the Base).
Safe Default Transistor Selection Table
Stop guessing which part to pull from the bin. These complementary pairs cover almost all general-purpose switching and linear amplification needs. All ratings assume a standard 25°C ambient temperature.
| Part Number | Type | Max VCE | Max IC | Max Power (PD) | Typical hFE | Package |
|---|---|---|---|---|---|---|
| 2N3904 | NPN | 40V | 200mA | 625mW | 100 - 300 | TO-92 |
| 2N3906 | PNP | 40V | 200mA | 625mW | 100 - 300 | TO-92 |
| 2N2222A | NPN | 40V | 800mA | 500mW | 100 - 300 | TO-92 / TO-18 |
| 2N2907A | PNP | 40V | 800mA | 400mW | 100 - 300 | TO-92 / TO-18 |
| TIP31C | NPN | 100V | 3A | 40W | 10 - 50 | TO-220 |
| TIP32C | PNP | 100V | 3A | 40W | 10 - 50 | TO-220 |
Biasing for the Job: Operation Regions and a Real-World Circuit
To use a BJT as a switch, you must drive it into saturation. If you only drive it into the active (linear) region, the transistor acts like a variable resistor, dissipating massive amounts of heat and likely failing. For a deeper look at BJT physics and regions, refer to the All About Circuits semiconductor guide.
BJT Operation Regions
| Region | Base-Emitter Voltage (VBE) | Collector-Emitter Voltage (VCE) | Collector Current (IC) | Use Case |
|---|---|---|---|---|
| Cutoff | < 0.5V | Equal to Supply (VCC) | ~0A (Leakage only) | Switch OFF |
| Active (Linear) | ~0.6V to 0.7V | > 0.3V (Typically 1V - 5V) | IB × hFE | Audio amplification, current mirrors |
| Saturation | ~0.7V to 0.9V | < 0.2V (VCE(sat)) | Limited by external load | Switch ON (Relays, LEDs, logic) |
Application Circuit: 12V Relay Driver via 3.3V ESP32 GPIO
Let’s design a low-side switch for a 12V automotive-style relay using a 2N2222A NPN transistor. The relay coil draws 50mA at 12V. The ESP32 GPIO outputs 3.3V and can safely source up to 40mA (though we want to keep it under 12mA for longevity).
Step 1: Determine Required Collector Current (IC)
IC = 50mA.
Step 2: Calculate Base Current (IB) using Forced Beta
Datasheets list hFE (DC current gain) in the active region, often around 100-300. However, in saturation, gain plummets. We use a “forced beta” of 10 to guarantee saturation.
IB = IC / 10 = 50mA / 10 = 5mA.
Step 3: Calculate the Base Resistor (RB)
The GPIO outputs 3.3V. The Base-Emitter junction drops about 0.7V.
RB = (VGPIO - VBE) / IB
RB = (3.3V - 0.7V) / 0.005A = 2.6V / 0.005A = 520 Ω.
Selection: Choose the next lower standard E12 resistor value to ensure slightly more base current. Use a 470 Ω or 510 Ω resistor.
Final Circuit Specs:
- Q1: 2N2222A NPN Transistor
- R1 (Base): 510 Ω 1/4W resistor (GPIO to Base)
- R2 (Pull-down): 10kΩ resistor (Base to GND) to prevent floating turn-on during MCU boot
- D1 (Flyback): 1N4007 diode across relay coil
- Load: 12V Relay Coil (50mA) connected between 12V supply and Q1 Collector
How Bipolar Junction Transistors Fail (and How to Test Them with a DMM)
BJTs are rugged, but they have specific failure modes. Understanding how they die helps you diagnose circuit faults faster.
Common Failure Modes
- Thermal Runaway (Secondary Breakdown): As silicon heats up, its resistance drops, causing it to draw more current, which creates more heat. Without proper heatsinking or emitter-degeneration resistors, the silicon melts internally, resulting in a Collector-Emitter short.
- Overvoltage (Avalanche Breakdown): Exceeding the VCEO rating (e.g., applying 50V to a 40V-rated 2N3904) punches through the depletion region. This usually results in a dead short between Collector and Emitter.
- Inductive Kickback: As mentioned in the relay circuit, failing to use a flyback diode causes a voltage spike that breaches the VCEO limit instantly.
- Bond Wire Melt: Exceeding the maximum continuous IC rating physically melts the microscopic wire connecting the silicon die to the external pin, resulting in an open circuit.
Testing a BJT with a Digital Multimeter
You do not need a specialized transistor tester. According to Fluke’s multimeter testing guidelines, the diode-test mode on a standard DMM is the most reliable way to check junction health. Set your DMM to the diode symbol.
Testing an NPN Transistor (e.g., 2N3904):
- Place the Red (+) probe on the Base.
- Touch the Black (-) probe to the Emitter. You should read a forward voltage drop between 0.550V and 0.750V.
- Move the Black (-) probe to the Collector. You should read a similar drop (0.550V - 0.750V).
- Swap the probes: Black on Base, Red on Emitter and Collector. Both should read OL (Over Limit).
- Test Collector to Emitter in both directions. Both must read OL. If you read near 0.00V, the transistor is shorted and dead.
Testing a PNP Transistor (e.g., 2N3906):
Reverse the probe logic. Place the Black (-) probe on the Base, and use the Red (+) probe on the Emitter and Collector to get the 0.6V readings. Reverse probes for OL.
Frequently Asked Questions About PNP and NPN Transistors
Can I replace an NPN transistor with a PNP transistor in the same circuit?
No, you cannot simply swap them without redesigning the circuit. NPN and PNP transistors require opposite voltage polarities to turn on. An NPN requires the Base to be more positive than the Emitter (sourcing current into the base), while a PNP requires the Base to be more negative than the Emitter (sinking current out of the base). If you replace an NPN low-side switch with a PNP, you must move the load to the low side, connect the PNP Emitter to VCC, and invert your logic signal so that a LOW output turns the transistor ON.
Why do we use NPN transistors more often than PNP in microcontroller circuits?
NPN transistors are preferred for low-side switching because microcontrollers (like the ATmega328P or ESP32) are much better at sourcing current from their GPIO pins than sinking it, and it is easier to reference the Base drive to the microcontroller’s common ground. Furthermore, NPN silicon is inherently faster and has slightly higher electron mobility than PNP silicon, making NPN parts marginally cheaper and more widely available in high-frequency RF applications.
What is the difference between a small-signal transistor and a power transistor?
The distinction is primarily about power dissipation (PD) and packaging. Small-signal transistors (like the TO-92 packaged 2N3904) are rated for under 1W and are designed for switching low currents or amplifying low-level audio/RF signals. Power transistors (like the TO-220 packaged TIP31C) can dissipate 40W or more when bolted to a heatsink and handle several amps. Power transistors also have a physically larger silicon die, which results in higher internal capacitance, making them slower to switch than small-signal parts.
How do I know which pin is the Emitter, Base, or Collector on a TO-92 package?
Pinouts vary by manufacturer and region, but for the vast majority of standard US/JEDEC registered parts (like the 2N3904, 2N2222, 2N3906) in a TO-92 package, holding the flat face toward you with the leads pointing down yields the pinout: Emitter (left), Base (middle), Collector (right). However, always verify this with the specific manufacturer’s datasheet (such as the ON Semiconductor BJT catalog), as European Pro Electron parts (like the BC547) use a different pinout (Collector, Base, Emitter) in the exact same physical package.






