Project: A Scratch-Built 5 V, 5 A Power Supply for the Raspberry Pi 5

In progress Project status: in progress. The circuit design, parts list and case design are done; build photos and test results will be added as the build goes along.

A Raspberry Pi 5 wants a steady 5 volts at up to 5 amperes, more than most phone chargers can give it. This project builds that supply from scratch on perforated board: a transformer, a rectifier, filter capacitors, a switching regulator, an over-voltage "crowbar" and a USB-C lead that tells the Pi how much current it may draw. Every part is explained from the start, so you can follow along even if you have never built a power supply before, and every number is worked out so you can check it.

Read this first: this project connects to household mains (120 V AC). Mains voltage can kill. The low-voltage half of the circuit is a good learning build; the mains half (the inlet, fuse F1 and the transformer's primary) needs care, insulated joints, a fused inlet with an earth wire and a careful first power-up through a dim-bulb tester (section 15). If you are not confident working with mains wiring, build the low-voltage half and feed it from a ready-made, certified 12 V AC or 15 to 20 V DC adapter instead. See section 17, Safety.

How to use this page. Sections 1 to 10 explain what each part of the supply does and why. Section 11 has the full schematic, section 12 the parts list, and sections 13 to 16 the build, testing and set-up. Numbers on this page that carry no source number were worked out with the formulas shown.

Photo to come: the finished supply board
The finished power supply board (photo to come).

1. Why the Pi 5 needs 5 V at 5 A

Three words come up all the time in this project. Voltage (measured in volts, V) is the electrical "push" that drives current around a circuit. Current (amperes, or amps, A) is how much electric charge flows past a point each second. Power (watts, W) is how fast energy is delivered: volts times amps. If those are new to you, the Ohm's Law and Power (PIE) Formula helpers explain them with calculators.

The Raspberry Pi 5 is a small computer that runs from 5 V. The Raspberry Pi documentation recommends a supply that can deliver 5 A for the Pi 5, and the official supply is a 27 W USB-C unit.[1] Five volts at five amps is 5 × 5 = 25 W. Not all of that goes to the Pi's own chips: the Pi passes power on to whatever you plug into its USB ports (drives, cameras, keyboards). With a supply it trusts for 5 A, the Pi lets its USB ports draw up to 1.6 A in total; with any other supply, it limits them to 600 mA (0.6 A).[1]

Under-voltage is what happens when the supply can't keep up. Every wire and connector has a little resistance, and by Ohm's law a current through a resistance loses some voltage (E = I × R). At 5 A, a cable with just 0.05 Ω in it loses 0.25 V. The Pi watches its input and flags a warning if it falls below 4.63 V (±5 %, so somewhere between about 4.40 and 4.86 V).[1] When that happens it slows its processor down ("throttles") to cut its own power draw, and the documentation warns that a poor supply can corrupt storage or cause unpredictable behavior.[1] This supply aims a little high, 5.13 V at its output terminals, so that after the cable losses the Pi still sees about 4.9 to 5.0 V at full load.

2. The plan: one stage at a time

The wall socket gives alternating current (AC): a voltage that swings from positive to negative and back, 60 times a second in North America. Its "120 V" is an average-like value called RMS; the peaks reach about 170 V. The Pi needs direct current (DC): a steady voltage that does not change direction. Getting from one to the other takes several stages, shown in Figure 1. Each box is one section of this page.

Block diagram of the Raspberry Pi 5 power supply Top row, left to right: wall outlet 120 V AC, inlet with fuse F1 and earth, transformer T1 to 12 V AC, bridge rectifier BR1, filter capacitors C1 to C3 giving about 15 to 21 V DC. A dashed red box marks the mains section, from the outlet to the middle of the transformer. Second row, left to right: fuse F2, buck regulator U1 with L1 and D1, output capacitors C4 and C5 at 5.13 V, USB-C lead with CC resistor, Raspberry Pi 5. A crowbar block below watches the 5 V output and, if it goes above 5.8 V, shorts the regulator's input so fuse F2 blows. MAINS SIDE (120 V AC): dangerous Wall outlet 120 V AC, 60 Hz Inlet J1, F1 fuse 1 A, earth Transformer T1 120 V → 12 V AC Rectifier BR1 AC → bumpy DC Filter C1–C3 ≈ 15–21 V DC Fuse F2 4 A slow-blow Buck U1 LM2678, L1, D1 Output C4, C5 5.13 V DC USB-C lead CC: 10 kΩ = "3 A" Raspberry Pi 5 up to 5 A Crowbar U2, Q2, Q1 if 5 V rises past 5.8 V: short the rail, blow F2 watches 5 V shorts here
Figure 1. The supply, stage by stage. Energy flows left to right along the top row, then along the bottom row to the Pi. The red dashed box is the dangerous mains section; everything after the transformer is low voltage. The crowbar (bottom) is a safety net that only acts if the output voltage goes too high.

In words: the transformer steps 120 V AC down to about 12 V AC and isolates the rest of the circuit from the mains. The rectifier flips the negative half of each AC cycle so that all of it points the same way. The filter capacitors smooth those bumps into fairly steady DC of about 15 to 21 V. The buck regulator converts that to a precise 5.13 V without wasting much energy as heat. The crowbar protects the Pi if anything goes wrong, the fuses protect the wiring, and the USB-C lead delivers the power and tells the Pi how much it can safely take.

Why not just buy the official 27 W supply? You can, and for most people you should. This build exists because it is a good way to learn how a real power supply works, because a linear-transformer front end is quiet and very robust, and because you end up with a supply you understand completely and can repair.

Photo to come: all the parts laid out
All the parts before assembly (photo to come).

3. Stage 1: the mains inlet, fuse F1 and the earth wire

Mains power comes in through J1, a standard IEC inlet: the same three-pin socket found on the back of a computer, which takes an ordinary detachable power cord. The one used here (Qualtek 719W-00/02) has a built-in drawer for a 5 × 20 mm fuse. A fuse is a thin wire designed to melt and break the circuit if too much current flows; fuse F1 here is rated 1 A. It is a slow-blow (time-delay, marked "T") type, which ignores the short surge of current at switch-on but still opens on a lasting fault. See Fuses and Circuit Protection for more.

The three pins are line (also called live or hot: the one carrying the 120 V), neutral (the return, near earth potential) and protective earth (PE, the green/yellow wire, connected to the ground rod at your electrical panel). The fuse must be in the line wire, so that when it blows the circuit after it is disconnected from the live side.

The earth wire is there for faults. Because this supply lives in a plastic (3D-printed) case, there is no metal box to earth. Instead, PE is connected to the 0 V (negative) side of the low-voltage circuit at one point. The transformer is already built to keep mains and low voltage apart (it is tested at 4000 V between them[7]), so this is a second layer of protection: if a loose mains wire ever touched the low-voltage side, the fault current would flow to earth and blow F1, instead of making the Pi's metal parts live.

4. Stage 2: the transformer

A transformer is two (or more) coils of wire wound on a shared iron core. AC in the first coil, the primary, makes a changing magnetic field in the core, and that field produces an AC voltage in the second coil, the secondary. The voltage ratio follows the ratio of turns: fewer turns on the secondary means a lower voltage. The two coils are not connected by any wire, so the secondary is isolated from the mains. Transformers covers how this works.[13]

T1 is a Triad Magnetics VPP24-2330, rated 56 VA (volt-amperes, close to watts for this purpose). It has two 115 V primaries and two 12 V secondaries, so it can work on 115 V or 230 V mains. For 120 V, the datasheet connects the two primaries in parallel (side by side: pins 1 and 4 joined, and pins 3 and 6 joined), and the two 12 V secondaries also in parallel (7 with 10, 9 with 12) for 12 V at up to 4.66 A.[7]

Phasing matters. Each winding has a "start" end, marked with a dot on the schematic (pins 1, 4, 7 and 10). Parallel windings must be joined start to start and end to end. Get one backwards and the two windings fight each other: it is a dead short across the mains (primaries) or across 24 V (secondaries), the fuse blows, and the transformer can be damaged. The build notes give a safe meter check before you close each pair of jumpers.

The "12 V" rating is at full load. A transformer's output sags as you draw more from it, because of the resistance of its copper windings; Triad rates this one at 25 % regulation, meaning the no-load voltage is about 25 % higher than the full-load voltage.[7] With nothing connected you will measure about 15 to 16 V AC on the secondary, which is normal.

Photo to come: transformer primary and secondary jumpers
T1's parallel jumpers: 1–4 and 3–6 on the primary, 7–10 and 9–12 on the secondary (photo to come).

5. Stage 3: the bridge rectifier

A diode is a one-way valve for current: it conducts in one direction (from its anode to its cathode) and blocks the other. Four diodes arranged in a diamond, called a bridge rectifier, steer both halves of the AC cycle into the same direction at the output. The result is DC that still bumps up and down 120 times a second. Diodes explains rectifiers with diagrams.[14]

BR1 is a GBPC3510W, a four-diode bridge in one block, rated 35 A and 1000 V.[11] That is far more than needed; it was chosen because its big metal base bolts to a heatsink and its wire leads suit perf board. The current always passes through two diodes, each dropping about 0.8 to 1 V, so at about 3 A average the bridge turns roughly 4 W into heat (up to about 6 W at low mains voltage). In this plastic case it gets its own finned aluminum heatsink. Its metal base is electrically isolated from the diodes, so the heatsink is not live.[11]

6. Stage 4: filter capacitors

A capacitor stores electric charge, a bit like a small, fast rechargeable tank. Placed across the rectifier output, big capacitors fill up at each peak and supply the current in between, smoothing the bumps into fairly steady DC. The leftover wobble is called ripple. See Capacitors.

C1, C2 and C3 are 2200 µF (microfarads) each, rated 35 V, for 6600 µF in total. With nothing connected the capacitors charge to the peak of the AC, about 21 V (up to about 23 V if your mains runs high at 132 V). At full load the average falls to about 14.6 V with a volt or two of ripple. The regulator after them only needs about 8 V to work, so there is plenty of margin. Electrolytic capacitors like these have a polarity: the stripe marks the negative lead, and they must go in the right way round.

R8, a 10 kΩ resistor, is a bleeder: it slowly drains the capacitors after you unplug, so the board isn't left charged. Its time constant is 10 kΩ × 6600 µF ≈ 66 seconds, so give it about five minutes before working on the board.

Photo to come: bridge rectifier on its heatsink and the filter capacitors
BR1 on its heatsink, with C1 and C2 and the star ground point (photo to come).

7. Stage 5: the buck regulator

A voltage regulator holds its output at a fixed voltage even when the input voltage or the load changes. The simplest kind, a linear regulator, works like a variable resistor that burns off the extra voltage as heat. Dropping 15 V to 5 V at 5 A that way would waste 10 V × 5 A = 50 W, twice the power delivered to the Pi. Instead, this supply uses a switching or buck regulator. See Voltage Regulators.

A buck regulator switches its input on and off very fast (here 260,000 times a second, 260 kHz) and smooths the pulses with an inductor and capacitors.[5] An inductor is a coil that resists changes in current, so it keeps current flowing smoothly between pulses. The fraction of time the switch is on (the duty cycle) sets the output: on about a third of the time, 15 V in averages to 5 V out. Because the switch is either fully on or fully off, it wastes little power, and this supply's buck stage is roughly 85 to 90 % efficient.

The parts of the buck stage:

Setting the voltage. U1 adjusts its switching until its feedback pin sits at 1.21 V. Two resistors form a voltage divider from the output: R2 (3.24 kΩ) on top and R1 (1.00 kΩ) on the bottom. The datasheet formula is[5]

Vout = 1.21 V × (1 + R2 ÷ R1) = 1.21 × (1 + 3.24 ÷ 1.00) = 1.21 × 4.24 ≈ 5.13 V

The reference can be anywhere from 1.186 to 1.234 V,[5] so a given chip will land between about 5.03 and 5.23 V. If the Pi reports under-voltage at heavy load, adding a resistor across R1 raises the output: 56 kΩ gives about 5.20 V and 33 kΩ about 5.25 V.

The "hot loop". The current through C3, U1 and D1 switches on and off in a few billionths of a second. Long wires in that loop act like antennas and add voltage spikes, so these three parts sit right next to each other with short, heavy wires. This is the single most important layout rule for the build.

Heat: U1's metal tab is its ground pin, so its heatsink (HS1) is at 0 V and needs no insulation. D1's tab, though, is its cathode, which is the switching node: its heatsink (HS2) carries a 0 to 23 V square wave and must not touch anything else.

Photo to come: the buck section (U1, D1, C3, L1, C4, C5)
The buck regulator section, with the tight C3–U1–D1 loop (photo to come).

8. Stage 6: the crowbar (over-voltage protection)

If the regulator ever failed with its switch stuck on, the full 15 to 23 V would reach the Pi and destroy it. A crowbar circuit guards against that. It watches the output, and if the voltage goes too high it deliberately short-circuits the supply, like dropping a metal bar across the terminals. The short blows fuse F2, and the Pi is saved.

Three parts do the work:

R5 (1 kΩ) and C8 (0.1 µF) from Q1's gate to its cathode keep electrical noise from firing it by accident.

A design lesson. The first version of this circuit drove the SCR's gate straight from the TL431. It looks fine, but the TL431 measures its 2.495 V from REF to its own anode pin,[6] and with the anode on the SCR gate that pin sits about 1 V above ground. The real trip point would have been around 7.4 to 9.3 V, too high to save the Pi. Grounding the TL431's anode and adding Q2 fixed it. Always check what a part's reference voltage is measured against.

Photo to come: the crowbar section (U2, Q2, Q1 and resistors)
The crowbar: TL431 (U2), PNP driver (Q2) and SCR (Q1) (photo to come).

9. The fuses

Two fuses protect different things. F1 (1 A slow-blow, in the inlet drawer) protects the mains wiring and the transformer. At full load the primary draws about 0.4 to 0.5 A, so 1 A leaves room for the switch-on surge; a short on the secondary side pulls about 3 A from the mains and blows it within seconds. F2 (4 A slow-blow, in a board-mounted holder) protects the low-voltage side and is the fuse the crowbar blows. In normal use the current through it is about 2 to 3.3 A, depending on load and mains voltage.

Use the power formula (PIE) to check: 26 W out of the regulator at about 88 % efficiency is about 30 W in; at 14.6 V that is 30 ÷ 14.6 ≈ 2.1 A. Fuses are normally run at no more than about 75 % of their rating for long life, so if you will run the Pi at a sustained 5 A on low mains, a 5 A fuse is a reasonable swap. Always replace a blown fuse with the same type and rating, and find out why it blew first. Fuses and Circuit Protection covers fuse ratings in depth.

10. The USB-C lead and the CC wire

The output reaches the Pi through a captive USB-C lead: a good-quality 5 A USB-C cable (Tripp Lite U040-003-C-5A) cut in half, with the cut end wired to the board. Inside a USB-C cable are the power pair (VBUS, positive, and GND), the data wires (D+ and D−, plus high-speed pairs) and a configuration channel wire, CC.

A USB-C power source tells the device how much current it offers using a resistor from CC to VBUS. The USB Type-C specification defines a 10 kΩ pull-up (to a 5 V supply) as "3.0 A available".[12] The Pi has its own 5.1 kΩ resistor from CC to ground, and the voltage it sees across that one (about 1.7 V) tells it which level is on offer. So: VBUS and GND carry the power, CC gets R6 (10 kΩ) to VBUS, and every data wire is cut short, insulated and left unconnected. Find the CC wire with a meter: it is the one with continuity to pin A5 on the plug.

Why 3 A, when the supply can give 5 A? The only way to advertise 5 A at 5 V is USB Power Delivery (PD), a digital conversation over the CC wire that needs a dedicated chip. The Pi accepts the 3 A signal and runs normally, but limits its USB ports to 600 mA unless you tell it otherwise in its configuration file (section 16).[1][2]

11. The schematic

A schematic is a circuit's wiring diagram, using symbols instead of pictures of the parts. Each part has a reference designator (R1, C3, U1 and so on) that matches the parts list. Lines are wires, and a dot where lines meet means they are connected; lines that cross without a dot are not. Every ground symbol is the same 0 V connection. The red dashed box is the mains section. The schematic is wide; scroll sideways on a small screen, or open the full-size version.

Schematic of the Raspberry Pi 5 power supply, Rev B: mains inlet, transformer, bridge rectifier, filter, LM2678 buck regulator, crowbar and USB-C leadRaspberry Pi 5 supply, single port: 120 V AC in, 5.13 V / 5 A out on a captive USB-C leadSchematic Rev B, 2026-10-11. Transformer > bridge > filter > LM2678 buck > crowbar > USB-C. Reference designators match the BOM (digikey-bom-single.md). Q2, R10, R11 are Rev B additions; R9 changed 47 Ω > 100 Ω.J1IEC C14inletQualtek719W-00/02(fuse drawer)LNPEF1 T1A 250 V slow-blow 5×20Littelfuse 0218001.HXP(in J1 fuse drawer)TB1-1TB1-2TB12-pos5.08 mmPE: bond to 0 V star point(green/yellow wire, see note 6)4613791012T1 Triad VPP24-2330 56 VA, PC mountpri 2 × 115 V in PARALLEL (1+4, 3+6)sec 2 × 12 V in PARALLEL (7+10, 9+12)= 12 V AC, 4.66 A● = winding start (same phase).Join dotted end to dotted end.Wrong phasing = a shortedwinding (see note 2).⚠ MAINS: 120 V AC, LETHALEverything inside the red box is at mains voltage.12 V AC~~+−BR1GBPC3510W35 A 1000 Von its own heatsink(≤ 5 °C/W)VRAW ≈ 14.6 V at 26 W, 17.6 V at 8 W(≈ 21 V unloaded at 120 V; ≤ 23 V at 132 V)+C12200 µF35 VPanasonicEEU-FR1V222+C22200 µF35 VEEU-FR1V222R810.0 kΩ¼ WbleederF2 T4A slow-blow 5×200218004.HXP in Schurter0031.8201 PCB holderVIN+C32200 µF 35 VEEU-FR1V222at U1 pins 2/4C70.1 µF50 V X7RC320C104K5R5TAQ12N6504GSCR50 V 25 AG7ON/OFF1SW2VIN3CB6FB4GND5NCU1LM2678T-ADJTO-220-7, tab = GNDHS1 Boyd HS380× leave OPEN×NCC6 0.01 µF 50 V X7RC315C103K5R5TA(pin 3 to pin 1)SWD1MBR1045G45 V 10 AK = pin 1 + tabHS2 floats atSW potential!L1 22 µH 6.7 ABourns 2100HT-220-H-RC+C4560 µF 35 VEEU-FR1V561+C5560 µF 35 VEEU-FR1V561VOUT 5.13 VR2 3.24 kΩ 1%MFR-25FBF52-3K24R1 1.00 kΩFB (pin 6): keep this wire away from L1 and the SW nodeVout = 1.21 V × (1 + R2/R1)= 1.21 × 4.24 = 5.13 V(5.03 to 5.23 V from VFBtolerance; trim at the Pi)TB2-1TB2-2R6 10.0 kΩW1 captive USB-C leadhalf of a 5 A USB-C cableTripp Lite U040-003-C-5AVBUS (plug A4 A9 B4 B9)CC (plug A5)GND + shield (A1 A12 B1 B12)×D+ (A6): cut, insulate×D− (A7): cut, insulate×all other wires: cut, insulateto Pi 5 USB-C power inputCC pull-upVOUT sense (take it at TB2)R3 3.24 kΩ 1%R4 10.0 kΩ 1%R7 10.0 kΩ 1%REFU2 TL431AILP2.495 V refK top, A bottomR10 1.00 kΩ (new)R11 10.0 kΩ (new)Q2 2N3906 PNP (new)E top, B left, C bottomR9 100 Ω ¼ W(was 47 Ω)crowbar gate drive to Q1R51.00 kΩC8 0.1 µF 50 V(gate noise filter)Solder R5 and C8 right at Q1, G (pin 3) to K (pin 1).OVER-VOLTAGE CROWBAR (Rev B)Trips at 2.495 V × (1 + 13.24 k / 10 k) = 5.80 V(about 5.68 to 5.93 V with TL431A and 1% resistors).Gate drive ≈ (5.8 − 0.2 − 1.0) V / 100 Ω ≈ 46 mA;the 2N6504 needs ≤ 30 mA at 25 °C. When Q1 fires itshorts VIN, U1 stops, the output collapses, and F2 (or F1) opens.NOTES1. Mains (red box): 120 V AC can kill. Unplug before touching; sleeve every mains joint; first power-up through a dim-bulb tester.2. T1 phasing: wire pins 1+4 together and 3+6 together (primaries), 7+10 together and 9+12 together (secondaries), per the Triad VPP24-2330 datasheet. Before joining the second winding of a pair, measure across the open joint: about 0 V AC = correct. About 230 V (primary) or 24 V (secondary) = reversed; swap that winding's two ends. Never parallel windings without checking.3. Pin numbers: U1 TO-220-7 (1 SW, 2 VIN, 3 CB, 4 GND/tab, 5 NC, 6 FB, 7 ON/OFF); Q1 TO-220AB (1 K, 2 A, 3 G, tab A); D1 TO-220AC (1 K, 3 A, tab K); U2 TO-92 facing the flat: REF, A, K from left; Q2 TO-92 facing the flat: E, B, C. See pinout-reference.png. TL431 pin NUMBERS differ by maker (TI: 1 K, 2 A, 3 REF); the physical order does not.4. Grounds: every ground symbol is the same 0 V net. Wire them as a star at C1's negative lead; the buck loop C3-U1-D1 returns to U1 pin 4 with short, heavy wire. Heavy bus wire on BR1, C1-C3, F2, U1 pins 1/2/4, D1, L1, C4/C5 and TB2.5. U1's tab is GND, so HS1 is at 0 V. D1's tab is its cathode = the switching node: HS2 carries a 0 to ≈ 23 V square wave at 260 kHz. Keep HS2 at least 3 mm from everything, or mount D1 on an insulating pad and bushing.6. The case is 3D-printed PETG (no metal box): bond PE from J1 to the 0 V star point so a mains-to-secondary fault blows F1. BR1 needs its own aluminum heatsink plate (about 4 W at full load); its metal base is isolated from the leads.7. W1 CC wire: find it by continuity to plug pin A5. 10 kΩ to VBUS tells the Pi 5 the supply can give 3 A, so the Pi needs usb_max_current_enable=1 in config.txt to allow its full 1.6 A USB budget. D+/D− and all data pairs stay unconnected.8. Rev B changes from DESIGN-single.md: crowbar now uses Q2 + R10 + R11 (the TL431 anode is at 0 V, so the trip is not raised by the SCR gate voltage); R9 changed from 47 Ω to 100 Ω; C8 moved to Q1 gate; PE bond and BR1 heatsink because of the plastic case.
Figure 2. Full schematic, Rev B. Downloads: PDF · PNG (5600 px) · SVG.

Figure 3 shows where each pin is on the actual parts, which is where most build mistakes happen. TO-220 and TO-92 parts are drawn looking at the front (the printed side) with the leads pointing down. Note the TL431: different makers number its pins differently, but the physical order is the same.[6]

Pinout reference for U1 LM2678, Q1 2N6504G, D1 MBR1045G, BR1 GBPC3510W, U2 TL431, Q2 2N3906 and T1 VPP24-2330Pinout and wiring reference: single Raspberry Pi 5 supply (Rev B)TO-220 and TO-92 parts are drawn from the FRONT (marking / flat face toward you, leads pointing down). Always confirm against the part in your hand.U1 LM2678T-ADJ (TO-220-7, TI NDZ)tab= pin 4 (GND)front1SW2VIN3CB4GND5NC6FB7ON/OFFLead pitch 1.27 mm (0.050 in). Pins 1, 3, 5, 7 areformed 5.08 mm (0.200 in) away from pins 2, 4, 6,so each row is on a 0.1 in pitch but the rows areoffset 0.05 in: drill or open up holes for one row.Pin 7 ON/OFF: leave open (internal pull-up).C6 0.01 µF from pin 3 to pin 1.Q1 2N6504G SCR (TO-220AB)tab= pin 2 (anode = VIN)front1K cathode2A anode3G gateTab is the anode, at VIN: no heatsink needed,but keep the tab clear of other parts.K (1) to 0 V, A (2) to VIN, G (3) to R9.R5 1 kΩ and C8 0.1 µF go directly fromG (3) to K (1) at the device.D1 MBR1045G Schottky (TO-220AC)tab= pin 1 (cathode = SW node)front1K cathode3A anodeTwo-lead TO-220: there is no pin 2.K (1, tab) to U1 pin 1 (SW) and L1.A (3) to 0 V, right beside C3 and U1 pin 4.⚠ HS2 is at the switching node:0 to ≈ 23 V square wave at 260 kHz.Insulate or space it 3 mm from everything.BR1 GBPC3510W (wire leads)view of the LEAD side (as in the datasheet outline)~−+~chamfered corner = + sideLeads: AC ~ top-left and bottom-right; DC + nearthe chamfered corner; DC − top-right. The + isalso marked on the case. Seen from the componentside of a board, the layout is mirrored.Metal base is isolated from the leads: bolt it toa finned heatsink ≤ 5 °C/W with paste (≈ 4 W).U2 TL431AILP (TO-92)flat faceREFAKLeft to right, flat face toward you:REF, ANODE, CATHODE.Pin NUMBERS differ by maker: TI LP package1 = K, 2 = A, 3 = REF; onsemi 1 = REF,2 = A, 3 = K. The physical order is the same.A to 0 V, REF to R4/R7, K to R10.Q2 2N3906 PNP (TO-92) newflat faceEBCLeft to right, flat face toward you:EMITTER, BASE, COLLECTOR (pins 1, 2, 3).E to VOUT sense, B to R10/R11,C to R9. Check your maker's sheet;some TO-92 PNPs (e.g. BC327) differ.T1 Triad VPP24-2330 (56 VA, PC mount): pin numbers and parallel jumpersschematic from the Triad datasheet (top view); pins 2, 5, 8 and 11 are not fitted1346791012PRIMARY 2 × 115 VSECONDARY 2 × 12 V120 V (parallel):jumper 1–4jumper 3–6Line to 1, Neutral to 612 V / 4.66 A (parallel):jumper 7–10jumper 9–12BR1 ~ to 7 and to 12● marks the start of each winding (Triad's series hookup, 3 to 4 and 9 to 10, puts 1/4 and 7/10 in phase).Check before you parallel: with only 1–3 powered (via a dim-bulb tester), join 1 to 4 and measure 3 to 6.≈ 0 V AC = correct; ≈ 230 V = reversed. Then join 7 to 10 and measure 9 to 12: ≈ 0 V correct, ≈ 24 V reversed.Triad specs: 4000 V AC hipot primary to secondary; 25% regulation (≈15 V AC unloaded at 115 V).Sources: TI LM2678 datasheet SNVS029L (Fig. 4-2, Table 4-1, NDZ0007B drawing); TI TL431 SLVS543S (Table 5-1); onsemi 2N6504/D rev 8 (TO-220AB style 3);onsemi MBR1035/D rev 9 (TO-220AC: 3 = A, 1 and tab = K); Fairchild/onsemi 2N3906 rev 1.2.2 (TO-92 E B C); Taiwan Semiconductor GBPC15/25/35 rev M2211 (GBPC-W outline); Triad VPP24-2330 (publish date Aug 26, 2021).
Figure 3. Pinout and wiring reference for U1, Q1, D1, BR1, U2, Q2 and T1. Downloads: PDF · PNG.

