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

How to Use INA219 Digital HiVolt Current Sensor [Bill Ludwig]: Examples, Pinouts, and Specs

Image of INA219 Digital HiVolt Current Sensor  [Bill Ludwig]
Cirkit Designer LogoDesign with INA219 Digital HiVolt Current Sensor [Bill Ludwig] in Cirkit Designer

Introduction

The INA219, manufactured by Adafruit (Part ID: INA219), is a high-side current shunt monitor that measures both current and voltage, providing a digital output via the I2C interface. This versatile sensor is designed for high-voltage applications, capable of measuring up to 26 volts and 3.2 amps. Its compact design and high accuracy make it ideal for battery management systems, power monitoring, and energy optimization in various electronic projects.

Explore Projects Built with INA219 Digital HiVolt Current Sensor [Bill Ludwig]

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-Controlled Smart Lighting System with Power Monitoring
Image of Energy Monitoring System: A project utilizing INA219 Digital HiVolt Current Sensor  [Bill Ludwig] in a practical application
This circuit appears to be a multi-channel current monitoring system using several ACS712 current sensors to measure the current through different loads, likely bulbs connected to a 220V power source. The current readings from the sensors are digitized by an Adafruit ADS1115 16-bit ADC, which interfaces with an ESP32 microcontroller via I2C communication for further processing or telemetry. A buck converter is used to step down the voltage to power the ESP32 and the sensors, and the system is powered through a 2.1mm DC barrel jack, indicating it is designed for external power supply.
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 Digital HiVolt Current Sensor  [Bill Ludwig] 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
Arduino UNO-Based Smart Relay Control with INA219 Current Sensor and RGB LED
Image of MCG: A project utilizing INA219 Digital HiVolt Current Sensor  [Bill Ludwig] 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 Based Precision Battery Monitoring System with INA228 and LM4040
Image of GIP_prelimiary: A project utilizing INA219 Digital HiVolt Current Sensor  [Bill Ludwig] in a practical application
This circuit is designed to monitor and measure current, voltage, and power using an INA228 sensor interfaced with an Arduino UNO via I2C. The LM4040 provides a precise voltage reference for the Arduino's ADC, and a rotary potentiometer along with a series resistor and Li-ion battery setup enables variable voltage input for monitoring purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with INA219 Digital HiVolt Current Sensor [Bill Ludwig]

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 Energy Monitoring System: A project utilizing INA219 Digital HiVolt Current Sensor  [Bill Ludwig] in a practical application
ESP32-Controlled Smart Lighting System with Power Monitoring
This circuit appears to be a multi-channel current monitoring system using several ACS712 current sensors to measure the current through different loads, likely bulbs connected to a 220V power source. The current readings from the sensors are digitized by an Adafruit ADS1115 16-bit ADC, which interfaces with an ESP32 microcontroller via I2C communication for further processing or telemetry. A buck converter is used to step down the voltage to power the ESP32 and the sensors, and the system is powered through a 2.1mm DC barrel jack, indicating it is designed for external power supply.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of INA219_Mega2560: A project utilizing INA219 Digital HiVolt Current Sensor  [Bill Ludwig] 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 MCG: A project utilizing INA219 Digital HiVolt Current Sensor  [Bill Ludwig] 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 GIP_prelimiary: A project utilizing INA219 Digital HiVolt Current Sensor  [Bill Ludwig] in a practical application
Arduino UNO Based Precision Battery Monitoring System with INA228 and LM4040
This circuit is designed to monitor and measure current, voltage, and power using an INA228 sensor interfaced with an Arduino UNO via I2C. The LM4040 provides a precise voltage reference for the Arduino's ADC, and a rotary potentiometer along with a series resistor and Li-ion battery setup enables variable voltage input for monitoring purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Battery management systems for electric vehicles and portable devices
  • Power monitoring in renewable energy systems (e.g., solar panels)
  • Energy consumption tracking in IoT devices
  • Overcurrent protection and diagnostics in industrial equipment
  • General-purpose current and voltage measurement in electronics projects

