Sunteți pe pagina 1din 4

ISBN 978-952-5726-11-4

Proceedings of the Third International Symposium on Electronic Commerce and Security Workshops(ISECS ’10)
Guangzhou, P. R. China, 29-31,July 2010, pp. 072-075

A Design of Smart Battery Charger Based on


AVR Single Chip
Li Geng1,Hai Lin-peng2
1
School of Computer Science and Technology,Henan Polytechnic University,Jiaozuo Henan
ligeng@hpu.edu.cn
2
President office, Henan Polytechnic University, Jiaozuo Henan
hailp@hpu.edu.cn

Abstract — With regard to incompatible and low how to adapt to different types of batteries, constant
efficiency of lithium-ion batteries, nickel metal current and voltage of output signal should be taken into
hydride batteries and nickel-chrome charger, a account in the design. For constant current and voltage of
generalized smart charger is designed in this paper, output signal, according to the principle of feedback,
which adopts single chip control circuit to make comparison and output that phase-locked loop involved,
battery charge intelligentize, using on-chip integrated and the function that output in step with input, we adopt
10-bit A/D converter and 8-bit pulse width the structure as shown in Fig.1.
modulation (PWM) output, to ensure that the charger Phase-lock achieved by MCU ATtiny15 in this paper.
with a higher accuracy and better charging An 8-bit square wave with 100 KHz can be output within
performance. the allowed precision range. By amending the comparison
value to change the duty cycle of square wave, and then
Index Terms— AVR single chip, intelligentize, use the square wave to modulate the output current and
charger, design voltage, to output a constant value.
To adapting problems of different batteries, manual
I. INTRODUCTION user-selected is adopted in the paper. Users select the type
Traditional simple charger can’t charge for batteries of batteries that need to charge after plugged in and the
that manufactured by different technics and that with battery right placed, MCU will initialize the charge
different capacity and voltage. Once used, it will result in parameters in accordance with the appropriate type[2].
improper charge, even a series of security incidents. To Continued charge power-off is in the design thought of
solve these problems, microcontroller should be used in charger, it means that after chose the batteries types,
the charger. Microprocessor apply in battery charger not MCU will record the choice immediately and clear the
only realize intelligent control, but also with the record at the end of normal charge, if the charge is
advantages of low cost, simple structure and so on. The abnormal interrupted by external power supply
application of microprocessor makes that develop a smart interruption, the record will remain stored in the memory
charger that can be widely applied in different situations unit, when you start charging again, MCU will find this
and with perfect function in a very short time. Moreover, record, to make charging continue.
the microprocessor can easily realize serial According to the current direction during charging, the
communication, real-time data logging and monitoring[1]. charger circuit is divided into a few important modules as
The hardware structure of smart battery charger based on follows: power supply module (including the chip power,
AVR MCU (micro controller unit) is given in the paper, charging power and reference voltage), voltage and
and intelligent control is achieved in software by current modulation module, voltage measurement module,
modularization programming method. current measurement module, temperature measurement
module, charge module, discharge module (only suit to
II. INTEGRATED STRUCTURE ANALYSIS OF CHARGER nickel-cadmium battery), battery type choose module,
Smart Charger is suitable to charge nickel-chromium, display module and alarm module.
nickel hydrogen and lithium-ion batteries, problems that

Figure 1. Principle of phase-locked loop

© 2010 ACADEMY PUBLISHER


AP-PROC-CS-10CN008 72
U1
D1 MC7812T
3A +12V
1 3
L Vin +12V

1
FUSE1 PBYR1645

GND
470UF
C1 T1 C2 4 2 T2 U2
100nF/400V 39ml 100nf/400v D2 MC7805K

2
1
Vin +5V
2 +5V
1.2A/500V PBYR1645

GND
N
TRANS4

3
C4 C5
470UF 100uF 100uF AREF

3
R1
R0 4.7K
1K
TL431

R2
10K

