Arduino/Microcontroller BMS - What features do you want?

Batteries, Chargers, and Battery Management Systems.
Post Reply
dmwahl   10 kW

10 kW
Posts: 613
Joined: May 06 2009 9:41am
Location: Madison, WI

Arduino/Microcontroller BMS - What features do you want?

Post by dmwahl » Oct 09 2013 10:12am

I've been working on a microcontroller BMS, based on the ATtiny84 and programmable using the Arduino environment, and wanted to get the community's input on some of the higher level details. I already have a thread with a more in depth discussion of the technical details, things like why I chose a specific transistor, getting the microcontroller to sleep between measurements, oversampling technique, etc. See the link in my signature and skip to the end of page 5 for the recent discussion if you're interested in that. The technical details of the design are mostly finished, the circuit works properly, and averages below 10 microamps of current draw from the cells.

My goal in designing the BMS is not to design another inexpensive BMS, but to produce a high quality design that can be easily reconfigured for multiple cell chemistries, is reliable, and easy to use. Schematics and source code will be available, so nobody will be left guessing which pin does what.

This thread is about the high level features of the BMS. Things like amount of balance current, physical size, # of cells monitored, etc. In depth discussion of the technical issues should be kept to the other thread.

The primary questions I have are as follows:

Form factor requirements
Does is need to fit in the palm of your hand, or is a few square inches per cell OK? Through hole parts are much larger, so the tradeoff with being able to build it yourself is that it will inevitably be larger.

Cell Connections
JST-XH connectors? Holes to solder wires directly? Something else?

Number of cells monitored
I would like the option for at least 24S.

Balance current
Do we really need 3A balance current?

Charge current control. Should the BMS throttle back charge current once HVC is reached to prevent overcharge.

LVC Pack cutout
Should the BMS cut power completely at LVC or just signal the controller to do so. Both are possible, although complete pack isolation is more difficult.

DIY (bare PCBs) or pre-built and ready to go?

Would it help if I offered preprogrammed microcontrollers?

meelis11   100 W

100 W
Posts: 116
Joined: Jul 30 2013 5:29am
Location: Tallinn, Estonia

Re: Arduino/Microcontroller BMS - What features do you want?

Post by meelis11 » Oct 11 2013 6:39am

Form factor requirements:
I agree that if it is designes as DIY open source, it should use through hole parts whenever possible. If some chips are available only surface mount packages, thenno big problem. Size-weight is not so critical, it is not going to helicopter/airplane.

Cell Connections:
if PCB has normal pin header holes, user can solder there any connector.

Number of cells monitored:
Your plan to make PCBs for 6 cells is okay. For 12S you only need 2 boards. If they can be stacked/daisychained to work as 6S, 10S (2 cells unpopulated), 12S, 16S, 18S ... then it is okay.

Balance current:
cannot comment on that, dont know :)
It probably depends if it is only balancing during charging or can be configured to balance always when current is not drawn (when cell voltages differ more that x volts - example 0.1V). maybe it is not so good idea?

Charge current control.
Should the BMS throttle back charge current once HVC is reached to prevent overcharge.
You mean when at least one cell is aleady max voltage, others should not get full amperage anymore?

LVC Pack cutout
Should the BMS cut power completely at LVC or just signal the controller to do so. Both are possible, although complete pack isolation is more difficult.
Maybe two diffrent thresholds? "cutoff voltage" and "low battery warning" voltage. User decides what they do with warning voltage - can blink led/make buzzer sound, use half-power.
DIY (bare PCBs) or pre-built and ready to go?
Best would be to offer both options.

dmwahl   10 kW

10 kW
Posts: 613
Joined: May 06 2009 9:41am
Location: Madison, WI

Re: Arduino/Microcontroller BMS - What features do you want?

Post by dmwahl » Oct 11 2013 8:42am

