Written by Martin Jäger, Lead Developer & Founder | Libre Solar

Flexible Battery Management System (BMS) for off-grid energy storage

Executive Summary

Energy storage is key to any off-grid energy application.

 

Today’s lead-acid batteries should and will be replaced more and more by Li-ion based technologies.

 

Fresh lithium-iron-phosphate cells can last more than 10 years, eliminating the need for frequent battery replacement. Second-life applications that reuse battery cells or modules from electric vehicles are also becoming more relevant to the energy access sector.

 

All of these batteries require an adaptable battery management system (BMS). However, developing a BMS that is safe, cheap, and reliable requires a lot of experience and can be a big burden for small companies in the energy access sector. The EnAccess Foundation provided funding for Libre Solar to develop a full-featured open source BMS in close collaboration with the community.

 

Libre Solar Project

The BMS was developed as part of the Libre Solar project, which has a 5-year history of providing open source hardware for renewable energy systems. The hardware is modular and uses standardized, open communication protocols, so it can be integrated into existing systems or used as the basis for your own product development.

 

Open Source Approach

 

Open Source eliminates the need to reinvent the wheel and accelerates product development. This is especially important for renewable energy to accelerate the transition away from fossil fuels. When developing an open source product, it is preferable to use open source tools. That’s why the electronics of the BMS are designed with KiCad, the housing parts with FreeCAD and the firmware is based on the Zephyr RTOS.

 

Another important aspect of making an open source design accessible to everyone is good documentation. To this end, manuals and other documentation are automatically generated from Markdown files that are checked into repositories on GitHub. The documentation is also released under an open source license.

 

The entire development process itself, from specification to implementation, was done publicly on GitHub, so that other people from the open source software and hardware community could participate and provide feedback. All design files and software are released in the native format of the tools used. In addition, the native files are exported to more readable formats such as PDF or PNG. The hardware is licensed under CERN-OHL-W and the firmware is licensed under Apache 2.0.

 

Hardware and Firmware

The BMS hardware is suitable for 12V, 24V or 48V systems (up to 16 LFP cells in series) with a continuous current of up to 100A. This makes it well suited for productive applications such as milling machines as well as energy storage systems for AC mini grids.

The picture below gives an overview of the BMS PCBA.

BMS

The high power connections use screw terminals for large cross section cables to carry the required current. The cells and thermistors are connected to the side with a single 24-pin type connector. The cell connections are used for balancing and monitoring the voltage of each cell.

 

At the bottom of the board, there are several different options for wired and wireless communication. The I2C bus is used internally to communicate with the bq76952 BMS IC. It can be used for custom displays or LEDs (via an I/O expander) in the battery pack. The USART interface is suitable for GSM modules, which usually implement serial protocols based on AT commands. The ESP32-C3 microcontroller provides WiFi and Bluetooth connectivity out of the box. Custom protocols to interface with mobile phones or cloud services can be easily implemented using the APIs provided by the Zephyr RTOS. The USB port is used only for flashing new firmware and for serial communication during development.

 

Since all parameters of the BMS are fully configurable, it can be used for virtually any cell type on the market. This is also useful for so-called second-life applications, where old batteries, e.g. from electric vehicles, are reused for stationary applications. Charge rates in stationary applications are much lower than in vehicles, so the increased internal resistance of aged cells is not as important.

 

For second-life applications, cells should be sorted by remaining capacity so that only similar cells are assembled into a battery pack. Due to cost constraints, this BMS has a passive balancing system that has limited ability to deal with inhomogeneous capacity distribution. If active balancing is required in the application, it could be added as an external module connected in parallel to the cells and controlled by the main BMS microcontroller using one of the interfaces such as I2C or UART.

Data and Communication

Monitoring and analyzing data is a key feature for any modern energy system to optimize its operation and improve usability. The BMS firmware comes with built-in Bluetooth communication, which can be used to configure thresholds and adapt the BMS to different battery types. An open source cross-platform mobile phone app was developed by Libre Solar and published under the ThingSet organization on GitHub.

 

 

A CAN interface is provided for communication with other batteries, a higher level energy management system, or a solar charge controller. Zephyr provides industry standard application layer protocols such as CANopen or ISO-TP, which can be customized to suit your application. By default, the serial, CAN and Bluetooth interfaces use the ThingSet protocol. This protocol exposes data in human-readable JSON format, which can be easily integrated with any type of local tools or cloud services for further data processing.

Field Testing

In order to gain a lot of testing experience and get feedback from different users, EnAccess and Libre Solar decided to run a BMS challenge where potential early adopters could apply to get two boards for free and use them for testing. The challenge was very competitive and 5 different companies were selected to participate in the field test. 

 

The data gathered during the test was sent to the Libre Solar cloud platform based on Grafana, an open source monitoring solution. This allowed participants to monitor all parameters live during the test. In addition, this approach allowed Libre Solar to collect valuable data and gain further insight into typical usage profiles in different applications.

 

The test is still ongoing (as of March 2023) and we will continue to collect feedback from the early adopters.

Lessons Learned

The BMS went through three design iterations. In the first prototype, the board was divided into two parts:  A power part (MOSFETs and shunt) and a control part (MCU, BMS IC and communication). While this approach allows for very thick copper on the power part since there are no constraints due to the small pin pitch of some components, it turned out that having two separate PCBs increased the cost significantly. So the final design uses a single PCB for all components.

 

We tried to involve the open source and energy access community as early as possible in the development process. This turned out to be very valuable as we got early feedback on design suggestions on GitHub. It also allowed us to refine some of the requirements so that the final design would meet the expectations of as many applications as possible.

Results

This project has been a great experience and the collaboration between Libre Solar and EnAccess has gone very well. We hope that the BMS design and accompanying materials will help other organizations in the energy access sector with their own battery development and provide a useful additional step towards a global 100% renewable energy supply.

 

To get started with the BMS, please watch the webinar that walks you through the BMS and its documentation.

 

Below please find a list of links to the results created in the project: