

The INA226 is a high-side current shunt monitor with an integrated I2C interface, designed to measure voltage, current, and power with high precision. It is widely used in applications requiring accurate power monitoring, such as battery management systems, server power monitoring, and industrial automation. The device supports a wide input voltage range and offers programmable calibration for enhanced flexibility.








| Pin Name | Pin Number | Description |
|---|---|---|
| VIN+ | 1 | Positive input for differential voltage measurement across the shunt resistor. |
| VIN- | 2 | Negative input for differential voltage measurement across the shunt resistor. |
| GND | 3 | Ground connection. |
| SCL | 4 | I2C clock line. |
| SDA | 5 | I2C data line. |
| ALERT | 6 | Alert output pin for programmable threshold-based alerts. |
| VCC | 7 | Power supply input (2.7V to 5.5V). |
| ADDR | 8 | I2C address selection pin. |
| NC | 9, 10 | No connection (leave unconnected). |
Below is an example of how to interface the INA226 with an Arduino UNO to measure current and voltage:
#include <Wire.h>
// INA226 I2C address (default is 0x40, adjust if ADDR pin is configured differently)
#define INA226_ADDRESS 0x40
// INA226 register addresses
#define REG_CALIBRATION 0x05
#define REG_CURRENT 0x04
#define REG_BUS_VOLTAGE 0x02
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Configure INA226 calibration register
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(REG_CALIBRATION); // Point to calibration register
Wire.write(0x10); // Write high byte of calibration value
Wire.write(0x00); // Write low byte of calibration value
Wire.endTransmission();
Serial.println("INA226 Initialized");
}
void loop() {
float current = readCurrent(); // Read current in Amperes
float voltage = readBusVoltage(); // Read bus voltage in Volts
Serial.print("Current: ");
Serial.print(current, 3); // Print current with 3 decimal places
Serial.println(" A");
Serial.print("Voltage: ");
Serial.print(voltage, 3); // Print voltage with 3 decimal places
Serial.println(" V");
delay(1000); // Wait 1 second before next reading
}
float readCurrent() {
int16_t rawCurrent = readRegister(REG_CURRENT); // Read raw current value
return rawCurrent * 0.001; // Convert to Amperes (adjust scaling as needed)
}
float readBusVoltage() {
int16_t rawVoltage = readRegister(REG_BUS_VOLTAGE); // Read raw voltage value
return rawVoltage * 0.00125; // Convert to Volts (1.25 mV per LSB)
}
int16_t readRegister(uint8_t reg) {
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(reg); // Point to the desired register
Wire.endTransmission();
Wire.requestFrom(INA226_ADDRESS, 2); // Request 2 bytes from the register
int16_t value = (Wire.read() << 8) | Wire.read(); // Combine high and low bytes
return value;
}
0x1000) with the appropriate value based on your shunt resistor.No I2C Communication:
Incorrect Current or Voltage Readings:
Alert Pin Not Functioning: