build lithium ion battery

Not rated 27,099

Circuit Image

The article describes the process of building a charger controller board and programming the AVR microcontroller. A Li-Ion battery is needed for practice; the example battery mentioned has withstood considerable abuse. Knowledge of the battery's specifications, such as maximum charge voltage and current (often printed on the case), thermistor presence (yes/no and resistance, which may not always be 10K), and whether it is a Smart Battery, is essential. A DC supply that can provide at least 2 volts above the maximum cell voltage (14.6 volts in this case) at the desired current is required. For the necessary capacities, a "Wall wart" power supply is insufficient. A Dell laptop supply rated at 18V @ 3.5A was used. The board is constructed using readily available components, as detailed in the parts list from the Atmel App Note. Some substitutions were made, and the schematic was updated accordingly. The ATMEGA8 microcontroller is a new release featuring 8K Flash and 1K RAM in a 28-pin narrow DIP package, capable of being clocked up to 16MHz. If the Smart Battery interface is removed and some debug code is deleted, the code could fit into an AT90S4433, as per the original Atmel design. The microcontroller software is based on GCC version 3.2, necessary for the direct I/O assignments resulting from the conversion from IAR used in Atmel's App Note. The software is a combination of Atmel's original code, converted from IAR, an I2C interface from 68HC11/Imagecraft, and additional custom GCC code. The program shows variations in style due to these multiple sources. Current and voltage control is achieved via a PWM output into a P-Channel MOSFET, with a large inductor/capacitor combination stabilizing the circuit. Special-purpose chargers typically operate at higher frequencies (150KHz compared to 15KHz), allowing for smaller components, although this is less critical in this setup. The charger provides a continuous data stream output via UART for connection to a PC, sending initialization and continuous charge status information, including data from a connected Smart Battery, which can be viewed on a PC terminal program. The baud rate is set at 115K but can be adjusted as needed. The charger was operational after a week of part-time work, with additional days spent on the Smart Battery interface and documentation. A foil grid board was utilized, with components spot soldered and wire-wrapped. Larger power wires were installed as necessary, and homemade wire-wrap pin labels were created using a printer. Although a printed circuit board would be suitable for this project, there is currently no incentive to create one since the board is functioning well. The microcontroller's physical design follows standard AVR conventions, using a 7.3 MHz crystal (the ATMEGA8 can support up to 16 MHz). An 8-point DIP switch is included for battery parameter selection, along with a variable resistor for setting charge current in "Custom" mode. A UART interface is present, but an RS-232 interface was not installed on the board due to the availability of a useful cable with a built-in MAX233. A heat sink has been attached to the HexFET, with the potential to handle 3.5 to 4 amps, although testing has been limited to 2.5 amps due to the lack of spare HexFETs. The App Note provides a comprehensive description of the circuit's functionality. Power components were mounted on the opposite end of the board from the microcontroller, with three separate grounds (microcontroller, analog, charger power) connected only at a single point. An op-amp circuit is utilized to measure battery voltage.

The charger controller board is designed to manage the charging of Li-Ion batteries effectively, integrating a microcontroller to handle various parameters and functionalities. The ATMEGA8 microcontroller acts as the core of the system, enabling programmable control over the charging process. The use of a PWM output for current and voltage control allows for precise management of the charging cycle, ensuring optimal battery performance and longevity.

The inclusion of a UART interface facilitates real-time communication between the charger and a connected PC, allowing users to monitor charging status and parameters easily. This feature is particularly beneficial for developers and engineers looking to analyze the charging process or troubleshoot issues. The choice of an 18V @ 3.5A power supply ensures that the system has sufficient headroom to handle the maximum charge voltage requirements, while the large inductor and capacitor combination provides stability, minimizing voltage fluctuations during operation.

To enhance the usability of the charger, the design incorporates an 8-point DIP switch for parameter selection, allowing users to tailor the charging settings to specific battery types and requirements. The variable resistor for setting charge current in "Custom" mode adds further flexibility, enabling users to optimize charging based on their specific needs.

The construction method, utilizing a foil grid board, demonstrates a practical approach to prototyping, allowing for easy modifications and adjustments during the development phase. The attention to detail in labeling and documentation enhances the project's overall quality, ensuring that users can replicate or modify the design as needed.

Overall, this charger controller board serves as a robust platform for managing Li-Ion battery charging, combining advanced microcontroller capabilities with user-friendly features and a flexible design approach.The article now describes how to build a charger controller board and how to program the AVR microcontroller. You should have a LiIon battery you can practice on - my practice battery is still alive and well despite considerable abuse.

The more you know about the battery the better: Maximum charge voltage and amps (sometimes printed on the case), thermistor (yes/no and resistance - they are not always 10K) and Smart Battery or not. In addition to the charge controller a DC supply capable of providing at least 2 volts more than the max cell voltage (14. 6 volts in my case) at the desired current is required. At the capacities I want you are out of the "Wall wart" category. I found a laptop supply for a Dell rated at 18V @3. 5A. The board is fabricated using easily obtainable components - refer to the parts list in the Atmel App Note.

I made some substitutions and marked the schematic up accordingly. The ATMEGA8 is a new release and has 8K Flash, 1K RAM in a 28 pin narrow DIP package and can be clocked up to 16MHz. If you are willing to eliminate the Smart Battery interface and delete some of the debug code the code could be made to fit in an AT90S4433 as per the original Atmel design.

The microcontroller software used is GCC version 3. 2. This version is required to accommodate the direct I/O assignments that resulted from the conversion from IAR that was used in Atmels App note. The software is actually a combination of Atmels, converted from IAR, an I2C interface, converted from 68HC11/Imagecraft and my own GCC code.

As a result the program does not read as well as I am used to as 3 different styles are evident. The current / voltage control is managed by a PWM output into a P-Channel MOSFET. A large inductor / capacitor combination is used to stabilize the circuit. The special purpose chargers generally run at much higher frequencies ( 150KHz compared to 15KHz) and can thus use smaller components, not that important in my case. The charger provides a continuous data stream output from the UART for your PC. I send initialization info and continuous charge status information from the charger, and, if a Smart Battery is connected, the battery, that can be viewed on a PC terminal program.

Baud rate is set at 115K but could be lowered as desired. The charger was operational after a weeks part time effort, another few days were spent on the Smart Battery interface and a couple more to document the whole thing. I use a foil grid one side board with foil down. I spot solder most components to the grid and use wire-wrap to wire it up. This board had a requirement for larger power wire which was installed where needed. Notice from the photo that I use homemade wirewrap pin labels - I print them on the printer and push them down over the pins.

Works quite well. I also print out top of board ID labels. This project would be a good candidate for a printed circuit board - I just don`t have any incentive now that my board is working. The microcontroller physical design is pretty much a standard AVR design. A 7. 3 MHz crystal is used (the ATMEGA8 can take up to 16 MHz). I added an 8 point dip switch for battery parameter selection and a variable resistor for setting Charge current in "Custom" mode.

I include a UART interface but did not install the RS-232 interface on the board as I have a very useful cable with a MAX233 built in. You can see from the photo that I have attached a heat sink to the HexFET. I suspect I could get up to 3. 5 to 4 amps without problems with this setup. So far I`ve held back to 2. 5 amps as I have no spare HexFETs in house and don`t feel like doing destructive testing. Read the App note for a good description of how this circuit works. I mounted the power components on the opposite end of the board from the uC and kept three separate grounds (uC, analog, charger power) connected only at a single point.

The op amp circuit used to measure battery voltag 🔗 External reference