INA3221 3-channel current + voltage monitor con ESP32
Alimentazione 3.3-5 V
Bus I2C
Indirizzo I2C
0x40 / 0x41 / 0x42 / 0x43
Misura corrente, tensione, potenza
Pin e collegamento all’ESP32
| Pin | Ruolo | Pin ESP32 | Note |
|---|---|---|---|
| VS | Alimentazione | 3V3 | Pin order differs between boards: check the silkscreen |
| GND | Massa | GND | |
| SCL | Clock I2C (SCL) | D22 | |
| SDA | Dati I2C (SDA) | D21 | |
| WAR | Interrupt | D35 | Warning alert, open drain. Optional |
| CRI | Interrupt | VP | Critical alert, open drain. Optional |
| TC | Non collegato all’ESP32 | — | Timing control alert. Leave unconnected |
| PV | Non collegato all’ESP32 | — | Power valid alert. Leave unconnected |
| IN1+ | Non collegato all’ESP32 | — | Channel 1 from the supply. Measured circuit only, up to 26 V |
| IN1- | Non collegato all’ESP32 | — | Channel 1 to the load |
| IN2+ | Non collegato all’ESP32 | — | Channel 2 from the supply |
| IN2- | Non collegato all’ESP32 | — | Channel 2 to the load |
| IN3+ | Non collegato all’ESP32 | — | Channel 3 from the supply |
| IN3- | Non collegato all’ESP32 | — | Channel 3 to the load |
Collegamento consigliato per l’ESP32 DevKit a 30 pin, evitando i pin della flash, di sola lettura e di strapping. BoardPilot lo controlla mentre colleghi.
Codice di partenza (Arduino)
#include <Wire.h>
void setup() {
Serial.begin(115200);
Wire.begin(21, 22); // SDA = GPIO 21, SCL = GPIO 22
Wire.beginTransmission(0x40);
bool found = Wire.endTransmission() == 0;
Serial.println(found ? "INA3221 3-channel current + voltage monitor found at 0x40" : "Not found: check power, GND and SDA/SCL");
}
void loop() {}
Fonti
- Texas Instruments INA3221 datasheet, Address pin A0 to GND/VS/SDA/SCL = 0x40/0x41/0x42/0x43
- Texas Instruments INA3221 datasheet, Bus voltage 0 to 26 V; shunt range ±163.84 mV
Provalo in 3D in BoardPilot
Componenti simili
ADS1015 12-bit ADCADS1115 16-bit ADCADXL375 high-g accelerometer (±200 g)AHT10 temperature + humidityAHT20 + BMP280 combo moduleAHT20 temperature + humidity
Dati dei componenti: CC BY 4.0, riutilizzabili citando BoardPilot.