The Core Job: What a Transistor Actually Does on the Bench
At its core, what a transistor does is act as a current-controlled valve. In a Bipolar Junction Transistor (BJT), a small current flowing into the Base terminal dictates how much larger current can flow from the Collector to the Emitter. Unlike a mechanical relay that is simply open or closed, a BJT can operate as a variable resistor (amplification) or a fully closed switch (saturation).
On the workbench, we rarely use BJTs for linear amplification anymore—op-amps and dedicated audio ICs handle that. Instead, we use them as low-side switches to let a low-voltage, low-current microcontroller GPIO pin control a higher-voltage, higher-current load like a relay, solenoid, or high-power LED. The transistor bridges the gap between logic-level signals and real-world power.
Pinout, Symbol, and Operation Regions
Before wiring anything, you must identify the pins. For the standard TO-92 through-hole package (the black teardrop shape), hold the transistor with the flat side facing you and the leads pointing down. For the ubiquitous 2N3904 and 2N2222, the pins from left to right are Emitter (E), Base (B), and Collector (C). Always verify this against the specific manufacturer's datasheet, as European BC547 transistors use a Collector-Base-Emitter arrangement.
In circuit schematics, the NPN symbol features an arrow on the Emitter pointing outward (Not Pointing iN), while the PNP arrow points inward. The Base is the line perpendicular to the arrow.
Understanding what a transistor does requires knowing its three operating regions. Here is how they map to real-world voltages for a standard NPN silicon BJT:
| Operation Region | Base-Emitter Voltage (Vbe) | Collector-Emitter Voltage (Vce) | Collector Current (Ic) | Practical Use |
|---|---|---|---|---|
| Cutoff | < 0.5V | Equal to Supply (Vcc) | 0A (Leakage only) | Switch is OFF |
| Active (Linear) | ~0.6V to 0.7V | > 0.3V (Typically Vcc/2) | Ic = β × Ib | Amplification (Avoid for switching) |
| Saturation | ~0.7V to 0.8V | < 0.2V (Vce_sat) | Ic < β × Ib (Limited by load) | Switch is fully ON |
How to Bias and Select a Transistor for the Job
The most common mistake hobbyists make is calculating the base resistor using the transistor's maximum hFE (beta) from the datasheet. Datasheets list hFE in the active region. To use the transistor as a switch, you must drive it into saturation by forcing a beta of 10 (or sometimes 20 for high-current Darlingtons). This is called 'overdrive'.
Complete Application Circuit: ESP32 Switching a 12V Relay
Let's build a circuit where an ESP32 (3.3V logic) switches a 12V automotive-style relay with a 75mA coil using a 2N2222 NPN transistor.
- Identify Load Current (Ic): The relay coil draws 75mA (0.075A).
- Calculate Required Base Current (Ib): Using a forced beta of 10, Ib = Ic / 10 = 75mA / 10 = 7.5mA.
- Calculate Base Resistor (Rb): The ESP32 GPIO outputs 3.3V. The BJT Base-Emitter junction drops about 0.7V. The voltage across the resistor is 3.3V - 0.7V = 2.6V.
R = V / I = 2.6V / 0.0075A = 346Ω.
Select the next lower standard E12 value: 330Ω. - Add the Flyback Diode: Wire a 1N4148 or 1N4007 diode in reverse bias across the relay coil (cathode/stripe to 12V, anode to the Collector). When the transistor turns off, the collapsing magnetic field generates a massive voltage spike. Without this diode, the spike will punch through the transistor's Vceo rating and destroy it, often taking the ESP32 with it.
Wiring Summary: ESP32 GPIO → 330Ω Resistor → 2N2222 Base. 2N2222 Emitter → System Ground. 2N2222 Collector → Relay Coil Pin 1. Relay Coil Pin 2 → 12V Supply. 1N4148 Diode across coil pins.
Failure Modes and Multimeter Testing
Transistors don't usually just 'wear out.' They fail catastrophically due to specific electrical abuses. The most common failure modes are thermal runaway (insufficient base drive causes high Vce, generating heat, which increases leakage current, generating more heat until the silicon melts) and secondary breakdown (exceeding the Safe Operating Area at high Vce and high Ic simultaneously, causing localized hot spots that punch a hole through the die).
You can quickly diagnose a dead BJT on the bench using a digital multimeter (DMM) in Diode Test mode. Here is the exact sequence for an NPN transistor:
- Base to Emitter (Forward): Red probe on Base, Black probe on Emitter. You should read a voltage drop between 0.550V and 0.750V.
- Base to Emitter (Reverse): Black probe on Base, Red probe on Emitter. The meter should read OL (Open Loop).
- Base to Collector (Forward): Red probe on Base, Black probe on Collector. Expect 0.550V to 0.750V.
- Base to Collector (Reverse): Black probe on Base, Red probe on Collector. Expect OL.
- Collector to Emitter (Both ways): Probe C and E in both directions. Both must read OL.
Safe Default Part Numbers for Your Bench
Stop buying random transistor assortments from unbranded kits. Stock your bench with these specific, industry-standard part numbers from reputable manufacturers like ON Semiconductor, Diodes Inc, or Vishay. According to the ON Semiconductor PN2222 datasheet, these components have well-documented Safe Operating Areas and predictable hFE curves.
| Part Number | Type | Package | Max Vceo | Max Ic | Best Application |
|---|---|---|---|---|---|
| 2N3904 | NPN | TO-92 | 40V | 200mA | Logic level shifting, small signal switching, LED drivers |
| 2N3906 | PNP | TO-92 | 40V | 200mA | High-side switching (paired with an NPN level shifter) |
| 2N2222 / PN2222 | NPN | TO-92 | 40V | 800mA | Relay drivers, small motor control, solenoids |
| TIP31C | NPN | TO-220 | 100V | 3A | Medium power loads, linear power supply pass elements |
| TIP120 / TIP122 | NPN Darlington | TO-220 | 60V / 100V | 5A | High current loads, PWM motor control (Note: high Vce_sat ~2V) |
For deeper theory on how these specific silicon structures operate at the semiconductor level, the SparkFun Transistor Tutorial provides an excellent visual breakdown of the N-P-N doping layers and electron flow.
Frequently Asked Questions
What does a transistor do compared to a logic-level MOSFET?
A BJT is controlled by current (Base current), while a MOSFET is controlled by voltage (Gate voltage). If you are switching a massive load (like a 10A heater or a high-power brushless motor), a logic-level MOSFET (like the IRLZ44N) is vastly superior because its gate draws virtually zero steady-state current, and its Rds(on) generates far less heat than a BJT's Vce(sat). However, for switching small 50mA relays or shifting logic levels, a 2N2222 BJT is cheaper, requires less board space, and doesn't suffer from the gate-capacitance ringing issues that plague poorly designed MOSFET circuits.
What does a transistor do when it experiences secondary breakdown?
Secondary breakdown is a localized thermal failure. If a BJT is subjected to high Collector-Emitter voltage and high Collector current simultaneously (a common occurrence when turning off an inductive load without a snubber diode, or in linear audio amplifiers), the current doesn't distribute evenly across the silicon die. It concentrates into a tiny 'hot spot.' This spot heats up, drops its resistance, draws even more current, and literally melts a microscopic hole through the silicon layers, permanently shorting the Collector to the Emitter. You prevent this by strictly adhering to the datasheet's Safe Operating Area (SOA) graph and using inductive flyback protection.
What does a transistor do if I wire the collector and emitter backward?
If you swap the Collector and Emitter, the transistor enters 'reverse-active mode.' The physical doping of the Emitter and Collector regions is different (the Emitter is heavily doped, the Collector is lightly doped to withstand high voltage). When wired backward, the device will still function as a transistor, but its current gain (hFE) will plummet to a fraction of its normal value (often less than 10), and its maximum breakdown voltage drops drastically (often to around 5V to 7V). In a 12V switching circuit, a backward-wired 2N2222 will likely suffer immediate avalanche breakdown and short out. Always double-check the TO-92 pinout before applying power.






