Monday, November 2, 2026

Protecting Switches from Inductive Spikes

 

Protecting Switches from Inductive Spikes

A Beginner's Guide

Safety note: Several circuits in this guide involve mains voltage (200-240 V AC), which can be lethal. Use appropriately rated components, keep high-voltage sections enclosed and insulated, never probe live mains circuits casually, and use proper isolation and safe measurement practices (for example, a differential probe or an isolating transformer with a properly rated scope setup). If you are unsure, don’t work on live circuits.

1. The one idea you need

A coil (inductor) resists sudden changes in current.

While current flows, the coil stores energy in its magnetic field. When you switch OFF, that energy needs somewhere to go. Without a suitable current path or voltage clamp, the inductor can generate a large voltage to keep the current flowing. The voltage may rise until a protection device conducts, a parasitic path carries the current, or something breaks down, potentially damaging the switch or insulation.

Think of a long pipe of fast-flowing water. Slam the valve shut and you get a pressure spike (“water hammer”). Protection circuits give the water somewhere to go.

Key question: Every protection circuit answers one question: when the switch turns OFF, where does the stored energy go?

2. The tools

Tool

Its job

Think of it as

Flyback diode

Lets DC coil current circulate in a loop

A bypass road

Zener / TVS diode

Limits voltage to a ceiling

A pressure relief valve

RC snubber

Damps ringing and reduces rapid voltage changes

A shock absorber

RCD clamp

Captures a spike in a capacitor, bleeds it off through a resistor

A catch basin with a drain

MOV

Clamps voltage surges on suitably rated AC or DC circuits

A relief valve that can degrade with repeated or severe surges

 

Zener vs TVS: a Zener is a general voltage-limiting part. A TVS is specifically designed for transient-voltage suppression and has specified breakdown, clamping-voltage and pulse-power characteristics. Its actual energy capability depends on the device and the pulse conditions. For power circuits, check the clamping voltage at your peak current, not just the nominal breakdown voltage.

Frequency: you don’t choose a topology by frequency alone. Pick it by what the energy must do. Then use frequency to size the parts, because the faster you switch, the more often energy is dissipated (clamp losses rise with frequency).

3. How to choose: three questions

Question 1: Is there an obvious inductor (coil, motor, relay, solenoid, transformer)?

•     Yes: continue.

•     No: you may not need an inductive clamp, but wiring inductance, capacitive loads and parasitic LC circuits can still cause spikes or ringing. Add protection if a measured waveform or the component ratings show a problem.

Question 2: Is the load DC or AC?

•     DC coil: diode, Zener/TVS or a combination.

•     AC coil: never connect a plain diode directly across an ordinary AC coil. Depending on the application, use a suitably rated RC snubber, MOV or bidirectional TVS. Check the standoff voltage, clamping voltage and energy rating against the coil’s normal operating voltage.

Question 3: Where is the energy supposed to go?

Goal

Typical choice

Simple suppression, slow relay release

Flyback diode across the DC coil

Faster coil-current decay and relay release

Diode in series with a Zener or TVS, keeping the voltage within the switch’s rating

Electrically brake a motor

A proper motor-driver or braking circuit. Stopping time also depends on inertia, load and friction.

Transfer to a secondary winding (flyback converter)

The secondary rectifier is the intended path. An RCD clamp or TVS limits the extra spike from leakage inductance.

Release as a high-voltage pulse (ignition coil)

No plain diode. Use a suitably designed ignition driver with controlled voltage clamping, or a self-clamping ignition IGBT.

Ringing or fast voltage edges

RC snubber

4. Two things people mix up

dv/dt vs ringing

•     dv/dt is how fast voltage changes. A steep edge is a high dv/dt.

•     Ringing is voltage that wobbles after a sharp edge, like a plucked string. It comes from stray inductance and capacitance forming a tiny resonant circuit.

A steep edge can exist without ringing, and ringing contains steep edges. An RC snubber adds damping and limits the rate of voltage change, which helps with both, though it won’t necessarily remove them completely.

Why TRIACs may need snubbers

A TRIAC has two weak spots:

1.       False triggering (static dv/dt). A fast voltage jump on the line can turn it ON with no gate signal. This can happen even with a resistive load.

