Design of multi-cell lithium battery management system based on STM32

Publisher:EternalBlissLatest update time:2013-03-17 Source: 21ICKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

Battery energy saving and pollution are becoming increasingly concerned issues. In the field of traditional batteries, lead-acid batteries and nickel-metal hydride batteries have a series of problems in actual use: such as small specific capacity, unsuitable for fast charging and high current power generation, or more management problems when nickel-metal hydride batteries are connected in series. On the contrary, lithium batteries not only have better specific capacity than lead-acid batteries and nickel-metal hydride batteries, but also have the advantages of no memory effect, long service life and high voltage per cell.

In mining products, lithium batteries have gradually replaced lead-acid batteries and nickel-metal hydride batteries. However, there is also an important problem when using lithium batteries. The battery may explode when it is overcharged or over-discharged, so a good protection circuit is needed to prevent the problem of battery explosion. This article studies the use of STM32f103 microcontroller and LTC6802-1 chip to manage and protect lithium battery packs. This can not only give full play to the advantages of lithium batteries, but also eliminate some problems caused by the use of lithium batteries.

LTC6802 Introduction

Among many battery management chips, LTC6802 has outstanding performance. Its unique internal design enables it to detect up to 12 battery voltages at the same time, and its simple external circuit configuration enables us to easily build the system, which helps reduce costs and development time.

The LTC6802 has a high-precision analog-to-digital converter with up to 12 bits. A single LTC6802 can simultaneously detect the voltage of 12 series-connected single cells, and can also measure the total voltage of the battery pack. In the battery management system, we can combine multiple LTC6802 chips into a chain circuit to facilitate us to monitor battery packs with more than 12 cells or greater than 60V. This stackable architecture makes it possible for us to measure or manage 1000V battery systems. The temperature of the lithium battery pack can be monitored in real time using multiple channels such as its dual thermistor input and on-board temperature sensor.

The communication between LTC6802 and microprocessor is realized by a compatible serial interface. In the chain circuit, each LTC6802 can realize data communication through simple diode isolation. Its SPI timing diagram is shown in Figure 1.

 
Figure 1 SPI communication timing

The LTC6802 has multiple operating modes, such as standby mode, measurement mode, and monitoring mode; each mode has its own unique operating state:

Standby mode: When the system is powered on, the LTC6802 is in standby mode by default. At this time, except for the serial port and regulator circuit, all other circuits are in the off state. At this time, the LTC6802 current is at the minimum state.

Measurement mode: By setting the register CDC bit through a command, the LTC6802 can be placed in measurement mode. At this time, the voltage of the single cell is monitored normally, and the register can be used to determine whether it is overvoltage or undervoltage.

Monitoring mode: LTC6802 only monitors single cells in overvoltage or undervoltage state, and the serial communication circuit is in the off state;

It is widely used in electric and hybrid vehicles, high-power portable devices, backup power supplies, and high-voltage data acquisition systems. This article mainly applies it to backup power supplies and achieves good results.

Hardware system design

In Figure 2, the LTC6802 chain circuit can measure the values ​​of multiple (12 or more) lithium battery cells. Through these voltage or temperature values, it can be determined whether the battery is overcharged, over-discharged or over-temperature. The STM32F103 main control chip reads the required values ​​from the LTC6802 through its own SPI bus module, and uses the charge and discharge control unit to protect the lithium battery pack, which can also be displayed on the LCD human-machine interface.

 

Figure 2 Hardware system block diagram

STM32F103 control unit

This MCU is an ARM chip designed based on the Cortex-M3 core, with internal integrated SPI bus module, USB module, 16-channel ADC sampling and other peripherals. Its clock frequency can reach up to 72MHz, which can meet the needs of most occasions. Built-in 512KB high-speed memory and 64KB SRAM, rich enhanced I/O ports and peripherals connected to the APB bus make STM32F103 a very excellent MCU.

These rich peripheral resources make the STM32F103 series MCU suitable for a variety of occasions:

① Motor drive and application control;

②Medical and handheld devices;

③PC peripherals and GPS platform;

