lamaPLC: INA modules with Arduino libraries

Several INA series ICs have excellent Arduino support, with libraries provided by Adafruit and the community. The following table summarizes the most popular models and their technical specifications

IC ModelADC Res.Max Bus VoltageShunt Voltage RangePGAAlert PinCommunicationArduino LibraryKey Functionality
INA21912-bit26V±40,±80, ±160,±320 mVYes (1, 2, 4, 8)NoI²C/SMBusAdafruit_INA219Basic current, voltage, and power monitoring.
INA22616-bit36V±81.92 mVNoYesI²C/SMBusINA226 (Rob Tillaart)High precision; monitors current, voltage, and power.
INA22820-bit85V±163.84.92 mVNoYesI²C/SMBusINA228 (Rob Tillaart)Ultra-high precision; includes energy and charge accumulation.
INA23716-bit85V±163.84.92 mVNoYesI²C/SMBusAdafruit_INA237High voltage support (up to 85V) for current and power.
INA23816-bit85V±163.84.92 mVNoYesI²C/SMBus-High voltage support (up to 85V) for current and power.
INA26016-bit36VIntegrated ShuntNoYesI²C/SMBusAdafruit_INA260Built-in 2m shunt; supports up to 15A continuous.
INA322113-bit26V±163.84.92 mVNoYesI²C/SMBusAdafruit_INA32213-Channel monitoring of voltage and current.

INA219: digital current, voltage, and power monitor with I²C communication

INA219 The INA219 is a digital current, voltage, and power monitor with an I²C- or SMBUS-compatible interface. It is primarily used for high-side current sensing but can also be configured for low-side sensing.

INA219: Key Specifications

  • Bus Voltage Range: Senses from 0V to 26V.
  • Supply Voltage: Operates on a single 3V to 5.5V supply.
  • Current Draw: Maximum of 1 mA.
  • Accuracy: Up to 0.5% maximum over temperature (for the B-grade version).
  • Interface: I²C/SMBUS with 16 programmable addresses via A0 and A1 pins.
  • ADC Resolution: Integrated 12-bit ADC.
  • Temperature Range: Operates from –40°C to 125°C.

INA219: Pin Description

INA219

PinNameTypeDescription
1VCCPowerSupply Voltage: Powers the chip (3.0V to 5.5V).
2GNDPowerGround: Common ground for the sensor and logic.
3SCLDigital I/OI²C Clock: Serial clock line for communication.
4SDADigital I/OI²C Data: Serial data line for communication.
5V+
(IN+)
Analog InputPositive Shunt: Connect to the power source side.
6V-
(IN-)
Analog InputNegative Shunt: Connect to the load side.
7A0Digital InputAddress 0: Connect to GND, VS, SDA, or SCL to set I²C address.
8A1Digital InputAddress 1: Connect to GND, VS, SDA, or SCL to set I²C address.

Important Considerations

  • Maximum Limits: Do not exceed 26V or 3.2A, or the shunt resistor might be damaged.
  • I²C Address: The default address is 0x40. You can bridge solder pads on the board to change it to 0x41, 0x44, or 0x45 to use multiple sensors.
  • Negative Current Readings: If current reads negative, you have swapped the Vin+ and Vin- connections.
  • Precision: If measuring very low currents, increase sensitivity by changing the Gain using ina219.setCalibration_16V_400mA().

Standard Breakout Board Address Table

The INA219 current sensor has a base I2C address of 0x40. Most breakout boards, like those from Adafruit, feature two address jumpers (A0 and A1) that allow you to set up to four unique addresses by bridging them with solder.

AddressA1 JumperA0 JumperDescription
0x40OpenOpenDefault address
0x41OpenClosedBridge A0
0x44ClosedOpenBridge A1
0x45ClosedClosedBridge A0 and A1

INA219 Arduino example code

#include <Wire.h>
#include <Adafruit_INA219.h>
 
