This power supply circuit is easy to build and cheap. And it requires only 5 components.
I have built many circuits in my life, but this is actually the first time I’ve built a power supply circuit from scratch.
The final project I wanted to build was a wall adapter with a USB socket to charge my iPhone. But first I wanted to start by creating a simple circuit that converts from the main power voltage, 220V or 110V, to 5V.
As I’m in Australia while writing this, and the voltage here is 220V, I built this with 220V in mind. But it’s very easy to convert to 110V instead by switching one connection (or one component).
Caution: Do NOT connect anything you make yourself to the power mains if you are not 100% sure about what you are doing. Doing it wrong can cause serious damage, even death. Use the information provided here at your own risk.
If you want a perfectly safe and extremely useful power supply circuit, you should check out this portable USB charger that I built. It even includes a downloadable step-by-step tutorial on how to build it yourself.
Designing The Power Supply Circuit
I want to base the power supply circuit around the LM7805 voltage regulator because it’s an easy-to-find chip that is simple to use. This component will give a stable output voltage of 5V up to 1.5 A.
I can easily figure out how to use the LM7805 by looking in its datasheet.
10 Simple Steps to Learn Electronics
Electronics is easy when you know what to focus on and what to ignore. Learn what "the basics" really is and how to learn it fast.
From the datasheet I found this little circuit:
Choosing Capacitor Values
The above image shows the voltage regulator with a 0.33 µF capacitor on the input and a 0.1 µF on the output. It’s hard to find a good source of info on these capacitor values, but according to this Q&A there’s nothing magical about these values.
There are a lot of opinions on the web about these capacitors. Some suggest 0.1 µF capacitors, and others suggest 100 µF capacitors. And some suggest using both a 0.1 µF and a 100 µF capacitor in parallel.
The values you should use depend on a lot of factors. For example how long the wires are going to be. But this article is about how to build a simple power supply circuit, so let’s not complicate things. Probably, almost any capacitor value will work. It will probably even work without capacitors.
For the sake of making the output voltage “a little bit stable”, I’m going to use a 1 µF capacitor on the output. I’ll skip the input capacitor because there will be a capacitor in this position anyway – just keep reading.
Converting From 220V
The datasheet also says that it needs between 7V and 25V to work correctly. So, I only need to add a few components that convert 220V (or 110V) AC to a DC voltage that stays between 7V and 25V.
This is relatively easy. I’ll just add a transformer that transforms the voltage down to for example around 12V. Then I’ll feed this AC voltage into a bridge rectifier to rectify it.
And I’ll use a large capacitor on the output to keep the voltage above the necessary 7V at all times. This capacitor value isn’t critical. I’ve seen many power supply circuit designs that use 470 or 1000 µF, so I’ll try 470 µF for now.
The Power Supply Circuit Diagram
So, the final circuit looks like this:
Parts List
Part | Value | Description |
---|---|---|
T1 | 220V (or 110V) to 12V | Transformer |
DB1 | Diode Bridge Rectifier | |
C1 | 470 µF (20V and upwards) | Capacitor |
C2 | 1 µF (10V and upwards) | Capacitor |
U1 | 7805 | Voltage Regulator |
The total cost of the components is about $12-15. The most expensive component is the transformer (about $10).
Finding Components For The Circuit
When I’m not sure how to choose components for a circuit, I usually go to online electronics stores for hobbyists and look at their options. These stores usually stock components that should work in a standard power supply without any special requirements.
In Australia, Jaycar is a nice option.
A quick search on “transformer” on Jaycar gives me several options. The input voltage needs to be around 220V and the output around 12V. After a quick scan of their options and prices, I decided on this one:
https://www.jaycar.com.au/12-6v-ct-7va-500ma-centre-tapped-type-2853-transformer/p/MM2013
The transformer has a center tap on the output side which I can ignore.
This one is for 220V. If you live in a country with 110V the stores in your country will probably have the correct version for you. Click here to check out my list of online stores.
Then I need a rectifier. We can use 4 power diodes (ex 1N4007), or a bridge rectifier (which is basically four diodes built into one component). The cheapest option that pops up when searching for a bridge rectifier on Jaycar is this one:
https://www.jaycar.com.au/w04-1-5a-400v-bridge-rectifier/p/ZR1304
The Finished Power Supply Circuit
This is an easy circuit to solder onto a prototyping board. Here’s the prototype I built:
Reminder: Do not connect anything you build yourself to the power mains unless you are 100% sure about what you are doing. Use the information provided here at your own risk.
Did You Build It?
Did you build this circuit? What’s your experience? Anything you struggled with? Let me know in the comments below how it went.
More Power Supplies Tutorials
Get Our Basic Electronic Components Guide
Learn how the basic electronic components work so that circuit diagrams will start making sense to you.