Arduino Solar Tracker Using LDR Sensor and Servo Motor

Arduino Solar Tracker


Arduino Solar Tracker

Solar power is one of the fastest growing industries in the world; Today, more than 65 GW energy generated solar power. Solar power due to recovery, it is a good resource, especially for the country to build.

In this project, I'll show you how to make a solar Tracker using an Arduino. Pengesan solar panels designed to monitor the movement of the sun so that the maximum intensity of light in the solar panel as soon as such increases the power of Gus. The use of solar pengesan circuits in the area of spending power will increase almost 25%. The system can be successfully implemented even in turbine water heaters and on the basis of other projects.

Basically there are two types of Arduino Solar Tracking. One is the one-axis Solar Tracker and others are two axes. Pengesanan the only axis of the solar system moving solar panels from east to West during the day for Menghala in the direction of the sun. Two axis solar monitoring uses the engine moving solar panels in all four directions (north-southeast-West &).

South North is not a movement that advanced or great helplessness, since it covers only 20 degrees in half a year and the rest of the year and a half moves from north to south and we can set it by hand, in a week. Since the Trace east-west is more important, I will be able to explain more than Single-axis solar tracking.

Arduino Solar Tracker-Work

In this Arduino Nano project to be used, which acts as a unit that is Berkawal. Two LDR (a light dependent roadblock can be) is also connected to an analog PIN with the Arduino. The dish is attached to the stupid to become parallel to the axis of the servo motor and the sensor both will be stored on the salary, as shown in the picture below.

Arduino Solar Tracker-Work

Arduino Solar Tracker – Solar Panel with LDR

LDR Sensor Movement


LDR Sensor Movement


There are three conditions to be followed:-

Condition 1:

Sun is in left side – Light on sensor1 is high because shadow of barrier falls on sensor 2 so solar plate moves clockwise.

Condition 2:

Sun is in right Side – Light on sensor2 is high because shadow of barrier falls on sensor1 so solar plate movie anticlockwise.

Condition 3:

Sun is in the middle – Light on both sensors are equal so, plate will not rotate in any direction.

Components Used

Component Specification        Quantity
Arduino Nano            1
USB Cable For Programming       1
Switch SPDT     1
Switch                 Momentary     1
Resistors           10K Ohm             3
LDR Sensor             2
Servo Motor 9g             1
Power Source 9 or 12 Volt     1

PCB Copper Clad/Zero PCB


Circuit

A PCB (Printed circuit board) is designed for this Solar Tracker Arduino. Using a breadboard or Zero PCB are also other simpler options to create this solar tracker circuit. For PCB printing refer the PCB design shown below.

PCB Design for Arduino Solar Tracker

PCB Design for Arduino Solar Tracker

PCB Design for Arduino Solar Tracker


Arduino Solar Tracker – Circuit Diagram

Arduino Solar Tracker – Circuit Diagram

In the circuit two LDR (Light Dependent Resistors) sensors are used to sense the light. Since LDR is an analogue sensor they are connected to the analog pins A0 and A1 of Arduino. The sensors are connected in series with 10 k ohm resistors.

Arduino Solar Tracker – Circuit Diagram


A servomotor is also connected to the digital pin D10. D10 is a PWM (pulse width modulation) pin. A momentary switch is also connected to digital pin D2, mainly for calibration purposes. When the switch is pressed D2 pin will act as the ground (GND). A 12-volt adapter or 9 volt battery, can be used to power this whole circuit. RAW pin in Arduino Nano is the power pin.

Program/Code

Download Program

We are using EEPROM and Servo Motor so two header files “EEPROM.h” and “Servo.h” are used in the starting of code. Next a servo motor is defined by the name “myservo”. Two integers are defined by names sensor1 and sensor2.  Calibration switch is connected to D2 pin so another integer is defined by “calswitch”. Other integers are defined by names val1, val2, pos, & error. All these states are used for internal processes.

In the void setup sensor1, sensor2 and calswitch are defined as input. Now servo is activated by “myservo.attach(10)” function.

In the void loop section first of all an “if” condition is used for calibration. When momentary switch is pressed this “if” condition becomes true. In this condition servo the motor is deactivated by function “myservo.detach(10)”. Next values of sensors are assigned in integer “val1” and “val2”. According to the value of val1, val2 & error, thestate is saved in EEPROM using function “EEPROM.write()”, and a delay of 1 second is used at the end of this loop. Now calibration process is done.

Program/Code


In else loop “myservo.attach” is used to activate the servo, val1 and val2 are read by using “analogRead” function, after that state and error is read from EEPROM using “EEPROM.read” function after that error is removed from val1 or val2.

Three conditions are described in working of project, these conditions are executed in the code using “if else” conditions, in this way servo rotates clockwise or anticlockwise according to sunlight.

The rotational movement of the solar panel should not should be confined between o and 90 degrees. When “pos” becomes more then 90 degree an if condition is used for making this 90 degree and same concept is used when it becomes less than 0 degree.

Calibration

This project is featured by self-calibration so it does not need any preset or variable resistor for calibration; you just need to press a momentary switch. For calibration, press and hold the switch, which is connected to pin D2 and rotate the solar plate in direction of sun and release after 2- 3 seconds. By using this simple process, Arduino reads the value of sensors and saves the error state in EEPROM. This system needs one time calibration.