Adafruit_INA219 ina219;
 
void setup(void) {
  Serial.begin(115200);
  if (!ina219.begin()) {
    Serial.println("Failed to find INA219 chip");
    while (1);
  }
  // Optional: Set calibration for higher precision (e.g., 32V 1A)
  // ina219.setCalibration_32V_1A();
}
 
void loop(void) {
  float shuntvoltage = 0;
  float busvoltage = 0;
  float current_mA = 0;
  float loadvoltage = 0;
  float power_mW = 0;
 
  shuntvoltage = ina219.getShuntVoltage_mV();
  busvoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  power_mW = ina219.getPower_mW();
  loadvoltage = busvoltage + (shuntvoltage / 1000);
 
  Serial.print("Load Voltage:  "); Serial.print(loadvoltage); Serial.println(" V");
  Serial.print("Current:       "); Serial.print(current_mA); Serial.println(" mA");
  Serial.print("Power:         "); Serial.print(power_mW); Serial.println(" mW");
  Serial.println("");
  delay(1000);
}

INA226: current/voltage/power monitor with I²C communication

INA226 36V, 16-bit, ultra-precise i²c output current/voltage/power monitor w/alert

The INA226 is a current shunt and power monitor with an I²C or SMBUS-compatible interface. It monitors both a shunt-voltage drop and the bus supply voltage. Programmable calibration values, conversion times, and averaging, combined with an internal multiplier, enable direct readouts of current in amperes and power in watts.

The INA226 is a current shunt and power monitor with an I²C or SMBUS-compatible interface. The device monitors both a shunt voltage drop and bus supply voltage. Programmable calibration value, conversion times, and averaging, combined with an internal multiplier, enable direct readouts of current in amperes and power in watts. The INA226 senses current on the common-mode bus, which can range from 0V to 36V, independent of the supply voltage. The device operates from a 2.7V to 5.5V supply, drawing a typical supply current of 330 μA. The device is specified for an operating temperature range of –40°C to 125°C and features up to 16 programmable addresses via an I2C-compatible interface.

The INA226 supports the fast mode (1 kHz to 400 kHz) and high-speed mode (1 kHz to 2.94 MHz) transmission protocols. All data bytes are transmitted in most significant byte-first order.

INA226: Features

  • Senses Bus Voltages: 0 V .. 36 V
  • Shunt Voltage Maximum: 81.9 V
  • Current Maximum: 20 A
  • High-Side or Low-Side Sensing
  • Reports Current, Voltage, and Power
  • High Accuracy:
    • 0.1% Gain Error (Max)
    • 10 μV Offset (Max)
  • Configurable Averaging Options
  • 16 Programmable Addresses
  • Operates from 2.7V to 5.5V Power Supply
  • 10-Pin, DGS (VSSOP) Package

INA226

If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.

Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.

2026/02/14 22:38

INA226

INA226 Pin Description

INA226

Pin NameDescription
V+ / VSPower Supply: 2.7V to 5.5V for the chip's own logic
GNDGround: Reference point for power and I²C
SCLI²C Clock: Connect to the microcontroller's SCL pin
SDAI²C Data: Connect to the microcontroller's SDA pin
VBUSBus Voltage Input: Connect this to the high-side or load-side to measure the actual bus voltage (up to 36V)
IN+Shunt Positive: Connect to the supply side of the external shunt resistor
IN-Shunt Negative: Connect to the load side of the external shunt resistor
A0 & A1Address Pins: Used to set the I²C address by tying them to GND, VS, SDA, or SCL
ALERTProgrammable Alert: Open-drain output that can trigger on over/under voltage or current thresholds

Typical Wiring (High-Side Sensing)

  • V+ and GND: Connect to your microcontroller's 3.3V or 5V power and ground.
  • SDA and SCL: Connect to your microcontroller's I²C pins.
  • IN+ and IN-: Place the shunt resistor in series with your load's positive line. Connect IN+ before the resistor and IN- after it.
  • VBUS: Connect this pin to IN- (load side) for standard high-side power monitoring.

