 # 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() {
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;
/*
* 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
char *msg;
Serial.print("The Solar Radiation is %f W/M2 : ");
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..    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...    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...    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? 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...    If we could talk in this code to avoid distraction ``````#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;
/*
* 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
char *msg;
Serial.print("The Solar Radiation is %f W/M2 : ");
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() {
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...    PS. Okay I'll use your code, no problem. 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;
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
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
//char *msg;
//Serial.print("The Solar Radiation is %f W/M2 : ");
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...    1 Like

Thank you Tom ..

I just want some clarification regarding the voltage divider area 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

Tom...    