DIY Programmable BMS (now using ATtiny/Arduino)

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

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

Re: DIY Modular BMS

Post by dmwahl » May 07 2013 3:37pm

chroot wrote:I think you was refer to 2nd page (viewtopic.php?p=723303#p723303) and 20S bms is longer board than 4S BMS board size. I got it clear picture and sorry for the confusion. :D :thumbup:
The one on page 3 is actually what I meant, from April 17. The larger version you referenced is a 16S through hole board. Same functionally, but just with larger through hole parts. I'm going to make an 6-8S through hole stackable version available as well, as a bare pcb. I just don't want to be working on too many things at once :)

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » May 07 2013 10:18pm

Here is a photo of 4 of the 4 cell modules (16S) attached to and balancing my pack. Sorry it's not the greatest quality, my normal camera battery was dead (ironic?) and I took it with my phone. Not shown is the PWM board. Since I don't yet have a PWM module built up I used an older version of it attached between the charger and balancing modules.

The shunt starts to turn on at about 3.62V and is completely on at 3.64V. Tuning the PWM board requires adjusting a potentiometer until the charging current equals the shunt current, once this is done it will prevent overcharging of the cells. The PWM board is only active when any one of the cells is at the HVC point, otherwise it will allow the full charge current. The first full charge will be the longest as the cells come into balance. After that the balancing period will be much shorter.
IMG_0854.JPG
Balancing shunt active

User avatar
mwkeefer   10 MW

10 MW
Posts: 2263
Joined: Jun 14 2009 8:47am
Location: Malvern, PA USA

Re: DIY Modular BMS

Post by mwkeefer » May 08 2013 2:24pm

Nice work David and props for including the requisite electrical tape roll in the photo, no DIY project proto is complete without electrical or duct tape ;)

Really though its looking good, so... When?

-Mike
Regards,
Mike

{My Rides]
2010 Dahon Jack - GNG v1 - LYEN 6FET - 20/40A - 18S2P10AH - Nom:66.6v,1332w
2004 Hard Rock Pro Disc - Recumpence ms eDrive v4 - Astro 3220 4T - 12S2P16AH - HV110 - Left Side Drive - Gearing: 38mph
Nominal Peak Power @ 60 seconds: 5328 watts - Maximum Power: 49.8v, 120A, 5872w
2010 Downtube 8FH - Stock GNG v1 Stock Controller - EB809XC - 12-16S
2012 Downtube Nova 7spd - Stock GNG v2 - 12S2P10AH - EB809 - 12S-16S - 20A/30A,Nom VCC: 44.4, 888w

User avatar
migueralliart   10 kW

10 kW
Posts: 887
Joined: Apr 08 2011 7:32pm
Location: West Palm Beach , FL
Contact:

Re: DIY Modular BMS

Post by migueralliart » May 08 2013 3:12pm

*Subscribed*

Also I got a brand new 16S LIFEPO4 pack made from 26700 cells that's begging to be the guinea pig.

KUDOS for the work. Its always amazing to see people with the RIGHT attitude do these kinds of things.

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » May 08 2013 3:29pm

mwkeefer wrote:Nice work David and props for including the requisite electrical tape roll in the photo, no DIY project proto is complete without electrical or duct tape ;)

Really though its looking good, so... When?

-Mike
Including the electrical tape wasn't even intentional... just the closest thing I could find to prop up the watts up meter. You're right though, no project is complete without some type of tape.

Regarding when, I still want to run this thing through the paces to be sure there are no unintended features. I hope to have everything tested within the next few weeks. At that point I'll start accepting pre-orders and building them in bulk. I have a website set up for just that purpose, I'll share the link when it's all ready to go. Schematics and BOMs will also be available for anyone who wants to buy the bare PCBs and build them themselves (saving my labor cost).
migueralliart wrote:*Subscribed*

Also I got a brand new 16S LIFEPO4 pack made from 26700 cells that's begging to be the guinea pig.

KUDOS for the work. Its always amazing to see people with the RIGHT attitude do these kinds of things.
Thanks for the kind words. I hope that this will be a benefit to people.

User avatar
mwkeefer   10 MW

10 MW
Posts: 2263
Joined: Jun 14 2009 8:47am
Location: Malvern, PA USA

Re: DIY Modular BMS