INA226 I2C Address Table

The Texas Instruments INA226 supports up to 16 unique I²C addresses. The address is set by connecting the two address pins (A0 and A1) to one of four possible points: GND, VS (power supply), SDA, or SCL.

The default address is 0x40 (when both pins are connected to GND).

A1 PinA0 PinHex Address
GNDGND0x40
GNDVS0x41
GNDSDA0x42
GNDSCL0x43
VSGND0x44
VSVS0x45
VSSDA0x46
VSSCL0x47
SDAGND0x48
SDAVS0x49
SDASDA0x4A
SDASCL0x4B
SCLGND0x4C
SCLVS0x4D
SCLSDA0x4E
SCLSCL0x4F

INA226 Arduino wiring

  • VCC/VSS → Arduino 5V (or 3.3V)
  • GND → Arduino GND
  • SDA → Arduino SDA (A4 on Uno)
  • SCL → Arduino SCL (A5 on Uno)

INA226 Arduino example code

In the Arduino IDE, go to Tools > Manage Libraries, search for “INA226_WE”, and install the version by Wollewald.

This sketch initializes the sensor at the default address (0x40) and prints current, voltage, and power to the Serial Monitor.

#include <Wire.h>
#include <INA226_WE.h>
 
#define I2C_ADDRESS 0x40
 
INA226_WE ina226 = INA226_WE(I2C_ADDRESS);
 
void setup() {
  Serial.begin(9600);
  Wire.begin();
 
  // Initialize INA226
  if (!ina226.init()) {
    Serial.println("Failed to find INA226 chip. Check wiring!");
    while (1);
  }
 
  /* 
     Optional: Calibrate for your shunt. 
     The default is usually 0.1 Ohm. 
     Parameters: (Shunt value in Ohms, Max expected current in Amps)
  */
  ina226.waitUntilConversionCompleted(); 
  Serial.println("INA226 Ready!");
}
 
void loop() {
  float shuntVoltage_mV = 0.0;
  float loadVoltage_V = 0.0;
  float busVoltage_V = 0.0;
  float current_mA = 0.0;
  float power_mW = 0.0;
 
  // Read values
  ina226.readAndClearFlags();
  shuntVoltage_mV = ina226.getShuntVoltage_mV();
  busVoltage_V = ina226.getBusVoltage_V();
  current_mA = ina226.getCurrent_mA();
  power_mW = ina226.getBusPower_mW();
  loadVoltage_V  = busVoltage_V + (shuntVoltage_mV / 1000);
 
  // Print results
  Serial.print("Bus Voltage:   "); Serial.print(busVoltage_V); Serial.println(" V");
  Serial.print("Current:       "); Serial.print(current_mA); Serial.println(" mA");
  Serial.print("Power:         "); Serial.print(power_mW); Serial.println(" mW");
  Serial.println("---------------------------");
 
  delay(2000);
}

INA228: ultra-precise, high-resolution digital power, energy, and charge monitor with an I²C interface

INA228

The INA228 is an ultra-precise, high-resolution digital power, energy, and charge monitor with an I²C interface. It is significantly more advanced than the INA219 or INA226, featuring a 20-bit ADC and a common-mode voltage range of –0.3V to +85V.

