Introduction:
In this project, we are going to show you how to make an 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 a 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. The 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
- Arduino Uno Board
- Servo Motor SG90
- Tact Switch (Button)
- Resistors 10K – 3 Nos
- LDR – 2 Nos
- Breadboard
- Connecting Wires
- 5 to 12 Volt power Supply
Circuit Diagram
The circuit diagram for the Arduino Based Solar Tracker Using LDR & Servo Motor is given below. Assemble the circuit as shown below.
Project Design & Consideration:
- Fix the cardboard at the top of the Servo Motor that will face towards the SUN and rotate:
-
Put a Blockage between the 2 LDR by keeping it at distance of at least 5 cm.
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 the servo motor and both the sensors are kept on the solar plate as shown in the figure above. Learn about LDR Arduino working in our previous post.
The design & the arrangement is done in such a manner that the movement of the sun is from LDR1 to LDR2, as shown in the image below.
There are three cases that are to be followed:-
Case 1: Sun is in the left side
Light on LDR1 is high because the shadow of barrier falls on LDR2 so solar plate moves clockwise.
Case 2: Sun is in right Side
Light on LDR2 is high because the shadow of barrier falls on LDR1 so solar plate movie anticlockwise.
Case 3: Sun is in the Center
Light on both LDR’s is equal so, plate will not rotate in any direction.
Source Code/Program
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
#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:
This project can be implemented with Solar MPPT Charge Controller to increase the efficiency of the Solar Panel output power.</p
7 Comments
Sir we have got the output…….tq for sharing sir……can you share the blockdiagram of this project
We don’t have block diagram but you can take help of this post. Read everything here and create your own block diagram.
i have connected everything accordingly but servo motor is not working can you tell me what is the problem pls its urgent….
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.
i am not able to understand circuit diagram.
Can I implement same circuit using DC motor instead of servo motor. If possible tell me how to the code.
Hi. What is tactile switch for? What will happen if I dont use thw switch?