Application of BQ2013H in lead-acid battery power monitoring

Publisher:qq8174350Latest update time:2011-11-05 Source: 互联网Keywords:BQ2013H Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: Based on TI's power management chip BQ2013H and STC89C52 microcontroller, real-time monitoring of the power of lead-acid batteries is achieved. According to the actual rated capacity of the battery, the initial capacity is set through the programmable pin of the BQ2013H chip. During the battery charging or discharging process, the charging and discharging status of the battery is determined by monitoring the voltage of the detection resistor between the negative electrode of the battery and the ground. The available capacity is indicated by 5 LEDs, and the microcontroller can also communicate with the BQ2013H chip through the HDQ protocol to read the relevant register values ​​and calculate the remaining capacity of the battery.
Keywords: BQ2013H; STC89C52; HDQ protocol; lead-acid battery; power monitoring

Introduction
As a long-term power supply, batteries are widely used in transportation, communication, control systems and other fields. In order to ensure the stability of the power system, monitoring the remaining power of the battery is a very important task. Commonly used detection methods are: density method, open circuit voltage method, discharge method and internal resistance method. The disadvantages of these four methods are low measurement accuracy, unsuitability for online measurement, complex circuit design or cumbersome algorithm. This article introduces a power management chip BQ2013H from TI, which can monitor the remaining battery power, current voltage, battery temperature and other information online with high accuracy and real-time. The peripheral circuit design is simple and adopts HDQ one-line communication protocol.

1 Introduction to the chip
1.1 Features
BQ2013H can accurately measure the remaining power of rechargeable batteries. The batteries that can be monitored include nickel-cadmium, nickel-metal hydride and lead-acid batteries. The chip directly drives the LED light for capacity display, can automatically charge and discharge compensation using the internal temperature sensor, and provides a simple single-bus serial communication interface. The chip pin diagram is shown in Figure 1, and the function description of each pin is listed in Table 1.


1.2 Functional Description
The BQ2013H chip is designed for battery packs and can keep an accurate record of the available power of the battery. A detection resistor is connected in series between the negative electrode of the battery and the ground of the circuit board. The chip determines whether the battery is in a charging or discharging state by monitoring the voltage drop of the detection resistor. BQ2013H is usually used to monitor the power of high-capacity batteries in high-discharge rate systems.
The self-discharge of the battery is estimated by an internal timer and temperature sensor. Compensation for battery temperature, charging rate and self-discharge rate is applied to the charge counter, which can provide available capacity information under a wide range of operating conditions. The initial battery capacity, self-discharge rate, display mode and charge compensation can be set using the chip's pins PROG1 to 6. During a discharge cycle from full to empty, the actual battery capacity can be automatically "learned" by the chip. The available power is indicated by 5 LED lights.
BQ2013H supports a simple single-wire bidirectional serial port connected to an external microprocessor (common ground). The chip responds to external commands from the serial port and outputs corresponding battery information. In order to support battery pack testing, the output can be controlled by commands, and the microprocessor can modify some data registers of the chip.
BQ2013H can directly monitor 4 nickel battery cells and 3 lead-acid battery cells. Connecting a transistor to the REF output pin of the BQ2013H chip can form a simple and inexpensive voltage regulator. In a multi-battery unit system, the VCC pin of the chip can be provided with power. The internal registers include available power, temperature, capacity, battery ID, and battery status registers.


The BQ2013H monitors the amount of charge input or output from a rechargeable battery to determine battery capacity. The BQ2013H measures discharge and charge currents, estimates self-discharge charge, monitors the battery for low voltage thresholds, and compensates for temperature and charge rate. Charge measurement is performed by monitoring the voltage across a small sense resistor connected in series between the negative electrode of the battery and the board ground. The available power is measured by monitoring the voltage over time and correcting for errors caused by environmental and operating conditions.

1.3 Overview of the internal operation of the chip
The internal operation block diagram in Figure 2 explains the operation of the BQ2013H. The BQ2013H cumulatively measures the charge and discharge currents, estimates the self-discharge, and compensates the charge current based on the charge rate and temperature. The compensation value of the discharge current is based on the value stored in the register LCOMP. The LCOMP register allows the chip to automatically adjust with a continuous small discharge current. The BQ2013H compensates for the self-discharge rate based on the value of the LC-OMP register and temperature.


