Cheap DIY 12S balance charger idea

I’ve been wanting per cell monitoring pretty bad, bad enough to at least attempt to put smartbms in every board.

From ignorantly googling around, voltage divider for something like 12s will have stacking error, and resistors have quite a bit of variability?

ASD1115, looks like it has 4 16bit ADC, but that’s in single ended mode (common ground). In differential mode there are only ADC.

I think a BMS chip (maybe from TI, maybe same family as smartbms or diebms?) will have all the voltmeters in one easy to use package, and probably cost less than rigging a bunch of ADC and voltage dividers?

1 Like

I have actually played with it a few months back. Here’s what I have done on a perfboard with two ATTINY84 chips (I had to use two to get enough ADC pins) and a bunch of resistors.

It kinda works, but the ADC pins on ATTINY84 are only 10bit and they are not very accurate, so especially the voltage reading on the last cell is ±0.1V, which is pretty bad.

There’s not really a stacking error. You measure the voltage on the last cell by measuring the 11S voltage and the 12S voltage and substract the values. The problem is that the resolution decreases with each cell. You get a usable resolution on the first cell, but the resolution on the last cell is 12 times worse (on 12S battery) and that’s unusable if measured with 10bit ADC. However, with a 16bit ADC, you would still get a pretty good resolution even on the last cell.

The variability in the resistors is not a problem. You don’t need exactly 1/2, 1/3, 1/4, etc dividers as long as you know the exact ratios of the dividers, which is a matter of simply measuring the exact resistance of the used resistors. You then adjust the measured voltage correctly in software.

Sure, that’s why you need the voltage divider. You don’t measure individual cells. Rather, you measure the first cell, first two, first three, etc. Like this.

The main problem I see with the voltage divider is that the cells get constantly discharged over the resistors. Even worse, the discharge is uneven. The first cell gets discharged most while the last gets discharged least. Even though the current flow can be kept low by using high enough resistors, this would get the cells out of balance eventually, especially should the measuring module be connected to the battery all the time. There’s no easy way to turn it off.

I don’t think it would cost less. Three ASD1115 would be around $5 and resistors cost almost nothing. I agree that a BMS chip would be a more elegant and generally better solution though. It just seems terribly complicated. I read through the datasheet of the TI bq76940 that the LLT Smart BMS uses and there were too many things I didn’t understand at all. Plus, it doesn’t seem you can use the chip alone. The datasheet contains a schematics of circuits to be used with the BMS chip and there’s a bunch of other components. You can probably exclude many if you only want to measure the cell voltage. Still, it didn’t seem at all easy to figure out, at least for a hobbyist like myself. A voltage divider, on the other hand, is simple and straightforward.

2 Likes

Very nice!

I have a similar BMS and don’t understand the power routing. So I know left side is B- and right side is C-/P-. In the App I can activate and deactivate charging and discharging which both works like set in the app (when I power down the discharge mosfet, the ESC doesnt work anymore, when I power down the charge mosfet the charger doenst charge anymore, when I power down the discharge and charge is still on: I can still charge but not discharge, never tried discharge:on charge:off and charge then).

So now I am thinking about how this works, I got a clue but that makes no sense: since the B- is on the left side, does that mean the current is flowing from B- through the little shunts/fueses to and through the first row of mosfets to the middle and then through second row of mosfets to right?

And how does charging from the C-/P- work if the discharge fet is powered off?

Since you have your BMS opened, did you check for this? Mine is currently in use in a batterypack 150km away from me… :confused:

I believe that if the charge MOSFET is enabled, it connects the B- and C-. If the discharge MOSFET is enabled, it connects the B- and P-. That is, the MOSFETs simply close the charge/discharge circuits.

1 Like

But my BMS has C- and P- on same connector. I charge through discharge wires/pad… also this would mean the battery pad is the middle one and there are same number of discharge mosfets as charge mosfets…

From how you describe the BMS behaves, I don’t believe the C- and P- are actually the same pad. I would check continuity between them with a multimeter.

Oh, I missed this bit. Then that must really be one pad. I don’t know how that works then, sorry.

Are you able to follow the path of the main current via the multimeter in your testsetup? Mine is currently not open…

Not sure what you mean. After more thinking about your BMS though, I believe it could allow the current to only pass in one direction. When discharge is disabled, only current from P/C- to B- is allowed and vice versa for charge being disabled. I believe that could be achieved with two MOSFETs and two diodes. That’s just an uneducated guess though. I don’t really know much about BMSes.

Could you use diodes or mosfets with the 12 separate lipo chargers and the earlier mentioned charging/balancing scheme using one power supply and not short? Still trying

The short happens because all the negatives of each charger, on both the supply and output end, are electrically wired together (common ground). So if you hook all the chargers up, shorts everywhere.

I believe the only reasonable way to isolate power circuits is transformers. So if you put a transformer between the single power supply and the 1s chargers, as long as nothing else is completing the circuit to ground, you have floating power supplies, which is safe. It can even be a 1-to-1 transformer (5 volts in, 5 volts out).

And transformers work via alternating current (doh), so practically, 120vac -> splitter -> transformer -> 5vac -> 5vdc -> 1s charger seems the simplest to do. dc-dc I guess is possible but you have to convert to ac and back somewhere.

I hope I’m not completely wrong again lol.

1 Like

Could maybe do a single to multiple transformer at least. Simplify a bit.

https://www.electric-skateboard.builders/t/no-words-just-pictures-delete-words-use-pm/2992/8892 Please tell me you made this work with the Serialoutput of the ChinaBMS :pray:

1 Like

Depends on what you mean by “ChinaBMS”. If the LLT Power Smart BMS then yes.

1 Like

All china bms working with xiaoxiang app (yellow elephant) I guess there are only 2 different smart bms on the market, the one with yellow elephant app and the one with big SPI screen and the app is called vmax or something…

That’s the one then. I mean one that works with the xiaoxiang app.

1 Like

Any chance you are posting the code? Which display driver you you have? ili9341? Did you figure out the bms lock/unlock function? Would like to attach a display + button…

Yes, I’ll make the code available, but I want to do some polishing first. Probably some time next week. It uses this display driver: https://github.com/Nkawu/TFT_22_ILI9225

Currently I can only read data from the BMS. I can’t control it or change settings. That part of the protocol is not documented so I would have to reverse engineer it.

1 Like

:heart: thanks!

Damn, that is the version/driver for 176x220 TFT screens…I got (and used so far) Ili9341 based displays since they got 240x320px and are available from 2.2" to 2.4" till 2.8".

Still one step ahead of me^^

There is a documentation? Some time ago I found a threat on ES forum where someone logged the protocol, but I couldn’t find it right now.

This guy already managed it GitHub - smagicld/xiaoxiangBMS: iOS app for Xiaoxang BMS But no dokumentation or real sourcecode…

1 Like

You can download a zipped Excel file from this page: Download Center – LLT POWER ELECTRONIC

Yeah, I know. We can try getting in touch with him and ask about the secret formula for writing into the BMS. :smile:

1 Like