SparkFun INA2XX Arduino Library  v1.0.0-3-gc9007d6
Arduino Library for the SparkFun Qwiic Power Monitor (INA228 / INA237)
Loading...
Searching...
No Matches
sfDevINA228.cpp File Reference

Implementation file for the SparkFun INA228 high-precision power monitor driver. More...

#include "sfDevINA228.h"

Detailed Description

Implementation file for the SparkFun INA228 high-precision power monitor driver.

This file implements the INA228-only features: the 40-bit energy/charge accumulator reads. Calibration, the shared measurement methods, and the device-identity check are inherited from the sfDevINA2XX base template (see sfDevINA2XX.h), instantiated with the INA228 raw register types (int32_t / uint32_t).

INA228 ADC Details:

  • 20-bit delta-sigma ADC
  • VSHUNT/VBUS/CURRENT registers are 24 bits wide; data is in bits [23:4], lower 4 reserved
  • POWER register is 24 bits wide, all bits used (unsigned)
  • ENERGY register is 40 bits wide (unsigned)
  • CHARGE register is 40 bits wide (two's complement)
  • Shunt LSB: 312.5 nV (ADCRANGE=0) or 78.125 nV (ADCRANGE=1)
  • Bus LSB: 195.3125 uV
  • Temp LSB: 7.8125 m-deg-C
  • Calibration scale: 13107.2 x 10^6 (x4 for ADCRANGE=1)
Author
SparkFun Electronics
Date
June 2026

SPDX-License-Identifier: MIT

See also
https://github.com/sparkfun/SparkFun_INA2XX_Arduino_Library