PB5 VCC

PB3 PB2
ATtiny15L
PB4 PB1
GND PB0
Q2

NPN

R8 S0 S1 S2
1K SW SW SW
AREF R7 R3
10K 10K
R9
10K R6 R4
33K 33K

R5
0.25
RTC
BT1 Q3
BATTERYS NPN

VO L2 L1

INDUCTOR1 INDUCTOR1 Q1
NPN
C8 D3
C7 C6 PBYR1645
100UF/15V 1000UF/15V CAP

Figure 2. Hardware circuit diagrams

(VI - Vsat - Vo )ton (12V − 0.5V −1.5V )5µs


III. HARDWARE CIRCUIT L= = = 16.7µH (2)
2Iomax 2 •1.5 A
According to the above analysis, the circuit of designed
Since all measurement results are 10-bit, measuring
charger is shown in Fig.2.
accuracy should be calculated by the equation of (3).
Many components parameters are involved in the
3.67V mV
circuit design, which ensure the circuit work proper, more = 3.58 (3)
important is to ensure charging safe and quick. According 1024 Step
to the direction of working current of charger, a few According to (1), we know that the measurement
parameters like reference voltage, key element voltage of ADC (Analog-Digital Converter) range from 0
modulation circuit, measurement range of voltage and to 3.67 V. From (4), we can get the measurement of
current, the distance, measuring accuracy and time/count output voltage of voltage divider.
of MCU need to fix[3]. Rb
The reference voltage of circuit is provided by TL431, V ADC = × Vb (4)
AREF set by proportional resistance. The ideal value can Ra + Rb
get from (1). Where VADC is the output voltage of voltage divider,
⎛ R ⎞ also the analog input of MCU, Vb is the voltage across the
AREF = V REF ⎜⎜1 + a ⎟⎟ = 3.67 V (1) battery. Ra and Rb is proportional resistance divide the
⎝ Rb ⎠ voltage across the battery, assume Ra is 3.7 kΩ and Rb is
Where 3.67 V is a middle value between high degree of 2.2 kΩ, we got 9.8 V of Vb from (4).
accuracy (which is a little smaller) and high From the circuit, we know that the charging current is
signal-to-noise (which is a little bigger), the proportional generated by reference voltage acting on 0.25Ω of
resistance of Ra is 4.7 kΩ, Rb is 10 kΩ. sensitive resistance, voltage on the resistance need to be
To components parameters of modulation circuit, Fosc amplified 20 times, to improve the conversion accuracy,
of oscillator frequency is 25.6MHz, Vsat of saturation and A/D conversion. Assume Vibat as analog input voltage
voltage is 0.5 V, Vi of input voltage is 12 V, Vo of output of A/D converter, Ir as the current across 0.25Ω of
voltage is 1.5 V, Iomax of maximum output current is 1.5 Sensitive resistance Rm, Ra and Rb is proportional
A, the period of 8-bit PWM is 10 µs, on state time is 5 µs resistance divide the voltage across 0.25Ω of resistance, in
of the half of the period when duty cycle is 50%. order to unify the proportion, recognize Ra= 3.7 kΩ,
Inductance can be calculated by (2) according to the Rb=2.2 kΩ. Analog input voltage is given in
above parameters: (5).

