diy solar

diy solar

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

Hy Guys
Just a simple reference connection schema for wireless and wired option using M5stack Atom and CAN base


1706546636417.png


and here my "wireless implementation" with Deye and 16xLifePo4 DIY pack with JK BMS

1706546733590.png


test will continue !

br
Davide
 
V1.16.4 on GitHub
  • Improved Charging Logic for ESP32 startup/reboot and Float charge (the voltage decreases slowly)
  • Add CAN ID 0x356 bytes [06:07] cycles for Sofar
  • Change switch name in order to be able to differentiate between the BMS switches and those of the CAN application
FYI, I had fun flashing the ESP32 in the middle of the absorption phase and the absorption phase continued after the reboot ;)
 
Last edited:
Just a simple reference connection schema for wireless and wired option using M5stack Atom and CAN base

Thank you very much for all these schemas, I will add them to the GitHub.

Could the Bluetooth version work with Atom Lite?
Or is it only for Atom S3?
 
Thank you very much for all these schemas, I will add them to the GitHub.

Could the Bluetooth version work with Atom Lite?
Or is it only for Atom S3?
Sure more than happy to contribute !

I will compile the BT version also on the Atom Lite version ESP32 Pico and let you know

Davide


PS S3 version seems quite stable

1706549179022.png
 
Thank you very much for all these schemas, I will add them to the GitHub.

Could the Bluetooth version work with Atom Lite?
Or is it only for Atom S3?
I can confirm wired and Bluetooth is working with this stack, although the human readable time resets at approximately 1hr 45 min.
IMG_4511.jpeg
 
Last edited:
I can confirm wired and Bluetooth is working with this stack, although the human readable time resets at approximately 1hr 45 min.

The reboot after 1h45 is not very good, fortunately the new version 1.16.4 will prevent you from having charging problems.

Do you have a good WiFi connection?
What is the quality of the signal from the ESP?

reboot_timeout (Optional, Time): The amount of time to wait before rebooting when noWiFi connection exists. Can be disabled by setting this to 0s, but note that the low level IP stack currentlyseems to have issues with WiFi where a full reboot is required to get the interface back working. Defaults to 15min.
 
The reboot after 1h45 is not very good, fortunately the new version 1.16.4 will prevent you from having charging problems.

Do you have a good WiFi connection?
What is the quality of the signal from the ESP?

looks like I need to add a sensor for wifi, but it's about 10ft away from a wired Eero access point. No other devices ever had a problem and when I used this as wired to the JK, it never had a reboot or disconnect.
 
looks like I need to add a sensor for wifi, but it's about 10ft away from a wired Eero access point. No other devices ever had a problem and when I used this as wired to the JK, it never had a reboot or disconnect.

Ok so it's the Bluetooth version which is not stable with Atom Lite.
@arzaman will test the BLE version on Atom Lite.
Wait and see ;)
 
I never charge over 30C or so (about the hottest it ever gets here). I would definitely not charge at all over 35C.
Cc @Sleeper85 I have not reached 40C before. This is the hottest season and the highest recorded by my jkbms sensor was 37C charging at 70A for close to 2hrs (280k eve battery). Average battery temp is 32-34V
 
Hi guys,

I have corrected the diagram to reflect what is actually programmed.

An alarm can stop charging or discharging or both. Alarms force charging settings.
Example: if the “CAN Charging enabled” switch is OFF but the BMS reports a UVP alarm => battery charging will still be requested.

If there are no alarms and the charging switches are ON (BMS + CAN), each start/reboot or end of phase goes through the "Wait" status and starts a Bulk phase again which will be followed by the Absorption phase then will remain in Float (if the Float switch is ON).

When in Float, a new Bulk phase can start again if the battery voltage is <= than Rebulk V. therefore 52.7V with the default values.

Edit: The diagram has an error. After the absorption phase, the status is 'EOC' (End Of Charge) and not 'Wait'.

What do you think ?

Do you think of any other improvements?


JK-BMS-CAN_Charging_Logic_Diagram_V1.16.4.png
 
Last edited:
Do you think of any other improvements?

It is better to base the absorption phase of charging on current comparison instead of a fixed timer. Considering, that this project is based on JK-BMS and charging current reading is always polled (available), it should be put to use.

The logic is this simple:

Assuming that the Absorption phase of charging has been entered for a given absorption voltage of V_absorption.
Instead of counting down 30 minutes (or whatever is set),

Just run a continuously running check for charge rate instead:
If at V_absorption ,
[the (running avg. over n consecutive values) charge rate] < 0.2 × [V_absorption - 3.375 × N_cells]

