You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the INA219 and this nice Library at a 24V Battery System (20V to 27V) at a 0.001Ohm (1milli Ohm) Shunt with a current of +30A (charging) and up to -120A (discharging).
Please find my Code attached/below.
The measurement of voltage above 16V is working due to the changes of “unsigned int temp;” to “int temp;” in “float INA219::busVoltage()// returns the bus voltage in volts ” in file INA219.cpp. (described in Issue #3)
But I still have problems with the measurement of the Current and Power values.
When I apply 25.1V and -5.2A (is -5.2mV at the shunt, measured with multimeter) I get the following results:
raw shunt voltage: 697
raw bus voltage: -15166
shunt voltage: 3.9000 mV
shunt current: 177.5542 mA
bus voltage: 25.1720 V
bus power: 4468.9951 mW
Does it my be a problem of value overflow? What might be the problem?
Thank you very much.
I have set the following default settings in INA219.h:
define D_I2C_ADDRESS 0x40 // I2C Adresse(64)
define D_RANGE 1 // 0: 0-16V, 1:0-32V
define D_GAIN 3 // Range: 2: +-160mV, 3: +-320mV
define D_SHUNT_ADC 10 // ADC 3: 12-bit, single sample, 532uS conversion time 6:8x 4,2ms
Hello,
I am using the INA219 and this nice Library at a 24V Battery System (20V to 27V) at a 0.001Ohm (1milli Ohm) Shunt with a current of +30A (charging) and up to -120A (discharging).
Please find my Code attached/below.
The measurement of voltage above 16V is working due to the changes of “unsigned int temp;” to “int temp;” in “float INA219::busVoltage()// returns the bus voltage in volts ” in file INA219.cpp. (described in Issue #3)
But I still have problems with the measurement of the Current and Power values.
When I apply 25.1V and -5.2A (is -5.2mV at the shunt, measured with multimeter) I get the following results:
raw shunt voltage: 697
raw bus voltage: -15166
shunt voltage: 3.9000 mV
shunt current: 177.5542 mA
bus voltage: 25.1720 V
bus power: 4468.9951 mW
Does it my be a problem of value overflow? What might be the problem?
Thank you very much.
I have set the following default settings in INA219.h:
define D_I2C_ADDRESS 0x40 // I2C Adresse(64)
define D_RANGE 1 // 0: 0-16V, 1:0-32V
define D_GAIN 3 // Range: 2: +-160mV, 3: +-320mV
define D_SHUNT_ADC 10 // ADC 3: 12-bit, single sample, 532uS conversion time 6:8x 4,2ms
define D_BUS_ADC 10 // -||-
define D_MODE 7 // 7: continuous conversion
define D_SHUNT 0.001 // R-Shung [Ohm]
define D_V_BUS_MAX 28 // U-Bus-Max [V]
define D_V_SHUNT_MAX 0.160 // U-Shunt_Max exp. [V]
define D_I_MAX_EXPECTED 130 // I-Max exp. [A]
My Code:
/**********************************************
**********************************************/
include <Wire.h>
include "INA219.h"
INA219 monitor;
void setup()
{
Serial.begin(115200);
monitor.begin(64);
// U-Range 0: 16V, 1:32V; I-Gain 2: 160mV, 3: 320mV; Bit/Avr U; Bit/AVR I; D_MODE 7: cont.
monitor.configure(1, 2, 10, 10, 7);
// Shunt[Ohm]; max Shunt [V]; max U [V]; max ecp. I [A]
monitor.calibrate(0.001, 0.160, 30, 130);
}
void loop()
{
Serial.println("******************");
Serial.print("raw shunt voltage: ");
Serial.println(monitor.shuntVoltageRaw());
Serial.print("raw bus voltage: ");
Serial.println(monitor.busVoltageRaw());
Serial.println("--");
Serial.print("shunt voltage: ");
Serial.print(monitor.shuntVoltage() * 1000, 4);
Serial.println(" mV");
Serial.print("shunt current: ");
Serial.print(monitor.shuntCurrent() * 1000, 4);
Serial.println(" mA");
Serial.print("bus voltage: ");
Serial.print(monitor.busVoltage(), 4);
Serial.println(" V");
Serial.print("bus power: ");
Serial.print(monitor.busPower() * 1000, 4);
Serial.println(" mW");
Serial.println(" ");
Serial.println(" ");
delay(1000);
}
The text was updated successfully, but these errors were encountered: