A Word about Safety for DIY'ers Building their Own Equipment
[This is the usual nag/disclaimer everyone who writes DIY articles puts out - but please take it seriously]
At some point, you will probably be working with primary side wiring. That is 120 volts AC in the US or 220 volts AC in most other places. This can kill you. I repeat - these are lethal voltages and can stop your heart!
DO NOT, under any circumstances, allow yourself to come in contact with the hot lead of the line voltage. Follow some basic safety precautions:
Understand your wiring. Know the difference between the hot, neutral, and ground wires.
Always connect the line ground conductor to the case of your enclosure or chassis, assuming they are metal. I do not recommend 2-wire A/C hookups (common in consumer gear) for DIY projects. Also, make sure all the metal parts of your chassis are bonded to the AC ground conductor. Do not assume that painted or anodized parts are bonded simply because they are bolted or screwed together. You may need individual bonding wires for each part of the chassis, including heatsinks. Check with an ohmmeter.
Always use insulated connectors with primary side wiring line and neutral wires, e.g. Faston terminals with plastic shrouds, or place heat-shrink tubing over any exposed metal terminals and uninsulated wire.
Always double-check your wiring with an ohmmeter and test for zero continuity between the line connections (hot and neutral) and equipment chassis prior to plugging anything in.
Always include a fuse (in an insulated fuse holder) in the primary side wiring on the hot lead.
Any components connected to the primary wiring should be UL/CSA or CE (in Europe) approved. Do not use cheap knock-offs.
If these don't make sense to you, consult with someone who knows what they are doing before you proceed, OR, only work with devices that can be powered by external "wall warts" which have agency approval.