Post by mwkeefer » May 08 2013 7:12pm

David,

When your ready to have at least one more set of eyes on any "unknown or unintentional features", let me know... PM or something, I'll build a few modules (12S or 2 modules minimum) and put them into practice along with the charge current limiter.

Just let me know BOM and costs of boards.

Regards,
-Mike
Regards,
Mike

{My Rides]
2010 Dahon Jack - GNG v1 - LYEN 6FET - 20/40A - 18S2P10AH - Nom:66.6v,1332w
2004 Hard Rock Pro Disc - Recumpence ms eDrive v4 - Astro 3220 4T - 12S2P16AH - HV110 - Left Side Drive - Gearing: 38mph
Nominal Peak Power @ 60 seconds: 5328 watts - Maximum Power: 49.8v, 120A, 5872w
2010 Downtube 8FH - Stock GNG v1 Stock Controller - EB809XC - 12-16S
2012 Downtube Nova 7spd - Stock GNG v2 - 12S2P10AH - EB809 - 12S-16S - 20A/30A,Nom VCC: 44.4, 888w

User avatar
fabiograssi   100 W

100 W
Posts: 253
Joined: Jun 14 2009 9:42am
Location: Bauru, Sao Paulo, Brazil
Contact:

Re: DIY Modular BMS

Post by fabiograssi » May 08 2013 8:19pm

:mrgreen: Lipo porn! :mrgreen:

User avatar
Tommy L   100 kW

100 kW
Posts: 1059
Joined: Dec 23 2010 4:33pm
Location: Saint Augustine, Florida USA

Re: DIY Modular BMS

Post by Tommy L » May 09 2013 1:53pm

Don't forget to PM me when you are ready to get some of these out for testing!


:)


Tommy L sends.....Image
http://www.rawvelocity.com

- 4th Hoolagan FS Mtn 9C-2810 with 128v nom 9.2ah A123 40S40P(1.2Kw) - Lyen 18Fet 4115 - 77.8kph :)
http://endless-sphere.com/forums/viewto ... =4&t=39480

- 3rd Catrike 700 Bionx PL350 Velo build
http://www.youtube.com/watch?v=rYdnkaAhVtI

- 2nd 150lbs Pusher Trailer
http://www.youtube.com/watch?v=Q1qTc4sjORY

- 1st Sears NS mtn bike - Rigid 10a drill 800rpm - 2 12v AGM - 1000 watt inverter - 600w dimmer for throttle, wicked torque!

48.2mph/77.8kph Club

User avatar
docnjoj   100 GW

100 GW
Posts: 5786
Joined: Sep 29 2007 5:26pm
Location: Fairhope AL

Re: DIY Modular BMS

Post by docnjoj » May 09 2013 2:58pm

So three modules will do 12S?
otherDoc
E-bike stable at our house

Steintrike Mad Max full suspension trike rear Cute 100H going on: Whoops, Cute wheel broke but I fixed it.
Sun USX delta trike EbikeKit small geared front wheel sort of front suspension for wife

Agniusm/A123 AMP 20 36 volts on the Steini has been taken off.
2x16000 Multisport from HK now gone as they died after 2 years
New Luna 10S bottle battery 13.6AH now on mine
Relatively New 10S4Px2 for wife's bike giving 20ah @ 40 volts home made Panasonic from Tumich. BMS's rule.

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » May 09 2013 3:01pm

docnjoj wrote:So three modules will do 12S?
otherDoc
Right.

silviasol   10 kW

10 kW
Posts: 878
Joined: Dec 30 2012 8:13pm

Re: DIY Modular BMS

Post by silviasol » May 09 2013 5:29pm

dmwahl wrote: 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.
[/color]
So you are running more then 32v on your esr750 now?
Current project: 10s 20ah sensored goped hoverboard
http://endless-sphere.com/forums/viewto ... 35&t=62155

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » May 09 2013 5:44pm

silviasol wrote:
dmwahl wrote: 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.
[/color]
So you are running more then 32v on your esr750 now?
I think you have me mistaken for someone else, I don't own an ESR750.

silviasol   10 kW

10 kW
Posts: 878
Joined: Dec 30 2012 8:13pm

Re: DIY Modular BMS

Post by silviasol » May 09 2013 5:54pm