12. Parts list

Part numbers are as ordered from DigiKey. Resistors are 1 %, ¼ W metal film unless noted. The perf board, terminal blocks and cable are interchangeable with anything of similar rating.

Bill of materials (Rev B)
RefQtyPartValue / ratingRole
J11Qualtek 719W-00/02IEC C14 inlet with fuse drawer, 10 AMains in
F11Littelfuse 0218001.HXPT1A 250 V, 5 × 20 mmMains fuse
T11Triad VPP24-233056 VA, 2 × 115 V / 2 × 12 VTransformer
BR11Taiwan Semi GBPC3510W35 A 1000 V bridgeRectifier
HS31Aluminum heatsink≤ 5 °C/WFor BR1
C1–C33Panasonic EEU-FR1V2222200 µF 35 VFilter / U1 input
R81YAGEO MFR-25FBF52-10K10.0 kΩBleeder
F21Littelfuse 0218004.HXP + Schurter 0031.8201 holderT4A 250 VDC rail fuse
U11TI LM2678T-ADJ/NOPB5 A buck, TO-220-7Regulator
L11Bourns 2100HT-220-H-RC22 µH 6.7 ABuck inductor
D11onsemi MBR1045G45 V 10 A SchottkyCatch diode
C4, C52Panasonic EEU-FR1V561560 µF 35 VOutput filter
C61KEMET C315C103K5R5TA0.01 µF 50 V X7RU1 boost
C7, C82KEMET C320C104K5R5TA0.1 µF 50 V X7RU1 input bypass; Q1 gate filter
R11YAGEO MFR-25FBF52-1K1.00 kΩFeedback divider (bottom)
R21YAGEO MFR-25FBF52-3K243.24 kΩFeedback divider (top)
U21TI TL431AILP2.495 V shunt reference, TO-92Crowbar sensor
R3, R4, R733.24 kΩ, 10.0 kΩ, 10.0 kΩ1 %Crowbar divider
Q21onsemi 2N3906BUPNP 40 V 200 mA, TO-92Crowbar driver
R10, R1121.00 kΩ, 10.0 kΩ1 %Q2 base, base pull-up
R91YAGEO MFR-25FBF52-100R100 ΩSCR gate current
R51YAGEO MFR-25FBF52-1K1.00 kΩSCR gate–cathode
Q11onsemi 2N6504GSCR 50 V 25 A, TO-220Crowbar switch
R61YAGEO MFR-25FBF52-10K10.0 kΩUSB-C CC pull-up
HS1, HS22Boyd 530002B02500GTO-220 heatsinkU1, D1
TB1, TB22Phoenix Contact 17291282-pos 5.08 mmMains in; DC out
W11Tripp Lite U040-003-C-5AUSB-C 5 A cable, cutCaptive lead
—1Perf board, bus wire, thermal paste, M3 hardware—Construction

