Common mistakes

Most of these mistakes work on the bench and fail in the field. Compare the wrong and right circuit on each card.

PracticeChapter 15

How to use Flip each card between ✗ Wrong and ✓ Right. Red is danger, copper is load current, blue is the control signal.
01

No base resistor

BJT
  • Symptom

    The GPIO pin runs hot; the MCU resets or the pin dies.

  • Cause

    Base–emitter is a diode; only the pin’s internal resistance limits the current.

  • Fix

    Add a series base resistor; 1 kΩ is enough for a 50 mA load.

The numbers
V_GPIO3.3 VV_BE0.7 VR_B1 kΩI_C50 mA
  1. Base currentI_B = (3.3 − 0.7) / 1 kΩ2.6 mAfar below the pin limit
  2. Forced gainβ = 50 / 2.6≈ 19below hFE, so it saturates
1 kΩ protects the pin and still saturates the transistor.
Chapter 05
02

“VGS(th) < 3.3 V, so it is logic level”

MOSFET
  • Symptom

    The MOSFET runs hot and the load is weak; one batch works, the next fails.

  • Cause

    Only 250 µA flows at VGS(th); an IRF540N passes a few hundred mA at 3.3 V.

  • Fix

    Pick a part with RDS(on) guaranteed at your gate voltage, or add a driver.

03

No gate pull-down

MOSFETProtection
  • Symptom

    The motor twitches at power-up or while flashing; the LED flickers.

  • Cause

    The pin floats during boot; noise and Cgd lift the gate above threshold.

  • Fix

    Put 10–100 kΩ from gate to source; avoid strapping pins.

04

No flyback diode

Protection
  • Symptom

    The transistor fails short after hours; the MCU resets at random.

  • Cause

    Coil current cannot stop instantly; the drain hits avalanche and the MOSFET absorbs the energy.

  • Fix

    Put a diode across the load, cathode to +; add a zener for fast release.

05

Slow 1N4007 as a PWM flyback diode

Protection
  • Symptom

    The MOSFET runs far hotter than calculated; the diode heats and EMI is high.

  • Cause

    A slow diode acts like a short for microseconds at every turn-on.

  • Fix

    In PWM use a Schottky (SS34, 1N5819) or an ultrafast diode (UF4007).

06

P-MOS on a 12 V rail driven straight from a 3.3 V GPIO

MOSFET
  • Symptom

    The load never turns off, and the pin may be damaged.

  • Cause

    Even with the pin high, VGS is −8.7 V, so the P-MOS stays on.

  • Fix

    Add a gate–source pull-up and a small NPN that pulls the gate down.

The numbers
V_S12 VPin high3.3 VV_GS(th)−2…−4 V
  1. Pin highV_GS = 3.3 − 12−8.7 Vwell past threshold, so on
  2. With NPN, pin highV_GS = 0 − 12−12 Von
  3. With NPN, pin lowV_GS = 12 − 120 Vthe pull-up turns it off
Driven straight from a GPIO, the P-MOS never turns off. With an NPN and pull-up it switches fully.
Chapter 07
07

High-side N-MOS with its gate driven from a GPIO

MOSFET
  • Symptom

    The load gets only a few volts; the MOSFET runs very hot.

  • Cause

    It becomes a source follower; the source stays about 2 V below the gate.

  • Fix

    Move it low-side, or use a P-MOS with a level shifter or a bootstrap driver.

The numbers
V+12 VV_G3.3 VI_D0.5 A
  1. Source voltageV_S ≈ 3.3 − 21.3 Vit needs VGS ≈ 2 V to conduct
  2. Across the MOSFETV_DS = 12 − 1.310.7 V
  3. LossP = 10.7 V · 0.5 A5.4 W
Most of the voltage turns into heat in the MOSFET. The load sees only 1.3 V.
Chapter 10
08

Using an emitter follower as a switch

BJT
  • Symptom

    A 12 V load sees only ~2.6 V; the transistor heats.

  • Cause

    The emitter stays 0.7 V below the base, and the base cannot exceed 3.3 V.

  • Fix

    Put the load in the collector (common emitter, low-side) and saturate it.

The numbers
V+12 VV_B3.3 VV_BE0.7 V
  1. Load voltageV_E = 3.3 − 0.72.6 V
  2. Left across the transistorV_CE = 12 − 2.69.4 Vthis voltage becomes heat
A follower lifts the load to 2.6 V at most.
Chapter 07
09

Ignoring the Darlington drop

BJT
  • Symptom

    A TIP120 or ULN2003 runs very hot; the load is under-powered.

  • Cause

    A Darlington never saturates; it drops 1–2 V.

  • Fix

    Use a logic-level MOSFET; loss at 3 A falls from 6 W to 0.23 W.

The numbers
I3 AV_CE (TIP120)2 VR_DS(on) (IRLZ44N)25 mΩ
  1. TIP120 lossP = 2 V · 3 A6 W
  2. MOSFET lossP = 3² · 0.025 Ω0.23 W
  3. Ratio6 / 0.23≈ 26×
The MOSFET heats about 26 times less. No heatsink needed.
Chapter 05
10

Sharing the load return with signal ground (ground bounce)

Layout
  • Symptom

    The ADC jumps on PWM edges, I²C/UART fails, the MCU resets.

  • Cause

    The load trace has resistance and inductance; switching 5 A makes 1 V spikes.

  • Fix

    Use a star ground: power return to the supply, MCU ground at one point.

The numbers
Trace20 mΩ · 10 nHΔI5 At_r50 ns
  1. Resistive dropV = 20 mΩ · 5 A0.1 V
  2. Inductive spikeV = 10 nH · 5 A / 50 ns1 Vat every edge
