DIY Programmable BMS (now using ATtiny/Arduino)

Batteries, Chargers, and Battery Management Systems.
Post Reply
dmwahl
10 kW
10 kW
Posts: 631
Joined: May 06, 2009 9:41 am
Location: Madison, WI

DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Apr 02, 2013 12:34 pm

I've been designing my own BMS recently and I'm wondering if there would be enough interest on the ES forum to make the bare PCBs (or pre-assembled boards) available.

Current features:
8-24 cells in series, although I could easily expand this to support a higher cell count with just a few component changes (higher voltage rated FETs mostly)
Cell balancing using shunt resistors and TL431 regulators, shunt current around 150-200mA (user configurable)
LVC triggers the controller brake input (or an external cutoff circuit)
HVC during charge turns on a PWM circuit to reduce the charge current
The HVC/LVC trip points and PWM duty cycle are configurable by changing resistor values, so it will work with LiFePO4/LiPo/Li-ion or other future chemistries, as well as a range of charging currents.
If you're charging a pack that has been forcibly discharged below the LVC set point, charge current will also be limited until all of the individual cell voltages are all back above the LVC point.

The overall design will be rugged and simple (K.I.S.S.) and as low cost as possible.

Any thoughts/questions/interested people? A few ES members have already expressed interest.

5/8/2013
EDIT:
Since this first post the specs have changed slightly.
It now supports any number of cells in series, although the PWM circuit can only handle charging voltages between about 32V and 125V (ie 8S-32S LiFePO4). It's highly recommended to use the PWM circuit unless the cells are close to balanced already or you're using a balancing charger.


9/16/2013
EDIT:
The analog version of this has turned out to be a pain to produce and I've been experimenting with using an ATtiny microcontroller instead. Will be reprogrammable using the Arduino tools. Skip to the end of page 5 if you want to ignore the analog design discussion. Schematics are halfway down page 8.
Last edited by dmwahl on Jul 21, 2014 8:39 am, edited 11 times in total.

SamTexas
1 GW
1 GW
Posts: 3004
Joined: Dec 29, 2010 5:34 am
Location: Houston, Texas

Re: DIY BMS

Post by SamTexas » Apr 02, 2013 12:50 pm

I'm very interested. So here is the first question:

Does your BMS create a perpetual imbalance on the battery pack it tries to manage?

sabongi
100 W
100 W
Posts: 181
Joined: Nov 19, 2009 6:30 am

Re: DIY BMS

Post by sabongi » Apr 02, 2013 12:51 pm

I think it´s about time for us to have a BMS for Lipos. A good one. For all of us who build hobbyking packs!!!

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

Re: DIY BMS

Post by dmwahl » Apr 02, 2013 1:17 pm

SamTexas wrote:I'm very interested. So here is the first question:

Does your BMS create a perpetual imbalance on the battery pack it tries to manage?
Could you clarify the question a bit? Are you wondering if the control circuitry draws power from the first 8 cells only and therefore causes an imbalance? Or some other mechanism?

My last pack was killed by a BMS (signalab) creating (or allowing) imbalance, it was supposedly a balancing bms but the balance current was so low that it would have taken days on the charger after each charge.

No design is perfect, but one of the reasons I'm designing my own is I want to ensure a properly balanced pack all the time.

SamTexas
1 GW
1 GW
Posts: 3004
Joined: Dec 29, 2010 5:34 am
Location: Houston, Texas

Re: DIY BMS

Post by SamTexas » Apr 02, 2013 1:24 pm

dmwahl wrote:
SamTexas wrote:I'm very interested. So here is the first question:

Does your BMS create a perpetual imbalance on the battery pack it tries to manage?
Could you clarify the question a bit? Are you wondering if the control circuitry draws power from the first 8 cells only and therefore causes an imbalance? Or some other mechanism?
I would like to know if the control circuitry draws power from just a few cells in a pack, or from the pack.

Example: A BMS for n cells (or groups of cells) in series. The control circuitry draws power from m cells in series.
If m = n, then no imbalance is created by the BMS
if m < n, then the BMS is creating a perpetual imbalance.

Which one is yours?
dmwahl wrote:... I want to ensure a properly balanced pack all the time.
That is possible/doable if m=n.

If m < n, then it's just hot air. Because the pack is NEVER BALANCED.

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