NAC (available capacity register) is the most important register, which describes the battery capacity available at any time. When the battery is charged, the value of the NAC register is increased. When the battery is discharged or self-discharged, the value of the NAC register is reduced, and the value of the DCR (discharge count register) is increased. The NAC register also automatically corrects the offset error according to the value of the OFFSET (offset register).
Without charging the battery, if the battery is fully discharged from full to empty, the value of the DCR register is used to update the value of the LMD (most recently measured discharge register). Therefore, the BQ2013H can rewrite the capacity measurement value according to the actual discharge situation.
The initial capacity of the battery is equal to the value of the PFC (programmable full-scale counter). Before the LMD register is updated, the NAC count increases during the charging process but does not exceed the initial threshold. This method allows the monitored battery to be charged independently and is compatible with any type of charger.

2 System Hardware Design
As shown in Figure 3, the entire system includes modules such as batteries, load circuits, power monitoring, microcontrollers, and LED displays. The system is powered by a 12 V/2.5 Ah battery. In addition to the system itself, the load also includes a stepper motor circuit. BQ2013H monitors the battery charge and drives the LED to display the remaining charge in 20% increments. The chip uses HDQ protocol communication to transmit the values ​​of the relevant registers to the microcontroller STC89C52, which then processes the collected data accordingly.


This system uses TI's power management chip BQ2013H as the core of the system. The 12 V voltage of the battery is regulated by the field effect tube BSS138 to provide a power supply voltage of about 5.2 V for the BQ2013H chip. The battery voltage is divided by resistors R6 and R7 as the discharge threshold voltage of the chip. The detection resistor R11 uses a 0.01 Ω/3 W resistor. The collected voltage signal is input to the SR pin of the chip after RC filtering. According to the battery type, capacity, and detection resistor value, the jumpers J3 to J8 should be set to meet the current battery usage conditions. In Figure 4, BAT+ and BAT- are connected to the positive and negative poles of the battery respectively. DONE is the battery charging completion status input terminal, and the charging completion signal can be given by the single-chip microcomputer. HDQ is connected to the I/O port of the single-chip microcomputer through a pull-up resistor. RB provides power-off protection voltage for the register. PACK- and GND are connected together as the negative terminal of the load or charger. ACC is the activation terminal of the LED display, and the single-chip microcomputer can control whether the LED display is required.


Referring to the BQ2013H chip manual, the following settings can be made: initial capacity PFC value 2500 mAh × 0.01 Ω = 25 mVh.
The programmable pin settings are listed in Table 2, where H is high level, Z is high resistance, and L is low level.



3 Software Design
3.1 HDQ Communication Protocol
BQ2013H communicates with the microcontroller STC89C52 via the HDQ serial bus. HDQ communication uses a single bus, open-drain output interface, which requires a pull-up resistor and uses a command-based communication protocol. The host sends a command byte to the BQ2013H chip. This command instructs the chip to store the next 8 bits of data to the specified register or output 8 bits of data from the specified register. The maximum data transmission rate is 5 Kb/s, and the least significant bit of the command or data byte is transmitted first. The first 7 bits of the command byte are the register address, and the last bit is the read/write bit. A typical read cycle data format is shown in Figure 5. In a write cycle, the HDQ bus can remain high during the period between address bits or data bits. In a read cycle, after the last bit of the specified register address is transmitted, it is necessary to wait for the specified response time tRSPS before the chip outputs data to the bus. The response time tRSPS refers to the time period from the falling edge of the read/write bit to the falling edge of the first data bit of the data returned by the chip, thus including the entire read/write bit time. Since the minimum response time is equal to the minimum bit cycle time, this means that the first data bit can be transmitted as soon as the command R/W bit ends. Sometimes this communication protocol is considered to be the HDQ8 protocol to distinguish it from the HDQ16 protocol used by devices such as the bq2060 and bq2063. The bit timing of the HDQ16 and HDQ8 protocols is the same, except that 16 bits of data are read and written instead of 8 bits. The command word of the HDQ16 protocol is still a 7-bit address plus a read/write bit.


3.2 HDQ reset
If the HDQ pin remains low for longer than the minimum interruption time of 190μs, the communication will automatically reset. If the MCU does not get the expected response from BQ2013H or the MCU needs to restart the communication, the MCU will keep the HDQ pin low and generate an interruption to reset the communication. The next communication will start after the minimum interruption recovery time of 40μs. The interruption and interruption recovery timing are shown in Figure 6. The design method of HDQ reliable communication is to have an interruption before each communication to ensure that the system is reset before each communication, so as to reduce the probability of reading and writing erroneous data.


