Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 27-09-2022, 14:32   #1
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,235
Build your own BMS

With all the boats building their LiFePO4 batteries, I think there are plenty with the skills to build their own BMS using simple Arduino modules.

So here’s the first draft of the diagram, based on my BMS which is in a state that can be called “experimental”. I have old threads with some hardware and software but at that time it was for a 12V battery, while I switched to 24V since then.

Please note that the components used can also work on 12V but not on 48V.

The cost of Arduino, INA226 modules, temperature sensors and OLED display is only a handful of dollars and available on Amazon. If you have a little experience with soldering and programming then this isn’t just the best way to go, it’s also fun to do.

I will be posting below with more details.
Attached Thumbnails
Click image for larger version

Name:	yaBMS-3.jpg
Views:	719
Size:	409.9 KB
ID:	265052  
__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Old 27-09-2022, 14:44   #2
Registered User

Join Date: Mar 2016
Location: San Francisco
Boat: Morgan 382
Posts: 3,123
Re: Build your own BMS

I'm toying with this idea in my mind. Mostly a time issue right now. However, I wouldn't want to rely solely on a microprocessor. I would want a simple hardware based BMS that monitored the extremes of the voltage limits, and a microprocessor that was programable with user limits, alarm signaling etc. Still fairly simple, although some component level design is needed. Or, you could probably parallel a cheap $10 module with an Arduino.

It's a fairly simple project for someone with some experience, and the cost is quite low.
__________________
-Warren
wholybee is offline   Reply With Quote
Old 27-09-2022, 14:46   #3
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,235
Re: Build your own BMS

Quote:
Originally Posted by wholybee View Post
I'm toying with this idea in my mind. Mostly a time issue right now. However, I wouldn't want to rely solely on a microprocessor. I would want a simple hardware based BMS that monitored the extremes of the voltage limits, and a microprocessor that was programable with user limits, alarm signaling etc. Still fairly simple, although some component level design is needed. Or, you could probably parallel a cheap $10 module with an Arduino.

It's a fairly simple project for someone with some experience, and the cost is quite low.
-all- BMS’s rely on the same microcontroller setup. There exists no BMS without it.
__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Old 27-09-2022, 15:02   #4
Registered User

Join Date: Mar 2016
Location: San Francisco
Boat: Morgan 382
Posts: 3,123
Re: Build your own BMS

I don't believe that is true. The cheapest ones use simple transistor logic and resistors to control a FET on/off based on voltage inputs. I've come across dozens of schematics that show this. I can't say with absolute certainty that programmable BMS's do or don't maintain a simple hardware failsafe, but I expect they do. The overkill solar BMS does have "hardware" protection limits given in the manual but I've not looked at a schematic to confirm it. If it can be shown that a REC or similar doesn't, that makes the job easier, that's for sure.
__________________
-Warren
wholybee is offline   Reply With Quote
Old 27-09-2022, 17:34   #5
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,711
Images: 2
Re: Build your own BMS

I am interested in this project and will be following it. Thanks for sharing.
rgleason is offline   Reply With Quote
Old 27-09-2022, 17:54   #6
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,235
Re: Build your own BMS

Cell voltage measurements:

The main issue is that you normally need galvanic isolation to do these measurements, making it all complicated unless you use specialized chips. So the way it is done here is to measure between the battery negative and each cell’s positive. This means the first module measures 3.2V, the second 6.4V, then 9.6, 12.8, 16, 19.2, 22.4 and 25.6V. The INA226 can do these voltages easily and it’s up to the microcontroller to substract the previous cell’s voltage to get back to the 3.2V cell voltage. This is a very neat for-next loop in code.

These INA226 modules cost $5 each on Amazon and communicate over the I2C bus with the micro. We only use the Vin to measure voltage, ignoring the shunt and current & power measurements.

Each module needs a unique address on the I2C bus, for which solder pads are available. For 8 modules you need to do a little work; I believe 4 need a link cut, but the PCB is marked on how to do this.

