USB Mobile Phone Charger Using the L7805 Voltage Regulator

I have a really big problem: my phone needs to be on all day, or at least for 8-10 hours. I own a really old Android phone, and its battery only lasts a few hours at most now. You may be wondering why I don’t just get a new battery and solve all my problems. I have tried three times, and none of the so called “compatible” ones work, but I have another one on the way. In the meantime, I was left with no choice other than to come up with my own solution. So I put to use the L7805 voltage regulator and a 9 V battery. It turned out to be a really fun and enriching little project, and in retrospect, I enjoyed making this infinitely more than I would have by just buying a solution to my problem.


This (for lack of a better term) device will work to power not only a mobile phone, but anything which requires 5V. Of course, it’s pretty easy to swap out the L7805 for any other similar voltage regulator to provide a different output (assuming you have the correct input voltage, and aren’t drawing more power than it is built for). I’ll also explain how voltage regulators work (and their limitations) below, as I enjoy taking every opportunity I can to learn and share.

Resources Required

This device was ultra cheap to make, probably on the order of about 50¢. Here are the components I needed:

  1. L7805/7805 voltage regulator (18¢)
  2. 100 µF electrolytic capacitor (2¢)
  3. 10 µF electrolytic capacitor (2¢)
  4. 1N400x rectifier diode (I used the 1N4001, 1.4¢)
  5. 9 V battery harness (my high school engineering teacher gave me a bag full of them, enough to last many generations)
  6. USB cable (this is phone specific I suppose, but to make it universal, just add a female USB plug instead)

Of course, you need a 9 V battery as well, or similar voltage source – but don’t go too much over 9 V. In fact, I would not recommend over 9 V at all because the L7805 can’t take it without some extra accommodations (i.e. a heatsink), but more on that later. One last note; I used a rechargeable 9 V battery. Right, on to putting it all together.


Take a look at the following circuit diagram, it’s super simple to follow and understand. Notice the diode which ensures current flows in only one direction (we don’t want any mishaps). Of course, diodes do have a drop voltage, but it’s low enough to keep everything working great. Then we have two decoupling capacitors to smooth out the voltage coming in, and going out. Of course, we have the 7805 which regulates the voltage. The IN pin accepts the inward voltage, the GND pin connects to the negative terminal of the voltage source, and OUT delivers the outbound voltage.

circuit diagram

Of course, you can set this up on a solderless breadboard, but it wouldn’t really be portable, right? In any case, I still recommend hooking it up on one, it will only take a minute and you can make sure everything works right before you put it on a PCB or perforated board. I took the latter route after testing it on a solderless breadboard, and used a perforated breadboard (or perfboard for short). Actually, this was the first time I used a perfboard and made any of my circuits “permanent”, so it was extremely exciting.

The problem was, I didn’t know how to set it up on a perfboard. I was used to the freedom of a solderless breadboard, and didn’t know how to setup my circuit with limited real estate, whilst keeping everything functional. I picked up this really cool tip online during my research, where someone wrote that for simple circuit diagrams it is easy to lay it out on a perfboard if you adapt the circuit diagram pictorially. So I did just that, which is why the circuit board ended up being quite linear as per my schematic (above).

DSC01609 DSC01613

The linear look actually runs quite well with the cable. I bent the voltage regulator downwards to maintain as flat a form factor as possible (I admit it’s not ideal for heat dissipation). As this was my first time, the soldering job underneath was not too great, but I think a better soldering iron would help too. I salvaged mine when my engineering teacher was throwing it out. I have been using it for almost 2.5 years now and cannot wait to get my hands on a beautiful temperature controlled one someday. Here is a picture of my perfboard from the bottom, and a shot of my soldering iron’s tip just for fun ;) Yeah, it really isn’t too great, but it’s been through every single one of my projects. EDIT (Jan. 4/13): I recently purchased an Aoyue 936 temperature controlled soldering station!

DSC01611 DSC01612

One last tip regarding soldering on perfboards: don’t cut the leads off the components. Use them as jumpers underneath the board. If you take a look at mine, I didn’t really have to use any extra wires to connect everything. Awesome, let’s take a quick look at how the voltage regulator works, and I’ll see you off.