Key Specifications

  • ADC Resolution: 20-bit delta-sigma ADC for high-precision measurements.
  • Bus Voltage: Supports 0V to 85V (more than double the INA226's 36V limit).
  • Measured Data: Reports current, bus voltage, temperature, power, energy, and charge accumulation.
  • Temperature Sensor: Integrated sensor with ±1°C accuracy for die temperature monitoring.
  • Precision: Very low offset voltage (±1 µV max) and low gain drift allow for micro-amp to kilo-amp sensing.
  • Interface: High-speed I²C (up to 2.94 MHz) with 16 programmable addresses via A0 and A1 pins.

INA228

INA228 Pin Description

Pin No.NameTypeDescription
1A1Digital InputAddress Pin: Connect to GND, VS, SDA, or SCL to set the I²C address.
2A0Digital InputAddress Pin: Works with A1 to configure one of 16 possible addresses.
3AlertDigital OutputOpen-drain Alert: Triggers on over/under voltage, current, or power limits.
4SDADigital I/OSerial Data: Bidirectional I²C/SMBUS data line.
5SCLDigital I/OSerial Clock: I²C/SMBUS clock input.
6VSPowerSupply Voltage: 2.7V to 5.5V to power the device.
7GNDAnalogGround: Common ground for the device.
8VBUSAnalog InputBus Voltage Input: Monitors the 0V to 85V bus voltage.
9IN–Analog InputNegative Shunt Input: Connect to the load side of the shunt resistor.
10IN+Analog InputPositive Shunt Input: Connect to the supply side of the shunt resistor.

INA228 Arduino example code

This sketch initializes the sensor and prints real-time power data to the Serial Monitor at 115200 baud.

#include <Adafruit_INA228.h>
// Initialize with default I2C address 0x40
Adafruit_INA228 ina228 = Adafruit_INA228();
 
void setup() {
  Serial.begin(115200);
  if (!ina228.begin()) {
    Serial.println("Failed to find INA228 chip");
    while (1) delay(10);
  }
  // Configure: Shunt Resistance = 0.015 Ohms, Max Expected Current = 10A
  ina228.setShunt(0.015, 10.0);
}
 
void loop() {
  Serial.print("Bus Voltage: "); Serial.print(ina228.getBusVoltage_V()); Serial.println(" V");
  Serial.print("Current: "); Serial.print(ina228.getCurrent_mA()); Serial.println(" mA");
  delay(1000);
}

INA237: is an ultra-precise, 16-bit digital power monitor with I²C communication

INA237 The INA237 is an ultra-precise, 16-bit digital power monitor designed for high-side or low-side current sensing in systems up to 85V. It is part of a modern family of sensors from Texas Instruments that includes the INA228 and INA238.

Key Specifications

  • Resolution: 16-bit precision delta-sigma ADC.
  • Bus Voltage Range: Monitors from 0V to 85V.
  • Common-Mode Range: Operates from –0.3V to +85V.
  • Interface: 2.94-MHz high-speed I2C with 16 programmable addresses.
  • Integrated Temperature Sensor: Provides die temperature readings with ±1°C accuracy.
  • Alert Feature: Features a fast 75 µs alert response for over/under limit detection.

INA237 Pin Description

The INA237 uses the same pinout as the INA228 and INA238, making them hardware-equivalent in many designs.

Pin No.NameTypeDescription
1A1Digital InputAddress Pin: Sets the I2C address (connect to GND, VS, SDA, or SCL).
2A0Digital InputAddress Pin: Used with A1 to select 1 of 16 addresses.
3AlertDigital OutputAlert Output: Open-drain pin for diagnostic reports or conversion-ready signals.
4SDADigital I/OSerial Data: Bidirectional data line for I2C communication.
5SCLDigital I/OSerial Clock: Clock input for I2C communication.
6VSPowerSupply Voltage: Powers the device (2.7V to 5.5V).
7GNDPowerGround: Common ground for both power and logic.
8VBUSAnalog InputBus Voltage: Sense input for monitoring the 0V to 85V bus voltage.
9IN–Analog InputNegative Shunt Input: Connect to the load side of the shunt resistor.
10IN+Analog InputPositive Shunt Input: Connect to the supply side of the shunt resistor.

INA237 Arduino example code

This code initializes the sensor and prints the Bus Voltage, Current, and Power to the Serial Monitor.

#include <Adafruit_INA237.h>
 
// Initialize sensor (Default address is 0x40)
Adafruit_INA237 ina237 = Adafruit_INA237();
 
void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10); // Wait for Serial Monitor
 
  Serial.println("Adafruit INA237 Test");
 
  if (!ina237.begin()) {
    Serial.println("Failed to find INA237 chip. Check wiring!");
    while (1) delay(10);
  }
 
  // --- CALIBRATION ---
  // setShunt(Shunt Resistance in Ohms, Max Expected Current in Amps)
  // Example: 0.1 Ohm resistor, 2 Amp max current
  ina237.setShunt(0.1, 2.0);
 
  Serial.println("INA237 Initialized.");
}
 
