meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sensor:ina_moduls [2026/03/28 19:20] – [INA228: ultra-precise, high-resolution digital power, energy, and charge monitor with an I²C interface] vamsan | sensor:ina_moduls [2026/03/28 21:26] (current) – [INA260: high-precision digital power monitor] vamsan | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| Several INA series ICs have excellent Arduino support, with libraries provided by Adafruit and the community. The following table summarizes the most popular models and their technical specifications | Several INA series ICs have excellent Arduino support, with libraries provided by Adafruit and the community. The following table summarizes the most popular models and their technical specifications | ||
| + | |< | ||
| ^IC Model^ADC Res.^Max Bus Voltage^Shunt Voltage Range^PGA^Alert Pin^Communication^Arduino Library^Key Functionality| | ^IC Model^ADC Res.^Max Bus Voltage^Shunt Voltage Range^PGA^Alert Pin^Communication^Arduino Library^Key Functionality| | ||
| ^[[# | ^[[# | ||
| ^[[# | ^[[# | ||
| ^[[# | ^[[# | ||
| - | ^INA237|16-bit|85V|±163.84.92 mV|No|Yes|I²C/ | + | ^[[#ina237|INA237]]|16-bit|85V|±163.84.92 mV|No|Yes|I²C/ |
| - | ^INA238|16-bit|85V|±163.84.92 mV|No|Yes|I²C/ | + | ^[[#ina238|INA238]]|16-bit|85V|±163.84.92 mV|No|Yes|I²C/ |
| - | ^INA260|16-bit|36V|Integrated Shunt|No|Yes|I²C/ | + | ^[[#ina260|INA260]]|16-bit|36V|Integrated Shunt|No|Yes|I²C/ |
| - | ^INA3221|13-bit|26V|±163.84.92 mV|No|Yes|I²C/ | + | ^[[#ina3221|INA3221]]|13-bit|26V|±163.84.92 mV|No|Yes|I²C/ |
| ==== INA219: digital current, voltage, and power monitor with I²C communication ==== | ==== INA219: digital current, voltage, and power monitor with I²C communication ==== | ||
| Line 28: | Line 29: | ||
| === INA219: Pin Description === | === INA219: Pin Description === | ||
| {{ : | {{ : | ||
| + | |||
| + | |< | ||
| ^Pin^Name^Type^Description| | ^Pin^Name^Type^Description| | ||
| ^1|VCC|Power|Supply Voltage: Powers the chip (3.0V to 5.5V).| | ^1|VCC|Power|Supply Voltage: Powers the chip (3.0V to 5.5V).| | ||
| Line 151: | Line 154: | ||
| The default address is **0x40** (when both pins are connected to GND). | The default address is **0x40** (when both pins are connected to GND). | ||
| + | |< | ||
| ^A1 Pin^A0 Pin^Hex Address| | ^A1 Pin^A0 Pin^Hex Address| | ||
| ^GND|GND|**0x40**| | ^GND|GND|**0x40**| | ||
| Line 236: | Line 240: | ||
| {{ : | {{ : | ||
| - | The INA228 is an ultra-precise, | + | The INA228 is an ultra-precise, |
| **Key Specifications** | **Key Specifications** | ||
| Line 247: | Line 251: | ||
| * **Interface: | * **Interface: | ||
| - | {{ : | + | {{ : |
| + | |||
| + | === INA228 Pin Description === | ||
| + | |||
| + | |< 100%>| | ||
| + | ^Pin No.^Name^Type^Description| | ||
| + | ^1|A1|Digital Input|Address Pin: Connect to GND, VS, SDA, or SCL to set the I²C address.| | ||
| + | ^2|A0|Digital Input|Address Pin: Works with A1 to configure one of 16 possible addresses.| | ||
| + | ^3|Alert|Digital Output|Open-drain Alert: Triggers on over/under voltage, current, or power limits.| | ||
| + | ^4|SDA|Digital I/O|Serial Data: Bidirectional I²C/SMBUS data line.| | ||
| + | ^5|SCL|Digital I/O|Serial Clock: I²C/SMBUS clock input.| | ||
| + | ^6|VS|Power|Supply Voltage: 2.7V to 5.5V to power the device.| | ||
| + | ^7|GND|Analog|Ground: | ||
| + | ^8|VBUS|Analog Input|Bus Voltage Input: Monitors the 0V to 85V bus voltage.| | ||
| + | ^9|IN–|Analog Input|Negative Shunt Input: Connect to the load side of the shunt resistor.| | ||
| + | ^10|IN+|Analog Input|Positive Shunt Input: Connect to the supply side of the shunt resistor.| | ||
| + | |||
| + | === INA228 Arduino example code === | ||
| + | This sketch initializes the sensor and prints real-time power data to the Serial Monitor at 115200 baud. | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | // Initialize with default I2C address 0x40 | ||
| + | Adafruit_INA228 ina228 = Adafruit_INA228(); | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | if (!ina228.begin()) { | ||
| + | Serial.println(" | ||
| + | while (1) delay(10); | ||
| + | } | ||
| + | // Configure: Shunt Resistance = 0.015 Ohms, Max Expected Current = 10A | ||
| + | ina228.setShunt(0.015, | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | Serial.print(" | ||
| + | Serial.print(" | ||
| + | delay(1000); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== INA237: is an ultra-precise, | ||
| + | {{anchor: | ||
| + | {{ : | ||
| + | The INA237 is an ultra-precise, | ||
| + | |||
| + | **Key Specifications** | ||
| + | |||
| + | * **Resolution: | ||
| + | * **Bus Voltage Range:** Monitors from 0V to 85V. | ||
| + | * **Common-Mode Range:** Operates from –0.3V to +85V. | ||
| + | * **Interface: | ||
| + | * **Integrated Temperature Sensor:** Provides die temperature readings with ±1°C accuracy. | ||
| + | * **Alert Feature:** Features a fast 75 µs alert response for over/under limit detection. | ||
| + | |||
| + | === INA237 Pin Description === | ||
| + | The INA237 uses the same pinout as the INA228 and INA238, making them hardware-equivalent in many designs. | ||
| + | |||
| + | ^Pin No.^Name^Type^Description| | ||
| + | ^1|A1|Digital Input|Address Pin: Sets the I2C address (connect to GND, VS, SDA, or SCL).| | ||
| + | ^2|A0|Digital Input|Address Pin: Used with A1 to select 1 of 16 addresses.| | ||
| + | ^3|Alert|Digital Output|Alert Output: Open-drain pin for diagnostic reports or conversion-ready signals.| | ||
| + | ^4|SDA|Digital I/O|Serial Data: Bidirectional data line for I2C communication.| | ||
| + | ^5|SCL|Digital I/O|Serial Clock: Clock input for I2C communication.| | ||
| + | ^6|VS|Power|Supply Voltage: Powers the device (2.7V to 5.5V).| | ||
| + | ^7|GND|Power|Ground: | ||
| + | ^8|VBUS|Analog Input|Bus Voltage: Sense input for monitoring the 0V to 85V bus voltage.| | ||
| + | ^9|IN–|Analog Input|Negative Shunt Input: Connect to the load side of the shunt resistor.| | ||
| + | ^10|IN+|Analog Input|Positive Shunt Input: Connect to the supply side of the shunt resistor.| | ||
| + | |||
| + | === INA237 Arduino example code === | ||
| + | This code initializes the sensor and prints the Bus Voltage, Current, and Power to the Serial Monitor. | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | |||
| + | // Initialize sensor (Default address is 0x40) | ||
| + | Adafruit_INA237 ina237 = Adafruit_INA237(); | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | while (!Serial) delay(10); // Wait for Serial Monitor | ||
| + | |||
| + | Serial.println(" | ||
| + | |||
| + | if (!ina237.begin()) { | ||
| + | Serial.println(" | ||
| + | while (1) delay(10); | ||
| + | } | ||
| + | |||
| + | // --- CALIBRATION --- | ||
| + | // setShunt(Shunt Resistance in Ohms, Max Expected Current in Amps) | ||
| + | // Example: 0.1 Ohm resistor, 2 Amp max current | ||
| + | ina237.setShunt(0.1, | ||
| + | |||
| + | Serial.println(" | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | // Read values from the sensor | ||
| + | float voltage_V = ina237.getBusVoltage_V(); | ||
| + | float current_mA = ina237.getCurrent_mA(); | ||
| + | float power_mW = ina237.getPower_mW(); | ||
| + | float temp_C = ina237.getDieTemperature_C(); | ||
| + | |||
| + | // Print results | ||
| + | Serial.print(" | ||
| + | Serial.print(" | ||
| + | Serial.print(" | ||
| + | Serial.print(" | ||
| + | Serial.println(" | ||
| + | |||
| + | delay(2000); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== INA238: Ultra-precise digital power monitor 16-bit delta-sigma ADC with I²C communication ==== | ||
| + | {{anchor: | ||
| + | {{ : | ||
| + | The INA238 is an ultra-precise digital power monitor featuring a 16-bit delta-sigma ADC designed for high-side or low-side current sensing in high-voltage systems up to 85V. | ||
| + | |||
| + | **Key Specifications** | ||
| + | |||
| + | * **Common-Mode Range:** Operates from –0.3V to +85V. | ||
| + | * **Precision: | ||
| + | * **Integrated Temperature Sensor:** Integrated die temperature sensing with ±1°C accuracy. | ||
| + | * **ADC Settings:** Selectable conversion times (50 µs to 4.12 ms) and sample averaging (1x to 1024x) to reduce noise. | ||
| + | * **High-Speed Interface: | ||
| + | * **Fast Response:** Provides a 75 µs alert response for rapid limit detection. | ||
| + | |||
| + | === INA238 Pin Description === | ||
| + | |< 100%>| | ||
| + | ^Pin No.^Name^Type^Description| | ||
| + | ^1|A1|Digital Input|Address Pin 1: Sets the I²C address by connecting to GND, VS, SDA, or SCL.| | ||
| + | ^2|A0|Digital Input|Address Pin 0: Used with A1 to select 1 of 16 possible I2C addresses.| | ||
| + | ^3|Alert|Digital Output|Alert Output: Open-drain pin for over/under limit notifications or conversion-ready status.| | ||
| + | ^4|SDA|Digital I/O|Serial Data: Bidirectional I²C/SMBUS data line.| | ||
| + | ^5|SCL|Digital I/O|Serial Clock: I²C/SMBUS clock input.| | ||
| + | ^6|VS|Power|Supply Voltage: 2.7V to 5.5V input to power the device.| | ||
| + | ^7|GND|Power|Ground: | ||
| + | ^8|VBUS|Analog Input|Bus Voltage: Monitors the 0V to 85V bus voltage.| | ||
| + | ^9|IN–|Analog Input|Negative Shunt Input: Connect to the load side of the shunt resistor.| | ||
| + | ^10|IN+|Analog Input|Positive Shunt Input: Connect to the supply side of the shunt resistor.| | ||
| + | |||
| + | === INA238 Arduino example code === | ||
| + | The INA238 uses the same 16-bit register structure as the INA237, so the code is nearly identical. You can use the Adafruit INA238 library for a quick setup. | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | |||
| + | // Create the sensor object (Default I2C address is 0x40) | ||
| + | Adafruit_INA238 ina238 = Adafruit_INA238(); | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | while (!Serial) delay(10); // Wait for Serial Monitor | ||
| + | |||
| + | Serial.println(" | ||
| + | |||
| + | // Try to initialize the chip | ||
| + | if (!ina238.begin()) { | ||
| + | Serial.println(" | ||
| + | while (1) delay(10); | ||
| + | } | ||
| + | |||
| + | // --- CALIBRATION --- | ||
| + | // setShunt(Shunt Resistance in Ohms, Max Expected Current in Amps) | ||
| + | // Example: 0.1 Ohm resistor, 1.0 Amp max current | ||
| + | ina238.setShunt(0.1, | ||
| + | |||
| + | Serial.println(" | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | // Read sensor data | ||
| + | float bus_v = ina238.getBusVoltage_V(); | ||
| + | float current_ma = ina238.getCurrent_mA(); | ||
| + | float power_mw = ina238.getPower_mW(); | ||
| + | float die_temp = ina238.getDieTemperature_C(); | ||
| + | |||
| + | // Print results to Serial Monitor | ||
| + | Serial.print(" | ||
| + | Serial.print(" | ||
| + | Serial.print(" | ||
| + | Serial.print(" | ||
| + | Serial.println(" | ||
| + | |||
| + | delay(1000); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Tips for the INA238** | ||
| + | |||
| + | * **Precision: | ||
| + | * **I²C Address:** If you have changed the A0/A1 jumpers, pass the address to the begin function: // | ||
| + | * **Alert Pin:** You can use the library to set high/low thresholds that trigger the physical Alert pin on the chip for over-current protection. | ||
| + | |||
| + | ==== INA260: high-precision digital power monitor with I²C communication ==== | ||
| + | {{anchor: | ||
| + | {{ : | ||
| + | The INA260 is a high-precision digital power monitor that stands out for its integrated precision shunt resistor. This makes it a //" | ||
| + | |||
| + | **Key Specifications** | ||
| + | |||
| + | * **Integrated Shunt:** Features a 2 mΩ resistor with 0.1% tolerance. | ||
| + | * **Current Range:** Can handle up to ±15A continuous current. | ||
| + | * **Bus Voltage:** Senses from 0V to 36V, independent of its own supply voltage. | ||
| + | * **Supply Voltage:** Operates on 2.7V to 5.5V. | ||
| + | * **Accuracy: | ||
| + | * **Interface: | ||
| + | |||
| + | === INA260 Pin Description === | ||
| + | {{anchor: | ||
| + | Although the chip features 16 pins, many breakout boards simplify this layout. The original chip pinout includes several high-current pins, which help ensure low resistance and better heat dissipation. | ||
| + | |||
| + | ^Pin No.^Name^Type^Description| | ||
| + | ^1, 2, 3|IN+|Analog Input|Positive Current Path: Connect to the supply for high-side sensing.| | ||
| + | ^4|A1|Digital Input|Address Pin: Connect to GND, VS, SDA, or SCL to set the I²C address.| | ||
| + | ^5|A0|Digital Input|Address Pin: Used with A1 to configure 1 of 16 addresses.| | ||
| + | ^6, 11|GND|Power|Ground: | ||
| + | ^7|ALERT|Digital Output|Alert Pin: Open-drain output for over-limit or conversion-ready signals.| | ||
| + | ^8|SDA|Digital I/O|Serial Data: Bidirectional I²C data line.| | ||
| + | ^9|SCL|Digital I/O|Serial Clock: I²C clock input.| | ||
| + | ^10|VS|Power|Supply Voltage: 2.7V to 5.5V to power the sensor logic.| | ||
| + | ^12|VBUS|Analog Input|Bus Voltage Sense: Measures the actual voltage of the line (0V to 36V).| | ||
| + | ^14, 15, 16|IN–|Analog Input|Negative Current Path: Connect to the load for high-side sensing.| | ||
| + | |||
| + | === INA260 Arduino example code === | ||
| + | This sketch initializes the sensor and prints Voltage, Current, and Power to the Serial Monitor at 115200 baud | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | |||
| + | // Create the sensor object | ||
| + | Adafruit_INA260 ina260 = Adafruit_INA260(); | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | while (!Serial) delay(10); // Wait for Serial Monitor to open | ||
| + | |||
| + | Serial.println(" | ||
| + | |||
| + | // Default I2C address is 0x40 | ||
| + | if (!ina260.begin()) { | ||
| + | Serial.println(" | ||
| + | while (1); | ||
| + | } | ||
| + | |||
| + | Serial.println(" | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | // Read and print Voltage (mV) | ||
| + | Serial.print(" | ||
| + | Serial.print(ina260.readBusVoltage()); | ||
| + | Serial.println(" | ||
| + | |||
| + | // Read and print Current (mA) | ||
| + | Serial.print(" | ||
| + | Serial.print(ina260.readCurrent()); | ||
| + | Serial.println(" | ||
| + | |||
| + | // Read and print Power (mW) | ||
| + | Serial.print(" | ||
| + | Serial.print(ina260.readPower()); | ||
| + | Serial.println(" | ||
| + | |||
| + | Serial.println("" | ||
| + | delay(1000); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Pro Tips for INA260** | ||
| + | |||
| + | * **No Calibration Needed:** Unlike the INA219 or INA226, you do not need to call a setShunt function because the resistor is built-in and factory-calibrated. | ||
| + | * **Averaging: | ||
| + | * **High Current:** Since the INA260 handles up to 15A, ensure your wiring (the wires going to IN+ and IN-) is thick enough to handle the load without overheating. | ||
| + | |||
| + | ==== INA3221: current and bus voltage monitor with 3 channels I²C communication ==== | ||
| + | {{anchor: | ||
| + | {{ : | ||
| + | The INA3221 is a high-side current and bus voltage monitor with three independent channels and an I²C-compatible interface. It is essentially a triple-channel version of the popular INA219, allowing you to monitor three separate power rails with a single chip. | ||
| + | |||
| + | **Key Specifications** | ||
| + | |||
| + | * **Channels: | ||
| + | * **Bus Voltage Range:** Senses from 0V to 26V. | ||
| + | * **Supply Voltage:** Operates on a single 2.7V to 5.5V supply. | ||
| + | * **Resolution: | ||
| + | * **Current Sensing:** Measures current by detecting the voltage drop across an external shunt resistor (up to ±163.8 mV). | ||
| + | * **Power Consumption: | ||
| + | * **Interface: | ||
| + | |||
| + | === INA3221 Pin Description === | ||
| + | The INA3221 features several specialized alert pins not found on simpler monitors. | ||
| + | {{ : | ||
| + | ^Pin Name^Type^Description| | ||
| + | ^IN+ [1, 2, 3]|Analog Input|Positive Shunt Input: Connect to the supply side of the shunt resistor for each channel.| | ||
| + | ^IN- [1, 2, 3]|Analog Input|Negative Shunt Input: Connect to the load side. Bus voltage is also measured here.| | ||
| + | ^VS|Power|Supply Voltage: 2.7V to 5.5V.| | ||
| + | ^GND|Power|Ground: | ||
| + | ^SCL/ | ||
| + | ^A0|Digital Input|Address Select: Tie to GND, VS, SDA, or SCL to set the I²C address.| | ||
| + | ^Critical|Digital Output|Critical Alert: Triggers immediately when a programmed current limit is exceeded.| | ||
| + | ^Warning|Digital Output|Warning Alert: Triggers based on an averaged current value to avoid false alarms.| | ||
| + | ^PV (Power Valid)|Digital Output|Goes high once all enabled channels reach a predefined voltage (default 10V).| | ||
| + | ^TC (Timing Control)|Digital Output|Monitors power-supply sequencing at power-up.| | ||
| + | |||
| + | **Important Usage Notes** | ||
| + | |||
| + | * **Common Ground:** All monitored loads and the INA3221 must share the same ground reference. | ||
| + | * **High-Side Sensing:** Intended for high-side sensing (resistor between supply and load), though low-side sensing is possible but less typical for this chip. | ||
| + | * **Standard Breakout Performance: | ||
| + | |||
| + | === INA3221 I2C Address Map === | ||
| + | |||
| + | ^A0 Pin Connection^Hex Address^Decimal| | ||
| + | ^GND (Ground)|0x40|64| | ||
| + | ^VS (VCC)|0x41|65| | ||
| + | ^SDA|0x42|66| | ||
| + | ^SCL|0x43|67| | ||
| + | |||
| + | **Wiring Reminder** | ||
| + | |||
| + | The INA3221 is primarily for high-side sensing. Connect your power source to IN+ and your load to IN- for each channel you wish to monitor. | ||
| + | |||
| + | === INA3221 Arduino example code === | ||
| + | To use the INA3221 with an Arduino, the Adafruit INA3221 Library is highly recommended for its ease of use and support for all three channels. | ||
| + | |||
| + | This sketch initializes the sensor and prints the voltage and current for all three channels to the Serial Monitor at 115200 baud. | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | |||
| + | // Initialize sensor (Default address 0x40) | ||
| + | Adafruit_INA3221 ina3221; | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | while (!Serial) delay(10); // Wait for Serial Monitor | ||
| + | |||
| + | Serial.println(" | ||
| + | |||
| + | if (!ina3221.begin()) { | ||
| + | Serial.println(" | ||
| + | while (1) delay(10); | ||
| + | } | ||
| + | |||
| + | // Set shunt resistance for all channels (Standard modules use 0.1 or 0.05 Ohms) | ||
| + | // For 0.1 Ohm shunts: | ||
| + | for (uint8_t i = 0; i < 3; i++) { | ||
| + | ina3221.setShuntResistance(i, | ||
| + | } | ||
| + | |||
| + | Serial.println(" | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | for (uint8_t i = 0; i < 3; i++) { | ||
| + | float voltage = ina3221.getBusVoltage(i); | ||
| + | float current_mA = ina3221.getCurrentAmps(i) * 1000.0; // Convert to mA | ||
| + | |||
| + | Serial.print(" | ||
| + | Serial.print(": | ||
| + | Serial.print(current_mA, | ||
| + | } | ||
| + | Serial.println(" | ||
| + | delay(2000); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Key Functions** | ||
| + | |||
| + | * **setShuntResistance(channel, | ||
| + | * **getBusVoltage(channel): | ||
| + | * **getCurrentAmps(channel): | ||
| + | * **setAveragingMode(mode): | ||
| + | |||