Building a Li-Pol battery charger using GreenPAK -

Building a Li-Pol battery charger using GreenPAK


The market for specialized ICs designed for Li-Pol batteries charging is mature, offering the right option for every application. Available ICs are feature rich, high performance, programmable, low power, and competitively priced. Few alternatives can compete with specialized ICs for the specific applications those IC target. Nevertheless, the feature set of specialized ICs is still limited and fixed.

The Silego GreenPAK is a programmable mixed-signal device that offers an alternative solution for applications requiring specific functions not available in specialized ICs. The circuitry in GreenPAK that is unused in the charger circuit can be utilized in those applications to implement such specific functions. Functions could be directly related to battery charging process or closely related functions like power source selection, load control and similar, but may just as well be completely independent hardware functions of the target device. This article does not cover the charging of all configurations and capacities of Li-Pol batteries, but GreenPAK ecosystem offers the right solution to cover all of them with appropriate design.

Li-Pol Battery Charging Process

A single cell lithium-ion polymer (Li-Pol) battery is charged in two stages: constant current (CC) and constant voltage (CV). During the constant current phase, the charger applies a constant current to the battery at a steadily increasing voltage, until the voltage limit per cell is reached. During the constant voltage phase, the charger applies a voltage equal to the maximum cell voltage in series to the battery, as the current gradually declines towards 0, until the current is below a set threshold of about 10% of initial constant charge current.

Li-Pol batteries are available in single cell, two-cell and multi-cell configurations with single cell as the common option in the mass market. Single cell LiPo chargers are integral part of battery powered electronic devices like cell phones and IoT products, together with the Li-Pol battery itself. Common options to power the charger are regulated +5 Volt power sources like USB power, AC wall adapter etc. Some chargers provide multiple input options and automatic power source selection.

Besides the main CC and CV charging stages, other stages include preconditioning, top off and maintenance. Preconditioning is needed when charging deeply discharged batteries. Such batteries are charged with low current (10% of full rate charge current) until battery voltage reaches 3.0V. Timed top off stage continues to charge the battery to provide optimal battery capacity following a complete charge cycle. During this cycle, charging terminates when ICHG reaches 2.5% of the full-rate charge current or when TTOPOFF times out, whichever occurs first. Once the top off stage is completed, maintenance mode monitors battery voltage and if the voltage drops below 4.0V a new charge cycle is initiated. Stages and transitions are presented in the figure 1 showing the different voltages associated with each state/state transition.

Figure 1. Li-Pol Battery Charging Process

Charging Circuits

There are three main topologies for the charging circuit: switch-mode, linear, and pulse. The major difference between these topologies is the size and cost vs. performance tradeoff they offer. Linear charger is simpler, easier to control and requires a minimum of external components but has low efficiency and may need additional board area to dissipate the heat generated by the charger's pass transistor. Switchmode charger exhibits high efficiency at small size, but also exhibits ripple, spikes, noise and EMI issues, it is more complex to control and requires a passive output LC filter. The pulse charger operates efficiently as the dissipated power is much lower than that of a linear charger; It doesn't require an output LC filter, but it does require a current-limited power source.

Depending on the application, a complete charger may include various auxiliary circuits for features such as protection, input voltage monitoring, thermal monitoring/regulation, thermal protection/shutdown, battery presence detection, battery protection, start-up, and status indication/signaling, among others.

Specs and features

In this article, we focus on a single cell Li-Pol charger powered from a regulated +5 Volt supply such as a USB port power source. Since power source is regulated and voltage dropout is relatively low, linear charger circuit is a good design choice. To enable high charging currents, we select the design approach with GreenPAK as the control circuit and external “power” circuit. In this design, the GreenPAK acts as a Li-Pol charge management controller.

