Application of AVR Microcontroller in Battery Residual Power Tester

Summary:Using a generation of AVR microcontroller (AT90S8515) to achieve the remaining battery power on-line measurement. This method measures the internal resistance of the battery in real time and calculates the remaining power. Finally, the experimental results are given.

Keywords: Single-chip microcomputer, on-line measurement of battery residual power battery as a backup power supply, has been widely used in computer networks, universal, power and other fields. The charge of the storage battery is closely related to the reliability of the entire power supply system. The remaining battery power is higher and the system reliability is higher, otherwise it is the opposite. For some important areas of power consumption, such as information processing centers, it would be of great practical significance to realize on-line monitoring of the remaining battery power if it can neither consume the energy of the battery nor affect the normal operation of the power equipment. In recent years, with the rapid development of the IT industry, the importance of batteries has become more and more prominent, and the demand for accurate prediction of the remaining power is becoming more and more urgent.

The common methods for predicting the remaining battery charge are: 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 on-line measurement of sealed batteries, so they are more difficult to use. The internal resistance method has little effect on the measured battery, and when the battery is fully charged (full) and fully discharged (discharged), its internal resistance differs by about 2-4 times. Therefore, using the internal resistance method to predict the remaining battery power is relatively High accuracy is gradually being applied.

1 internal resistance measurement principle 1.1 Battery equivalent model Battery AC impedance impedance Z model shown in Figure 1.

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

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

L is the lead inductance;

Rn is the battery ohmic resistance.

Battery ohmic resistance Rn characterizes the degree of battery charge. In order to simplify the measurement, only the pure resistance R (R is composed of RΩ, R1, and R2) is usually separated from the equivalent impedance Z, and the relationship between R and RΩ is linear, so the degree of battery charge can be indirectly characterized by R.

1.2 Four-wire internal resistance measurement Since the internal resistance of the battery is very small, generally uΩ-Ωm, the impedance of the measurement line becomes non-negligible. For this purpose, the four-wire measurement is used, that is, the drive current loop and the induced voltage circuit are separated. Internal resistance four-wire measurement principle shown in Figure 2, where R2 is a sampling resistor.

The method of measuring the internal resistance of a battery is to apply a constant ac audio current source is on both ends of the battery, and then to measure 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: Z = Vo / io

R=Zcosθ

R is the internal resistance of the reservoir that we need to obtain.

1.3 Measurement of Remaining Energy The principle study shows that there is a high correlation between the internal resistance of the battery and the degree of charge (about 0.88), and the residual charge can be accurately predicted by measuring the internal resistance of the battery. The relationship between the battery internal resistance and the remaining power is shown in Figure 4.

The method of this embodiment is to fully charge the battery (12V battery as an example, charge it to 13.8V, float charge to 10mA.) Then discharge the battery at a discharge rate of 0.1C, and record the size of the internal charge and battery during discharge. . When the battery discharge is completed (12V battery discharged to 10.8V) can get a complete release curve, that is, the relationship between the remaining battery and the internal resistance of the battery. Store these curves in the EPROM. After testing the same type of batteries in the future, the microcontroller will calculate the remaining battery value by looking up the table according to the measured internal battery resistance.

2 Hardware Design 2.1 Instrument Structure Block Diagram In order to realize the above-mentioned method for predicting the remaining power, the hardware block diagram of the test instrument we developed is shown in Figure 5. The instrument is mainly composed of audio signal generator, coupling driver, differential amplifier, filter network, rectifier circuit, phase detection circuit, voltage and current sampling circuit, analog conversion switch, A/D converter (AD7715), single-chip computer (AT90S8515), LCD Display and keyboard and other components.

It should be pointed out that in order to obtain a higher prediction accuracy of residual power, the internal resistance to be measured must have enough ineffective bits. For this reason, we take 4 significant digits. This requires that the A/D converter must be above 14 bits. Since the internal resistance and voltage of the battery are slowly changing and low time-varying signals, we only need to select the low-speed serial A/D converter, and the ∑-Δ type A/D converter can meet our requirements well. Therefore, we choose AD7715. The AD7715 is a 16-bit A/D converter with self-calibration and self-calibration function. It has a high measurement accuracy. In addition, the politician SPI interface facilitates high-speed communication with the microcontroller.

The microcontroller is Atmel's new generation of Risc microcontroller (AT90S8515), which has the following superior performance:

120 streamlining orders, and most instruction execution time is a single clock cycle;

With the Harvard architecture, the execution time of each instruction is only 125ns under the 8MHz clock.

On-chip 8KB Flash program memory, 512byteEPROM data memory, 512byte RAM memory;

In addition to ordinary asynchronous communication interface, it also has SPI interface, SPI data transfer rate up to 2.5Mb / s;

It has a PWM generator, analog voltage comparator and Watehdog timer.

2.2 interface design SCM and main peripheral devices interface circuit shown in Figure 6.

(1) Port is used as keyboard input and external EPROM memory, where PAO is connected to the memory clock line, PAI is connected to the memory data line, and PA2∽PA7 is connected to the keyboard.

(2) The port is used for A/D conversion and analog switch channel selection, where PBO∽PB2 is used as the channel line, and PB5∽PB7 is connected with the corresponding SPI port of the A/D converter.

(3) The port is used as a liquid crystal display data port.

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

3 Software Design The main program flow chart of the instrument is shown in Figure 7-9.

4 test results In order to verify the design, I have done a full performance test on the two samples developed, the test results are shown in Table 1.

AVR is a very powerful microcontroller. It not only integrates many peripheral interface functional circuits, but also has fast operation speed, low power consumption, and high reliability. It is ideally suited for applications in smart instrumentation.

In theory, as long as the amplitude of the audio current source is adjusted, the internal resistance method can be applied to battery measurements of various capacities. This method is also applicable to Ni-Mh, Ni-Cd, and Li batteries. Therefore, the internal resistance method is used to predict the remaining battery charge has good versatility and practicality.

(This article is from the world of electronic engineering: http://Test_and_measurement/zhzx/200605/2295.html)

Razor Barbed Wire

Razor Barbed Wire is a new type of Fence, razor wire is corrosion-resistant galvanized steel orstainless steel as raw material processed, Is one of the most popular high-level protection of metal construction materials. Razor barbed wire models are usually divided into BTO-12, BTO-15, BTO-22, BTO-30, CBT-60, CBT-65, Concertina razor wire usually make with galvanized steel sheet, stainless steel sheet. Razor barbed wire is characterized by beautiful, strong, corrosion, oxidation, excellent protection, deterrent effect. Razor barbed wire is widely used in military, prisons, detention centers, government buildings and pasture boundary, railway, highway isolated protection, etc.razor wire

Razor Barbed Wire,Stainless Steel Razor Barbed Wire,Galvanized Razor Barbed Wire,Concertina Razor Barbed Wire

Anping Sanxing Wire Mesh Factory , https://www.anpingsanxingwiremesh.com