• Have you tried out dark mode?! Scroll to the bottom of any page to find a sun or moon icon to turn dark mode on or off!

diy solar

diy solar

DIY BMS design and reflection

Another design consideration: for larger DIY packs (4p16s, for example) with a single BMS it is difficult to troubleshoot a problematic cell. Ignoring additional cost, the preferred approach would be to assemble four 16s packs in parallel (16s4p), each with their own BMS. In this situation, each BMS would need its own IP address, ideally with peer-to-peer data sharing between each BMS. Thoughts?

Yes, of course, you can have as many BMS as there is available IPs on your network. My solar install will be exactly what you described in your example: 4 packs in // of 16 cells in series each ;)

For the data sharing directly between BMS however I've not planned to do that but you can have a central device acting as a gateway between the BMS if you want.

Or you can change the code (will be released under the GPL license) if you want to implement direct com between BMSs (but again the flash/RAM space available to add that will be very low as I'll probably use pretty much every byte available... you can always remove other things you don't need for use case if you need more space though).

I'm curious to know what would be the main purpose of direct com between BMSs? I don't want to miss something important (it's hard to think about everything on your own...)

I'm working a similar project and I'm using a ESP32 (it has BT and WIFI). ESP also has nice device with wired connection.

The ESP32 is nice but a bit overkill for what I'm trying to do I think. The power requirement is also a problem, it would probably eat more power on its own than the whole arduino based BMS, and you need to add ethernet com power on top... I also prefer a MCU to a SoC as it's more reliable and doesn't depends on an OS.

All of these reasons are why I chose the Arduino over the Raspberry Pi too.
 
I was playing with a STM32 befor switching to the ESP32. I'm using Arduino on both and power consumption are very similar. I only have a small pack to monitor and it's in a camper so my project is a bit different than yours.
 
I just thought about something: the ethernet module is optional (at the hardware level the BMS can work 100 % without it) so for those of you who don't want ethernet you can avoid it and you now have the SPI port available. So you can either communicate directly via SPI or use another module (wifi, BT, ...) as long as it can talk to the arduino via SPI.

You can even ditch the SPI protocol and bit bang your own protocol. You have 4 I/Os available (D10 to D13) so you can use pretty much any protocol you want (UART, I2C, CAN, ...) as they often use only 2 or 3 I/Os.

Keep in mind the SPI port is still used for the ADC (only D12 and D13 though so you have D10 and D11 fully available for you) so you need to be a bit careful with what you do (i.e. don't select the ADC (via D9) while your doing your com and don't do your com while the ADC is used).

Also D0 and D1 (serial port) are not used on the BMS so you can use them to do whatever you want to. But you need to be careful as they are also used by the arduino to communicate via USB.

Of course doing any of this will need some software changes.
 
Last edited:
Guys/gals, I need your input on something: what about the balancing section being on a separate board from the BMS?

The idea is that not everyone want it so the BMS would be simpler and less expensive for those ones.

It also means I have a better chance to fit the BMS on a 100 * 100 mm board (if you go bigger than 100 mm the board cost tends to be a lot higher) even if I can't guarantee that for now as I haven't started the PCB routing.

If I do that I'll try to make the boards stackable to simplify the cabling.
 
Guys/gals, I need your input on something: what about the balancing section being on a separate board from the BMS?

The idea is that not everyone want it so the BMS would be simpler and less expensive for those ones.

It also means I have a better chance to fit the BMS on a 100 * 100 mm board (if you go bigger than 100 mm the board cost tends to be a lot higher) even if I can't guarantee that for now as I haven't started the PCB routing.

If I do that I'll try to make the boards stackable to simplify the cabling.
I think this is fine as it can lead to using different size in Amps of balancing. Plus might not be needed at all for some.
 
I exported the current schematic as a PDF (sorry for the black and white but I use custom colors to work with less eye strain and Kicad don't export the background color and always uses white so everything is hard to read if I don't export in B&W), you'll find it as an attachement to this post.

Of course there's still things to do; mainly the safeties (basically a bunch of comparators with some resistors), watchdog (resettable monostable), and connectors + some support components for the disconnect/precharge, balancing and LEDs boards.

I have two spare inputs for temp sensors and one spare input on the final mux before the ADC (I'll probably add a connector so we can measure whatever we want as long as it is between 0 V and 4.096 V relative to B-).

The actual max power consumption is around 1.6 W (0.9 W just for the ethernet), that's not including the disconnect, balancing and LEDs HMI (but that shouldn't add too much as it's mainly control logic) so not too bad I think.
 

Attachments

Stackable ‘shield’ design is a great idea. Module balance module would also allow active/passive balance options, or perhaps stacking several balance boards together for higher balance currents.
 
I'm curious to know what would be the main purpose of direct com between BMSs? I don't want to miss something important (it's hard to think about everything on your own...)
I was pondering the benefits of comparing charge/discharge currents between packs to identify capacity differences.
 
Stackable ‘shield’ design is a great idea. Module balance module would also allow active/passive balance options, or perhaps stacking several balance boards together for higher balance currents.

Oh man you're a genius, multiple balance boards to increase balance current, how come I didn't think about that?

Now there's some limitations (i.e. you can't stack boards forever...) and the first one will be the current limitation of the inter-board connectors.

Stackable connectors are expensive (quick looking yesterday told me about $5 minimum per connector for a classic 0.1" pitch connector) and there isn't 1 million models available, so high current ones would be very hard to find and very pricey. Then we can do stackable connectors for everything but balancing wires and have one connector per board for the balancing wires. It would solve the problem and also solve the other problem of current limitation of the balancing wires, but you would need a lot of balancing wires so the cabling would be a bit less clean.

Then there's the power supply limit: the main power source is a DC/DC converter who takes B+ and outputs +12 V @ 250 mA max and -12 V @ 250 mA max. There's a second DC/DC converter who takes the +12 V and outputs +5 V @ 400 mA max (mainly to avoid the bigs losses of the linear regulator of the arduino).

I currently use half of the max available on the + 12 V, only a few mA on the -12 V and half of the max on the +5 V. I still need to add some things so I'll probably be around 2/3 of the max on the +12 and +5 V when I'm finished. The balance board shouldn't use much (wild guess 10 to 20 mA) but the DC/DC converter isn't a beast either so sooner or later we will cross the limit.

I'd say stacking more than 3 balance boards will be hard. But each balance board will have a decent balance current (I planned 2 to 5 A but there's some serious heat limitations if I keep the dump resistors on the board, so I may downgrade to 0.5 or 1 A, still better than 90 % of the ready made BMS if I'm not mistaken) so even 3 boards should be plenty enough for a big battery.

NB: I'll not do active balancing because it's costly, complex and not really useful for what I do. But if someone wants to design a board for active balancing I'm all for it :)

I was pondering the benefits of comparing charge/discharge currents between packs to identify capacity differences.

Ok, so you can definitely do that with a central device, that would be the easier way (it even makes more sense than each BMS comparing itself with each other).
 
Last edited:
An alternative to stackable connectors is two parallel rows of 0.1” holes, traced identically. Solder male pins facing one way, female pins on the other side of the board. Downside is additional board real estate required.
Another idea is to use brass standoffs in each of the 4 board corners to pass power rails. +12, -12, +5, gnd.
 
Board real estate will be at a premium... I'm not even sure I'll be able to fit 0.1" connectors, I may have to go lower like 2.0 mm pitch. Also I love standard 0.1" header but it tends to be unreliable so I'm not sure I'll use it solely because of that.

The more I add components on the schematic and the farther away a 100 * 100 mm board is... And right now it's pretty far away... I'm pretty sure I'll be over 100 mm, then the good thing is a few more mm doesn't matter much so I'll be able to fit bigger connectors if needed.

Well the problem isn't much the power rails (pretty much any connector will handle the power needed) it's more the 17 balance wires. If someone can find on mouser.com a stackable connector with at least 17 pins who can handle at least 3 A each (5 A would be nice to have some safety margin, I saw too many melted connectors in my life...) and who doesn't cost a million dollars it would be awesome :P
 
Studying the schematic, it appears a 2-layer pcb will be adequate, especially with the balance circuits being on their own stack. Avoiding 3+ layers will definitely help keep costs down. Thoughts?
 
For the balance lead connections, what about thick traces full of vias at the edge of the board? Something like this:
F1A88A03-2C5D-476B-9196-99C94D453049.png
 
Studying the schematic, it appears a 2-layer pcb will be adequate, especially with the balance circuits being on their own stack. Avoiding 3+ layers will definitely help keep costs down. Thoughts?

Well the schematic is not finished for now and I'll add at least 5 SOIC-14 ICs (for the hardware redundant protections) + 2 double row 0.1" 20 to 30 pins connectors (for the disconnect and LEDs) so it'll be really tight.

I think the main problem will not be the traces but the physical space for components; if I can fit all the components I'm pretty sure to be able to route the board on two layers as each section is pretty well self-sufficient with not a lot of traces to other sections. However power will be a bit more complex to route (there's actually 6 rails and 4 grounds...) but should be ok if each section is correctly placed on the board.

In any case I'll not go 3+ layers, I prefer to increase the board size and stay with 2 layers.

For the balance lead connections, what about thick traces full of vias at the edge of the board? Something like this:
View attachment 7316

Well the main problem is that's not a connector, you can't unplug the wires with this solution. It's a bit overkill too as we are talking amps, not dozens of amps.

I think the best for this use case is not stackable connectors but SMD mezzanine connectors.

Or the good old 0.1" but a right angle one, right on the edge of the PCB, so we can have a "bus" ribbon cable to interconnect the boards (used this solution for a 2 m rocket, worked pretty good but it's not very economical in board space). But it's less clean and I don't know the current capacity of 0.1" IDC connectors nor the one of the matching ribbon cable.

Now that I think about it we can have a card-edge connector (but that's really hungry on board space...).

I'll look into all of this once I finished what I'm doing (HW safeties) because clearly it's not something we can just choose in 2 min.

NB: in case it was not clear (well, I never explained what I had in mind for this part, I'm sorry about that) the idea is to have only one set of balancing wires plugged into the BMS via a connector (J1 on the schematic) and another board to board connector between the BMS board and the balancing board (and each additional balancing board of course).

The balancing board(s) would be under the BMS (because on top there's the arduino and the DC/DC converters who are tall).

The problem isn't the main connector but the board to board connector as they are mainly designed for signals, not power.
 
Last edited:
Well the main problem is that's not a connector, you can't unplug the wires with this solution. It's a bit overkill too as we are talking amps, not dozens of amps.

I think the best for this use case is not stackable connectors but SMD mezzanine connectors.

Or the good old 0.1" but a right angle one, right on the edge of the PCB, so we can have a "bus" ribbon cable to interconnect the boards (used this solution for a 2 m rocket, worked pretty good but it's not very economical in board space). But it's less clean and I don't know the current capacity of 0.1" IDC connectors nor the one of the matching ribbon cable.
I really like the edge ribbon cable idea. For mobile solutions (mine’s in an RV), I prefer soldered connections for anything over 200mA. The edge pads would give the user the option of a connector or a soldered ribbon bus. I mocked up a few proto boards for a proof of concept, using both edge and PTH connections:
4A1FDA39-5FF0-4F16-9560-1D25FC08F3A5.jpeg9260F258-8A1B-4985-ADF1-CC9803BB31C6.jpeg
 
For mobile solutions (mine’s in an RV), I prefer soldered connections for anything over 200mA.

I certainly understand why. Note there's lockable connectors; actually the 0.1" header has a version like that: https://www.hobbytronics.co.uk/image/cache/data/misc/16way-idc-ra-latched-500x500.jpg

I'm now contemplating using the edge half PTH but I have a vague memory those half PTH are a special thing you pay for, but I can be wrong. Even then, if it's not more than a few dollars it's a good solution as a connector would have cost that much anyway.

Now, I don't like too much the definitive aspect of it, I'd prefer an unpluggable connector.
 
Last edited:
Thanks for the research ;)

But after a lot of thinking (yeah so the HW safeties didn't advance a lot... I can't help it, I needed to solve this problem before sleeping) I think I found the best compromise (and it avoids special PCB features such as the castellated holes as a bonus): PTH for a double row 0.1" right angle header... yeah, that simple ?

You can do [at least] 4 configurations with the exact same PCB:

1. use a right angle shrouded connector (lockable or not) + 0.1" IDC with ribbon cable
2. use right angle 0.1" pin header + solder some stripboard on it
3. same as 2. but use female 0.1" connector on a board (TH or SMT on stripboard or a proper PCB) so you can still easily disassemble the BMS if needed
4. solder bare wire through the holes (only the most accessible row is enough) like in your test a few posts earlier

In theory a 0.1" header pin can handle 3 A (but definitely need proper quality, no buying on ebay...) so by paralleling two of them we have 6 A. The only unknown is the ribbon cable, didn't look about that yet, but all the other solutions should be able to handle 5 A no pb.

The next weak point will be the balance wires and the connector for them but that should not be a pb as I plan on using a pluggable terminal block, 5 A should be easy. The main issue will be fitting the pluggable connector and the pin header more or less at the same place on the board... quantum connectors anyone?
 
Last edited:
Wow, you're following closely, I like that as it didn't seem there was a lot of people interested.

I didn't chose yet (still need to finish the HW protections, about 1/3 done) but I can tell you already it'll be 5 V, 8 bits, have a data output and have an output enable. It'll be from the 74 or CD4000 series (most likely from the CD4000 for power consumption reasons) and I'll use the same part for everything.

The LEDs data will be shifted in first and the balancing data will be shifted last; so the balancing SDI is connected to the arduino SDO and the LEDs SDI is connected to the balancing SDO. That way if someone choose to not use the LEDs HMI there's nothing to change, and if someone wants to use the LEDs without balancing we just need a jumper between balancing SDI/SDO and to not send the balancing data.

In case of multiple balancing boards all the balancing SDI will be connected together and same for the balancing SDO. To avoid conflicts in case of voltages/speed differences between shift registers on each balancing board I'll simply use a few kOhm resistor in series with each the output.

The data will be bit-banged in software so the speed will be pretty low, probably a few dozens kHz top, so nothing to worry about that.

Also, I found a 5th configuration: just don't stack the boards and use IDC connectors with ribbon cable to put the balancing board a bit less close to the BMS (can be useful for heat management and/or thickness reasons for example).
 
Last edited:
I have no doubt some are watching and can't participate because it's too technical, but I can't do much about that :p

NB: once the BMS is finished I'll make another thread to present the BMS like the other BMS on the market are, nothing too technical (but there will be a full datasheet for those who want it too), this thread is really the design thread.
 
I'm here too. Been here from the start and will be there when you boot it up. Looks like you found a good partner in Cass3825.
 

diy solar

diy solar
Back
Top