The INA226 is a high-side current shunt monitor with an integrated I2C interface, designed to measure voltage, current, and power in a wide range of applications. It features a precision 16-bit analog-to-digital converter (ADC) for accurate measurements and operates with a supply voltage range of 2.7V to 5.5V, making it ideal for battery-powered devices. The INA226 is commonly used in power management systems, battery monitoring, and industrial equipment.
Explore Projects Built with INA226
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit is a load cell signal conditioning and amplification system. It uses an INA125 instrumentation amplifier to amplify the differential signal from a load cell, with additional filtering and gain control provided by potentiometers and capacitors. The amplified signal is then monitored by a digital voltmeter, and the entire system is powered by a 12V battery with a step-up boost converter to provide stable voltage.
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.
This circuit is designed for solar energy management and monitoring. It includes a 12V AGM battery charged by solar panels through an MPPT charge controller, with voltage monitoring provided by an INA3221 sensor. Additionally, a 3.7V battery is connected to an ESP32-C3 microcontroller and an AHT21 sensor for environmental data collection, with power management handled by a Waveshare Solar Manager.
This circuit is an emergency alert system that uses a NUCLEO-F072RB microcontroller to send SMS alerts and make calls via a SIM800L GSM module, while obtaining location data from a GPS NEO 6M module. The system is powered by a Li-ion battery and includes a TP4056 module for battery charging and protection, with a rocker switch to control power to the microcontroller.
Power Supply: Connect the V+ pin to a 2.7V to 5.5V power source and the GND pin to ground.
Shunt Resistor: Place a precision shunt resistor between the load and ground. Connect the VIN+ and VIN- pins across the shunt resistor to measure the voltage drop.
I2C Interface: Connect the SCL and SDA pins to the corresponding I2C lines of your microcontroller. Use pull-up resistors (typically 4.7kΩ) on the SCL and SDA lines.
Address Configuration: Use the A0 and A1 pins to set the I2C address of the INA226. These pins can be connected to V+ or GND to select one of 16 possible addresses.
Bypass Capacitor: Place a 0.1µF ceramic capacitor close to the V+ pin for power supply decoupling.
Important Considerations
Ensure the shunt resistor value is chosen to provide a measurable voltage drop without exceeding the input voltage range of the INA226.
Avoid long traces for the VIN+ and VIN- connections to minimize noise and ensure accurate measurements.
The I2C pull-up resistors should be chosen based on the bus capacitance and speed.
Example Code for Arduino UNO
Below is an example of how to use the INA226 with an Arduino UNO to measure current and voltage:
#include <Wire.h>
// INA226 I2C address (default: 0x40 if A0 and A1 are grounded)
#define INA226_ADDRESS 0x40
// INA226 register addresses
#define CONFIG_REGISTER 0x00
#define SHUNT_VOLTAGE_REGISTER 0x01
#define BUS_VOLTAGE_REGISTER 0x02
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Configure the INA226 (default configuration)
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(CONFIG_REGISTER); // Point to the configuration register
Wire.write(0x45); // MSB of configuration (example value)
Wire.write(0x27); // LSB of configuration (example value)
Wire.endTransmission();
}
void loop() {
float shuntVoltage = readRegister(SHUNT_VOLTAGE_REGISTER) * 0.0025; // Convert to volts
float busVoltage = readRegister(BUS_VOLTAGE_REGISTER) * 0.00125; // Convert to volts
Serial.print("Shunt Voltage (V): ");
Serial.println(shuntVoltage);
Serial.print("Bus Voltage (V): ");
Serial.println(busVoltage);
delay(1000); // Wait 1 second before the next reading
}
uint16_t readRegister(uint8_t reg) {
Wire.beginTransmission(INA226_ADDRESS);
Wire.write(reg); // Point to the desired register
Wire.endTransmission();
Wire.requestFrom(INA226_ADDRESS, 2); // Request 2 bytes
uint16_t value = (Wire.read() << 8) | Wire.read(); // Combine MSB and LSB
return value;
}
Troubleshooting and FAQs
Common Issues and Solutions
No I2C Communication:
Ensure the SCL and SDA lines have proper pull-up resistors (typically 4.7kΩ).
Verify the I2C address matches the configuration of the A0 and A1 pins.
Check for loose or incorrect wiring.
Incorrect Voltage or Current Readings:
Verify the shunt resistor value and connections.
Ensure the VIN+ and VIN- pins are connected across the shunt resistor.
Minimize noise by using short, twisted-pair wires for the shunt connections.
Device Not Responding:
Confirm the power supply voltage is within the 2.7V to 5.5V range.
Check for proper bypass capacitor placement near the V+ pin.
FAQs
Q: Can the INA226 measure negative currents?
A: No, the INA226 is designed for unidirectional current measurement. For bidirectional current sensing, additional circuitry or a different device is required.
Q: What is the maximum current the INA226 can measure?
A: The maximum current depends on the value of the external shunt resistor and the maximum measurable voltage drop across it (±81.92mV).
Q: Can I use the INA226 with a 3.3V microcontroller?
A: Yes, the INA226 is compatible with 3.3V systems as long as the supply voltage (V+) is within the 2.7V to 5.5V range.