A hardware-based security shield for Battery Management Systems (JBD/Xiaoxiang, Daly, and JK).
This project runs on an ESP32 (e.g., Seeed Studio XIAO ESP32-S3) and works by "squatting" on the BMS's single Bluetooth Low Energy (BLE) connection slot. Since BLE peripherals only allow one active controller at a time, the ESP32 keeps the connection occupied 24/7. This prevents any unauthorized third party from connecting to your BMS and controlling the charge/discharge MOSFETs.
When you need to connect your phone or laptop to check telemetry, you can temporarily release the lock using the built-in BOOT button or the secure Wi-Fi web portal.
- Protocol-Agnostic Link-Layer Locking: Connects strictly at the Bluetooth link layer. Zero data packets or keep-alive commands are transmitted, ensuring maximum privacy and instant connection speed.
- WPA2 Access Point Security: Secure your configuration portal with a custom WPA2 password (minimum 8 characters) to prevent unauthorized users from unlocking your BMS.
- Circuit Digest Branding & Modern UI: Built with a responsive, light corporate UI matching
bms_analyzerand featuring the official Circuit Digest logo. - Hardware BOOT Button Controls: Use the onboard
BOOTbutton without extra wiring:- Short press (< 2s): Toggle temporary release / re-lock.
- Long press (> 5s): Trigger a full factory reset (indicated by rapid LED strobing).
- Multi-Brand Compatibility: Select JBD (Xiaoxiang), Daly, or JK BMS in the UI.
- Auto-Reconnection: Automatically detects BLE link drops and re-establishes the lock immediately.
- Visual Status LED: On-board LED indicates system state (Configuring, Locked, or Temporarily Released).
- Microcontroller: Seeed Studio XIAO ESP32-S3 or Seeed Studio XIAO ESP32-C3 (recommended for their compact form factor) or any standard ESP32 development board.
- Power Supply: A 5V DC micro-USB / Type-C cable or a 5V Buck Converter connected directly to your battery bank.
The firmware auto-detects board pinouts at compile time:
| Board Type | Boot Button Pin | Onboard LED Pin | Active LOW LED |
|---|---|---|---|
| XIAO ESP32-S3 | GPIO 0 (BOOT) |
GPIO 21 (D10) |
Yes (Low = ON) |
| XIAO ESP32-C3 | GPIO 9 (D9) |
GPIO 8 (D8) |
Yes (Low = ON) |
| Generic ESP32 | GPIO 0 |
GPIO 2 |
No (High = ON) |
- Install ESP32 Board Manager:
- In Arduino IDE, open File > Preferences.
- Add this URL to Additional Boards Manager URLs:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json - Go to Tools > Board > Boards Manager, search for
esp32and install the package.
- Select Board:
- Select
XIAO_ESP32S3,XIAO_ESP32C3, orESP32 Dev Moduleunder Tools > Board > ESP32.
- Select
- Upload:
- Open BMS_Protector.ino in Arduino IDE.
- Connect your board and select the correct serial Port.
- Click Upload (Ctrl + U).
- Upon initial boot, the ESP32 starts an open Wi-Fi Access Point called
BMS-Shield-Setup. - Connect your phone or laptop to
BMS-Shield-Setup. - Open your browser and navigate to
http://192.168.4.1(or let the captive portal load). - Select your BMS brand (JBD, Daly, or JK).
- (Optional but recommended) Enter an Access Point Password (minimum 8 characters) to secure the AP.
- Click Scan for BLE Devices, select your BMS, and click Select / Save.
- The ESP32 saves the settings and reboots.
- On boot, the LED blinks slowly while connecting to your BMS.
- Once connected, the LED stays Solid ON. The protector is now holding the BLE link layer connection.
- Your BMS will now be hidden or refuse connections from unauthorized devices trying to scan or control it.
When you need to connect your official BMS app or PC analyzer:
- Via BOOT Button: Short press (< 2s) the onboard
BOOTbutton. - Via Wi-Fi: Connect to
BMS-Shield-XXXX(enter your WPA2 password if set), go tohttp://192.168.4.1, and click Release Lock. - Result: The ESP32 disconnects from BLE, and the LED blinks rapidly. You have 5 minutes (or your configured duration) to connect with your normal app.
- Re-locking: The protector automatically re-locks the BMS once the timer expires. You can also click Re-Lock Now in the Web UI or short-press the
BOOTbutton to re-lock instantly.
If you want to clear saved configurations or connect to a new BMS:
- Press and hold the
BOOTbutton for 5+ seconds until the status LED begins rapidly strobing/flickering, then release. - The ESP32 will clear all saved preferences and restart into
BMS-Shield-Setupmode.