dmwahl wrote:
silviasol wrote:
dmwahl wrote: 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.
[/color]
So you are running more then 32v on your esr750 now?
I think you have me mistaken for someone else, I don't own an ESR750.
Ok there is another guy names walls something that has a custom bms for his goped. I will have 3-4 7s packs in my scooter later this summer. Any pricing yet? Bare board or completed board prices please.
Current project: 10s 20ah sensored goped hoverboard
http://endless-sphere.com/forums/viewto ... 35&t=62155

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » May 09 2013 6:11pm

silviasol wrote:Ok there is another guy names walls something that has a custom bms for his goped. I will have 3-4 7s packs in my scooter later this summer. Any pricing yet? Bare board or completed board prices please.
Bare boards will be $10 each for either the balancing or PWM modules. Assembled boards will be $40 for the balancing modules, and $45 for the PWM module. I'm hoping to bring the cost down a little, but that's where it's standing right now.

silviasol   10 kW

10 kW
Posts: 878
Joined: Dec 30 2012 8:13pm

Re: DIY Modular BMS

Post by silviasol » May 09 2013 7:48pm

dmwahl wrote:
silviasol wrote:Ok there is another guy names walls something that has a custom bms for his goped. I will have 3-4 7s packs in my scooter later this summer. Any pricing yet? Bare board or completed board prices please.
Bare boards will be $10 each for either the balancing or PWM modules. Assembled boards will be $40 for the balancing modules, and $45 for the PWM module. I'm hoping to bring the cost down a little, but that's where it's standing right now.
Oops, I can only have 7s voltage with my controller, any more voltage will shut down the controller. $10 is an awesome price though! I will have to look at getting a different controller. I have soldering experience so adding the components is no problem. Are the components included in that price? If not can you supply them for extra?
Current project: 10s 20ah sensored goped hoverboard
http://endless-sphere.com/forums/viewto ... 35&t=62155

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » May 09 2013 8:22pm

silviasol wrote:Oops, I can only have 7s voltage with my controller, any more voltage will shut down the controller. $10 is an awesome price though! I will have to look at getting a different controller. I have soldering experience so adding the components is no problem. Are the components included in that price? If not can you supply them for extra?
You can still use it with 7S, just leave the 8th channel parts off. I will be making the BOM available so you can order the parts yourself from digi-key, I suppose I could supply them as well but it would be much easier to just give you a BOM and let you order. At $10 for a bare PCB it's not worth my time to make component kits and if I did the price would be close to an assembled board.

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » May 10 2013 6:46pm

I took a quick video with my phone showing 4 of the balancing modules assembled and balancing my pack. Sorry about the quality, handheld phone videos are never that great.

http://youtu.be/w7f5F0dWk9k

velias   100 W

100 W
Posts: 159
Joined: Aug 11 2008 12:49pm
Location: Reno, NV

Re: DIY Modular BMS

Post by velias » Jun 09 2013 2:46pm

Whats the latest on this project? Is it still being tested? Is it going to be sold soon?

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » Jun 09 2013 10:02pm

velias wrote:Whats the latest on this project? Is it still being tested? Is it going to be sold soon?
Sorry I've been a little MIA, at the moment this has been slowed down due to a number of factors. The primary one is that I've just been too busy to put a lot of time into this. The circuit itself is working fine and has been in use on my own bike for about the last month or so. I'm going to tweak some component values to speed up the actual balance process, but it's about 95% done.

The second reason this has taken a back seat is that I've also been working on an Arduino microcontroller based BMS along with mwkeefer (using TI's BQ76PL536A chips). The See http://endless-sphere.com/forums/viewto ... 14&t=47127 and http://endless-sphere.com/forums/viewto ... 3&p=747150 for details.

To be perfectly frank, building these for people is probably not going to be worth my time right now. In order to be worthwhile, I would need to sell them for a minimum of around $30-$40 per 4S module. I still plan on releasing a through hole version along with a BOM and assembly instructions for anyone interested. PCBs for the build it yourself version will be around $15-20 each and allow you to build up a custom BMS for a reasonable price. Unfortunately moving from surface mount to through hole reduces the parts I can use, so that version is not yet ready.

Sorry for the delay, but this is definitely not a dead project.

User avatar
Arlo1   100 GW

100 GW
Posts: 8338
Joined: Apr 26 2009 10:36pm
Location: Nanaimo
Contact:

Re: DIY Modular BMS

Post by Arlo1 » Jun 10 2013 1:33am

Hats off for DIY SMD work. Sorry I skimmed your thread and did not see how this works. Do they use current when the battery is at rest? I think I read they just send ground signal if LVC is reached? So it could be used to pull the throttle low? But will not cut power to the controller?
Very nice build IM excited to see this.
Does your project need a high performance motor drive, battery charger or other power electronics developed? Let's talk!
www.powerdesigns.ca
Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
Never above 4.2v never below 2.7v EVER!!!
Support me on Patreon. https://www.patreon.com/user/posts?u=6842045
http://www.undergroundelectrics.ca/

flez1966   100 W

100 W
Posts: 103
Joined: Dec 22 2010 9:24am
Location: UK

Re: DIY Modular BMS

Post by flez1966 » Jun 10 2013 2:11am

re the voltage difference jumper possibility, why a jumper, as you sayits large and costly also, just go for a pair of solder pads ppl can drop a blob of solder on...

I just bought my first 4*4s packs, and i have one crappy b6, charging is a pain.

I have spent a week trying out different designs in a simulator but think as you have all the work done best just to pay up lol

can i charge a 4s pack with a 19v supply with this design of yours, I know 4/5v isnt much of an overhead.

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » Jun 10 2013 8:32am

Arlo1 wrote:Hats off for DIY SMD work. Sorry I skimmed your thread and did not see how this works. Do they use current when the battery is at rest? I think I read they just send ground signal if LVC is reached? So it could be used to pull the throttle low? But will not cut power to the controller?
Very nice build IM excited to see this.
When at rest (ie between LVC and HVC points) there is a small current draw through a voltage divider on the TL431 ref input. The resistors on this input are in the 100k range total, so divide 100k into the cell voltage and you'll get an approximation of the steady state draw. For LiFePO4 it's around 40 microamps.

[EDIT] The TL431 actually draws more current than I anticipated, in the range of 200-400 microamps depending on cell voltage. Still small, but not as small as I had hoped. 200 microamps constant draw is about 1 Ah every 7 months. Even the worst case 440 uA draw would still take close to 3 years to deplete a 10Ah pack, although this is a very conservative estimate since the TL431 current load drops off as the cell voltage drops. At the nominal 3.2V for LiFePO4, total current draw would be around 250-300 microamps, or around 4-4.5 years to deplete a 10Ah pack. Hardly a problem in my opinion, but greater than I hoped for.


LVC and HVC both send a ground signal (via an optocoupler). At LVC it's used to cut out the controller by simulating pulling the brake lever, or anything else that triggers on a low signal. It could also be used to trigger a fet array to cut off current, or whatever else you want. I didn't include it since it adds complication and the brake input is sufficient for most people.

The LVC/HVC signal can also be used to limit charge current when below LVC or above HVC.

flez1966 wrote:re the voltage difference jumper possibility, why a jumper, as you say its large and costly also, just go for a pair of solder pads ppl can drop a blob of solder on...

I just bought my first 4*4s packs, and i have one crappy b6, charging is a pain.

I have spent a week trying out different designs in a simulator but think as you have all the work done best just to pay up lol

can i charge a 4s pack with a 19v supply with this design of yours, I know 4/5v isnt much of an overhead.
I'd suggest investing in a decent charger that is adjustable or will only supply up to the max pack voltage. 19V for 4S is 4.75V per cell, way over the safe limit for any chemistry. No BMS will protect against everything. Unless your charge current is less than or equal to the balance shunt current (~150mA for mine) then you will still over charge the cells.
Last edited by dmwahl on Sep 14 2013 8:52am, edited 3 times in total.

dmwahl   10 kW

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

Re: DIY Modular BMS

Post by dmwahl » Sep 14 2013 8:40am

Sorry it has been so long since my last update here, but personal things have got in the way. Anyway, short story is that the prototype boards are built and functioning. I've been riding around with them and charging my pack for a while with no problems.

The problem is they take forever to build as I'm building them all by hand, and with about 45 surface mount parts to place per 4 cell board, it takes me several hours just to build up a few boards. I would have liked to make an all through hole version as well, but the LVC chip I wanted to use isn't available in a through hole package.

