Introduction: Universal USB Power Supply Kit

Picture of Universal USB Power Supply Kit
As a hacker and a maker i have many old rechargeable batteries, AC Adapters (wall warts) and other sources of DC power lying around the shop. It occurred to me that most hackers and makers like myself have a hard time throwing out wall warts and good rechargeable batteries.  Since the world is full of USB powered devices and we could all use another USB power supply, i figured it was time to design a simple circuit to make use of all these available power sources. Something that is flexible enough to use an old wall wart, Car charger, laptop battery or solar panel as the need arises.

In this Instrcutable we'll cover:
  • Design Considerations for the circuit and show the resulting schematic
  • The Parts list and give you links to a good parts source and prices. 
  • The PCB Layout and how we will use that layout to build the circuit onto a Breadboard
  • Step by step instructions on placing components onto the breadboard and soldering them into place
  • Using the leads of the components and/or wires to help create the traces and solder them into place.

Step 1: Design Considerations

Picture of Design Considerations
Many wall warts do not output a commonly used voltage rating used by most hackers and makers in there projects. So they can be relatively useless in most cases. Most electronics typically use 5v, 9v, or 12v. But the world is full of odd adapters that use voltages like 8.5v, 10v, 15v and so on. Not to mention you have to be careful about many of those adapters. While they may state one voltage rating on the label there actual output could be higher, even under a load. Making them troublesome in some projects. If you have some solar panels the voltage output can vary throughout the day and depending on weather conditions. Many of the rechargeable batteries i have lying around are from old laptops. They can still hold a charge but the battery packs are rated anywhere between 12v and 18v. With this in mind i had to consider what specs i wanted for this circuit. Here is what i came up with.
  1. Input voltage range between 8V and 35V @ 500mA or greater
  2. Able to accept voltage input from many different sources (i.e. batteries, wall warts, solar panels, ect.)
  3. Support the USB spec for powering devices (5V @ +/-500mA)
  4. Small form factor so it could be easily used anywhere.
  5. Ability to turn it off and on (seams simple enough but i've forgotten to add a power switch to projects in the past, not a very green way to do things)
Obviously we need a voltage regulator that can take the incoming voltage and bring it down to the 5v we need. I chose to use the LM7805 because its a very common and cheap regulator. It can take any voltage between 7.5v and 35v and outputs 5v @ up to 1A. (The data sheet on the part says the minimum is 7.5V but I've used as low as 6V and still got a 5V output.)

To allow for the use of different possible input connectors i considered the typical DC jack but decided in the end a set of screw terminals would be best. So i had to include a protection diode in case people connected there power source backwards. 

I was able to get the PCB layout down to a 1.5"x1.5" form factor. Small enough to fit inside of an Altoids Smalls tin as long as you lay down the Electrolytic capacitor and voltage regulator flat.

On many of today's smart phones and MP3 players the device won't start charging or use the power from USB unless it is receiving a small voltage on the Data + and Data - lines. These devices , such as all Apple iPods and Phones, are looking for 2V on the D+ and about 2.7V on the D- lines. So voltage dividers are needed to accommodate this. As you will see in the schematic R1, R2, and R3 are feeding the D- line. I found the best resistor values for this where 22K ohms on R1 and a total of 26K between R2 and R3. Two resistors are needed here because 26K Ohm resistors are hard to come by. Then we have a 22k Ohm and 15K Ohm feeding D+. Other resistor values can be used as long as the end result is close to 2V on D+ and 2.7V on D-. I've used this arrangement in past projects and know it works so i'm sticking with it for now. I've tried resistor values under 10K ohms and they don't work. So if you decide to go with a different voltage divider setup make sure the values are greater then 10K ohms. 

Here is the Rev 1 Schematic thanks to


Step 2: Parts List

Picture of Parts List
Note: A full parts list is attached to this page. Listing the part, manufacture, part number, link to, quantity and price (as of the publishing of this Instructable).

Parts List:
  • 1x 15k ohm resistor $0.07
  • 1x 100 ohm resistor $0.07
  • 2x 22K ohm resistor $0.07
  • 1x 6k ohm resistor $0.13
  • 1x 20k ohm resistor $0.07
  • 1x SPST slider Switch $1.37
  • 1x Fixed Terminal Block $0.54
  • 1x USB Type A Connector $0.52
  • 1x 0.1 uF Multilayer Ceramic Capacitor $0.16
  • 1x 1.0 uF Aluminum Electrolytic Capacitor $0.32
  • 1x 5mm Red LED $0.59
  • 1x LM7805 Voltage Regulator $0.50
  • 1x 1N4004 Diode $0.09
  • PCB or Breadboard ($2.19 for a 2 breadboard set at Radio Shack)

Total cost in parts is less then $7 before cost of shipping is added. Making this the most versatile and affordable USB power supply you can find. Its small size allows it to be a lightweight backpack to turn any 8v or larger battery pack into an extended life battery pack for your mobile devices. It also allows you to make use of almost any would be useless wall wart you have lying around.

If you spend another $5 you can get a nice little 8x AA Battery holder and 9V snap connector and have a good 9V power pack for any USB device. Then you have the option of using regular AA batteries or rechargeable AA batteries.

Step 3: Board Layout.

Picture of Board Layout.

The most challenging part of all this wasn't creating the schematic and deciding what parts to us. The challenge was in laying everything out on a PCB. This was further complicated by the need to create a single sided PCB layout so anyone could build this on a  perforated board/ peg board/ breadboard (for the sake of this istructable we'll call it a breadboard). If i had done a two sided PCB then routing the traces wouldn't be an issue on such a basic circuit like this. In the end i played around with a couple of revisions to the layouts of the components before settling on Rev 2. Rev 1 was laid out in, what seemed to be, the easiest way i could lay it out and run the traces. With little consideration on how the user will interact with the board. On Rev 2 i decided i needed to focus more on how the user will handle it so i focused the part arrangement on placing key items like the terminal block, USB connector and power switch. I also thought it would be nicer to have the LED indicator in the middle of the board. 

With a breadboard layout in mind i have included a PDF file of Rev 2's PCB layout without the copper fill. I picked up a Dual Mini Board Breadboard from Radio Shack for about $2.19. This Breadboard is just slightly bigger then my PCB layout. Best of all the PCB layout lines up to the grid of the Breadboard. So you'll be able to print off the PDF of the PCB layout below and overlay it onto the Breadboard.

Now to get things pieced together.

Once you print the layout cut it down to size and tape it to the side of the board without copper pads. Line up the bottom right corner of the layout with the bottom right corner of the board. Hold the board and layout up to the light so you can see through the paper where the holes are and get everything lined up. To help ensure the holes all line up take one of the components and use it to punch all the component holes out. If things are not quite matching up then make adjustments as needed. 

For the most part you will be able to solder the components together similar to the PCB layout but there will be some sections where you may have to make adjustments. We'll get to that in the next steps. I'll break the assembly down into several steps to help insure you get everything plugged into the right places and soldered together.

I've included the PCB files for Rev 2 below in extended Gerber, PDF , and Eagle CAD files if you want to try etching your own board. I've also included a Fritzing file of the REV 1 Board which has a simple prototyping breadboard layout if you want to prototype it before putting everything onto a PCB or peg board.  The finished board is only 40mm x 40mm. As you can see there is still a good bit of open space on the board. It can be made much smaller for final PCB production. I did consider having the resisters mounted on end to help shrink things down a little more. But we don't want to make things too small otherwise it becomes difficult for the hobbyist to assemble.  I hope to get money together and have a small production run of boards made in the near future. I may get through a couple more of revisions before that happens.

Step 4: Tools Needed

Picture of Tools Needed
Before we start piecing this together lets gather the tools we'll need for this.

  • Soldering iron
  • Solder
  • Needle nose pliers
  • Wire cutters
  • Wire strippers (if you plan to use wire to make the traces)
  • Helping hand/PCB clamp
  • Small flat head screwdriver or Probe
  • Solder braid/pump/bulb
  • Magnifying glass
Most of these tools are self explanatory. Of course you need a soldering iron and solder to put the kit together. You'll need a small flat head screwdriver or probe to help break any unwanted solder bridges. You can very easily bridge contacts unintentionally while soldering the traces. especially when you have traces that will be very close together like the ones around the Voltage regulator. The magnifying glass will come in real handy inspecting your work and ensuring there are no unwanted solder bridges.

Step 5: Placing the Resistors

Picture of Placing the Resistors

We'll start on the left hand side and work our way across and down. The resistor leads need to be bent right at the edge of the resistor to fit in the holes. Place the resistors in there designated spot referring to the reference diagram above as needed. The resistors in the diagram are clearly labeled. The resistors them self are also clearly marked in one form or another. The 22K and 15K use the resistor color codes. All the rest have there values printed on them.  With the exception of the 6K which has a larger physical size then the rest, making it easy to pick out.

Bend the leads of the resistors out so they will not fall out when you turn the board over to solder them into place. When working with breadboard like this i like to use the leads of the components to link the traces from one component to another. So bending you leads in the direction of the nearest component they will be linked to is a good idea.

With the resistors in place flip the board over and solder them in place. Don't worry about soldering the ends of the leads down as traces until we get all the components in place. But go ahead and use your pliers to bend them around to where they need to go and cut off any access so its out of the way. 

Step 6: Placing Capacitors, LED, and Diode

Picture of Placing Capacitors, LED, and Diode

Now place the capacitors into place. The Electrolytic capacitor goes near the terminal block area and the Ceramic goes near the voltage regulator. Pay attention to the polarity of the Electrolytic capacitor. The silver stripe down the side of the can is the negative side, (its also the side with the shorter lead) and needs to be on the right hand side if your keeping your board oriented in the same way the reference image is. You will need to fully straighten out the leads to fit in the board correctly. 

With the LED and Diode its important to pay attention to which lead is the Anode and which is the Cathode. On the LED one lead is longer then the other indicating the Anode. So your short lead is the cathode and should be on the right hand side of the board. The Diode's cathode is indicated with a white line around one end of it. That line should be facing towards the left side of the board.

Like before bend the lead out a bit in the direction they need to go. Flip the board over and solder the leads into place. Then rout the leads and trim as needed. 

Step 7: Placing the Voltage Regulator and Switch

Picture of Placing the Voltage Regulator and Switch

Now we will place the voltage regulator and switch in place. Check the reference images and make sure you place the voltage regulator in the right orientation. You'll be able to bend the leads of the regulator a bit but not enough to use them as a trace. So just bend them enough that it stays in place. The leads of the switch are spread out a bit wider then then holes on the breadboard. So you'll need to bend them in ever so slightly to get it to fit. Like the regulator the leads on the switch are not long enough to use as traces and you might not be able to bend them over at all to help hold the switch in place. Chances are the friction of the leads in the holes will hold it for you.

Flip the board and solder the 2 components.

Step 8: Placing the Connectors

Picture of Placing the Connectors

Now its time to get the terminal block and USB connector in place.

Make sure the openings of the terminal block faces out. The terminal block has a couple of plastic legs sticking out just in front of the leads. You can choose to clip these off or widen the holes in the board with a 1/16" drill bit. I suggest widening the holes since they are good for keeping the terminal block in place.

As for the USB connector you'll have to do some added work here. There are 2 clips on either side of the connector. You will need to enlarge the the holes on the board (designated as GND on the reference image above) with a 5/64" drill bit so the clips can snap into the board.

Like the switch the terminal block and USB connector leads will not be long enough to bend over and use as traces but friction should hold both part in place till you solder them. Solder everything in place.

Step 9: Soldering the Traces

Picture of Soldering the Traces

Now starting with one component at a time start bending the leads the rest of the way over to make contact with the components they need to link too. Where you don't have leads to help make your trace start creating solder bridges across the copper pads to the component. It may be a good idea to take some scrap wire and strip it bear to use as a trace from one component to the next. If you don't like the look of solder bridges on a breadboard then use bits of wire to go directly from 1 component to the next.

Take your time and do one trace at a time. Like they always say "measure twice and cut once". In this case check and verify the trace placement twice and solder once. 

Step 10: Conclusion

Picture of Conclusion
There you have it. A Universal USB Power Supply. Able to use any DC power source between 8V and 35V.

NOTE: Its important to note that any voltage input above 12V will REQUIRE a heat sync on the voltage regulator.  Even with only 9V input with a 700mA output i measure 180 degrees from the regulator. If you plan to mount this into a mint tin the body of the tin can be used as the heat sync.

NOTE: When connecting a power source be aware of the polarities as you connect it. If you get the polarities reversed nothing will happen due to the protection diode. So if you get everything connected and the circuit won't turn on then flip the wires around and try again. Remember the screw terminal towards the outside of the board is the ground and the one towards the middle of the board is positive. You may want to mark the polarities on your board.

As mentioned earlier this is the Rev 2 design and future revisions are in the works. I may explore a couple more layout options before moving onto some of the other ideas i have in mind for future revisions. I've included Revision 3 of the PCB layout below. It puts the Power supply within the typical dimensions of a USB thumb drive. The board layout is about 19mm X 56mm.

Plans for future revisions:
  • Ability to use both AC and DC voltages
  • Remove the need to worry about polarity of the power source being used.
  • Dual regulators or change in regulators to allow up to 2A to the USB connector to fulfill the power needs of iPad
  • Ability to toggle between 1A and 2A of available current for better efficiency.
  • Ability to have a single PCB that is scale able for different version of the kit. (i.e. 1 USB connector with 1A output, 2 or 3 USB connectors with 2A output)
The first two can be resolved by swapping one component out. Just a matter of finding the best one for my needs. Here is what a future revision schematic may look like when i'm ready to implement all of the above mentioned changes. Thanks to our friends at the schematic below will update as changes are made to it. 

Yes i'm aware that a pair of 7805's in parallel may not be the best solution for achieving up to 2A of available current. Not to mention the total amount of heat that will be generated by both regulators outputting 1A. Other options are being considered.


MattS401 (author)2017-04-20

how exactly does it work?

mpilchfamily (author)MattS4012017-04-20

Electrons go in one end and come out the other. ;)

