# 5v Power Supply Tutorial

I couldn't really think of a good name for this topic, but basically Im looking for a good Tutorial/Schematic for kind of a "basic" Power Supply (To run Experiments off a breadboard). Typically they seem to use a 7805 5v regulator (coming from a 9V), a few capacitors, a diode (and some other components like a resettable fuse usually).

This would be a great thing I could put together then hook up (so I can use for basic learning/experiments). I found a few videos on youtube, but they were really sparse and didn't actually "show" the schematic in the end (nor explain why what goes where).

Anything with a Schematic or explanation would be great, the one components the better IMO since it'll give me a chance to get used to the actual components themselves.

edit: Something similar to this: http://www.youtube.com/watch?v=FVMrA8C-GM0&feature=channel_video_title

This is the schematic for a typical 5V power supply:

The 12V AC input from the transformer is rather high. The rectifier + smoothing capacitor will level the voltage at the peak value; $\sqrt{2} \cdot V_{RMS}$, though you have to subtract 2 diode drops from the rectifier, about 1V per diode. So

$V_{IN} = \sqrt{2} \cdot 12V - 2 \cdot 1V = 15V$

The 7805 can supply up to 1A, and then the dissipated power is

$P_{REG} = (V_{IN} - V_{OUT}) \cdot I = (15V - 5V)\cdot 1A = 10W!$

That's a lot! Try to keep the dissipation low by having a lower input voltage. This should be at least 8V, then an 8V transformer should be fine. At 1A you'd still need a heatsink.

The smoothing capacitor's value depends on the load. Every half cycle of the mains voltage the capacitor will be charged to the peak value and start to discharge until the voltage is high enough to charge again. A simplified calculation gives

$C = \dfrac{I \cdot \Delta T}{\Delta V}$

where $\Delta T$ is half the mains cycle (e.g. 10ms in Europe, 8.33ms in the US). This formula assumes a linear discharge, which in reality often will be exponential, and also assumes a too long time, which often will be 70-80% of the given value. So, all in all, this is really worst case. Based on the above equation we can calculate the ripple voltage for a given current, like 100mA:

$\Delta V = \dfrac{I \cdot \Delta T}{C} = \dfrac{100mA \cdot 10ms}{470\mu F} = 2.1V$

which is OK given the high input voltage. In practice the ripple will probably be around 1.6V. A 1A current, however, would cause a 16V ripple, so you should use at least a 4700$\mu$F capacitor then.

Ripple is the variation in voltage which remains after smoothing with the capacitor.

No matter how big your capacitor is you'll always have a certain amount of ripple, though with large capacitors and low power consumption you can reduce it to mV levels.

Image from here

• Wait a second. Last I checked, the mains input voltage and secondary voltage were both specified as peak, not RMS values, for transformers. So that sqrt(2) does not belong in there. You only use RMS values when calculating power and such; peak voltage is far more useful: for example, it determines whether or not your diodes will reverse breakdown or if your capacitor is over voltage. Oct 23 '11 at 14:22
• The rule with the smoothing capacitor is that, at full load, the voltage on the capacitor must not drop below the output voltage plus the regulator's dropout voltage. Oct 23 '11 at 14:24
• Nope, that 230V is RMS, no transformer is specified as 325V, which is the peak value. Same with secondary: RMS, not peak. Oct 23 '11 at 14:27
• @Sauron: Ripple is simply the difference between the maximum and minimum voltage at a node. In this case, the maximum is where the voltage from the diodes is at its maximum (The VIN equation above) and the minimum is the voltage the capacitor discharges to right before VIN exceeds VCAP on the next cycle. The capacitor is charging only when VIN >= VCAP; at other times, the diodes are all reverse biased and no current flows. That's why mains power guys hate this circuit; it creates two big current spikes per cycle, which result in a lot of harmonics. Oct 24 '11 at 4:46
• @Sauron - added an image illustrating ripple to my answer. Oct 24 '11 at 6:54

Well typical power supply consists of a transformer follower by a Graetz bridge rectifier, a big capacitor and a regulator and components required for it to work. For the safety side, you'll at least want a fuse on the transformer. If you can get a regulator which has current limiting and short-circuit protection, you'd make life much easier for yourself. There are 7805 regulators with that features, like for example L7805AB from STMicroelectronics. Just be sure to read the datasheet of the exact regulator you have and confirm that it has short-circuit protection and thermal overload protection.

When I was building my own "bench" power supply, I had problems finding a nice tutorial. There are power supply schematics on the Internet, but not many gave me explanations I wanted to hear.

In the end, I managed to find some tutorials which explain how each major component of the power supply works made by Youtube user "Afrotechmods".

Here's a tutorial on transformers.
Here's a tutorial on diodes and rectifiers.
Here's a tutorial on regulators.

I haven't been able to find a nice tutorial on safety, so I can't recommend anything.

Also be sure to expect components to fail (even the non-obvious ones, like cables) and know what to do when they do. Having a small fire extinguisher nearby may prove to be useful. It saved me once.

EDIT: This answer from Endolith seems to have a schematic of a complete 7805 based linear power supply, if that's what you're looking for.