④Industrial applications: programmable controllers, frequency converters, printers and scanners;

⑤Alarm system, video system, backup battery system, etc.

In this system, the STM32F103 microcontroller is mainly used in the battery management system, that is, the backup power supply. The STM32F103 uses its own SPI peripheral to set the LTC6802 working mode, reads the battery cell voltage value and cell temperature value through the LTC6802, and sets the battery overvoltage, undervoltage and overtemperature alarm flags, and uses these values ​​to manage the battery charge and discharge, so as to protect the battery.

In the hardware system block diagram, we can see that the system modules include: single-chip minimum system, LTC6802 chain circuit, battery balancing circuit, battery temperature measurement unit circuit, communication circuit, etc.

In this circuit, the STM32F103 microcontroller is mainly responsible for reading and writing LTC6802 information, controlling the balancing circuit, that is, the charge and discharge control unit, and can also detect the battery temperature and display these useful information on the human-machine interface. The circuit is shown in Figure 3.

Figure 3 STM32F103 control circuit

LTC6802 Chain Circuit

The LTC6802 chain circuit plays an important role in multi-battery information detection. We know that one LTC6802 chip can only manage 12 individual batteries, which is generally about 36V. In some cases, the battery voltage may be much greater than 36V. At this time, we can use the LTC6802 chain circuit to meet this requirement, as shown in Figure 4.

In Figure 4, SPI TOP and SPI BOTTOM connect the top LTC6802 and the bottom LTC6802. This can form a multi-stage LTC6802 chain circuit.

Figure 4 LTC6802 chain circuit

Control equalization circuit

The balancing circuit plays a vital role in the battery management process. Everything we do is to facilitate the management of the battery voltage and power balance. The role of the balancing circuit is to maintain the balance of the battery voltage, thus protecting the battery. The circuit is shown in Figure 5, where only part of the balancing circuit is shown.

Figure 5 Equalization circuit

Battery temperature measurement unit circuit

Each chip has its own operating temperature range. The temperature range of LTC6802 is <85℃. When its internal temperature exceeds 105℃, the sampling performance of LTC6802 will be reduced. What is more serious is that if its temperature reaches 150℃, the LTC6802 chip is very likely to be burned. Therefore, in order to protect the LTC6802 chip, a temperature detection circuit must be used, as shown in Figure 6.

Figure 6 Battery temperature measurement unit circuit

Here VTEMP2 is connected to NTC, and we can get the actual temperature value through NTC.

Communication circuit

The communication circuit between STM32F103 and LTC6802 is relatively simple, mainly SPI communication, as shown in Figure 7.

Figure 7 Communication circuit

Software Design

This battery management system adopts a modular programming method and uses high-level language programming. The main flow chart is shown in Figure 8.

Figure 8 shows the software programming of a single LTC6802 for data processing. The LTC6802 chip can be connected into a chain circuit. At this time, the STM32F103 sends read and write instructions to each level of LTC6802 from high to low. When writing instructions, data is transmitted from high to low, and the opposite is true for reading data.

LTC6802 has multiple instruction registers, such as voltage register, temperature register, flag register, and command register. Each register has its own special function. For example, by configuring the voltage register, we can set the overvoltage size, undervoltage size, etc.; by configuring the command register, we can set the number of battery measurements, etc. Table 1 lists the command registers.

Table 1 Command register

Figure 8 Program flow chart

Figure 9 LTC6802 management effect

The system uses a single-chip microcomputer as the main controller, and uses its own SPI peripheral to exchange data with the LTC6802. Here is a partial program list as follows:

void Ltc6802_Init(void)

{

GPIO_Configuration();

SPI_Configuration();

Ltc6802_Write();

}

Test Results

We can use special software to check the management effect of LTC6802. From Figure 9, we can see that there are 12 batteries in the battery pack, which means that only one LTC6802 chip is used here to manage the battery. The cell voltages CELL1 to CELL12 are all around 1.89V. From this software, we can also see the sampled temperature voltage: such as 2.487V. Of course, we need to convert it into temperature value manually. Another important thing is that this software can be used to set the over-voltage and under-voltage values ​​of the cells in the battery pack.

