diy solar

diy solar

DIY BMS design and reflection

But all that is a personal choice of course
What is great about this forum is that there are sooooo many different approaches and ideas. That gives you the opportunity to weigh the pros and cons of each and decide what works best for you. The other nice thing is that the forum is fairly civil. For the most part, people are willing to acknowledge that what works for them may not be the only 'right' way and other approaches may suit someone else better. I have been on forums that are less civil and frankly, I rarely participate when they are contentious. Kudos to @Will Prowse for fostering a helpful, collaborative spirit on the forum.
 
Shorts are taken care of by the fuse next to the battery.

Of course I'll put a fuse too, the BMS will not (and shouldn't IMHO) take the place of a fuse. But having the BMS being able to stop the short circuit is a lot safer as it is a lot quicker than a fuse and it also save an expensive fuse (and it's a lot less harsh on the FETs as a fuse is pretty slow and they would probably fry before it cuts the current).

What is great about this forum is that there are sooooo many different approaches and ideas. That gives you the opportunity to weigh the pros and cons of each and decide what works best for you. The other nice thing is that the forum is fairly civil. For the most part, people are willing to acknowledge that what works for them may not be the only 'right' way and other approaches may suit someone else better. I have been on forums that are less civil and frankly, I rarely participate when they are contentious. Kudos to @Will Prowse for fostering a helpful, collaborative spirit on the forum.

Yep, I know my approach is a bit extreme on the redundancy and safety side but I don't want to ruin thousands of $ of cells and certainly don't want a fire so I think it's worth it (and also for other things like the ethernet interface, more accuracy, ...). Of course someone wanting just a fuse and no BMS is fine too if it works for him/her ;)
 
Fuses are perfect to detect shorts. Fuses blow due to dissipated energy. In other words, they have a time component. A fuse will not blow if there’s a high surge current for a short period of time. Does your circuit have that capability?

What’s your max allowable current? Charge? Discharge?
Where does over-current trip?
Once tripped, do you require a manual reset, or does the BMS attempt to restart?

What’s the current measurement resolution?
 
Yep, it can handle 400 A for 20 or 30 seconds.

Charge and discharge continuous max is 300 A

Max peak is 400 A

I have both software and hardware OC detection and they both have continuous and short term limits (hardware ones are set a bit higher than the software ones, which are user settable anyway). Hardware require manual reset (and has a dedicated button), software can be either manual or auto reset (or manual for some faults and auto for others, I'll see when I'll be at the software part).

Resolution can be pretty high; I use a 16 bits ADC and then you can use a x A shunt with a 50, 75 or 100 mV output (the recommended one would be a 500 A 50 or 75 mV shunt) which will get amplified to match the Vref scale (currently you need to replace 2 resistors to set the shunt voltage but I'll try to change that and have solderable jumpers, similar to set the chemistry type).

So with a 500 A shunt you have a 15 mA resolution (0.003 %) but the accuracy is of course lower. There's the shunt accuracy, the amplifier accuracy, the Vref accuracy and the ADC accuracy at play. Most of the errors can be calibrated because they are offsets and gain errors but some of them aren't linear or they are temperature dependent for example so you can't really avoid them (but fortunately they should be pretty small). I plan to achieve at least 0.1 %, ideally 0.01 % (not counting the shunt as you can use a 10 $ chinese one or a more accurate but more expensive one).

You can see all that on the BMSB and HWPB schematics, I attached them to this post ;)

The BMS board is the main one, the HWP (hardware protections) board is an add-on plugin on top of it, and on the bottom side of the BMSB you can stack up to 3 passive balancing boards depending on how much balancing current you want, 1.5 A (maybe 1.2 A for thermal reasons, we'll see) per board. Then you have the DPB (disconnect and precharge board) I'm finishing routing who handles all the high current things, and the last board is the HMI board which is basically a lot of LEDs for all the status info.

All boards but the BMSB and the DPB are optional (but you lose short-circuit protection without the HWPB as the software will be too slow to react) so if you don't want the HMI and just use the ethernet interface you can, or if you don't want balancing you can too (and @cass3825 was planning to design an active balancing board plugging in place of the passive one) ;)
 

Attachments

  • BO_BMSB_1630.pdf
    279.8 KB · Views: 7
  • BO_HWPB_30.pdf
    226.5 KB · Views: 7
Last edited:
  • Like
Reactions: Cal
Yep, it can handle 400 A for 20 or 30 seconds.

Charge and discharge continuous max is 300 A

Max peak is 400 A

I have both software and hardware OC detection and they both have continuous and short term limits (hardware ones are set a bit higher than the software ones, which are user settable anyway). Hardware require manual reset (and has a dedicated button), software can be either manual or auto reset (or manual for some faults and auto for others, I'll see when I'll be at the software part).

Resolution can be pretty high; I use a 16 bits ADC and then you can use a x A shunt with a 50, 75 or 100 mV output (the recommended one would be a 500 A 50 or 75 mV shunt) which will get amplified to match the Vref scale (currently you need to replace 2 resistors to set the shunt voltage but I'll try to change that and have solderable jumpers, similar to set the chemistry type).

So with a 500 A shunt you have a 15 mA resolution (0.003 %) but the accuracy is of course lower. There's the shunt accuracy, the amplifier accuracy, the Vref accuracy and the ADC accuracy at play. Most of the errors can be calibrated because they are offsets and gain errors but some of them aren't linear or they are temperature dependent for example so you can't really avoid them (but fortunately they should be pretty small). I plan to achieve at least 0.1 %, ideally 0.01 % (not counting the shunt as you can use a 10 $ chinese one or a more accurate but more expensive one).

You can see all that on the BMSB and HWPB schematics, I attached them to this post ;)

The BMS board is the main one, the HWP (hardware protections) board is an add-on plugin on top of it, and on the bottom side of the BMSB you can stack up to 3 passive balancing boards depending on how much balancing current you want, 1.5 A (maybe 1.2 A for thermal reasons, we'll see) per board. Then you have the DPB (disconnect and precharge board) I'm finishing routing who handles all the high things and the last board is the HMI board which is basically a lot of LEDs for all the status info.

All boards but the BMSB and the DPB are optional (but you lose short-circuit protection without the HWPB as the software will be too slow to react) so if you don't want the HMI and just use the ethernet interface you can, or if you don't want balancing you can too (and @cass3825 was planning to design an active balancing board plugging in place of the passive one) ;)
Another project I need to resurrect! LOL I’ve been distracted learning Linux, Python & Prometheus the last few weeks/months as life allows. Where does the time go?
 
16 bit a/d with 15 mA resolution is very good. Interesting to see the noise profile.

I’m disappointed in Chargery current resolution. It can’t detect 700 mA.
 
Of course you usually derate ADC/DAC by one bit, or even 2 bits for 24+ bits ones, as the last bit is pretty much useless, that's why I chose a 16 bits one when a 14 bits one would be enough in theory. And I plan to do some averaging of multiple samples to increase the resolution. But I can't go really far with that method however as it's only a 60 S/s ADC, but 2 or 4 samples is no problem and it should improve the resolution by at least half a bit. If someone wants more info on that method: https://www.silabs.com/documents/public/application-notes/an118.pdf

Wow, that's not good, 700 mA is a lot.
 
Last edited:
Minor correction?
You list the adc as LTC24521...
Should be LTC2451...
The data sheet shows an input RC filter. You just have C.
 
It's actually a LTC2452, this one to be exact: https://www.mouser.fr/ProductDetail...DuTUz7Xu%2B83NC4B1t7jUUpKK5BGdVfiANGzqejMBA==

There's an uppercase i after the 2 which can look like a 1 I guess.

There's a R (sorry, the layout isn't the best on this part of the schematic, I sort of ran out of space) but it's actually multiple ones: R24*

