INA226 current + voltage monitor con ESP32

Alimentazione 3.3-5 V Bus I2C Indirizzo I2C 0x40 / 0x41 / 0x42 / 0x43 / 0x44 / 0x45 / 0x46 / 0x47 / 0x48 / 0x49 / 0x4A / 0x4B / 0x4C / 0x4D / 0x4E / 0x4F Misura corrente, tensione, potenza
VCCGNDSCLSDAALEVBSIN-IN+

Pin e collegamento all’ESP32

PinRuoloPin ESP32Note
VCCAlimentazione3V3
GNDMassaGND
SCLClock I2C (SCL)D22
SDADati I2C (SDA)D21
ALEInterruptD35Alert output, optional
VBSNon collegato all’ESP32—Bus voltage sense. Usually linked to IN- on the board
IN-Non collegato all’ESP32—To the load. Measured circuit only, up to 36 V
IN+Non collegato all’ESP32—From the supply. Measured circuit only, up to 36 V

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 ? "INA226 current + voltage monitor found at 0x40" : "Not found: check power, GND and SDA/SCL");
}

void loop() {}

Fonti

Provalo in 3D in BoardPilot

BoardPilot Dati del componente (JSON)

Componenti simili

Dati dei componenti: CC BY 4.0, riutilizzabili citando BoardPilot.