Through this software, we can monitor the operating status of the lithium battery pack in real time and accurately determine whether any single cell is in an overvoltage or undervoltage state.

in conclusion

This article introduces the joint use of STM32F103 microcontroller and LTC6802 in detail, and gives a lithium battery management method. LTC6802 is a very excellent battery management chip. During the battery management process, it can accurately obtain the voltage and temperature of the battery cell of the battery pack, effectively balance the battery voltage, and realize the dynamic protection of the lithium battery pack. It can measure and monitor the voltage of the battery cell of a long string of lithium battery packs, and can also achieve the purpose of battery pack voltage balance by charging and discharging the battery. It can be widely used in places such as electric vehicles and backup power supplies. Of course, in this article, the system power consumption and current detection need to be improved.

Keywords:STM32 Reference address:Design of multi-cell lithium battery management system based on STM32

Previous article:Monitoring circuit to save battery power
Next article:Design analysis of dual battery power supply solution based on bq24161+TPS2419

Recommended ReadingLatest update time:2024-11-16 15:47

Understanding the Difficulties of STM32 Interface FSMC/FMC
1. FSMC Brief           FSMC, the Flexible Static Storage Controller, is capable of interfacing with synchronous or asynchronous memories and 16-bit PC memory cards. The FSMC interface of STM32 supports memories including SRAM, NAND FLASH, NOR FLASH and PSRAM. 2. FSMC storage block The STM32F767's FMC divides
[Microcontroller]
STM32 fast read and write AT24C16 code simulation I2C
This post is only applicable to chips AT24C16 and below. The reading and writing methods of chips AT24C32 and above are different, so it is not applicable!!! If your code can read and write 24C01/02 normally, you can use it to read 24C16 directly, but it can only read 256 bytes. AT24C16 is different from AT24C01/0
[Microcontroller]
STM32 fast read and write AT24C16 code simulation I2C
STM32F4 study notes 5——The highest bit error of the data sent by the stm32 serial port
        Recently, I encountered a problem with the data transmission of the stm32 serial port when doing ModBus protocol communication based on the stm32f401 serial port. I spent a whole day looking for the problem, from the ModBus protocol format, scheduling algorithm to the serial port configuration, and finally sol
[Microcontroller]
stm32——initialize serial port 1 and serial port 2
void USART1_Initialise(u32 bound) {         //GPIO端口设置         GPIO_InitTypeDef GPIO_InitStructure;         USART_InitTypeDef USART_InitStructure;         NVIC_InitTypeDef NVIC_InitStructure;         RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA|RCC_APB2Periph_AFIO, ENABLE);         //USART1_TX   P
[Microcontroller]
IIC hardware programming of STM32 microcontroller --- query waiting mode
    IIC device is an embedded peripheral device between high speed and low speed. In fact, generally speaking, its speed is relatively slow. Usually, slow devices mean more waiting, which is a nightmare for embedded engineers who strive for perfection. The access data of low-speed devices is a waste of resources. How
[Microcontroller]
First look at I2C with STM32
1. Communication protocol.   I2C is a two-wire serial bus developed by PHILIPS and is a synchronous half-duplex bus. Data is valid When transmitting data, the SDA line must remain stable during the high level period of the clock. The high or low level state of SDA can only change when the clock signal of the SCL line
[Microcontroller]
First look at I2C with STM32
STM32 MCU Learning (9) LCD1602 Display Output Experiment
The core code is provided by kingsraywii. The author of this article integrates it, annotates it in more detail, and improves some of the code. The chip ID acquisition, string output and printf redirection output functions are added. Note: When using the Puzhong Technology Development Board for testing, you need to un
[Microcontroller]
Detailed explanation of STM32 serial port usage
1. Several knowledge points about serial ports: 1. Baud rate: In serial communication, data is transmitted bit by bit, so the transmission rate is expressed by the number of format bits transmitted per second, which is called baud rate.    The baud rate determines the speed of serial port transmission, 1 baud = 1 bps
[Microcontroller]
Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号