diy solar

diy solar

Home build LiFePo4 BMS - what should I be asking?

Padzb

New Member
Joined
Feb 8, 2022
Messages
60
Location
Portugal
Hi gang, new boy here.. so the background >
I live full time on a sailing boat, have done for many years now. Just taken delivery of 4 x 300Ah cells from Jenny at forget the name but cells look perfect. Already onboard there is a reliable home built monitoring system based on a raspberry pi which records data once a second - image below are data from a victron smartshunt as an example.
ETQP1IB.png


So plan is ...... probably esp32 based BMS, ads1115 (accuracy down to a mV or 2) will measure the voltage of each cell, a ds18b20 thermometer will record the temperture - one on each cell maybe?

Then the esp32 will control relays - I've order 2 of these>
So too hot , volts too high/low the relay(s) get switched off. Maybe fit another smartshunt to monitor current in/out.

Cells should get enough charge most days from solar to get the SOC back up after the overnight loads. Not sure of what SOC the cells will cycle at though should be an easy hopefully very long life, At the moment I've 2 x trojan T015's (12v, 225Ah) which go down from full to maybe 70% overnight. There are 2 new Trojans which will stay but probably rarely used.

So far I'm sort of OK with it, keeping an open mind and it will be little careful baby steps then look at the graphs to see what's going on.

So what am I missing?? What should I be asking??

Thanks in advance :cool:
 
Last edited:
How many amps do you need from the battery bank? If the number is close to, or exceeds, the amperage of the typical FET-based BMS then you need to look at contactor BMS. I don't pull that many amps from my battery bank so two of the JBD 4s 120 amp BMS are just right for my needs.
 
What method do you plan for balancing cell voltages? Where in the charge cycle would you do that?
Plan so far is top balance in parallel first then run them for a while to see what happens. The data logging system works very well so each cell voltage gets accurately (1mV) recorded continually once a second to a time based database running on a raspberry pi & graphed so hoping that will flag up any cells drifting. No continual balancing, if they need balancing again once in a while that's what will happen, plenty of time available on a cruising boat ?
Actually, thinking about it, running them for a few days unbalanced first might be some interesting data to have for comparison.

Think it's worth logging temperature of each cell, or just one for the bank?
 
Last edited:
How many amps do you need from the battery bank? If the number is close to, or exceeds, the amperage of the typical FET-based BMS then you need to look at contactor BMS. I don't pull that many amps from my battery bank so two of the JBD 4s 120 amp BMS are just right for my needs.
Link to the latching relays ordered is in the first post, 190A continuous or 1000A for 1s.
Should be OK but the plan is to slowly try every different scenario I can think of and look at real world data. Engine starter motor inrush current will likely be the one of heaviest loads, might rewire that direct to the trojan T-105's. There's a 3kw 240v inverter onboard but don't think I own anything mains voltage more than about 1Kw,nearly everything is 12v low power.
 
Not sure it'll be useful to you but just in case you're interested into reading the process I went through to design my own here it is: https://diysolarforum.com/threads/diy-bms-design-and-reflection.4065/ ;)

How do you plan to measure the voltage of cells 2, 3 and 4?

NB: you'll probably want to add an external Vref to the ADC if you want 1 or 2 mV accuracy, the internal one is probably not accurate enough (I didn't checked tho; it might be enough, even if it's unlikely).
 
Last edited:
Not sure it'll be useful to you but just in case you're interested into reading the process I went through to design my own here it is: https://diysolarforum.com/threads/diy-bms-design-and-reflection.4065/ ;)

How do you plan to measure the voltage of cells 2, 3 and 4?

NB: you'll probably want to add an external Vref to the ADC if you want 1 or 2 mV accuracy, the internal one is probably not accurate enough (I didn't checked tho; it might be enough, even if it's unlikely).
Thanx for the link, always something to learn :cool:
ADS1115 is a 4 channel precision 16 bit voltage sensor, everything in there so no need for an external reference, used them a lot, very accurate. Will need a voltage divider per channel & calibration as can only go about 6v above ground. So channel 1 will be to ground to get a zero then subtract the channel before from each one to get the cell voltage. Works fine, I do the same with my trojans. Matches the trusty fluke meter to the mV so plenty accurate for this. https://www.ti.com/document-viewer/ADS1115/datasheet/description-sbas444783#SBAS444783
Once I know it all works I'll get a PCB made up with FETs to switch the relays and any surface mount components/chips already assembled from jlcpcb.
 
Actually, thinking about it, running them for a few days unbalanced first might be some interesting data to have for comparison.
Then you are building a Battery Monitoring System not a Battery Management System. You are the Battery Cell Manager. That works for four cells but it does not scale up well for 16 in series like I have. Tools to be the BMS would be a power supply capable of going as low as 3.5 volts to put energy into a cell that is low. Also a low Ohm high Wattage power resistor to pull down a cell that is climbing faster than others.
 