Technical Specifications

The INA219 sensor offers precise current and voltage measurements with a digital I2C interface. Below are its key technical details:

Key Specifications

Parameter Value
Operating Voltage 3.0V to 5.5V
Measurable Voltage Range 0V to 26V
Measurable Current Range ±3.2A (with default shunt)
Shunt Resistor 0.1Ω (default, 1% tolerance)
Communication Protocol I2C
I2C Address (Default) 0x40
Resolution 12-bit
Accuracy ±1%
Operating Temperature -40°C to +125°C

Pin Configuration

The INA219 module has the following pin layout:

Pin Name Description
VIN+ Positive input for the voltage to be measured (connect to load's positive)
VIN- Negative input for the voltage to be measured (connect to load's negative)
VCC Power supply input (3.0V to 5.5V)
GND Ground connection
SDA I2C data line
SCL I2C clock line

Usage Instructions

The INA219 is straightforward to use in a circuit, especially with microcontrollers like the Arduino UNO. Below are the steps to integrate and use the sensor:

Connecting the INA219

  1. Power the Sensor: Connect the VCC pin to the 5V or 3.3V pin of your microcontroller 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.
  3. I2C Communication:
    • Connect the SDA pin to the Arduino's A4 pin (on an UNO) or the corresponding SDA pin on other boards.
    • Connect the SCL pin to the Arduino's A5 pin (on an UNO) or the corresponding SCL pin on other boards.

Arduino Code Example

Below is an example Arduino sketch to read current and voltage using the INA219:

#include <Wire.h>
#include <Adafruit_INA219.h>

// Create an instance of the INA219 sensor
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 sensor initialized");
}

void loop() {
  float shuntVoltage = 0.0; // Variable to store shunt voltage
  float busVoltage = 0.0;   // Variable to store bus voltage
  float current_mA = 0.0;   // Variable to store current in milliamps
  float power_mW = 0.0;     // Variable to store power in milliwatts

  // Read values from the INA219 sensor
  shuntVoltage = ina219.getShuntVoltage_mV();
  busVoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  power_mW = ina219.getPower_mW();

  // Print the readings 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 taking the next reading
}

Important Considerations

  • Shunt Resistor: The default 0.1Ω shunt resistor is suitable for most applications. For higher currents, replace it with a lower resistance shunt.
  • I2C Address: The default I2C address is 0x40. If multiple INA219 sensors are used, configure their addresses by adjusting the A0 and A1 pins.
  • Voltage Limits: Ensure the input voltage does not exceed 26V to avoid damaging the sensor.

Troubleshooting and FAQs

Common Issues

  1. No Data Output:

    • Ensure the I2C connections (SDA and SCL) are correct and secure.
    • Verify the INA219 is powered (check the VCC and GND connections).
    • Confirm the I2C address matches the one in your code (default is 0x40).
  2. Incorrect Readings:

    • Check the shunt resistor value and ensure it matches the expected configuration.
    • Verify that the load is connected properly between VIN+ and VIN-.
  3. Sensor Not Detected:

    • Use an I2C scanner sketch to confirm the sensor's address.
    • Ensure pull-up resistors are present on the SDA and SCL lines if required.

FAQs

Q: Can the INA219 measure negative currents?
A: Yes, the INA219 can measure bidirectional currents. Ensure the configuration matches your application.

Q: How do I change the I2C address?
A: Adjust the A0 and A1 pins on the module to set a new I2C address. Refer to the datasheet for address configuration.

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: What is the maximum current the INA219 can measure?
A: With the default 0.1Ω shunt resistor, the maximum measurable current is ±3.2A. For higher currents, use a lower resistance shunt.

By following this documentation, you can effectively integrate the INA219 into your projects for accurate current and voltage monitoring.