1 Introduction

The Libre Solar BMS C1 is a flexible Open Source Battery Management System (BMS) suitable for various applications.

This manual describes the usage and most important functions of the BMS. Please visit learn.libre.solar for general information about battery management systems, charge controllers and other devices for DC energy systems.

Read this manual carefully and make sure you understand everything before starting with installation of the BMS.

Same as the hardware and firmware of the BMS, also this manual is Open Source. If you find any errors or have suggestions for improvement, please contribute to the repository on GitHub.

1.1 Project background

The main target of the project behind this BMS is to provide a solid technical basis for custom developments of organizations working in the energy access sector.

The project is funded by the EnAccess Foundation.

The development is driven by the Libre Solar and EnAccess Communities. Visit the following websites for most recent updates:

Hardware and firmware source files are published on GitHub:

1.2 Disclaimer

This user manual has been written and checked with care and to the best of our knowledge.

Libre Solar assumes no liability for the accuracy, completeness or quality of the information provided. Liability claims against the team for material, physical or immaterial damages caused by the use or non-use of the information provided or by the use of incorrect and/or incomplete information are excluded.

All information and instructions are non-binding. Libre Solar reserves the right to change, supplement or delete parts of the pages or the entire document without prior notice.

1.3 License

This user manual document is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License.

The full license text is available at https://creativecommons.org/licenses/by-sa/4.0/.

2 Safety Instructions

  • The BMS shall only be used for the intended application.

  • The maximum voltage and current of the connected batteries or loads must not exceed the limits of the BMS.

  • Ensure that the BMS is configured correctly for the used battery type.

  • Install the device considering general best practices for electrical and mechanical installations in accordance to laws in your country.

  • An additional fuse must be installed as close to the battery positive terminal as possible.

  • As sparks can occur during connection of the battery wires, don’t install the BMS close to any flammable materials.

  • The wire cross-section has to be large enough to handle at least the maximum specified current of the BMS.

  • Use insulated tools only.

  • Fix the wires outside the BMS to provide a strain relief and reduce forces on the terminals.

  • Mount the device on a solid, non-inflammable material only. Depending on the ambient conditions and the average current, a heat sink may be required.

3 Features

3.1 System overview

The BMS is the heart of every Li-ion battery. It is needed to equalize series connected cells and protect the battery from current, voltages and temperatures outside the allowed operating range.

Below figure shows a complete battery system with the integrated BMS.

Overview of the BMS integrated into a Li-ion battery pack.

This BMS has the following high-level features:

  • Flexible and fully Open Source design
  • Suitable for 12V, 24V or 48V systems (up to 16 LFP cells in series)
  • Continuous currents of up to 100A

With above specifications it is suitable for the following applications:

  • Poductive use appliances like milling machines
  • Energy storage for AC mini-grid applications with up to 4 kVA inverters
  • Second-life batteries built e.g. from recycled EV batteries
  • Generic off-grid energy storage e.g. in caravans

3.2 Hardware

BMS Overview

3.2.1 Board design

All electronics components (power and control) are integrated into a single PCB in order to reduce cost and size.

The board contains the following main subsystems:

  • Power part (top left)
    • High current terminals
    • MOSFETs (4 in parallel, 2 in series for bi-directional switching)
    • Current measurement shunt
  • Control part (bottom right)
    • Microcontroller: ESP32-C3
    • BMS ASIC: Texas Instruments BQ76952
    • Internal power supply
    • Communication interfaces (CAN, UART, I2C, USB, Bluetooth)

3.2.2 MCU: ESP32-C3

The Espressif ESP32-C3 is a single-core microcontroller featuring Wi-Fi, Bluetooth 5 (LE) and CAN (called TWAI by Espressif). It is based on the open-source RISC-V architecture.

3.2.3 BMS IC: BQ76952

The Texas Instruments BQ76952 was selected as the BMS IC as it offers a good compromise between accuracy, features and cost.

