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

How to Use Adafruit INA219: Examples, Pinouts, and Specs

Image of Adafruit INA219
Cirkit Designer LogoDesign with Adafruit INA219 in Cirkit Designer

Introduction

The Adafruit INA219 (Part ID: 904) is a high-side current sensor designed to measure voltage, current, and power in a circuit. It features an I2C interface, making it easy to integrate with microcontrollers such as Arduino, Raspberry Pi, and other development boards. This sensor is ideal for monitoring power consumption in various applications, including battery-powered devices, solar power systems, and motor controllers.

Explore Projects Built with Adafruit 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!
Arduino Mega 2560 and INA219 Sensor for Current and Voltage Measurement
Image of INA219_Mega2560: A project utilizing Adafruit 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
Multi-Sensor Monitoring System with INA219, Hall Sensor, and OLED Display
Image of R8 Charger: A project utilizing Adafruit 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
Arduino UNO-Based Smart Relay Control with INA219 Current Sensor and RGB LED
Image of MCG: A project utilizing Adafruit INA219 in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an INA219 current sensor, a 5V relay, and an RGB LED. The Arduino reads current measurements from the INA219 via I2C and controls the relay and LED, potentially for monitoring and controlling power to a USB-connected device.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Battery-Powered Temperature and Current Monitoring System
Image of finalyearproject: A project utilizing Adafruit INA219 in a practical application
This circuit uses an Arduino UNO to read temperature data from a DS18B20 waterproof temperature sensor and monitor voltage and current using an INA219 sensor. The Arduino is powered by a 3.7V battery and communicates with the INA219 via I2C, while the DS18B20 sensor is connected to a digital pin with a pull-up resistor.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit 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 INA219_Mega2560: A project utilizing Adafruit 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
Image of R8 Charger: A project utilizing Adafruit 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 MCG: A project utilizing Adafruit INA219 in a practical application
Arduino UNO-Based Smart Relay Control with INA219 Current Sensor and RGB LED
This circuit features an Arduino UNO microcontroller interfaced with an INA219 current sensor, a 5V relay, and an RGB LED. The Arduino reads current measurements from the INA219 via I2C and controls the relay and LED, potentially for monitoring and controlling power to a USB-connected device.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of finalyearproject: A project utilizing Adafruit INA219 in a practical application
Arduino UNO Battery-Powered Temperature and Current Monitoring System
This circuit uses an Arduino UNO to read temperature data from a DS18B20 waterproof temperature sensor and monitor voltage and current using an INA219 sensor. The Arduino is powered by a 3.7V battery and communicates with the INA219 via I2C, while the DS18B20 sensor is connected to a digital pin with a pull-up resistor.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Battery monitoring and management
  • Solar power system analysis
  • Motor current sensing
  • Power consumption measurement in IoT devices
  • Energy-efficient system design

Technical Specifications

The Adafruit INA219 is based on the Texas Instruments INA219 chip and offers precise power monitoring capabilities. Below are the key technical details:

Key Specifications

Parameter Value
Operating Voltage 3.0V to 5.5V
Current Measurement Range ±3.2A (default shunt resistor)
Voltage Measurement Range 0V to 26V
Communication Interface I2C
Default I2C Address 0x40 (modifiable to 0x41, 0x44, or 0x45)
Resolution 12-bit ADC
Accuracy ±1%
Shunt Resistor 0.1Ω (default, replaceable for custom range)
Dimensions 25mm x 20mm x 2mm

Pin Configuration

The Adafruit INA219 has six pins, as described in the table below:

Pin Name Description
VIN+ Positive input for the high-side voltage to be measured.
VIN- Negative input for the high-side voltage to be measured.
GND Ground connection.
VCC Power supply input (3.0V to 5.5V).
SDA I2C data line for communication with the microcontroller.
SCL I2C clock line for communication with the microcontroller.

Usage Instructions

Connecting the INA219 to a Circuit

  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 Load:
    • Attach the VIN+ pin to the positive terminal of the power source.
    • Attach the VIN- pin to the positive terminal of the load.
    • Ensure the current flows through the shunt resistor for accurate measurement.
  3. I2C Communication:
    • Connect the SDA and SCL pins to the corresponding I2C pins on your microcontroller.
    • Use pull-up resistors (typically 4.7kΩ) on the SDA and SCL lines if not already present.

Important Considerations

  • Shunt Resistor: The default 0.1Ω shunt resistor is suitable for most applications. For higher currents, replace it with a lower-value resistor.
  • I2C Address: If using multiple INA219 sensors, modify the I2C address by soldering the address jumpers on the board.
  • Voltage Limits: Ensure the measured voltage does not exceed 26V to avoid damaging the sensor.

Example Code for Arduino UNO

Below is an example of how to use the Adafruit INA219 with an Arduino UNO to measure voltage, current, 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 execution if the sensor is not detected
    }
  }
  Serial.println("INA219 initialized successfully");
}

void loop() {
  // Read voltage, current, and power
  float busVoltage = ina219.getBusVoltage_V(); // Voltage across the load
  float current_mA = ina219.getCurrent_mA();   // Current through the load
  float power_mW = ina219.getPower_mW();       // Power consumption of the load

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

  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
}

Best Practices

  • Use short, thick wires for the VIN+ and VIN- connections to minimize resistance and improve accuracy.
  • Avoid exceeding the maximum current rating of the shunt resistor to prevent overheating or damage.
  • Calibrate the sensor if you replace the shunt resistor or require higher accuracy.

Troubleshooting and FAQs

Common Issues

  1. INA219 Not Detected on I2C Bus:

    • Ensure the SDA and SCL connections are correct.
    • Verify that pull-up resistors are present on the I2C lines.
    • Check the I2C address and ensure it matches the one in your code.
  2. Incorrect Current or Voltage Readings:

    • Verify that the shunt resistor is securely soldered and has the correct value.
    • Ensure the load is properly connected between VIN+ and VIN-.
  3. Overheating of the Shunt Resistor:

    • Check that the current through the resistor does not exceed its power rating.
    • Replace the resistor with a lower-value, higher-power-rated one if necessary.

FAQs

Q: Can I measure negative currents with the INA219?
A: Yes, the INA219 can measure bidirectional currents. However, you may need to configure the sensor for bidirectional mode in your code.

Q: How do I change the I2C address of the INA219?
A: Modify the address by soldering the A0 and A1 jumpers on the back of the board. Refer to the silkscreen for the corresponding address settings.

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

By following this documentation, you can effectively integrate the Adafruit INA219 into your projects for accurate power monitoring and analysis.