The desired features for this design include:

  • Full rate charge current programmed through an external resistor allowing charge currents up to 2500mA (Currents greater than 2500 mA can be achieved by replacing current sense resistor.)

  • High Accuracy Preset Voltage Regulation: 2V ± 0.75%, Settable to: 4.25V, 4.35V, 4.38V

  • Built-in Multiple Safety Timers

  • Charge Status Indication

  • Continuous Over-current Protection

  • Near-depleted Battery Pre-conditioning Settable to: 10%, 20%, 40% ICHG or Disable

  • Maintenance Mode with Automatic Recharge

  • End-of-Charge Control Settable to 5%, 10%, 15% or 20% ICHG

  • Battery presence detection

  • Bad battery detection and indication

Power Circuit
A logic level PMOS transistor is used as a pass transistor, enabling direct drive from low power opamp SLG88102V. Precision shunt resistor enables high side current sensing, conditioned and translated to ground reference using simple current mirror opamp circuit. Standard precision reference TL431B is used to set the output voltage. Circuit is designed as current limited voltage regulator and no control action is necessary for CC/CV stage transition. LED indicators are driven directly from the GreenPAK.

Output voltage 0.75% accuracy is achieved thanks to TL431B (0.5%) and resistive divider with 0.1% precision resistors. If tighter tolerance is required, higher accuracy components might be applied to achieve it.

Current limit is set by the value of the resistor R2 in current mirror circuit, 100 ohms per Ampere. For example, for 2.5 Amps current limit, R2 = 250 ohms. Current sense resistor is 0.1Ω and voltage drop is small enough for currents up to 2.5 Amps. Above that, current sense resistor value should be lower to reduce voltage drop, for example 0.05Ω. For current sense resistor other than 0.1Ω, current mirror resistor R2 must be recalculated: R2 = ICHG * Rcs / 1mA. When selecting current sense resistor, don’t forget to consider power rating.

Figure 2. GreenPAK based design schematic

For charging currents up to 500mA (battery capacity 500mAh) no heatsink is needed for the pass transistor because power dissipation is less than 1W. Above that current, pass transistor should be mounted on a heat sink to avoid overheating. Maximum power dissipation occurs at transition from preconditioning stage to full charge and makes roughly 1W per every 0.5Amps of charging current (6W @ 3Amps), worst case. For maximum temperature rise of ΔT and battery capacity Cb, heat sink thermal resistance must be less than Rhs = ΔT / (2*Cb/1000). For example, ΔT=20°C and Cb = 2500 mAh yields thermal resistance Rhs ≤ 20 / 5 = 4 °C/W.

Pay attention to the physical layout of the part of the circuit carrying high currents. Voltage regulation is disturbed by voltage drop on connecting wires and contacts. Make the connections as short as possible and use wire with cross-section to spare. If problems persist, use separate wires for voltage sensing.

GreenPAK Design

SLG46531V GreenPAK 5 is selected for the design because it offers Asynchronous State Machine Block and 4 analog comparators with abundant additional logic blocks. GreenPAK design modules include:

  1. Analog module with analog comparators for battery voltage and charging current,

  2. Control module based on GreenPAK ASM block

  3. Timing module

  4. Signaling module for light indicators control

  5. Interface module for I2C serial communication

Analog module

Li-Pol Battery charging requires tight battery measurements and small error budgets to work correctly and safely, and the accuracy of GreenPAK analog comparators is not sufficient for GreenPAK to regulate the output voltage on its own. External components are necessary to minimize the error budget: voltage reference, voltage divider and low offset operational amplifier.

Current measurements are not nearly as critical as battery voltage measurements, and the same goes for voltage thresholds for stage transitions. GreenPAK comparators are fully up to those tasks and no external components are necessary.

To control Li-Pol charging profile, at least 2 thresholds have to be implemented:

1a) preconditioning threshold (battery voltage at 3V)

2a) end-of charge threshold (charging current at 10%)

For additional charger functions: battery detection, maintenance mode / automatic recharge and top off mode, 3 more thresholds are needed:

1b) battery detection (output voltage over 4.5V)

2b) recharge threshold (battery voltage below 4.0V)

3b) end-of-topoff threshold (charging current at 2.5%)

Since SLG46531 has only 4 comparators, 5th threshold for top off stage is realized by scaling the current sense signal once EOC is detected during top off stage. The current sense signal switches off additional resistor, decreasing the ratio of the current sense resistive divider, thus increasing the current sense signal at GreenPAK input pin. Since the comparator threshold remains unchanged, charging current needs to decline further, to reach the new threshold.

To avoid noise triggering issues, all comparators are programmed for small 25mV hysteresis.

Battery detection is based on weak pullup resistor on the voltage sense input (VS pin). If no battery is connected, pullup resistor will raise the voltage on comparator input to positive supply (5V), above the max limit of regular Li-Pol battery. When battery is connected, it will define the voltage at VS pin, small pullup current will not affect it.

Control Module based on GreenPAK ASM Block

The implementation of the control circuit is based on the state machine functionality of the GreenPAK. Out of 8 available states, 6 are used to capture the relevant states of the battery/charger.

Figure 3. GreenPAK states and signals

2-bit and 3-bit LUT blocks are applied to form control signals for ASM state transitions.

Out of 8 available ASM outputs, 6 are used for state signals, one for current limit level and one for blocking the charger.

State signals are named with ST_ prefix and further used in timing and signaling modules. They are active “1” when ASM is in the relevant state / charger in the relevant stage.

FRCHG signal sets the current limit to full rate. It is active in charging and top off stages.

Block signal overrides the external circuit control loop and closes the pass transistor thus stopping the charger. It is active in all states except charging states: preconditioning, charging and top off.

Control module can be stopped on I2C command or by pulling down “Enable” pin. “Enable” pin is with 100K pullup so the charger is enabled by default.

Enable/disable signals from I2C block control opening the LUT gates thus enabling I2C control of the ASM transitions. I2C control signals:

ASM design

Three main states cover the three charging stages: preconditioning, charging and top off, while other states control no-charging periods. Initial ASM state is “No battery” because the charger may be powered while no battery is connected to charger output. When a battery is connected, the circuit will automatically detect battery presence and start charging. If the battery is not deeply discharged, the battery voltage will already be higher than 3.0V and ASM will immediately switch to full rate charging stage, otherwise that transition will happen later. If preconditioning stage or charging stage lasts too long, relevant timer will set ASM to “Bad battery” state. Once in this stage, the bad battery status may only be cleared by removing the input power source or by external command (I2C command “Disable charger” or pulling down the “Enable” pin).

Figure 5. GreenPAK states and transitions

Timing module  

Timing module includes clock circuitry that generates pulse clocks at second and minute intervals. Seconds clock is used for light indication, while minute clock is used for safety timers.

Safety timers range from minutes to hours, so CNT/DLY blocks are used to implement timers for relevant stages, supplied by low frequency minute clock. Minute clock is generated by dividing 25kHz internal OSC frequency using two cascaded CNT/DLY blocks, with first block forming the 1Hz (second) clock and the second block forming 1/60Hz (minute) clock.

Timer starts upon relevant ASM output signal and asserts its output (TPREC, TCHG or TTOP) on timer expiry.

Duration of safety timers is programmable by setting the counter values of relevant CNT/DLY blocks via I2C block. Values are in minutes. Available range for preconditioning and top off timer is 8-bit (1 to 255) and for charging timer 16-bit (1 to 65535). Default values are shown in the following table:

Indication and signaling module

The Charger is equipped with two LED diodes to indicate the status and operation of the device.

Green LED “Charging” indicates all three charging states using pulse codes:

  • short pulses: preconditioning stage

  • 50:50 pulses: full rate charging stage

  • long pulses (inverted short): top off stage

  • on: maintenance mode (battery full)

  • off: no battery