MattS401 (author)2017-04-20

actually never mind i found where you say that in the article. sorry for needlessly spaming

MattS401 (author)2017-04-20

i'm doing this for a school project and i realy am relatively new to this whole thing

kagazwala (author)2014-09-02

I am a newbie in electronics just doing it as hobby I find this project interestiing to do. But I want to place four(4) usb charging hubs how do i modify to do so

mpilchfamily (author)kagazwala2014-09-03

This designs is good for about 2 USB devices. Most only require about 400mA to charge and of course this design only supports up to 1A. You can add a second 7805 in parallel with the first to increase the available amperage and support up to 4 devices at once. Just keep in mind the power source you use will also need to support 2A or more.

So to Parallel the 7805 I would just solder the same pins on both of the regulators together?

To add the second USB device would I just stack the second USB on top of the first and solder all of the leads together? Or would I have to do some extra modification for this?

Yes stack them and wire it all in Parallel.

kagazwala (author)mpilchfamily2014-09-03

sorry for being naive but can you tell me this through a diagram or so....

mpilchfamily (author)kagazwala2014-09-03

Basically you plug another 7805 voltage regulator in the same holes as the first. Then a USB connector with 4 connections in a single part and your all set.

8ByteRemmargorp (author)2016-02-22

I was going to need even more than the two amp power supply, would it be safe if I were to add a third 7805 in parallel to get a third amp coming from the power supply, and if so, what would be the limit? I have a bunch of spare Lithium Ion batteries that came from laptop batteries so the battery supply is not an issue