Features according to Datasheet:

  • Battery monitoring capability for 3-series to 16-series cells
  • Integrated charge pump for high-side NFET protection with optional autonomous recovery
  • Extensive protection suite including voltage, temperature, current, and internal diagnostics
  • Two independent ADCs
  • Support for simultaneous current and voltage sampling
  • High-accuracy coulomb counter with input offset error < 1 uV (typical)
  • High accuracy cell voltage measurement < 10 mV (typical)
  • Wide-range current applications (±200-mV measurement range across sense resistor)
  • Integrated secondary chemical fuse drive protection
  • Autonomous or host-controlled cell balancing
  • Multiple power modes (typical battery pack operating range conditions)
  • NORMAL mode: 286 uA
  • Multiple SLEEP mode options: 24 uA to 41 uA
  • Multiple DEEPSLEEP mode options: 9 uA to 10 uA
  • SHUTDOWN mode: 1 uA
  • High-voltage tolerance of 85 V on cell connect and select additional pins
  • Tolerant of random cell attach sequence on production line
  • Support for temperature sensing using internal sensor and up to nine external thermistors
  • Integrated one-time-programmable (OTP) memory programmable by customers on production line
  • Communication options include 400-kHz I2C, SPI, and HDQ one-wire interface
  • Dual-programmable LDOs for external system usage
  • 48-pin TQFP package (PFB)

3.2.4 Balancing

The BMS features passive balancing with up to 100 mA.

3.2.5 Protective switches

The positive battery terminal can be disconnected by the BMS for safety reasons or upon demand of the user via a communicatoin interface.

The disconnect switches are N-channel MOSFETs in a back-to-back configuration to be able to interrupt current in both directions (see also BQ76952 datasheet). In order to allow the high currents, 4 MOSFETs are connected in parallel.

The bottom side of the PCB can be attached to a heat sink to dissipate the heat at high continuous currents.

The cell connector has a pin to trigger a fuse at the pack positive terminal as a secondary protection if the MOSFETs fail short.

3.2.6 Current measurement

The current is measured using a shunt, located in the negative voltage path of the battery pack. The shunt voltage is amplified by the BQ76952 ASIC and read by the MCU.

Time-critical safety features like overcurrent and short circuit protection are implemented directly in the ASIC and can be calibrated via firmware.

3.2.7 Cell and thermistor connectors

The cells and thermistors are connected to the BMS using Molex Micro-Fit or Würth WR-MPC3 series connectors.

Both series are pin-compatible and there are even more compatible connectors in the market for this popular series. The connectors can handle up to 5A, which is sufficient even for active balancing.

3.2.8 Power connectors

The BMS is designed for up to 100A continuous current, depending on ambient temperatures, heat sink and actually fitted MOSFETs.

Würth high-power solder terminals with M5 threads are used for wire-to-board connections.

3.3 Communication interfaces

One major advantage of an Open Source design is its extensibility and adaptation to specific requirements.

In order to provide the hardware interfaces required to add custom extensions, two options are offered. Communication between multiple BMSs or other devices like charge controllers can be achieved via CAN bus, while the addional interfaces like I2C and UART can be used for extension of the board with internal features like displays.

The MCU features built-in WiFi and Bluetooth communication.

The serial and Bluetooth communication interfaces use the ThingSet protocol by default, which allows to read measurement values from the BMS as well as store custom configuration.

3.4 Firmware

The firmware is based on Zephyr RTOS and thus allows for easy integration of additional communication features. The latest Zephyr long-term support release is in the process of being certified for functional safety according to IEC 61508.