void loop() {
  // Read values from the sensor
  float voltage_V = ina237.getBusVoltage_V();
  float current_mA = ina237.getCurrent_mA();
  float power_mW = ina237.getPower_mW();
  float temp_C = ina237.getDieTemperature_C();
 
  // Print results
  Serial.print("Bus Voltage: "); Serial.print(voltage_V);  Serial.println(" V");
  Serial.print("Current:     "); Serial.print(current_mA); Serial.println(" mA");
  Serial.print("Power:       "); Serial.print(power_mW);   Serial.println(" mW");
  Serial.print("Temperature: "); Serial.print(temp_C);     Serial.println(" C");
  Serial.println("---------------------------------");
 
  delay(2000); // Wait 2 seconds between readings
}

INA238: Ultra-precise digital power monitor 16-bit delta-sigma ADC with I²C communication

INA238 The INA238 is an ultra-precise digital power monitor featuring a 16-bit delta-sigma ADC designed for high-side or low-side current sensing in high-voltage systems up to 85V.

Key Specifications

  • Common-Mode Range: Operates from –0.3V to +85V.
  • Precision: Features a maximum offset voltage of ±5 µV and a maximum gain error of ±0.1%.
  • Integrated Temperature Sensor: Integrated die temperature sensing with ±1°C accuracy.
  • ADC Settings: Selectable conversion times (50 µs to 4.12 ms) and sample averaging (1x to 1024x) to reduce noise.
  • High-Speed Interface: 2.94-MHz I²C interface supporting 16 programmable addresses via two pins (A0, A1).
  • Fast Response: Provides a 75 µs alert response for rapid limit detection.

INA238 Pin Description

Pin No.NameTypeDescription
1A1Digital InputAddress Pin 1: Sets the I²C address by connecting to GND, VS, SDA, or SCL.
2A0Digital InputAddress Pin 0: Used with A1 to select 1 of 16 possible I2C addresses.
3AlertDigital OutputAlert Output: Open-drain pin for over/under limit notifications or conversion-ready status.
4SDADigital I/OSerial Data: Bidirectional I²C/SMBUS data line.
5SCLDigital I/OSerial Clock: I²C/SMBUS clock input.
6VSPowerSupply Voltage: 2.7V to 5.5V input to power the device.
7GNDPowerGround: Common ground for the device.
8VBUSAnalog InputBus Voltage: Monitors the 0V to 85V bus voltage.
9IN–Analog InputNegative Shunt Input: Connect to the load side of the shunt resistor.
10IN+Analog InputPositive Shunt Input: Connect to the supply side of the shunt resistor.

INA238 Arduino example code

The INA238 uses the same 16-bit register structure as the INA237, so the code is nearly identical. You can use the Adafruit INA238 library for a quick setup.

#include <Adafruit_INA238.h>
 
// Create the sensor object (Default I2C address is 0x40)
Adafruit_INA238 ina238 = Adafruit_INA238();
 
void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10); // Wait for Serial Monitor
 
  Serial.println("INA238 Precision Power Monitor Test");
 
  // Try to initialize the chip
  if (!ina238.begin()) {
    Serial.println("Failed to find INA238 chip. Check wiring!");
    while (1) delay(10);
  }
 
  // --- CALIBRATION ---
  // setShunt(Shunt Resistance in Ohms, Max Expected Current in Amps)
  // Example: 0.1 Ohm resistor, 1.0 Amp max current
  ina238.setShunt(0.1, 1.0);
 
  Serial.println("INA238 Initialized successfully.");
}
 