2.       Retriggering during turn-off (commutating dv/dt). When the current falls below the holding current, the TRIAC attempts to turn OFF. With an inductive load, the voltage across it may rise rapidly during recovery. If the commutating dv/dt exceeds the device’s capability, the TRIAC may retrigger.

Resistive loads cause fewer commutation problems than inductive ones, but whether you need a snubber depends on the TRIAC, the circuit and the electrical noise around it. A snubber is not a universal cure. Sometimes you also need a TRIAC with a higher dv/dt rating, or changes to the gate network.

5. RC debounce vs RC snubber

•     Debounce (Arduino button): smooths a noisy signal so one press reads as one press. Tiny parts, usually with a Schmitt-trigger input.

•     Snubber: damps power transients across a switch or load. The parts must handle real voltage, current and energy.

6. Worked examples

Circuit

What happens at turn-off

Protection

DC relay + MOSFET

Coil current needs a loop

Flyback diode across the coil

Fast-release relay

Same, but quicker decay wanted

Diode + Zener/TVS in series

Flyback converter

Magnetizing energy transfers to the secondary during the switch’s OFF-time, while leakage inductance can produce an additional voltage spike across the primary switch

Secondary rectifier for the intended energy, RCD clamp or TVS on the primary for the leakage spike

TRIAC dimmer + motor

Steep voltage step across the TRIAC

RC snubber, checked against the TRIAC’s ratings

Ignition coil

Rapid current interruption produces the high voltage needed for the spark

A suitably designed ignition driver with controlled voltage clamping, never a plain flyback diode

7. Common mistakes

1.       A plain diode across an ignition coil. The current decays slowly and the spark dies.

2.       A diode across an AC load. It conducts every half-cycle.

3.       A diode across a flyback transformer primary. It blocks energy transfer to the secondary.

4.       Assuming “X2” means “suitable”. Across mains, use a safety-rated capacitor (typically Class X2), but also check its AC voltage, pulse and surge ratings for your circuit. Use a pulse-rated resistor too.

5.       Ignoring snubber leakage. The capacitor passes a small current even when the TRIAC is OFF, so LED lamps and small loads can glow faintly or flash.

6.       Adding protection “just because there’s an inductor.” Add it when the real waveform or ratings call for it.

7.       Assuming every joule becomes heat in the clamp. In a converter, most of the energy goes to the output.

8. Two stages of design

1.       Pick the topology. Start by reading the schematic and identifying the intended current and energy paths. You can often choose an initial protection approach without measurements.

2.       Size the parts and verify. The stored energy in an ideal inductor is E = ½LI² (L in henries, I in amps, E in joules). In a real circuit that energy is shared between the clamp, winding resistance, the switch, parasitics and any intended output path. Then account for voltage limits, switching frequency and average power dissipation, and check the real waveform, because a schematic alone won’t show parasitic inductance or the true size of the transient.

 

TRIAC snubber starting point: about 100 Ω + 0.1 µF is a common value for some 200-240 V AC designs, but it is not universal. Check the TRIAC’s static and commutating dv/dt ratings, the load’s inductance and power factor, capacitor discharge current at turn-on, resistor pulse rating, and leakage when OFF. Verify with an oscilloscope, following the safety note above.

9. The summary

•     Diode: give DC coil current a place to go.

•     Zener/TVS: set a maximum voltage.

•     RC: damp ringing and reduce rapid voltage changes.

•     RCD: catch a leakage spike and burn it off.

•     Combine when needed, for example an RCD clamp for the big spike plus a small RC snubber for ringing.


Thursday, October 8, 2026

How to Select and Calculate a Heatsink for an IC, MOSFET, or Other PCB Component

 

 

A heatsink must provide low enough thermal resistance to keep the junction temperature below a safe limit. Wattage or physical size alone won't tell you what to buy. You need to know how much heat is generated, how hot the part may get, and how easily heat travels from the silicon to the air.

1. The heat-flow path

Treat heat flow like current through series resistors, with temperature difference as the voltage. Heat passes through:

1.       Junction (the die), at TJ.

2.       Case, crossed with RθJC (from the datasheet).

3.       Thermal interface (grease, pad, insulator), RθCS.

4.       Heatsink, RθSA.

5.       Ambient air, at TA.

Resistances are in °C/W (K/W). A poor interface can ruin an otherwise good heatsink.