13. Construction

The board is 165 × 114 mm (6.5 × 4.5 in) perf board: board with a grid of holes, each with its own copper pad, so you make every connection yourself with wire and solder. Figure 4 shows the suggested layout. The mains parts sit at the left end, well away from everything else, and the output terminal is at the right end next to where the USB-C lead leaves the case.

Top view of the 165 by 114 millimeter board. Left end: mains inlet terminal TB1 and the keep-out zone. Center-left: transformer T1 with the bridge rectifier on its heatsink above it. Center: filter capacitors C1 and C2 with the star ground point, fuse F2 and the SCR. Right: C3, U1 and D1 on their heatsinks forming the hot loop, inductor L1 at the bottom, output capacitors, the crowbar parts and output terminal TB2 at the right edge.
Figure 4. Suggested parts placement, in the case's board coordinates (millimeters from the mains end).

Key rules:

  1. Keep mains apart. Leave at least 8 mm of bare board between any mains connection and anything on the low-voltage side; cut away copper pads along that line. Cover every mains joint with heat-shrink tubing, and tie wires down so a broken joint cannot swing loose.
  2. Heavy wire for heavy current. The path from the transformer through the rectifier, capacitors, regulator, inductor and out to the terminal carries 3 to 5 A. Use 16 to 18 AWG wire or doubled bus wire, not thin hookup wire.
  3. Tight hot loop. C3, U1 and D1 as close together as possible, leads short (section 7).
  4. Star ground. Run all the 0 V (ground) wires back to one point, at the negative leads of C1 and C2. This keeps the big switching currents from disturbing the small feedback and crowbar signals.
  5. Sense at the terminal. Connect the top of the feedback divider and the crowbar's sense wire at the output terminal TB2, so the 5.13 V is set where it leaves the board.
  6. Insulate D1's heatsink. Mount D1 on an insulating pad and shoulder washer, or keep its heatsink at least 3 mm from everything.
  7. LM2678 leads. Its seven leads are only 1.27 mm apart and formed into two staggered rows. On 2.54 mm (0.1 in) perf board, drill the odd-numbered row between grid holes or gently spread the leads.
  8. Secure the transformer. It weighs about 0.8 kg (1.7 lb)[7]; use its mounting holes and a couple of cable ties, not just its solder pins.