Switch to FLOAT phase.
 
I have created on HA a simple "status" widget to monitor the adapter communication either CAN and BT

1706611790121.png

BT as reported (on Atom S3) seems quite stable
CAN has periodic disconnection/reconnection every 2h (quite regular)
Is this normal ?

Davide
 
It is better to base the absorption phase of charging on current comparison instead of a fixed timer. Considering, that this project is based on JK-BMS and charging current reading is always polled (available), it should be put to use.

The logic is this simple:

Assuming that the Absorption phase of charging has been entered for a given absorption voltage of V_absorption.
Instead of counting down 30 minutes (or whatever is set),

Just run a continuously running check for charge rate instead:
If at V_absorption ,
[the (running avg. over n consecutive values) charge rate] < 0.2 × [V_absorption - 3.375 × N_cells]

Switch to FLOAT phase.

So set a tail current to complete the charge. It's not complicated to do.

What do others think?
 
I have created on HA a simple "status" widget to monitor the adapter communication either CAN and BT

View attachment 192157

BT as reported (on Atom S3) seems quite stable
CAN has periodic disconnection/reconnection every 2h (quite regular)
Is this normal ?

Davide

Not normal, I have to check it at home. The CANBUS status is based on the 0x305 response sent by the inverter.
Response = ON
No response = OFF
 
It's only a matter of time.
I was going to implement tail current detection logic by myself either way.

At home when I am almost at 55.15v the current is already close to 0A. I don't have the graphs in front of me, I'm looking at it this evening.
 
This afternoon, I achieved a 100% State of Charge (SoC) for the first time since installing the protocol adapter, thanks to today's sunny weather. However, I'm noticing some strange behavior and am a bit concerned about the battery charging process.

Here's the sequence of messages I collected from Home Assistant in the sensor registry. It includes a mix of status changes, errors from the BMS, and CAN communication errors—quite a confusing situation :unsure:!

Code:
jk-bms-ble-can errors
15:54:21 - Tra 5 secondi
jk-bms-ble-can Charging Status cambiato in Bulk
15:53:52 - 24 secondi fa
jk-bms-ble-can Charging Status cambiato in Wait
15:53:50 - 1 minuto fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:51:49 - 3 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:51:38 - 3 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:50:46 - 4 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:50:45 - 4 minuti fa
jk-bms-ble-can errors cambiato in Cell Overvoltage
15:48:48 - 6 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:48:44 - 6 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:48:28 - 7 minuti fa
jk-bms-ble-can errors
15:47:45 - 7 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:47:41 - 7 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:45:49 - 9 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:45:39 - 9 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:44:47 - 10 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:44:46 - 11 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:43:05 - 12 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:42:55 - 13 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:42:13 - 13 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:42:12 - 13 minuti
jk-bms-ble-can errors cambiato in Cell Overvoltage
15:40:47 - 16 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:40:43 - 16 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:40:32 - 16 minuti fa
jk-bms-ble-can errors
15:40:05 - 17 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:39:56 - 17 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:39:55 - 17 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:38:30 - 19 minuti fa
jk-bms-ble-can errors cambiato in Cell Overvoltage
15:38:30 - 19 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:38:15 - 19 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:37:39 - 20 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:37:37 - 20 minuti fa
jk-bms-ble-can errors
15:37:37 - 20 minuti fa
jk-bms-ble-can errors cambiato in Cell Overvoltage
15:37:00 - 21 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:36:24 - 22 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:35:57 - 22 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:35:27 - 23 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:35:26 - 23 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:34:38 - 24 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:33:40 - 25 minuti fa

Additionally, here's the overall battery voltage during the same period.

1706627341815.png

I've kept the default charging parameters in the YAML file.

Any ideas on what might be happening :confused:?

Davide
 
This afternoon, I achieved a 100% State of Charge (SoC) for the first time since installing the protocol adapter, thanks to today's sunny weather. However, I'm noticing some strange behavior and am a bit concerned about the battery charging process.

Here's the sequence of messages I collected from Home Assistant in the sensor registry. It includes a mix of status changes, errors from the BMS, and CAN communication errors—quite a confusing situation :unsure:!

