Arduino Based Solar Tracker Using LDR & Servo Motor

Arduino Based Solar Tracker Using LDR & Servo Motor (Last Updated On: March 21, 2019)

Introduction:

In this project, we are going to show you how to make a Arduino Based Solar Tracker Using LDR & Servo Motor. The solar panel tracker is designed to follow the sun movement so that maximum light intensity hits on the solar panel, thus increasing the power efficiency.

We have designed Single axis solar tracking system. In this system, the whole solar panel moves from east to west in a day to point in the direction of the sun. Use of a solar tracker circuit in the field of energy production will increase its efficiency. This system can also be successfully implemented in other solar energy based projects like water heaters and steam turbines.


Arduino Based Solar Tracker Using LDR & Servo Motor:

Components Required:

Following are the list of components required to design a Solar Tracker

1. Arduino Uno Board
2. Servo Motor SG90
3. Tact Switch (Button)
4. Resistors 10K - 3 Nos
5. Breadboard
6. Connecting Wires
7. 5 to 12 Volt power Supply.



Components Required:

The circuit diagram for the Arduino Based Solar Tracker Using LDR & Servo Motor is given below. Assemble the circuit as shown below.

Arduino Based Solar Tracker Using LDR & Servo Motor


Project Design & Consideration:

1. Fix the cardboard at the top of the Servo Motor that will face towards the SUN and rotate:
Arduino Based Solar Tracker Using LDR & Servo Motor

2. Put a Blockage between the 2 LDR by keeping it at distance of at least 5 cm.
Arduino Based Solar Tracker Using LDR & Servo Motor


Working of the Project:

Two LDR’s (Light Dependent Resistor) LDR1 & LDR2 are connected to Analog pins of the Arduino. A solar plate is attached in parallel to the axis of servo motor and both the sensors are kept on the solar plate as shown in the figure above.

The design & arrangement is done in such a manner that the movement of sun is from LDR1 to LDR2, as shown in the image below.

Arduino Based Solar Tracker Using LDR & Servo Motor

There are three cases that is to be followed:-

Case 1: Sun is in left side
Light on LDR1 is high because shadow of barrier falls on LDR2 so solar plate moves clockwise.



Case 2: Sun is in right Side
Light on LDR2 is high because shadow of barrier falls on LDR1 so solar plate movie anticlockwise.

Case 3: Sun is in the Center
Light on both LDR’s are equal so, plate will not rotate in any direction.


Arduino Source Code:

For designing Arduino Based Solar Tracker Using LDR & Servo Motor you need to program Atmega 328 Arduino microcontroller. Below is the program that will interface servo motor & LDR with Arduino for Solar Tracking. Copy this code and upload it to your Arduino Board.

#include <EEPROM.h>
#include <Servo.h>

Servo myservo;

int sensor1=A1;
int sensor2=A0 ;
int calswitch=2;

int val1;
int val2;

int pos=0;
int error;
int state;

void setup() {
pinMode(sensor1,INPUT);
pinMode(sensor2,INPUT);
pinMode(calswitch,INPUT);

myservo.attach(10);
}

void loop() {
if(digitalRead(calswitch)==0) {
myservo.detach();

val1=analogRead(sensor1);
val2=analogRead(sensor2);

if (val1>val2) {error=val1-val2; state=0; }
else {error=val2-val1; state=1; }

EEPROM.write(0,error);
EEPROM.write(1,state);

delay(1000);
}

else{
myservo.attach(10);

val1=analogRead(sensor1);
val2=analogRead(sensor2);

state=EEPROM.read(1);
error=EEPROM.read(0);

if(state==0) { val1=val1-error;}
else { val2=val2-error;}

if (val1-val2>4) {myservo.write(pos); pos=pos-1; delay(10);}
else if (val2-val1>4) {myservo.write(pos); pos=pos+1; delay(10);}
else {myservo.write(pos);}

if (pos>90) {pos=90;}
else if (pos<0) {pos=0;}

}
}

Video Preview & Explanation:



Recommended For You

About the Author: Alex Newton

6 Comments

    1. We don’t have block diagram but you can take help of this post. Read everything here and create your own block diagram.

  1. i have connected everything accordingly but servo motor is not working can you tell me what is the problem pls its urgent….

    1. Check the program, servo pin number. And also check hardware connection, that should have same pin number.
      If still it does nt work may be servo is damaged.

Ask A Question .......

Close