{"id":25411330,"url":"https://github.com/peff74/arduino-jk-bms","last_synced_at":"2026-04-30T13:34:19.717Z","repository":{"id":277738857,"uuid":"933344583","full_name":"peff74/Arduino-jk-bms","owner":"peff74","description":"Arduino script to monitor and control a Jikong Battery Management System JK-BMS via BLE","archived":false,"fork":false,"pushed_at":"2025-02-27T20:16:12.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T02:28:37.431Z","etag":null,"topics":["arduino","ble","bluetooth","bms","esp32","esp32-c3-super-mini","jikong-bms","jk","jk-bms","jkbms","nimble"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peff74.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-15T18:23:15.000Z","updated_at":"2025-02-27T20:16:15.000Z","dependencies_parsed_at":"2025-02-15T19:32:03.833Z","dependency_job_id":"c83f6551-136e-4ad8-8cb1-3723ba2f9d17","html_url":"https://github.com/peff74/Arduino-jk-bms","commit_stats":null,"previous_names":["peff74/arduino-jk-bms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FArduino-jk-bms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FArduino-jk-bms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FArduino-jk-bms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peff74%2FArduino-jk-bms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peff74","download_url":"https://codeload.github.com/peff74/Arduino-jk-bms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248845165,"owners_count":21170713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","ble","bluetooth","bms","esp32","esp32-c3-super-mini","jikong-bms","jk","jk-bms","jkbms","nimble"],"created_at":"2025-02-16T10:17:09.590Z","updated_at":"2026-04-30T13:34:19.688Z","avatar_url":"https://github.com/peff74.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arduino script with NimBLE to monitor JK-BMS \n\nThis project is a modified version of [syssi/esphome-jk-bms](https://github.com/syssi/esphome-jk-bms/), rewritten for Arduino using NimBLE.\nUsefull for v11 / v15 BMS and also for v19 but there seem to be differences depending on [which ESP32](https://github.com/peff74/Arduino-jk-bms/issues/7#issuecomment-3515887170) you use.\n\n## Features\n*   **Real-time Monitoring**:\n    \n    *   All data that are also available via the app\n        \n    *   Cell voltages, resistances, temperatures, battery voltage, current, state of charge and more\n        \n    *   BMS settings and status flags.\n        \n*   **Control**:\n    \n    *   Turn **Charging**, **Discharging**, and **Balancing** ON/OFF for each BMS.\n \n    *   I plan to add more.\n        \n*   **System Information**:\n    \n    *   Uptime \n        \n    *   Free heap memory \n        \n    *   Sketch information \n        \n*   **Multi-BMS Support**:\n    \n    *   Monitor and control multiple BMS devices simultaneously.\n        \n*   **Web Interface**:\n    \n    *   Simple but not pretty web interface with all data and some switches.\n \n    *   A small file manager is included to handle web server files\n        \n    *   Automatic refresh \n\n\nInstallation\n------------\n\n*   **Get startet**:\n\n    *   copy index.html + style.css + jk-bms.ino local\n    \n*   **Open the Project in Arduino IDE**:\n    \n    *   Open the jk-bms.ino file in the Arduino IDE.\n        \n*   **Install Required Libraries**:\n    \n    *   Install the libraries NimBLEDevice + ArduinoJson\n \n    *   All others are included in the IDE by default\n \n*   **Edit settings**:\n\n    *   WiFi SSID / Password + MAC from the BMS\n        \n*   **Upload the Sketch**:\n    \n    *   Connect your ESP32 to your computer.\n        \n    *   Select the correct board and port in the Arduino IDE.\n        \n    *   Upload the sketch to the ESP32.\n        \n*   **Access the Web Interface**:\n    \n    *   After the upload, the ESP32 will connect to your Wi-Fi and the IP will be displayed in the serial monitor.\n        \n    *   Open a web browser and navigate to the IP address of the ESP32.\n \n    *   A small error message appears that no Index.html was found\n \n    *   Follow the link or use http://IP/fs to upload index.html + style.css to the ESP32\n \n## Examples\n\n   *   Serial interface\n\n\u003cdetails\u003e\n\u003csummary\u003e📁 Click to show\u003c/summary\u003e\n\n```\nrst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)\nconfigsip: 0, SPIWP:0xee\nclk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00\nmode:DIO, clock div:1\nload:0x3fff0030,len:4916\nload:0x40078000,len:16436\nload:0x40080400,len:4\nho 8 tail 4 room 4\nload:0x40080404,len:3524\nentry 0x400805b8\n..\nWiFi connected\nIP address: \n192.168.0.102\nLittleFS Mounted Successfully\nInitializing NimBLE Client...\nStarting scan...\nBLE Device found: Name: , Address: 27:74:79:c1:9a:a6, manufacturer data: 0600010f200283b89eafdb644a971466f6f372ef262acdf0eb0c92be0f\nBLE Device found: Name: JK_BD4A20S4P, Address: 20:22:08:25:26:8b, manufacturer data: 4a4b0001, serviceUUID: 0xffe0\nFound target device: 20:22:08:25:26:8b\nAttempting to connect to 20:22:08:25:26:8b...\nNew client created.\nConnected to 20:22:08:25:26:8b\nConnected to: 20:22:08:25:26:8b RSSI: -41\nSubscribed to notifications for 0xffe1\nWriting register: address=0x97, value=0x00000000, length=0\nFrame to be sent: AA 55 90 EB 97 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 \nNotification received...\nHandling notification...\nStart of data frame detected.\nNotification received...\nHandling notification...\nContinuing data frame...\nNew data available for parsing.\nDevice info frame detected.\nProcessing device info...\nRaw data received:\n55 AA EB 90 03 77 4A 4B 5F 42 44 34 41 32 30 53 \n34 50 00 00 00 00 31 31 2E 58 57 00 00 00 31 31 \n2E 32 35 00 00 00 90 C4 05 00 3A 00 00 00 4A 4B \n5F 42 44 34 41 32 30 53 34 50 00 00 00 00 31 32 \n33 34 00 00 00 00 00 00 00 00 00 00 00 00 32 34 \n30 39 32 37 00 00 32 30 38 32 33 32 31 34 33 39 \n00 30 30 30 30 00 49 6E 70 75 74 20 55 73 65 72 \n64 61 74 61 00 00 31 32 33 34 00 00 00 00 00 00 \n00 00 00 00 00 00 49 6E 70 75 74 20 55 73 65 72 \n64 61 74 61 00 00 7C F8 FF FF 1F 0D 00 00 00 00 \n00 00 90 0F 00 00 00 00 C0 D8 03 00 00 00 00 01 \n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE \n0F 00 00 00 00 00 00 00 00 00 00 53 \n  Vendor ID: JK_BD4A20S4P\n  Hardware version: 11.XW\n  Software version: 11.25\n  Uptime: 378000 s\n  Power on count: 58\n  Device name: JK_BD4A20S4P\n  Device passcode: 1234\n  Manufacturing date: 240927\n  Serial number: 2082321439\n  Passcode: 0000\n  User data: Input Userdata\n  Setup passcode: 1234\nNotification received...\nHandling notification...\nWriting register: address=0x96, value=0x00000000, length=0\nFrame to be sent: AA 55 90 EB 96 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 \n20:22:08:25:26:8b connected successfully\nNotification received...\nHandling notification...\nStart of data frame detected.\nNotification received...\nHandling notification...\nContinuing data frame...\nNew data available for parsing.\nBMS Settings frame detected.\nProcessing BMS settings...\nCell voltage undervoltage protection: 2.82V\nCell voltage undervoltage recovery: 2.85V\nCell voltage overvoltage protection: 4.20V\nCell voltage overvoltage recovery: 4.18V\nBalance trigger voltage: 0.01V\nPower off voltage: 2.80V\nMax charge current: 25.00A\nCharge overcurrent protection delay: 30.00s\nCharge overcurrent protection recovery time: 60.00s\nMax discharge current: 40.00A\nDischarge overcurrent protection delay: 300.00s\nDischarge overcurrent protection recovery time: 60.00s\nShort circuit protection recovery time: 60.00s\nMax balance current: 0.40A\nCharge overtemperature protection: 70.00C\nCharge overtemperature protection recovery: 60.00C\nDischarge overtemperature protection: 70.00C\nDischarge overtemperature protection recovery: 60.00C\nCharge undertemperature protection: -20.00C\nCharge undertemperature protection recovery: -10.00C\nPower tube overtemperature protection: 100.00C\nPower tube overtemperature protection recovery: 80.00C\nCell count: 9\nTotal battery capacity: 40.00Ah\nShort circuit protection delay: 1500.00us\nBalance starting voltage: 3.00V\nNotification received...\nHandling notification...\nNotification received...\nHandling notification...\nStart of data frame detected.\nNotification received...\nHandling notification...\nContinuing data frame...\nNew data available for parsing.\nCell data frame detected.\nParsing data...\n\n--- Data from 20:22:08:25:26:8b ---\nCell Voltages:\n  Cell 01: 3.695 V\n  Cell 02: 3.696 V\n  Cell 03: 3.696 V\n  Cell 04: 3.698 V\n  Cell 05: 3.697 V\n  Cell 06: 3.701 V\n  Cell 07: 3.700 V\n  Cell 08: 3.700 V\n  Cell 09: 3.696 V\n  Cell 10: 0.000 V\n  Cell 11: 0.000 V\n  Cell 12: 0.000 V\n  Cell 13: 0.000 V\n  Cell 14: 0.000 V\n  Cell 15: 0.000 V\n  Cell 16: 0.000 V\nwire Resist:\n  Cell 01: 0.321 Ohm\n  Cell 02: 0.326 Ohm\n  Cell 03: 0.332 Ohm\n  Cell 04: 0.325 Ohm\n  Cell 05: 0.310 Ohm\n  Cell 06: 0.314 Ohm\n  Cell 07: 0.314 Ohm\n  Cell 08: 0.312 Ohm\n  Cell 09: 0.313 Ohm\n  Cell 10: 0.000 Ohm\n  Cell 11: 0.000 Ohm\n  Cell 12: 0.000 Ohm\n  Cell 13: 0.000 Ohm\n  Cell 14: 0.000 Ohm\n  Cell 15: 0.000 Ohm\n  Cell 16: 0.000 Ohm\nAverage Cell Voltage: 3.70V\nDelta Cell Voltage: 0.01V\nBalance Curr: 0.00A\nBattery Voltage: 33.28V\nBattery Power: 0.00W\nCharge Current: 0.00A\nCharge: 77%\nCapacity Remain: 30.81Ah\nNominal Capacity: 40.00Ah\nCycle Count: 0.00\nCycle Capacity: 0.05Ah\nTemperature T1: 22.0C\nTemperature T2: 22.9C\nTemperature MOS: 28.1C\nUptime: 4d 9h 4m\nCharge: 1\nDischarge: 1\nBalance: 0\nBalancing Action: 0\nNotification received...\nHandling notification...\nIgnoring notification. Remaining: 9\nNotification received...\nHandling notification...\nIgnoring notification. Remaining: 8\nNotification received...\nHandling notification...\nIgnoring notification. Remaining: 7\nNotification received...\nHandling notification...\nIgnoring notification. Remaining: 6\nNotification received...\nHandling notification...\nIgnoring notification. Remaining: 5\nNotification received...\nHandling notification...\nIgnoring notification. Remaining: 4\nNotification received...\nHandling notification...\nIgnoring notification. Remaining: 3\nNotification received...\nHandling notification...\n```\n\u003c/details\u003e\n\n\n *   Web interface\n\n![Exampel](https://github.com/peff74/Arduino-jk-bms/blob/main/jkbms_website.png)\n\n## Disclaimer\nThis is an experimental project. Use it at your own risk.\n\n## Credits\nBased on the work of [syssi](https://github.com/syssi).\n\n![Badge](https://hitscounter.dev/api/hit?url=https%3A%2F%2Fgithub.com%2Fpeff74%2FArduino-jk-bms\u0026label=Hits\u0026icon=github\u0026color=%23198754\u0026message=\u0026style=flat\u0026tz=UTC)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeff74%2Farduino-jk-bms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeff74%2Farduino-jk-bms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeff74%2Farduino-jk-bms/lists"}