Amongst all features inherited from underlying Zephyr, the BMS firmware has the additional BMS-specific features:

  • Monitoring and configuration using the ThingSet protocol (mapping to MQTT, CoAP and HTTP possible)
    • Serial interface
    • CAN bus
    • I2C
    • Bluetooth
    • WiFi
  • SOC estimation based on coulomb counting
  • Configuration options
    • Pack layout
      • Cell chemistry (LiFePO4, NMC, NCA)
      • Nominal capacity
      • Number of cells
      • Thermistor type
      • Shunt resistor
      • Custom open circuit voltage (OCV) look-up table
    • Protection
      • Discharge short circuit limit (A)
      • Discharge short circuit delay (us)
      • Discharge over-current limit (A)
      • Discharge over-current delay (ms)
      • Charge over-current limit (A)
      • Charge over-current delay (ms)
      • Cell target charge voltage (V)
      • Cell discharge voltage limit (V)
      • Cell over-voltage limit (V)
      • Cell over-voltage error reset threshold (V)
      • Cell over-voltage delay (ms)
      • Cell under-voltage limit (V)
      • Cell under-voltage error reset threshold (V)
      • Cell under-voltage delay (ms)
      • Discharge over-temperature (DOT) limit (°C)
      • Discharge under-temperature (DUT) limit (°C)
      • Charge over-temperature (COT) limit (°C)
      • Charge under-temperature (CUT) limit (°C)
      • Temperature limit hysteresis (°C)
    • Balancing
      • Enable automatic balancing.
      • Balancing cell voltage target difference (V)
      • Minimum cell voltage to start balancing (V)
      • Current threshold to be considered idle (A)
      • Minimum idle duration before balancing (s)

4 Installation

Attention: The maximum operating voltage of the BMS is 60V. The 16s configuration is only feasible for LFP cells. For NMC cells, a maximum number of 14 cells may be used.

4.1 Mechanical Design

The board dimensions are 70x135 mm² so that it can be easily integrated into existing housings with typical 18650 or 2170 cells.

BMS mounted on a heat sink

Depending on the current requirements and ambient temperatures, a heat sink may be required. For good thermal contact, a thermal interface material (e.g. Henkel/Bergquist GAP PAD A2000) is required, as shown in above picture.

4.2 Connections

Below picture shows the connections of the cells, the 10k thermistors (NTC1 and NTC2) and the high power cables.

BMS connections

The BMS is powered through the BAT+ terminal. If only the cell connector is mounted, the power is provided through the additional BAT+ wire in the cell connector, which has to be connected to the last cell’s positive terminal.

The BMS cannot be powered through the USB port only.

4.2.1 Power connections

The high power terminals have an M5 thread and allow to fit wires of up to 35 mm² cross-section.

The nuts and washers should be made from stainless steel to avoid corrosion with copper cable lugs.

The wires must be properly fixed in the housing to reduce stress on the soldered terminals on the PCB.

The fixing torque for the nuts is 2.2 Nm. Use of a torque wrench is highly recommended.

4.2.2 Signal connections

The MPC3 / Microfit connector must be equipped with properly crimped wires connected to the cells and the thermistors. Würth sells pre-crimped wires so that no crimping tool is needed (the low-force type is recommended). These wires can be cut in half and connected to an own wiring harness.

If less than 16 cells are used, the unused cell connections have to be short-circuited (either on the PCB using the pads left of the balancing resistors or in the wiring harness). See also the BQ76952 documentation for further details.

At least NTC1 has to be connected and show a valid temperature range for the BMS to allow charging/discharging.

4.2.3 Connection order

  1. Connect the fully wired cell connector. (Note the two separate connections to the first cell’s negative terminal)
  2. Connect the BAT- terminal.
  3. Connect the BAT+ terminal (with a fuse in line, as shown).
  4. Connect load or charger.

4.3 Communication ports

The CAN, UART and I2C communication ports use JST PH connectors. The pinout is marked on the PCB.

The I2C is shared with the BQ76952. It must be ensured that this communication is not disturbed by another component on the I2C bus.

5 Operation

5.1 Firmware flashing

If no firmware is flashed on the board, make sure the board is powered through the cell connector. The power wires BAT+ and BAT- are optional.

The firmware is flashed through the USB port. Follow the instructions in the Firmware repository.

5.2 Start-up

In order to wake up the BMS chip, short-press the ON/OFF button S1 (top-right corner).

If the button is long-pressed for at least 3 seconds, the BMS will go into low-power shutdown mode.

A custom push-button as part of the battery housing can be connected to the connector J5 next to the button.

5.3 LED indications

The BMS is equipped with two status LEDs with below indications:

Red LED:

