AVR450: Battery Charger for SLA, NiCd, NiMH
and Li-Ion Batteries
Features
• Complete Battery Charger Design
• Modular “C” Source Code and Extremely Compact Assembly Code
• Low Cost
• Supports Most Common Battery Types
• Fast Charging Algorithm
• High Accuracy Measurement with 10-bit A/D Converter
• Optional Serial Interface
• Easy Change of Charge Parameters
• EEPROM for Storage of Battery Characteristics
1 Introduction
The battery charger reference design is a battery charger that fully implements the
latest technology in battery charger designs. The charger can fast-charge all
popular battery types without any hardware modifications. It allows a full product
range of chargers to be built around a single hardware design; a new charger
model is designed simply by reprogramming the desired charge algorithm into the
microcontroller using In-System Programmable Flash memory. This allows
minimum time to market for new products and eliminates the need to stock more
than one version of the hardware. The charger design contains complete libraries
for SLA, NiCd, NiMH, and Li-Ion batteries.
Figure 1-1. Battery Charger Reference Design Board
8-bit
Microcontrollers
Application Note
1659C-AVR-09/06
2
AVR450
1659C-AVR-09/06
The battery charger reference design includes two battery chargers built with the
high-end AT90S4433 microcontroller and the highly integrated low-cost 8-pin
ATtiny15 microcontroller. However, it can be implemented using any AVR
microcontroller with A/D converter, PWM output and enough program memory to
store the desired charging algorithm.
As more and more electronic equipment becomes portable, the rush for better
batteries with higher capacity, smaller size and lower weight will increase. The
continuing improvements in battery technology calls for more sophisticated charging
algorithms to ensure fast and secure charging. Higher accuracy monitoring of the
charge process is required to minimize charge time and utilize maximum capacity of
the battery while avoiding battery damage. The AVR
®
microcontrollers are one step
ahead of the competition, proving perfect for the next generation of chargers.
The Atmel AVR microcontroller is the most efficient 8-bit RISC microcontroller in the
market today that offers Flash, EEPROM, and 10-bits A/D converter in one chip.
Flash program memory eliminates the need to stock microcontrollers with multiple
software versions. Flash can be efficiently programmed in production just before
shipping the finished product. Programming after mounting is made possible through
fast In-System Programming (ISP), allowing up-to-date software and last minute
modifications.
The EEPROM data memory can be used for storing calibration data and battery
characteristics, it also allows charging history to be permanently recorded, allowing
the charger to optimize for improved battery capacity. The integrated 10-bit A/D
converter gives superior resolution for the battery measurements compared to other
microcontroller-based solutions. Improved resolution allows charging to continue
closer to the maximum capacity of the battery. Improved resolution also eliminates
the need for external op-amps to “window” the voltage. The result is reduced board
space and lower system cost.
AVR is the only 8-bit microcontroller designed for high-level languages like “C”. The
reference design for AT90S4433 is written entirely in “C”, demonstrating the superior
simplicity of software design in high-level languages. C-code makes this reference
design easy to adopt and modify for today’s and tomorrows batteries. The reference
design for ATtiny15 is written in assembly to achieve maximum code density.
2 Theory of Operation
The charging of a battery is made possible by a reversible chemical reaction that
restores energy in a chemical system. Depending on the chemicals used, the battery
will have certain characteristics. When designing a charger, a detailed knowledge of
these characteristics is required to avoid damage inflicted by overcharging.
2.1 The AVR 8-bit RISC MCU
The reference designs includes two separate battery chargers. One using
AT90S4433 AVR microcontroller and one using the ATtiny15 AVR microcontroller.
The AT90S4433 design demonstrates how efficient a battery charger can be
implemented with C-code. The ATtiny15 design shows the highest integrated and
lowest cost battery charger available in today’s market. The AT90S4433 can be used
for voltage and temperature monitoring with UART interface to PC for data logging.
Table 1 shows the differences in the design.
AVR450
3
1659C-AVR-09/06
Table 2-1. Design Differences
AT90S4433 Design ATtiny15 Design
Programming Language C Assembly
Code Size (approximately) 1.5K Bytes <350 Bytes
Current Measurement
External Op-Amp Gain
Stage
Built-in Differential Gain Stage
PWM Frequency 14 kHz, 8-bit Resolution 100 kHz, 8-bit Resolution
Clock Source External Crystal, 7.3 MHz
Internal Calibrated RC
Oscillator, 1.6 MHz
Serial Comm. Interface Yes No
In-System Programming Yes Yes
2.2 Battery Technologies
Modern consumer electronics use mainly four different types of rechargeable
batteries:
• Sealed Lead Acid (SLA)
• Nickel Cadmium (NiCd)
• Nickel Metal Hydride (NiMH)
• Lithium-Ion (Li-Ion)
It is important to have some background information on these batteries to be able to
select the right battery and charging algorithm for the application.
2.2.1 Sealed Lead Acid (SLA)
Sealed Lead Acid batteries are used in many applications where cost is more
important than space and weight, typically preferred as backup batteries for UPS and
alarm-systems. The SLA batteries are charged using constant voltage, with a current
limiter to avoid overheating in the initial stage of the charging process. SLA batteries
can be charged infinitely, as long at the cell voltage never exceeds the manufacturer
specifications (typically 2.2V).
2.2.2 Nickel Cadmium (NiCd)
Nickel Cadmium batteries are widely used today. They are relatively cheap and
convenient to use. A typical NiCd cell can be fully charged up to 1,000 times. They
have a high self-discharge rate. NiCd batteries are damaged from being reversed,
and the first cell to discharge completely in a battery pack will be reversed. To avoid
damaging discharge of a battery pack, the voltage should be constantly monitored
and the application should be shutdown when the cell voltage drops below 1.0V. NiCd
batteries are charged with constant current.
2.2.3 Nickel Metal Hydride (NiMH)
Nickel Metal Hydride batteries are the most widely used battery type in new
lightweight portable applications (i.e., cell phones, camcorders, etc.). They have a
higher energy density than NiCd. NiMH batteries are damaged from overcharging. It
is therefore important to do accurate measurements to terminate the charging at
exactly the right time (i.e., fully charge the battery without overcharging). Like NiCd,
NiMH batteries are damaged from being reversed.
4
AVR450
1659C-AVR-09/06
NiMH has a self-discharge rate of approximately 20%/ month. Like NiCd batteries,
NiMH batteries are charged with constant current.
2.2.4 Lithium-Ion (Li-Ion)
Lithium-Ion batteries have the highest energy/weight and energy/space ratio
compared to the other batteries in this application note. Li-Ion batteries are charged
using constant voltage, with current limiter to avoid overheating in the initial stage of
the charging process. The charging is terminated when the charging current drops
below the lower current limit set by the manufacturer. The battery takes damage from
overcharging and may explode when overcharged.
2.3 Safe Charging of Batteries
Modern fast chargers (i.e., battery fully charged in less than three hours, normally one
hour) requires accurate measurements of the cell voltage, charging current and
battery temperature in order to fully charge the battery completely without
overcharging or otherwise damage it.
2.3.1 Charge Methods
SLA and Li-Ion batteries are charged with constant voltage (current limited). NiCd and
NiMH batteries are charged with constant current and have a set of different
termination methods.
2.3.2 Maximum Charge Current
The maximum charge current is dependent on the battery capacity (C). The maximum
charge current is normally given in amounts of the battery capacity. For example, a
battery with a cell capacity of 750 mAh charged with a charging current of 750 mA is
referred to as being charged at 1C (1 times the battery capacity). If the charging
current for trickle-charge is set to be C/40 the charging current is the cell capacity
divided by 40.
2.3.3 Overheating
By transferring electric energy into a battery, the battery is charged. This energy is
stored in a chemical process. But not all the electrical energy applied to the battery is
transformed into the battery as chemical energy. Some of the electrical energy ends
up as thermal energy, heating up the battery. When the battery is fully charged, all the
electrical energy applied to the battery ends up as thermal energy. On a fast charger,
this will rapidly heat up the battery, inflicting damage to the battery if the charging is
not terminated. Monitoring the temperature to terminate the charging is an important
factor in designing a good battery charger.
2.4 Termination Methods
The application and environment where the battery is used sets limitations on the
choice of termination method. Sometimes it might be impractical to measure the
temperature of the battery and easier to measure the voltage, or the other way
around. This reference design implements the use of voltage drop (-dV/dt) as primary
termination method, with temperature and absolute voltage as backup. But the
hardware supports all of the below mentioned methods.
AVR450
5
1659C-AVR-09/06
2.4.1 t – Time
This is one of the simplest ways to measure when to terminate the charging. Normally
used as backup termination when fast-charging. Also used as primary termination
method in normal charging (14 - 16h). Applies to all batteries.
2.4.2 V – Voltage
Charging is terminated when the voltage rises above a preset upper limit. Used in
combination with constant current charging. Maximum current is determined by the
battery, usually 1C as described above. Current limiting is crucial to avoid thermal
damage to the battery if charge current is too high. SLA batteries are normally
charged infinitely by setting the maximum voltage above the actual charge voltage.
Used for Li-Ion as primary charging algorithm/termination method. Li-Ion chargers
usually continue with a second phase after the maximum voltage has been reached
to safely charge the battery to 100%. Also used on NiCd and NiMH as backup
termination.
2.4.3 -dV/dt – Voltage Drop
This termination method utilizes the negative derivative of voltage over time,
monitoring the voltage drop occurring in some battery types if charging is continued
after the battery is fully charged. Commonly used with constant current charging.
Applies to fast-charging of NiCd and NiMH batteries.
2.4.4 I – Current
Charging is terminated when the charge current drops below a preset value.
Commonly used with constant voltage charging. Applies to SLA and Li-Ion to
terminate the top-off charge phase usually following the fast-charge phase.
2.4.5 T – Temperature
Absolute temperature can be used as termination (for NiCd and NiMH batteries), but
is preferred as backup termination method only. Charging of all batteries should be
terminated if the temperature rises above the operating temperature limit set by the
manufacturer. Also used as a backup method to abort charging if voltage drops below
a safe temperature – Applies to all batteries.
2.4.6 dT/dt – Temperature Rise
The derivative of temperature over time can be used as termination method when
fast-charging. Refer to the manufacturer’s specifications on information on the exact
termination point (Typically 1C/min for NiCd batteries) – Applies to NiCd and NiMH.
2.4.7 DT – Temperature over Ambient Temperature
Terminates charging when the difference between ambient (room) temperature and
battery temperature rises over a preset threshold level. Applies to NiCd and SLA as
primary or backup termination method. Preferred over absolute temperature to avoid
battery damage when charged in a cold environment. As most systems have only one
temperature probe available, the ambient temperature is usually measured before
charging is initiated.