The MCU ground jumps 1 V at every edge. That is far too much for 3.3 V logic.
Chapter 09
11

Exceeding the total GPIO current

MCU
  • Symptom

    Each pin is within limits, yet the MCU warms and output levels sag.

  • Cause

    Port-group and package limits also apply; pin currents add up.

  • Fix

    Drive loads via transistors, a ULN2003 or a TPIC6B595; leave pins a few mA.

The numbers
MCUATmega328PPins6Per pin30 mA
  1. Total6 · 30 mA180 mA
  2. Port-group limitdatasheet~100–150 mAexceeded
Each pin is safe, the total is not.
Chapter 04
12

Exceeding VGS(max) on a 24 V rail

MOSFETProtection
  • Symptom

    The P-MOS fails gate–source short at first switch-on or days later.

  • Cause

    When the NPN pulls the gate to 0 V, VGS is −24 V; the limit is ±20 V.

  • Fix

    Add R2 in series with the gate as a divider, or a 12–15 V zener.

The numbers
V_S24 VV_GS(max)±20 VR1 = R210 kΩ
  1. No dividerV_GS = 0 − 24−24 Voutside the limit
  2. With dividerV_GS = −24 · R1 / (R1 + R2)−12 Vfully on, safe
The divider holds VGS at −12 V. The MOSFET turns fully on and the oxide survives.
Chapter 07
13

Forgetting that RDS(on) rises with temperature

MOSFET
  • Symptom

    A MOSFET calculated at 100 °C runs above 150 °C or dies in thermal runaway.

  • Cause

    RDS(on) is ~1.5× higher at 100 °C; heat raises loss, loss raises heat.

  • Fix

    Iterate with the hot RDS(on); where the curves cross is the real Tj.

The numbers
T_a40 °CR_θJA40 °C/WP @ 25 °C1.6 WR_DS(on)+0.6 %/°C
  1. With the 25 °C valueT = 40 + 1.6 · 40104 °Cfirst estimate
  2. Loss at 104 °CP = 1.6 · (1 + 0.006 · 79)2.36 W
  3. New temperatureT = 40 + 2.36 · 40134 °C
  4. EquilibriumT = 104 + 0.384 · (T − 25)≈ 153 °Csettles after a few rounds
The real Tj is about 153 °C. That is 49 °C above the first estimate.
Chapter 13
14

No dead-time in a half-bridge (shoot-through)

ProtectionMOSFET
  • Symptom

    The bridge heats, the supply dips at every edge, then both MOSFETs blow.

  • Cause

    Turn-off is slower than turn-on, so both switches briefly conduct together.

  • Fix

    Leave 100 ns–1 µs with both off (IR2104 or complementary PWM).

15

Paralleling BJTs without emitter resistors

BJT
  • Symptom

    One transistor takes most of the load, overheats and dies; then the other.

  • Cause

    VBE drifts −2 mV/°C, so the hotter transistor draws more current.

  • Fix

    Put 0.1–0.47 Ω in each emitter, or use MOSFETs.

The numbers
Per transistor1.5 AR_E0.22 ΩΔT50 °C
  1. VBE driftΔV = 50 °C · 2 mV/°C0.1 V
  2. RE feedbackV = 0.22 Ω · 1.5 A0.33 V3× larger than the drift
RE swamps the drift, so the current shares evenly.
Chapter 02
16

Huge gate resistor + high PWM frequency

MOSFET
  • Symptom

    The MOSFET heats even at low current; brightness tracks duty oddly.

  • Cause

    The gate RC constant is close to the PWM half-period; the gate never fully charges.

  • Fix

    Use RG = 10–100 Ω; 10 kΩ belongs in the pull-down.

The numbers
R_G10 kΩC_iss2 nFf_PWM20 kHz
  1. Time constantτ = 10 kΩ · 2 nF20 µs
  2. Half periodt = 1 / (2 · 20 kHz)25 µsalmost equal to τ
  3. With 47 Ωτ = 47 Ω · 2 nF94 ns
With 10 kΩ the gate spends most of its time in the linear region. With 47 Ω the edge takes under 1 µs.
Chapter 06
17

Long gate wires → ringing/oscillation

Layout
  • Symptom

    MHz ringing on the gate, EMI and heating; sometimes VGS(max) is exceeded.

  • Cause

    20 cm of wire and Ciss form a lightly damped RLC circuit.

  • Fix

    Place the driver right at the MOSFET and add 5–22 Ω of gate resistance.

The numbers
Wire200 nHC_iss2 nFR2 Ω
  1. Resonancef₀ = 1 / (2π · √(200 nH · 2 nF))8.0 MHz
  2. Dampingζ = 2/2 · √(2 nF / 200 nH)0.10ζ < 0.5 → large overshoot
  3. Short trace + 10 Ωζ = 10/2 · √(2 nF / 20 nH)1.6no overshoot
A short trace and a small gate resistor kill the ringing.
Chapter 10
18

Capacitive inrush resets the MCU

Protection
  • Symptom

    The MCU resets the moment you switch on a module with a big capacitor.

  • Cause

    An empty capacitor acts like a short; the rail collapses under the surge.

  • Fix

    Use soft start, a load-switch IC, an eFuse or an NTC.

The numbers
C1000 µFV12 VSource + switch0.55 Ω
  1. Instant currentI = 12 V / 0.55 Ω≈ 22 A
  2. With a 10 ms rampI = 1000 µF · 12 V / 10 ms1.2 A
A 10 ms ramp cuts the current 18-fold. The MCU rail stays up.
Chapter 11
The common thread Most mistakes come from designing with “typical” values. Use minimum hFE, maximum VGS(th), hot RDS(on) and the pin state at boot. Examples are in Chapter 14, formulas in Chapter 16.