Limits of the series model: it assumes essentially all heat leaves through the case, interface, and heatsink. Many packages also shed heat through other paths in parallel, such as leads and PCB copper (a TO-220's leads, or an SMD part cooled from both the board and a top-mounted sink). Ignoring these makes the estimate conservative, but for such devices the simple series model may not capture the full thermal behavior. Use the manufacturer's thermal model where one is given.

2. Step 1: Find the power dissipated as heat

Use the power lost inside the component, not the power delivered to the load.

MOSFET conduction loss:

Pcond = ID2 × RDS(on)

Use RDS(on) at your actual gate-drive voltage and operating junction temperature, not the 25 °C headline value. Check the datasheet's resistance-versus-temperature curve. Hot values are often 1.5 to 2 times higher. At 5 A with 0.04 Ω at 25 °C, the loss is 1.0 W. If the hot value is 0.064 Ω, it is 1.6 W, which is 60% higher than the cold estimate. Designing around the cold figure significantly underestimates the heat.

MOSFET switching loss (first-order estimate):

Psw ≈ ½ × VDS × ID × (tr + tf) × fsw

This assumes idealized linear transitions. Real losses depend on the actual voltage and current waveforms, gate resistance, parasitic capacitances, reverse recovery, and load type (inductive loads usually cost more). Body-diode conduction and reverse-recovery losses may also apply.

Output-capacitance loss:

Poss ≈ Eoss × fsw

Coss varies strongly with drain voltage, so the simple ½ × Coss × V2 × fsw form is only a rough guide. Where the datasheet gives the stored energy Eoss (at or near your operating voltage), use it instead.

Gate-drive power:

Pg ≈ Qg × VGS × fsw

This is the power needed to charge and discharge the gate each second. It is dissipated across the driver's output stage and the gate resistor, not only in the driver. It matters for driver heating but is usually small for the MOSFET's own heatsink. At high frequency, rely on the manufacturer's loss tools or measured waveforms.

Linear regulator or linear IC:

PD ≈ (VIN − VOUT) × IOUT + VIN × IQ

Example: 12 V to 5 V at 0.2 A with 5 mA quiescent current gives 1.4 + 0.06 = 1.46 W. This form is valid when IQ is the additional ground/quiescent current drawn from the input. Datasheets don't all define current the same way, so verify the definition. For a regulator with significant ground-pin current, or one whose quiescent current varies with load, use the actual input and output currents:

PD = VIN × IIN − VOUT × IOUT

Other parts: resistors dissipate I2R or V2/R. BJTs dissipate roughly VCE × IC plus base-drive and switching losses. For a switching converter, use the switching device's actual losses, not the load power.

3. Step 2: Find the maximum allowable heatsink resistance

TJ = TA + PD × (RθJC + RθCS + RθSA)

Solving for the heatsink:

RθSA ≤ (TJ,target − TA) / PD − RθJC − RθCS

Choosing the target: don't design to the absolute maximum (often 150 or 175 °C). Typical derated targets are 100 to 125 °C for commercial designs and 80 to 100 °C for high-reliability or hot-environment equipment. Use the worst-case air temperature near the part, not room temperature.

Typical RθCS (approximate; depends on package, contact area, interface thickness, and clamping pressure):

•        Grease on a flat, clamped surface: about 0.1 to 0.5 °C/W.

•        Silicone pad: about 0.5 to 1.5 °C/W.

•        Mica insulator plus grease: about 1 to 3 °C/W or more.

Worked example: MOSFET at 3 W

Assume 3 W (hot RDS(on) included), 40 °C worst-case ambient, 150 °C absolute maximum, 110 °C design target, RθJC = 2 °C/W, and RθCS = 0.5 °C/W.

At the absolute maximum:

RθSA ≤ (150 − 40) / 3 − 2 − 0.5 = 36.67 − 2.5 = 34.17 °C/W

At the design target, which is the number to use:

RθSA ≤ (110 − 40) / 3 − 2 − 0.5 = 23.33 − 2.5 = 20.83 °C/W

Real-world conditions. Published heatsink ratings are measured under specific conditions (airflow, orientation, temperature rise), and performance in an enclosure is often worse. Use the manufacturer's thermal curves for your actual conditions where available. Otherwise apply an engineering margin and verify by testing. For illustration only, assume a 25% penalty (an assumption, not a universal factor):

20.83 / 1.25 ≈ 16.7 °C/W

A 15 °C/W heatsink passes this check. With the assumed penalty its effective resistance is 18.75 °C/W:

TJ = 40 + 3 × (2 + 0.5 + 18.75) = 103.75 °C

At exactly 15 °C/W, TJ = 92.5 °C. Either way it is under the 110 °C target.

Practical check. Under the same assumptions, the predicted case temperature is:

TC = TA + PD × (RθCS + RθSA) = 40 + 3 × (0.5 + 18.75) = 97.75 °C

This is valid only for the assumed steady-state model and measurement location. When comparing against a measurement:

•        Measure at the defined case reference point (usually where the datasheet specifies RθJC, such as the tab or exposed pad), with good thermal contact for the probe.

•        Wait for thermal equilibrium before reading.

•        Remember the junction is hotter than the case by PD × RθJC, so a measured case temperature must be converted using the actual power and thermal path.

A measured value well above prediction means the real dissipation or the mounting is worse than assumed.

4. Components mounted directly on a PCB

Through-hole (TO-220, TO-247): attach a heatsink to the tab. Check whether the tab is a live terminal (drain, collector); if so, an insulator is needed, which raises RθCS.

SMD (SO-8, DPAK, PowerPAK, QFN): heat flows mainly into PCB copper. Three datasheet parameters matter:

•        RθJA: junction-to-ambient under a specified test board and setup. It is board-dependent and valid only for similar boards.

•        RθJC: junction-to-case (or to the exposed pad).

•        RθJB: junction-to-board, where specified.

Adding an external heatsink does not make the datasheet RθJA apply; use RθJC plus the external path instead. For PCB-cooled parts, follow the manufacturer's recommended pad layout and thermal guidance. Cooling is improved by:

•        More copper connected to the thermal pad or power terminal.

•        Thermal vias under the exposed pad (effectiveness depends on pad geometry, via size and count, and layer stack-up).

•        Thicker copper where practical.

•        Airflow and spacing from other hot parts.

5. Choosing the physical heatsink

Compare candidates by published RθSA under conditions like yours. Rough natural-convection guides: small TO-220 clip-ons are about 20 to 30 °C/W or worse, medium extrusions about 5 to 10 °C/W, and large finned sinks a few °C/W. These are illustrations only. Check:

1.       Natural vs. forced convection (a fan-rated figure needs the fan).

2.       Fin orientation (vertical fins suit natural convection).

3.       Worst-case local ambient inside the enclosure.

4.       Mounting interface: flatness, compound, and clamping pressure.

5.       Electrical isolation from live terminals.

6.       Multiple devices on one sink: add their powers for RθSA, then check each junction separately with its own RθJC and interface.

7.       Neighboring heat sources.

A heatsink's wattage rating alone isn't enough. The relevant spec is thermal resistance under conditions representative of your installation.

6. Pulsed and transient loads

A steady-state calculation alone does not establish that a pulsed condition is safe. For pulses shorter than the time needed to reach thermal equilibrium, the junction rise can be lower than the steady-state prediction. Use the datasheet's transient thermal impedance ZθJC(t) to estimate peak junction temperature. For repetitive pulses, account for pulse width, duty cycle, and residual heat from preceding pulses; at high duty cycles the result approaches steady state. Also check the safe operating area (SOA) and pulsed-power limits.

7. A warning about datasheet ratings

A part rated for 50 W maximum dissipation cannot necessarily dissipate 50 W on your board. That figure usually assumes the case is held at 25 °C by an ideal heatsink. Your real limit depends on your ambient, thermal path, and junction target.

Quick recipe

1.       Find PD at hot operating conditions, including switching losses.

2.       Choose worst-case TA and a derated TJ target.

3.       Look up RθJC; estimate RθCS from your mounting method.

4.       Compute RθSA,max = (TJ,target − TA) / PD − RθJC − RθCS.

5.       Account for real-world conditions using manufacturer thermal data where available; otherwise, apply an appropriate engineering margin and verify by testing.

6.       Measure case temperature at a defined point under worst-case operation, after reaching thermal equilibrium, and compare it with your prediction.