DIYBMS v4

I made yesterday the update of the shunt and it look like that all work now as it should. CAN communication worked before to, SOC was wrong.

At the first try I made the foult that I connected one wire to much becouse I thought that the can may need the gnd wire to. And, shame on me, I X 2 wires. After fixing of this it worked fine.
Remark: I modified a CAT-7 Wire as CAN cable

I managed to do the Update of the Controller and modules.
First i coulnd flash the ESP32. There is a driver needed, so that Windows is able to recognize the connected ESP via USB. After the Installation it worked fine.
Now i have to figure out the values for Dynamic charging.

The current shunt will be updated later.

Thanks Stuart!

If that is quite old firmware you will get incorrect SoC and amp-hour counts when using the newer controller software.

you have to update it now, not later!

I really like your BIYBMS solution. I have a question whether it is possible to change the BIYBMS software to support 160S or larger batteries. I am currently using a H Y D 2 0 K T L -3 P H inverter, it requires a minimum voltage of 400V.
I have a 160S battery and a Chinese BMS, I would like to change it to yours because it has a lot of cool functions. Will it be possible ?

stm32cube does not work with st-link clone.
My serial - usb adapter also does not connect
 :sweat:
This sunday i’ll check it all again, how are your experiences with the new 4.9 boards?

You don’t have to use the stm programming connection. Use the serial one and put the jumper pin in place (pgm).

Then use serial programming instead

2 Likes

you are right i forgot to place the jumper in programming mode after testing with the st-link that didn’t need it. Thanks.

what would make the last cell value 1v lower than it sould be?
Tested with 7s and 14s with the same result.
All cells go from 3.9v to 4.1v.

Hello, I see that you are using a 14 cell, have you done what is written? I am attaching a photo.

2 Likes

didn’t get to this part. thanks.
So a 8s setup would have to link all the remaining 8s?

Yes - the last screw terminal (16) actually powers the large chip on the board, without that strange things will occur.

1 Like

Hello everyone. I’m testing diybms. I have had a problem with an all-in-one. Communication through module 2 has failed. The red leds were fixed, without flashing. Burning energy. Unbalancing the 36S batteries.
Does the STM32 software have any watchdogs? To restart the module after a period of time without communication. My configuration is 12 cells for each all-in-one. I use the controller’s internal current monitor on the negative side of the battery and a voltage divider (Vbatt/2) for the vbus measurement.

If the controller had lost communication with the modules you should have seen an error in the controller webpage, and the related rule would have triggered - did this happen?

You have a lot of missing communication packets (packets rec’d 5871 vs 11740) indicating communication problems - use 5K speed for the communication.

The configuration you are running isn’t one I’ve looked at/tested - especially running a higher voltage into the current monitor (through resistor divider).

Are these LIFEPO4 cells? What are your charge limits/balance limits?

Yes of course. Module 1 had the white LED flashing. Module 2 did not and the red LEDs were fixed, not flashing like the other modules. I disconnected the power from module 2 to restart it and the communication worked correctly.

Yes, they are LiFePo4 cells. The limits of discharge 3V (108V) and charge 3.45V (124V)

For the correct reading of Vbus using a voltage divider, I have modified the code to include a dividing factor in the configuration of the internal current monitor.
The voltage divider is very simple. Two resistors and a multiturn potentiometer.



I am currently testing. The battery control is carried out by an ESP32 that reads the data from two jkbms.

1 Like

Hi @rubenfm,
different topic!
I really like your simple aproach of brakets for the modules and controller, would you please share the STL files for them?
Thanks.

Ok, we need to find out why this module appeared to have locked up. I can look to add on the watchdog code to the STM32, but curious why this happened in the first place.

I’ve created a bug issue - V490 / all-in-one monitor board hang and passive balance enabled · Issue #262 · stuartpittaway/diyBMSv4ESP32 · GitHub

and also just uploaded a new firmware for the V490 board to include the watchdog timer.

Hello, the battery was charging from the network for more than 24 hours, to do a top balance of all the cells at 3.45V. The bank was unbalanced. There was a micro-outage of the electrical supply. In my town they are common. When I got home I reset the system. I’m sorry I can’t provide more information.


Thank you for your work and dedication. I’ll try the new firmware.

The support for all-in-one, I recommend printing it scaled to 101%. I had to cut the edge of the supports in the connector area. It is not a good design.
supports_diybms.zip (105.0 KB)

1 Like

please show a schematic of your voltage devider (2x 100k resistors should work but you have a variable one) and the modifications of the code so stuart may add it to the final version for more people like me that are interested.
I don’t have 34s but i drive my 32s every day SOC would be very helpful.