Customer:
I bought the Voltage & current sensor INA219 breakout and am trying to connect it to an ESP32 to measure voltage.
I connected everything according to the instructions and code.
When I connect the battery to measure it, the battery overheats and I get no results.
Code:
#include "INA219-SOLDERED.h"
INA219 ina;
void setup() {
Serial.begin(115200);
if (!ina.begin()) {
Serial.println("Failed to find INA219 chip");
while (1) { delay(10); }
}
ina.configure(INA219_RANGE_32V, INA219_GAIN_320MV, INA219_BUS_RES_12BIT, INA219_SHUNT_RES_12BIT_1S);
ina.calibrate(0.1, 2); // Rshunt = 0.1 ohm, Max expected current = 2A
Serial.println("INA219 Initialized and Configured");
}
void loop() {
float busVoltage = ina.readBusVoltage();
Serial.print("Bus Voltage: ");
Serial.print(busVoltage);
Serial.println(" V");
delay(6000);
}
Connections: d21 and d22 to 3.3V and GND
Log output:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load: ,len:13260
load: ,len:3028
entry 0x400805e4
INA219 Initialized and Configured
What am I doing wrong?
Original message (Croatian)
kupio sam Voltage & current sensor INA219 breakout i pokušavam ga spojit na esp32 da bih mjerio voltažu.
Sve sam spojio prema upustvima i kod.
Kad spojim bateriju da idem izmjerit pregrijava se baterija i nema rezultata.
Kod:
#include “INA219-SOLDERED.h”
INA219 ina;
void setup() {
Serial.begin(115200);
if (!ina.begin()) {
Serial.println(“Failed to find INA219 chip”);
while (1) { delay(10); }
}
ina.configure(INA219_RANGE_32V, INA219_GAIN_320MV, INA219_BUS_RES_12BIT, INA219_SHUNT_RES_12BIT_1S);
ina.calibrate(0.1, 2); // Rshunt = 0.1 ohm, Max expected current = 2A
Serial.println(“INA219 Initialized and Configured”);
}
void loop() {
float busVoltage = ina.readBusVoltage();
Serial.print("Bus Voltage: ");
Serial.print(busVoltage);
Serial.println(" V");
delay(6000);
}
d21 i d22 3.3v i gnd
log:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load: ,len:13260
load: ,len:3028
entry 0x400805e4
INA219 Initialized and Configured
možete li mi pomoć sa što radim krivo?
Originally submitted via email support on 16 April 2024. Migrated to the forum for community visibility.