Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use INA219: Examples, Pinouts, and Specs

Image of INA219
Cirkit Designer LogoDesign with INA219 in Cirkit Designer

Introduction

The INA219 by LaskaKit is a high-side current shunt monitor with an integrated I2C interface. This versatile component is capable of measuring both current and voltage, making it ideal for accurate power monitoring in a wide range of applications. By combining precision measurements with a simple digital interface, the INA219 enables efficient power consumption analysis and management.

Explore Projects Built with INA219

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Solar Power Monitoring System with MPPT and INA219
Image of lapmag: A project utilizing INA219 in a practical application
This circuit is designed to monitor the voltage and current of a solar panel using an ESP32 Devkit V1 microcontroller and an INA219 current sensor. The ESP32 reads data from the INA219 via I2C communication (using pins D21 and D22 for SDA and SCL, respectively) and reports voltage, current, and power measurements over a serial connection. The solar panel is connected to an MPPT solar charge controller, which is in turn connected to the INA219 for monitoring its output.
Cirkit Designer LogoOpen Project in Cirkit Designer
Multi-Sensor Monitoring System with INA219, Hall Sensor, and OLED Display
Image of R8 Charger: A project utilizing INA219 in a practical application
This circuit is designed for monitoring and displaying sensor data. It includes three INA219 current sensors, a GH1248 Hall sensor, and an SSD1306 OLED display, all interfaced with a Seeed Studio RP2350 microcontroller. The microcontroller reads data from the sensors and controls the display and three LEDs.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Motor Control System with INA219 Current Sensor and ST7735S Display
Image of test1: A project utilizing INA219 in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560 and INA219 Sensor for Current and Voltage Measurement
Image of INA219_Mega2560: A project utilizing INA219 in a practical application
This circuit connects an Arduino Mega 2560 to an INA219 sensor for current and voltage measurement. The INA219 sensor communicates with the Arduino via the I2C protocol, and the Arduino reads and prints the current, bus voltage, shunt voltage, and power values to the Serial Monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with INA219

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 lapmag: A project utilizing INA219 in a practical application
ESP32-Based Solar Power Monitoring System with MPPT and INA219
This circuit is designed to monitor the voltage and current of a solar panel using an ESP32 Devkit V1 microcontroller and an INA219 current sensor. The ESP32 reads data from the INA219 via I2C communication (using pins D21 and D22 for SDA and SCL, respectively) and reports voltage, current, and power measurements over a serial connection. The solar panel is connected to an MPPT solar charge controller, which is in turn connected to the INA219 for monitoring its output.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of R8 Charger: A project utilizing INA219 in a practical application
Multi-Sensor Monitoring System with INA219, Hall Sensor, and OLED Display
This circuit is designed for monitoring and displaying sensor data. It includes three INA219 current sensors, a GH1248 Hall sensor, and an SSD1306 OLED display, all interfaced with a Seeed Studio RP2350 microcontroller. The microcontroller reads data from the sensors and controls the display and three LEDs.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of test1: A project utilizing INA219 in a practical application
ESP32-Based Motor Control System with INA219 Current Sensor and ST7735S Display
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of INA219_Mega2560: A project utilizing INA219 in a practical application
Arduino Mega 2560 and INA219 Sensor for Current and Voltage Measurement
This circuit connects an Arduino Mega 2560 to an INA219 sensor for current and voltage measurement. The INA219 sensor communicates with the Arduino via the I2C protocol, and the Arduino reads and prints the current, bus voltage, shunt voltage, and power values to the Serial Monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Battery management systems
  • Power supply monitoring
  • Solar power systems
  • IoT devices and embedded systems
  • Industrial automation and robotics

Technical Specifications

The INA219 is designed to provide precise measurements with minimal power consumption. Below are its key technical details:

Parameter Value
Operating Voltage (Vcc) 3.0V to 5.5V
Bus Voltage Range 0V to 26V
Current Measurement Range ±3.2A (with default 0.1Ω shunt resistor)
Shunt Voltage Range ±320mV
Communication Interface I2C (7-bit address, configurable)
Resolution 12-bit ADC
Accuracy ±1% (typical)
Operating Temperature -40°C to +125°C

Pin Configuration and Descriptions

The INA219 module typically comes with the following pinout:

Pin Name Description
VCC Power supply input (3.0V to 5.5V). Connect to the microcontroller's power pin.
GND Ground connection.
SDA I2C data line. Connect to the microcontroller's SDA pin.
SCL I2C clock line. Connect to the microcontroller's SCL pin.
VIN+ Positive input for the shunt resistor. Connect to the high-side of the load.
VIN- Negative input for the shunt resistor. Connect to the low-side of the load.

Usage Instructions

The INA219 is straightforward to use in a circuit, thanks to its I2C interface and high-side current sensing capability. Below are the steps to integrate and use the INA219:

Circuit Connection

  1. Power the INA219: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground.
  2. Connect the I2C Lines:
    • Connect the SDA pin to the microcontroller's SDA pin.
    • Connect the SCL pin to the microcontroller's SCL pin.
    • Use pull-up resistors (typically 4.7kΩ) on the SDA and SCL lines if not already present.
  3. Connect the Shunt Resistor:
    • Attach the VIN+ pin to the positive side of the load.
    • Attach the VIN- pin to the negative side of the load.
    • Ensure the shunt resistor is appropriately rated for the expected current.

Important Considerations

  • Shunt Resistor Selection: The default shunt resistor on most INA219 modules is 0.1Ω, suitable for currents up to ±3.2A. For higher currents, replace the shunt resistor with a lower value.
  • I2C Address Configuration: The INA219 supports multiple I2C addresses. Check the module's datasheet or documentation for address selection details.
  • Voltage Limits: Ensure the bus voltage does not exceed 26V to avoid damaging the component.

Example Code for Arduino UNO

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 INA219 instance
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 execution if the sensor is not found
    }
  }
  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_mA = ina219.getCurrent_mA();        // Get current in mA
  float power_mW = ina219.getPower_mW();            // Get power in mW

  // Print the measurements to the serial monitor
  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_mA);
  Serial.println(" mA");

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

  Serial.println("-----------------------------");
  delay(1000); // Wait 1 second before the next reading
}

Troubleshooting and FAQs

Common Issues

  1. No I2C Communication:

    • Ensure the SDA and SCL lines are correctly connected.
    • Verify that pull-up resistors are present on the I2C lines.
    • Check the I2C address of the INA219 and ensure it matches the address in your code.
  2. Incorrect Readings:

    • Verify the shunt resistor value and ensure it matches the expected current range.
    • Check for loose or incorrect connections on the VIN+ and VIN- pins.
    • Ensure the bus voltage does not exceed the 26V limit.
  3. Sensor Not Detected:

    • Confirm that the INA219 is powered correctly (VCC and GND connections).
    • Use an I2C scanner sketch to detect the device on the I2C bus.

FAQs

Q: Can the INA219 measure negative currents?
A: Yes, the INA219 can measure bidirectional currents. Ensure the shunt resistor is connected correctly for accurate readings.

Q: What is the maximum current the INA219 can measure?
A: The maximum measurable current depends on the shunt resistor value. With the default 0.1Ω resistor, the range is ±3.2A. For higher currents, use a lower-value shunt resistor.

Q: Can I use the INA219 with a 3.3V microcontroller?
A: Yes, the INA219 operates with both 3.3V and 5V logic levels, making it compatible with most microcontrollers.

Q: How do I change the I2C address of the INA219?
A: The I2C address can be configured by adjusting the address pins (A0 and A1) on the module. Refer to the module's datasheet for specific address configurations.