INA226 → Voltage & Current Monitor

The code below serves to read the voltage only between VBS and GND

#include <Wire.h>
#include <INA226_WE.h>

INA226_WE ina226(0x40);  

void setup() {
  Serial.begin(115200);
  Wire.begin(D2, D1); 
  ina226.init();    
}

void loop() {
  float voltage = ina226.getBusVoltage_V();
  Serial.print("Voltage: ");
  Serial.print(voltage, 3);
  Serial.println(" V");
  delay(1000);
}

 




09 July 2025 | Last Updated: 22 Nov. 2025 | jaimedcsilva

Related
  • AGS10 → Gas Sensor
  • VEML6040 → Light Sensor
  • INA226 → Voltage & Current Monitor

  • Buy Me a Coffee