๐ŸŽ„โ›„โ„๏ธ๐ŸŽ It's beginning to look a lot like ADABOX-mas! The next ADABOX from Adafruit ships soon! Get yours now, or give as a gift! ๐ŸŽ„โ›„โ„๏ธ๐ŸŽ
0

INA219 featherwing wiring with solar panel.
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

INA219 featherwing wiring with solar panel.

by David0111 on Sun Nov 10, 2019 8:45 am

qwwftmdmfux31.jpg
qwwftmdmfux31.jpg (48.19 KiB) Viewed 100 times
Using INA219 featherwing I want to messure the power of the solar panel and the voltage of the battery. Is this correct wiring?

David0111
 
Posts: 11
Joined: Tue Oct 22, 2019 11:37 am

Re: INA219 featherwing wiring with solar panel.

by adafruit_support_bill on Sun Nov 10, 2019 9:02 am

No. The positive wire from the panel goes to V+. V-goes to the positive terminal of your load.
The negative wire from the panel goes directly to the Ground of your load.

https://learn.adafruit.com/adafruit-ina ... ircuit-3-7

adafruit_support_bill
 
Posts: 75036
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 featherwing wiring with solar panel.

by David0111 on Sun Nov 10, 2019 9:10 am

What do you mean with the ground of your load? Do you mean the negative battery terminal?

David0111
 
Posts: 11
Joined: Tue Oct 22, 2019 11:37 am

Re: INA219 featherwing wiring with solar panel.

by adafruit_support_bill on Sun Nov 10, 2019 10:49 am

If your load is the Feather, you can connect the negative wire from the panel to either the negative battery terminal or one of the GND pins.

I want to messure the power of the solar panel and the voltage of the battery.

Note that the INA219 cannot do both. It can measure the current and voltage from either the panel or the battery. Most Feathers allow you to measure the battery voltage on one of the analog pins. https://learn.adafruit.com/adafruit-fea ... attery-5-8

adafruit_support_bill
 
Posts: 75036
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 featherwing wiring with solar panel.

by David0111 on Thu Nov 14, 2019 7:56 am

I only want to messure the voltage and current of the battery. When I switched the cabels on Vin+ and Vin-. I don't get the voltage of the battery. I understand that the INA219 only can do one thing, so if I only want to messure the voltage and current of the battery should I leave it as is. I know that I can messure the voltage using the analog pin on the esp32 feather. But I have two batteries. One that's being charged by the solar panel and one that's connected to the analog pin on the feather. Could you say if it's the code or the wiring that's producing these inconsistent values.

Code: Select all | TOGGLE FULL SIZE
Bus Voltage:   3.62 V
Shunt Voltage: -2.41 mV
Load Voltage:  3.62 V
Current:       -24.10 mA
Power:         87.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: -0.01 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       -0.10 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: -0.01 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       -0.10 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: -0.01 mV
Load Voltage:  3.61 V
Current:       -0.10 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       -0.10 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: -0.01 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       -0.10 mA
Power:         0.00 mW

Bus Voltage:   3.62 V
Shunt Voltage: -2.41 mV
Load Voltage:  3.62 V
Current:       -24.10 mA
Power:         87.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.62 V
Shunt Voltage: -1.05 mV
Load Voltage:  3.62 V
Current:       -24.00 mA
Power:         87.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: 0.00 mV
Load Voltage:  3.61 V
Current:       -0.10 mA
Power:         0.00 mW

Bus Voltage:   3.61 V
Shunt Voltage: -0.01 mV
Load Voltage:  3.61 V
Current:       0.00 mA
Power:         0.00 mW

Bus Voltage:   3.62 V
Shunt Voltage: -2.41 mV
Load Voltage:  3.62 V
Current:       -24.10 mA
Power:         87.00 mW


Code: Select all | TOGGLE FULL SIZE
#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;


void setup(void)
{
  Serial.begin(115200);
  while (!Serial) {
      // will pause Zero, Leonardo, etc until serial console opens
      delay(1);
  }

  uint32_t currentFrequency;
   
  Serial.println("Hello!");
 
  // Initialize the INA219.
  // By default the initialization will use the largest range (32V, 2A).  However
  // you can call a setCalibration function to change this range (see comments).
  ina219.begin();
  // To use a slightly lower 32V, 1A range (higher precision on amps):
  //ina219.setCalibration_32V_1A();
  // Or to use a lower 16V, 400mA range (higher precision on volts and amps):
  ina219.setCalibration_16V_400mA();

  Serial.println("Measuring voltage and current with INA219 ...");
}

void loop(void)
{
  float shuntvoltage = 0;
  float busvoltage = 0;
  float current_mA = 0;
  float loadvoltage = 0;
  float power_mW = 0;

  shuntvoltage = ina219.getShuntVoltage_mV();
  busvoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  power_mW = ina219.getPower_mW();
  loadvoltage = busvoltage + (shuntvoltage / 1000);
 
  Serial.print("Bus Voltage:   "); Serial.print(busvoltage); Serial.println(" V");
  Serial.print("Shunt Voltage: "); Serial.print(shuntvoltage); Serial.println(" mV");
  Serial.print("Load Voltage:  "); Serial.print(loadvoltage); Serial.println(" V");
  Serial.print("Current:       "); Serial.print(current_mA); Serial.println(" mA");
  Serial.print("Power:         "); Serial.print(power_mW); Serial.println(" mW");
  Serial.println("");

  delay(2000);
}
Attachments
Solar_Panel_Circut.jpg
Solar_Panel_Circut.jpg (695.15 KiB) Viewed 33 times

David0111
 
Posts: 11
Joined: Tue Oct 22, 2019 11:37 am

Re: INA219 featherwing wiring with solar panel.

by adafruit_support_bill on Thu Nov 14, 2019 8:13 am

With those connections, you are measuring the battery voltage and the current flow between the battery and the charger.

3.62v seems like a typical value for a nominal 3.7v cell.
-24mA indicates that you are slowly charging the battery.

adafruit_support_bill
 
Posts: 75036
Joined: Sat Feb 07, 2009 10:11 am

Re: INA219 featherwing wiring with solar panel.

by David0111 on Thu Nov 14, 2019 8:45 am

But why is the reading not steady they fluxate alot. Any ideas how to get a more stable and consistent reading?
Thanks

David0111
 
Posts: 11
Joined: Tue Oct 22, 2019 11:37 am

Re: INA219 featherwing wiring with solar panel.

by adafruit_support_bill on Thu Nov 14, 2019 8:57 am

Your battery reading seems to be quite steady. It only varies by 0.01V.
The charge current will vary with solar conditions. If solar irradiation is not strong enough for full-time charging, the BFC on the charger will scavenge power from the panel and deliver intermittent charge pulses to the battery.
https://learn.adafruit.com/usb-dc-and-s ... zation-6-9

adafruit_support_bill
 
Posts: 75036
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.