A bipolar junction transistor (BJT) operates in three distinct transistor states: Cutoff (fully off, acting as an open switch), Active/Linear (partially on, acting as a current amplifier), and Saturation (fully on, acting as a closed switch). When using a transistor as a digital switch for relays, solenoids, or motors, you must force it into hard saturation. Leaving it in the active state causes it to drop excess voltage across its junction, dissipate massive heat, and ultimately melt. This guide breaks down the physics into bench-ready math, showing you exactly how to bias, test, and select the right part for your next build.
The Three Transistor States and Pinout Basics
Before calculating base resistors, you need to know how to identify the pins and understand the voltage thresholds that define each state. For the industry-standard TO-92 package (used by the 2N3904, PN2222, and BC547), hold the transistor with the flat side facing you and the pins pointing down.
The behavior of an NPN transistor is governed by the voltage applied to the Base-Emitter junction (VBE) and the resulting voltage across the Collector-Emitter junction (VCE). Here is how the three transistor states map to real-world measurements:
| Transistor State | VBE (Base-Emitter) | VCE (Collector-Emitter) | Collector Current (IC) | Primary Use Case |
|---|---|---|---|---|
| Cutoff | < 0.5V | Equal to VCC (Supply) | 0A (Leakage only) | Open switch (OFF) |
| Active / Linear | ≈ 0.6V to 0.7V | > 0.3V (Typically VCC/2) | IC = β × IB | Amplification, audio, linear regulators |
| Saturation | ≈ 0.7V to 0.8V | ≈ 0.1V to 0.2V (VCE(sat)) | Limited by load (IC < β × IB) | Closed switch (ON) |
Biasing for the Job: Switching vs. Amplification
The most common mistake hobbyists make is treating a switching circuit like an amplification circuit. In the active state, the transistor's current gain (β or hFE) dictates the collector current. If a datasheet claims a β of 150, a base current (IB) of 1mA yields 150mA of collector current. However, β is highly variable—it shifts with temperature and drops significantly at high currents.
To guarantee the transistor enters the saturation state, we ignore the datasheet's linear β and use a forced β (often called an overdrive factor) of 10 or 20. This ensures the base is flooded with enough charge carriers to fully close the collector-emitter channel, dropping VCE down to ~0.2V.
Bench War Story: The Melted Solenoid Driver
To understand why transistor states matter, let's look at a real bench failure involving an ESP32-WROOM-32 dev board and a 12V irrigation solenoid.
The Setup: A builder needed to switch a 12V, 2A solenoid valve (coil resistance = 6Ω) using a 3.3V GPIO pin on an ESP32. They chose a PN2222 (TO-92 package, max IC = 600mA, max power = 625mW) and used a 4.7kΩ base resistor, assuming the high β of the transistor would do the heavy lifting.
The Numbers:
Base Current (IB) = (3.3V - 0.7V) / 4700Ω = 0.55mA.
Assuming a linear β of 100, the transistor attempts to pass 55mA. Because the solenoid requires 2A to fully pull in, it remains partially open, presenting its full 6Ω DC resistance to the circuit.
Voltage across solenoid = 0.055A × 6Ω = 0.33V.
Voltage dropped across the transistor (VCE) = 12V - 0.33V = 11.67V.
The Outcome:
Power dissipated by the transistor (P = VCE × IC) = 11.67V × 0.055A = 641mW.
The TO-92 package is rated for a maximum of 625mW at 25°C ambient. The transistor was stuck in the active state, acting as a 641mW space heater. Within 15 seconds, the junction exceeded its thermal limit, entered thermal runaway, and shorted internally, taking the ESP32 GPIO pin with it.
What Went Wrong: The builder failed to force the transistor into saturation. For a 2A load, a PN2222 is entirely the wrong part. Even if they used a 10Ω base resistor to force saturation, the ESP32 GPIO cannot source the 200mA of base current required (IB = 2A / 10). The correct fix is to use a logic-level MOSFET (like the IRLZ44N) or a Darlington pair (TIP120) for high-current inductive loads.
The Correct Application Circuit: 5V Relay Driver
Let's design a proper circuit for a standard 12V, 150mA relay coil using a 5V Arduino Uno. We will force the PN2222 into hard saturation.
- Identify Load Current: IC = 150mA.
- Calculate Forced Base Current: IB = IC / 10 = 15mA.
- Calculate Base Resistor: RB = (VGPIO - VBE) / IB = (5V - 0.7V) / 0.015A = 286Ω. Select standard value: 270Ω.
- Add Flyback Protection: Place a 1N4148 signal diode in reverse parallel across the relay coil (cathode to 12V, anode to collector) to absorb the inductive kickback when the transistor switches to cutoff.
With a 270Ω base resistor, the transistor receives ~16mA of base drive. VCE drops to roughly 0.15V. Power dissipation is just 0.15V × 0.15A = 22.5mW. The transistor runs completely cool. For deeper reading on BJT switching characteristics, refer to the Texas Instruments BJT Application Notes.
Testing and Diagnosing Failed Transistors
When a circuit fails, you need to verify if the transistor is dead. You can test the internal PN junctions using a standard digital multimeter (DMM) in Diode Test Mode.
- Isolate the Component: Remove the transistor from the circuit. In-circuit testing will yield false readings due to parallel resistor paths.
- Test Base-to-Emitter (B-E): Place the red probe on the Base and black on the Emitter. A healthy NPN silicon transistor will read between 0.55V and 0.75V. Reverse the probes; it should read 'OL' (Open Loop).
- Test Base-to-Collector (B-C): Red on Base, black on Collector. Expect the same 0.55V to 0.75V forward voltage drop. Reverse probes for 'OL'.
- Test Collector-to-Emitter (C-E): Place probes across Collector and Emitter in both directions. Both must read 'OL'. If you read 0.00V or hear a continuity beep, the transistor has suffered a thermal short and is destroyed.
Safe Default Part Numbers and Ratings
Stop guessing which transistor to pull from your parts bin. Here are the benchmark part numbers you should stock, complete with their absolute maximum ratings. Always derate these maximums by at least 20% in practice. For comprehensive electrical characteristics, check the ON Semiconductor 2N3904/PN2222 Datasheets.
| Part Number | Type | Package | Max VCEO | Max IC | Max Power | Best Application |
|---|---|---|---|---|---|---|
| 2N3904 | NPN BJT | TO-92 | 40V | 200mA | 625mW | Low-current logic level shifting, LED driving |
| PN2222 | NPN BJT | TO-92 | 40V | 600mA | 625mW | Small relays (up to ~150mA), buzzers |
| BC547 | NPN BJT | TO-92 | 45V | 100mA | 500mW | Audio pre-amplification, sensor signal buffering |
| TIP120 | NPN Darlington | TO-220 | 60V | 5A | 65W* | High-current motors, solenoids, heavy relays |
| IRLZ44N | N-Channel MOSFET | TO-220 | 55V | 47A | 45W* | PWM motor control, high-power LED strips (Logic-level) |
*Note: TO-220 power ratings assume mounting to an adequate heatsink. Without a heatsink, limit TO-220 dissipation to ~1.5W to 2W in free air.
Understanding transistor states is the bridge between copying a schematic and actually engineering a reliable circuit. By calculating for hard saturation, respecting thermal limits, and testing with a DMM, you will stop burning through components and start building hardware that survives the real world. For more foundational theory on semiconductor junctions, Electronics Tutorials offers excellent deep-dives into BJT physics.






