When you move beyond blinking LEDs with logic gates and start switching motors, relays, or high-current loads, you need muscle. That muscle comes from the transistor. But staring at a distributor's parametric search page for various types of transistors will paralyze you with thousands of part numbers. The reality on the bench is that 95% of hobbyist and prototyping jobs can be handled by a handful of default components, provided you understand how to bias them correctly and protect them from the real world.
This guide skips the semiconductor physics lectures and goes straight to the workbench. We will cover the safe default part numbers, how to read their pinouts, how to bias them for switching versus amplification, and exactly how they fail when you make a mistake.
The Bench Default: Safe Part Numbers and Ratings
You do not need to memorize every datasheet. Keep these specific part numbers in your kit. They are cheap, widely available, and cover almost all low-to-medium power prototyping needs. Prices reflect typical 2026 bulk retail from major distributors like Mouser or Digi-Key.
| Type | Part Number | Max V (Vce/Vds) | Max I (Ic/Id) | Key Spec (hFE / Rds-on) | Package | Unit Cost |
|---|---|---|---|---|---|---|
| NPN BJT | 2N3904 | 40V | 200mA | hFE: 100-300 | TO-92 | $0.08 |
| NPN BJT | 2N2222 (or P2N2222A) | 40V | 800mA | hFE: 100-300 | TO-92 / TO-18 | $0.12 |
| PNP BJT | 2N3906 | 40V | 200mA | hFE: 100-300 | TO-92 | $0.08 |
| N-Ch MOSFET | 2N7000 | 60V | 200mA | Rds(on): 5Ω @ 10V | TO-92 | $0.15 |
| N-Ch Logic FET | IRLB8721 | 30V | 62A | Rds(on): 15mΩ @ 4.5V | TO-220 | $1.45 |
Pinouts, Symbols, and Operating Regions
Before you wire anything, you must verify the pinout. Never trust your memory; always check the datasheet for the specific manufacturer's package, but here are the industry-standard physical orientations.
TO-92 BJT (2N3904, 2N2222): Hold the transistor with the flat side facing you and the leads pointing down. From left to right, the pins are Emitter (E), Base (B), Collector (C). The circuit symbol features an arrow on the emitter pointing outward for NPN, and inward for PNP.
TO-220 MOSFET (IRLB8721, IRFZ44N): Hold the metal tab facing away from you and the leads pointing down. From left to right, the pins are Gate (G), Drain (D), Source (S). The symbol shows the gate insulated from the channel, with an arrow on the source indicating channel type.
Transistors operate in three distinct regions depending on the bias voltages applied. Understanding these is critical for deciding if your part will act as a switch or an amplifier.
| Region | BJT (NPN) Condition | MOSFET (N-Ch) Condition | Primary Use Case |
|---|---|---|---|
| Cutoff | Vbe < 0.6V, Ib = 0 | Vgs < Vgs(th), Ig = 0 | Switch OFF (Open circuit) |
| Active / Linear | Vbe ≈ 0.7V, Vce > Vce(sat) | Vgs > Vgs(th), Vds > Vgs - Vth | Amplification, Linear Regulators |
| Saturation / Triode | Vbe ≈ 0.7V, Vce < 0.2V | Vgs >> Vgs(th), Vds is very low | Switch ON (Closed circuit, low loss) |
Biasing for the Job: Switch vs. Amplifier
The most common mistake beginners make is biasing a switching transistor like an amplifier. When using a transistor as a switch, your only goal is to drive it deep into saturation (for BJTs) or the triode/ohmic region (for MOSFETs) to minimize voltage drop and heat.
Biasing a BJT as a Switch:
Calculate the base current required to support your collector load using the minimum hFE from the datasheet, then multiply that base current by a factor of 2 to 10. This 'overdrive' guarantees hard saturation. If your load draws 100mA and your 2N3904 has a minimum hFE of 100, you need 1mA of base current. Overdrive it with 5mA. If your logic pin outputs 5V, subtract the 0.7V Vbe drop, leaving 4.3V. Using Ohm's law (R = V/I), your base resistor should be roughly 820Ω to 1kΩ.
Biasing a MOSFET as a Switch:
MOSFETs are voltage-controlled, not current-controlled. You do not calculate a continuous gate current; you only need to ensure the Gate-to-Source voltage (Vgs) is high enough to fully enhance the channel. For a 3.3V ESP32 driving an IRLB8721, the 3.3V output exceeds the 1.35V typical Vgs(th), and at 4.5V the Rds(on) is fully specified at 15mΩ. A 100Ω series gate resistor is used only to dampen high-frequency ringing and limit the instantaneous inrush current from the MCU's GPIO pin into the gate's parasitic capacitance.
Application Circuit: Driving a 12V Relay with an ESP32
Let us build a complete, robust switching circuit. We will use a 3.3V ESP32 GPIO pin to switch a 12V automotive-style relay coil that draws 75mA. Because the ESP32 operates at 3.3V, we must use a logic-level N-channel MOSFET like the IRLB8721.
Bill of Materials:
- 1x IRLB8721 N-Channel Logic-Level MOSFET
- 1x 12V SPDT Relay (75mA coil)
- 1x 1N4148 or 1N4007 Flyback Diode
- 1x 100Ω Resistor (Gate series)
- 1x 10kΩ Resistor (Gate pull-down)
- Wire the Load: Connect one side of the relay coil to your 12V power supply. Connect the other side of the coil to the Drain (center pin) of the IRLB8721.
- Install the Flyback Diode: Place the 1N4148 diode in parallel with the relay coil. The cathode (striped end) must point toward the 12V supply, and the anode must point toward the MOSFET Drain. This is non-negotiable for inductive loads.
- Wire the Source: Connect the Source pin (right pin) of the MOSFET directly to the system Ground (shared between the 12V supply and the ESP32).
- Wire the Gate Drive: Connect the 100Ω resistor in series between the ESP32 GPIO pin and the MOSFET Gate (left pin).
- Install the Pull-Down: Connect the 10kΩ resistor between the MOSFET Gate and Ground. This ensures the relay stays off while the ESP32 is booting and its GPIO pins are floating.
Bench War Story: The Melted 2N2222 and the Inductive Kick
Theory is clean; the bench is not. A few years ago, I was tasked with switching a 12V linear solenoid that drew 300mA under steady-state conditions. I grabbed a 2N2222 NPN BJT, which is rated for 800mA continuous collector current. I calculated the base resistor to provide 5mA of base drive, ensuring hard saturation. I wired it up, triggered the microcontroller, and the solenoid engaged perfectly.
Then, I turned it off. The 2N2222 instantly popped, splitting its plastic TO-92 casing and venting magic smoke.
What went wrong? I had treated an inductive load like a resistive one. When the BJT turned off, the magnetic field in the solenoid coil collapsed. By Faraday's law of induction, this rapid change in current (di/dt) generated a massive reverse voltage spike (inductive kickback). Without a flyback diode to clamp it, the voltage at the collector spiked to over 80V. The 2N2222 has a maximum Vceo (Collector-Emitter voltage with base open) of just 40V. The transistor went into avalanche breakdown, conducting massive current while blocking high voltage, instantly exceeding its thermal limits and destroying the silicon die.
The Fix: Always place a flyback diode across inductive loads (relays, solenoids, motors). For faster switching times where the slow decay of a standard diode is unacceptable, use a Zener diode in series with the flyback diode, or a dedicated TVS (Transient Voltage Suppression) diode to clamp the spike safely.
Forensics: How Transistors Fail and How to Test Them
Transistors rarely fail gracefully. They typically fail due to Electrical Overstress (EOS) or Thermal Runaway. When a BJT gets too hot, its Vbe drops, which causes it to draw more base current, which makes it hotter—a positive feedback loop that ends in a short circuit. MOSFETs usually fail from gate oxide puncture (exceeding the ±20V Vgs max rating) or from secondary breakdown during high-voltage, high-current switching.
You can diagnose a dead transistor on the bench using your multimeter's Diode Test mode.
Testing an NPN BJT (e.g., 2N3904):
- Set the DMM to diode mode.
- Place the Red probe on the Base. Touch the Black probe to the Emitter, then the Collector. You should read a forward voltage drop of 0.60V to 0.75V.
- Reverse the probes (Black on Base, Red on Emitter/Collector). The meter should read 'OL' (Open Loop).
- Measure between Collector and Emitter in both directions. Both should read 'OL'.
- Failure signature: If any junction reads 0.00V (short) or if C-E reads a low resistance in either direction, the BJT is dead.
Testing an N-Channel MOSFET (e.g., IRLB8721):
- Discharge the gate by briefly touching a wire between the Gate and Source pins.
- Set DMM to diode mode. Place Red on Source, Black on Drain. You should read 'OL'.
- Reverse probes (Red on Drain, Black on Source). You should read ~0.4V to 0.6V (this is the internal body diode conducting).
- The Gate Charge Test: While keeping the Red probe on the Drain, briefly touch the Gate pin to the Drain pin. This uses the multimeter's internal battery to charge the gate capacitance.
- Move the Red probe back to the Source, then back to the Drain. The meter should now read a very low voltage drop (near 0.0V), indicating the MOSFET channel has turned on and is conducting.
- Failure signature: If the Gate-to-Source or Gate-to-Drain reads a dead short (0.00V) before you even start, the gate oxide is punctured. Bin it.
Mastering various types of transistors is less about memorizing quantum mechanics and more about respecting their voltage limits, managing their thermal dissipation, and always providing a safe path for inductive energy. Keep your default parts stocked, always use a flyback diode, and your circuits will survive the real world.
For deeper reading on component selection and safe operating areas, refer to the SparkFun Transistor Tutorial and the onsemi MOSFET design resources.