Status Meaning
off Discharging finished and battery is empty
on Discharging allowed (current below idle threshold)
blinking slowly Discharging active (current above idle threshold)
flashing quickly Discharging error (UV/OT/UT/OC/SC)

Green LED:

Status Meaning
off Charging finished and battery is full
on Charging allowed (current below idle threshold)
blinking slowly Charging active (current above idle threshold)
flashing quickly Charging error (OV/OT/UT/OC)

5.4 Communication Setup

Device information, configuration values and measurements can be explored using the ThingSet protocol. This protocol is used for the serial interface as well as the Bluetooth communication.

For details regarding the protocol consider the specification linked above. The basic setup is explained below.

5.4.1 USB Serial

The USB virtual COM port exposes log data and the Zephyr shell. Among other commands, the shell can also be used for communication using the ThingSet protocool.

A terminal program like picocom is recommended:

picocom /dev/ttyACM0

The shell command for the ThingSet protocol is thingset. Either prefix it for every command or select thingset to switch into ThingSet mode.

select thingset
?Meas
:85 {"rPackVoltage_V":13.71,"rStackVoltage_V":13.91,"rPackCurrent_A":0.05,"rBatTemp_degC":29.4,"rICTemp_degC":34.2,"rMOSFETTemp_degC":31.8,"rSOC_pct":100.0,"rErrorFlags":0,"rBmsState":3,"rCellVoltages_V":[3.495,3.497,3.486,3.495,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000],"rCellAvgVoltage_V":3.493,"rCellMinVoltage_V":3.486,"rCellMaxVoltage_V":3.497,"rBalancingStatus":0}

When using the shell, the quotation marks in JSON data have to be escaped. See below for an example:

=Conf {\"sCellOvervoltage_V\": 3.8}
:84

5.4.2 UART Serial

The serial interface uses a baud-rate of 115200 bps. Depending on the operating system, you can use different tools to communicate with the serial interface manually.

For Linux CuteCom is recommended, as it stores a history of previous commands.

The Serial2Websocket Python script can be used as a basis for own scripts to use the monitoring data.

5.4.3 BLE

The generic ThingSet app can be used to connect to the BMS via Bluetooth LE.

For own developments see the BLE transport layer specification on the ThingSet website and consider the implementation of the device side in the ThingSet Zephyr SDK.

5.5 Configuration

The ThingSet protocol itself allows to discover available data items for configuration, so this manual will only use some examples for demonstration purposes.

5.5.1 Read measurements and battery status

Use the following command to get the current state of the battery, including all current, temperature and voltage measurements:

?Meas

5.5.2 Configure battery type

The configuration for a particular cell type and battery size can be preset with suitable default values using the two executable data items xPresetNMC for NMC cells and xPresetLFP for LFP cells. The functions expect a parameter defining the nominal capacity of the battery in Ah.

For an LFP battery with 45 Ah, send the following command to the BMS:

!Conf/xPresetLFP [45]

The expected response if the parameters were successfully set:

:84 0

5.5.3 Adjust thresholds

The current configuration can be determined with the following command:

?Conf

Individual parameters can be adjusted with a command as shown below (using the overvoltage threshold as an example):

=Conf {"sCellOvervoltage_V": 3.8}

6 Datasheet

Feature Value Comment
Battery
Nominal voltage range 12 V to 48 V
Maximum voltage 70 V
Maximum current 70 A - 100 A heat Depending on ambient conditions and sink
Self consumption < 20 mA Exact value t.b.d.
Shutdown current < 1 mA Exact value t.b.d.
Cell types LFP, NMC and others Customizable through firmware
Interfaces
CAN 2.0
RS-485 (connector shared with CAN)
USB CDC-ACM
UART serial
I2C
Bluetooth
Protection
Over-/undervoltage
Overcurrent / Short circuit
Over-/undertemperature
Environmental conditions
Operating ambient temperature -10 °C to +50 °C
Storage temperature -20 °C to +60 °C
Humidity <95%, non-condensing
Mechanical design
Screw terminals M5, torque: 2.2 Nm
Weight t.b.d.
Dimensions 70 mm x 135 mm