Parallel as many regulators as you want. Just make sure the wires and traces your using can handle the amperage.

I'm sorry to be a noob, I just got into electronics not too long ago but what do you mean by traces?

If your using a PCB the copper lines are traces.

My Last Question is if I were to have a 3 amp power supply and plugged in a device that only required 100 ma would it fry it or present any danger to it? Or isonly the amount of amperage that is needed pulled from the circuit to the device?

In electronics amperage is pulled from the power source not pushed out by the power source. Circuits draw only what they need.

Thanks for being so helpful by the way.

ssingh163 (author)2015-01-22

I use 7805 votage regulater 2 100 ohm resistor to d+ or d- 8 aa rechargable cell 4 cell hav 1000 mah so 8 cell have 2000 mah but prblm is tht my iphone shw charging but not increase the battery persentage it decreased after few sec n min plz help me i use 2 cell holder 1 holder capacity is 4 cell i use cell series or parralel but not working

mpilchfamily (author)ssingh1632015-02-03

If you are using the phone while it's connected then it may be using he power faster than the batteries can charge.

First thing you need to understand is the 7805 needs at least 7.5V going into it to produce 5V. Anything less will not work and not properly charge a device. You also need to understand how series and parallel works. 8 AA batteries in Series will output 12V. If each battery has a capacity of 1000mAh then the whole series bank will have a capacity of 1000mAh. If you wire those 8 batteries in parallel the output voltage will be only 1.5V but will have a capacity of 8000mAh. If you take your 8 cells and wire one set of 4 in series and the other set of 4 in series then wire both sets in parallel you'll have a battery pack that outputs 6V with a capacity of 2000mAh. Keep in mind the mAh rating is the amount of current the batteries can supply for about 20 hours straight.

