SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
BQ25896Adc.hpp File Reference

@license MIT License More...

#include "../../PmicAdcBase.hpp"
#include "BQ25896Core.hpp"
Include dependency graph for BQ25896Adc.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  BQ25896Adc
 

Detailed Description

@license MIT License

Copyright (c) 2026 lewis he

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
Lewis He (lewis.nosp@m.he@o.nosp@m.utloo.nosp@m.k.co.nosp@m.m)
Date
2026-04-09

BQ25896 ADC (Analog-to-Digital Converter) Module Interface

This class provides access to the BQ25896's integrated 10-bit ADC for monitoring various system parameters including battery voltage, system voltage, VBUS voltage, charge current, and NTC (Negative Temperature Coefficient) thermistor readings.

Channels

The BQ25896 ADC supports the following measurement channels:

  • VBUS_VOLTAGE: USB input voltage (2600-15300mV, 100mV resolution)
  • BAT_VOLTAGE: Battery voltage (2304-4608mV, 20mV resolution)
  • VSYS_VOLTAGE: System voltage (2304-3700mV, 20mV resolution)
  • BAT_CURRENT: Charge current (0-6350mA, 50mA resolution, requires charging)
  • BAT_TEMPERATURE: NTC thermistor (21%-80%, percentage, NOT temperature!)
  • DIE_TEMPERATURE: Thermal status flag (0=normal, 1=thermal regulation active)

Note About NTC Temperature

Warning
The BAT_TEMPERATURE channel returns NTC percentage, NOT temperature!

The ADC reads the NTC thermistor voltage as a percentage of REGN (the internal voltage reference used in the NTC divider circuit).

  • Formula: NTC/REGN = 21% + [TSPCT] * 0.465%
  • Range: 21% (cold) to 80% (hot)

This value cannot be directly converted to temperature without knowing:

  1. The NTC thermistor's Beta value (typically 3380, 3950, 4100, etc.)
  2. The pull-up resistor value in your specific battery pack circuit
  3. The REGN voltage which varies based on charger configuration

Different battery packs use different NTC specifications (e.g., 10kΩ at 25°C with different Beta values), so no universal conversion is possible.

To convert to temperature, you would need to use the Steinhart-Hart equation with parameters from your battery pack's specification sheet.

Channels

The ADC can operate in two modes:

  • One-shot mode: Single conversion on demand (default)
  • Continuous mode: Repeated conversions at 1Hz

ADC conversions are controlled via REG_PWR_ONOFF (0x02):

  • Bit 7 (CONV_START): Initiates ADC conversion
  • Bit 6 (CONV_RATE): Sets continuous mode if set, one-shot if clear
See also
BQ25896Adc.cpp for implementation details
BQ25896Regs.hpp for ADC register definitions and step values
BQ25896RegisterMap.md for detailed ADC specifications

Definition in file BQ25896Adc.hpp.