Battery Repair By Reverse Engineering

Ryobi is not exactly the Cadillac of cordless tools, but one still has certain expectations when buying a product. For most of us “don’t randomly stop working” is on the list. Ryobi 18-volt battery packs don’t always meet that expectation, but fortunately for the rest of us [Badar Jahangir Kayani] took matters into his own hands and reverse-engineered the pack to find all the common faults– and how to fix them.

[Badar]’s work was specifically on the Ryobi PBP005 18-volt battery packs. He’s reproduced the schematic for them and given a fairly comprehensive troubleshooting guide on his blog. The most common issue (65%) with the large number of batteries he tested had nothing to do with the cells or the circuit, but was the result of some sort of firmware lock.

It isn’t totally clear what caused the firmware to lock the batteries in these cases. We agree with [Badar] that it is probably some kind of glitch in a safety routine. Regardless, if you have one of these batteries that won’t charge and exhibits the characteristic flash pattern (flashing once, then again four times when pushing the battery test button), [Badar] has the fix for you. He actually has the written up the fix for a few flash patterns, but the firmware lockout is the one that needed the most work.

[Badar] took the time to find the J-tag pins hidden on the board, and flash the firmware from the NXP micro-controller that runs the show. Having done that, some snooping and comparison between bricked and working batteries found a single byte difference at a specific hex address. Writing the byte to zero, and refreshing the firmware results in batteries as good as new. At least as good as they were before the firmware lock-down kicked in, anyway.

He also discusses how to deal with unbalanced packs, dead diodes, and more. Thanks to the magic of buying a lot of dead packs on e-Bay, [Badar] was able to tally up the various failure modes; the firmware lockout discussed above was by far the majority of them, at 65%. [Badar]’s work is both comprehensive and impressive, and his blog is worth checking out even if you don’t use the green brand’s batteries. We’ve also embedded his video below if you’d rather watch than read and/or want to help out [Badar] get pennies from YouTube monetization. We really do have to give kudos for providing such a good write up along with the video.

This isn’t the first attempt we’ve seen at tearing into Ryobi batteries. When they’re working, the cheap packs are an excellent source of power for everything from CPap machines to electric bicycles.

Thanks to [Badar] for the tip.

 

 