void loop() {
  // Read sensor data
  float bus_v = ina238.getBusVoltage_V();
  float current_ma = ina238.getCurrent_mA();
  float power_mw = ina238.getPower_mW();
  float die_temp = ina238.getDieTemperature_C();
 
  // Print results to Serial Monitor
  Serial.print("Bus Voltage: "); Serial.print(bus_v);     Serial.println(" V");
  Serial.print("Current:     "); Serial.print(current_ma); Serial.println(" mA");
  Serial.print("Power:       "); Serial.print(power_mw);   Serial.println(" mW");
  Serial.print("Die Temp:    "); Serial.print(die_temp);   Serial.println(" C");
  Serial.println("------------------------------------");
 
  delay(1000); // 1-second update rate
}

Tips for the INA238

  • Precision: Because the INA238 has a very low offset (±5 µV), it is excellent for measuring very small currents. Ensure your shunt resistor value is entered accurately in the setShunt() function for the best results.
  • I²C Address: If you have changed the A0/A1 jumpers, pass the address to the begin function: ina238.begin(0x41).
  • Alert Pin: You can use the library to set high/low thresholds that trigger the physical Alert pin on the chip for over-current protection.

INA260: high-precision digital power monitor with I²C communication

INA260 The INA260 is a high-precision digital power monitor that stands out for its integrated precision shunt resistor. This makes it a “one-stop” solution for measuring current, voltage, and power without an external sense resistor.

Key Specifications

  • Integrated Shunt: Features a 2 mΩ resistor with 0.1% tolerance.
  • Current Range: Can handle up to ±15A continuous current.
  • Bus Voltage: Senses from 0V to 36V, independent of its own supply voltage.
  • Supply Voltage: Operates on 2.7V to 5.5V.
  • Accuracy: Offers a maximum system gain error of 0.15% and a 16-bit ADC for high-resolution data.
  • Interface: I²C/SMBus compatible with 16 programmable addresses via A0 and A1 pins.

INA260 Pin Description

Although the chip features 16 pins, many breakout boards simplify this layout. The original chip pinout includes several high-current pins, which help ensure low resistance and better heat dissipation.

Pin No.NameTypeDescription
1, 2, 3IN+Analog InputPositive Current Path: Connect to the supply for high-side sensing.
4A1Digital InputAddress Pin: Connect to GND, VS, SDA, or SCL to set the I²C address.
5A0Digital InputAddress Pin: Used with A1 to configure 1 of 16 addresses.
6, 11GNDPowerGround: Common ground for analog and digital circuits.
7ALERTDigital OutputAlert Pin: Open-drain output for over-limit or conversion-ready signals.
8SDADigital I/OSerial Data: Bidirectional I²C data line.
9SCLDigital I/OSerial Clock: I²C clock input.
10VSPowerSupply Voltage: 2.7V to 5.5V to power the sensor logic.
12VBUSAnalog InputBus Voltage Sense: Measures the actual voltage of the line (0V to 36V).
14, 15, 16IN–Analog InputNegative Current Path: Connect to the load for high-side sensing.

INA260 Arduino example code

This sketch initializes the sensor and prints Voltage, Current, and Power to the Serial Monitor at 115200 baud

#include <Adafruit_INA260.h>
 
// Create the sensor object
Adafruit_INA260 ina260 = Adafruit_INA260();
 
void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10); // Wait for Serial Monitor to open
 
  Serial.println("Adafruit INA260 Test");
 
  // Default I2C address is 0x40
  if (!ina260.begin()) {
    Serial.println("Couldn't find INA260 chip. Check wiring!");
    while (1);
  }
 
  Serial.println("Found INA260!");
}
 
