DIY Programmable BMS (now using ATtiny/Arduino)

Batteries, Chargers, and Battery Management Systems.
User avatar
hillzofvalp   1 MW

1 MW
Posts: 1861
Joined: Dec 26 2010 2:09am
Location: Los Angeles, CA

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by hillzofvalp » Mar 03 2014 2:31am

dmwahl wrote:
hillzofvalp wrote:I have made a SMD variant of this approach. I will share results soon. I'm not convinced that it is cheaper than analog methods utilizing comparators, however.
It's not necessarily cheaper, but standby power draw is substantially lower. Versions using the TL431 or similar parts will have 200-300uA of quiescent draw just due to the TL431 itself, plus resistor dividers to set cutoff points, and any other parts they may include. It's not a lot, but can easily add up to 0.5mA of constant draw from the cells which will draw around 1Ah every few months. The ATtiny one I put together was averaging around 8uA average draw, which would draw 1Ah every 15 years. That's lower than the normal self discharge of the cell itself.

I'd love to see more details of your design as well, post a link to the thread here when you have it started. SMD is certainly the way to go if you don't mind dealing with the process, the BMS on my bike right now is 100% SMD.

Check out the TS882 and MCP6542 (300nA/500nA) and tell me what you think about using these for an analog bms.

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Mar 03 2014 10:23am

hillzofvalp wrote:Check out the TS882 and MCP6542 (300nA/500nA) and tell me what you think about using these for an analog bms.
Those are just comparators, you'll need a known reference voltage to compare to.

User avatar
hillzofvalp   1 MW

1 MW
Posts: 1861
Joined: Dec 26 2010 2:09am
Location: Los Angeles, CA

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by hillzofvalp » Mar 03 2014 7:21pm

LM4040 or LM285/385 references would be used

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Mar 03 2014 7:27pm

I've used both of those parts and had good results, personally I would use the LM285. As I recall the quiescent current is substantially lower. You don't need the 0.1% precision of something like the 4140 either, 1-2% is generally fine.

User avatar
hillzofvalp   1 MW

1 MW
Posts: 1861
Joined: Dec 26 2010 2:09am
Location: Los Angeles, CA

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by hillzofvalp » Mar 05 2014 3:21pm

The quiescent current is something like 500nA. How could the attiny bms possibly beat this? Where is the primary power draw in an analog bms?

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Mar 05 2014 3:30pm

hillzofvalp wrote:The quiescent current is something like 500nA. How could the attiny bms possibly beat this? Where is the primary power draw in an analog bms?
Unless the only part in your BMS is a comparator, current load will be higher than 500nA.

Regarding power draw in an analog BMS, it depends on the design. Look at the TL431 datasheet and you'll find a lot of it. You need to consider every part when calculating your current draw, even parts with zero theoretical load (ie a capacitor) will have some actual load.

Keep in mind that product datasheets are not only an engineering tool, but a marketing tool as well. The stated 500nA is probably only under ideal conditions and partly to attract the attention of engineers. I wouldn't be at all surprised to see 2-3 times the current draw or more under "real world" conditions.

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Mar 05 2014 5:28pm

hillzofvalp wrote:The quiescent current is something like 500nA. How could the attiny bms possibly beat this? Where is the primary power draw in an analog bms?
Also something to keep in mind, the primary goal of a BMS is not to minimize quiescent current. It's a very good feature, but the difference between 8uA and 500nA in practice is pretty insignificant. If you assume 1% self discharge per month you will find that for a 10Ah pack the self discharge is equivalent to around 130uA of constant load which dwarfs 8uA or 500nA to the point that neither are really significant design factors.

User avatar
hillzofvalp   1 MW

1 MW
Posts: 1861
Joined: Dec 26 2010 2:09am
Location: Los Angeles, CA

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by hillzofvalp » Mar 07 2014 10:48am

I see.

What is the correct code for implementing the optoisolator output for LVC and HVC? I copied the code you used for triggering other events but it doesn't seem to work correctly. I think I got the pins to switch between 1.4V and 3.1V, but the optos never turn on (obviously).

Other than that issue, the brownout protection line does not compile. If I comment it out it works great.

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Mar 07 2014 10:56am

hillzofvalp wrote:I see.

