

The INA219 is a high-side current shunt monitor with an integrated I2C interface, designed for precise measurement of current, voltage, and power. It is widely used in applications requiring accurate power monitoring, such as battery management systems, power supply diagnostics, and energy monitoring in embedded systems. By measuring both the voltage across a shunt resistor and the bus voltage, the INA219 calculates power consumption with high accuracy.








The INA219 offers a range of features that make it versatile and reliable for power monitoring applications. Below are its key technical details:
The INA219 is typically available in an 8-pin SOIC package. Below is the pinout and description:
| Pin | Name | Description |
|---|---|---|
| 1 | V+ | High-side connection to the positive terminal of the shunt resistor. |
| 2 | V- | High-side connection to the negative terminal of the shunt resistor. |
| 3 | GND | Ground connection. |
| 4 | SDA | I2C data line for communication. |
| 5 | SCL | I2C clock line for communication. |
| 6 | ALERT | Configurable alert output for overcurrent or other fault conditions. |
| 7 | Vcc | Power supply input (3.0V to 5.5V). |
| 8 | NC | No connection (leave unconnected or grounded). |
The INA219 is straightforward to use in a circuit, thanks to its I2C interface and built-in ADC. Below are the steps and considerations for using the INA219:
Connect the Shunt Resistor:
V+ pin to the positive terminal of the shunt resistor and the V- pin to the negative terminal.Power the INA219:
Vcc pin to a 3.3V or 5V power supply.GND pin to the ground of the circuit.Set Up I2C Communication:
SDA and SCL pins to the corresponding I2C pins on your microcontroller (e.g., Arduino UNO).SDA and SCL lines if not already present.Configure the INA219:
Read Measurements:
Power = Voltage × Current.Below is an example of how to use the INA219 with an Arduino UNO to measure current, voltage, and power:
#include <Wire.h>
#include <Adafruit_INA219.h>
// Create an instance of the INA219 class
Adafruit_INA219 ina219;
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
while (!Serial) {
delay(10); // Wait for the serial monitor to open
}
// Initialize the INA219 sensor
if (!ina219.begin()) {
Serial.println("Failed to find INA219 chip");
while (1) {
delay(10); // Halt if the INA219 is not detected
}
}
Serial.println("INA219 initialized successfully");
}
void loop() {
float shuntVoltage = ina219.getShuntVoltage_mV(); // Get shunt voltage in mV
float busVoltage = ina219.getBusVoltage_V(); // Get bus voltage in V
float current = ina219.getCurrent_mA(); // Get current in mA
float power = ina219.getPower_mW(); // Get power in mW
// Print the measurements to the serial monitor
Serial.print("Shunt Voltage: ");
Serial.print(shuntVoltage);
Serial.println(" mV");
Serial.print("Bus Voltage: ");
Serial.print(busVoltage);
Serial.println(" V");
Serial.print("Current: ");
Serial.print(current);
Serial.println(" mA");
Serial.print("Power: ");
Serial.print(power);
Serial.println(" mW");
delay(1000); // Wait 1 second before taking the next measurement
}
0x40, but it can be changed by configuring the address pins.INA219 Not Detected on I2C Bus:
SDA and SCL pins. Ensure pull-up resistors are present.Incorrect Current or Voltage Readings:
No Output on Serial Monitor:
Overcurrent or Fault Alerts:
ALERT pin to monitor fault conditions programmatically.Q: Can the INA219 measure negative currents?
A: Yes, the INA219 can measure bidirectional currents if configured appropriately.
Q: What is the maximum sampling rate of the INA219?
A: The INA219's ADC can sample at up to 12-bit resolution, with a configurable conversion time.
Q: Can I use the INA219 with a 3.3V microcontroller?
A: Yes, the INA219 is compatible with both 3.3V and 5V logic levels.
Q: How do I change the I2C address of the INA219?
A: The I2C address can be changed by connecting the address pins (A0 and A1) to GND or Vcc in different combinations.
By following this documentation, you can effectively integrate the INA219 into your projects for accurate power monitoring and diagnostics.