The Adafruit INA219 Current Sensor FeatherWing is a high-precision current and voltage measurement module designed to be compatible with the Feather series of development boards by Adafruit. This sensor is capable of measuring both the voltage across and the current passing through a load with high accuracy, which makes it an invaluable tool for monitoring power consumption in various electronic projects. Common applications include battery monitoring, energy monitoring, and power management systems.
Pin | Description |
---|---|
GND | Ground connection |
VCC | Power supply (3.0V to 5.5V) |
SDA | I2C Data Line |
SCL | I2C Clock Line |
Vin+ | Voltage input, positive side |
Vin- | Voltage input, negative side |
To use the INA219 FeatherWing with your Feather board, follow these steps:
#include <Wire.h>
#include <Adafruit_INA219.h>
Adafruit_INA219 ina219;
void setup() {
Serial.begin(9600);
while (!Serial) {
// Wait for serial port to connect (needed for Leonardo only)
}
if (!ina219.begin()) {
Serial.println("Failed to find INA219 chip");
while (1) { delay(10); }
}
Serial.println("INA219 Current Sensor FeatherWing test");
}
void loop() {
float shuntvoltage = 0;
float busvoltage = 0;
float current_mA = 0;
float loadvoltage = 0;
shuntvoltage = ina219.getShuntVoltage_mV();
busvoltage = ina219.getBusVoltage_V();
current_mA = ina219.getCurrent_mA();
loadvoltage = busvoltage + (shuntvoltage / 1000);
Serial.print("Bus Voltage: "); Serial.print(busvoltage); Serial.println(" V");
Serial.print("Shunt Voltage: "); Serial.print(shuntvoltage); Serial.println(" mV");
Serial.print("Load Voltage: "); Serial.print(loadvoltage); Serial.println(" V");
Serial.print("Current: "); Serial.print(current_mA); Serial.println(" mA");
Serial.println("");
delay(2000);
}
Q: Can I measure currents higher than 3.2A? A: Yes, but you will need to replace the default shunt resistor with one that has a lower resistance value and recalibrate the sensor accordingly.
Q: What is the accuracy of the sensor? A: The INA219 provides high accuracy with a resolution of 0.8mA when using the default 0.1 ohm shunt resistor.
Q: How do I change the I2C address? A: The I2C address can be changed by adjusting the jumpers on the INA219 FeatherWing. Refer to the datasheet for the address configuration.
Q: Can I use this sensor with other microcontrollers besides the Feather series? A: Yes, the INA219 FeatherWing can be used with any microcontroller that supports I2C communication, provided the logic levels are compatible.