Project tutorial
Light Intensity and Solar Panel Energy Detector

Light Intensity and Solar Panel Energy Detector © GPL3+

Evaluate the amount of the energy generated by a solar panel at a given direction through light intensity levels.

  • 2,741 views
  • 3 comments
  • 14 respects

Components and supplies

Apps and online services

About this project

Description

I wanted to approximately evaluate the amount of energy generated by a solar panel at a given direction by using light intensity values produced by photoresistors. Solar panels generate a high amount of energy under high solar radiation relative to the light intensity which is why I intended to use light intensity levels as indicators assigned to LED colors – red, yellow and green. In other words, this project is for predicting the amount of energy generated by a solar panel between three light intensity thresholds, and also notifies you when the high threshold exceeded.

To support my projects and articles, you can visit my website here :)

How to calculate the generated energy by a solar panel

[ E = A * r * H * PR ] is the formula for calculating the generated energy by a solar panel, where A is the area of the solar panel, r is the efficiency, H is the average solar radiation and PR is the performance ratio or coefficient( usually 0.75).

You can change all solar panel values at the code below.

Connections

You can find a detailed connections guide at the code below.

Connect LED, photopesistor and GND wire to a mini breadboard. And, connect buzzer to control_1 mini breadboard.

Make the connections between all mini breadboards, and it is ready to detect light intensity.

Define threshold values to get accurate data

Energy production thresholds has three level at which LED colors change:

Low - Red

Moderate - Yellow

High - Green

Also, if you want, get the output through serial ports.

Now, you can use it to charge your Li-Po battery properly via a solar panel.

Videos

Code

Arduino Nano CodeArduino
         /////////////////////////////////////////////  
        //  Light Intensity and Solar Panel Energy //
       //                Detector                 //
      //             ---------------             //
     //             (Arduino Nano)              //           
    //             by Kutluhan Aktar           // 
   //                                         //
  /////////////////////////////////////////////

// This project is for predicting the amount of energy generated by a solar panel under the light intensity level given by photoresistors which are placed in three different directions.
// The amount of energy generated by a solar panel is related to the amount of solar radiation which is why I used the light intensity level as an indicator to evaluate it approximately.
// Energy production thresholds has three level at which led colors change:
// Red - Low
// Yellow - Moderate
// Green - High 
// You can define threshold values below.
//
// Connections
// Arduino Nano :           
//                                controlLed_1_1 [red]
// D2  ---------------------------
//                                controlLed_1_2 [yellow]
// D3  ---------------------------
//                                controlLed_1_3 [green]
// D4  ---------------------------
//                                controlLed_2_1 [red]
// D5  ---------------------------
//                                controlLed_2_2 [yellow]
// D6  ---------------------------
//                                controlLed_2_3 [green]
// D7  ---------------------------
//                                controlLed_3_1 [red]
// D8  ---------------------------
//                                controlLed_3_2 [yellow]
// D9  ---------------------------
//                                controlLed_3_3 [green]
// D10 ---------------------------
//                                Buzzer
// D11 ---------------------------
//                                LDR [1]
// A1  ---------------------------
//                                LDR [2]
// A2  ---------------------------
//                                LDR [3]
// A3  ---------------------------



  // Define control leds as indicators.
  #define controlLed_1_1 2
  #define controlLed_1_2 3
  #define controlLed_1_3 4
  #define controlLed_2_1 5
  #define controlLed_2_2 6
  #define controlLed_2_3 7
  #define controlLed_3_1 8
  #define controlLed_3_2 9
  #define controlLed_3_3 10
  // Define Ldr analog pins to calculate solar panel energy and light intensity.
  #define Ldr_1 A1
  #define Ldr_2 A2
  #define Ldr_3 A3
  // Define the buzzer pin.
  #define buzzerPin 11 

  // Define solar panel variables emphasized by the guide. Do not forget to change them. 
  #define SP_area 0.0088
  #define SP_efficiency 6.2
  #define SP_coefficient 0.75

  // Define threshold values(low, moderate).
  #define low 8.18
  #define moderate 18.40 
  
  // Define variables to collect light intensity data.
  int LdrData_1;
  int LdrData_2;
  int LdrData_3;


  
