Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use INA226 VI Sensor: Examples, Pinouts, and Specs

Image of INA226 VI SensorDesign with INA226 VI Sensor in Cirkit Designer

Introduction

The INA226 is a high-side current shunt and voltage monitor with an integrated I2C interface. It is designed to measure both current and voltage with high precision, making it ideal for power monitoring applications. The device is widely used in battery management systems, energy monitoring, and industrial equipment where accurate power measurement is critical. Its ability to measure shunt voltage, bus voltage, and calculate power makes it a versatile component for a variety of electronic projects.

Explore Projects Built with INA226 VI Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Smart Weighing System with ESP8266 and HX711 - Battery Powered and Wi-Fi Enabled: A project utilizing INA226 VI Sensor in a practical application
Smart Weighing System with ESP8266 and HX711 - Battery Powered and Wi-Fi Enabled

This circuit is a multi-sensor data acquisition system powered by a 18650 battery and managed by an ESP8266 microcontroller. It includes a load sensor interfaced with an HX711 module for weight measurement, an IR sensor, an ADXL345 accelerometer, a VL53L0X distance sensor, and a Neo 6M GPS module for location tracking. The system is designed for wireless data transmission and is supported by a TP4056 module for battery charging.

Open Project in Cirkit Designer
Image of ESP32 and INA3221-Based Smart Power Monitoring System with Bluetooth and Environmental Sensing: A project utilizing INA226 VI Sensor in a practical application
ESP32 and INA3221-Based Smart Power Monitoring System with Bluetooth and Environmental Sensing

This circuit is a sensor monitoring and communication system that uses an ESP32 microcontroller to read data from a BME/BMP280 environmental sensor and an INA3221 power monitor. The ESP32 communicates with the sensors via I2C and transmits data wirelessly using an HC-05 Bluetooth module. Additionally, the circuit includes optocouplers and diodes for signal isolation and protection.

Open Project in Cirkit Designer

Common Applications:

Technical Specifications

The INA226 offers a range of features and specifications that make it a reliable and efficient choice for power monitoring applications.

Key Technical Details:

Pin Configuration and Descriptions:

The INA226 is available in a small 10-pin VSSOP package. Below is the pinout and description:

Pin Number Pin Name Description
1 VBUS Bus voltage input (0V to 36V)
2 GND Ground
3 SCL I2C clock line
4 SDA I2C data line
5 ALERT Alert output (programmable threshold)
6 NC No connection
7 NC No connection
8 VSHUNT+ Positive input for shunt voltage measurement
9 VSHUNT- Negative input for shunt voltage measurement
10 VCC Power supply input (2.7V to 5.5V)

Usage Instructions

The INA226 is straightforward to use in a circuit, but proper configuration and calibration are essential for accurate measurements.

How to Use the INA226 in a Circuit:

  1. Power Supply: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Shunt Resistor: Place a precision shunt resistor between the VSHUNT+ and VSHUNT- pins. The value of the resistor determines the current measurement range.
  3. Voltage Measurement: Connect the VBUS pin to the voltage source you want to monitor (up to 36V).
  4. 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.
  5. Alert Pin (Optional): The ALERT pin can be configured to trigger when certain thresholds are exceeded. Connect it to a microcontroller GPIO pin if needed.

Important Considerations:

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>
#include <Adafruit_INA226.h>

// Create an INA226 object
Adafruit_INA226 ina226;

void setup() {
  Serial.begin(9600); // Initialize serial communication
  while (!Serial) {
    delay(10); // Wait for Serial Monitor to open
  }

  // Initialize the INA226 sensor
  if (!ina226.begin()) {
    Serial.println("Failed to find INA226 chip");
    while (1) {
      delay(10); // Halt if sensor initialization fails
    }
  }
  Serial.println("INA226 initialized successfully");

  // Configure the INA226
  ina226.setCalibration_32V_2A(); // Set calibration for 32V bus and 2A max current
}

void loop() {
  // Read bus voltage
  float busVoltage = ina226.getBusVoltage_V();
  // Read shunt voltage
  float shuntVoltage = ina226.getShuntVoltage_mV();
  // Calculate current
  float current = ina226.getCurrent_mA();
  // Calculate power
  float power = ina226.getPower_mW();

  // Print the measurements
  Serial.print("Bus Voltage: ");
  Serial.print(busVoltage);
  Serial.println(" V");

  Serial.print("Shunt Voltage: ");
  Serial.print(shuntVoltage);
  Serial.println(" mV");

  Serial.print("Current: ");
  Serial.print(current);
  Serial.println(" mA");

  Serial.print("Power: ");
  Serial.print(power);
  Serial.println(" mW");

  delay(1000); // Wait 1 second before the next reading
}

Notes:

Troubleshooting and FAQs

Common Issues:

  1. No I2C Communication:

    • Cause: Incorrect wiring or missing pull-up resistors on the I2C lines.
    • Solution: Verify the connections and ensure 4.7kΩ pull-up resistors are present on the SDA and SCL lines.
  2. Inaccurate Measurements:

    • Cause: Incorrect shunt resistor value or lack of calibration.
    • Solution: Double-check the shunt resistor value and perform software calibration.
  3. Sensor Not Detected:

    • Cause: Incorrect I2C address or faulty wiring.
    • Solution: Verify the I2C address and ensure proper connections.
  4. Alert Pin Not Functioning:

    • Cause: Alert thresholds not configured.
    • Solution: Configure the alert thresholds in software using the appropriate library functions.

FAQs:

By following this documentation, you can effectively integrate the INA226 into your projects for precise voltage, current, and power measurements.