diff --git a/documents/README/BMS_JK-PB_RS485_solution.md b/documents/README/BMS_JK-PB_RS485_solution.md index 229d6ba..021f196 100644 --- a/documents/README/BMS_JK-PB_RS485_solution.md +++ b/documents/README/BMS_JK-PB_RS485_solution.md @@ -10,64 +10,24 @@ [JK_RS485](https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md) by [@txubelaxu](https://github.com/txubelaxu) -## ESP32 board +## Hardware -Hardware wise, [Atom S3](https://docs.m5stack.com/en/core/AtomS3) solution is easier and cleaner but [ESP32-S3 DevKitC-1](https://docs.espressif.com/projects/esp-idf/en/v5.3/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html) has more GPIOs and PSRAM. +> [!TIP] +> This solution only requires an ESP32 with a CAN transceiver and a RS485 transceiver. -### Atom S3 +You are free to choose the hardware you want, the list below are 3 easy to use examples : -- [Atom S3 - SKU:C123](https://docs.m5stack.com/en/core/AtomS3) -- [Atom S3 Lite - SKU:C124](https://docs.m5stack.com/en/core/AtomS3%20Lite) -- [Atomic CAN Base - SKU:A103](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) +- `AtomS3` with the isolated `Atomic CAN base` and `RS485 unit` +- [`LilyGo T-Connect`, ESP32-S3 with 3x RS485 and 1x CAN](https://github.com/Xinyuan-LilyGO/T-Connect) +- [`LilyGo T-CAN485`, ESP32 with 1x RS485 and 1x CAN](https://github.com/Xinyuan-LilyGO/T-CAN485) -Note: `Atom S3 Lite` does not have a display. +See the [documentation about supported hardware](Supported_devices.md). -### ESP32-S3 DevKitC-1 +### M5Stack AtomS3 example (no welding) -- [ESP32-S3 N16R8](https://a.aliexpress.com/_EzFdrw3) -- [SN65HVD230 3V3 CAN transceiver](https://a.aliexpress.com/_Evq9Ra7) +The example below uses an `AtomS3` (display) with the `Atomic CAN base` and `RS485 unit`. -## RS485 unisolated board (not recommanded) - -This board is the one used by [@txubelaxu](https://github.com/txubelaxu) the developer of the RS485 component for the new JK-PB series BMS.
-This board is certainly not the best, it does not have galvanic isolation and requires a `TALK PIN`. - -![Image](../../images/RS485_Transceiver_MAX485_TALK_PIN_board.jpg "MAX485 UART-RS485") - -## RS485 isolated board (recommended for making your own PCB) - -This board has galvanic isolation and does not require a `TALK PIN` (this avoids having to solder a wire to the Atomic CAN base of the Atom S3). - -![Image](../../images/RS485_Transceiver_isolated_high_speed_dual_board.png "ADUM3201 B0505XT TTL to RS485") - -[RS485 isolated board (high speed dual)](https://a.aliexpress.com/_EueIZT5) - -Note: choose the `high speed dual` version ! - -## M5stack RS485 isolated unit [SKU:U094] (recommended with M5stack Atom S3 solution) - -If you are using M5stack solution with Atom S3, this [RS485 unit](https://docs.m5stack.com/en/unit/iso485) is the simplest solution without soldering. - -![Image](../../images/RS485_Transceiver_M5stack_SKU-U094_RS485_Isolated_Unit.png "M5stack RS485 isolated unit (SKU:U094)") - -## M5stack Atom S3 with CAN base and RS485 unit - -If soldering or creating your own board seems complicated to you, know that it is possible to use the Atom S3 solution from M5Stack. - -**Choose Atom S3 (display) or Atom S3 Lite + Atomic CAN base + RS485 unit** - -- [Atom S3 - SKU:C123](https://docs.m5stack.com/en/core/AtomS3) -- [Atom S3 Lite - SKU:C124](https://docs.m5stack.com/en/core/AtomS3%20Lite) -- [Atomic CAN Base - SKU:A103](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) -- [RS485 Isolated Unit - SKU:U094](https://docs.m5stack.com/en/unit/iso485) - -| Atomic S3 Lite | Atomic CAN Base | RS485 isolated Unit | -| --- | --- | --- | -| | | | - -The example below uses an Atom S3 (display) with the CAN base and RS485 unit. - -![Image](../../images/Solution_M5stack_AtomS3_CAN_base_RS485_unit.png "M5stack Atom S3 solution") +![Image](../../images/Solution_M5stack_AtomS3_CAN_base_RS485_unit.png "M5stack AtomS3 solution") ## Schematic and setup instructions @@ -75,19 +35,15 @@ The example below uses an Atom S3 (display) with the CAN base and RS485 unit. > Galvanic isolation of the `RS485` connection is strongly recommended. > The diagrams below does not show the galvanic isolation of the `RS485` connection ! -> [!IMPORTANT] -> The boards `uart` are configured by default with an `rx_buffer_size` of `512` which **normally** is fine for all components. Only one user reported to me an instability problem with his `Atom S3` which he solved by increasing the `rx_buffer_size` to `1024`, this user is also the only one currently using the isolated RS485 unit of M5Stack. -> If you encounter a similar problem, let me know. - **Note:** the choice of RS485 board is not related to the chosen ESP32. -### Atom S3 with unisolated RS485 board +### AtomS3 with unisolated RS485 board ``` ┌──────────┐ ┌───────────┐ ┌──────────┐ │ │ │ UART │<-VCC--------------5V--│ │<---5V │ BMS │ │ TO │ │ ESP32 │ -│ JK-PB │<-RJ45-P1-----B->│ RS485 │<-DI-----------TX--G1--│ ATOM S3 │ +│ JK-PB │<-RJ45-P1-----B->│ RS485 │<-DI-----------TX--G1--│ Atom S3 │ │ │<-RJ45-P2-----A->│ │--RO-----------RX--G2->│ │ ┌────────────┐ ┌────────────┐ │ RS485 │ │ CONVERTER │<-DE--+ │ │--G5--TX-----CTX->| | | | │ NETWORK │ │ │<-RE--└--TALK PIN--G8--│ │<-G6--RX-----CRX--| Atomic |<---CAN H--->| Inverter | diff --git a/documents/README/Supported_devices.md b/documents/README/Supported_devices.md index ed4eb57..048cc20 100644 --- a/documents/README/Supported_devices.md +++ b/documents/README/Supported_devices.md @@ -6,14 +6,6 @@ ![GitHub forks](https://img.shields.io/github/forks/Sleeper85/esphome-yambms) ![GitHub watchers](https://img.shields.io/github/watchers/Sleeper85/esphome-yambms) -## Supported ESP32 - -**Recommended: ESP32-S3 or Atom S3** - -* [M5Stack Atom S3](Supported_devices_M5Stack_Atom_S3.md) -* [PVbrain2 with ESP32-S3](https://github.com/SeByDocKy/pvbrain2) (up to 11 BMS monitored with `UART`) -* [Build your own PCB with ESP32 or ESP32-S3](Supported_devices_Build_your_own_PCB.md) - ## Supported BMS * All `JK-B` BMS models with software version `>=6.0`, see [esphome-jk-bms](https://github.com/syssi/esphome-jk-bms) @@ -25,27 +17,47 @@ ## Supported shunt -* `Victron Smartshunt` (UART), see [VictronMPPT-ESPHOME](https://github.com/KinDR007/VictronMPPT-ESPHOME) -* `Victron Smartshunt` (BLE), see [esphome-victron_ble](https://github.com/Fabian-Schmidt/esphome-victron_ble) -* `Junctek KH-F` (UART/RS485), see [esphome-junctek_khf](https://github.com/Sleeper85/esphome-junctek_khf) +* `Victron Smartshunt` (UART) +* `Victron Smartshunt` (BLE) +* `Junctek KH-F` (UART/RS485) **Note: other Shunt brands already integrated with ESPhome can be added easily.** +## Supported ESP32 + +**Recommended: AtomS3 or ESP32-S3** + +* [M5Stack AtomS3 dedicated documentation](Supported_devices_M5Stack_AtomS3.md) +* [PVbrain2 with ESP32-S3](https://github.com/SeByDocKy/pvbrain2) (up to 11 BMS monitored with `UART`) +* [Build your own PCB with ESP32 or ESP32-S3](Supported_devices_Build_your_own_PCB.md) + +| [AtomS3 Lite](https://docs.m5stack.com/en/core/AtomS3%20Lite) | [AtomS3](https://docs.m5stack.com/en/core/AtomS3) | [AtomS3R (8MB PSRAM)](https://docs.m5stack.com/en/core/AtomS3R) | +| --- | --- | --- | +| | | | + +| [ESP32 DevKit-V1](https://a.aliexpress.com/_EG12CJ2) | [ESP32-S3 DevKitC-1](https://a.aliexpress.com/_EzFdrw3) | [ESP32-C3 ETH01-EVO](https://a.aliexpress.com/_Ey29fog) | +| --- | --- | --- | +| | | | + +| [espBerry + Waveshare 2-CH CAN HAT](https://copperhilltech.com/esp32-development-board-with-dual-isolated-can-bus-hat/) | [LilyGo T-CAN485 (ESP32)](https://github.com/Xinyuan-LilyGO/T-CAN485) | [LilyGo T-Connect (ESP32-S3)](https://github.com/Xinyuan-LilyGO/T-Connect) | +| --- | --- | --- | +| | | | + ## Supported CAN bus transceiver **Note: some inverters only accept a CAN bus at 3.3V in this case please choose the SN65HVD230 chip.** -| TJA1050 (5V) | TJA1051 (5V) | SN65HVD230 (3V3) | +| TJA1050 (5V) | [TJA1051T (5V)](https://a.aliexpress.com/_EIdl3b5) | [SN65HVD230 (3V3)]((https://a.aliexpress.com/_Evq9Ra7)) | | --- | --- | --- | | | | | -| [M5Stack Atomic CAN Base (isolated)](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) | [M5Stack CAN Unit (isolated)](https://docs.m5stack.com/en/unit/can) | MCP2515 (5V) | +| [M5Stack Atomic CAN Base (isolated)](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) | [M5Stack CAN Unit (isolated)](https://docs.m5stack.com/en/unit/can) | [MCP2515 (5V)](https://a.aliexpress.com/_EGPcjhZ) | | --- | --- | --- | | | | | ## Supported RS485 transceiver -| [M5Stack RS485 unit (isolated)](https://docs.m5stack.com/en/unit/iso485) | [RS485 isolated board (high speed dual)](https://a.aliexpress.com/_EueIZT5) | [RS485 Two-way Converter](https://electronics.stackexchange.com/questions/244425/how-is-this-rs485-module-working) | +| [M5Stack RS485 Unit (isolated)](https://docs.m5stack.com/en/unit/iso485) | [RS485 isolated board (high speed dual)](https://a.aliexpress.com/_EueIZT5) | [RS485 Two-way Converter](https://electronics.stackexchange.com/questions/244425/how-is-this-rs485-module-working) | | --- | --- | --- | | | | | diff --git a/documents/README/Supported_devices_M5Stack_AtomS3.md b/documents/README/Supported_devices_M5Stack_AtomS3.md new file mode 100644 index 0000000..8f40ca3 --- /dev/null +++ b/documents/README/Supported_devices_M5Stack_AtomS3.md @@ -0,0 +1,56 @@ +# YamBMS - M5Stack AtomS3, the Plug & Play solution (no welding) + +[![Badge License: GPLv3](https://img.shields.io/badge/License-GPLv3-brightgreen.svg)](https://www.gnu.org/licenses/gpl-3.0) +[![Badge Version](https://img.shields.io/github/v/release/Sleeper85/esphome-yambms?include_prereleases&color=yellow&logo=DocuSign&logoColor=white)](https://github.com/Sleeper85/esphome-yambms/releases/latest) +![GitHub stars](https://img.shields.io/github/stars/Sleeper85/esphome-yambms) +![GitHub forks](https://img.shields.io/github/forks/Sleeper85/esphome-yambms) +![GitHub watchers](https://img.shields.io/github/watchers/Sleeper85/esphome-yambms) + +> [!IMPORTANT] +> AtomS3 provides very few GPIOs. +> This solution is not the best for supervising a large number of `JK-B BMS` via `UART` but it works very well for supervising a large number of `JK-PB BMS` via `RS485`. + +> [!TIP] +> If you have `JK-PB BMS` (inverter BMS) and want to monitor them via `RS485`, please read the [BMS JK-PB RS485](BMS_JK-PB_RS485_solution.md) dedicated topic. + +## Number of BMS supported + +* 3x BMS with `Bluetooth` (BLE stack consumes significant amount of RAM on device and can cause crash and reboot) +* 2x `JK-B` BMS with `UART/RS485` (the second UART must be soldered on the Atomic CAN base on GPIOs G7 and G8) +* several `JK-PB` BMS with `RS485` (already tested with 7 BMS) + +Note: these are theoretical limits, not all combinations have been tested. + +## List of M5Stack components that can be used depending on needs + +> [!TIP] +> Choose an `AtomS3` to clip onto the `Atomic CAN Base`. +> Feel free to ask your question on the [DIY solar forum](https://diysolarforum.com/threads/yambms-jk-bms-can-with-new-cut-off-charging-logic-open-source.79325/) if you don't know what to choose. + +- [AtomS3 Lite - SKU:C124](https://docs.m5stack.com/en/core/AtomS3%20Lite) +- [AtomS3 - SKU:C123](https://docs.m5stack.com/en/core/AtomS3) +- [AtomS3R - SKU:C126 (8MB PSRAM)](https://docs.m5stack.com/en/core/AtomS3R) +- [Atomic CAN Base - SKU:A103 (recommended)](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) +- [CAN Unit - SKU:U085](https://docs.m5stack.com/en/unit/can) +- [RS485 Unit - SKU:U094](https://docs.m5stack.com/en/unit/iso485) + +| [AtomS3 Lite](https://docs.m5stack.com/en/core/AtomS3%20Lite) | [AtomS3](https://docs.m5stack.com/en/core/AtomS3) | [AtomS3R (8MB PSRAM)](https://docs.m5stack.com/en/core/AtomS3R) | +| --- | --- | --- | +| | | | + +| [Atomic CAN Base (isolated)](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) | [CAN Unit (isolated)](https://docs.m5stack.com/en/unit/can) | [RS485 Unit (isolated)](https://docs.m5stack.com/en/unit/iso485) | +| --- | --- | --- | +| | | | + +## Note regarding the sensors managing the display backlight (ili9xxx platform) + +* **Backlight control** : manual brightness control +* **Backlight max level** : limit the max brightness in general +* **Backlight Autodim level** : the desired brightness when dimmed down (set to 0 to switch off screen completely instead of dimming down) +* **Backlight Autodim time in min** : time in minutes, after the screen will dim down (set to 0 to disable Auto dimming) + +Device will restore last screen brightness after boot, but the timer script does not get start automatically. +The auto dim timer gets initially started by pressing the screen button (which bumps up the brightness to 100% until the timer dims down then). + +That seems to be the easiest and lightweight solution. +But i guess some user could be confused and expect from the device to react immediately after changing some parameters. diff --git a/documents/README/Supported_devices_M5Stack_Atom_S3.md b/documents/README/Supported_devices_M5Stack_Atom_S3.md deleted file mode 100644 index 20c6c50..0000000 --- a/documents/README/Supported_devices_M5Stack_Atom_S3.md +++ /dev/null @@ -1,53 +0,0 @@ -# YamBMS - M5Stack Atom S3 (ESP32-S3FN8) - -[![Badge License: GPLv3](https://img.shields.io/badge/License-GPLv3-brightgreen.svg)](https://www.gnu.org/licenses/gpl-3.0) -[![Badge Version](https://img.shields.io/github/v/release/Sleeper85/esphome-yambms?include_prereleases&color=yellow&logo=DocuSign&logoColor=white)](https://github.com/Sleeper85/esphome-yambms/releases/latest) -![GitHub stars](https://img.shields.io/github/stars/Sleeper85/esphome-yambms) -![GitHub forks](https://img.shields.io/github/forks/Sleeper85/esphome-yambms) -![GitHub watchers](https://img.shields.io/github/watchers/Sleeper85/esphome-yambms) - -> [!IMPORTANT] -> Atom S3 provides very few GPIOs without UART expander. -> BMS monitoring with `UART` or `RS485` is recommended. - -## Number of BMS supported - -* 2x BMS with `Bluetooth` (BLE stack consumes significant amount of RAM on device and can cause crash and reboot) -* 2x `JK-B` BMS with `UART/RS485` (the second UART must be soldered on the Atomic CAN base on GPIOs G7 and G8) -* several `JK-PB` BMS with `RS485` (already tested with 7 BMS) - -Note: these are theoretical limits, not all combinations have been tested. - -## UART/IO Expander - -Theoretically, with the 4 GPIOs available, it would be possible to add one [WK2168 4x UART expander](https://esphome.io/components/weikai.html) for a total of 4x `JK-B` BMS monitored with `UART`. - -## M5Stack Atom CAN Kit (the Plug & Play solution) - -> [!IMPORTANT] -> If you have JK-PB series BMS (inverter BMS) and want to monitor them via RS485, please read the [README](BMS_JK-PB_RS485_solution.md) dedicated to this topic. - -If soldering or creating your own board seems complicated to you, know that it is possible to use the Atom CAN Kit from M5Stack.
- -**Choose Atom S3 (display) or Atom S3 Lite + Atomic CAN base.** - -- [Atom S3 - SKU:C123](https://docs.m5stack.com/en/core/AtomS3) -- [Atom S3 Lite - SKU:C124](https://docs.m5stack.com/en/core/AtomS3%20Lite) -- [Atomic CAN Base - SKU:A103](https://docs.m5stack.com/en/atom/Atomic%20CAN%20Base) - -| Atomic S3 Lite | Atomic CAN Base | -| --- | --- | -| | | - -## Note regarding the sensors managing the display Backlight - -* **Backlight control** : manual brightness control -* **Backlight max level** : limit the max brightness in general -* **Backlight Autodim level** : the desired brightness when dimmed down (set to 0 to switch off screen completely instead of dimming down) -* **Backlight Autodim time in min** : time in minutes, after the screen will dim down (set to 0 to disable Auto dimming) - -Device will restore last screen brightness after boot, but the timer script does not get start automatically. -The auto dim timer gets initially started by pressing the screen button (which bumps up the brightness to 100% until the timer dims down then). - -That seems to be the easiest and lightweight solution. -But i guess some user could be confused and expect from the device to react immediately after changing some parameters. \ No newline at end of file diff --git a/documents/RS485 protocol/Shoto RS485 Modbus protocol V1.2.pdf b/documents/RS485 protocol/Shoto RS485 Modbus protocol V1.2.pdf new file mode 100644 index 0000000..786d715 Binary files /dev/null and b/documents/RS485 protocol/Shoto RS485 Modbus protocol V1.2.pdf differ diff --git a/images/Atom_CAN_Kit.png b/images/Atom_CAN_Kit.png deleted file mode 100644 index cf1a5b5..0000000 Binary files a/images/Atom_CAN_Kit.png and /dev/null differ diff --git a/images/Atom_Lite_ESP32-PICO_pin.png b/images/Atom_Lite_ESP32-PICO_pin.png deleted file mode 100644 index 8c83be1..0000000 Binary files a/images/Atom_Lite_ESP32-PICO_pin.png and /dev/null differ diff --git a/images/Atom_S3.jpg b/images/Atom_S3.jpg deleted file mode 100644 index 053d0be..0000000 Binary files a/images/Atom_S3.jpg and /dev/null differ diff --git a/images/MCU_AtomS3.png b/images/MCU_AtomS3.png new file mode 100644 index 0000000..4dac856 Binary files /dev/null and b/images/MCU_AtomS3.png differ diff --git a/images/MCU_AtomS3R.png b/images/MCU_AtomS3R.png new file mode 100644 index 0000000..148450d Binary files /dev/null and b/images/MCU_AtomS3R.png differ diff --git a/images/Atom_S3_Lite.png b/images/MCU_AtomS3_Lite.png similarity index 100% rename from images/Atom_S3_Lite.png rename to images/MCU_AtomS3_Lite.png diff --git a/images/Atom_S3_Lite_schematic.png b/images/MCU_AtomS3_Lite_schematic.png similarity index 100% rename from images/Atom_S3_Lite_schematic.png rename to images/MCU_AtomS3_Lite_schematic.png diff --git a/images/Atom_S3_schematic.jpg b/images/MCU_AtomS3_schematic.jpg similarity index 100% rename from images/Atom_S3_schematic.jpg rename to images/MCU_AtomS3_schematic.jpg diff --git a/images/MCU_ESP32-C3_ETH01-EVO.png b/images/MCU_ESP32-C3_ETH01-EVO.png new file mode 100644 index 0000000..3babd5d Binary files /dev/null and b/images/MCU_ESP32-C3_ETH01-EVO.png differ diff --git a/images/MCU_ESP32-DevKit-V1.jpg b/images/MCU_ESP32-DevKit-V1.jpg new file mode 100644 index 0000000..ba980a1 Binary files /dev/null and b/images/MCU_ESP32-DevKit-V1.jpg differ diff --git a/images/MCU_ESP32-DevKit-V1_pinout.png b/images/MCU_ESP32-DevKit-V1_pinout.png new file mode 100644 index 0000000..e9ee2cc Binary files /dev/null and b/images/MCU_ESP32-DevKit-V1_pinout.png differ diff --git a/images/MCU_ESP32-DevKitC_espBerry_2-CH-CAN.png b/images/MCU_ESP32-DevKitC_espBerry_2-CH-CAN.png new file mode 100644 index 0000000..b52a062 Binary files /dev/null and b/images/MCU_ESP32-DevKitC_espBerry_2-CH-CAN.png differ diff --git a/images/MCU_ESP32-S3-DevKitC-1.png b/images/MCU_ESP32-S3-DevKitC-1.png new file mode 100644 index 0000000..3eb0a73 Binary files /dev/null and b/images/MCU_ESP32-S3-DevKitC-1.png differ diff --git a/images/MCU_ESP32-S3-DevKitC-1_pinout.png b/images/MCU_ESP32-S3-DevKitC-1_pinout.png new file mode 100644 index 0000000..c4391b3 Binary files /dev/null and b/images/MCU_ESP32-S3-DevKitC-1_pinout.png differ diff --git a/images/MCU_ESP32-S3_LilyGo-T-Connect.jpg b/images/MCU_ESP32-S3_LilyGo-T-Connect.jpg new file mode 100644 index 0000000..04fca7e Binary files /dev/null and b/images/MCU_ESP32-S3_LilyGo-T-Connect.jpg differ diff --git a/images/MCU_ESP32_LilyGo-T-CAN485.jpg b/images/MCU_ESP32_LilyGo-T-CAN485.jpg new file mode 100644 index 0000000..784e498 Binary files /dev/null and b/images/MCU_ESP32_LilyGo-T-CAN485.jpg differ diff --git a/images/MCU_ESP32_LilyGo-T-CAN485_overview.jpg b/images/MCU_ESP32_LilyGo-T-CAN485_overview.jpg new file mode 100644 index 0000000..6321eec Binary files /dev/null and b/images/MCU_ESP32_LilyGo-T-CAN485_overview.jpg differ