The full builder's notes, with exact coordinates and a wiring order, are published with this project's downloads.

14. The 3D-printed case

The supply lives in a two-piece case printed in PETG, a tough plastic that copes with the warmth inside (about 50 °C at full load; PETG softens at around 80 °C). The case has mounting bosses for the transformer, standoffs for the board, a cut-out for the IEC inlet, an exit for the USB-C lead, ventilation slots and an internal barrier between the mains end and the rest of the board. It replaces the Hammond 1590EE metal box in the original design. Because it is plastic, the earth wire is bonded as described in section 3.

Case status: in progress. The case is designed and the printable files are below. The pictures in this section are computer renders of the design, not photos; photos of the printed case with the board installed will be added as the build goes along.

Render of the closed case: a light grey rectangular tub with a blue lid. Ventilation slots run along the lid and the lower side wall; the IEC inlet sits in the left end wall with warning text beside it, and keyhole mounting tabs stick out at the bottom.
Figure 5. The assembled case, mains end on the left. Render of the OpenSCAD case model (not a photo). The label text is drawn in red only to make it visible in the render; on the real case it is raised or recessed in the same plastic.
Exploded render: the lid lifted above the tub, showing the barrier rib hanging from the lid's underside, and inside the tub simplified models of the perf board, the yellow transformer, the inlet and the black heatsinks.
Figure 6. Exploded view with simplified stand-ins for the board, transformer, inlet and heatsinks. The tall plate under the lid is the barrier rib that separates the mains end. Render of the OpenSCAD case model (not a photo).
Render looking down into the empty tub: the IEC inlet cut-out in the left end wall, four large transformer bosses and the board standoffs on the floor, the low floor rib, lid-screw corbels in the corners and vent slots in the side and right end walls.
Figure 7. Inside the base: the transformer bosses, board standoffs, floor rib, lid-screw corner blocks and vent slots. Render of the OpenSCAD case model (not a photo).