Re: DIY BMS

Post by dmwahl » Apr 02, 2013 2:33 pm

It will draw equally across all the cells.

The control circuitry is powered by the individual cells when not charging. When charging the PWM circuitry is supplied by the charger itself, and disconnected as soon as you disconnect the charger. This gave a bit more wiggle room on regulator selection.

When the charger is disconnected the only draw is from the individual cell monitors, and they draw about 40 microamps total. At that rate it will take almost 3 years to discharge the pack by 1Ah, ignoring cell self discharge. This could be reduced, but the balancing circuit stability would suffer.

SamTexas
1 GW
1 GW
Posts: 3004
Joined: Dec 29, 2010 5:34 am
Location: Houston, Texas

Re: DIY BMS

Post by SamTexas » Apr 02, 2013 2:43 pm

dmwahl wrote: The control circuitry is powered by the individual cells when not charging...
When the charger is disconnected the only draw is from the individual cell monitors,
So when not in charging mode, does the control circuitry draw EQUALLY ACROSS ALL CELLS? Yes or No?

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

Re: DIY BMS

Post by dmwahl » Apr 02, 2013 2:50 pm

SamTexas wrote:
dmwahl wrote: The control circuitry is powered by the individual cells when not charging...
When the charger is disconnected the only draw is from the individual cell monitors,
So when not in charging mode, does the control circuitry EQUALLY draw ACROSS ALL CELLS? Yes or No?
Yes, the draw across all cells will be equal. Each cell has it's own monitoring circuit, and they are all identical.

There will be some very small variation due to the component tolerances, worst case 2-3%. You will never get perfectly equal draw across the cells. Even using 0.1% resistors for the 431 divider network there will be some inherent imbalance between them.

SamTexas
1 GW
1 GW
Posts: 3004
Joined: Dec 29, 2010 5:34 am
Location: Houston, Texas

Re: DIY BMS

Post by SamTexas » Apr 02, 2013 3:17 pm

That sounds good. So it appears to me it's a "slave/master" scheme. But that's speculation on my part. Where can I find a high level block diagram?

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

Re: DIY BMS

Post by dmwahl » Apr 02, 2013 3:24 pm

SamTexas wrote:That sounds good. So it appears to me it's a "slave/master" scheme. But that's speculation on my part. Where can I find a high level block diagram?
I'll put one together and post it here. I'd scan the one in my notebook but that would just be embarrassing.

SamTexas
1 GW
1 GW
Posts: 3004
Joined: Dec 29, 2010 5:34 am
Location: Houston, Texas

Re: DIY BMS

Post by SamTexas » Apr 02, 2013 3:30 pm

dmwahl wrote: The overall design will be rugged and simple (K.I.S.S.) and as low cost as possible.
"Low cost" means different things to different people. What are the expected costs for a 4s, 7s, 10s and 14s unit.

SamTexas
1 GW
1 GW
Posts: 3004
Joined: Dec 29, 2010 5:34 am
Location: Houston, Texas

Re: DIY BMS

Post by SamTexas » Apr 02, 2013 3:32 pm

dmwahl wrote:
SamTexas wrote:That sounds good. So it appears to me it's a "slave/master" scheme. But that's speculation on my part. Where can I find a high level block diagram?
I'll put one together and post it here. I'd scan the one in my notebook but that would just be embarrassing.
Can't speak for others, but I value function over form.

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

Re: DIY BMS

Post by dmwahl » Apr 02, 2013 3:39 pm

I'm with you on function being the priority, there are plenty of poorly functioning BMSes out there already, no sense adding another.

I'm still working on the final layout and BOM but I'll post it when I have it.

-dg
1 kW
1 kW
Posts: 376
Joined: Jun 01, 2012 4:38 am
Location: Oakland, CA USA

Re: DIY BMS

Post by -dg » Apr 03, 2013 1:28 am

dmwahl wrote:I've been designing my own BMS recently and I'm wondering if there would be enough interest on the ES forum to make the bare PCBs (or pre-assembled boards) available.
I am interested. Thanks for your work so far.
If simplicity worked, the world would be overrun with insects.

emiyata
100 W
100 W
Posts: 177
Joined: Mar 04, 2012 4:18 pm
Location: Tomah WI

Re: DIY BMS

