diy solar

diy solar

JK BMS CAN bus comms now possible for inverters that support Goodwe and Pylontech batteries

This is excellent. Will definitely buy you a beer. About to buy a B2A20S20P from Ali Express with "Heat and CAN" but only because I want the heat function.

Just to confirm though, the presence of the CAN port on the BMS doesn't stop the RS485 port from working with this does it?
 
This is really nice. I'll like to know in details how the charging algorithm is done.

It would be nice if the charging current is tapered down between 80% and pre-configured end SoC (90% default). For instance if we one is charging with 100A, as we get to 80% the current can be reduced to 20A.
 
This is excellent. Will definitely buy you a beer. About to buy a B2A20S20P from Ali Express with "Heat and CAN" but only because I want the heat function.

Just to confirm though, the presence of the CAN port on the BMS doesn't stop the RS485 port from working with this does it?
Hi,

That looks to be a newer model, so I can't say for sure but if it is the same as all the other models RS485 should be active.
I would double check with the seller.
 
Last edited:
This is really nice. I'll like to know in details how the charging algorithm is done.

It would be nice if the charging current is tapered down between 80% and pre-configured end SoC (90% default). For instance if we one is charging with 100A, as we get to 80% the current can be reduced to 20A.
Hi,

I did initially implement this, but found that it was unnecessary, once the battery has been top balanced, as the voltage approaches the set charging/absorption voltage the battery on it's own will reduce/ramp down the current to 0

I'm in the middle of testing a more robust charging profile, that should ensure the battery is always charged to the set voltage (SOC can vary):

Bulk charge: if packV < chargeV-3V (below 90% start bulk charging usually the next day when there is solar)
Absorption timer: starts when chargeV is reached (30min, configurable, time for absorption and balencing)
Wait (to bulk) if packV > chargev – 3V (after absorption wait till below 90% then Bulk)
Wait currently turns off the charger, which seems to be working fine.
I'm still on the fence if Wait should be set to a float voltage.
I'm not convinced that Lifep04 needs a float voltage.
 
Hi,

I did initially implement this, but found that it was unnecessary, once the battery has been top balanced, as the voltage approaches the set charging/absorption voltage the battery on it's own will reduce/ramp down the current to 0

I'm in the middle of testing a more robust charging profile, that should ensure the battery is always charged to the set voltage (SOC can vary):

Bulk charge: if packV < chargeV-3V (below 90% start bulk charging usually the next day when there is solar)
Absorption timer: starts when chargeV is reached (30min, configurable, time for absorption and balencing)
Wait (to bulk) if packV > chargev – 3V (after absorption wait till below 90% then Bulk)
Wait currently turns off the charger, which seems to be working fine.
I'm still on the fence if Wait should be set to a float voltage.
I'm not convinced that Lifep04 needs a float voltage.
I think float is not needed for lifepo4 battery.
Is the chargeV and bulk voltage configurable?
 
I think float is not needed for lifepo4 battery.

Yes I think so too, but I wonder why most of the commercial chargers still have it enabled, like victron etc.

Is the chargeV and bulk voltage configurable?
chargeV, bulk and absorption voltage are all same voltage and is configurable, just a little different is how they are used to charge.
chargeV/bulk voltage is constant current(CC), voltage will rise and current stays constant(it maybe be less than constant when using solar to charge)
absorption is constant voltage charging(CV) Voltage is held constant, current will reduce to near zero.
 
Float is practically the same as absorption to a point. Absorption should stop once current drops below 0.05C, whereas float will maintain a set voltage for as long as sufficient input energy exists.

Absorption is best for LiFePO4, whereas float is preferable for lead acid.
 
Absorption is best for LiFePO4, whereas float is preferable for lead acid.

Yes but strange that Victron and many other vendors have a specific LiFePO4 charging profile but have chosen to have both Absorption and float.

Default profile for Victron LiFePO4:
Absorption voltage: 56.80V
Absorption time: 2h
Float voltage: 54.00V
Re-bulk voltage offset: 0.4V drop below float (53.6v default setting)
 
Last edited:
Hi,

That looks to be a newer model, so I can't say for sure but if it is the same as all the other models RS485 should be active.
I would double check with the seller.
If it helps, I am using a newly ordered B2A24S15P-CAN which has both CAN and RS485. I am using RS485 for this, works fine.
 
@uksa007 some clarification:
1) Is the Vcc of TJA1050 connected to 5V pin of Esp32?
2) how are you powering th esp32? I thorough usb or 5v pin
3) did you connect any power to 3.3v pin of esp32
4) if esp32 is powered through USB, can TJA1050 get power from 5v pin of Esp32?
 