Figure 7. GreenPAK charging states

Red LED “Bad battery” indicates error status. Battery attached is unusable or can’t be fully charged. This indicator will also activate if, for example, a resistor is attached to the output instead of battery.

Charging indication is implemented using one CNT/DLY block and 3-bit LUTs . CNT/DLY block is used to make symmetrical 50:50 signal from the 1Hz (second) clock, needed for indication of full rate charging mode. LUTs select the indication mode based on ASM state.

Interface module

Interface module is based on GreenPAK I2C communication feature. It enables external signaling, for example with an MCU or single board computer. Signaling enables programming charger parameters, controlling charger operation and monitoring the charging process.

Programmable parameters: timer durations, enable/disable preconditioning stage, enable/disable top off stage, output voltage (4.2V, 4.25V, 4.35V, 4.38V), set preconditioning current level (10%, 20%, 40% ICHG), set end-of-charge threshold (5%, 10%, 15% or 20% ICHG)

Charger control: enable/disable charger, stop/block charging, reset ASM (charger)

Monitoring status: charger status by reading ASM state/output, stage duration by reading relevant timer (counter), pin status, readback current settings.


Main characteristics of the charger circuit are shown in the table below.


Testing GreenPAK Design

The GreenPAK Emulation Tool included in the GreenPAK Designer Development Suite was used to test the CMIC design. Analog signal generators were used to simulate voltage and current sense inputs.

Custom signals were designed to cover all stages of regular charging profile. Battery charging is a long process, so to enable efficient testing, each stage simulated duration is 10 seconds. That is enough time to check relevant control signals and still one full test cycle is less than 2 minutes long.

I2C tools are used to check internal signal states like ASM outputs, analog comparator outputs as well as the states of internal counters.

Control signals generated by GreenPAK circuit are accessible on test pins of GreenPAK Universal Development Board.

Final Testing

For the purpose of final testing, the power circuit is assembled on a breadboard and connected to GreenPAK Universal Development Board using patch wires (see figure below).

External LEDs are not wired on the breadboard because LEDs are already available on the GreenPAK Development Board. Test battery is flat Li-Po battery 2400mAh 3.7V manufactured in China. Current mirror resistor is set to 250Ω limiting the full rate charge current ICHG to 2.4Amps. End-of-charge current is set to 10% ICHG.Timers are set to default values: preconditioning 30 min, charging 5 hours, top off 30 min.

Before starting the test, battery is discharged using 2Ω resistor. Battery has built-in overdischarge protection and when the voltage falls below 2.5V, it switches off to high impedance state. Because of built-in protection, it was not possible to deplete the battery in order to test preconditioning feature of the charger.

At the beginning of the test, battery voltage is below 3V and the charger is plugged into the power source. Connecting the battery to the charger triggers the transition from the no battery state to the preconditioning stage. As soon as the battery is connected to the charger, battery voltage raises above 3.0V and the charger transitions to charging stage and the charging current is limited to full rate current ICHG. Preconditioning stage is too short to be seen in the graph below.

During the charging process, the green LED indicates the charging stages. Battery voltage and charging current are measured and shown on the following graph. Constant current stage lasts about 15 minutes and constant voltage stage more than 2 hours. CC to CV timing ratio may be altered by adjusting the gain of voltage error amplifier, the higher the gain the longer CC stage.

Once the charging current falls below end-of-charge threshold, the charger switches off the pass transistor and goes into maintenance mode. The charging current falls to zero and battery voltage slightly falls for a while as a result of processes inside the battery but stabilizes after a couple of minutes.

1 thought on “Building a Li-Pol battery charger using GreenPAK

  1. “An excellent article Vladimir. Not only the circuit, techs and calcs for contemporary battery charging but a great tutorial for incorporating Green PAK PLAs. Maybe a future challenge is to reduce the electronics outside the GreenPAK device? Keep up the go

    Log in to Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.