I like building Power Supplies for my Projects and I like to use the old Linear Power Supply. For one they’re quite and stable as heck. The downside is they’re a bit power hungry.
The basics of a Linear Power Supply is a Step down Transformer, Rectifier and a Smoothing Capacitor. These days it’s better to use a Full Bridge Rectifier and Smoothing Caps that are much higher the Voltage Rating so if you’re building a Power Supply that just needs to power 12 Volts then use 50 Volt Rated Caps.
AC Line Protection
It’s better to use the all-in-one IEC connector that has a built in Fuse and EMI Filter. You also want to add a Safety Cap across the Line and from Neutral to Ground. Make sure it is fused and to kill the power to both Live and Neutral.
From left to right we have the following components.
AC Mains coming in passes through a EMI Filter that passes through some Safety Caps that goes Across the Line and from Neutral to Chassis Ground. A SPST Switch that switches the Live and Neutral ON/OFF and with a Fuse on the Live Wire. From there it goes into a Stepdown Transformer that turns 110 Mains into a Low Voltage Secondary and shown above is also Isolated from the AC Mains Primary (IE: Floating Ground) that then feeds into a Full Bridge Rectifier and finally into a Smoothing Cap.
When grounding the Mains you want to use toothed lock washers when attaching it to a metal chassis. You want it to bite into the Metal so Vibrations can’t loosen it and also in most cases can get through the Paint into bare metal. If anything sand off to bare metal for your Chassis Ground. Best practice is to use the correct wiring color scheme.
Typical North American wiring standards use 18 to 16 gauge copper wire. Polarized Two Prong cable are is Black for Live and White for Neutral. Three Prong is the same but the third wire is Green that is Earth Ground. Try and keep the wire short as possible inside of the Chassis and it is good Practice to twist the Live and Neutral together to stop transient EMI. Rule of thumb is to twist it 6 times per foot.
If you happen to use an old Computer IEC cable and you see Blue, Brown and Green with a yellow stripe it’s using the European Color Code.
Brown = Live
Blue = Neutral
Green with Yellow = Earth
In all you can find IEC Filters that already have built in safety caps and power switches but chances are the switch only switches the Live leg. Keep the Low Voltage stuff away from the High Voltage as much as possible and keep the high voltage lines short as possible. Be sure to double up on the Heatshrink. and if you’re using a Transformer with open air taps be sure to use electrical grade plastics to isolate it from Metal.