Last edited:
Thanx for the link, always something to learn :cool:
ADS1115 is a 4 channel precision 16 bit voltage sensor, everything in there so no need for an external reference, used them a lot, very accurate. Will need a voltage divider per channel & calibration as can only go about 6v above ground. So channel 1 will be to ground to get a zero then subtract the channel before from each one to get the cell voltage. Works fine, I do the same with my trojans. Matches the trusty fluke meter to the mV so plenty accurate for this. https://www.ti.com/document-viewer/ADS1115/datasheet/description-sbas444783#SBAS444783
Once I know it all works I'll get a PCB made up with FETs to switch the relays and any surface mount components/chips already assembled from jlcpcb.

Perfect then ;)
 
Then you are building a Battery Monitoring System not a Battery Management System. You are the Battery Cell Manager. That works for four cells but it does not scale up well for 16 in series like I have. Tools to be the BMS would be a power supply capable of going as low as 3.5 volts to put energy into a cell that is low. Also a low Ohm high Wattage power resistor to pull down a cell that is climbing faster than others.
It will hopefully do both. Stand alone management as in protection (though not active dynamic balancing) but also sends data to a Raspberry Pi to save to an influxdb database once a second. Research so far suggests dynamic balancing just isn't really necessary if not getting anywhere near 100% or 0% SOC but only way to know for sure is log the data & look at the plots. If they do drift a little another top balance every once in a while it's no big deal to do it manually. Luckily for me logging & plotting accurate data is great fun, even my fridge voltage/current/duty cycle is online :p
 
Perfect then ;)
Ta. :)

Similar project which has been up and running for a good while now is in here > https://github.com/boatybits/boatymonpy
It sends the data over wifi/udp to the raspberry pi - runs 24/7 and has been rock solid so far so should be stable - if not I'll know! :geek:

Just hope there are some ads1115 chips around, bit of a global shortage going on..

And ta again for the link, thermometer on each cell to flag up a warm cell is a good idea, alerts/alarms etc are pretty easy to do after the data gets into the database.
 
Research so far suggests dynamic balancing just isn't really necessary if not getting anywhere near 100% or 0% SOC but only way to know for sure is log the data & look at the plots.
Yes with conservative voltage settings you may not see much drift. The risk of loss is only four cells so your downside is less than mine. Are you going to capacity test your cells first?
 
Yes with conservative voltage settings you may not see much drift. The risk of lose is only four cells so your downside is less than mine. Are you going to capacity test your cells first?
Yes, will capacity test the cells individually at some point before it all gets finished. And of course log all the data :cool:
Having another lead acid bank on the boat means the LiFePo4 can be taken offline any time to do another test if needed .. or wanted.. and compare the data.
 
Ta. :)

Similar project which has been up and running for a good while now is in here > https://github.com/boatybits/boatymonpy
It sends the data over wifi/udp to the raspberry pi - runs 24/7 and has been rock solid so far so should be stable - if not I'll know! :geek:

Just hope there are some ads1115 chips around, bit of a global shortage going on..

And ta again for the link, thermometer on each cell to flag up a warm cell is a good idea, alerts/alarms etc are pretty easy to do after the data gets into the database.

Not sure what "Ta" means, but in any case I definitely have the same problem with the global shortage on multiple critical components, it's really annoying :rolleyes:
 
Oh ok, I see. Well, you're welcome ;)

I use ALLPCB personally if you want to check out a JLCPCB alternative ;)
 
BMS slowly coming along - looking at a little breakout box so the main board can stay outside the battery box. 3d terminals are just what came up first, likely screw terminals eventually. Transistors to add to control the relays which looks like will need to be bigger than any surface mount ones but all quite easy, hopefully - I'm neither a programmer or electrical designer :p
JLCPCB min order is 5 boards so might add terminals for a little lcd screen so spare boards can be used for stand along monitoring.
Must have missed something.......:LOL:
All comments/suggestions welcome, thanks.


u0BQV8k.jpg
 
Good job ;)

Must have missed something.......:LOL:

A ground plane? I can tell from the trace connecting the two GND pins of the MCU you don't have one. I'd recommend a ground plane on one side and a power plane (probably the +5V in your case) on the other. Or ground planes on both sides if you prefer that option.

What CAD software do you use?

NB: you can find plenty of MOSFET in SOT-23 package that can control around 1 or 2 A (I wouldn't go higher) and in higher power packages like DPAK you can control dozens of amps so controlling a relay with SMD transistors shouldn't be a problem at all ;)
 
Good job ;)



A ground plane? I can tell from the trace connection the two GND pins of the MCU you don't have one. I'd recommend a ground plane on one side and a power plane (probably the +5V in your case) on the other. Or ground planes on both sides if you prefer that option.

What CAD software do you use?
Ground plane - ah, yes, on the back probably. Ground just for the ads1115 will go direct to the batteries 0v to hopefully stop any voltage drop. Software is online, easyeda.com which links direct to jlcpcb to order the PCBs. They do 3d printing as well, little enclosures might be nice.
Thanks
 
Be careful with routing for and around the ADC, I recommend to follow the datasheet guidelines as close as possible to avoid any problem.
 
Back
Top