A 5c lithium ion battery charger

5cCharger (1)

Nerd Ralph writes:

As various sites explain, lithium-ion rechargeable batteries should be charged to 4.2 volts. USB ports provide 5V, so all I needed was a way to drop 5V down to 4.2 or less. Standard diodes have a voltage drop of 0.6 to 1.0 volts, so I pulled up the datasheet for a 1n4148, and looked at the I-V curve
A standard USB port should provide up to 500mA of current, enough for charging a small camera battery. A fully-discharged li-ion battery is 3V, and will climb to 3.8V within minutes of the start of charging. Line 2 in the graph indicates a 1.2V drop at 350mA of current. Under load the voltage output of a USB port will drop a bit, so with 4.9V from the USB port and 3.8V drop at the battery, the charging current will be around 250mA (where 1.1V intersects line 2). Looking at the numbers, a single 1n4148 diode would work as a battery charge controller.

Join the Conversation


  1. Probably you should also post a link to a youtube video showing how violently lithium-ion batteries can explode if charged incorrectly :-)

    1. I think that will be the follow-up to this howto. This is a good way to build a firebomb, not a battery charger.

      What about overcharging the battery? And soldering to the battery tabs?! While the tabs are connected to the protection circuitry and not to the cell directly, you don’t want heat anywhere close to the cell.

      A proper charging IC costs only a little more than the diode and will save you from burning your house down when the battery finally blows up.

      1. Doh, I didn’t notice that you are the actual author of the article and the circuit presented.

        Please, for your own sake, do yourself a big favor and educated yourself on how to properly charge these batteries before you – or someone else – gets hurt.

  2. Kids, please do not try this at home. Especially dangerous is trying to charge a depleted battery rapidly to 3.8V (as the article implies). Lithium battery fires are awesome and people can get hurt. Please do not proceed with charging experimentation unless and until becoming familiar with the details and dangers that lurk within. Learn how to properly CC-CV (constant current – constant voltage) charging with prequalification. Please read upon proper procedures described in data sheets for Li battery charging ICs. Favorite: http://www.linear.com

    1. Must support the comments so far. Charger ICs set their end voltage to 1% or better, with good reason. Anything above 4.20V is DANGEROUS. If it doesn’t blow up the first time, doesn’t mean the thing is undamaged and so it might blow your thighs off later. Someone at DP, please EDIT the blog and add some commentary. Please, no more blog entries about crazy battery charger projects. Anyone who wants to do crazy battery chargers, just please do it with SLAs which will stand a lot of abuse.

    2. Oldtimer, you’re spreading FUD. What lithium batteries are dangerous to charge at <=0.5C? The battery I was charging is rated 650mAh, so charging at 250-300 is below 0.5C. The cell never even got warm, so the "dangers" seem to be all in your head.
      Old LiMn2O4 batteries increase in voltage quicker than LiCoO2 when charged at the same current.

      LiFePO4 batteries can even be charged at over 1C without overheating.

      1. Ralph, the problem is NOT the charging current but the fact that there is no cutoff circuitry detecting the end of the charging. The battery will blow up if you overcharge it and that is bound to happen sooner or later with that simple circuit.

      2. Ralph, stuff happens. I saw a spectacular Li fire due to overcharge. Then see the publicised Boeing 787 battery fires. Presumably battery engineers knew what they were doing. Admittedly less damage will happen with a little camera battery and the 5 cent charger. But people will experiment with bigger ones because it is LiPo “and the guy did just that”. Please read up on “qualification charge when the battery is totally depleted.

      3. @Ralph, You are trying to present subjective anecdotal evidence as proof. This makes most DP’s old-timers dismiss your project. It is too bad you don’t see the dangers associated with it.

        Most of us don’t care if you think your project is cool or if you get injured. Unfortunately, being it published in DP blog without warning flags might lead inexperienced hobbyist to think it safe.

      4. I agree with most comments.
        This circuit is really dangerous and should not be published, it’s a tutorial to burn down your house.
        – A USB port is not a proper current source.
        – the 5V USB can go up to 5.25V if it respects the official USB tolerance, and the diode drop is not precise. Add tolerances, and the battery goes kaboom from overcharge.
        – also note that typical battery cells from cell phones mostly do not have an internal protection circuitry, they rely on the phone circuit, so there is no backup.

        This circuit is effectively a time bomb. it will go bad. you just don’t know when.
        Inconscious guy.

  3. The presentation of the project totally makes it a danger to inexperienced hobbyists. I have seen many blog comments here asking for very basic advice on aspects of some of these projects — these people will have no inkling of the risks involved. It may seem that this is an acceptable way of making one’s own charger — this will mislead inexperienced (or worse, young) hobbyists who don’t carefully test. Also, I would rather hobbyists not welcome increased risk of drift in circuit characteristics or changed endpoints due to Vusb differences. A cute trick at most, but not for normal use, and which must have red flags waved all over it.

    Find me an actual EE who will say positive things about this project. My initial reaction is to gasp in horror.

  4. I see from an NXP datasheet that 1N4148 is rated to 200mA with a peak repetitive forward current of 450mA. With some USB ports that are designed for high-current charging, the 1N4148 will be much more stressed than the 250mA (was there an actual measurement?) from the article. Also, are we to rely on the system designer to provide the 500mA limitation? Well, if the diode fails by shorting, then the results won’t be pretty at all… heh heh.

  5. Let’s look at charging from a discharged battery, 3V is given in the article. Assume the USB port is good, it can source 500mA at 4.8V. Then Vdiode=1.8V, which looking at the graph, if the current is not limited by the USB port, it will be about double the max rep forward current. So, with a high-current USB port, the 1N4148 should die pretty quickly.

    Now, if the diode somehow survives the initial surge, and let’s be generous and plug in the values given in the article: Vdiode=1.1V and I=250mA, P=275mW and THEN, look in the data sheet for Rth to ambient, NXP says it’s 350K/W, so we have T=96deg. Assume Tambient=25deg, we now have the junction temperature to be 121 degrees Celsius. Ahem.

    Note that it’s 121 degrees C after the circuit settles down so if you believe the article’s wisdom, then the first few minutes surge would have the diode running at well over 121 degrees C, effectively approaching or exceeding max ratings. So I would expect diode failure, and failure by shorting will lead the lithium battery to… uh, shall we just call it Game Over?

    1. Actually, if the USB port functions to spec and has the 500mA limit working, the USB controller will power down the affected port due to overcurrent protection kicking in. So the “charger” won’t actually work in many cases (especially on laptops – their USB ports can source no more than ~300mA …)

      However, if someone connects this to a 1-2A wall wart used to charge e.g. a large tablet or to a newer USB port that can provide high current they will get maimed and fire started :(

      Ignorant people are the most dangerous :(

      1. Yeah, I know about that, it’s just that I haven’t actually tried to trip a USB port myself on my desktop. ;-) Some mobos I see claims to have individual polyfuses too, and also I haven’t checked the details of other mobos who offer high-current charging on some ports.

      2. I have managed to short on my hub before and had a device overload it as well – if you are lucky and this happens on a hub, either the polyfuse or (on more sophisticated devices) the controller will disable the port, often with a message in the system log.

        If you aren’t lucky and short a port attached directly to the mobo, often the short circuit protection of the PSU kicks in and the whole machine turns off … oops.

        And if you are really really unlucky (poorly designed hub/mobo), then the electronics will fry itself :(

      1. When doing power circuitry, it is customary to check the expected temperature rise (or generally the thermal performance of the system), because datasheets never tell the full story — quite often for power parts you can hit temperature limits before going anywhere near maximum ratings. Being a small signal diode, the temp on a 1N4148 rises very quickly (350K/W junction to ambient) so subjecting it to such stresses as shown means it should not be applied to any kind of normal use. Most actual engineers would derate instead of running parts close to performance limits. Yawn.

    2. So according to you, it’s just a fluke it works for me.

      How about you do some real testing (like I did)? You sound like someone who would have expensive toys like a fast scope. Measure the current & voltage, and watch the temperature of the diode with an infrared camera. Then post your results. Then go back and look at the datasheet and figure out what your armchair quarterbacking missed. You might actually learn something, like what “non-repetitive peak forward current” means, or how to extrapolate forward voltage as a function of current and temperature.
      But I’ll bet you won’t do that…

      1. Ralph, you have what? A sample of *one*. So yeah, it is a fluke. Not that it actually charged the battery (that is not that surprising), but that it didn’t explode in your face. It may well do so next time you (or someone else) try it.

        If you want to hurt yourself, your kids or burn your own house down, be my guest.

        However, once you post this sort of “howto” online, someone is bound to try to reproduce it – and they will get hurt. There are plenty of newbies around. Can you sleep well knowing that?

        Instead of admitting your error you only launch into arrogant diatribes insulting people pointing out problems with your design left and right. Jeeze, what a bunch of idiots are those engineers from TI and elsewhere that have actually built all those useless safety features into their charging IC when a simple diode is enough! If they only knew Ohms law, right?

        Christ …

      2. >> So according to you, it’s just a fluke it works for me.

        Yes, definitely.
        You disconnected before overcharge by overvoltage. Let it too much time, and you damage the battery, or it can also go kaboom.
        Furthermore, you have no clue about the current limit behaviour of the USB source you used.

  6. I’m a qualified EE too, and I concur, this “circuit” is not safe. Using a diode drop to find the “approx” voltage (when it really needs to be 4.1V or 4.2V depending on cell) is not good practise. When the manufacturers demand this, it’s silly to ignore this and believe a diode drop is acceptable. And there is the failure risk as KH mentions too, which may lead to disastrous conditions.
    I’ve seen a different cell technology accidentally explode with projectile behavior. And it was consistent with many cells in the battery pack. So from experience I know better than to “assume” things are ok with a simple diode drop just because it happened to work out ok for you just once. There is a reason why some people would monitor voltage and temperature, and make intelligent decisions based on that.

  7. The nerd is rather defensive. I don’t think he wishes to take on board any comments, he would clearly rather teach us V=IR.

    1. I am sorely tempted to send the link to his “charger” to Dave from EEVBLOG. I am sure Ralph would be only happy to teach Dave about Ohm’s law and proper design …

  8. I think this is just something Ralph whipped it up quickly to address an immediate need. Ralph just shared with us on how he handled a missing charger situation with the parts on hand. It is no way a permanent setup. We just need to appreciate the ingenuity and move on.

    1. I’m sorry if you think like that, but there are extremely good reasons for some of us to discuss the issues with the circuit. Cute trick perhaps, but there must be many red flags added to warn people. A school-going hobbyist might stumble upon this thing and try something quickly — and tragedy might happen. Many people don’t have the knowledge to evaluate this kind of risk. This is not a blinking LED project, things can explode. Get serious. Plenty of organizations, IEEE, ACM, etc, have codes of ethics. I would be totally negligent as an engineer if I did not point out the issues with this project.

      1. Understood. I think enough people have pointed out that. So it is time to move on. It is not important to prove that the other person was wrong. I hope you have better things to do. I am sure Ralph did not come around to get your seal of approval. There is no need for your blessings.

      2. Then you have not understood Ethics and doing the Right Thing at all. Well, maybe one day someone will teach it to you; you have much to learn.

      3. I never said I know everything. You assume too much. It now clearly shows that you think you know everything and the rest of the world needs to learn from you. I feel sorry for you. You are here to seek attention. I did not understand that it is your primary purpose. Sorry for the interruption. Please continue your show. Your audience eagerly awaits.

    2. >> We just need to appreciate the ingenuity and move on.
      In this case not.

      While it could perhaps be acceptable to have a dangerous behaviour at home, it is totally irresponsible to recommend others doing the same (ie. publishing a blog post without even a single warning)

      A good question for ralph : what is the spec tolerance of the multimeter you used for checking the voltage on the 20V range?

  9. LOL… Go Ralph, get them! If those pesky commentators are becoming too annoying just throw your battery charger project at them and see them running XD

  10. Author: Look how clever I am.
    Commenter: Ok, but it’s an unsafe method and you should probably point that out.
    Author: Meh. Safety Nazis. It didn’t burn up for me.
    Commenter: Tinkerers could cause a fire if they attempt to duplicate.
    Author: Not my problem and I’ll downplay your concerns to troll you some more.
    Commenter: AHhrrrggsspfff….

    Me: Yawn. Not that clever nor sufficiently different than a resistor to justify a post IMHO. Although I suppose we all have to start somewhere.

    Congrats Ralph. Keep swinging.

Leave a comment

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

Notify me of followup comments via e-mail. You can also subscribe without commenting.