I'm planning to use a 5V 1W 65 x112mm solar panel to measure solar irradiance since the TSL235R cant measure solar irradiance in direct sunlight. The problem is that the output of the solar panel is kinda rubbish so i really need a calibration method for it but i dont know how?.
so here are the source code
#define ANALOG_PIN A2 // Analog pin
#define RESISTANCE 10 // Resistance in thousands of ohms
#define PANEL_LENGTH 112 // Length of solar cell in mm
#define PANEL_WIDTH 65 // 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.0728; // 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);
}
The short circuit current of any photodiode or solar cell is proportional to the illumination intensity. You can measure it using a transimpedance amplifier, as described here. The cell voltage is of no interest in this regard, and the voltage across a fixed load resistor is not proportional to the illumination.
For DIY solar measurements (e.g. pyranometer construction and calibration), this site has lots of useful information.
Cell current, not voltage, is a good indicator of solar radiation.
Try to short circuit the 1watt panel with a 5ohm resistor (2*10ohm parallel),
and measure voltage across the 5ohm resistor with 1.1volt Aref enabled in setup().
Leo..
thanks guys. is it okay to incorporate the panel with aref enabled to other sensors such as dht22 since iv'e been working on a data logger with multiple sensors
The DHT22 is digital, and has nothing to do with analogue or Aref.
Always best to test sensors seperately, before combining them into one big program.
Post the code for the solar sensor, so we can see if you have done it right.
Leo..
so this is the code. I just got it from the internet also I input the aref code
#define ANALOG_PIN A2 // Analog pin #define RESISTANCE 10// Resistance in thousands of ohms #define PANEL_LENGTH 112 // Length of solar cell in mm #define PANEL_WIDTH 65 // Width of solar cell in mm
volatile float Area;
volatile float Power;
volatile float Radiation;
/*
Main Setup function /
void setup() {
// Begin serial communication
analogReference(INTERNAL);
Serial.begin(9600);
while(!Serial);
delay(1000);
}
/
Main Setup function
*/
void loop() {
Area = .7280; // we are dividing by 10000 get the area in square meters
Power = pow(analogRead(ANALOG_PIN), 1)/ 10 ; // Calculating power
Radiation = Power / Area;
Serial.print("The Solar Radiation is %f W/M2 : ");
Serial.println(Radiation);
delay(1000);
}
I would first use some simple code to see if you're getting the A/D values in range.
e.g. a value of about 1000 with 100% noon sunlight.
Maybe your 1watt panel is not 1watt. You might have to adjust that 10ohm resistor.
Maybe wise to add a ~5k resistor between panel(+) and analogue pin, to protect the pin.
Leo..
Patience grasshopper.
The best source is the sun itself.
You should get max values at noon this time of the year if you live in the northern hemisphere (I don't).
Otherwise you must wait half a year.
Once you have adjusted the load resistor for full range, you can calibrate irradiance against a known weather station in your area.
Leo..
Any idea to measure the true power of the solar panel?
The power output of the solar panel depends on the load, as well as the illumination. Some useful info here.
To measure points for a power curve like that shown in the link above, you need a variable resistor. For your panel, a 50 Ohm, 2 Watt (or larger) potentiometer could be used as the variable load. One approach is to measure a bunch of voltages as you change the resistance, and plot V^2/R as a function of R. Peak should be at about 25 Ohms, for a 5V 1W panel.
OP wanted to measure solar irradiation, not panel output.
The easiestway to measure solar irradiation is to measure cell short circuit current.
Therefore I recommended the low resistance load and 1.1volt Aref, so it's almost a short for that 5volt/200mA panel.
Working with one variable (current) is also easier than with two and a variable load.
Leo..
i just short circuited the solar panel using a 5 ohm resistor connected in parallel between the negative and positive ports of the solar panel but it seems that the values that the arduino gave fluctuates between 0 -1023 and it does not show any constant reading.
just checked the wiring on the breadboard, i just mistakenly connected the A2 pin. my problem is now is that getting the accurate values since im getting high reading at night times i think that there are something wrong in the coding
so heres the code. thanks in advance
#define ANALOG_PIN A2 // Analog pin
#define RESISTANCE // Resistance in thousands of ohms
#define PANEL_LENGTH 112 // Length of solar cell in mm
#define PANEL_WIDTH 65 // Width of solar cell in mm
volatile float Area;
volatile float Power;
volatile float Radiation;
/*
* Main Setup function
*/
void setup() {
// Begin serial communication
Serial.begin(9600);
analogReference(INTERNAL);
}
/*
* Main Setup function
*/
void loop() {
Area = .7280; // we are dividing by 10000 get the area in square meters
Power = pow(analogRead(ANALOG_PIN), 1)/10 ; // Calculating power
Radiation = Power / Area;
Serial.print("The Solar Radiation is %f W/M2 : ");
Serial.println(Radiation);
delay(1000);
}
The analogRead() function reads the voltage on the input pin, in ADC units. The result needs to be scaled to produce an accurate voltage measurement, and for that, you need to know the ADC reference voltage.
Since you are using the INTERNAL voltage reference, for best results, you need to calibrate the actual value of the reference voltage (it is probably not 1.1V), but you need a multimeter for that.