Let’s make a cheap +5V power supply

In this tutorial we make a simple 5V DC power supply from initial idea to finished product. This is not an exercise in making a flash power supply, just solving a problem with the parts at hand.

Updated 18/03/2013

When writing my Arduino tutorials, or generally experimenting with the breadboards – and more often both – I have needed 5V DC to power something, or in the case of working with two Arduinos at once, having to run USB cables all around the place just to power them. Some may say “Oh, just get another couple of wall warts/plug packs”. True, but good ones are over Au$20 here… and buying cheap ones have not been so successful in the past. However, I do have a collection of odd-voltage plug packs from old cordless phones and so on.. 12V AC, 15V DC etc.

So while at my desk I thought “How can I combine my need for 5V, my cheapness and use one of these plugpacks?”. Easy!

After perusing my stock database it turned out that all the parts were already around me to make a simple 5V supply using an LM7805 voltage regulator. It is quite versatile, can accept voltages up to 35V, and I have some in the drawer. Here is the data sheet: LM7805.pdf.

One should keep in mind the possible current draw from the device this is powering. The LM7805 is good for one amp, so if you’re going to milk it to the limit, your power supply should be good for around 1.5A.

Following this it occurred to me that it would be nice to not have to worry about the type of current from the plug pack – AC or DC. So my circuit needs a bridge rectifier. That can be made with four 1N4004 diodes. And it would be nice to have a power-on indicator that isn’t a tiny speck of light. Thankfully I bought some 20 mm red LEDs when element14 had a crazy sale. Perfect.

And finally, a nice enclosure. Or anything really, to hold it all together. A small semi-opaque jiffy box was hiding in the cupboard with some veroboard, so they will be used. How? Here is my schematic:

schematicsmall

Oh – the resistor is 560 ohms. And here are the participants in this project:

partssmall1

The black stuff at the top-right is heatshrink. The next though was how to mount the board in the box – I don’t have any standoffs, but the box does have some slots to hold the board. So this tells me how much space there is to use on the board, as I will trim it down to fit the space available:

boxsmall

But before hacking things up with the tinsnips, it pays to see if your circuit will actually fit in the board space available. (However my circuit was quite small, so I knew it would fit). This can be done by laying out your parts on a sheet of paper that has a grid of dots at 2.54mm intervals. Next was to measure the internal dimensions of the box in order to cut the veroboard. Then out with the tinsnips and chop chop chop. When using tinsnips or a saw of some sort, try and cut a little outside of the line – as the PCB material does flex a little .This means that you may lose 2~3 mm at the edges, so make allowances for that.

Moving on, I now have the board sized for the box and can start component placement:

pcbinboxsmall

The parts just fit in together nicely. I will have to drill the holes for the 7805 regulator so it can fit, however it doesn’t really leave room for the 0.1uF capacitor. However it is not really necessary, the output will be ok without it. The leads from the power socket, and to the switch and output lead will feed from the bottom of the PCB:

layout1

Now for one final visual check, and then to solder in the components. After doing so, then it was time to put the link in and cut the tracks. I use a sanding bit on the drill to cut the tracks, completely removing the copper:

lay2small

After cutting the tracks on the solder side, it was a good time to use the continuity function of the multimeter to check for shorts between tracks and other errors. The soldering proved to be fine, and the track cuts worked. Now it was time to position the DC socket and switch in order to wire them in, then drill their holes. The output wire is to come out of the top:

almostsmall

Now all there is to do is solder the connecting wires from the DC socket to the rear of the circuit board, and the output wire via the switch. At this point the unit was also tested. Naturally my eyesight had failed me and a short had appeared. However it was sorted out with the solder sucker:

smallaalmost

Notice how I tied a knot in the output lead before it passes through the lid – this is to stop accidental damage to the board caused by someone pulling the wire out. Here is the finished product, with a nice red glow for a power-available indicator:

finishedssss

Hooray – finished. What else was there to do on a Tuesday night? The LED indicates power is supplied to the box, and the switch just controls the load. Not too happy about that 5.05V reading… but then again, that meter was somewhat inexpensive. Now let’s have a look at the CRO and look for any ripple from the supply:

crosmall

The display was set to 50 millivolts per vertical division – and still a nice solid line. Considering the cost of the power supply, that’s not too bad. And we didn’t need the extra smoothing capacitor after all.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The following two tabs change content below.

John Boxall

Founder, owner and managing editor of tronixstuff.com.

8 Responses to “Let’s make a cheap +5V power supply”

  1. Tracy says:

    Cool stuff, thanks for your blog. I enjoy electronics as well and it is fun to see other people with the same passion. So often with electronics when I try to speak to my friends their eyes just kinda glaze over and you can see their minds drift of, lol.

    • John Boxall says:

      Hello Tracy.
      Thanks for your comment – I agree completely. My flatmates think I am totally crazy, or plotting some sort of nefarious activities. Maybe a little of both! Mate there are more of us out there than we realise, so just have fun and tell the world.
      Cheers
      John

  2. bahri says:

    hi,
    thank you for everything you share with us.
    they are really helpful ve useful stuff and information for me.

  3. what about the transformer?

  4. Fernando Lopez Jr. says:

    What i meant is that you don’t give that much information about the “plug pack”… you don’t give any specs about it… btw, i would use bigger caps… great post =)

    • John Boxall says:

      “After perusing my stock database it turned out that all the parts were already around me to make a simple 5V supply using an LM7805 voltage regulator. It is quite versatile, can accept voltages up to 35V, and I have some in the drawer. Here is the data sheet: LM7805.pdf. One should keep in mind the possible current draw from the device this is powering. The LM7805 is good for one amp, so if you’re going to milk it to the limit, your power supply should be good for around 1.5A.”

      Up to 35V at 1.5A

Trackbacks/Pingbacks


Leave a Reply

Receive notifications of new posts by email.

Arduino Tutorials

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: