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
PropertyBJTMOSFET Control methodCurrent (base current controls collector current)Voltage (gate voltage controls drain current) Input impedanceLow-moderate (kΩ range)Extremely high (MΩ to GΩ range) Gate/base driveRequires continuous current into baseRequires voltage, essentially zero DC current On-state voltage dropVce(sat): 0.1-0.3V when saturatedRds(on) × I: can be millivolts at low currents Switching speedModerate (100ns to μs)Fast (10ns to 100ns) but gate capacitance matters Linear regionExcellent for analog amplifiersLess predictable; better for switching Cost (small signal)$0.02-0.10$0.05-0.20 Cost (power)$0.20-2.00$0.30-5.00Rule 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
ParameterSymbolDescription DC Current GainhFE or βCollector current ÷ base current (typically 20-300) Collector-Emitter SaturationVce(sat)Voltage across transistor when fully on (0.05-0.3V) Maximum Collector CurrentIc(max)Highest continuous collector current Maximum VoltageVceoMaximum collector-emitter voltage Transition FrequencyftFrequency where current gain drops to 1BJT 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 siliconExample: 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
ParameterSymbolDescription Drain-Source On ResistanceRds(on)Resistance when fully on — lower is better Gate Threshold VoltageVgs(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 CurrentId(max)Maximum continuous current (at specified temperature) Gate ChargeQgTotal charge needed to switch — determines drive requirements Input CapacitanceCissGate capacitance — must be charged/discharged to switch Maximum VoltageVds(max)Maximum drain-source voltageLogic-Level vs. Standard MOSFETs
TypeVgs(th)Fully On AtUse With Standard MOSFET2-4V10V gate driveHigh-side drivers, 12V circuits Logic-level MOSFET0.5-2V3.3V or 5V gate driveMicrocontroller GPIO direct driveCritical: 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 ÷ IgSlow 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:
DriverTypeCurrentUse TC4427 / MCP1407Single/dual low-side1.5-6A peakLow-side N-MOSFET drive IR2104 / HIP4081Half-bridge1-2AHigh+low side (bootstrap) DRV8701H-bridge gate driverConfigurableDC motor control TC427 / MCP1416Inverting1.5AWhen inverted drive neededCommon 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 → Speaker5. Current Source (BJT)
Iout ≈ Vzener ÷ Remitter (approximately constant)Used for driving LEDs with constant current regardless of supply voltage variations.