Use arduino uno with solar panel to measure sun light Irridiation

Hello
I am currently working on a project, which is how to measure the intensity of solar radiation using Arduino using a small solar panel

Epoxy panel with a capacity of 4 watts and a voltage of 5.5 volts and an area of 200 * 130 mm

I read several articles and watched several videos, but I did not get a good result

So .. I hope for your help

What do you need help with? Have you searched the forum for similar projects? They seen to occur about every two weeks.
Paul

1 Like

How to measure solar radiation, DIY:
https://instesre.org/construction/pyranometer/pyranometer.htm

1 Like

I made several attempts but to no avail , I want to get the radiation reading in watts/m²

I tried to measure the voltage as in that drawing

The reading was changing from 1023 in the bright sun to 800~200 in the shade and 0 in the dark ..
But after a while, the 10 ohm resistance started burning
I measured the volts and amperes coming out of the solar panel in the sun and found it to be 6.5 volts (Voc) and 0.5 amperes (Isc).

So far, I have not found any correct and accurate equations or codes

I have read almost all the articles you have talked about on this topic. But unfortunately I couldn't get what I wanted .

Understand what is the ADC or the Analog Digital Converter

The readings were on this code

void setup() {
  Serial.begin(9600);
  analogReference(INTERNAL);
}

void loop() {
  Serial.println(analogRead(A2));
  delay(1000);
}

I also tried some other codes but same problem

#define ANALOG_PIN A2 // Analog pin
#define RESISTANCE 10 // Resistance in thousands of ohms
#define PANEL_LENGTH 200 // Length of solar cell in mm
#define PANEL_WIDTH 130 // Width of solar cell in mm
float Area;
float Power;
float Radiation;
/*
* Main Setup function
*/
void setup() {
// Begin serial communication
Serial.begin(9600);
while(!Serial);
delay(1000);
}
/*
* Main Setup function
*/
void loop() {
Area = 0.026 ; // (( PANEL_LENGTH * PANEL_WIDTH )/ 1000000 ) we are dividing by 10000 get the area in square meters
Power = pow(analogRead(ANALOG_PIN), 2) / RESISTANCE ; // Calculating power
Radiation = Power / Area;
char *msg; 
Serial.print("The Solar Radiation is %f W/M2 : ");
Serial.println(Radiation);
delay(1000);
}

Hi,
If your PV is capable of 4W, then your load resistor should be rated at more than 4W, for safety 10W.

It sounds like you are using a 1/4W resistor.

You need a potential divider between the load and the controller to make sure you do not exceed the 5V max that the ADC can handle.

What model Arduino are you using?

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

Indeed, Tom, unfortunately, at the moment, I only have the 1/4 watt resistors

and The type of Arduino board is Arduino Uno

Thanks so much

Hi,
The variable you will get from A0 is not volts but from 0 to 1023, you have to use a scaling equation to get your voltage.

By selecting INTERNAL reference you are using 1.1V as your reference.
So 1023 will represent 1.1V.

You need to design your potential divider to give say 1.0 when you have 5.5V on the 10 Ohm load.

Tom... :smiley: :+1: :coffee: :australia:

Hi,

yes, and it will take way to many of those in parallel to give you your required wattage.
For 5W you will need 5 / 0.25 = 20 resistors.
10 x 20 = 200 Ohms each.

If you used 220R then you would get 220/20 = 11 Ohms.

You could factor 11 Ohms into your calculations.

But first get your hardware sorted and measure your voltage with a DMM, to check your results before connecting it to your controller.

Tom... :smiley: :+1: :coffee: :australia:

1 Like

I don't know if it is true or not this scale

float volts ;

void setup() {
  Serial.begin(9600);
  analogReference(INTERNAL);
}

void loop() {
  
  volts = ( analogRead(A2) + 0.5 )* 5.0 / 1024 ;
  Serial.print(volts);
  Serial.println("V");
  delay(1000);
}

And I modified the voltage divider to this shape to withstand 6.5 volts
R1 =30Kohm
R2 = 100kohm

Very nice..
So instead of the 10 ohm resistance I will use 220 ohms, but where do you mean by putting the 11 ohms in the calculations? :sweat_smile:

Hi,
This configuration would work.

In your calculations for power you must use the Load Resistor value.

If you use the internal reference, you need to get 1.0V Vout of your divider not 5V.