void loop() {
  // Read and print Voltage (mV)
  Serial.print("Voltage: ");
  Serial.print(ina260.readBusVoltage());
  Serial.println(" mV");
 
  // Read and print Current (mA)
  Serial.print("Current: ");
  Serial.print(ina260.readCurrent());
  Serial.println(" mA");
 
  // Read and print Power (mW)
  Serial.print("Power:   ");
  Serial.print(ina260.readPower());
  Serial.println(" mW");
 
  Serial.println("");
  delay(1000);
}

Pro Tips for INA260

  • No Calibration Needed: Unlike the INA219 or INA226, you do not need to call a setShunt function because the resistor is built-in and factory-calibrated.
  • Averaging: If your readings are “jumpy,” you can add ina260.setAveragingCount(INA260_AVG_16); in setup() to smooth out the data.
  • High Current: Since the INA260 handles up to 15A, ensure your wiring (the wires going to IN+ and IN-) is thick enough to handle the load without overheating.

INA3221: current and bus voltage monitor with 3 channels I²C communication

INA3221 The INA3221 is a high-side current and bus voltage monitor with three independent channels and an I²C-compatible interface. It is essentially a triple-channel version of the popular INA219, allowing you to monitor three separate power rails with a single chip.

Key Specifications

  • Channels: 3 independent monitoring channels.
  • Bus Voltage Range: Senses from 0V to 26V.
  • Supply Voltage: Operates on a single 2.7V to 5.5V supply.
  • Resolution: Integrated 13-bit ADC.
  • Current Sensing: Measures current by detecting the voltage drop across an external shunt resistor (up to ±163.8 mV).
  • Power Consumption: Low typical supply current of 350 µA.
  • Interface: I²C/SMBUS with 4 programmable addresses (0x40 to 0x43) via the A0 pin.

INA3221 Pin Description

The INA3221 features several specialized alert pins not found on simpler monitors. INA3221

Pin NameTypeDescription
IN+ [1, 2, 3]Analog InputPositive Shunt Input: Connect to the supply side of the shunt resistor for each channel.
IN- [1, 2, 3]Analog InputNegative Shunt Input: Connect to the load side. Bus voltage is also measured here.
VSPowerSupply Voltage: 2.7V to 5.5V.
GNDPowerGround: All loads and the supply must share this common ground.
SCL/SDADigital I/OI²C Interface: Clock and data lines for communication.
A0Digital InputAddress Select: Tie to GND, VS, SDA, or SCL to set the I²C address.
CriticalDigital OutputCritical Alert: Triggers immediately when a programmed current limit is exceeded.
WarningDigital OutputWarning Alert: Triggers based on an averaged current value to avoid false alarms.
PV (Power Valid)Digital OutputGoes high once all enabled channels reach a predefined voltage (default 10V).
TC (Timing Control)Digital OutputMonitors power-supply sequencing at power-up.

Important Usage Notes

  • Common Ground: All monitored loads and the INA3221 must share the same ground reference.
  • High-Side Sensing: Intended for high-side sensing (resistor between supply and load), though low-side sensing is possible but less typical for this chip.
  • Standard Breakout Performance: Most modules feature 0.1Ω shunts, enabling measurements of up to approximately 1.6A per channel with a resolution of 40µV.

INA3221 I2C Address Map

A0 Pin ConnectionHex AddressDecimal
GND (Ground)0x4064
VS (VCC)0x4165
SDA0x4266
SCL0x4367

Wiring Reminder

The INA3221 is primarily for high-side sensing. Connect your power source to IN+ and your load to IN- for each channel you wish to monitor.

INA3221 Arduino example code

To use the INA3221 with an Arduino, the Adafruit INA3221 Library is highly recommended for its ease of use and support for all three channels.

This sketch initializes the sensor and prints the voltage and current for all three channels to the Serial Monitor at 115200 baud.

#include <Adafruit_INA3221.h>
 
