
ESP32-BMS Ctrl
juepi/PIO-ESP32-BMS_Ctrl
Monitor and Controller for battery setups using Daly Smart BMS with Victron VE.Direct charger and shunt

Monitor and Controller for battery setups using Daly Smart BMS with Victron VE.Direct charger and shunt
BMS Ctrl DE-9 Adaptor is an open-source printed circuit board by juepi, from the juepi/PIO-ESP32-BMS_Ctrl repository on GitHub. It is a 2-layer board of 55.9 × 34.3 mm with 7 parts on 12 nets, routed with 52 tracks and 0 vias.
It is built around the B4B-XH-A and B2B-XH-A. Its parts include 6 connectors and 1 resistor. It belongs with the power boards of this library.
This project is intended to be used as an WiFi/MQTT interface to the Daly Smart BMS Systems and Victron VE.Direct devices based on my PlatformIO ESP32 Template.
Primarily, the code reads status data from the Daly BMS, Victron VE.Direct PV charger and SmartShunt and sends it to your MQTT broker at a configurable interval. It automatically switches the load-SSR on if the batteries are fully charged (2 configurable SOC limits) and off if the batteries are drained (also configureable SOC limit). Load-SSR can also be switched manually by setting the corresponding MQTT topic to on or off. The primary source for the battery SOC is the Victron SmartShunt.
Last but not least, the firmware also allows you to handle an external active balancer through an additional SSR as recommended by Andy. However, i have added a second condition beside the 3.4V cell voltage: we're only enabling the active balancer if the voltage difference between the highest and lowest cell is above an configurable threshold (defaults to 30mV, configurable via MQTT topic t_Ctrl_Cfg_SSR2_CdiffOn).
To configure the firmware for your needs, see files user-config.h and mqtt-ota-config.h, also see PlatformIO ESP32 Template readme (WiFi setup etc.).
platformio.inito your needs)What you are looking at here is the second major release of this firmware. If you want to see how it all started or you're interested in the problems I've encountered up to this point, take a look at the final v1 release readme.
The hardware part is also finished now, see KiCad folder.
Keep in mind that you are working with potentially dangerous electricity levels depending on the hardware you use. Take any precautions necessary!
You need to do the initial battery setup on the Daly BMS using the included Bluetooth adapter and Daly's SmartBMS app, as the used library does not support setting configuration parameters. Victron devices can use the VictronConnect App in parallel to the (read only) serial output on the VE.Direct port.
An active balancer is highly recommended, as the internal passive balancer of the Daly BMS is useless. Andy from the Off-Grid Garage has picked up this topic recently, and i've decided to add the active-balancing control as he suggests it into the firmware. Note that you will need an active balancer that will allow you to start the balancing by shorting 2 pins, like this one from AliExpress. You will need to remove the solder chunk from the pads labeled "Run", this will reveal 2 seperate soldering pads. Solder 2 wires to the pads and connect them to an optocoupler output, in example AQW212EH.
Take caution when connecting the ESP to the UART ports: the internal electronics of the BMS (including UART port) use "battery ground", whereas other connected devices (i.e. load, charger) use the "power ground". NEVER EVER connect these different grounds or magic smoke will leave your electronics! To avoid this, make sure to isolate anything coming from or going into the UART ports of the Daly BMS and your VE.Direct devices. For UART RX/TX, a ADUM1201 isolator chip works well for me.
Thanks to maland16 and softwarecrash for providing a library to interact with the Daly Smart BMS.
Thanks to cterwilliger for his Victron VE.Direct frame handler, which has been integrated into this project since v1.2.0. Note that the source is in the lib directory, not from github, as i needed to include the buffer overflow patch. I have also added a frameCounter which increments when a valid frame is decoded (to ease handling of fresh data) and a function which looks up array index numbers by Name label (required for SmartShunt!).
t_Ctrl_Cfg_Offgrid_Mode in user-config.h). Plugging in the offgrid inverter is only done in case of a long lasting power outage, which has not happened yet (and hopefully never will), so i can live with that limitation. A note on failing OneWire communication: in my case the only way to recover OW-communication was to power down the ESP (remove power from the OW sensors), it seems that the controller inside the sensors hung and rebooting the ESP did not help.v2.0.2.CtrlStatTXT topic; now publishes info on every action the controller takes (like enable/disable load or balancer)Daly_dV now reports mVplatformio.ini) - doesn't work yetplatformio.iniuser_setup.h to more suitable user-config.hgetTempCByIndex() calls when no sensors are availablet_Ctrl_Alarm in user-config.h)VSS_MAX_SOC_DIFF was set too low to 0.5% instead of 5%)SSR2.CVOff (previous conditions could lead to Auto-mode rapidly toggling balancer if a single cell is above enable and another one is below disable voltage)platformio.ini)EspSoftwareSerial library versionVSS_MAX_V_DIFF defined in user-config.h)DATA_UPDATE_INTERVAL to avoid publishing wrong/incomplete data directly at firmware bootOW_MAX_TEMP_DIFF)I somehow managed to not to include the VeDirectFrameHandler library into previous commits as it was intended. This affects all versions prior v2.1.0!
If you want to build an older release, you can easily fix this by adding my fork of VeDirectFrameHandler into the library section of platformio.ini:
lib_deps =
https://github.com/juepi/VeDirectFrameHandler
...Have fun,
Juergen
| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | B4B-XH-A | Connector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical | J1, J2, J3 |
| 1 | 4k7 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1 |
| 1 | B2B-XH-A | Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical | J4 |
| 1 | Conn_02x05_Counter_Clockwise | Connector_PinHeader_2.54mm:PinHeader_2x05_P2.54mm_Vertical | J5 |
| 1 | DE9 Plug | Connector_Dsub:DSUB-9_Male_Horizontal_P2.77x2.84mm_EdgePinOffset9.90mm_Housed_MountingHolesOffset11.32mm | J6 |

juepi/PIO-ESP32-BMS_Ctrl
Monitor and Controller for battery setups using Daly Smart BMS with Victron VE.Direct charger and shunt

CNES/argos-demo-board
Demo board designed to use the ARRIBADA SMD module via USB to send ARGOS messages to the Kineis constellation.

0xEBD/fumeXsense
The idea behind fumeXsense is simple: understand what the Weller WX2 is doing via its serial interface and use that information to control the existing fume extractor automatically.

themarcolab/Stardrive-Shield
With STARDRIVE SHIELD you can implement from 6 step to FOC motor control algorithms.


RSXLX/sunny-the-growing-sunflower-lamp
SUNNY — The Growing Sunflower Lamp | A personal lamp with customizable exteriors, traceable fabrication, and a local creative workspace.


01binary/str1ker
A human-scale mech integrated with Robot Operating System

It measures 55.9 × 34.3 mm and has 2 copper layers, 1.6 mm thick.
7 parts, built around the B4B-XH-A and B2B-XH-A. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the juepi/PIO-ESP32-BMS_Ctrl repository on GitHub, at the commit this page was made from: the board is KiCad/BMS_Ctrl_DE-9_Adaptor/BMS_Ctrl_DE-9_Adaptor.kicad_pcb and its schematic KiCad/BMS_Ctrl_DE-9_Adaptor/BMS_Ctrl_DE-9_Adaptor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask juepi before reusing the design.