If you don’t know how a voltage divider circuit works, I suggest checking it out. All it is really is two or more resistors/capacitors/diodes/inductors in series, but the values are adjusted to achieve a specific voltage output. This Wikipedia article explains it quite well. The math behind it is actually quite fun, and the concept in general is very useful. Anyway, a linear voltage regulator is basically a web of voltage dividers which adjust themselves to deliver the specified output voltage, depending on the input voltage. But what happens to the extra voltage? The excess energy has to be released somehow to give us our desired output voltage, and in this case, it is dissipated as heat. And if there is too much of a voltage difference between the input and output voltage, then the energy is released as light. Light? Yep, when the voltage regulator sets on fire, we have heat and light!

So the message here is that we have to be careful, we do not want to feed too much voltage into the regulator, as it will get real hot because it has to work harder to drop an even higher voltage to 5V. For example, I tried it with a 12.5V source, and it was getting way too hot (too hot to touch). Of course, with proper heatsinking, the datasheet indicates that the regulator and gives us up to 1 Amp. If you need more power, a voltage regulator is not for you. Then again, if your device only requires a few milliamps, then you have nothing to worry about. I believe our phones need at least 200 mA, and more than 0.8 W of power is out of spec for the regulator without proper heatsinking. So that means 0.2 A * x = 0.8 W (as per P = VI). That means the maximum voltage drop the regulator can handle at 200 mA is 4 V, so a 9 V battery is borderline based on our rudimentary calculations. My regulator hooked up to 9V does get a little warm, but that’s expected.

Sure this gadget may look a little geeky, but what can you do? Anyway, that’s all folks, until next time! Keep those phones charged!