28 thoughts on “Battery Repair By Reverse Engineering

  1. 63% of the “failed” batteries were actually working, but simply disabled by their own firmware?
    That feels well past the point where a consumer protection agency should be stepping in.

    1. Not really. It is better to fail safe than to burst into flames. Don’t forget, we don’t know the provenance of these batteries. If they were all failures then 63% of them exhibiting the same fault is not a surprise.

      I also take issue with the article stating “We agree with [Badar] that it is probably some kind of glitch in a safety routine”, which is supposition based on no evidence. There will be a valid cause for this condition.

      I don’t disagree that being super-sensitive to potential problems and bricking the battery leads to more sales, but reversing the safety lock-out without understanding why it’s there could be dangerous. Hopefully the battery will detect the same fault condition again and turn itself off again.

      This is a common problem with Makita batteries, but for a known reason. The first cell in the pack also powers the BMS. Therefore it’s “on” all the time and drains at a higher rate than the others. It fails first (legitimately) even though the other cells have more life left. They can be harvested, but the first cell is toast, so the pack is unsafe and refuses to charge.

      1. Is it really toast is it only discharged a little to far so the BMS doesn’t allow it to charge? Do the cells get balanced during charging?

        1. I’ve found that the majority of battery failures is when they’re discharged below the BMS voltage.

          Force-feeding the batteries will bring them up above the BMS minimum, at which point the BMS can take over and you can use the battery once more.

          I’m told that this can be dangerous, that there can be a chemical change that causes the batteries to become dangerous, but so far haven’t had any issues.,

          My local dump/transfer station has a place for junk batteries, and I’ve managed to resurrect several units in this way.

          1. You got holes that start to develop between the layers when the battery is over discharged.
            I too have resurrected quite a lot of 18650s, but they’ve probably had their life span greatly reduced.

          2. Undervoltage causes lithium plating on the electrodes and dissolving the copper current collectors, which are then deposited back haphazardly when charging. It makes the electrodes go lumpy and form dendrites of copper and/or lithium, which can pierce the cell separator and cause a battery fire.

      2. If that’s true about Makita then that is some truly malicious design. It’s basically trying to set them up to fail.

    2. Define “working”. Some faults are intermittent/temperature sensitive/cumulative, and not always obvious just by inspection, but only by constant monitoring. Which is what the BMS is doing.

      The underlying issue is that the batteries which are new but locked-out should be going back to the manufacturer for warranty replacement, not sold.

      1. Unsupervised journalism?

        You do realise that these kinds of errors have occurred for as long as spellcheckers have existed, yes?

      1. There are 36 packs in the picture so I guess it’s 23 out of 36, which when rounded off to 200 decimals gives 0.638888888888888888888888888888888888888888888888888888888888888888888888888888
        8888888888888888888888888888888888888888888888888888888888888888888888888888888
        8888888888888888888888888888888888888888889

    1. I might suspect one of the early multi chemistry chargers as the cause(?) I have a blue 1/2″ ryobi var spd drill that came with nicads (which lasted a couple years ea ) a circular saw, sander and flashlight from 20 (?) yrs. When li batteries came out the charger would charge both types until it would not. A new charger worked fine and I used the same drill and other tools with a new drill driver, and impact drill for another 3 years with the old li battery and 2 spares for another 3 years daily and still when needed 4 years later, no problems. Just a thought…

  2. I’ve been using Ryobi 18 v tools daily for years and never had a battery failure. What am I doing wrong? I love their stuff. I have an old 18v string trimmer ( so old it’s the old blue and yellow) that I absolutely punish a couple times a week and it still works great.

    1. My Ryobi experience has been bad AND good. Got a great deal @ Home Depot. Initial units were cr**! They of course had a warranty but tended to be slow in replacement. Eventually after more than one replacement they have been in periodic use for >5+ years! Equal opportunity … Ryobi, Dewalt and Makita devices.

  3. Cool project! Of course the “glitch” might really just be some obscure safety mechanism having done its intended job, but then again, these kinds of batteries are commonly understood at this point and there’s no sorcery involved. So if the cells still test good, it’s reasonable wanting to put them back to use.

    1. Yes. Usually there’s an internal counter for intermittent errors, and a threshold above which the battery can’t be trusted anymore and goes into lockout. There’s a good chance that any battery “recovered” like this may work fine for a while and then lockout again as the original fault resurfaces.

      Any items with manufacturing defects should lockout early while they’re still in their warranty period, and the owner should be taking them back to the manufacturer for immediate replacement. So something else is going wrong that these batteries are making it onto the secondary market instead of being correctly disposed of by Ryobi.

  4. This happened to a couple of my batteries. I ultimately had to swap the whole circuit board I salvaged from a pack that got flooded to one where the board went bad out of nowhere. But I still have a whole other pack with the board stripped from it that I probably could have saved.

  5. reminds me of my last asus laptop…it had a replacable unit that was a 3s pack with a BMS built into it. and the pack would simply stop accepting a charge at some point. i wound up buying 3 batteries over its 5 year lifespan before finally giving up on it.

    at first i thought it was a safety feature because it had been deep discharged. but after the second time it happened, i paid attention and caught it in the act. found it in the state where the battery was still mostly charged, but had already disabled charging. since i had a dead one around, i removed the cover from its BMS and identified all the chips on board. which was a lot easier than i expected. and there were a lot more of them than i expected.

    i looked through their datasheets, expecting to find one that had a built in safety fuse that could be blown. and i did find one. but it was easy to test and it had not been blown! unlike Kayani, i’m not willing to do the micro-soldering that i perceived to be necessary to hook up to the diagnostic pin on the BMS chips so i never got to the bottom of it.

    so i gave up and bought a $150 temu laptop. if i’m going to be dealing with that kind of fault from asus, it’s hard to imagine it getting worse by going cheaper. it’s been about 4 months and i’m still happy with it. shrug

  6. I’m honestly astonished that Ryobi haven’t enabled firmware readout protection on the microcontroller.

    I wish more manufacturers would do the same.

Leave a Reply to IanCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.