void setup() {
  // Start serial ports.
  Serial.begin(9600);
  Serial.print("System Activated:");
  Serial.print("\n");
  Serial.print("Please connect all photoresistors and led to the defined Arduino Nano pins before uploading the code.");
  Serial.print("\n");
  Serial.print("Do not forget to change solar panel variables and threshold values!");
  // Start led outputs.
  pinMode(controlLed_1_1, OUTPUT);
  pinMode(controlLed_1_2, OUTPUT);
  pinMode(controlLed_1_3, OUTPUT);
  pinMode(controlLed_2_1, OUTPUT);
  pinMode(controlLed_2_2, OUTPUT);
  pinMode(controlLed_2_3, OUTPUT);
  pinMode(controlLed_3_1, OUTPUT);
  pinMode(controlLed_3_2, OUTPUT);
  pinMode(controlLed_3_3, OUTPUT);

}

void loop() {
  gatherLdrData();

  // Initial the indicators at three different directions.
  
  // Control_1
  IndicatorInitial(SolarPanelEnergy(SP_area, SP_efficiency, LdrData_1, SP_coefficient), controlLed_1_1, controlLed_1_2, controlLed_1_3, 1);
  // Control_2
  IndicatorInitial(SolarPanelEnergy(SP_area, SP_efficiency, LdrData_2, SP_coefficient), controlLed_2_1, controlLed_2_2, controlLed_2_3, 2);
  // Control_3
  IndicatorInitial(SolarPanelEnergy(SP_area, SP_efficiency, LdrData_3, SP_coefficient), controlLed_3_1, controlLed_3_2, controlLed_3_3, 3);
 

}

void gatherLdrData(){
   // Gather light intensity data from photoresistors each placed in a particular direction.
   LdrData_1 = analogRead(Ldr_1);
   LdrData_2 = analogRead(Ldr_2);
   LdrData_3 = analogRead(Ldr_3);
  }
  
  float SolarPanelEnergy(float Area, float Efficiency, int Radiation, float PerformansCoefficient){
     // Calculate the energy level of a solar panel approximately by assigning radiation levels to light intensity levels.
     float Energy = Area * Efficiency * Radiation * PerformansCoefficient;
     return Energy;
    }

    void IndicatorInitial(float predictedEnergy, int red, int yellow, int green, int number){
         // Adjust the range of the indicators according to the amount of the energy generated by a solar panel. And, get notified when the high threshold exceeded.
         // Write which control ldr gathers data.
         Serial.print("Control ["); 
         Serial.print(number); 
         Serial.print("] = \t");
         Serial.print(predictedEnergy);
         Serial.print("\n");
         
         if(predictedEnergy < low){
           digitalWrite(red, HIGH);
           digitalWrite(yellow, LOW);
           digitalWrite(green, LOW);
           noTone(buzzerPin);
          }else if(low <= predictedEnergy && predictedEnergy < moderate){
             digitalWrite(red, HIGH);
             digitalWrite(yellow,HIGH);
             digitalWrite(green, LOW);
             noTone(buzzerPin);
            }else if(predictedEnergy >= moderate){
               digitalWrite(red, HIGH);
               digitalWrite(yellow, HIGH);
               digitalWrite(green, HIGH);
               tone(buzzerPin, 300);
              }
          
      }
     

Custom parts and enclosures

Fritzing File
light-intensity-fritzing_eha9yq3ftf.fzz

Schematics

Schematics
1 oxxikbkgr5

Comments

Similar projects you might like

Dual Axis Solar Tracker Panel with Auto and Manual Mode

Project tutorial by Giannis Arvanitakis

  • 7,142 views
  • 6 comments
  • 37 respects

Mobile Weather Station Being Powered by Solar Energy

Project tutorial by Kutluhan Aktar

  • 3,419 views
  • 0 comments
  • 16 respects

Servo-Controlled, Light-Tracking Solar Panel Platform

Project tutorial by scott mangiacotti

  • 12,450 views
  • 10 comments
  • 41 respects

The Vibrating Pressure Temperature Altitude Tilt Detector

Project tutorial by Kutluhan Aktar

  • 1,661 views
  • 0 comments
  • 4 respects

The Light Box

Project tutorial by Wpeeters

  • 3,291 views
  • 2 comments
  • 18 respects

SERENA: Alarm Control Panel

Project tutorial by Michael Marinis

  • 6,895 views
  • 0 comments
  • 13 respects
Add projectSign up / Login