Post by emiyata » Apr 03, 2013 1:54 am

dmwahl wrote: Any thoughts/questions/interested people? A few ES members have already expressed interest.
I would be interested in board(s). I live 1.5 hr from you. Will you be sending data out of a com port so I can capture the data on my cpu board so I can display cell status? I would like to read battery temperature at some point. Using common thermistors. I can populate the boards.

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

Re: DIY BMS

Post by dmwahl » Apr 03, 2013 7:58 am

emiyata wrote:
dmwahl wrote: Any thoughts/questions/interested people? A few ES members have already expressed interest.
I would be interested in board(s). I live 1.5 hr from you. Will you be sending data out of a com port so I can capture the data on my cpu board so I can display cell status? I would like to read battery temperature at some point. Using common thermistors. I can populate the boards.
This one is a purely analog design, so no com ports. At some point I'd like to do a microprocessor version that would include a data port, but there's a lot more work involved in that. What cpu board are you using?

emiyata
100 W
100 W
Posts: 177
Joined: Mar 04, 2012 4:18 pm
Location: Tomah WI

Re: DIY BMS

Post by emiyata » Apr 03, 2013 9:59 am

dmwahl wrote: This one is a purely analog design, so no com ports. At some point I'd like to do a microprocessor version that would include a data port, but there's a lot more work involved in that. What cpu board are you using?
I am using a Arduino Nano 3.0 with ATMEGA328. In time I could connect another one up and read analog voltages and send the data to the main cpu . The cpu boards are like $10. Reading voltages using test points keeps the board looking clean and not so hacked up. If traces need to be cut so that DACs can replace analog ref voltages, the use of two triangles on a trace pointing at each would be nice .
If you need parts contact me I may have the parts you need. Lots of analog parts in bins. Your not that far away and my sister lives in Madison and I make it there from time to time.

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

Re: DIY BMS

Post by dmwahl » Apr 03, 2013 10:36 am

emiyata wrote:
dmwahl wrote: This one is a purely analog design, so no com ports. At some point I'd like to do a microprocessor version that would include a data port, but there's a lot more work involved in that. What cpu board are you using?
I am using a Arduino Nano 3.0 with ATMEGA328. In time I could connect another one up and read analog voltages and send the data to the main cpu . The cpu boards are like $10. Reading voltages using test points keeps the board looking clean and not so hacked up. If traces need to be cut so that DACs can replace analog ref voltages, the use of two triangles on a trace pointing at each would be nice .
If you need parts contact me I may have the parts you need. Lots of analog parts in bins. Your not that far away and my sister lives in Madison and I make it there from time to time.
I wasn't planning on adding voltage reference points, primarily because through hole components are pretty easy to take readings off of. You could also use the header for the cell connections. I attached a screenshot of part of the board. P104 on the far left is the cell connections. Pin 1 is the negative terminal of cell 1, pin 2 the positive terminal of cell 1, pin 3 the positive terminal of cell 2, and so on. Will that meet your needs or did you have something else in mind?
4-cell_routed.png
4-cell_routed.png (75.76 KiB) Viewed 175 times

User avatar
migueralliart
100 kW
100 kW
Posts: 1268
Joined: Apr 08, 2011 7:32 pm
Location: West Palm Beach , FL
Contact:

Re: DIY BMS

Post by migueralliart » Apr 03, 2013 12:09 pm

Subscribed!

emiyata
100 W
100 W
Posts: 177
Joined: Mar 04, 2012 4:18 pm
Location: Tomah WI

Re: DIY BMS

Post by emiyata » Apr 03, 2013 1:09 pm

dmwahl wrote:
I wasn't planning on adding voltage reference points, primarily because through hole components are pretty easy to take readings off of. You could also use the header for the cell connections. I attached a screenshot of part of the board. P104 on the far left is the cell connections. Pin 1 is the negative terminal of cell 1, pin 2 the positive terminal of cell 1, pin 3 the positive terminal of cell 2, and so on. Will that meet your needs or did you have something else in mind?
4-cell_routed.png
I was thinking you had surface mount parts and they are harder to mount wires. You are using through hole so everything should be fine. In a high vibration environment things need to be fairly stable.
If you are ordering parts I will need need some. Just msg me. I can send you money. If not I will need a BOM so I can order parts. Also if you have a BOM you can send me I have lots of new analog parts and could see what I have in my bins to reduce the cost of building the boards.

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