What the case provides

The bridge rectifier can't use a metal case wall as its heatsink, so in this design it bolts to its own finned aluminum heatsink beside the transformer (section 5).

Printing it

The case was set up for an Anycubic Kobra 2 Pro (220 × 220 mm bed). The base and lid don't fit on the bed together, so each is printed separately, with no supports: the base open side up, the lid top face down.

Print estimates from the slicer (PrusaSlicer 2.9.2, 0.2 mm layers)
PartPrint time (estimate)Filament (estimate)
Base tub15 h 32 min254 g
Lid5 h 13 min88 g
Totalabout 20 h 45 minabout 342 g

The plastic is not the insulation. Ordinary PETG is not flame-rated to the standard of a commercial power-supply case (it is typically UL94 HB, not V-0), and metallic PETG contains metal-effect pigment. Every live part must be insulated in its own right: sleeve every inlet tab and splice, and keep the mains wiring on the mains side of the barrier ribs. A flame-retardant PETG or PC-ABS rated UL94 V-0 at 3 mm is a better choice if you can get it. Never run the supply with the lid off. See section 17.

Hardware for the case

Not in the DigiKey parts list (builder's stock):

Check before you drill. The transformer's mounting-hole pattern comes straight from its datasheet, but the positions of its pins inside each pin row were inferred from the drawing. Hold the real transformer against the board as a drilling template. Also keep the board clear of anything taller than 1.5 mm along the line under the lid's barrier rib, about 30 mm from the mains end of the board.

Downloads

Case files
FileWhat it isSize
pi5psu-case-base.stlBase tub, STL, already in print orientation3.4 MB
pi5psu-case-lid.stlLid, STL, already in print orientation (top face down)1.6 MB
pi5psu_case.scadOpenSCAD source. Every dimension is a parameter, so you can change the board size, hole positions or standoff height to suit your own board.15 KB

An STL file describes a 3D shape as a mesh of triangles; any slicer (PrusaSlicer, OrcaSlicer, Cura, Anycubic's own slicer) can open it and turn it into printer instructions.

Photo to come: the board installed in the printed case
The finished board installed in the 3D-printed case (photo to come).

15. Testing, step by step

Never connect the Pi until every step below has passed. Test in stages, so that a mistake costs a fuse rather than a Raspberry Pi. You need a multimeter, a dim-bulb tester (an ordinary 40 to 60 W incandescent bulb wired in series with the mains feed, so that a short just lights the bulb instead of blowing fuses or parts), and ideally a bench power supply with a current limit.

  1. Before power. With the board unplugged, measure resistance: mains line and neutral to earth should read open (more than 10 MΩ). The DC rail should not read as a short to ground.
  2. First power, through the dim bulb, with U1 and Q1 not yet fitted. The bulb should flash briefly and then go dark or glow dimly. A steady bright bulb means a short or a reversed transformer winding: unplug and check.
  3. Transformer output. About 15 to 16 V AC across the secondary with no load (higher than 12 V is normal, section 4).
  4. Raw DC. About 20 to 21 V DC across C1 at 120 V mains. Unplug and watch it drain slowly through R8.
  5. Fit U1 and set the output. Unplugged and discharged, fit U1. At no load, the output terminal should read 5.03 to 5.23 V (typically 5.13 V).
  6. Load test. Remove the dim bulb. Connect a 1 Ω, 50 W power resistor on a heatsink (or an electronic load set to 5 A) for a few minutes at a time. The output should stay above about 5.05 V, and nothing should get too hot to keep a finger on for a few seconds.
  7. Crowbar test, with a bench supply. Unplug mains and remove U1. Fit Q1. Connect a bench supply to the output terminal, current limit 100 mA, starting at 5 V. Raise it slowly: at about 5.8 V the current jumps from almost nothing to about 50 mA. That shows the crowbar trips at the right voltage. To see the SCR latch, also feed the DC rail from a second supply at 12 V limited to 200 to 500 mA: when the output supply passes 5.8 V, the rail collapses to about 1 V and stays there. Keep this test short, then refit U1.
  8. At the Pi. Only now plug in the Pi. Measure the voltage at the Pi itself (between a 5 V pin and a ground pin on its GPIO header) while it is busy, and check the Pi's own report (section 16).
Photo to come: meter reading the 5 V at the Pi under load
Measuring the voltage at the Pi's GPIO header while it runs a stress test (photo to come).

16. Telling the Pi: config.txt

Because the USB-C lead advertises 3 A (section 10), the Pi limits its USB ports to 600 mA. This supply really can deliver 5 A, so you can lift that limit by adding one line to the Pi's config.txt, a settings file the Pi reads when it starts:[2]

usb_max_current_enable=1

On Raspberry Pi OS the file is /boot/firmware/config.txt. On Home Assistant OS it is on the small boot partition (named hassos-boot) of the SD card or SSD; shut down, put the card in another computer and edit it there. Only add this line with a supply that really can provide 5 A, like this one.

Checking for under-voltage. On Raspberry Pi OS, run

vcgencmd get_throttled
vcgencmd pmic_read_adc EXT5V_V

The first command should print throttled=0x0. A 1 in the lowest bit (0x1) means under-voltage right now; 0x10000 means it has happened since the last boot.[3] The second reads the Pi's own measurement of its input voltage, which should stay above about 4.9 V.[1] For a proper test, load the processor with stress-ng --cpu 4 --timeout 600s while your USB devices are busy, and watch both readings.

In Home Assistant, add the Raspberry Pi Power Supply Checker integration (Settings → Devices & services → Add integration). It creates a binary sensor that shows a problem if the Pi running Home Assistant detects under-voltage.[4] Leave it on your dashboard for a few days after building the supply.

Screenshot to come: Home Assistant power status sensor
Home Assistant's Raspberry Pi power supply sensor showing no problem (screenshot to come).

17. Safety

The whole story in brief

The transformer steps 120 V AC down to 12 V AC and isolates it from the mains. The bridge rectifier and filter capacitors turn that into about 15 to 21 V DC. The LM2678 buck regulator switches it efficiently down to 5.13 V, set by two resistors. A TL431, a PNP transistor and an SCR form a crowbar that blows fuse F2 if the output ever passes 5.8 V. A 10 kΩ resistor on the USB-C CC wire tells the Pi it may draw 3 A, and usb_max_current_enable=1 lets it use the supply's full 5 A. Test in stages, through a dim bulb, before the Pi ever sees it.

Sources

Links checked in October 2026. External links open in a new tab.

  1. Raspberry Pi Ltd, Raspberry Pi documentation, "Power supply" (typical power requirements, USB current limits, power supply warnings, pmic_read_adc): https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#power-supply
  2. Raspberry Pi Ltd, Raspberry Pi documentation, "config.txt" (usb_max_current_enable): https://www.raspberrypi.com/documentation/computers/config_txt.html
  3. Raspberry Pi Ltd, Raspberry Pi documentation, "vcgencmd: get_throttled": https://www.raspberrypi.com/documentation/computers/os.html#get_throttled
  4. Home Assistant, "Raspberry Pi Power Supply Checker" integration: https://www.home-assistant.io/integrations/rpi_power/
  5. Texas Instruments, LM2678 SIMPLE SWITCHER High-Efficiency 5-A Step-Down Voltage Regulator (SNVS029L, PDF): https://www.ti.com/lit/ds/symlink/lm2678.pdf
  6. Texas Instruments, TL431, TL432 Precision Programmable Reference (SLVS543S, PDF): https://www.ti.com/lit/ds/symlink/tl431.pdf
  7. Triad Magnetics, VPP24-2330 power transformer datasheet (PDF): https://catalog.triadmagnetics.com/Asset/VPP24-2330.pdf
  8. onsemi, 2N6504 Series Silicon Controlled Rectifiers (2N6504/D, PDF): https://www.onsemi.com/download/data-sheet/pdf/2n6504-d.pdf
  9. onsemi, MBR1035, MBR1045 Switch-mode Power Rectifiers (MBR1035/D, PDF): https://www.onsemi.com/download/data-sheet/pdf/mbr1035-d.pdf
  10. onsemi (Fairchild), 2N3906 / MMBT3906 / PZT3906 PNP General-Purpose Amplifier (PDF): https://www.mouser.com/datasheet/2/149/2N3906-888380.pdf
  11. Taiwan Semiconductor, GBPC3510W bridge rectifier, DigiKey product page and datasheet: https://www.digikey.com/en/products/detail/taiwan-semiconductor-corporation/GBPC3510W/17766096
  12. USB Implementers Forum, USB Type-C Cable and Connector Specification, Release 2.4 (source current advertisement, Rp values): https://www.usb.org/document-library/usb-type-cr-cable-and-connector-specification-release-24
  13. Tony R. Kuphaldt, Lessons In Electric Circuits, Volume II (AC), chapter 9, "Transformers": https://www.ibiblio.org/kuphaldt/electricCircuits/AC/AC_9.html
  14. Tony R. Kuphaldt, Lessons In Electric Circuits, Volume III (Semiconductors), chapter 3, "Diodes and Rectifiers": https://www.ibiblio.org/kuphaldt/electricCircuits/Semi/SEMI_3.html
  15. Tony R. Kuphaldt, Lessons In Electric Circuits, Volume III (Semiconductors), chapter 7, "Thyristors" (including the SCR crowbar): https://www.ibiblio.org/kuphaldt/electricCircuits/Semi/SEMI_7.html