3.3 HDQ read and write timing
After a tB interruption time and tBR interruption recovery time, the MCU starts to send command bytes and data bytes to the HDQ bus. The transmission of each bit is completed in 3 steps: the first step is to start the transmission bit, and the MCU or BQ2013H sets the HDQ pin to a low level for tSTRHB time; the second step is to transmit the data bit, which is valid within the tDSUB time, and the data bit should be kept for tDHV time to allow the MCU or BQ2013H to read and write; the third step is to stop the transmission, which is achieved by setting the HDQ pin to a high level. The stop time is determined by tSSUB and tCYCHB, and the timing time is calculated from the negative level edge that starts the transmission. The HDQ read/write timing is shown in Figure 7.


3.4 HDQ read/write program
The single-chip microcomputer STC89C52 can control the BQ2013H chip, write control words to BQ2013H or read relevant data from BQ2013H. The following is the subroutine for the single-chip microcomputer (crystal oscillator 11.0592 MHz) to write control words to BQ2013H:



Conclusion
The method of using BQ2013H to monitor the battery power discussed in this article can effectively monitor the battery power in real time. The peripheral circuit is simple and the program is short. The single-chip microcomputer controls BQ2013H to read/write data through the HDQ protocol. The collected data is processed to realize online monitoring of the battery power.

Keywords:BQ2013H Reference address:Application of BQ2013H in lead-acid battery power monitoring

Previous article:Accurately calculating the remaining battery charge is crucial
Next article:High-power battery status detection based on DS2438

Recommended ReadingLatest update time:2024-11-16 22:34

STC89C52+SJA1000 self-transmitting and receiving program record
The project needs to use the CAN controller SJA1000 chip, and the main control chip used is ARM9, but no matter how I debug on ARM9, it doesn't work. As a last resort, I have to test whether the 51 series microcontroller can work with this chip. I need to rule out the chip problem, but I find that when you don't know
[Microcontroller]
STC89C52 MCU drives CC1101 wireless module receiving C language program
#include #include intrins.h #defineINT8Uunsigned char #defineINT16Uunsigned int #define WRITE_BURST 0x40 //Continuous writing #define READ_SINGLE 0x80 // read #define READ_BURST 0xC0 //Continuous read #define BYTES_IN_RXFIFO 0x7F //Number of valid bytes in the receive buffer #define CRC_OK 0x80 //CRC check
[Microcontroller]
STC89C52 DC Motor ---- Self-study Notes
1. What is a DC motor? 1.1. Brief description of DC motor A DC motor is a rotating electrical machine that can convert DC electrical energy into mechanical energy (DC motor) or convert mechanical energy into DC electrical energy (DC generator). It is a motor that can realize the mutual conversion between DC electric
[Microcontroller]
STC89C52 DC Motor ---- Self-study Notes
STC89C52 microcontroller digital tube static display
Digital tube display principle Digital tubes are divided into common cathode and common anode according to different internal connections. There are 8 LEDs inside the eight-segment digital tube. If you want to display a specific font, you only need to control the corresponding LED to light up and the other LEDs to t
[Microcontroller]
STC89C52 microcontroller digital tube static display
NRF24L01 sending program (the microcontroller is STC89C52)
#include #include intrins.h typedef unsigned int uint; typedef unsigned char uchar; #define TX_ADDR_WITDH 5 //Set the transmit address width to 5 bytes #define RX_ADDR_WITDH 5 //Set the receive address width to 5 bytes #define TX_DATA_WITDH 8 // #define RX_DATA_WITDH 8 #define R_REGISTER       0x00   // Rea
[Microcontroller]
51 MCU STC89C52 infrared decoding
/********************************  **For:Car mp3 IrControler  **Author:YWZ  **Date:2013/10/16  ********************************/   #include "reg52.h"      typedef unsigned char U8;    typedef unsigned int U16;      U8 code aHexIndex ={   '0','1','2','3',   '4','5','6','7',   '8','9','A','B',   'C','D','E','F'   };   U
[Microcontroller]
Design and implementation of passenger car safety system based on STC89C52 single chip microcomputer
In order to increase the safety of buses, a bus safety system based on STC89C52 single-chip microcomputer with anti-overload and anti-collision functions is proposed. By studying the ultrasonic ranging principle and pulse width modulation principle, the weight of the vehicle body and the distance of obstacles are moni
[Microcontroller]
Design and implementation of passenger car safety system based on STC89C52 single chip microcomputer
Light up the LED light (STC89C52RC chip)
Light up the first LED light 1. Understand the partial LED circuit schematic diagram. On the basis of understanding the schematic diagram, be familiar with the interface such as P2. Be familiar with its underlying circuit logic. 2. When using keil5, you must create a new folder. In this file, write a program to preven
[Microcontroller]
Light up the LED light (STC89C52RC chip)
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号