If you need a default NPN bipolar transistor for general-purpose switching under 200mA, grab a 2N3904. For loads up to 800mA, use a 2N2222. To bias any bipolar junction transistor (BJT) as a reliable switch, always design your base resistor to supply a base current that is exactly 1/10th of your required collector current. This 'forced beta' guarantees the device enters hard saturation, minimizing voltage drop and heat.
Unlike MOSFETs, which are voltage-controlled, bipolar transistors are strictly current-controlled devices. They require continuous base current to stay on, making them less efficient for high-power battery-operated switching but incredibly robust, linear, and cheap for signal amplification and low-to-medium power switching. Here is how to select, bias, and troubleshoot them on the bench.
The Bench-Tested Defaults: Which Bipolar Transistors to Keep in Stock
Walking into a parts distributor's catalog yields thousands of BJT part numbers. In practice, 95% of hobbyist and prototyping tasks can be handled by four through-hole staples. Keep these in your bench bins so you never have to wait for shipping when a design needs a quick switch or amplifier.
| Part Number | Polarity | Vce (max) | Ic (max) | hFE (typical) | Package | Best Used For |
|---|---|---|---|---|---|---|
| 2N3904 | NPN | 40V | 200mA | 100 - 300 | TO-92 | Logic level shifting, small relays, LED drivers |
| 2N3906 | PNP | 40V | 200mA | 100 - 300 | TO-92 | High-side switching, complementary push-pull pairs |
| 2N2222 | NPN | 40V | 800mA | 100 - 300 | TO-92 / TO-18 | Medium loads, small DC motors, higher current relays |
| TIP31C | NPN | 100V | 3A | 25 - 50 | TO-220 | Power switching, linear regulators, motor drivers (needs heatsink) |
Pinouts, Symbols, and the Three Operating Regions
Before wiring anything, you must verify the pinout. For the standard TO-92 package (like the 2N3904), hold the transistor with the flat face toward you and the leads pointing down. The pins from left to right are Emitter (E), Base (B), and Collector (C). Always verify this with a datasheet, as some European BC547-style transistors swap the Collector and Base positions.
On a schematic, the symbol tells you everything. The Emitter is the leg with the arrow. If the arrow points out, it's NPN (current flows into the collector and out the emitter). If the arrow points in, it's PNP. The Base is the vertical line the arrow attaches to, and the Collector is the remaining angled leg.
A BJT operates in one of three distinct regions, dictated by the bias voltages applied to its internal PN junctions:
| Operating Region | Base-Emitter Voltage (Vbe) | Collector-Emitter Voltage (Vce) | State & Application |
|---|---|---|---|
| Cutoff | < 0.6V | Equal to Supply Voltage | OFF. Acts as an open switch. Zero collector current. |
| Active (Linear) | ~ 0.65V to 0.7V | > 0.3V (typically 1V to Vcc) | Amplifier. Ic = hFE * Ib. Used for audio and signal amplification. |
| Saturation | ~ 0.7V to 0.8V | < 0.2V (Vce_sat) | ON. Acts as a closed switch. Base is flooded with current. |
Biasing for the Job: The 12V Relay Driver Circuit
The most common mistake makers make is treating a BJT like a MOSFET. A MOSFET gate draws virtually zero steady-state current. A BJT base acts like a forward-biased diode to ground and must have a current-limiting resistor. Without it, the base will draw massive current from your microcontroller, instantly frying the GPIO pin.
Let's build a complete application circuit: driving a 12V, 80mA relay coil using a 2N3904 NPN transistor controlled by a 3.3V ESP32 GPIO pin.
The Biasing Math
- Identify Collector Current (Ic): The relay coil requires 80mA to pull in.
- Determine Base Current (Ib): To force the 2N3904 into hard saturation, we use a forced beta of 10. Therefore, Ib = Ic / 10 = 80mA / 10 = 8mA. (This is well within the ESP32's 40mA absolute max GPIO limit, though 12mA is the recommended continuous max for the whole chip).
- Calculate Base Resistor (Rb): The ESP32 outputs 3.3V. The BJT Base-Emitter junction drops about 0.7V. The voltage across the resistor is 3.3V - 0.7V = 2.6V. Using Ohm's Law: R = V / I = 2.6V / 0.008A = 325Ω.
- Select Standard Component: Choose the next standard E12 resistor value down to guarantee enough current: 330Ω.
The Complete Circuit
- Microcontroller GPIO connects to one leg of a 330Ω 1/4W resistor.
- The other resistor leg connects to the Base of the 2N3904.
- The Emitter connects directly to System Ground.
- The Collector connects to the negative terminal of the 12V relay coil.
- The positive terminal of the relay coil connects to the 12V supply.
- Critical: Place a 1N4148 flyback diode in reverse bias across the relay coil (cathode/stripe to 12V, anode to Collector). When the transistor turns off, the collapsing magnetic field generates a massive voltage spike that will punch through the BJT's collector-emitter junction without this diode.
For a deeper dive into the semiconductor physics governing these junction behaviors, the Bipolar Junction Transistors chapter on All About Circuits provides excellent foundational theory.
War Story: When a 'Simple' Motor Driver Melts
Theory is clean; the bench is messy. A few years ago, I was prototyping a thermal management system and needed to switch a 12V DC cooling fan. The fan's spec sheet rated it at 150mA continuous. I grabbed a 2N3904, calculated a base resistor for 15mA of base drive, and wired it up to an Arduino.
The Setup: 2N3904 switching a 12V, 150mA fan. Flyback diode installed. Base resistor correctly sized for steady-state operation.
The Numbers: The 2N3904 is rated for a maximum continuous Collector current (Ic) of 200mA. The fan draws 150mA. Margin looks fine, right?
The Outcome: The moment the Arduino pin went HIGH, the fan twitched, the 2N3904 hissed, cracked open, and died. Worse, the short circuit fed 12V back through the base-collector junction, instantly bricking the Arduino's ATmega328P microcontroller.
What Went Wrong: I ignored the startup stall current. DC motors and fans draw massive current when the rotor is stationary—often 5 to 10 times their running current. The fan's startup surge was hitting 1.2A. The 2N3904 was pushed far beyond its Safe Operating Area (SOA). It went into thermal runaway, the silicon melted, and the internal junctions shorted.
The Fix: For inductive loads with high startup surges, you must size the BJT for the stall current, not the running current. I replaced the 2N3904 with a TIP31C (rated for 3A continuous), mounted it to a small TO-220 heatsink, and added a 100Ω base resistor driven by a secondary small-signal transistor (a Darlington configuration) because the Arduino couldn't supply the 120mA of base current the TIP31C needed to saturate at 1.2A. Alternatively, swapping the BJT entirely for a logic-level MOSFET like the IRLZ44N would have solved the issue with zero base current draw.
Forensics: How They Fail and How to Test with a Multimeter
Bipolar transistors generally fail in three ways: thermal runaway (exceeding power dissipation limits, causing a short), secondary breakdown (localized hot spots in the silicon under high Vce and high Ic simultaneously), and overvoltage avalanche (exceeding the Vceo rating, punching through the collector-base junction).
When a BJT fails, it almost always fails as a dead short between two or more pins, or as an open circuit. You can diagnose this in 60 seconds using a standard digital multimeter (DMM).
Step-by-Step Multimeter Testing (NPN Transistor)
Set your DMM to Diode Test Mode (the symbol with the arrow and line). This mode outputs a small voltage and measures the forward voltage drop across a PN junction.
- Identify the Base: Touch the red probe to one pin and the black probe to the other two. If you get a reading of roughly 0.5V to 0.7V on both pins, the pin under the red probe is the Base, and the transistor is NPN.
- Test Base-Emitter (Forward): Red probe on Base, Black probe on Emitter. Expect 0.60V to 0.75V.
- Test Base-Collector (Forward): Red probe on Base, Black probe on Collector. Expect 0.60V to 0.75V (often slightly lower than the B-E reading).
- Test Reverse Bias: Swap the probes (Black on Base, Red on Emitter/Collector). The meter must read OL (Over Limit / Open). If it reads a voltage or zero, the junction is shorted.
- Test Collector-Emitter: Put one probe on the Collector and the other on the Emitter. It must read OL in both directions. If it reads 0.00V or a low resistance, the transistor has suffered a catastrophic thermal short.
- Verify the Verdict: If steps 2 and 3 show ~0.65V, step 4 shows OL, and step 5 shows OL, the bipolar transistor is healthy. If any forward test reads 0.00V or OL, or any reverse test reads continuity, throw it in the bin.
Testing PNP transistors follows the exact same logic, but the polarity is reversed: the black probe goes on the Base to forward-bias the junctions, and the red probe goes on the Emitter/Collector. For more detailed troubleshooting methodologies, the transistor tutorials at Electronics-Tutorials.ws offer excellent visual references for junction testing.
Bipolar transistors might be older technology compared to modern MOSFETs, but their predictability, low cost, and linear characteristics make them irreplaceable on the workbench. Stock the right defaults, respect the base current math, and always include a flyback diode on inductive loads.