For a 12V version you can also use the INA219 modules, which I just saw for $3 each on Amazon.

The OLED module is another I2C bus device and has standard libraries in the Arduino IDE available. Now you can design nice displays. The picture is from a couple years ago when I was designing the BMS
Attached Thumbnails
Click image for larger version

Name:	4C5C1C3D-F7F3-4632-B4D6-A195AD337E23.jpeg
Views:	131
Size:	114.0 KB
ID:	265062  
__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Old 27-09-2022, 21:24   #7
Registered User

Join Date: Jul 2011
Location: Australia Mannum South Australia
Posts: 644
Re: Build your own BMS

What I'd like is cell top boards that only measured the voltage of that cell and had a programmable alarm signal for low cell voltage and a separate alarm for high cell voltage.
The issue arises sending this information back to the main control board. CANBUS is the idea method but that pushes beyond the simple and into the relm of those that better understand just how CANBUS works and be able to understand what the signal looks like if there is a problem with the CANBUS itself.
Every system owner would need to be able to read, interpret and diagnose any such problem and this is where the whole thing falls over, if every system owner knew how to do this, there would be no high paid professionals following the career path .... a bit like graphic designers and web designers and those that repaired the photo development machines that processed exposed rolls of film .... still highly skilled but a skill not worth much these days ....

The tricky part is building a BMS out of basic off the shelf components and build in levels of redundancy, so if one part starts giving trouble, there is work around till the faulty part can be replaced ... just getting the faulty part can be the real problem when remote, so simply replacing the whole unit by carrying a spare becomes complex and expensive.

We built our own BMS units some 12 yrs ago, 7 levels of redundancy, the last level the system operator becomes the BMS, the second last level is battery isolation if no one heard or responded to all the alarms and flashing lights. This protects at both high cell voltage and low cell voltage but can determine if the cell voltage alarm is the real thing or a false alarm.

Sadly. a number of the parts required to build this BMS are now becoming near impossible top source, I'm fine with microprocessors, just as long as there is another micro processor further down the line that can step in to protect the battery if an upstream microprocessor drops its bundle .....

T1 Terry
T1 Terry is offline   Reply With Quote
Old 27-09-2022, 21:54   #8
Registered User
 
Zanshin's Avatar

Join Date: Feb 2007
Location: Caribbean
Boat: Jeanneau 57
Posts: 2,329
Images: 3
Re: Build your own BMS

I'm also working on a BMS using the INA229 for my 28V system. But if all you want the INA229 for is voltage measurement there are cheaper and better chips on the market. I use the 229 to also measure power, which is what it is built for and excels at. No need to write a library for the Arduino, I've got one that works interchangeably for most INA2xx chips: Zanduino INA Library
__________________
Zanshin sailing
Zanshin is offline   Reply With Quote
Old 27-09-2022, 22:31   #9
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,235
Re: Build your own BMS

Quote:
Originally Posted by T1 Terry View Post
What I'd like is cell top boards that only measured the voltage of that cell and had a programmable alarm signal for low cell voltage and a separate alarm for high cell voltage.
The issue arises sending this information back to the main control board. CANBUS is the idea method but that pushes beyond the simple and into the relm of those that better understand just how CANBUS works and be able to understand what the signal looks like if there is a problem with the CANBUS itself.
Every system owner would need to be able to read, interpret and diagnose any such problem and this is where the whole thing falls over, if every system owner knew how to do this, there would be no high paid professionals following the career path .... a bit like graphic designers and web designers and those that repaired the photo development machines that processed exposed rolls of film .... still highly skilled but a skill not worth much these days ....

The tricky part is building a BMS out of basic off the shelf components and build in levels of redundancy, so if one part starts giving trouble, there is work around till the faulty part can be replaced ... just getting the faulty part can be the real problem when remote, so simply replacing the whole unit by carrying a spare becomes complex and expensive.

