Meassuring power output of small solar panel

Hello, I want to build a small device that consist of two small solar panels, they will be angled in the same way my roof is angeld. I want to log power output over time, to determine which of my roof surfaces would be better to install solar panels on.

The solar panel i am using is a 6V 166mA unit. I have two of these. I also have an arduino uno.

I tried to sclae down the voltage of the panels with a voltage divider consisting of a 200 Ohm and a 1000 Ohm resistor (for each panel) from 6V to 5V, and then read the output on analog A0 and A1. Here's a simulation: https://www.tinkercad.com/things/9T5N6KRi35c-dual-solar-output-meassuring

I think if I log each value during the day, and look at the data, I should get a okay idea about which panel produces more power, and during what hours of the day. However, it would be nicer if I could meassure the actual energy production, instead of the voltage, so also meassure amp. But I'm way too novice to figure out how to do this.

Another challenge is power to supply the project, since the module is gonna be placed outside, I realize it needs to be battery powered, and wouldn't it be great of those two solar panel would actually charge the battery. I think it would.

I stumbled upen this little unit: https://store.arduino.cc/products/solar-power-manager-5v?variant=39894943891607 which should be able to charge the battery. I was wondering if anyone have experience with this module? Can I somehow hook into it and see how much power it receives from the colar cell. Because if that would be possible, then I could use two of this modul, to read energy production on each of them, while charging a battery that would power everything.

Any other suggestions is warmheartedly received, or if you know a project by someone else that achieves this, please don't hesitate pointing me to that project - I couldn't find it my self.

Thanks :pray:

The INA219 type of "high side" sensor measures the panel voltage and current simultaneously, and is compatible with the Arduino Uno.

How much can those panels output? You want a dummy load for each panel in form of a power resistor, and something to measure with, like the module @jremington link to.

Thanks, this looks promising. Please confirm that I am reading it right, I can connect the solar panel positive to the vin+ on the INA219, and then connect my BMS to the vin- to draw the load and charge my battery.

Also, I want to be sure that it's suitable for meassuring power delivery, rather than pull, because I can only find examples where its being used with a non-variable power source, such as being powered by the arduinos 5v out. Would it work if powered directly be a solar panel that delivers variable energy?

@ledsyn the panels output 6V 166mA at max.

Will you charge a battery from one of the panels (or both)?

That is the primary purpose of the sensor.

I can connect the solar panel positive to the vin+ on the INA219, and then connect my BMS to the vin- to draw the load

Sounds correct, but a carefully drawn schematic diagram would convey that information without ambiguity.

I recommend that you study the excellent tutorial on Adafruit's site.

2 Likes

For comparing power output you only need to log panel current, by connecting the panel directly to the V-in (shunt) terminals.
An INA226 has a higher resolution than an INA219 (11bits vs. 15bits).
An INA3221 is a 3-channel 219 version, so can measure three panels.
Leo..

Good evening rpuls,

for a similar measurement requirement I've used INA219 as well.

Here below a schematic of the approach I've followed:

if you substitute the 9v battery as power source with your solar panel, then you have 2 INA219, the first one measuring from the source (solar panel in your case) to the battery charger and the second from the solar breakout (in my case an Adafruit one) to the Arduino MKRwifi1010 who is powered by the source. The second arduinto MKRWifi1010 is the microcontroller that get the measures from the 2 INA219 connected and monitors current in milliAmpere from powersource to battery and from battery to the first MKRWIfi1010.
Hope this could be of some help to you. BR Andrea

1 Like

And in case it might be interesting, here below the code

//filename INA219MultipleCurrentSensor
// https://learn.adafruit.com/adafruit-ina219-current-sensor-breakout/wiring
// https://www.electroniclinic.com/ina219-current-sensor-with-arduino-circuit-and-code-explained/

#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219_A;
Adafruit_INA219 ina219_B(0x41);


