Transistors and MOSFETs Guide: BJT vs MOSFET, Switching, Amplifiers, and Motor Control
What Is a Transistor?
A transistor is a semiconductor device that can amplify or switch electrical signals and power. It's the fundamental building block of modern electronics — there are more transistors on Earth (over 10^22) than grains of sand on all beaches. Two main families exist: Bipolar Junction Transistors (BJTs) and Field Effect Transistors (FETs, including MOSFETs). Understanding both and knowing when to use each is critical for circuit design.
BJT vs MOSFET: Key Differences
| Property | BJT | MOSFET |
|---|---|---|
| Control method | Current (base current controls collector current) | Voltage (gate voltage controls drain current) |
| Input impedance | Low-moderate (kΩ range) | Extremely high (MΩ to GΩ range) |
| Gate/base drive | Requires continuous current into base | Requires voltage, essentially zero DC current |
| On-state voltage drop | Vce(sat): 0.1-0.3V when saturated | Rds(on) × I: can be millivolts at low currents |
| Switching speed | Moderate (100ns to μs) | Fast (10ns to 100ns) but gate capacitance matters |
| Linear region | Excellent for analog amplifiers | Less predictable; better for switching |
| Cost (small signal) | $0.02-0.10 | $0.05-0.20 |
| Cost (power) | $0.20-2.00 | $0.30-5.00 |
Rule of thumb: Use BJTs for analog amplifiers and low-cost simple switches. Use MOSFETs for power switching, high-speed applications, and when drive current is limited (like microcontroller GPIO pins).
BJT (Bipolar Junction Transistor)
Types and Pinout
- NPN: Most common. Current flows collector→emitter when base is positive relative to emitter. 2N2222, 2N3904, BC547.
- PNP: Current flows emitter→collector when base is negative relative to emitter. 2N2907, 2N3906, BC557.
- Pin order (TO-92): Usually C-B-E or E-B-C from front — always check datasheet
Key BJT Parameters
| Parameter | Symbol | Description |
|---|---|---|
| DC Current Gain | hFE or β | Collector current ÷ base current (typically 20-300) |
| Collector-Emitter Saturation | Vce(sat) | Voltage across transistor when fully on (0.05-0.3V) |
| Maximum Collector Current | Ic(max) | Highest continuous collector current |
| Maximum Voltage | Vceo | Maximum collector-emitter voltage |
| Transition Frequency | ft | Frequency where current gain drops to 1 |
BJT as a Switch
To use a BJT as a switch, you must drive it into saturation:
Required base current: Ib = Ic ÷ hFE(min) For saturation: Use Ib = Ic ÷ 10 (forced beta of 10) Base resistor: Rb = (Vdrive - Vbe) ÷ Ib Vbe ≈ 0.7V for silicon
Example: Switching a 100mA LED with a 3.3V GPIO (hFE = 100): Ib = 100mA ÷ 10 = 10mA Rb = (3.3V - 0.7V) ÷ 0.01A = 260Ω → use 220Ω
BJT as an Amplifier
Common-emitter amplifier (most common topology):
Voltage gain ≈ Rc ÷ Re (with emitter degeneration) Or: ≈ Rc × gm (without degeneration) gm = Ic ÷ 26mV (transconductance at room temperature)
Bias the base at VCC/2 for maximum output swing. Use emitter resistor for thermal stability. Couple input and output through DC-blocking capacitors.
MOSFET (Metal-Oxide-Semiconductor FET)
Types
- N-channel: Most common for switching. Conducts when gate is positive relative to source. Needs gate voltage > Vgs(threshold) to turn on. IRFZ44N, IRLZ44N, AO3400.
- P-channel: Conducts when gate is negative relative to source. Used for high-side switching and complementary circuits. IRF9540, AO3401.
- Enhancement mode: Normally OFF — requires gate voltage to turn on (vast majority).
- Depletion mode: Normally ON — requires gate voltage to turn off (rare, special applications).
Key MOSFET Parameters
| Parameter | Symbol | Description |
|---|---|---|
| Drain-Source On Resistance | Rds(on) | Resistance when fully on — lower is better |
| Gate Threshold Voltage | Vgs(th) | Minimum gate voltage to start conducting (not fully on!) |
| Gate-Source Voltage (max) | Vgs(max) | Maximum gate voltage — exceeding destroys the gate oxide |
| Continuous Drain Current | Id(max) | Maximum continuous current (at specified temperature) |
| Gate Charge | Qg | Total charge needed to switch — determines drive requirements |
| Input Capacitance | Ciss | Gate capacitance — must be charged/discharged to switch |
| Maximum Voltage | Vds(max) | Maximum drain-source voltage |
Logic-Level vs. Standard MOSFETs
| Type | Vgs(th) | Fully On At | Use With |
|---|---|---|---|
| Standard MOSFET | 2-4V | 10V gate drive | High-side drivers, 12V circuits |
| Logic-level MOSFET | 0.5-2V | 3.3V or 5V gate drive | Microcontroller GPIO direct drive |
Critical: Always check the Rds(on) spec at your actual gate voltage. A MOSFET rated for 4mΩ might need 10V gate drive to achieve that. At 3.3V it could be 100mΩ or not turn on at all. Look for parts with Rds(on) specified at 2.5V or 4.5V for logic-level applications.
MOSFET as a Switch
For low-side switching (N-channel, source grounded):
- Choose logic-level N-MOSFET with Vgs(th) < 1.5V for 3.3V drive
- Verify Rds(on) at your gate voltage gives acceptable power: P = I² × Rds(on)
- Add gate resistor (10-100Ω) to limit inrush current into gate capacitance
- For fast switching: use a gate driver IC rather than GPIO direct drive
For high-side switching (P-channel, source at VCC):
- Gate pulled up to VCC through resistor (10kΩ) — MOSFET is OFF
- Pull gate to ground through NPN or N-MOSFET — P-MOSFET turns ON
- Vgs = -VCC when on (gate at 0V, source at VCC)
MOSFET Gate Drive
The gate of a MOSFET is a capacitor. To switch fast, you must charge/discharge this capacitor quickly:
Switching time ≈ (Rg × Ciss) or more accurately Qg ÷ Ig
Slow switching causes the MOSFET to spend too much time in the linear region (half-on), where it acts as a resistor and generates massive heat. This is why MOSFETs fail in switching applications.
Gate Driver ICs
For PWM applications (motor control, buck converters), always use a gate driver:
| Driver | Type | Current | Use |
|---|---|---|---|
| TC4427 / MCP1407 | Single/dual low-side | 1.5-6A peak | Low-side N-MOSFET drive |
| IR2104 / HIP4081 | Half-bridge | 1-2A | High+low side (bootstrap) |
| DRV8701 | H-bridge gate driver | Configurable | DC motor control |
| TC427 / MCP1416 | Inverting | 1.5A | When inverted drive needed |
Common Transistor Circuits
1. Simple LED Driver (BJT)
Vdrive (3.3V) → 1kΩ resistor → Base Emitter → GND Collector → LED cathode → LED anode → 5V For 10mA LED: Ib = 1mA, Rb = (3.3-0.7)/0.001 = 2.6kΩ → 2.2kΩ
2. High-Power LED / Strip Driver (MOSFET)
GPIO → 100Ω → Gate Source → GND Drain → LED strip negative LED strip positive → 12V MOSFET: IRLZ44N (logic level, Rds(on) 22mΩ at 5V)
3. H-Bridge Motor Driver (4 MOSFETs)
Four MOSFETs in an H configuration control motor direction and speed:
- Forward: Q1 (high-left) and Q4 (low-right) ON
- Reverse: Q2 (high-right) and Q3 (low-left) ON
- Brake: Both low-side ON (short motor)
- Coast: All OFF
- Speed: PWM on the active high-side or low-side
Critical: Never turn on both MOSFETs on the same side simultaneously — this creates a shoot-through (direct short from VCC to GND). Use a gate driver with dead-time insertion or code protection.
4. Push-Pull Audio Output
Complementary pair (NPN + PNP or N-MOS + P-MOS) for driving speakers:
Audio signal → Bases of both transistors NPN collector → VCC, PNP collector → GND Emitters tied together → Speaker
5. Current Source (BJT)
Iout ≈ Vzener ÷ Remitter (approximately constant)
Used for driving LEDs with constant current regardless of supply voltage variations.
6. Linear Voltage Regulator
Pass transistor + Zener reference + feedback = adjustable regulator Classic: 2N3055 + LM317 or discrete design
Popular Transistor Part Numbers
Small Signal BJTs
| Part | Type | Ic | Vce | hFE | Use |
|---|---|---|---|---|---|
| 2N2222 / PN2222 | NPN | 800mA | 40V | 100-300 | General purpose, switching |
| 2N3904 | NPN | 200mA | 40V | 100-300 | Signal, switching |
| BC547 / BC548 | NPN | 100mA | 45V | 110-800 | Audio, signal, European standard |
| 2N2907 / 2N3906 | PNP | 600mA | 40V | 100-300 | Complementary switching |
| BC557 | PNP | 100mA | 45V | 110-800 | Complement to BC547 |
| TIP31C | NPN | 3A | 100V | 25-50 | Medium power |
| TIP41C | NPN | 6A | 100V | 15-75 | Higher power |
| 2N3055 | NPN | 15A | 60V | 20-70 | Classic power transistor |
| 2N7000 / 2N7002 | N-MOS | 200mA | 60V | — | Small signal MOSFET |
Power MOSFETs
| Part | Type | Vds | Rds(on) | Id | Logic Level? |
|---|---|---|---|---|---|
| IRLZ44N | N-MOS | 60V | 22mΩ@5V | 47A | Yes (4.5V drive) |
| IRFZ44N | N-MOS | 55V | 17.5mΩ@10V | 49A | No (needs 10V) |
| AO3400 / SI2302 | N-MOS | 30V | 28mΩ@2.5V | 5.7A | Yes (SOT-23) |
| AO3401 | P-MOS | 30V | 40mΩ@2.5V | 4A | Yes (SOT-23) |
| IRL540N | N-MOS | 100V | 44mΩ@5V | 36A | Yes |
| FQP30N06L | N-MOS | 60V | 35mΩ@5V | 32A | Yes (TO-220) |
| IRF9540 | P-MOS | 100V | 200mΩ@10V | 23A | No |
| IPP048N12N3 | N-MOS | 120V | 4.8mΩ@10V | 100A | No |
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| MOSFET gets very hot when switching | Insufficient gate drive voltage or slow switching | Use logic-level MOSFET; add gate driver; reduce gate resistor |
| BJT not fully turning on | Insufficient base current | Decrease base resistor; check hFE at operating current |
| MOSFET gate blown | Vgs exceeded (typically ±20V max) | Add Zener protection (15V) on gate; check drive voltage |
| Shoot-through in H-bridge | Both MOSFETs on same side conducting simultaneously | Add dead time in PWM; use gate driver with built-in dead time |
| Transistor oscillates at high frequency | Parasitic capacitance + inductance in layout | Add ferrite bead on base/gate; keep leads short; add damping resistor |
| High power loss in switching | Slow switching transitions | Gate driver IC instead of GPIO; reduce gate resistor; optimize layout |