meta data for this page
  •  

This is an old revision of the document!


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 I2C 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

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: 3, Until now: 40