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.
Input voltage range between 8V and 35V @ 500mA or greater
Able to accept voltage input from many different sources (i.e. batteries, wall warts, solar panels, ect.)
Support the USB spec for powering devices (5V @ +/-500mA)
Small form factor so it could be easily used anywhere.
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 Upverter.com