The INA226, manufactured by Sensor, is a high-side current shunt monitor with an integrated I2C interface. It is designed to measure voltage, current, and power with high precision, thanks to its built-in analog-to-digital converter (ADC). The INA226 is highly versatile and operates over a wide voltage range, making it ideal for applications such as battery management, power monitoring, and energy-efficient system design.
Parameter | Value |
---|---|
Supply Voltage (Vcc) | 2.7V to 5.5V |
Input Voltage Range | 0V to 36V |
Current Measurement Range | Configurable (based on shunt resistor) |
Power Measurement | Calculated internally (Voltage × Current) |
Communication Interface | I2C (up to 400 kHz) |
ADC Resolution | 16-bit |
Operating Temperature | -40°C to +125°C |
Package | MSOP-10 |
Pin No. | Pin Name | Description |
---|---|---|
1 | VBUS | Voltage input to measure bus voltage |
2 | GND | Ground |
3 | SCL | I2C clock line |
4 | SDA | I2C data line |
5 | ALERT/RDY | Alert or Ready output (configurable) |
6 | V+ | Power supply input (2.7V to 5.5V) |
7 | A0 | I2C address selection bit 0 |
8 | A1 | I2C address selection bit 1 |
9 | SHUNT+ | Positive input for shunt resistor |
10 | SHUNT- | Negative input for shunt resistor |
#include <Wire.h>
// INA226 I2C address (default: A0 = GND, A1 = GND)
#define INA226_ADDRESS 0x40
// Register addresses
#define CONFIG_REGISTER 0x00
#define BUS_VOLTAGE_REGISTER 0x02
#define CURRENT_REGISTER 0x04
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Configure INA226 (example configuration)
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(CONFIG_REGISTER); // Point to configuration register
Wire.write(0x45); // MSB: Set averaging, bus voltage conversion time
Wire.write(0x27); // LSB: Set shunt voltage conversion time
Wire.endTransmission();
}
void loop() {
// Read bus voltage
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(BUS_VOLTAGE_REGISTER); // Point to bus voltage register
Wire.endTransmission();
Wire.requestFrom(INA226_ADDRESS, 2); // Request 2 bytes
if (Wire.available() == 2) {
uint16_t rawVoltage = (Wire.read() << 8) | Wire.read();
float busVoltage = rawVoltage * 0.00125; // Convert to volts (1.25mV/LSB)
Serial.print("Bus Voltage: ");
Serial.print(busVoltage);
Serial.println(" V");
}
delay(1000); // Wait 1 second before next reading
}
No I2C Communication:
Incorrect Current or Voltage Readings:
ALERT/RDY Pin Not Functioning:
Q: Can the INA226 measure negative currents?
A: No, the INA226 is designed for high-side current sensing and measures only positive currents.
Q: What is the maximum current the INA226 can measure?
A: The maximum current depends on the shunt resistor value and the voltage drop across it. Ensure the voltage drop does not exceed the ADC's input range.
Q: Can I use the INA226 with a 3.3V microcontroller?
A: Yes, the INA226 operates with a supply voltage as low as 2.7V, making it compatible with 3.3V systems.