Code:
jk-bms-ble-can errors
15:54:21 - Tra 5 secondi
jk-bms-ble-can Charging Status cambiato in Bulk
15:53:52 - 24 secondi fa
jk-bms-ble-can Charging Status cambiato in Wait
15:53:50 - 1 minuto fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:51:49 - 3 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:51:38 - 3 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:50:46 - 4 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:50:45 - 4 minuti fa
jk-bms-ble-can errors cambiato in Cell Overvoltage
15:48:48 - 6 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:48:44 - 6 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:48:28 - 7 minuti fa
jk-bms-ble-can errors
15:47:45 - 7 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:47:41 - 7 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:45:49 - 9 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:45:39 - 9 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:44:47 - 10 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:44:46 - 11 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:43:05 - 12 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:42:55 - 13 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:42:13 - 13 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:42:12 - 13 minuti
jk-bms-ble-can errors cambiato in Cell Overvoltage
15:40:47 - 16 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:40:43 - 16 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:40:32 - 16 minuti fa
jk-bms-ble-can errors
15:40:05 - 17 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:39:56 - 17 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:39:55 - 17 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:38:30 - 19 minuti fa
jk-bms-ble-can errors cambiato in Cell Overvoltage
15:38:30 - 19 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:38:15 - 19 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:37:39 - 20 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:37:37 - 20 minuti fa
jk-bms-ble-can errors
15:37:37 - 20 minuti fa
jk-bms-ble-can errors cambiato in Cell Overvoltage
15:37:00 - 21 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:36:24 - 22 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:35:57 - 22 minuti fa
jk-bms-ble-can Charging Status cambiato in Bulk
15:35:27 - 23 minuti fa
jk-bms-ble-can Charging Status cambiato in Wait
15:35:26 - 23 minuti fa
jk-bms-ble-can Charging Status cambiato in Alarm
15:34:38 - 24 minuti fa
jk-bms-ble-can Charging Status cambiato in Absorption
15:33:40 - 25 minuti fa

Additionally, here's the overall battery voltage during the same period.

View attachment 192174

I've kept the default charging parameters in the YAML file.

Any ideas on what might be happening :confused:?

Davide
Logs suggest Cell OVP kicking.
Highly likely, a cell has gone out of balance and is peaking ahead of the pack

Also, JK BMS usually don't show 100% SOC. 100%SOC is immediately shown only when BMS throws Cell OVP. Otherwise , they show 95% when the lowest Cell gets above 3.5 V
 
@arzaman

Thank you for testing the alarm system.

It looks like you have an OVP alarm. What value is set for OVP in the BMS? 3.65V or less? You can see it in HA.

You can check this by analyzing the cell voltage at the end of charging, everything is saved in HA.
 
Logs suggest Cell OVP kicking.
Highly likely, a cell has gone out of balance and is peaking ahead of the pack

Also, JK BMS usually don't show 100% SOC. 100%SOC is immediately shown only when BMS throws Cell OVP. Otherwise , they show 95% when the lowest Cell gets above 3.5 V

FYI, The latest JK-BMS like the one I own have a 0% and 100% setting. I set 100% to 3.45V and 0% to 3.0V.
 
Logs suggest Cell OVP kicking.
Highly likely, a cell has gone out of balance and is peaking ahead of the pack
It seems so. This is the level of overvoltage set on JK-BMS protection, overall 3.6 x 16 = 57.6V, which has never been reached on average. It's possible that one cell exceeds the 3.6V limit and triggers the alarm.

If I understand correctly, when the alarm is active, charging is stopped. Then the voltage drops, and the cycle starts again—Bulk -> Absorption -> alarm.

What do you suggest to avoid this situation? Lower the bulk voltage level?

1706632891137.png
 
@arzaman

Thank you for testing the alarm system.

It looks like you have an OVP alarm. What value is set for OVP in the BMS? 3.65V or less? You can see it in HA.

You can check this by analyzing the cell voltage at the end of charging, everything is saved in HA.

I plotted the max cell voltage for every cell, and there is a bunch of cells that exceed the Over Voltage Protection (OVP). I'm not sure how to fix it.
Should I increase the OVP to 3.65V or decrease the bulk voltage ? other ?


1706633982960.png
 
It seems so. This is the level of overvoltage set on JK-BMS protection, overall 3.6 x 16 = 57.6V, which has never been reached on average. It's possible that one cell exceeds the 3.6V limit and triggers the alarm.

If I understand correctly, when the alarm is active, charging is stopped. Then the voltage drops, and the cycle starts again—Bulk -> Absorption -> alarm.

What do you suggest to avoid this situation? Lower the bulk voltage level?

View attachment 192189

Chek the bms logs.
 
I plotted the max cell voltage for every cell, and there is a bunch of cells that exceed the Over Voltage Protection (OVP). I'm not sure how to fix it.
Should I increase the OVP to 3.65V or decrease the bulk voltage ? other ?


View attachment 192193

Battery at rest without large charge or discharge. What voltage does Deye and BMS display?

There may be a calibration problem.
 

diy solar

diy solar
Back
Top