Isolated DC-DC Basics Guide: a 24 V to 5 V / 2 A Flyback Across an Isolation Barrier — Creepage, Optocoupler Feedback and CMTI Worked Out

Author: Abloom Spark Date: December 06, 2026

A non-isolated buck can step 24 V down to 5 V with one inductor and no transformer — so why add a transformer at all? Because sometimes the output must not share a ground with the input: a medical sensor touching a patient, a USB port on a mains-powered device, a control board driven from a noisy 24 V industrial bus. Isolation means no DC path and no low-impedance AC path between input and output, so a fault on one side cannot reach the other. The transformer provides it — but it also creates a problem: the output voltage has to be measured on the secondary and the answer sent back across the barrier to the controller on the primary, without breaking the isolation. The standard answer, used in millions of adapters, is a TL431 shunt regulator driving an optocoupler. This guide builds a 24 V to 5 V / 2 A isolated flyback, works out the transformer, the creepage and clearance, and every current in the feedback loop — and shows where the loop can be fooled by a fast-switching MOSFET.

Left: isolated flyback schematic — 24 volt input, primary coil of 27 turns, a 100 volt MOSFET to primary ground driven by a controller, a dashed red isolation barrier down the middle, secondary coil of 10 turns, a diode and output capacitor giving 5 volts at 2 amps. Below the barrier: a divider of two 2.4 kilo-ohm resistors feeding a TL431 shunt regulator with 2.495 volt reference, an optocoupler PC817 straddling the barrier with its LED on the secondary side and its phototransistor feeding the controller's FB pin on the primary side, and a Y1 1 nanofarad capacitor across the barrier. Right: chart of efficiency and output voltage against load — efficiency 80.6 percent at 0.5 amps, 83.8 at 1 amp, 85.4 at 2 amps, output voltage 5.00, 4.99 and 4.99 volts.

Figure 1: (a) The isolated flyback — the dashed barrier is the whole point: nothing but the transformer, the optocoupler and the Y1 capacitor crosses it. The feedback loop (divider → TL431 → optocoupler LED → phototransistor → FB pin) is the only signal that crosses, and it crosses as light. (b) Efficiency and output voltage against load: the loop holds 5 V within 10 mV from 0.5 A to 2 A, while the output diode — 0.5 V × Iout — is the biggest loss. (TL431 and PC817 figures are from the TI and Sharp datasheets.)

The power stage — the same flyback, a different question

The power stage is an ordinary DCM flyback: 24 V in, 5 V / 2 A out, 100 kHz, designed on the DCM boundary. Pick a reflected output voltage VOR = 15 V, so the turns ratio is Np:Ns = 15 / (5 + 0.5) = 2.73:1 — 27 turns primary, 10 turns secondary — and the duty is D = VOR / (VOR + Vin) = 15 / 39 = 0.385. At 85% efficiency the input power is Pin = 10 / 0.85 = 11.76 W. The period is T = 10.00 µs, the on-time is ton = D / f = 3.85 µs, and the primary inductance is Lp = (Vin·D)² / (2·Pin·f) = (24 × 0.385)² / (2 × 11.76 × 100,000) = 36.2 µH. The peak primary current is Ipk = Vin·ton / Lp = 24 × 3.85 µs / 36.2 µH = 2.55 A, the energy per cycle is E = ½·Lp·Ipk² = ½ × 36.2 µH × 2.55² = 118 µJ, and E × f = 11.76 W — the design closes. On the secondary, Ls = Lp / (Np:Ns)² = 36.2 / 2.73² = 4.87 µH, Is_pk = 2.55 × 2.73 = 6.95 A, and tsec = Ls·Is_pk / (Vout + Vf) = 4.87 µH × 6.95 A / 5.5 V = 6.15 µs. Then ton + tsec = 3.85 + 6.15 = 10.00 µs = T — DCM boundary, as designed. The drain voltage, unclamped, is Vin + VOR = 39 V; with the RCD snubber it is clamped to about 24 + 1.5 × 15 = 46.5 V, so the MOSFET must be a 100 V part — a 60 V MOSFET would have only 60 / 46.5 = 1.29, or 29% margin, which is too little once the snubber's overshoot is added. (The December 1 flyback transformer guide worked out turns and air gap; this guide takes the transformer as given and asks what the barrier demands.)

Creepage and clearance — the barrier in millimetres

Isolation is not a feeling — it is a distance, and the standard that sets it for this kind of supply is IEC 62368-1. For a 250 Vrms working voltage, pollution degree 2 (a normal indoor environment, with only non-conductive pollution), material group IIIb, the numbers are: basic creepage 2.5 mm, reinforced creepage 5.0 mm; basic clearance 1.5 mm, reinforced clearance 3.0 mm (the clearance is set by a 2500 V impulse, overvoltage category II). Creepage is the distance along a surface; clearance is the distance through air. Basic insulation protects against a single fault; reinforced insulation is a single layer that must survive on its own — it is double insulation in one layer, and that is why it is twice the basic distance. In practice, that means a slot — a moat — cut in the PCB under the transformer and the optocoupler, at least 6 mm wide in this design, so that no copper track and no solder splash can bridge the barrier. One component is allowed to cross the barrier: the Y1 safety capacitor (1 nF here, rated for an 8 kV impulse), which gives high-frequency noise a return path for EMI. It must be a safety-rated Y1 part — never an ordinary ceramic — and its leakage at 230 V / 50 Hz is 2Ï€ × 50 × 1 nF × 230 V = 72 µA, which is within the touch-current limit.

The feedback loop — every current worked out

