ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

A BETTER BATTERY CHARGER


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

A BETTER BATTERY CHARGER

Lessons from the Trenches Part 2: Hardware and Software Implementation
by Thomas Richter

Start ý The Buck Converter ý Voltage Reference and Battery Temperature ý AT90S2333 Battery Charger ý ATtiny15 Battery Charger ý Charge Current ý Software Implementation ý User Settings ý Source Code ý INT Battery Function ý The Stable_ADC Function ý BC.H ý B_DEF.H ý Charge MethodýSLA.C ý Charge MethodýNiCd.C and NiMH.C ý Charge MethodýLilon.C ý Suggested Improvement ý Sources and PDF

B_DEF.H

The B_DEFH module defines the battery to be charged. When a customer designs a battery charger using the given circuit and program code, this file has to be changed to meet the needs.

The battery type defines the charging and termination algorithm. If more than one battery type is chosen, an error will occur while the program is linking, because all functions for the different battery types have the same namesýbattery(), fast_charge(), and trickle_charge(). Also, an error message will occur if no battery type is chosen.

The cell number determines the voltage of the battery pack and all related constants. It is assumed that all cells are in series. Zero cells are not reasonable but will only result in zero charge current. The voltage range of the buck converter and the voltage measurement circuit sets the upper limit.

The capacity (in mAh) defines the charge current and all related constants. All battery types except SLA (which is charged with 2 C) are fast-charged in a conservative way at 1 C. This sets the limit for the battery capacity.

The buck converter is calculated to supply a maximum current of 1.5 A. The maximum capacity for SLA is 750 mAh, and for all other battery types, it is 1500 mAh. If a higher charge current for NiCd or NiMH is required, the buck converter layout has to be changed. In case of a current higher than 2 A, the current measurement circuit will need some modifications. If batteries with a higher capacity than calculated here should be charged, it is possible to change the buck converter or reduce charge current.

For the Li-Ion battery type, two cell voltages exist, depending on the battery manufacturer. This voltage, 4.1 or 4.2 V, must be edited. It will be included automatically if the Li-Ion definition is chosen. Stating a wrong voltage in this place will not necessarily result in an error message but may lead to incorrect charge methods, which can damage the battery and the battery charger.

The ADC step parameters should be edited according to the resistors used in the measurement circuitry. This was described previously in Table 1. This look-up table is used in NiCd charging. The table may be edited if the NTC is different from the one used in this description.

PREVIOUSNEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ýCircuit Cellar, the Magazine for Computer Applications. Posted with permission.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