Number of cells monitored:
Your plan to make PCBs for 6 cells is okay. For 12S you only need 2 boards. If they can be stacked/daisychained to work as 6S, 10S (2 cells unpopulated), 12S, 16S, 18S ... then it is okay.
That's the idea, each individual cell monitor can stand alone. You can populate 1 cell circuit only, or all 6, doesn't matter.
Balance current:
cannot comment on that, dont know :)
It probably depends if it is only balancing during charging or can be configured to balance always when current is not drawn (when cell voltages differ more that x volts - example 0.1V). maybe it is not so good idea?
Only during balancing, but the point at which it starts balancing can be configured. I have mine set up to start balancing 0.1V below the HVC point.
Charge current control.
You mean when at least one cell is aleady max voltage, others should not get full amperage anymore?
Yep, exactly. It's incredibly simple to do with the ATtiny as it already has PWM built in. I've got it set up at about 4kHz and it works great. I'm going to try to bump it up to more like 32kHz, but more for my own curiosity than anything else.

User avatar
grindz145   100 MW

100 MW
Posts: 2955
Joined: Apr 07 2009 12:10pm
Location: Rochester NY
Contact:

Re: Arduino/Microcontroller BMS - What features do you want?

Post by grindz145 » Oct 11 2013 8:47am

dmwahl wrote:

Balance current:
cannot comment on that, dont know :)
It probably depends if it is only balancing during charging or can be configured to balance always when current is not drawn (when cell voltages differ more that x volts - example 0.1V). maybe it is not so good idea?
Only during balancing, but the point at which it starts balancing can be configured. I have mine set up to start balancing 0.1V below the HVC point.
There is absolutely no reason why you need 3A balance current :) 1A would be fantastic.

dmwahl   10 kW

10 kW
Posts: 613
Joined: May 06 2009 9:41am
Location: Madison, WI

Re: Arduino/Microcontroller BMS - What features do you want?

Post by dmwahl » Oct 11 2013 9:49am

grindz145 wrote:There is absolutely no reason why you need 3A balance current :) 1A would be fantastic.
I agree, 3A balance current is excessive for typical 10-20Ah packs. 1A is theoretically possible with my design, although I haven't tested it that high yet. The limiting factor will most likely be whether or not the transistor and power resistor can stay cool enough at 1A. I was planning on around 0.6A max myself.

powersupply   100 W

100 W
Posts: 215
Joined: Apr 14 2013 8:04am
Location: Santa Monica

Re: Arduino/Microcontroller BMS - What features do you want?

Post by powersupply » Oct 11 2013 9:33pm

Now that you're asking.....

Form factor
A centralized solution would be great! It makes wiring/mounting/exchanging so much easier.
A decentralized version (with several 6s etc boards as suggested here) would just add to the complexity and failure (more interconnections).

Charge current control of 0.6A is totally fine, actually 0.3A should be fine, too.
But it would be great to limit the charge current for different charging profiles. With a switch maybe. Sometimes the batteries need to be to charged in a hurry (at say 2C), but generally they can be charged overnight (at 0.2C). I thought about a resistor in series but the heat genrated is quite high.

Would be great if the hot parts would be on the underside, so a aluminium plate could be pressed on them to help dissipating the heat (air to alu was around 1 to 100 if I remember correctly)

JST-XH connectors are a good choice, locked and modern and quite standard now.
But whatever you choose, I would ask you to leave room for several of them (in parallel).
Even from beneath. Your PCB will probably be 2 sided anyhow.
It would make bundling several parallel packs so much easier.

Next to the BMS functions some streaming/storing of raw data would be really great.
Something the OZ chip is capable of doing apperantly.
Data like voltage of each cell, temperature and such.
Binary (ASCII), as is, any silicon brain receiving that can reformat/rescale it as needed.
Something the Celllog is missing is the main charge and discharge current, so considering that there will be a shunt somewhere on the BMS, it could be digitized, too I guess.
Never understood why there are separate solutions for these basic things. Probably because they want to make more money.

This data could be stored and/also sent serially to a cheap onboard display or via a bluetooth module to your smartphone when needed.


Some of his has been suggested by others, just repeating here.
And keep in mind, you asked, this is just a brainstorming.

None of the other solutions were really complete or reproducable.
I truly hope you'll get somewhere!
Good luck!

powersupply   100 W

100 W
Posts: 215
Joined: Apr 14 2013 8:04am
Location: Santa Monica

Re: Arduino/Microcontroller BMS - What features do you want?

Post by powersupply » Oct 14 2013 1:46am

Just found your other thread again, impressive!

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: Arduino/Microcontroller BMS - What features do you want?

Post by torqueboards » Feb 03 2014 6:09am

Just found this thread. Is this project still in progress or is it abandoned. What is the link to the open source code and where can we get the boards?
DIYElectricSkateboard.com Electric Skateboard Kits

