This paper presents a multi-channel lithium battery charge and discharge testing system, which is based on the STM32F429 microcontroller as the central control unit. The system includes dual-range current sensing, charge and discharge control, dual-temperature detection, and voltage monitoring circuits, enabling comprehensive testing and protection for series-connected power lithium battery packs. During the test, the host computer program can monitor the charging and discharging process of multiple lithium battery packs in real time, while displaying the collected data for analysis and processing.
**1. System Hardware Design**
The system employs the high-performance, low-cost, and energy-efficient STM32F429 from STMicroelectronics as its core controller. It communicates with the current, temperature, and voltage detection modules via SPI and SMBus interfaces. The opening and closing of the charge and discharge circuit are controlled through general-purpose IO pins, allowing the system to implement protective functions. Collected data is sent to the host computer through a serial port connected to a USB module, enabling real-time monitoring and data analysis. The system features 8 independent monitoring channels, each capable of monitoring 1 to 8 lithium batteries. Additionally, channels can be combined—such as channels 1 & 2, 3 & 4, 5 & 6, and 7 & 8—to monitor up to 9 to 16 series-connected lithium battery packs. A system structure diagram is shown in Figure 1.

The hardware design of the system encompasses the lithium battery voltage detection module, temperature detection module, current detection module, and charge/discharge protection function module.
**1.1 Current Detection and Charge/Discharge Control Hardware Design**
Current is a critical parameter during the charging and discharging of lithium battery packs, as it directly indicates whether overcurrent has occurred. It also plays a key role in estimating total charge and discharge using integration methods. Therefore, the accuracy of current detection significantly impacts the reliability of charge and discharge estimation and subsequent data analysis. Due to the varying capacities, models, and performance characteristics of lithium battery packs used in portable power tools, the current sensing module must be versatile. To address this, the system uses a dual-range current detection design, ensuring accurate measurement at both low and high current levels and enhancing the system’s ability to detect current magnitude.
Considering the advantages of closed-loop Hall current sensors—such as a wide dynamic range, high accuracy, fast response, and isolation—the system utilizes a closed-loop Hall sensor model MMI-200B in each channel for current collection. The primary charging and discharging current Ip passes through the sensor's hole, and the relationship between the secondary output current Iout and the primary current Ip is given by:
n × Ia = K × Iout. (1)
In this formula, K is the proportional coefficient, which depends on the sensor model. For the MMI-200B, K = 1000, and n, the number of turns in the primary coil, is set to 2 in the system.
To measure the magnitude of the charge and discharge current Ip, the voltage across the sampling resistor is measured. To ensure accuracy under both high and low current conditions, the system controls the switching state of the relay G6K-2P via the high or low level of the STM32’s IO pin, selecting different sampling resistors. The ADS1247, a high-precision 24-bit ADC chip with two differential inputs, then performs the analog-to-digital conversion. Finally, the main control chip reads the converted values from each current detection module via the SPI bus and calculates the charge and discharge current for each channel.

Fixtures For Mining,Tungsten Based Alloys,High Tungsten Steel,High Density Tungsten Powder
Shaanxi Xinlong Metal Electro-mechanical Co., Ltd. , https://www.cnxlalloys.com