Application of AVR single chip microcomputer in battery remaining capacity tester

Publisher:yunhuiLatest update time:2016-10-26 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
As a backup power source, batteries have been widely used in computer networks, communications, electricity and other fields. The charge of the battery is closely related to the reliability of the entire power supply system. The higher the remaining battery power, the higher the system reliability, otherwise it is not. For some important power consumption areas, such as information processing centers, if the online monitoring of the remaining battery power can be achieved without consuming the energy of the battery and affecting the normal operation of the power consumption equipment, it will be of great practical significance. With the rapid development of the IT industry in recent years, the importance of batteries has become more and more prominent, and the demand for accurate prediction of the remaining power has become more and more urgent.

Common methods for predicting the remaining capacity of batteries include: density method, open circuit voltage method, discharge method, and internal resistance method. The first three methods have low measurement accuracy and are not suitable for online measurement of sealed batteries, so they are difficult to use. The internal resistance method has little effect on the measured battery, and the internal resistance of the battery differs by about 2-4 times when it is fully charged (full) and fully discharged (discharged). Therefore, the internal resistance method has a high accuracy in predicting the remaining capacity of the battery and is gradually being put into practical use.

Application of AVR microcontroller in battery remaining capacity tester - Tianyu Cancan - Tianyu Cancan ParadiseApplication of AVR microcontroller in battery remaining capacity tester - Tianyu Cancan - Tianyu Cancan Paradise

1. Internal resistance measurement principle

1.1 Battery Equivalent Model

The battery AC effective impedance Z model is shown in Figure 1.

In the figure: R1, R2 are the polarization resistances of the positive and negative electrodes;

C1 and C2 are positive and negative electrodes and polarization capacitors;

L is the lead inductance;            Application of AVR microcontroller in battery remaining capacity tester - Tianyu Cancan - Tianyu Cancan Paradise

RΩ is the battery ohmic resistance.

The battery ohmic resistance RΩ characterizes the battery charge level. In order to simplify the measurement, usually only the pure resistance R (R is composed of RΩ, R1, and R2) is separated from the equivalent impedance Z. There is a linear relationship between R and RΩ, so R can be used to indirectly characterize the battery charge level.

1.2 Four-wire internal resistance measurement

Since the internal resistance of the battery is very small, generally in the uΩ-Ωm level, the impedance of the measurement line becomes non-negligible, so the four-wire method is used for measurement, that is, the driving current loop and the induction voltage circuit are separated. The principle diagram of the internal resistance four-wire method measurement is shown in Figure 2, where R2 is the sampling resistor.Application of AVR microcontroller in battery remaining capacity tester - Tianyu Cancan - Tianyu Cancan Paradise

The method of measuring the internal resistance of a battery is to apply a constant AC audio current source is across the battery, and then detect the voltage Vo across the battery, and the angle θ between is and V0. The relationship between the three is shown in Figure 3.

From Figure 3, we can see that: Z = Vo/io

R=Zcosθ

R is the internal resistance of the battery we need to obtain.

1.3 Principle of measuring remaining power

    Research shows that there is a high correlation (about 0.88) between the internal resistance of the battery and the degree of charge. By measuring the internal resistance of the battery, its remaining capacity can be predicted more accurately. The relationship curve between the internal resistance of the battery and the remaining capacity is shown in Figure 4.

The specific implementation method is: fully charge the battery (taking a 12V battery as an example, charge to 13.8V, and float charge current to 10mA.) Then discharge the battery at a 0.1C discharge rate, and record the internal resistance and power during the discharge process. When the battery is discharged (the 12V battery is discharged to 10.8V), a complete discharge curve can be obtained, that is, the relationship between the remaining power and the internal resistance of the battery. This curve is stored in the EPROM. When testing batteries of the same model and specification in the future, the microcontroller will calculate the remaining power value based on the battery internal resistance value measured online by looking up the table.

Application of AVR microcontroller in battery remaining capacity tester - Tianyu Cancan - Tianyu Cancan Paradise

2 Hardware Design

2.1 Instrument structure diagram

In order to realize the above remaining power prediction method, the hardware block diagram of the test instrument we developed is shown in Figure 5. The instrument is mainly composed of an audio signal generator, a coupling driver, a differential amplifier, a filter network, a rectifier circuit, a phase detection circuit, a voltage and current sampling circuit, an analog conversion switch, an A/D converter (AD7715), a single-chip microcomputer (AT90S8515), an LCD display and a keyboard.

Application of AVR microcontroller in battery remaining capacity tester - Tianyu Cancan - Tianyu Cancan Paradise

    It should be pointed out that in order to obtain a higher remaining power prediction accuracy, the measured internal resistance must have enough effective digits, so we take 4 effective digits, which requires the A/D converter to be more than 14 bits. Since the battery internal resistance and voltage are both slow-changing low-time-varying signals, we only need to choose a low-speed serial A/D converter, and the ∑-△ type A/D converter can well meet our requirements, so we choose AD7715. AD7715 is a 16-bit A/D converter with self-calibration zero and self-calibration range functions, with high measurement accuracy, and SPI interface, which is convenient for high-speed communication with the microcontroller.Application of AVR microcontroller in battery remaining capacity tester - Tianyu Cancan - Tianyu Cancan Paradise

The single chip microcomputer is a new generation of Risc single chip microcomputer (AT90S8515) of Atmel Company, which has the following superior performances:

120 streamlined instructions, and most instructions are executed in a single clock cycle;

Adopting Haffey architecture, the execution time of each instruction is only 125ns at 8MHz clock.

The chip has 8KB Flash program memory, 512byte EPROM data memory, and 512byte RAM memory;

In addition to the common asynchronous communication interface, it also has an SPI interface, and the SPI data transmission rate is up to 2.5Mb/s;

It has PWM generator, analog voltage comparator and Watchdog timer.

2.2 Interface Design   Application of AVR microcontroller in battery remaining capacity tester - Tianyu Cancan - Tianyu Cancan Paradise

The interface circuit between the microcontroller and main peripheral devices is shown in Figure 6.

(1) The PA port is used for keyboard input and external EPROM memory, where PA0 is connected to the memory clock line, PAI is connected to the memory data line, and PA2~PA7 are connected to the keyboard.

(2) The PB port is used for A/D conversion and analog switch channel selection, where PBO~PB2 are used as channel lines and PB5~PB7 are connected to the SPI port lines corresponding to the A/D converter.

(3) The PC port is used as the LCD display data port.

(4) The PD port is used as the A/D request and LCD control port, where PD2 is the A/D converter request, PD5 is the LCD chip select signal, PD6 is the read/write select signal, and PD7 is the enable signal.

3 Software Design

The main program flow charts of the test instrument are shown in Figures 7 to 9.

4 Test Results

In order to verify the design, we conducted full performance tests on the two samples we developed. The test results are shown in Table 1.

AVR is a very powerful single-chip microcomputer. It not only integrates many peripheral interface function circuits, but also has fast computing speed, low power consumption and high reliability. It is very suitable for application in intelligent instruments.

Theoretically, the internal resistance method can be applied to the measurement of batteries of various capacities as long as the amplitude of the audio current source is adjusted. This method is also applicable to Ni-Mh, Ni-Cd and Li batteries. Therefore, the internal resistance method is very versatile and practical for predicting the remaining capacity of batteries.

Reference address:Application of AVR single chip microcomputer in battery remaining capacity tester

Previous article:The original program of PID temperature control system based on AVR
Next article:Program implementation of 8-bit digital tube display of AVR single-chip computer

Latest Microcontroller 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号