Isaac_Gukas (author)mpilchfamily2016-02-01

Hey, about the voltage regulator.. I'm a bit of a newbie at this. Will it defnitely work with a 6V input because that's all I can manage right now with what I have. (I know you said it works fine with 6v I'm just checking).

mpilchfamily (author)Isaac_Gukas2016-02-01

The regulator will output a little less than 5V with only 6V being fed into it. It may still work for some applications but the regulator needs a good 7.5V in to output a good and steady 5V.

rafalikezombies (author)2015-04-21

So hey, one question, this as it's done can only send 1A to the phone? I didn't quite get it how to make a 2A one :/

BobK5 (author)rafalikezombies2015-06-01

Instead of LM7805, you should use L78S05. It can deliver 5V 2.0A output. The circuit designed using L78S05 is also similar.

BobK5 (author)2015-06-01

In most of the mobile phone chargers the D+ and D- are shorted together. If D+ and D- are shorted phone thinks it is battery charger. If you supply some voltage on on D+ and D-, then phone thinks it is connected to USB port of PC.

MarkM17 made it! (author)2015-03-14

Hi, Thank yo very much for this Instructable , I am a newbie and found the instruction great. Works with no problems. Tested on several phones & tablets. Tested with 12v/7ah battery and with 10W Solar panel.Again Thank you. (P.S. In the pic i did accidently zap the diode but have replaced it )

Mitchel.Booker (author)2015-02-28

Thank you for this Instructable! And thank you for all your replies to the questions!

mathewriver (author)2015-02-03

If I step down the voltage to 3,7 v, 500ma, can I use this circuit as a 18650 batteries charger? Will it cut the voltage once the battery is fully charged?

mpilchfamily (author)mathewriver2015-02-03

This is not a charge controller. It only provides a regulated 5V power source from a higher voltage input. If you want to charge a set of batteries you'll need a charge controller. This circuit charges a USB device like a phone because the charge controler is built into the device.

drewb2 (author)2014-12-13

I'm planning to use this for my project. I need a USB charger that can produce 6v-12v input and 5v 2A output. How can i raise the ampere to 2A? and can i use this as a smartphone charger? Thank you.

mpilchfamily (author)drewb22014-12-14

Place a second 7805 in parallel with the first. Though you need at least 7.5V input for the 7805 to give you a full 5V output.

Wired_Mist (author)2014-11-15

I really like that technique of gluing the schematic to the PCB; I hope you have a nice case made for that !

HavocRC (author)2013-05-10

I really like how you put the paper circuit down first. Can you give me the Eagle dimensions please?

mpilchfamily (author)HavocRC2013-05-10

To do that i would have to recreate the schematic in Eagle. You'll need to get the size and spacing of the perf board you want to use and set your spacings accordingly in Eagle. It's much easier if you download Fritzing and use the file i have in step 3. You'll find Fritizing a very helpful app when dealing with some basic electronics and interfacing with an Arduino.

wz-ski (author)2013-04-19

Have you made the device that can use a AC wall wart yet? I think that you need to add some diodes or something.

mpilchfamily (author)wz-ski2013-04-19

Just follow the schematic in step 10. It's just placing a bridge rectifier between the input from the wall wart and the rest of the circuit.

eyu2 (author)2013-03-04

Hey. Thanks for this. I am planning on using a LiPo battery as the source with it outputting 15.3V. Do you think this circuit would be enough to output 5V and up to 1.5 mA? And yes a heatsink will be used. I'm worried about any capacitors failing because of the high voltage.

mpilchfamily (author)eyu22013-03-04

Look at the specs of the 7805. It can only offer a max of 1A as long as the supply is offering enough power to support it. If you are pulling a full 1A from it you will need a good heat sync and possibly a fan to keep the regulator cool . You can add a second 7805 in parallel with the first to get up to 2A from the circuit. But the supply needs to be able to support 2A or more. Otherwise you'll burn out the supply. Make sure the battery you use can support a consistent drain of 1.5A if that is what your circuit needs. If not it can overheat and possibly explode on you. At the very least the battery will drain quite fast.

Sargebubbles26 (author)2013-01-31

You should put it in an altoids tin now for portablity :D

Left this open so you can put it in any housing you would like.

mrinsj (author)2012-11-15

Just found this article. This is great. Thanks. I have a couple of questions if someone can help answer.
1. What is the purpose of C1 and C2? Is it required by the user manual for LM7805?
2. From the same power source if I want a 1A USB and a 2A USB, should I duplicate the whole circuit and in one instance use LM7805 and in the other use an LM338? Or just one LM338 with 2 USB output circuits? And how will I ensure one USB has 1A and the other has 2A?

Thanks in advance for any help.

mpilchfamily (author)mrinsj2012-11-16

The capacitors are there to help smooth the voltage. The output voltage of the wall adapters may have a little 'noise' on the line from the AC to DC conversion. The capacitor on the output of the 7805 is there to help smooth any 'noise' in the line after passing through the voltage regulator. The capacitors are not needed but not having them may effect the operation of some more sensitive circuits.

There are multiple ways to get more amperage out of the circuit. An LM338 is a great option since it can offer up to 5A so long as the input voltage to the regulator is capable of offering more than 5A. You would only need to use 1 of them and it can replace the LM7805 in this circuit. Then you can put 2 or more USB jacks on the circuit. You don't need to worry about limiting the max current to 1A or 2A. Devices will pull the amperage they need so long as it doesn't exceed the output of the regulator. So you only have to worry about how many items you plug into the circuit so you don't exceed the 5A limit of the regulator or the limit of the wall adapter, whichever comes first.

mrinsj (author)mpilchfamily2012-11-16

Thanks for the explanation. I'll try it out.

mdog93 (author)2012-07-13

Could a lm317 be used in the lm7805's place here?

mpilchfamily (author)mdog932012-07-13

Yes. Any voltage regulator you have that will output 5V will work. But you will need to add some additional components along with the LM317 so it will output 5V. Just refer to the LM317 data sheet for how to accomplish that.

mdog93 (author)mpilchfamily2012-07-13

Cool, I bought some of those as I though I would need them. Alas I did not and I can use them for an overflow project with no further expense :) such is the beauty of buying 'extras' when placing a large order online... anyway I digress.

Good instructable, and thanks for replying so fast.

Rene Artois (author)2012-07-01

I like your instructable.

Instead of using multiple 7805 you may use LM338. It hadles up to 5 A.

mpilchfamily (author)Rene Artois2012-07-01

Thanks that helps out allot!

huck alexander (author)2012-06-17

This a great idea! I think I'll make a few for gifts. Perhaps most sane people don't have as large a box as I do filled with adapters, but everyone I know has one or two that doesn't seem to work with anything.

Thanks for sharing this. I love it!

tridecagon (author)2012-05-16

"So i had to include a protection diode in case people connected there power source backwards."

You could've used a bridge rectifier. That way, no matter how you connect the power supply, the thing would still work.

About This Instructable




Bio: I'm a jack of all trades and a master of none. I like to tweak, mod and improvise whenever possible!
More by mpilchfamily:FidgSpin, the Transforming Fidget SpinnerWeighted Companion Cube Fidget SpinnerMagLev 608 Bearing Replacement
Add instructable to: