Smart charger - how to detect current and voltage of different battery packs and then charge them accordingly [closed]

I am thinking of designing a smart charger for a few of my bikes/scooters, etc

• detects current and voltage of the pack (30-60V, 1-5A)
• charges the pack accordingly in the CC-CV mode, fast-charging when possible

All of these battery packs are li-on based (mostly 18650, 21700).

My questions are: - how does the charger figure out what is the maximum permissible voltage for a pack? - respectively, what about the max current? - are there any ICs for that? - can I go with a transformer based charger or do I have to use a switch-power (or maybe some other type like capacitive - although I would like the efficiency to be reasonable).

I know it is a layman question - I am quite new to electronics, but I would like to steadily learn and practice more.

closed as too broad by Chris Stratton, Bimpelrekkie, Finbarr, winny, StainlessSteelRatMar 14 at 20:45

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• It is not a trivial task to charge li-ion batteries, as there is a lot you have to consider and li-on batteries will show in a very spectacular way when they are treated the wrong way (like explode with a big flame). Although it is no witchery to build a charger for this purpuse, it is certainly not a project I would recommand to someone who is new to electronics - it is just too dangerous when something goes wrong or isn't considered from the beginning. Therefore I would highly recommend to buy a quality charger right now and start your electronics engineering career with safer projects. – jusaca Mar 14 at 12:48
• I am quite new to electronics That then basically means that you should not "design a smart charger". Also: you're asking about the most basic aspects of charging batteries and chargers in general. I expect you to know this already before you can even consider designing something on your own. You're not the only one who wants to "design" something only because they need that function. Fact is that your lack of experience makes you underestimate the complexity of the task. So forget "designing your own" and just buy a ready made one. – Bimpelrekkie Mar 14 at 13:20
• but I would like to steadily learn and practice more. Excellent! but I strongly advise you to start with something much, much more simple. You would not be the first person to run into issues and give up on electronics because you simply aimed too high. ALL experienced people here started simple, with a LED flasher for example. Start simple, learn and build on that knowledge. Bite off too much and you'll choke. – Bimpelrekkie Mar 14 at 14:14

If you have a limited number of voltage variations you COULD use auto-detect of the voltage. eg if you had say 36V and 72V packs (10S and 20S) then the legal voltage ranges are at most 25 - 42 V and 50 - 84V. 42V is far enough below 50V IF NOTHING GOES WRONG to allow you to dostinguish between packs by voltage. But if you ever get an anomalous situtaion - unlikely but possible, where the 20 cell pack was down by another 8V (eg 3 fully dead cells) then your charger may rapidly render ALL the cells dead if it attempted discharging the pack for any reason.

The only truly safe method is what is done in typical commercial applications - the batteries are "smart" and convey their identity to the charger in some manner. The "smartness" could be as simple as a resistor to uniquely identify the pack - but inclusion of a microcontroller is trivially easy and it can be used for other features such as usage tracking.

I have seen laptops which accept 3S or 5S battery packs equally happily. This is easily accomplished once battery identification is independent of the actual battery.

Batteries selected for a pack are normally matched for full charge resting voltage binned in some "x" mV range, mAh capacitance, which I model as follows, $$C=Ic\cdot dt/dV=[Ah]/dV\cdot 3600[s/h]$$ and $$ESR= ΔV/ΔI$$ using some pulse I of various pulse widths ( similar to Maxwell's Ultracap ESR test methods) where the C charge rate ( not related to C capacitance rather self-heating rise['C] ΔT from thermal resistance from jcn. to amb. $$\R_{JA}\$$from $$ΔT=Pd\cdot R_{JA}=I^2ESR\cdot R_{JA}$$.

If the packs are thermally coupled, then Temp sensing is one method using say a case temp rise of 10'C for one limit and measure ESR with pulse charge to predict the optimum $$\P=I^2ESR\$$ for an expected range, but the more you push the limits the faster this leads to thermal runaway by a weaker battery with higher ESR becoming over-voltage charged. So a slow charge is safer and low temp rise reduces accelerated ageing from self-heating. All batteries have a memory such that when you apply a pulse voltage higher or lower, it slowly returns to the previous voltage. This is because the capacitance resembles a simple model of $$\ESR_1*C_1//ESR_2*C_2\$$ where the memory cap is charged during the last 10% CV charge mode after CC.

A faster C rate only results in a longer CC time interval which most people know is the critical time when self-heating rapidly ages a Li-Ion cell above 4.0V and worse above 4.2V

So you could use a CV charger with current sensing and a FET regulator with a cutoff of 4.0V and get 90% capacity and lower risk of a max capacity charger of CC, CV then cutoff at 10% of CC.

The same methods apply to Undervoltage lockout control methods below 3.0V except the mechanism is that Lithium dendrites grow from the electrolyte and create short circuit crystals that create cell death. A high current pulse can go to a lower voltage than 3.0V from ESR drops can be tolerated but a slow discharge < 3V acclerates aging. A safer cutout is 3.1 to 3.2V for longer battery life expectancy per cell or according to different battery chemistry OEM guidelines. as best practise.

Longevity ( # of charge cycles) and max capacity per useage are big user tradoffs.

I cannot make this assumption for you, so I cannot answer it. (consult with www.batteryuniversity.com for background info)

The ideal BMS battery balancer bypasses each cell with a FET SPDT switched inductor to transfer the stored current past a fully charged cell to the next one with minimal losses. The passive balancers use a Zener-like active device to create a bypass with a cell voltage limiter.

When you understand these principles and battery ageing effects and become expert in design of specifications for the optimal charger, then you can realize it with Voltage current and temp sensing.

A transformer + bridge charger is the worst solution because the voltage range from no load (Peak) : rated load (rms) is 1.414:1 voltage regulation, which is pretty bad for Lithium secondary cells.

Caveat

I have never performed this task for a Battery pack or Charger design company, but as an R&D designer and Test Engineer for > 40 yrs this is how I would approach the task using SPC ( Statistical Process Control) and model validation.

Any questions?