BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Output of INA219 is incorrect

#1

Hello everybody
I have problem with my project: i’m using INA219 to measure current, voltage and battery consumption, i connect INA219 with arduino and open Serial monitor, but the result not true. i uploaded image and my code. Please help me !!!


#include <INA219.h>

#include <Wire.h>
#include <Adafruit_INA219.h> // You will need to download this library

Adafruit_INA219 sensor219; // Declare and instance of INA219

void setup(void) 
{
      
  Serial.begin(9600);    
  sensor219.begin();
  
}

void loop(void) 
{
  float busVoltage = 0;
  float current = 0; // Measure in milli amps
  float power = 0;

  busVoltage = sensor219.getBusVoltage_V();
  current = sensor219.getCurrent_mA();
  power = busVoltage * (current/1000); // Calculate the Power
  
  
  Serial.print("Bus Voltage:   "); 
  Serial.print(busVoltage); 
  Serial.println(" V");  
  
  Serial.print("Current:       "); 
  Serial.print(current); 
  Serial.println(" mA");
  
  Serial.print("Power:         "); 
  Serial.print(power); 
  Serial.println(" W");  
  
  Serial.println("");  

  delay(2000);
}

0 Likes

#2

It’s difficult to tell how you’ve wired this, but I don’t think you have the negative side of the battery connected to GND on the Arduino.

You should watch this:

Pete.

0 Likes

#3

thank you for supporting me, i will try again and reply your resolve

0 Likes