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.
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
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Traffic Light Control System Based on Fuzzy Control (Single-Chip Microcomputer Implementation)
- Principles and Applications of Single Chip Microcomputers (Second Edition) (Wanlong)
- MCU Principles and C51 Programming Tutorial (2nd Edition)
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Please help me check if 28335 is down
- Code compression technologies for several mainstream embedded architectures
- 【Laser target detector】Belated unboxing, RPI400 unit only
- Getting Started Using TouchGFX to Develop STM32 Interface Applications (Part 1) - Software Installation and Hello World
- psoc creator soft imitation function
- Developer Case: Design of Smart Agriculture Based on Gizwits IoT and RT-Thread
- Basic Theory of System Timing
- Several technical principles of unlocking shared bicycles with mobile phones,,,
- 【GD32E503 Review】——04.MCU CoreMark Performance Test
- [RTT & Renesas high performance CPK-RA6M4] 3. PWM to achieve breathing light evaluation