They are just before the mux (IC240) and have the double duty of protecting the mux and ADC against too high voltages (well it's actually the ESD diodes on the mux inputs who does that, the resistors just limit the current to a safe value for those poor diodes) and being the R of the RC filter. The muxes also have some internal series resistance (a few dozens Ohms IIRC) due to the Rdson of the FETs they use, so you need to add that if you want to do calculations with the real values.

For that reason I’ve been thinking of building my own bms. 12V, 4 cell, Arduino system. No fet disconnects, just a OV and UV signal.

If you don't need com and just want OV/UV outputs I would even recommend keeping it purely analogue and just use some comparators and latches (basically what I've done for the HWPB). No software bug or freeze to be concerned with ;)
 
  • Like
Reactions: Cal
I do want an AH counter. One thought I had is to use an Ardruno Zero. It has a 12 bit adc. Got a 300A shunt. But don’t need 600A measurement range. Max charging current is 55A. Max discharge current is 160A. I can configure the adc for a +100 to -200A range, total 300A.

300A/4096 = 73 mA resolution

I can live with that.
 
Ok ;)

To achieve that kind of precision you'll need oversampling + averaging (with 16 or 32 samples at least) and an external Vref because the internal one is really not good.

Also you'll need a nice op-amp with a low Vos as 50 mV / 4096 is 12 µV
 
For that reason I’ve been thinking of building my own bms. 12V, 4 cell, Arduino system. No fet disconnects, just a OV and UV signal.
You may be interested in looking at Stuart Pittaway's DIYBMS project which uses a Wemos board, but he recommends programming with PlatformIO versus the ArduinoIDE.
 
If you don't need com and just want OV/UV outputs I would even recommend keeping it purely analogue and just use some comparators and latches (basically what I've done for the HWPB). No software bug or freeze to be concerned with ;)