@uksa007 some clarification:
1) Is the Vcc of TJA1050 connected to 5V pin of Esp32?
2) how are you powering th esp32? I thorough usb or 5v pin
3) did you connect any power to 3.3v pin of esp32
4) if esp32 is powered through USB, can TJA1050 get power from 5v pin of Esp32?

Hi,
1) Yes
2) From USB but you could also power from 5V pin.
3) NO you need 5V for the TJA1050
4) Yes

Please see this link for more info on connecting the TJA1050
 
Hi,
1) Yes
2) From USB but you could also power from 5V pin.
3) NO you need 5V for the TJA1050
4) Yes

Please see this link for more info on connecting the TJA1050
Thanks for your feedback. The esp32-example-can.yaml file specifies that GPIO 16 and 17 is connected between bms and esp32 but readme.md has this line:
*Connect a TJA1050 to an ESP32 (default GPIO 17 TX, 16 RX) as per https://esphome.io/components/canbus.html?highlight=can#wiring-options*.
Which is the correct one?
 
Thanks for your feedback. The esp32-example-can.yaml file specifies that GPIO 16 and 17 is connected between bms and esp32 but readme.md has this line:
*Connect a TJA1050 to an ESP32 (default GPIO 17 TX, 16 RX) as per https://esphome.io/components/canbus.html?highlight=can#wiring-options*.
Which is the correct one?
These are the pins I use:

Code:
# GPIO pins your JK-BMS RS485(TTL) is connected to the ESP TX->RX and RX->TX.
  tx_pin: GPIO17
  rx_pin: GPIO16
# GPIO pins your CAN bus transceiver(TJA1050) is connected to the ESP, note! TX->TX and RX->RX.
  can_tx_pin: GPIO23
  can_rx_pin: GPIO22
 
Last edited:
Great work indeed !
It's exactly what I'm looking for my project to enable the communication of my Deye inverter with DIY battery pack (16 cells ) and BMS
I try to understand what commercial BMS like Daly,JBD,JK BMS are compatible with Deye phiscal interface and application protocol but I understand that none of them is compatible off the shelf (I got suggestion to use SEPLOS) !
Then I discover this nice bridge/protocol adapter and seems really a simple and low cost solution..will offer you a beer for sure !
Just a question, are you going to make the same protocol conversion also for JBD and Daly BMS ?
For some reason I prefer JBD, but since I have still not bought the BMS for my project so I can switch to JK if is the only compatible with Deye

thanks again for this application

Davide
 
Just a question, are you going to make the same protocol conversion also for JBD and Daly BMS ?
Sorry we only support these JK-BMS:

 
Hi uksa007, really cool project.

Have you considered support for multiple JK BMS? I guess you would be looking at summing some values, averaging others, and passing through all alarms to make it look like one big pack.
 
Have you considered support for multiple JK BMS? I guess you would be looking at summing some values, averaging others, and passing through all alarms to make it look like one big pack.
I have briefly thought about it, there are few hurdles that may prevent it from being simple, like the code that reads the JK-BMS values may not easily support multiple BMS, both hardware serial ports are already used on ESP32 etc.

At the moment I'm focused on improving the charging logic and overall user experience, ensure everything works as it should.

My thoughts at the moment are if you need more capacity just add more of the same cells in parallel then you don't need another BMS.
EG 2P16S, 3P16S etc.
 
Last edited:
I have briefly thought about it, there are few hurdles that may prevent it from being simple, like the code that reads the JK-BMS values may not easily support multiple BMS, both hardware serial ports are already used on ESP32 etc.

At the moment I'm focused on improving the charging logic and overall user experience, ensure everything works as it should.

My thoughts at the moment are if you need more capacity just add more of the same cells in parallel then you don't need another BMS.
EG 2P16S, 3P16S etc.
You just need to add a analog switch like TMUX1309, and use 2 io pins and one serial port to control 4 bms. ;-)
 
Last edited:
What are the steps to upgrade from one version to another when it's in operation.
 
What are the steps to upgrade from one version to another when it's in operation.
Just the same as when you first flash it:
Check the yaml file and set the configuration at the top, eg charging voltage, number of packs etc.
Compile and flash using "esphome run esp32-can-example.yaml"
Communication with the inverter will be lost for a few seconds while it flashes and reboots.
The inverter may stop charging/discharging the battery until it receives comms, unusually only a few seconds.
Done.
 
Last edited:
Back
Top