Site icon Homemade Circuit Projects

BQ24295 Smart Battery Charger IC with Boost + OTG

This BQ24295 IC is like a super smart charger chip. This one is not just for charging battery, but also doing many other jobs like boost converter, USB detection, power path control, and even OTG (host power supply). So we can say that this is a full battery charging and power management IC.

Let us try to understand everything about it slowly and deeply.

What BQ24295 Actually Does

Full Internal Block Idea

Basic Features Overview

FeatureDetails
Battery Support1-cell Li-Ion or Li-Polymer
Input Voltage3.9V to 17V (20V max abs)
Charging CurrentUp to 4A
Input DetectionUSB SDP/CDP/DCP or adapter
CommunicationI2C interface
Output Boost5V OTG boost from battery
SafetyOVP, UVLO, Thermal, Battery OTP
System Output4.36V max (for load power)
Charging AlgorithmCC-CV with termination
Package24-pin QFN

Pin Configuration (Important Pins)

Pin NameFunction
PMIDMain output pin for system load
VBUSInput for USB or adapter
BATBattery connection pin
OTGBoost enable (active high)
SDA/SCLI2C communication lines
STATStatus pin (charging/done/fault)
CECharge enable (low = ON, high = OFF)
TSBattery thermistor (NTC) input
PGPower good (low = OK)
REGNInternal 3.3V LDO output
ISETSets charging current using resistor
ILIMSets input current limit
SYSOutput to system load
GNDGround

How Charging Actually Works?

So this IC follows 3-stage charging algorithm:

  1. Pre-Charge Stage: If battery voltage is very low (<3V) then it first gives small current (like 10%) to bring battery safely up.
  2. Fast Charge (CC) Stage: Then once battery reaches 3V+ then it starts full constant current charging, as set by ISET resistor.
  3. Voltage Regulation (CV) Stage: After battery reaches around 4.2V then it slowly reduces current and maintains voltage. When current drops below ~10% of ISET value then it stops (terminates) charging.

This way battery stays safe and does not get overcharged.

Charging Current and Limit Settings

ParameterHow to Set
Charge CurrentSet by resistor at ISET pin: ICHG = K_ICHG / R_ISET (K = 890 by default)
Input Current LimitSet by resistor at ILIM pin: ILIM = K_ILIM / R_ILIM (K = 1.44k)
Termination Current~10% of fast charge current (auto)
Top-off VoltageUsually 4.2V (adjustable via I2C)

So for example if we use 890 ohms at ISET, then:
ICHG = 890 / 890 = 1A charging current

Charging Current and Limit Settings

OTG Boost Mode

Status Indications

Protections

I2C Control and Readings

Basic Application Circuit

Full Explanation of BQ24295 Application Circuit

VBUS Pin (Top Left)

PMID Pin

ILIM Pin

Formula is:

I_ILIM = K_ILIM / R_ILIM
Where K_ILIM = 1320 (typical value)
R_ILIM = 317 ohm
So, I_ILIM ≈ 1320 / 317 ≈ 4.16 A (but IC clamps to 1.5A max)

D+ / D- (USB Detection Pins)

SYS Pin

STAT Pin

I2C Pins: SDA, SCL

INT Pin

CE Pin (Charge Enable)

SW / BTST / REGN / PGND Section (Right Side Buck Converter)

BAT Pin (Battery Terminal)

QON Pin

TS Pin (Temperature Sense)

Thermal Pad

Summary of Capacitors and Inductors

ComponentValuePurpose
C120 µFOutput bulk filter on PMID
C21 µFVBUS input decoupling
C347 nFBootstrap capacitor (BTST)
C44.7 µFREGN decoupling
C510 µFBattery output filter
C6, C710 µFSYS output stability
L12.2 µHBuck inductor for charger loop

Important Calculations

ILIM Resistor Formula:

R_ILIM = K_ILIM / I_LIMIT
Where K_ILIM ≈ 1320
Example: I_LIMIT = 1.5 A
R_ILIM = 1320 / 1.5 ≈ 880 ohms

Thermistor Divider Thresholds:

For 10k NTC and default charge range (0°C to 45°C):

V_TS = V_REGN * [RTH / (RT1 + RTH + RT2)]

So design RT1, RT2 for proper window.

What You Can Do with This BQ24295 Battery Charger Circuit