Posted in Projects
17 comments on “USB Mobile Phone Charger Using the L7805 Voltage Regulator
  1. Jesse says:

    Love the Guide very cool. If i was going to salvage parts from leftover used items do you know how to test them as not to waste time and or get discuraged?

    • Thanks for your comment Jesse.

      Salvaging components is great fun. You often find really unique and valuable things, and you never know when they may come in handy. The first thing to do is to identify what it is (if you don’t know). I’ve stopped salvaging RLC (resistors, inductors, capacitors) components, mostly because they are so, so cheap to buy online.

      ICs can be hard to extract, and even harder to verify if they work. I generally don’t salvage ICs either, because they are usually designed specifically for the product they are connected to, and may not be of much use to me. Plus, interfacing with a component that you have no information about can be tricky.

      So what I would recommend is that for a component you think is interesting, take it out, and look up the datasheet for it. Datasheets can be a bit cryptic to beginners, so you can always ask for help. A great place to ask such questions is You can always message me too, and I can try to help.

      So a datasheet will give you a good idea about what the component is, and how it should work. You can also do a raw Google search for the component, and see if others have done anything interesting with it. It could inspire you to use it in a similar manner.

      Mechanical components like motors are really great things to salvage. They are almost always useful. If there are any pieces attached to mechanical systems (belts, rods, pulleys, etc.) take those too. Usually they are designed specifically to work perfectly together, so when you use them elsewhere, you don’t have to hunt down compatible components.

      And don’t forget that your time is valuable. Salvaging RLC components, LEDs, wires, etc. for the most part are not worth it. You can buy those things extremely cheap. One of me favorite shops is If you spend ~$50, you can have an entire tool chest full hundreds to thousands of awesome and essential components for any project.

      One last tip: don’t forget that you can contact companies, tell them about your project, and request samples. They are very helpful, and want you to try their stuff. Just don’t abuse the system; request things you need. Adafruit has a great page on where to get samples

      Have fun!

  2. Darrel Trinca says:

    Most important thing to be kept in mind when working with soldering iron is not to touch the tip of the iron as it is extremely hot. Soldering material used for the purpose is an alloy of tin and lead and is called flux. Before you put solder over the required area, heat up the surface to be soldered by touching the tip of the hot iron. Application of the solder is called “tinning”since percentage of tin is more in the flux. However, flux can be of various types depending upon the things to be soldered. :

    Our new internet page

    • I have touched it a few times. It is certainly not the most pleasant experience. But over the years, I have gotten pretty good at soldering (which I only realize after getting the new station). Now that I have an amazing solder station, soldering has literally become a breeze. I finish my projects in 10% of the time it used to take, and they look so much cleaner. A good solder station is very helpful, but practice and patience is critical. Thanks for the soldering tips. Tinning is very helpful.

      I will be getting a hot air station soon.

  3. Dane says:

    This is such an awesome project! My only complaint is that no one ever list the voltage of the 10uf and 100uf. Is this a secret or is there something that I am missing?



    • Treehouse Projects says:


      Thanks for the comment.

      Your question is totally valid, and I think the answer is that it depends. Usually these capacitors handle 25+ volts by default – I think you’d be hard pressed to find something rated at like 5 or 10 volts – if they even exist.

      The point is, for a project like this where the voltages being used are relatively low in comparison to ratings for commonly available capacitors, it does not seem necessary to mention what you requested.

      Though, from now on, I will try to include this information in all future posts.

      Voltage ratings are definitely mentioned when you are working with high voltages.

      Thanks, Dane.

  4. Dane says:

    Sorry, but I should have addressed this in my last question. =o) What about A23 batteries? 12V X 2 = 24V with some resistance added? I guess I am a bit confused considering the 7805 can handle up to 35V and you will need more than 6V input in order for this regulator to run smoothly as well as correctly. I am not necessarily looking for the more power, I am looking for longevity.

    The iPhone 5 uses a lot of power during charge and it diminishes the 9v battery on the first charge.

    Then again, a lot of these devices are made to boost and anyone building such a device should not be look to charge their device to its full potential.

    Any input?

    Thanks again,

    Dane =o)

    • Treehouse Projects says:

      Hey Dane!

      You’re absolutely right, 9V batteries are really lousy for this. Although I ended up getting a new battery for my phone, I realized later on that if I were to make something like this again, I’d use a Lithium Polymer Pack (LiPos). I am not sure what possessed me to use a 9V actually, but it’s nice because they are certainly more common for most people.

      Now, back to your question: I wouldn’t recommend the A23 for the same reason as that stated above – they won’t last long. You’ll burn through these batteries really fast and it’ll cost you a lot of money. You don’t really need a resistor, because as you mentioned, the 7805 can handle up to 35V. It’ll drop the 12V down to 5V on it’s own.

      The only caveat with using something of higher voltage is that a lot of power is wasted in the form of heat. So if you’re stepping down 12V to 5V with the 7805, you’re wasting 7V * (the amount of current your phone is drawing) of power as heat. That’s why a 9V was a little bit better.

      So in conclusion, yes you can use the A23 (resistor not needed). Would I recommend it for charging your phone fully? No. It won’t provide you with any longevity really, will cost a lot, and will waste a lot of power. I made this device for emergency purposes, not to run full blown charges (as you mentioned, these devices are used as “boosts”). Additionally, the 9V I was using was rechargeable, so I wasn’t going to waste a lot of money and resources burning through batteries.

      If you really want to make a charger that’ll last, try using LiPos. They’re very very common, dirt cheap, high capacity (therefore, will last longer), rechargeable (charge very fast), and very small.

      I hope that helps. Don’t hesitate to contact me if you have any more questions!

  5. Tamojit says:

    i cant charge apple ipod with this circuit…nor its charging my phone(samsung galaxy s)..pls help..

    • Treehouse Projects says:

      Those phones (well, at least the iPod) charge in very different ways. Typically the companies only want their chargers to sell, and equip their chargers with proprietary technology to prevent anyone from making chargers that work. Obviously, there are tonnes of third party chargers on the market.

      Bottom line, this project will not work for your iPod.

  6. gauresh says:

    What is perfect value of cacapacitors 100 u f & 10 u f what is volt value both cap. …?

    • Treehouse Projects says:

      Any voltage above say 10V should be just fine. This is a low voltage set up, so you won’t hit anywhere near the voltages that max out on traditional electrolytic capacitors.

  7. vignesh says:

    its so nice.due to this using this charger to mobile any problems will occur to battery or mobile…?

  8. tarun says:

    can you please tell me that which type of batter should i use???

    • Treehouse Projects says:

      Well, when I wrote this tutorial, I used a 9V. That was before I had learned about LiPo batteries, and better power management circuits. I would really recommend using a 9V for this now. Maybe a 2 cell rechargeable LiPo would be more suitable.

Leave a Reply to Treehouse Projects Cancel reply

Your email address will not be published. Required fields are marked *