void setup() {
  // put your setup code here, to run once:

  Serial.begin(9600);
  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).
  if (! ina219_A.begin()) {
    Serial.println("Failed to find INA219_A chip");
    while (1) { delay(10); }
  }
  if (! ina219_B.begin()) {
    Serial.println("Failed to find INA219_B chip");
    while (1) { delay(10); }
  }
  // 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() {
  // put your main code here, to run repeatedly:
 float shuntvoltage_A = 0;
  float busvoltage_A = 0;
  float current_mA_A = 0;
  float loadvoltage_A = 0;
  float power_mW_A = 0;

  float shuntvoltage_B = 0;
  float busvoltage_B = 0;
  float current_mA_B = 0;
  float loadvoltage_B = 0;
  float power_mW_B = 0;

  shuntvoltage_A = ina219_A.getShuntVoltage_mV();
  busvoltage_A = ina219_A.getBusVoltage_V();
  current_mA_A = ina219_A.getCurrent_mA();
  power_mW_A = ina219_A.getPower_mW();
  loadvoltage_A = busvoltage_A + (shuntvoltage_A / 1000);
  
  Serial.print("Bus VoltageA:   "); Serial.print(busvoltage_A); Serial.println(" V");
  Serial.print("Shunt VoltageA: "); Serial.print(shuntvoltage_A); Serial.println(" mV");
  Serial.print("Load VoltageA:  "); Serial.print(loadvoltage_A); Serial.println(" V");
  Serial.print("CurrentA:       "); Serial.print(current_mA_A); Serial.println(" mA");
  Serial.print("PowerA:         "); Serial.print(power_mW_A); Serial.println(" mW");
  Serial.println("*****************");

  shuntvoltage_B = ina219_B.getShuntVoltage_mV();
  busvoltage_B = ina219_B.getBusVoltage_V();
  current_mA_B = ina219_B.getCurrent_mA();
  power_mW_B = ina219_B.getPower_mW();
 loadvoltage_B = busvoltage_B + (shuntvoltage_B / 1000);
  
  Serial.print("Bus VoltageB:   "); Serial.print(busvoltage_B); Serial.println(" V");
  Serial.print("Shunt VoltageB: "); Serial.print(shuntvoltage_B); Serial.println(" mV");
  Serial.print("Load VoltageB:  "); Serial.print(loadvoltage_B); Serial.println(" V");
  Serial.print("CurrentB:       "); Serial.print(current_mA_B); Serial.println(" mA");
  Serial.print("PowerB:         "); Serial.print(power_mW_B); Serial.println(" mW");
  Serial.println("*****************");
  
  delay(4000);

}

you can easily see that Adafruit has been inspirational in my case as well :slight_smile:

Hi, @apagliari

Can we have a schematic of your circuit, not a Fritzy please?

A picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Thanks... Tom... :grinning: :+1: :coffee: :australia:

Well known that panels angle on the roof is the same as your latitude angle.
Direction depends on North or South hemisphere...that's pretty much it.
No need for uC or the like.

@jremington jr Thanks for the link ! :slight_smile:

@apagliari awesome, thanks for sharing, this helps a ton!

@bluejets For me its interesting to see which surface delivers more power during the hours I use the most (one surface gets sun in the morning, the other, later in the day - one gets some shade from other buildings etc.) - as I am not gonna be storing solar energy in batteries, and energy grid credit system will be phased out by 2030 where I live - so I have to be smart about this desicion.

So it's rated at 1W.

The simplest way to measure would be to connect a high power resistor (at least 2W, maybe 50 ohms) across the panel terminals. Make sure the resistor has air-flow to keep it cool, and is away from the panel so that it does not heat the panel (that would make the panel less efficient). All you need to do to measure the power produced is measure the voltage across the panel or resistor, which you can do with a voltage divider and the Arduino analog input. Use higher values for the voltage divider than you chose before, to avoid affecting the readings, like 10K and 2K.

Panels are usually mounted flat against your roof, so the angle is the angle of your roof, not your latitude.

Power output can also be affected by the direction that the roof faces, the roof angle, the time of year, overhanging/shadowing trees or other buildings, weather....

3 Likes

Not the way to install panels with ANY shading............
Even the smallest amount on the panels makes them inoperable. (not a bit...totally)

And to be clear - not doing the below, since it'll screw the readings up.

What BMS?

It might be worth you reading this about the solar power manager.

Tom... :grinning: :+1: :coffee: :australia:

Price 7.9000 USD !!

Pricey but neat.

Sometimes it cannot be avoided. My panels are in two groups facing east and west, because that's the orientation of the roof. In early morning and late evening, one of the panels cannot generate. The inverter has 2 circuits which enable one panel to generate even when the other cannot.

That may be ok for you.
In general terms, any solar installer worth their salt would ever do an install and accept shading to any degree.
You may accept driving around on a flat tyre but most would not.

Op wants to find ultra efficiency in angle and direction and yet accept "some shading from time to time", a variable which changes from bad to worse during the change in seasons.
Does not make any sense.

Again, to compare power of two panels you should only measure current, by short circuiting the panels. This can easily be done with the 0.1ohm resistor that's on an INA219 module.
Voltage or a load or a battery is going to complicate things, and create errors.
Leo..