We built our own BMS units some 12 yrs ago, 7 levels of redundancy, the last level the system operator becomes the BMS, the second last level is battery isolation if no one heard or responded to all the alarms and flashing lights. This protects at both high cell voltage and low cell voltage but can determine if the cell voltage alarm is the real thing or a false alarm.

Sadly. a number of the parts required to build this BMS are now becoming near impossible top source, I'm fine with microprocessors, just as long as there is another micro processor further down the line that can step in to protect the battery if an upstream microprocessor drops its bundle .....

T1 Terry
That was how I started: a module per cel. It is very easy to do with an ATtiny and to communicate back to the central unit is the problem. The best way is to convert the measured voltage to a frequency, which can be pushed through an opto-isolator and decoded at the main module. By that time it is way better to throw $3 or $5 at each cell for an INA226 chip and get 16-bit precision measurements over I2C bus.
__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Old 27-09-2022, 22:48   #10
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,235
Re: Build your own BMS

Quote:
Originally Posted by Zanshin View Post
I'm also working on a BMS using the INA229 for my 28V system. But if all you want the INA229 for is voltage measurement there are cheaper and better chips on the market. I use the 229 to also measure power, which is what it is built for and excels at. No need to write a library for the Arduino, I've got one that works interchangeably for most INA2xx chips: Zanduino INA Library
Nice, using interrupt handlers. I used the Adafruit library but will go over everything again. You needed 20-bit precision?
__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Old 27-09-2022, 23:01   #11
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,235
Re: Build your own BMS

Here’s another picture from the prototyping: it has 4 INA219 modules and 3 different types of temperature sensors. This was a working BMS on a breadboard after I added control of a Blue System RBS. I used overkill, too large mosfets for that so will downscale it probably to a transistor. I’m trying to make it work with 3.3V vcc this time so we can use newer Arduinos with wifi and Bluetooth.

For temperature I have changed my mind and am now using the OneWire sensors because of their easy of use. You can buy waterproof models and slap them on and it’s done.
Attached Thumbnails
Click image for larger version

Name:	4EDE419B-8068-44D5-BA02-282621B8E6E8.jpeg
Views:	136
Size:	350.6 KB
ID:	265072   Click image for larger version

Name:	B5BAFC64-01E4-443B-854D-BECFC0FD3FDA.jpg
Views:	128
Size:	430.9 KB
ID:	265073  

__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Old 27-09-2022, 23:44   #12
Registered User

Join Date: Mar 2022
Location: Ontario Canada
Boat: Jeanneau SO 389
Posts: 1,969
Re: Build your own BMS

My oldest grandson and I have been playing with Ardunio and Raspberry pi. In 2008 Jeanneau came out with a Sailing option so you didn’t list too much during a dinner cruise. Turned out to be a raspberry pi type private board which is exactly what everyone BMS out there. A raspberry or Ardunio is too expensive. Two raspberries can watch each other and take over if one is taxed. We managed to follow Jupiter and build an Ardunio dissolved oxygen tester on a bread board. It recycles every 30 seconds. Got the design from the Ardunio projects forum. It drew 2Amp off one of my 200-400 amp banks and blew up real good. I’ve found it’s best to run either off a on board lithium 2400mA and charger. While the raspberry may shield itself from high amps it doesn’t protect other boards from drawing killer 2.
I use a Raspberry on my 3D printers with software called octopus. I print some high tech stuff with Pa6-11 Nylon for marine use. I make a bunch of ASA items for marine use. One is a waterproof to 1 atmosphere raspberry pi case. Has two ports. Inner carriage to hold one pi and one wireless board one battery.
They are dirt cheap if you need one. Takes 16 hours to print all the parts. If anyone is interested it will save you at least $40.00 just on a case for wet location.
Anyone interested I take some photos or if anyone wants the data I consider it public domain and print it yourself. I use ASA to print it. Water UV and impact strength is hard to beat. The pi in my boat opens a power hatch turns on heat air golden rods in winter. Has its own cell line watches with two cameras (one failed during winter) I’m also 3D printing my 3rd attempt to make a raspberry camera housing which will aim any direction on command. Has two 90 RC servos. The blue one. Cooked both during winter.
. I bought the new Sony pi Camera. WOW.
I’m currently printing a 2 year old life size TRex and a Rasoberry has been helping my optimize the best position to print each bone in. 90 hours to print the Cevical vertebrae.
I rather buy a BMS of a local electronics geek than China so please keep it up.
Rumrace is offline   Reply With Quote
Old 28-09-2022, 04:38   #13
Nearly an old salt
 