dmwahl   10 kW

10 kW
Posts: 613
Joined: May 06 2009 9:41am
Location: Madison, WI

Re: Arduino/Microcontroller BMS - What features do you want?

Post by dmwahl » Feb 05 2014 10:18am

This thread is just a to post ideas/feature requests. There's no final design posted yet. I do have a design based on the TI BQ76PL536A (see signature link) that works but I haven't scaled it up quite yet. I've been busy with work, consulting, and a 2 month old kid lately so I haven't really had much time to put into this. Definitely still in progress, although a bit slow at the moment.

User avatar
friendly1uk   10 MW

10 MW
Posts: 2282
Joined: Mar 14 2013 1:18pm
Location: The not so UK

Re: Arduino/Microcontroller BMS - What features do you want?

Post by friendly1uk » Feb 05 2014 4:51pm

The 4s 5Ah lipo bricks are common building blocks. At 139x43x45mm they slip in to the 48x48mm center of a 2x2" box section nicely. 2x4" is equally useful, and 4x4 they are all common sizes. With the narrowest bms boards coming in at 50x7mm, they can't quite fit the inside dimension of a 2" enclosure. When I stack bricks up in pack shaped piles, my mind is always thinking about extending the battery shaped enclosure to accommodate the bms. So the bms dimensions should reflect cell size. If it were 48mm wide by perhaps 120mm long, You could put 3 bricks (44v 5Ah) in to a 2x2 tube with the bms and unboxed 6fet side by side, making a 2' baton that could be slung from the bottom bar, ending under the bottom bracket, a good place to bring out motor and pas cables. It could be a tidy and fast install. I feel strongly that a bms should be able to fit anywhere a cell will fit. They shouldn't be dictating to us.


A bms that can do up to 14s would cover most 24 36 and 48v needs. Building in blocks of 6 rather than 7 leaves people a bit short. Perhaps the number of input/output channels on common chips will guide here.
bmsbattery sent me broken and incorrect stuff, and won't even talk to me about it.

dmwahl   10 kW

10 kW
Posts: 613
Joined: May 06 2009 9:41am
Location: Madison, WI

Re: Arduino/Microcontroller BMS - What features do you want?

Post by dmwahl » Feb 05 2014 5:52pm

The BQ76 chips each support 3-6 lipo cells (or 4-6 LiFePO4), so 7S from a single IC would not be an option. Splitting up the cells between two boards would of course work fine.

I wonder, however, if people building packs from the 4-6S lipo packs would even be interested in these... don't you normally use a balance charger anyway? My original intent was for these to go on larger packs where space and price are less of a premium. Personally I use a 16S LiFePO4 pack in a bike rack bag and have plenty of room for a larger BMS, plus I use a cheap dumb charger with no balance leads.

DVDRW   100 W

100 W
Posts: 211
Joined: Sep 10 2012 10:57am
Location: Tallinn, Estonia, EU
Contact:

Re: Arduino/Microcontroller BMS - What features do you want?

Post by DVDRW » Feb 06 2014 12:56pm

Good to know, i'm not alone.
I'm also working on a microcontroller BMS.
Using Attiny24 (<1$) on each cell. Each Attiny measures voltage itself and sends value to main controller Atmega32A thru optocoupler digitally.
Atmega32A displays each cell voltage on display. Also Atmega32A can send commands to Attinys at which voltage to start balance etc.
If you switch off BMS after each ride or any cells are too low, then all Attinys go to sleep and BMS switches itself off.
To turn it back on, connect charger or press low current small switch (no sparks).
Planning it to use with my offgrid Lifepo4 system too.

Quite simple circuit for each cell:
https://imagizer.imageshack.us/v2/1242x ... 6/5a3k.png

I Encourage you all to make PCBs with SMD components.
Its not that hard as you may think.
You can build UV box today for just ~15$
And use precoated UV PCBs, print PCB layout to 2x OHP transparency and you are good to go.
I Choose 0805 resistors for comfortable soldering and 1 sided board for simpler operation.

My first test PCB board layout:
P3 to cells, P2 to Atmega32A, 2pin connector to to send commands to all tinys at once.
Image

Testing it in my solar system here
1:55 closer look at PCB
Improved solar system video

Post Reply