Blog

Copy And Paste Lithium Battery Protection | Hackaday

Lithium batteries have, nearly single-handedly, ushered in the era of the electric car, as well as battery energy storage of grid power and plenty of other technological advances not possible with older battery chemistries. There’s just one major downside: these lithium cells can be extremely finicky. If you’re adding one to your own project you’ll have to be extremely careful to treat them exactly how they are designed to be treated using something like this boilerplate battery protection circuit created by [DIY GUY Chris].

The circuit is based around the TP4056 integrated circuit, which handles the charging of a single lithium cell — in this design using supplied power from a USB port. The circuit is able to charge a cell based on the cell’s current charge state, temperature, and a model of the cell. It’s also paired with a DW01A chip which protects the cell from various undesirable conditions such as over-current, overcharge, and over-voltage. Adjustable Brightness Usb C Interface Portable Light

Copy And Paste Lithium Battery Protection | Hackaday

The best thing about this design isn’t the design itself, but that [DIY GUY Chris] built the circuit schematic specifically to be easily copied into PCB designs for other projects, which means that lithium batteries can more easily be integrated directly into his other builds. Be sure to check out our primer on how to deal with lithium batteries before trying one of your own designs, though.

Missing 5.1k Ohm resistors on CC USB-C pins

Looks like this designer needs to read more HackADay.

His reply on his youtube channel, he even pinned the comment:

5.1K resistors are missed but not for this application, no data transmission here, or maybe I should add them for the VCONN based on the cable characteristics, by the way the 5.1K value is not always valide it depends on many other factors, you can check more details about the CC pin of USB C connector here : https://community.silabs.com/s/article/what-s-the-role-of-cc-pin-in-type-c-solution?language=en_US I’m open for more talk about this topic : )

CC resistors aren’t just needed for data, and many power supplies will not provide any power if they’re missing. For a basic usecase like this, I believe the 5.1k resistors are correct.

I like the copy and paste idea. Too many circuits are said to be open source, but require a lot of modification to implement into a bigger design. And please stop using chip libraries as they cause more problems than they are worth IMO. Keep the designs nice and simple without too many esoteric layers in the Gerber files.

Will we run out of lithium before oil?

Gareth, we’ll never run out of Hydrogen (so long as there are nuclear powerplants by the rivers to run electrolysis stations). If we’re to ditch oil we need a working hydrogen economy up and running first. Lithum would run out very fast if more electric cars and grid scale batterie are made, but would last a lot longer if only used for small lower powered devices.

Waste heat has to go somewhere, not every river supports nuclear plants every mile. Better to do the nuclear plants in Antarctica, to enable reforestation there

Solar. Wind. Pumped hydro storage where possible. Thorium modular reactors. Lithium recycling just like we do with lead-acid batteries. Lead-acid power storage at the customer access.

There’s a large number of non-Cobalt non-lithium battery technologies in the people.

Un-fark and electrify public transport.

Hydrogen is a terrible idea. It exploded far too easily. It has a low energy density. It is nearly impossible to store in bulk without massive leaking because H² is still tiny. H² is also a very peculiar acid and corrosive agent properties.

The single hardest thing in our energy future is solving poverty so that our last mile technologies (bikes, scooters, etc.) Could be casually secured with little fear of being stolen or partsed-out by the desperate categories.

Not if the ocean has anything to say about it.

The ocean doesn’t say much. It just waves

Sign language is the medium, not the message…

10 Internet points to you, Sir. Or should I say..dad ;)

River don’t push much, they just let it flow.

The rate that disposable e-cigarettes are being consumed and discarded most likely. The ones I’ve found have given me a good stock of 0.5Ah and 1.5Ah cells though

Same. They are a great free source of batteries

No because other chemistries will become viable long before lithium runs out.

In KiCAD, it is easy to keep building blocks in separate sub-schematics, which can be reused in other projects.

Reuse of partial layouts (e.g. for switching regulators, where the arrangement often just follows datasheet or design tool recommendations) is far more challenging. “Group”ing in KiCAD PCB can help a bit when moving things around, but the user experience compared to using a shared library (.so/.dll) when programming a software is so much worse.

There is a plugin for copying “rooms” in KiCAD now – you can copy design of one routed hiearchical sheet to others. And another plugin to do that, but from a different project. So, you can now reuse parts of PCB quite easily (or at least it should work that way, didn’t have time to test it yet).

I’ve been waiting for a plugin like that! Do you have names of those plugins?

This. I’ve been storing reusable feature-level circuits in Altium using the template functionality for a while now (and I’m sure all EDAs have similar options) but the lack of a web platform centralising open community reusable designs (often refined through many expensive iterations of trial and error) still strikes me. Really weird the EE industry still does not have the EE equivalent of SW libraries

@Reluctant Cannibal said: “I like the copy and paste idea…”

The TP4056 Battery Management System (BMS) IC is old. I think the reason the TP4056 is so popular on Chinese 18650 cell charger modules sold online is because there are lots of TP4056 / DW01 / 2xMOSFET copy-paste clones out there already and the parts on the modules are very likely clones themselves. Don’t just clone the TP4056 boards, there are far better chips out there today that have both BMS and cell protection built-in. So there’s no need for the external DW01 cell protection chip and the two external cell protection MOSFETs needed to go along with the TP4056 BMS IC.