73
To identify the battery type, from the hardware circuit
we know that port PB0, PB1 and PB2 connected with the
switch respectively, the switch connected with analog
ground. If press the switch corresponding to port PB0, the
pin of port PB0 must be low level, thus 11111110 is read
in, automatic pulsing 1, the result is 11111111, the initial
value of R16 is 11111111, result of the two values
subtract each other is 0, one type is chose. If the switch
corresponding to port PB1 is pressed, the pin of port PB1
must be low level, thus 11111101 is read in, twice
automatic pulsing 1, the result is 11111111, the result is 0
the same, thus achieve the identification of battery type,
and begin to charge according to selected type. The code
is as follows [4].
type_choose:
ldi temp,0
; assign an initial value
out ddrb,temp
; Set port B input with pull-up resistor
ldi temp2,0
; Clear register 2
ldi temp,0xff
in temp2,Pinb
; Read port B
Figure 3. Workflow diagram of charging inc temp2
; Automatic pulsing 1
⎛ Rb ⎞ sub temp,temp2
V Ibat = 20⎜⎜ ⎟⎟ * I r * R m = 1.964 I r (5)
⎝ Rb + R a ⎠
; Subtract each other
breq li_type
The maximum charge current can be measured is given
; Choose lithium ion battery if equal to 0
in (6).
ldi temp,0
3.67
I max = = 1.869mA (6) ; Else continue to scan
1.964 ldi temp2,0
out DDRB,temp
IV. INTELLIGENT CONTROL SOFTWARE ldi temp,0xff
We can get the workflow of charger from the overall in temp2,PinB
function, as shown in Fig.3. inc temp2
From the workflow diagram, we need to check the inc temp2
battery placed right or not and identify the battery type sub temp,temp2
before charging. breq NiMh_type
Measure the voltage across the battery through A/D ; Choose nickel-hydrogen battery if equal to 0
convert can check battery if properly placed or not, ldi temp,0
normally it would not be 0 or negative. If the ; Else continue to scan
measurement results less than or equal to 0, it means there ldi temp2,0
is fault, thus implement this cycle continuously and give out ddrb,temp
tips. The code is as follows. ldi temp,0xff
include "tn15def.inc" ;ldi temp2,3
include "bc.inc" in temp2,Pinb2
; ******[ Interrupt Vector Table ]********* inc temp2
org 0x00 inc temp2
ldi temp, 0x05 inc temp2
out TCCR0, temp ; TCNT0 CK/1024 sub temp,temp2
ldi temp, 0x41 breq NiCd_type
; Set 100KHz as PWM output ; Choose nickel-cadmium battery if equal to 0
out TCCR1, temp ; Output disabled rjmp type_choose
; ******* Test battery placed right or not ******** ; Else scan port B from the beginning
; eeprom li_type:
; Is there memory of battery type? ; Procedure of writing type-memory unit
rjmp type_choose ; Define PB port as input
.org OVF0addr rjmp fast_charge_li

74
NiMh_type: of small, light, programmable charging sessions, also with
; Write type-memory unit reliable performance and fine applicability. The
rjmp fast_charge_NiMh technology will occupy a certain market share if promoted
NiCd_type: in the market, thus achieve pretty good social and
; Write type-memory unit economic benefits.
rjmp fast_charge_NiCd
;******[ Interruption control of timer 0]******** REFERENCES
; *************** [1] OU Xi-jun, XIN Guo-qiang. “Structure Principle of a
; Charging procedure of some kind of battery novel Smart Charger,” Journal of Jilin Teachers Institute
; *************** of Engineering and Technology (Natural Sciences
; Clear the type-memory unit Edition), Vol. 22, Jun. 2006, pp. 44-45.
[2] WANG Guo-zhi, HU Wan-qiang. “Design of Intelligent
; End
Charger Circuit,” Journal of Xuchang University, Vol. 27,
V. CONCLUSIONS Mar. 2008, pp. 36-39.
[3] HUA You-qing, SU Hong-fu, ZHANG Jue-rui. “Design of
The smart charger which adopts AVR microcontroller Intelligent Lead-acid Battery Charger Based on
as the core of control circuit, can choose the battery types, MC68HC08,” Journal of Jinhua College of Profession and
adjust control parameters and diagnose fault itself Technology, Vol. 6, Dec. 2006, pp. 6-10.
according to the charging process, unattended operation [4] “Big secret implied in mobile phone,” Era Youth, Vol. 6,
during charging, and prolong the battery life. The design 2007.
process (peripheral circuit) is simple, with the advantages

75

S-ar putea să vă placă și