goboatingnow's Avatar

Join Date: Jun 2009
Location: Lefkas Marina ,Greece
Boat: Bavaria 36
Posts: 22,801
Images: 3
Re: Build your own BMS

Quote:
Originally Posted by wholybee View Post
I don't believe that is true. The cheapest ones use simple transistor logic and resistors to control a FET on/off based on voltage inputs. I've come across dozens of schematics that show this. I can't say with absolute certainty that programmable BMS's do or don't maintain a simple hardware failsafe, but I expect they do. The overkill solar BMS does have "hardware" protection limits given in the manual but I've not looked at a schematic to confirm it. If it can be shown that a REC or similar doesn't, that makes the job easier, that's for sure.


Microcontroller is a much better job.
__________________
Interested in smart boat technology, networking and all things tech
goboatingnow is offline   Reply With Quote
Old 28-09-2022, 04:42   #14
Nearly an old salt
 
goboatingnow's Avatar

Join Date: Jun 2009
Location: Lefkas Marina ,Greece
Boat: Bavaria 36
Posts: 22,801
Images: 3
Build your own BMS

Nick thanks for posting.

I’m using esp32 as it’s more powerful and can report via wifi Bluetooth or CAN , I’m looking at multiplexing the voltage measurement as it’s used one high performance ADC and One calibration


I’m ploughing through understanding the VE.CAN protocol but I think I’ll use my yacht devices nmea2000 wifi gateway to get monitoring data onto the nmea 2000 bus.

The bigger task is a iPhone app to allow it all to be configured and monitored.

As I am installing a Rut950 lTE gateway it then should be practical to monitor it on internet as I’m not convinced by the Venus Os Victron system.
__________________
Interested in smart boat technology, networking and all things tech
goboatingnow is offline   Reply With Quote
Old 28-09-2022, 06:25   #15
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,235
Re: Build your own BMS

Quote:
Originally Posted by goboatingnow View Post
Nick thanks for posting.

I’m using esp32 as it’s more powerful and can report via wifi Bluetooth or CAN , I’m looking at multiplexing the voltage measurement as it’s used one high performance ADC and One calibration


I’m ploughing through understanding the VE.CAN protocol but I think I’ll use my yacht devices nmea2000 wifi gateway to get monitoring data onto the nmea 2000 bus.

The bigger task is a iPhone app to allow it all to be configured and monitored.

As I am installing a Rut950 lTE gateway it then should be practical to monitor it on internet as I’m not convinced by the Venus Os Victron system.
A BMS doesn’t require a powerful microcontroller but things like CanBus, Bluetooth and wifi are only available on the powerful units. I like the Teensy with on board CANbus. I also like the new Arduino MKR 1010 with the Arm Cortex. You simply build a website as front-end for the BMS.

But none of that is needed, all it needs to do is monitor and protect the battery. The more invisible the better
__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing a drop in batteries BMS with your own alctel Lithium Power Systems 23 29-06-2022 07:50
Do you have to be up for your own maintenance and repairs to sensibly own a sailboat Rblakenyc General Sailing Forum 68 31-01-2021 16:42
Yet another LFP and BMS build tanglewood Lithium Power Systems 0 19-11-2018 07:40
LiFe(Y)PO4 BMS Dessign - good reading for DIY BMS developers CatNewBee Lithium Power Systems 10 20-09-2018 00:15
Did you build your own compost toilet? Are you using it successfully on your boat? magentawave Liveaboard's Forum 9 28-06-2013 12:36

Advertise Here


All times are GMT -7. The time now is 03:24.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.