// Initialize sensor (Default address 0x40)
Adafruit_INA3221 ina3221;
 
void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10); // Wait for Serial Monitor
 
  Serial.println("Adafruit INA3221 Test");
 
  if (!ina3221.begin()) {
    Serial.println("Failed to find INA3221 chip. Check wiring!");
    while (1) delay(10);
  }
 
  // Set shunt resistance for all channels (Standard modules use 0.1 or 0.05 Ohms)
  // For 0.1 Ohm shunts:
  for (uint8_t i = 0; i < 3; i++) {
    ina3221.setShuntResistance(i, 0.1); 
  }
 
  Serial.println("INA3221 Initialized.");
}
 
void loop() {
  for (uint8_t i = 0; i < 3; i++) {
    float voltage = ina3221.getBusVoltage(i);
    float current_mA = ina3221.getCurrentAmps(i) * 1000.0; // Convert to mA
 
    Serial.print("Channel "); Serial.print(i + 1);
    Serial.print(": "); Serial.print(voltage, 2); Serial.print(" V, ");
    Serial.print(current_mA, 2); Serial.println(" mA");
  }
  Serial.println("---------------------------------");
  delay(2000); // Update every 2 seconds
}

Key Functions

  • setShuntResistance(channel, ohms): Configures the library with your actual shunt resistor value (default is often 0.1Ω or 0.05Ω).
  • getBusVoltage(channel): Returns the measured voltage on the specified channel (0, 1, or 2).
  • getCurrentAmps(channel): Returns the calculated current in Amperes based on the shunt resistance.
  • setAveragingMode(mode): Can be used to reduce noise by averaging multiple samples (e.g., INA3221_AVG_16_SAMPLES).

I²C topics on lamaPLC

PageDateTags
2025/05/31 21:56, , , , , , ,
2025/09/23 19:25, , , , , ,
2026/03/21 19:20, , , , , , ,
2026/02/15 20:33, , , , , , , , ,
2026/02/14 22:24, , , , , , , , , , , , ,
2026/03/28 22:07, , , , , , ,
2026/02/15 20:40, , , , , , , , , , , , , ,
2026/02/14 23:37, , , , , , , , , , ,
2026/02/14 22:40, , , , , , , , , ,
2026/03/21 22:25, , , , , , , , , , ,
2026/02/14 18:19, , , , , , , , , , ,
2026/02/14 18:11, , , , , , , ,
2025/05/31 21:32, , , , , , , ,
2026/02/14 19:29, , , , , , , , , , , , , ,
2025/11/21 23:07, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2023/07/01 15:29, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2026/03/22 00:26, , , , , , , , ,
2026/02/14 22:45, , , , , , , , ,
2026/02/14 22:09, , , , , , , , , , , , , , , ,
2026/02/14 17:26, , , ,
2026/02/14 21:54, , , , , , , , , , , , , , , , , , , , , , , , ,
2026/03/28 18:02, , , , , , , , , , , , , , , ,
2026/02/14 23:58, , , , , , , , , , ,
2026/02/14 17:27, , , , , , , , , ,
2026/02/14 23:38, , , , , , ,
2026/02/14 22:52, , , , , , , ,
2026/02/14 22:23, , , , , , , ,
2026/02/14 22:53, , , , , , , , , , , , ,
2026/02/15 20:27, , , , , , , , , , , , , , , ,
2026/02/15 20:29, , , , , , , , , , , , , ,
2026/02/14 22:47, , , ,
2026/02/14 22:51, , , , , ,
2026/02/14 17:26, , , ,
2026/02/14 22:22, , , , , , , , , , , , ,
2026/02/14 22:21, , , , , , , , , , ,
2026/02/14 22:22, , , , , , , ,
2026/03/05 20:19, , , , , , , , , , , , , , , , ,
2026/02/14 17:27, , , , , , ,



This page has been accessed for: Today: 1, Until now: 13