Now, in the next section I am giving you the full Arduino code for I2C communication with BQ24295, along with the complete connection details and how the wiring is supposed to go.

Full Circuit Connections for BQ24295 with Arduino

Here is how we connect everything step-by-step:

BQ24295 PinConnects ToNotes
VBUS+5V from USB / AdapterPower input for charging
GNDArduino GND & Battery GNDCommon ground
BATPositive of 3.7V Li-ion cellDirect battery terminal
SYSOutput to load (Arduino Vin)Can be used to power Arduino if battery available
SCLArduino A5 (I2C Clock)Add 4.7k or 10k pull-up to 3.3V
SDAArduino A4 (I2C Data)Add 4.7k or 10k pull-up to 3.3V
TSNTC thermistor or fixed dividerOptional, can use voltage divider for fake NTC
STATLED (with 1k) or Arduino input pinShows charge/fault status
OTGOptional switch or Arduino pinTo enable OTG 5V boost mode
ILIM, ISETResistors to GND as per charging current requirementICHG = 890/R (R in kΩ)
CEConnect to GND to enable chargingOr control using Arduino pin (LOW = enable)

Important: This IC is 3.3V logic so if your Arduino is UNO (5V), then use level shifter or resistive divider for SDA/SCL.

Arduino Code for Reading BQ24295 Registers via I2C

#include <Wire.h>

// I2C Address of BQ24295
#define BQ24295_ADDR 0x6B  // Default I2C address

// Register map (only few important ones shown)
#define REG_STATUS     0x0B
#define REG_FAULT      0x0C
#define REG_INPUT_SRC  0x00
#define REG_POWER_ON   0x01
#define REG_CHG_CTRL_0 0x04

void setup() {
  Serial.begin(9600);
  Wire.begin();  // Join I2C bus

  delay(1000);
  Serial.println("Starting BQ24295 Monitor...");

  // Optional: Configure input current limit
  writeRegister(REG_INPUT_SRC, 0b00010000); // Set 500mA input limit

  // Optional: Enable charging manually (if CE is tied to logic)
  writeRegister(REG_POWER_ON, 0b00011011);  // Default safe config
}

void loop() {
  // Read and display charger status
  byte status = readRegister(REG_STATUS);
  byte fault = readRegister(REG_FAULT);

  Serial.print("Charger Status: ");
  decodeStatus(status);

  Serial.print("Fault: ");
  decodeFault(fault);

  delay(2000);
}

byte readRegister(byte reg) {
  Wire.beginTransmission(BQ24295_ADDR);
  Wire.write(reg);
  Wire.endTransmission(false);  // Restart for reading
  Wire.requestFrom(BQ24295_ADDR, 1);

  if (Wire.available()) {
    return Wire.read();
  } else {
    return 0xFF;
  }
}

void writeRegister(byte reg, byte val) {
  Wire.beginTransmission(BQ24295_ADDR);
  Wire.write(reg);
  Wire.write(val);
  Wire.endTransmission();
}

void decodeStatus(byte data) {
  byte chg_stat = (data >> 4) & 0x03;

  switch (chg_stat) {
    case 0: Serial.println("Not Charging"); break;
    case 1: Serial.println("Pre-Charging"); break;
    case 2: Serial.println("Fast Charging"); break;
    case 3: Serial.println("Charge Terminated"); break;
  }
}

void decodeFault(byte data) {
  byte fault = data & 0x07;

  switch (fault) {
    case 0: Serial.println("Normal"); break;
    case 1: Serial.println("Input Fault"); break;
    case 2: Serial.println("Thermal Fault"); break;
    case 3: Serial.println("Battery Fault"); break;
    default: Serial.println("Unknown Fault");
  }
}

Resistor Selection (for ILIM and ISET)

Use following values for current setup:

ResistorPinFormulaExample
R_ILIMILIMI_ILIM = 1360 / R_ILIM (kΩ)For 1A, R = 1.36kΩ
R_ISETISETI_CHG = 890 / R_ISET (kΩ)For 1A, R = 0.89kΩ

Optional Additions

Important Formulas for Resistor Selection

Charging Current (I_CHG):

I_CHG = 890 / R_ISET (R in k-ohms, I in Amps)

For example:

Input Current Limit (I_INLIM):

I_INLIM = 1360 / R_ILIM (R in k-ohms)

For example:

Summary of What All It Can Do

Source: Datasheet

Exit mobile version