As of right now I have 10 bare 4 cell balancing PCBs remaining. If anybody wants to build some themselves, I'll happily sell you the bare boards for cheap ($5 each plus shipping) and share the design data with you (bom, schematic, etc). Warning though, they are all surface mount parts, don't bother trying to solder by hand unless you have a lot of time. I etched my own stencil, applied solder paste, and reflowed the boards myself. Bottom line, it's a pain.

In order to make this more of a true "diy" project, I'm experimenting with a few different ideas. The most promising one right now is using an ATtiny microcontroller to monitor cell voltage, turn the balance resistor on/off, and send an HVC/LVC signal. Component count drops substantially, everything is available in a through hole version, and it's actually less expensive to build than the pure analog version. The added bonus is that since it's microcontroller based, changing the HVC/LVC voltages is as easy as changing 2 variables in the code and re-uploading the firmware, which can all be done using the Arduino IDE (or any other AVR compatible option you prefer).

Thoughts?

deVries   1 MW

1 MW
Posts: 1545
Joined: Jul 10 2008 11:29pm
Location: Solar Powered 3000w Texas

Re: DIY Modular BMS

Post by deVries » Sep 14 2013 2:21pm

dmwahl wrote:As of right now I have 10 bare 4 cell balancing PCBs remaining. If anybody wants to build some themselves, I'll happily sell you the bare boards for cheap ($5 each plus shipping) and share the design data with you (bom, schematic, etc). Warning though, they are all surface mount parts, don't bother trying to solder by hand unless you have a lot of time. I etched my own stencil, applied solder paste, and reflowed the boards myself. Bottom line, it's a pain.

In order to make this more of a true "diy" project, I'm experimenting with a few different ideas. The most promising one right now is using an ATtiny microcontroller to monitor cell voltage, turn the balance resistor on/off, and send an HVC/LVC signal. Component count drops substantially, everything is available in a through hole version, and it's actually less expensive to build than the pure analog version. The added bonus is that since it's microcontroller based, changing the HVC/LVC voltages is as easy as changing 2 variables in the code and re-uploading the firmware, which can all be done using the Arduino IDE (or any other AVR compatible option you prefer).

Thoughts?
Some guy in the UK had a contact in China, and I think he had them make some SMC boards for him relating to your type of setup too. Maybe he would be a good contact to explore that option.

Regarding the through the hole DIY project... you can search on Goodrum and Fechter to see their production runs that ended 3+ years ago. Now, Methods is liquidating his For Sale projects, and is going to work for "the man", so there is definitely a void and hole to be filled by someone now, meaning opening for you, to take-on your project and offer these for DIY sale on ES. No one else is actively doing that now, so if you've got something good, great, go for it. We welcome you to offer it as a DIY offering. 8)

rf   1 kW

1 kW
Posts: 381
Joined: Sep 18 2007 8:02pm

Re: DIY Modular BMS

Post by rf » Sep 14 2013 3:30pm

dmwahl wrote: In order to make this more of a true "diy" project, I'm experimenting with a few different ideas. The most promising one right now is using an ATtiny microcontroller to monitor cell voltage, turn the balance resistor on/off, and send an HVC/LVC signal. Component count drops substantially, everything is available in a through hole version, and it's actually less expensive to build than the pure analog version. The added bonus is that since it's microcontroller based, changing the HVC/LVC voltages is as easy as changing 2 variables in the code and re-uploading the firmware, which can all be done using the Arduino IDE (or any other AVR compatible option you prefer).

Thoughts?
That sounds wonderful.

I keep thinking that if someone will work out the details of monitoring cells with a microcontroller that a flood of different things will become possible, cheaply and easily.

Ultimately, the ability to monitor a large number of cells would be incredibly enabling. Monitoring without loading or draining the cells.

People don't seem to be making the connection. Cheap microprocessors are a hardware hacker's paradise. As you suggest, you can easily tweak a few numbers and make a simple, cheap design a very accurate one. A one dollar chip opens up amazing possibilties.

Here's my favorite. Tiny board, but still solderable. Latest processor, ATmega32U4. $8! Built in USB to program it through, and align it later, etc.

http://tinyurl.com/nnyzq3a

http://www.atmel.com/devices/atmega32u4.aspx

And check this out, the 32U4 A/D has some very nice features.

http://openenergymonitor.org/emon/node/2542

Post Reply