The INA226 is a high-side current shunt monitor with an integrated I2C interface, designed to measure voltage, current, and power in a single device. It is highly versatile, featuring a programmable gain and a wide operating supply voltage range of 2.7V to 5.5V. This makes it ideal for applications such as battery management, power monitoring, and energy optimization in embedded systems.
Explore Projects Built with INA226
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit is a load cell signal conditioning and amplification system. It uses an INA125 instrumentation amplifier to amplify the differential signal from a load cell, with additional filtering and gain control provided by potentiometers and capacitors. The amplified signal is then monitored by a digital voltmeter, and the entire system is powered by a 12V battery with a step-up boost converter to provide stable voltage.
This circuit is a motor control system using an ESP32 microcontroller, an INA219 current sensor, and a BTS7960 motor driver. The ESP32 reads current data from the INA219 and controls the motor driver, while a display module shows relevant information. A pushbutton is included for user interaction.
This circuit is designed for solar energy management and monitoring. It includes a 12V AGM battery charged by solar panels through an MPPT charge controller, with voltage monitoring provided by an INA3221 sensor. Additionally, a 3.7V battery is connected to an ESP32-C3 microcontroller and an AHT21 sensor for environmental data collection, with power management handled by a Waveshare Solar Manager.
This circuit is an emergency alert system that uses a NUCLEO-F072RB microcontroller to send SMS alerts and make calls via a SIM800L GSM module, while obtaining location data from a GPS NEO 6M module. The system is powered by a Li-ion battery and includes a TP4056 module for battery charging and protection, with a rocker switch to control power to the microcontroller.
Current Measurement Range: Determined by the shunt resistor
Communication Interface: I2C (up to 1 MHz)
Programmable Gain: Configurable for different shunt resistor values
Operating Temperature Range: -40°C to +125°C
Accuracy: ±0.1% (typical)
Power Consumption: 330 µA (typical)
Pin Configuration and Descriptions
The INA226 is available in a 10-pin VSSOP package. Below is the pinout description:
Pin Number
Pin Name
Description
1
VBUS
Voltage input pin for bus voltage measurement
2
GND
Ground connection
3
SCL
I2C clock input
4
SDA
I2C data input/output
5
ALERT
Alert output pin for programmable threshold-based alerts
6
ADDR
Address pin for setting the I2C address
7
VSHUNT+
Positive input for shunt voltage measurement
8
VSHUNT-
Negative input for shunt voltage measurement
9
NC
No connection
10
VCC
Power supply input (2.7V to 5.5V)
Usage Instructions
How to Use the INA226 in a Circuit
Power Supply: Connect the VCC pin to a 2.7V to 5.5V power source and the GND pin to ground.
Shunt Resistor: Place a shunt resistor between the VSHUNT+ and VSHUNT- pins to measure current. The value of the resistor depends on the expected current range.
Voltage Measurement: Connect the VBUS pin to the voltage source you want to monitor.
I2C Communication: Connect the SCL and SDA pins to the corresponding I2C lines of your microcontroller. Use pull-up resistors (typically 4.7kΩ) on these lines.
Address Configuration: Set the I2C address using the ADDR pin. This allows multiple INA226 devices to share the same I2C bus.
Alert Pin (Optional): Configure the ALERT pin for overcurrent, overvoltage, or other threshold-based alerts.
Important Considerations
Ensure the shunt resistor is appropriately rated for the expected current to avoid excessive power dissipation.
Use decoupling capacitors (e.g., 0.1 µF) near the VCC pin to stabilize the power supply.
Verify the I2C pull-up resistors are correctly sized for the bus speed and capacitance.
The INA226 can measure both current and voltage simultaneously, enabling real-time power calculations.
Example Code for Arduino UNO
Below is an example of how to use the INA226 with an Arduino UNO to measure voltage and current:
#include <Wire.h>
// INA226 I2C address (default is 0x40, but check your configuration)
#define INA226_ADDRESS 0x40
// INA226 register addresses
#define REG_CONFIG 0x00
#define REG_BUS_VOLTAGE 0x02
#define REG_SHUNT_VOLTAGE 0x01
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Configure the INA226 (default configuration)
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(REG_CONFIG); // Point to the configuration register
Wire.write(0x45); // MSB of configuration (example value)
Wire.write(0x27); // LSB of configuration (example value)
Wire.endTransmission();
}
void loop() {
float busVoltage = readBusVoltage();
float shuntVoltage = readShuntVoltage();
float current = shuntVoltage / 0.1; // Assuming a 0.1 ohm shunt resistor
Serial.print("Bus Voltage: ");
Serial.print(busVoltage);
Serial.println(" V");
Serial.print("Shunt Voltage: ");
Serial.print(shuntVoltage);
Serial.println(" V");
Serial.print("Current: ");
Serial.print(current);
Serial.println(" A");
delay(1000); // Wait 1 second before the next reading
}
float readBusVoltage() {
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(REG_BUS_VOLTAGE); // Point to the bus voltage register
Wire.endTransmission();
Wire.requestFrom(INA226_ADDRESS, 2); // Request 2 bytes
uint16_t rawData = (Wire.read() << 8) | Wire.read();
return rawData * 0.00125; // Convert to volts (1.25 mV per bit)
}
float readShuntVoltage() {
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(REG_SHUNT_VOLTAGE); // Point to the shunt voltage register
Wire.endTransmission();
Wire.requestFrom(INA226_ADDRESS, 2); // Request 2 bytes
uint16_t rawData = (Wire.read() << 8) | Wire.read();
return rawData * 0.0000025; // Convert to volts (2.5 µV per bit)
}
Troubleshooting and FAQs
Common Issues
No I2C Communication:
Ensure the INA226 is powered correctly (VCC and GND connected).
Verify the I2C pull-up resistors are present and correctly sized.
Check the I2C address configuration (ADDR pin).
Incorrect Current or Voltage Readings:
Confirm the shunt resistor value matches the expected current range.
Verify the connections to the VBUS and VSHUNT pins are correct.
Ensure the INA226 configuration register is set appropriately.
Alert Pin Not Functioning:
Verify the alert threshold settings in the INA226 configuration.
Check the connection to the ALERT pin and ensure it is not floating.
Tips for Troubleshooting
Use an I2C scanner sketch to confirm the INA226 is detected on the I2C bus.
Double-check all wiring and connections, especially the shunt resistor.
Use a multimeter to verify the actual voltage and current values for comparison.
By following this documentation, you can effectively integrate the INA226 into your projects for accurate power monitoring and management.