The original manufacturer of the TP4056 BMS IC is TOPPOWER (Nanjing extension of Microelectronics Co., Ltd.), they have newer chips that are far better than the TP4056. Most have both BMS and cell protection built-in, some are single (1S / 4.2V) and multi-cell (2S / 8.4V) capable, some provide uninterrupted charging and power (e.g. UPS / Power Bank). To begin with take a look at the TP5000 and TP5100 parts to replace the old TP4056 / DW01 / 2xMOSFET combo. Here’s a partial list of the TOPPOWER ICs from LCSC Electronics:

https://www.lcsc.com/products/Battery-Management-ICs_612.html?brand=309

The problem is the datasheets on lcsc.com are in Chinese only. However some datasheets have been translated to English by third parties. Search the web for .pdf equivalents, or try Google Translate.

Just for fun, here are two English translated datasheets I found online. The links work at my post time – but that’s no guarantee of availability in the future. However, the up to date Chinese TOPPOWER datasheets are always available for download from lcsc.com (full link above):

https://robu.in/wp-content/uploads/2021/01/TP5000-3.6V4.2V-1A-LithiumBattery-Charger-Module.pdf

https://voltiq.ru/datasheets/TP5100-datashhet.pdf

Among all comments, this one is the most constructive : ) Thank you very much for the useful info.

@DIY GUY Chris said: “Among all comments, this one is the most constructive : ) Thank you very much for the useful info.”

I dunno about the “EV challenge”, as the only solution being presently applied is brute-forcing it by squeezing more 18650’s into modules. The battery technology and chemistries developed over the last thirty years just aren’t being commercialized – favoring lithium technology… of which the viable sources for materials seem to come from ironically specific places.

It’s almost as if there are big interests behind the scenes steering the technology after the money…

I mean, you’d think we’d have learnt how to diversify and it’s not as if this is a particularly new idea (ahem… OPEC et al) :-)

I’ve switched to using TP5000 instead, since it’s a proper switching regulator instead of a linear regulator and can extract more power from e.g. small PV-panels. I also use Xysemi XB5333A for protection, since it has built-in MOSFET and thus there’s no need for an external one.

Neither is quite as a ubiquitous component as the ones here, but easy enough to source from e.g. LCSC.

I always wondered how switching battery chargers worked. The charging chip wouldn’t get the output voltage of the DC-to-DC converter as feedback (since the battery would eat up everything) so I would imagine they could only do constant current

That’s not really how electricity works and yes, they can track the output-voltage just the same as with any other load. You measure current by measuring the voltage on two sides of a shunt resistor, so obviously, you are able to measure voltage, if you are able to measure current.

As for the TP5000: it does do all the different discrete steps of proper li-ion charging, not just a constant-current mode. If it just did a constant-current mode, it’d just be a CC buck-converter and not a li-ion charger.

Can you share the design? The catch is often in the details.

@None said: “Can you share the design? The catch is often in the details.”

I just posted a comment further up in this thread addressing the likes of the TP5000 & TP5100 that may answer your question. I posted links to English translations of the datasheets that have example schematics. Search in this thread for my handle: Drone.

Tip for the young gamers out there. Make sure your TP40xx is a TopPower part. Or whatever your expecting.

I’ve seen second source manufacturers chips that don’t exactly perform the same (higher low amperage via the resistor setting). Would’ve probably been fine on a large cell but wouldn’t go down to LR2045 capacity cell safe amperages.

@Inhibit said: “Tip for the young gamers out there. Make sure your TP40xx is a TopPower part.”

I agree 100%. I buy TOPPOWER parts directly from lcsc.com (yes, China but so-far reputable in my experience). Start here:

https://www.lcsc.com/products/Battery-Management-ICs_612.html?brand=309

I have no affiliation with lcsc.com. If you’re buying pre-built Chinese 18650 charger modules (boards) online, YMMV. Some or all of the chips on the dirt cheap boards or modules are likely fake. But it may still work for you – at best it will work just good-enough – at worst it will burn your house down. Use caution and common-sense when dealing with modern batteries – there’s a lot of stored energy and the materials they are made of are very difficult to deal with once they start burning.

Sure looks like straight clone of Chinese modules available for over 6 months now at ridiculous price of ~$3 for 5 units with free shipping. Cheaper than buying just the UBS-C connector locally. Thats what I paid for mine last year after watching Big Clive video :

Why is nobody asking how! 1000Mah in a 402030 package??? Doesnt seem right to me?!?

Exactly! I was searching numbers to find anything similar as it didn’t look right in the picture to be 1000 mAhr unless it was just as thick as it is wide!

I’m confused. Don’t lipo cells already have protection board on them? Look at video below @ 1:22. It looks like the DW01A and FS8205A are built in to the protection board on the lipo. Why have them again on an external board? Is this for non-protected lipo’s? https://youtu.be/zavSoXgzhxg

Some do and others don’t, the 18650 cells are supposed to be 65mm tall and if they are a little taller than that they are probably protected. But there is no standard, or commonly used designation. It’s amazing that we were able to settle on standard sizing (A, AA,AAA,C,D) almosta hundred years ago https://en.wikipedia.org/wiki/Battery_nomenclature while today we have a mess where every tool had a different battery pack and even individual cells are not quite standard.

It did take some time for marketing to catch up and realize they could earn more money by putting batteries in a non standard form factor.

Or, more likely, they did know (I think marketing as we know it started somewhere around 1850) but back then production of different size batteries and distribution was just too difficult to make this marketing trick stick.

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.

Copy And Paste Lithium Battery Protection | Hackaday

Tool Battery Inverter Pluggable Design By using our website and services, you expressly agree to the placement of our performance, functionality and advertising cookies. Learn more