Skip to main content

INA219 Current Sensor

Wiring

INA219 PinArduino Pin
VCC3.3V or 5V
GNDGND
SDAA4 (SDA)
SCLA5 (SCL)
Vin+Power supply +
Vin-Load +

Code

Install Adafruit INA219 library first.

#include <Wire.h>
#include <Adafruit_INA219.h>
Adafruit_INA219 ina219;
void setup() {
Serial.begin(115200);
ina219.begin();
}
void loop() {
Serial.print("Bus V: "); Serial.print(ina219.getBusVoltage_V());
Serial.print(" V, Current: "); Serial.print(ina219.getCurrent_mA());
Serial.print(" mA, Power: "); Serial.print(ina219.getPower_mW());
Serial.println(" mW");
delay(1000);
}

Specifications

  • Voltage: 0–26V
  • Current: up to ±3.2A (with 0.1Ω shunt)
  • I2C address: 0x40 (default)

Troubleshooting

  • Shows 0V — Vin+/Vin- not connected in series with load
  • Wrong current — INA219 must be IN SERIES, not in parallel