I see you went analog with OV, UV, OTemp, LTemp. Do you think that’s better than going through the adc? Chargery has that data on its display. I find myself viewing temperature. Especially now while camping in the Pacific North West where temps are now around 100. Yikes!

You are using 4148 diodes to “or” temperature or other parameters to a common comparator. Are you not concerned of the diode voltage drift with temperature? All temps have a single diode but one which has 2 diodes in parallel. The voltage drop will be lower for this temp resulting in an error when compared to the others.

Hope you don’t mind my reviewing your design. I am rusty and things have changed as I haven’t worked in electronics in over 20 years.

Edit
I see the diodes are within the OpAmp loop. So the diode drift error is compensated within the loop?
 
Last edited:
I see you went analog with OV, UV, OTemp, LTemp. Do you think that’s better than going through the adc? Chargery has that data on its display. I find myself viewing temperature. Especially now while camping in the Pacific North West where temps are now around 100. Yikes!

I have all the data in software too, that's why I have the muxes on the ADC input (I really need to do a block diagram like for the DPB but for the other boards so you can see better), if you want a quick description of the features you can read the second post of this thread (there's a few changes and some added features since I wrote it but it is mostly exact) ;)

You are using 4148 diodes to “or” temperature or other parameters to a common comparator. Are you not concerned of the diode voltage drift with temperature? All temps have a single diode but one which has 2 diodes in parallel. The voltage drop will be lower for this temp resulting in an error when compared to the others.

It's actually not a OR gate but a min or max (depending on the direction of the diodes) gate. For example you have three temps: 53, 58 and 54 °C and you want just the highest one to see if it's over the limit. Well the analogue way to doing this is with op-amp and diodes. The diodes doesn't impact the value as the feedback is connected after them (same as when you do a precision rectifier with an op-amp and a diode).

Hope you don’t mind my reviewing your design. I am rusty and things have changed as I haven’t worked in electronics in over 20 years.

Oh no I love it. It allows to catch mistakes I made and to have more ideas for cool features ;)
 
I have rounded the PCB corners, added the small vias stitching (still need to add the big vias under the busbars), added the heatsinks outlines and added the solder mask polygons for the busbars and heatsinks:

pcb.png

I know, it's a bit hard to see anything with all the layers... so, here's the busbars (green) and the heatsinks (blue-green) outlines:

heatsinks_busbars.png

The heatsinks outlines with some context:

heatsinks.png

Then there's the front solder mask layer with the busbars outlines (and you can see where I'll solder a length of 2.5 mm² wire as a mini busbar in the center):

busbars_fmask.png

And same with the back solder mask and the heatsinks outlines (again, you can see 10 small areas in the center where 2.5 mm² wires will be soldered):

heatsinks_bmask.png
 
nice work... I'm following your build closely and look forward to future updates.
currently deploying an ED SBMS0 off-grid system personally and liking where you're going for FET-based controls
 
Thanks ;)

I think I'll do the HMI board next as it's simple and I need a pause with something simple and easy ?

So, question to everyone: What do you think of backlit labels like this or like that?

Because I find them pretty nice and the final design directly affects how the PCB will be routed so I need to know. But there's time, I need to do the schematic first anyway ;)

Also what degree of abbreviation do you think should I use? because acronyms are hard to decipher (ODCST anyone?) and full text is too long (over discharge current short term)...

Edit: full list of the annunciators (the letter on the left is the LED color):
Code:
MAIN (8 LEDs)

(B) OFF (only if battery was powered off from long press on power button)
(R) DISCONNECTED (only if battery was disconnected from fault but is not in recover)
(O) RECOVERING
(Y) PRECHARGING
(G) ON

(O) WARNING (if any SW/HW orange LED is on)
(R) FAULTED (if any SW/HW red LED is on)

(O) NO COMM


SW (15 LEDs)

(O) RCF (recover circuit fault)
(O) PCF (precharge circuit fault)
(R) BOV (battery over voltage)
(R) BLV (battery low voltage)
(R) COV (cell over voltage)
(R) CLV (cell low voltage)
(R) OCCST (over charge current short term)
(R) ODCST (over discharge current short term)
(R) OCCLT (over charge current long term)
(R) ODCLT (over discharge current long term)
(R) BOT (battery over temperature)
(R) BLT (battery low temperature)
(R) FOT (FETs over temperature)
(R) SOT (system over temperature)
(R) FIRE (fire)


HW (12 LEDs)

(O) WDR (watchdog reset)
(R) BOV (battery over voltage)
(R) BLV (battery low voltage)
(R) OCCST (over charge current short term)
(R) ODCST (over discharge current short term)
(R) OCCLT (over charge current long term)
(R) ODCLT (over discharge current long term)
(R) BOT (battery over temperature)
(R) BLT (battery low temperature)
(R) FOT (FETs over temperature)
(R) SOT (system over temperature)
(R) FIRE (fire)
 
Last edited:
Back
Top