The battery charger application easily allows adding battery charging functionality to portable applications. Since it is very compact – uses less than 2k words of program space and less than 128 bytes of RAM – it fits on small, cost-effective parts like the 14-pin PIC16F616. The basic charger has a single power source in a buck converter configuration with current feedback. To charge both batteries, it switches between the batteries every second. When a battery is active, its voltage and current readings are updated then the state machine uses the readings to decide the next step in the charging process. If debugging is enabled, the readings are sent to the PC for logging. The average current received by each battery is the current set value divided by the number of slots.
The NiMh battery cell has become widespread in many high-end portable electronic products where battery performance is a major consideration. First adoption of the nickel-metal hydride cell had occurred in the cellular phone and portable computer markets. Currently, most portable electronics are powered by either nickel-metal hydride or Li-Ion batteries. As production volume increased, the metal hydride cells have replaced nickel-cadmium cells in most applications with a few possible exceptions in specialty niches.
The technology for metal hydride cells is essentially an extension of the sealed NiCd rechargeable battery technology. The negative cadmium-based electrode is substituted by a hydrogen-absorbing alloy. This substitution increases the cell electrical capacity for the same weight and volume and eliminates heavy metal toxicity concerns while the rest of the metal hydride cell is quite similar to the cadmium-based product. Exchanging the cell types in a design usually involves a few significant design changes.
The negative electrode of a metal hydride cell is constructed from a special hydrogen-absorbing alloy. This alloy can absorb as much as 1000 times its own volume in hydrogen gas which allows it to become a metal hydride. The alloy can also reversibly release the gas it has stored. Different manufacturers have developed many hydrogen-absorbing alloys used in lifepo4 battery manufacturing.