If you need a reliable transistor for switching a low-power load (under 500mA) from a 5V microcontroller, the default choice is a 2N3904 or 2N2222 NPN Bipolar Junction Transistor (BJT). For higher currents (1A to 30A), high-frequency PWM, or battery-powered applications where efficiency matters, use a logic-level N-channel MOSFET like the IRLZ44N or AO3400. The core difference is control: BJTs are current-controlled devices requiring continuous base current, while MOSFETs are voltage-controlled devices that draw virtually zero steady-state gate current.
Selecting the right part isn't just about matching the maximum current rating on the datasheet. You must account for saturation voltage drops, gate threshold voltages, and the specific drive voltage your microcontroller provides. Below is a data-dense breakdown of the most reliable default part numbers before we move into biasing math and circuit design.
The Default Transistor for Switching: Part Numbers & Ratings
When ordering components for your bench stock, these are the safe defaults that cover 95% of hobbyist and prototyping switching applications. Note the critical distinction between 'standard' and 'logic-level' MOSFETs—a mistake that bricks countless beginner projects.
| Part Number | Type | Max Continuous Current | Max Voltage (Vce/Vds) | Drive Requirement (Vgs/Vbe) | Package | Best Use Case |
|---|---|---|---|---|---|---|
| 2N3904 | NPN BJT | 200 mA | 40 V | Vbe ≈ 0.7V (Current driven) | TO-92 | Low-power relays, LEDs, 5V logic level shifting |
| 2N2222 (P2N2222A) | NPN BJT | 800 mA | 40 V | Vbe ≈ 0.7V (Current driven) | TO-92 / TO-18 | Medium power loads, small motors, higher current relays |
| TIP120 | NPN Darlington | 5 A | 60 V | Vbe ≈ 1.2V - 2.5V | TO-220 | High current DC motors, solenoids (Requires heatsink due to high Vce(sat)) |
| IRLZ44N | N-Ch Logic MOSFET | 47 A | 55 V | Vgs(th) 1.0V - 2.0V (Fully on at 5V) | TO-220 | High current loads, high-frequency PWM, 5V/3.3V microcontrollers |
| AO3400 | N-Ch Logic MOSFET | 5.8 A | 30 V | Vgs(th) 0.7V - 1.4V (Fully on at 3.3V) | SOT-23 (SMD) | Compact PCB designs, 3.3V ESP32/Raspberry Pi switching |
| IRF520 | N-Ch Std MOSFET | 9.2 A | 100 V | Vgs(th) 2.0V - 4.0V (Needs 10V to fully turn on) | TO-220 | AVOID for 5V logic. Use only with 10V+ gate drivers or op-amp buffers. |
BJT vs. MOSFET Operation Regions & Biasing
To use a transistor as a switch, you must drive it hard into its lowest resistance state, completely bypassing the linear (amplification) region. Here is how the operation regions map to switching behavior.
| Region | BJT State (NPN) | MOSFET State (N-Ch) | Switching Role |
|---|---|---|---|
| Cutoff | Vbe < 0.6V, Ic ≈ 0 | Vgs < Vgs(th), Id ≈ 0 | OPEN Switch (Load is OFF) |
| Active / Linear | Vbe ≈ 0.7V, Ic = hFE * Ib | Vgs > Vgs(th), Id varies with Vgs | AVOID (Acts as variable resistor, generates massive heat) |
| Saturation / Ohmic | Vce(sat) ≈ 0.2V, Ic maxed out | Vgs >> Vgs(th), Rds(on) min | CLOSED Switch (Load is ON, minimal voltage drop) |
Physical Pinouts and Orientation
When holding a standard TO-92 BJT (like the 2N3904) with the flat side facing you and the leads pointing down, the pins from left to right are: Emitter (E), Base (B), Collector (C). The schematic symbol features an arrow on the Emitter pointing outward for NPN types.
For a TO-220 MOSFET (like the IRLZ44N) with the metal tab facing away from you and leads pointing down, the pins from left to right are: Gate (G), Drain (D), Source (S). Note that the metal mounting tab is internally connected to the Drain, which is critical to remember when mounting to a shared heatsink.
Biasing Math: Calculating the Base Resistor
Unlike MOSFETs, BJTs require continuous current into the Base to keep the Collector-Emitter path open. To ensure hard saturation (acting as a true closed switch), the rule of thumb is to design for a forced beta (current gain) of 10, regardless of the datasheet's hFE rating.
Example: Switching a 12V relay with an 80mA coil using a 2N3904 and a 5V Arduino GPIO.
- Target Collector Current (Ic): 80 mA
- Required Base Current (Ib): Ic / 10 = 8 mA
- Voltage across Base Resistor (Rb): V_GPIO - Vbe_drop = 5V - 0.7V = 4.3V
- Calculate Rb: 4.3V / 0.008A = 537.5 Ω
- Select Standard Value: Use a 470 Ω or 510 Ω resistor. (A 1kΩ resistor is often used in casual hobby circuits, yielding 4.3mA of base current. While this usually works for an 80mA load, 470Ω guarantees deep saturation and prevents the transistor from warming up).
For MOSFETs, you don't calculate a current-limiting gate resistor in the same way. Instead, place a 100 Ω series resistor between the GPIO and the Gate to dampen high-frequency ringing, and a 10k Ω pull-down resistor between Gate and Source to ensure the MOSFET stays off if the microcontroller pin floats during boot-up.
Complete Application Circuit: Switching a 12V Relay
Below is a complete, battle-tested circuit for controlling a 12V automotive-style relay (SPDT, ~80mA coil) using a 5V microcontroller and a 2N3904 NPN BJT. This topology is the backbone of most DIY home automation and automotive control boards.
Bill of Materials
- Q1: 2N3904 NPN Transistor (TO-92)
- R1: 470 Ω 1/4W Resistor (Base current limiter)
- D1: 1N4148 or 1N4007 Flyback Diode
- K1: 12V DC Relay (e.g., Songle SRD-05VDC-SL-C, though rated 5V coil, 12V coils work identically in this topology)
Wiring Steps
- Connect the Emitter: Wire the Emitter (Pin 1, left) of the 2N3904 directly to the system Ground (GND).
- Wire the Base Resistor: Connect one end of the 470 Ω resistor to your microcontroller's GPIO pin, and the other end to the Base (Pin 2, middle) of the transistor.
- Connect the Relay Coil: Wire one side of the relay coil to your 12V power supply. Wire the other side of the coil to the Collector (Pin 3, right) of the 2N3904.
- Install the Flyback Diode (CRITICAL): Place the 1N4148 diode in parallel with the relay coil. The Cathode (stripe end) must point toward the 12V supply, and the Anode must point toward the transistor's Collector. This provides a safe path for the inductive voltage spike when the transistor turns off.
- Verify and Power: Measure resistance between the 12V rail and GND to ensure no dead shorts. Power the 12V rail, then trigger the GPIO HIGH. You should hear a distinct relay click.
Failure Modes and Multimeter Testing
Transistors don't just 'stop working'—they fail in specific, predictable ways based on the abuse they endure. Understanding these failure modes is crucial for debugging a dead circuit on the bench. For deeper theory on semiconductor junction breakdowns, refer to the Electronics Tutorials transistor switching guide or the SparkFun Transistor Tutorial.
How They Fail
- BJT Collector-Emitter Short: The most common BJT failure. Caused by exceeding the maximum collector current (Ic) or failing to use a flyback diode on an inductive load. The inductive spike punches through the silicon, permanently welding the C-E junction. The load stays ON permanently.
- BJT Bond Wire Melt (Open): Caused by sustained moderate overcurrent. The microscopic wire connecting the silicon die to the lead frame melts, resulting in an open circuit. The load stays OFF.
- MOSFET Gate Puncture: Caused by Electrostatic Discharge (ESD) or exceeding the maximum Vgs (usually ±20V). The gate oxide layer is incredibly thin; a static shock punches a hole through it, shorting Gate to Source. The MOSFET will not turn on.
- MOSFET Avalanche Failure (D-S Short): Caused by inductive kickback exceeding the Vds rating without a snubber diode, or by operating in the linear region with high current, causing thermal runaway.
Bench Testing with a Digital Multimeter (DMM)
You can definitively test both devices using your multimeter's Diode Test mode (the setting with the diode symbol).
Testing an NPN BJT (e.g., 2N3904)
- Base to Collector: Place the Red probe on Base, Black on Collector. You should read a forward voltage drop of 0.60V to 0.75V. Swap probes (Black on Base, Red on Collector); it must read OL (Open Loop).
- Base to Emitter: Red on Base, Black on Emitter. Expect 0.60V to 0.75V. Swap probes; expect OL.
- Collector to Emitter: Test both directions. Both must read OL. If you read 0.00V or a low resistance in either direction, the transistor is shorted and dead.
Testing an N-Channel MOSFET (e.g., IRLZ44N)
- Gate Isolation: Test between Gate and Source, and Gate and Drain in both directions. All four combinations must read OL. Any reading other than OL means the gate oxide is punctured.
- Body Diode Check: Place Red probe on Source, Black probe on Drain. You should read the body diode forward drop, typically 0.40V to 0.60V. Swap probes (Black on Source, Red on Drain); it must read OL.
- Channel Turn-On Test (The DMM Trick): Leave the Black probe on Source and Red probe on Drain (reading OL). While keeping the Black probe firmly on the Source, use your finger or a jumper wire to briefly touch the Red probe to the Gate. This charges the gate capacitance with the DMM's internal voltage. Move the Red probe back to the Drain. The meter should now read 0.00V to 0.05V, indicating the channel has turned on and is conducting. Touch the Gate and Source together briefly to discharge the gate; the reading should return to OL.
Mastering these selection criteria, biasing calculations, and diagnostic techniques ensures your transistor for switching designs will survive the transition from a breadboard prototype to a permanent, reliable installation.