The TL431 is a shunt regulator with a 2.495 V reference: it sinks whatever current is needed to hold its cathode at the voltage that keeps its reference pin at 2.495 V. The B grade (TL431B) holds that reference to ±0.5% (the A grade is 1%, the standard part 2%). Set R1 = R2 = 2.4 kΩ, and the output is Vout = Vref × (1 + R1 / R2) = 2.495 × 2 = 4.99 V. The divider current is Idiv = Vref / R2 = 2.495 V / 2.4 kΩ = 1.04 mA. The TL431's reference input draws up to 4 µA, and across the divider's Thevenin resistance (2.4 kΩ in parallel with 2.4 kΩ = 1.2 kΩ) that shifts the reference by 4 µA × 1.2 kΩ = 4.8 mV — 0.096% of the output, small, and it is why the divider current (1.04 mA) must be much larger than the reference current (4 µA). Now the LED side. The optocoupler LED sits in series with the TL431, with a resistor R_LED = 470 Ω feeding it from the 5 V rail: I_RLED = (5 − 1.2 − 2.5) / 470 Ω = 2.77 mA, where 1.2 V is the LED forward voltage and 2.5 V is the TL431 cathode voltage. A 1 kΩ bias resistor across the LED draws I_bias = 1.2 V / 1 kΩ = 1.20 mA, so the LED itself carries I_F = 2.77 − 1.20 = 1.57 mA. The bias resistor is there on purpose: the TL431 needs at least 1 mA of cathode current to regulate, and without the resistor all 2.77 mA would flow through the LED, where the current-transfer ratio would drift with it. At the PC817's minimum CTR of 50%, the phototransistor delivers I_C = 0.5 × 1.57 = 0.78 mA, against the 0.53 mA needed to pull the controller's FB pin to 2.5 V through its 4.7 kΩ pull-up to 5 V — 1.47× headroom. And the TL431's cathode current, 2.77 mA, is comfortably above its 1 mA minimum. The resistor burns (1.3 V)² / 470 Ω = 3.6 mW. The PC817 itself is rated at 5000 Vrms isolation, CTR 50–600% at 5 mA, and a cut-off frequency of 80 kHz — so the loop bandwidth must stay well below 80 kHz, or the optocoupler itself becomes the speed limit. (The TL431 + optocoupler loop was also used in the November 29 guide — the numbers here are for this 5 V / 2 A supply.)

CMTI — where the optocoupler can be fooled

The PC817 has no CMTI (common-mode transient immunity) rating in its datasheet — but it has a floating capacitance between its input and output, Cf = 0.6 pF typical, and that is enough to work out the risk. A fast voltage edge on the primary couples through that capacitance as a current: I = Cf·dV/dt. At 10 V/ns that is 0.6 pF × 10 V/ns = 6 mA; at 50 V/ns, 30 mA; at 100 V/ns, 60 mA. A modern MOSFET switches at roughly 50 V/ns, so the spurious current — 30 mA — dwarfs the 0.53 mA signal current. This is an illustrative calculation, not a datasheet rating, but it shows why the FB node needs filtering, and why the optocoupler must sit away from the switch node on the layout. If the signal itself must survive fast edges — a gate-drive signal across the barrier, for example — use a digital isolator instead: the TI ISO7741 is rated at ±100 kV/µs CMTI minimum.

Efficiency — the diode owns the loss

The loss budget (MOSFET Rds(on) 0.1 Ω assumed, leakage inductance 2% of Lp) gives: at 2 A, total loss 1.71 W — diode 1.00 W, MOSFET conduction 0.083 W, core 0.15 W, snubber 0.234 W, misc 0.24 W — efficiency 85.4%; at 1 A, 0.97 W, 83.8%; at 0.5 A, 0.60 W, 80.6%. The output voltage holds at 5.00 V, 4.99 V and 4.99 V — within 10 mV across the whole range, which is the feedback loop doing its job. The diode is the biggest loss at every load: 0.5 V × 2 A = 1.0 W at full load, and a synchronous rectifier would buy back about 0.8 W of it.

Key points to remember

  • Worked example: 24 V → 5 V / 2 A isolated flyback, 100 kHz, DCM boundary. VOR 15 V, Np:Ns 27:10, D 0.385, Lp 36.2 µH, ton 3.85 µs, Ipk 2.55 A, 118 µJ per cycle, Is_pk 6.95 A, tsec 6.15 µs. Vds clamped ≈ 46.5 V → 100 V MOSFET (a 60 V part leaves only 29% margin).
  • Creepage and clearance (IEC 62368-1, 250 Vrms, pollution degree 2, group IIIb): basic creepage 2.5 mm, reinforced 5.0 mm; clearance basic 1.5 mm, reinforced 3.0 mm — reinforced is twice basic. A 6 mm moat (slot) under the barrier; the Y1 capacitor (1 nF, 8 kV impulse) is the only capacitor allowed across it, leaking 72 µA at 230 V / 50 Hz.
  • Feedback: TL431B (Vref 2.495 V ±0.5%) + PC817 (5000 Vrms, CTR ≥ 50%). R1 = R2 = 2.4 kΩ → Vout 4.99 V, divider current 1.04 mA, Iref error 4.8 mV. I_F 1.57 mA, I_C 0.78 mA against 0.53 mA needed — 1.47× headroom. The PC817's 80 kHz cut-off sets the loop's speed limit.
  • CMTI: the PC817's 0.6 pF floating capacitance couples 30 mA of spurious current at 50 V/ns — far above the 0.53 mA signal — so the FB node needs filtering and careful layout. A digital isolator such as the ISO7741 is rated ±100 kV/µs.
  • Efficiency: 85.4% at 2 A, 83.8% at 1 A, 80.6% at 0.5 A; Vout holds 5.00 / 4.99 / 4.99 V. The output diode (1.0 W at full load) is the biggest loss; a synchronous rectifier would buy back about 0.8 W.