Re: DIY BMS

Post by dmwahl » Apr 03, 2013 1:17 pm

emiyata wrote:
dmwahl wrote:
I wasn't planning on adding voltage reference points, primarily because through hole components are pretty easy to take readings off of. You could also use the header for the cell connections. I attached a screenshot of part of the board. P104 on the far left is the cell connections. Pin 1 is the negative terminal of cell 1, pin 2 the positive terminal of cell 1, pin 3 the positive terminal of cell 2, and so on. Will that meet your needs or did you have something else in mind?
4-cell_routed.png
I was thinking you had surface mount parts and they are harder to mount wires. You are using through hole so everything should be fine. In a high vibration environment things need to be fairly stable.
If you are ordering parts I will need need some. Just msg me. I can send you money. If not I will need a BOM so I can order parts. Also if you have a BOM you can send me I have lots of new analog parts and could see what I have in my bins to reduce the cost of building the boards.
I was originally going to use surface mount parts since they're cheaper and smaller (so the PCB would be cheaper) but I decided against it since I wanted to make this available to the DIY crowd. I'll post a BOM when it's complete.

My estimate on the BOM cost (based on Mouser pricing) will be around $7 plus about $1.50 per cell. Most quantity discounts start around 25-100, so if you're building multiples then the cost will decrease.
Last edited by dmwahl on Apr 03, 2013 3:31 pm, edited 2 times in total.

emiyata
100 W
100 W
Posts: 177
Joined: Mar 04, 2012 4:18 pm
Location: Tomah WI

Re: DIY BMS

Post by emiyata » Apr 03, 2013 1:37 pm

dmwahl wrote: My estimate on the BOM cost (based on Mouser pricing) will be around $7 plus about $1.50 per cell. Most quantity discounts start around 25-100, so if you're building multiples then the cost will decrease.
I would guess I would build 10 4 cell units to start with and go from there. Ordering that quantity I assume you bread boarded the design and works for the most part.

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

Re: DIY BMS

Post by dmwahl » Apr 03, 2013 1:59 pm

emiyata wrote:
dmwahl wrote: My estimate on the BOM cost (based on Mouser pricing) will be around $7 plus about $1.50 per cell. Most quantity discounts start around 25-100, so if you're building multiples then the cost will decrease.
I would guess I would build 10 4 cell units to start with and go from there. Ordering that quantity I assume you bread boarded the design and works for the most part.
The current one only supports down to 8 cells with the charge throttling (PWM) circuit, although it would work on smaller packs with a few modifications. The individual cell monitors (LVC, HVC, balancing) will work on any number of cells. If you're interested in the charge throttling on your 4 cell packs then I can modify the schematic to support that as well but it will take some time. I've been considering doing a stand-alone charger controller to go between a pack and the charger as well, one thing at a time though :)

What are you building the 4S packs for? Are they LiFePO4 or some other chemistry?

emiyata
100 W
100 W
Posts: 177
Joined: Mar 04, 2012 4:18 pm
Location: Tomah WI

Re: DIY BMS

Post by emiyata » Apr 04, 2013 1:54 am

dmwahl wrote: What are you building the 4S packs for? Are they LiFePO4 or some other chemistry?
I was assuming you are using many boards if you run higher voltage 4s is your smallest size. I will use laptop batteries lots of them on a cargo bike. I will run 13-14s 30-40 ah. You are making a bigger board and people just populate what they need? I guess without a block diagram I have no idea how it will work. The features sound good. Have you bread boarded this BMS?

User avatar
circuit
100 kW
100 kW
Posts: 1411
Joined: Mar 19, 2009 11:43 am
Location: EU
Contact:

Re: DIY BMS

Post by circuit » Apr 04, 2013 2:26 am

How is this one different from numerous other TL431 based "BMS"?
smart and Tiny BMS solution
Visit my blog. Personal projects: Clean Peugeot conversion | Ultralight enduro
Any and all information, such as texts, specifications, drawings or other material that I post are to be used only as a reference for personal, non-commercial projects ONLY. Any republication for personal or commercial needs must be agreed on individually. Use of any information, that I post, for commercial purposes is strictly prohibited.

Post Reply