Looking for an MCU controlled discrete power stage (Li-Ion charger/discharger) - Page 1
Forum section: electronics / projects

author: RoGeorge
author_rank: Super Contributor
timestamp: January 13, 2023, 12:49:03 pm
content: Searching ideas for the schematic of a power stage to charge/discharge/measure old Li-Ion single cells, most of them from former mobile phones.- the schematic has to be with discrete parts- has to be controlled by an MCU- the MCU can connect to a PC to plot I and V charge/discharge curves- self contained, with a rotary encoder for inputs and a 2x16 LCD and LEDs for signaling- adjustable current, max 500mA, at least 10% accuracy, 10mA resolution- adjustable voltage, max 4.5V, at least 1% accuracy, 1mV resolution- many independent channels, e.g. 4 batteries at the same time- maybe add a thermal shutdown protection (analog), but no idiot-proof protections- simple/minimalist design for a one-off, not designed for manufacturing- no buying of dedicated ICs or ready made chargers(already have discrete parts sitting unused, for example BD139/140 or Darlington BD680/681, power MOSFETs, power supplies with +5V, +12V and -12V, Arduino and alike MCUs, etc.)I'm hesitating between a switched topology for the final stage of each channel, with the control loop in the MCU, and a voltage-controlled analog power stage, where the DC voltage that controls the analog final stage will come from a PDM or PWM DAC.I've started with a NPN as emitter repeater (to set the max 4.2V topping voltage), but at 500mA the Ib would be a little too big to be driven from an MCU pin. A Darlington instead of a NPN would be better. An emitter repeater would need some limiting max current, so added in the collector yet another Darlington to control the current.Ended up with something I don't like very much, that's why asking for more schematic ideas.

author: ledtester
author_rank: Super Contributor
timestamp: January 13, 2023, 01:06:24 pm
content: Do you mean something like the "ASCD Mega 8x Project":Processing Li-Ion batteries and the new Arduino 8x Charger / Discharger (tester) working -- brettwatty101https://youtu.be/yiqRIWckhIc?t=14m10s(relevant section starts at 14:10)Description has links to the design files (PCB, firmware, ...)

author: RoGeorge
author_rank: Super Contributor
timestamp: January 13, 2023, 01:38:35 pm
content: Wow, thank you, that's a very elaborated project!Great idea with the barcode scanner.Now I want a barcode scanner.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: January 15, 2023, 04:25:35 pm
content: I’d go back to the point where you evaluated the switching mode for charging. Switching is the best possible way doing it, without burning up a lot of power. In other words, you take in only as much power as you need.On the discharge side, the power needs to burned up anyway, so a linear transistor of mosfet based current source is the only choice.On the schematics: you’ll need two controlled current generators, one to charge, on e to discharge. You’d want to measure both currents and the battery voltage.Control of the current generators are fine with PWM, however buck topology with inductor/capacitor on the charging one makes lower power and complexity, thus failure proof.Firmware: the current/voltage control loops are all to be done in software, including the buck regulator control. If you’d want to add pc connectivity you can do it by talking SCPI, assuming this project is for learning.PC sw stack for charging and analysis: highly recommend a Jupyter notebook (python), with PyVisa doing the talking over SCPI to the MCU board.

author: RoGeorge
author_rank: Super Contributor
timestamp: January 15, 2023, 06:34:14 pm
content: Regarding the discharging part, I plan to use the same source as for charging. Constant current with fixed top voltage (CC-CV), but with the battery connected in reverse. LEDs on their radiator plates (from broken LED light bulbs) as discharging loads, like here:https://www.eevblog.com/forum/projects/cc-cv-power-supply-as-a-contolled-load-for-batteries-(i-e-rigol-dp832)/The DP832 power supply can do either charging or discharging, has SCPI too, just that DP832 has a fan that is too noisy to run it for days, non-stop. Want something that runs quiet.For both charge/discharge I'm thinking to lower down the specs for max current, from 500mA to only 50mA. That would simplify the final stage to a single transistor, something like this:where instead of a Zener, a PWM coming from an MCU can be used to generate the reference voltage.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: January 15, 2023, 08:31:43 pm
content: Reverse connecting at discharge just does not sound good. Why dissipate 2x of what a parallel transistor would do? How would switch for reverse back to normal? I assumed all automatic/software driven charge/discharge cycles.If you are cost conscious take a look at this for $2 (if in the US/CA)https://www.allelectronics.com/item/ex-57/li-ion/li-polymer-battery-charger/1.htmlThe cost beats aliexpress.It has all the circuitry a well designed battery charging/discharging circuit needs. It was in a medical battery pack charger. Nuke the pic out of it and connect it to the MCU board of your choice. When you buy two, use one to reverse engineer the schematics.Btw I started reverse engineer it but did not finish.

author: RoGeorge
author_rank: Super Contributor
timestamp: January 15, 2023, 08:53:31 pm
content: That charger is a bargain indeed, even if for parts scavenging, and still worth buying. Though I'm from EU, taxes and shipping will cost way more than $2, and will take a couple of weeks to arrive.I would rather build something on the spot, using whatever I can find through the scrapboxes.The wasted energy doesn't mater in this case. The charger is powered from mains. 1kWh cost less than $0.5, and that would suffice to charge/discharge hundreds of phone batteries.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: January 16, 2023, 01:02:13 am
content: The power saving is not b/c electricity cost - it’s to save on component cost, reliability, cooling concerns, heat sink size. In applications other than yours it can improve precision circuits, also save board space.Back to your question - scrap bin parts wise I suggest a buck converter, to act as a cv/cc supply under the MCU’s control loop driven by a PWM DAC.Discharge load wise an NPN or N channel mosfet driven by another PWM DAC.Measure charge and discharge current, battery voltage, input voltage, battery temperature, discharge bjt/fet temperature. Probably with an ADC of the MCU. Might need opamps for high or low side current measurement and possibly analog switches if the ADC has a single channel.I would extend the current specs to the top range of the 18650 batteries - at 1C, let’s say 2.5A. If using a buck charger it can be powered from a 12V 1A scrap bin power brick. It would allow you to charge two cells at 0.5C current, too.If you’d really want to stay on linear pass element charging use a PNP or P channel mosfet to allow charging from a stable 5V, up to 4.5V battery voltage. This will push the design as you only have 0.5V budget for the pass element and shunt resistor drop, and your supply should not sink below 5V.As far as the schematics you sketched - the NPN darlington to discharge expected to be across the battery, not in series. If you add a low side current sensing you can get away with a single shunt resistor for both charge and discharge measurement.