Home › Builds › Real device: phone charger, 220 V AC wall to 5 V USB

Real device: phone charger, 220 V AC wall to 5 V USB

Bench build · Real Devices · Advanced · about 30 minutes

A USB phone charger traced from the wall to the phone, every part annotated: fuse, bridge, bulk capacitor, switching transformer, opto feedback, output capacitor.

Real device: phone charger, 220 V AC wall to 5 V USB: the finished build running on the simulator's bench

Build it in the labGuided build, test sheet and fault finding, free in your browser.

Parts list

Test procedure

Each test has an expected value and a pass range, like a factory test sheet:

  1. C1 charges to the mains peak
  2. 5 V at the phone
  3. 2 A into the phone
  4. Output isolated: the only paths across are T1, U3 and CY1

How it works

Every phone charger sold for the last fifteen years is the same machine: rectify the mains, chop it at tens of kilohertz into a small transformer, and use light to tell the primary how the output is doing. This one is the lab's 65 W USB-C charger delivering 5 V to a phone; a 10–20 W charger has exactly these blocks, just a smaller transformer and capacitors.

A220 V AC at the wall plug.BA regulated 5 V on the USB port, isolated from the mains.

The path, A to B

  1. 220 V AC wall (Mains). Point A: the wall, 220 V at 60 Hz, which peaks at 311 V. Everything on the left of the transformer and the optocoupler is at this potential.
  2. Fuse (F1). Fault safety. A slow-blow 3.15 A fuse that ignores the switch-on surge but opens if anything behind it shorts, so a failed part becomes a dead charger instead of a fire. Ceramic and sand-filled, because a short right behind the bridge can draw far more current than a glass tube can safely break.
  3. Bridge (BR1). AC to pulsing DC. Four diodes flip the negative half of every cycle up, giving 120 bumps a second that all point the same way.
  4. Bulk cap (C1). Smoothing. A 68 µF 400 V electrolytic fills in between the bumps, so the switcher sees a steady ~300 V DC with a little 120 Hz ripple. It is also the part that stays charged after unplugging.
  5. Switch (Q1). The switch. An 800 V MOSFET chops the bulk voltage into the transformer about 70,000 times a second. Switching that fast is what lets a transformer the size of a sugar cube do the work of a 60 Hz one ten times its weight.
  6. Transformer (T1). Step-down and isolation in one. The flyback transformer stores energy in its core while Q1 is on and hands it to the secondary when Q1 turns off. The 40 : 8 turns ratio brings ~300 V down to the output, and the insulation between the windings is what keeps the mains away from you.
  7. Rectifier (D5). Output rectifier. A dual Schottky: its low forward drop means less heat at several amps.
  8. Output cap (C9). Clean output. With C10, 1360 µF of low-ESR capacitance soaks up the transformer's pulses and leaves steady DC. Two in parallel share the ripple current, which is what wears electrolytics out.
  9. USB port (U2). The PD controller. It talks to the device over the cable's CC wire, agrees a voltage, then moves the output there by pulling on the TL431's divider.
  10. 5 V phone (Phone). Point B: the phone. It asks for nothing more than 5 V, so the PD controller never moves the output from the TL431's base 5.0 V. 2 A here is 10 W.

The loop back: C9 → U4 (TL431) → U3 (opto) → U1 → Q1. If the output rises, the TL431 brightens the opto's LED, U1 ends each pulse sooner and less energy goes through T1. This loop is the regulation, and it crosses the isolation gap as light.

Every other part, and why

Why it lasts

On the mat: the amber line is the energy path from A to B, the dashed blue line the feedback loop. Click any part: why it is there shows at the top of the inspector. Turn the path off or on in the View menu (Real-device path & notes); the Thermal view shows where the heat goes.

Background

The offline flyback with a TL431 and an optocoupler became the standard small power supply in the late 1980s, and the UC384x controller (1984) is still in thousands of products. Newer chargers add GaN switches and quasi-resonant timing to shrink, but the path from A to B is the same.

More builds: real devices