Tom... :smiley: :+1: :coffee: :australia:

If we could talk in this code to avoid distraction :laughing:

#define ANALOG_PIN A2 // Analog pin
#define RESISTANCE 10 // Resistance in thousands of ohms
#define PANEL_LENGTH 200 // Length of solar cell in mm
#define PANEL_WIDTH 130 // Width of solar cell in mm
float Area;
float Power;
float Radiation;
/*
* Main Setup function
*/
void setup() {
// Begin serial communication
Serial.begin(9600);
while(!Serial);
delay(1000);
}
/*
* Main Setup function
*/
void loop() {
Area = 0.026 ; // (( PANEL_LENGTH * PANEL_WIDTH )/ 1000000 ) we are dividing by 10000 get the area in square meters
Power = pow(analogRead(ANALOG_PIN), 2) / RESISTANCE ; // Calculating power
Radiation = Power / Area;
char *msg; 
Serial.print("The Solar Radiation is %f W/M2 : ");
Serial.println(Radiation);
delay(1000);
}

Hi,
Look at this code to get you started, try to develop your code in stages.
Do you have a DMM to measure the voltage across the load and at pin A0?

float volts ;
int rawVolts;
void setup() {
  Serial.begin(9600);
  Serial.println("Solar panel power meter");
  analogReference(INTERNAL);
}

void loop() {
  rawVolts = analogRead(A2);  // read the ADC
  volts = (float)rawVolts * 1.1 / 1023.0 ; // convert the ADC to a voltage.
  Serial.print(volts);
  Serial.println("V"); //print the voltage AT the A0 pin
  delay(1000);
}

What model Arduino are you using?

Tom... :smiley: :+1: :coffee: :australia:
PS. Okay I'll use your code, no problem. :+1:

1 Like

Is not setting a resistance (RLoad ) in this way used to measure current?

Hi,
Try this;

#define ANALOG_PIN A2 // Analog pin
#define RESISTANCE 10 // Resistance in thousands of ohms
#define PANEL_LENGTH 200 // Length of solar cell in mm
#define PANEL_WIDTH 130 // Width of solar cell in mm
float Area;
float Power;
float Radiation;
int rawVolts;
float voltsInput;
/*
  Main Setup function
*/
void setup() {
  // Begin serial communication
  Serial.begin(9600);
  while (!Serial);
  Serial.println("Solar panel power meter");
  delay(1000);
}
/*
  Main Setup function
*/
void loop() {
  Area = 0.026 ; // (( PANEL_LENGTH * PANEL_WIDTH )/ 1000000 ) we are dividing by 10000 get the area in square meters
  rawVolts = analogRead(A2);  // read the ADC
  voltsInput = (float)rawVolts * 1.1 / 1023.0 ; // convert the ADC to a voltage.
  Serial.print(voltsInput);
  Serial.println("V at A0 Pin"); //print the voltage AT the A0 pin
  //Power = pow(analogRead(ANALOG_PIN), 2) / RESISTANCE ; // Calculating power
  //Radiation = Power / Area;
  //char *msg;
  //Serial.print("The Solar Radiation is %f W/M2 : ");
  //Serial.println(Radiation);
  delay(1000);
}

You do not need to calculate current.
Use;

Power = V * V / Rload

Power equals V squared divided by R.

What values are you using for R2 and R3?

Tom... :smiley: :+1: :coffee: :australia:

1 Like

Thank you Tom ..

I just want some clarification regarding the voltage divider area :sweat_smile:
Do I use a 400 ohm resistor for a 10 watt load ?
And resistance 2 and 3 how much do I put their values exactly?

The short circuit current of a photodiode or "solar cell" is directly proportional to the illumination intensity.

Anything else is an approximation, so measure the short circuit current as best you can, using the lowest value load resistor possible.

You still have to calibrate the setup.

2 Likes

You need 10R for your load.
If you use 400R, then the max out of your panel is 5.5V
So the power drawn with 400R is

P= 5.5 * 5.5 / 400 = 0.075625 Watts, no where near the 4W your panel can produce.

What model Arduino are you using?

Tom... :smiley: :+1: :coffee: :australia:
PS, keep using your code that I have edited.

Now I was trying to use the resistors of the voltmeter, which are 30 kOhm and 7.5
kOhm