What is the correct code for implementing the optoisolator output for LVC and HVC? I copied the code you used for triggering other events but it doesn't seem to work correctly. I think I got the pins to switch between 1.4V and 3.1V, but the optos never turn on (obviously).

Other than that issue, the brownout protection line does not compile. If I comment it out it works great.
Next to impossible to help debug your code without your code... Perhaps post the relevant sections here.

Also, I would expect the pins to switch between close to 0V and your supply voltage, which I'm assuming is >3.1V. Only going down to 1.4 seems like something else is going on. I was relying on the internal pull-up resistors to keep the various outputs high when off, and then set them low when I wanted to turn on the pin.

User avatar
hillzofvalp   1 MW

1 MW
Posts: 1861
Joined: Dec 26 2010 2:09am
Location: Los Angeles, CA

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by hillzofvalp » Mar 12 2014 4:32pm

Pretty tight fit. Any tips on this (working) layout? This is about 10mm x 37mm. Utilizes standup bleeders
Attachments
attiny.jpg

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Mar 12 2014 10:10pm

hillzofvalp wrote:Pretty tight fit. Any tips on this (working) layout? This is about 10mm x 37mm. Utilizes standup bleeders
Hard to critique without a schematic, but you might as well pack it tight... Doesn't really make it any more difficult to assemble assuming you're using a stencil and reflowing everything. Good job.

User avatar
GiantEV   100 W

100 W
Posts: 195
Joined: Sep 21 2008 2:18am
Location: Albuquerque, NM, USA

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by GiantEV » Sep 08 2014 1:41pm

Looks like you have a couple of irons in the fire. I'm loving the discussions here. Subscribing to this thread as well.

cassschr1   10 kW

10 kW
Posts: 510
Joined: Aug 14 2009 11:57am
Location: LaCrosse, Wisconsin

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by cassschr1 » Oct 20 2014 9:08pm

the threads been dormant for months

silviasol   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by silviasol » Oct 24 2014 2:44pm

Too much for me to read. What advantages does using arduino have? I have seen all sorts of stuff hooked up to them like remotes, lcd displays, wireless stuff...
Current project: 10s 20ah sensored goped hoverboard
http://endless-sphere.com/forums/viewto ... 35&t=62155

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Oct 24 2014 2:57pm

silviasol wrote:Too much for me to read. What advantages does using arduino have? I have seen all sorts of stuff hooked up to them like remotes, lcd displays, wireless stuff...
The advantage to using a microcontroller is extremely low standby power and easy reconfiguration of setpoints by changing the firmware. I used the ATtiny84 and measured an average current draw of 8uA. This was a proof of concept type project and intended to be a starting point for others wishing to do the same.

Using an actual Arduino board would be a bad idea, largely due to the inefficient regulators on board. Using an ATmega328 such as on the Arduino Uno would work fine, but it's overkill and you can save on cost with a more basic microcontroller such as the ATtiny series.

silviasol   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by silviasol » Oct 30 2014 2:41am

Is it possible with the arduino to make some kind of lower power shut off or over amp protection? Like flip a power off switch if it reaches too high of amps or too low of voltage while riding?
Current project: 10s 20ah sensored goped hoverboard
http://endless-sphere.com/forums/viewto ... 35&t=62155

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Oct 30 2014 7:58am

silviasol wrote:Is it possible with the arduino to make some kind of lower power shut off or over amp protection? Like flip a power off switch if it reaches too high of amps or too low of voltage while riding?
It's certainly possible, but for the reasons I mentioned above you would either want a shutoff switch or just use a bare microcontroller, the Arduino boards are for the most part quite inefficient.

User avatar
mwkeefer   10 MW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by mwkeefer » Jan 24 2015 11:47pm

David,

Im ready for the next interation samples to start helping with design and coding if you are still offering or in need of my assistance.

-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

dmwahl   10 kW

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

Re: DIY Programmable BMS (now using ATtiny/Arduino)

Post by dmwahl » Jan 28 2015 9:57am

mwkeefer wrote:David,

Im ready for the next interation samples to start helping with design and coding if you are still offering or in need of my assistance.

-Mike
That would be great. Do you still have the boards I sent you a while ago? They're code compatible, just don't have all the current features like temp sensor, but fine for code work.

Post Reply