Arduino Solar Tracker
Arduino Solar Tracker
HOME PROJECTS MINI PROJECTS ARDUINO FREE CIRCUITS TUTORIALS SYMBOLS DIY
REVIEWS CONTACT US
In modern solar tracking systems, the solar panels are fixed on a structure that moves
according to the position of the sun.
Help us in selecting the next DIY Arduino Project. : Select your Favourite Project»
Let us design a solar tracker using two servo motors, a light sensor consisting of four
LDRs and Arduino UNO board.
Table of Contents
1. Circuit Diagram
2. Components Required
3. Working
4. Setup
4.1. Step-1
4.2. Step 2
4.3. Step 3
4.4. Step4
4.5. Step 5
4.6. Step 6
4.7. Step 7
4.8. Step 8
5. Project Code
Circuit Diagram
The circuit design of solar tracker is simple but setting up the system must be done
carefully.
Four LDRs and Four 100KΩ resistors are connected in a voltage divider fashion and the
output is given to 4 Analog input pins of Arduino.
The PWM inputs of two servos are given from digital pins 9 and 10 of Arduino.
Components Required
Arduino UNO [Buy Here]
Servo Motor [Buy Here]
Light Sensors
LDR
Resistors
Working
LDRs are used as the main light sensors. Two servo motors are fixed to the structure
that holds the solar panel. The program for Arduino is uploaded to the microcontroller.
The working of the project is as follows.
LDRs sense the amount of sunlight falling on them. Four LDRs are divided into top,
bottom, left and right.
For east – west tracking, the analog values from two top LDRs and two bottom LDRs are
compared and if the top set of LDRs receive more light, the vertical servo will move in
that direction.
If the bottom LDRs receive more light, the servo moves in that direction.
For angular deflection of the solar panel, the analog values from two left LDRs and two
right LDRs are compared. If the left set of LDRs receive more light than the right set, the
horizontal servo will move in that direction.
If the right set of LDRs receive more light, the servo moves in that direction.
Setup
Step-1
Take cardboard. Make a hole in the middle and four holes on four sides so that LDR
fit into that.
Stick the solar panel to the cardboard and bring two wires of the panel out as
shown.
Step 2
Now cut one of the two leads of the LDR so that one lead is shorter and other is
longer.
Insert these four LDRs into four holes as shown.
Bend the straight Perforated metal strip as shown below.
Place the bent metal strip on the back side of the cardboard
Apply glue to the LDR to fix them firmly.
Step 3
Step4
Now take a bus wire.This is used to connect the Outputs of four LDRs to Arduino
board.
Insert it into metal strip as shown in the image.
Now Solder the four wires to four LDRs at any point between LDR and resistor.
Step 5
Insert another two wire bus into the perforated metal strip as shown.This is used
for supplying Vcc and GND to LDR circuit.
Solder one wire to the leads of LDRs which are connected to resistors and other
wire to the other leads.
Short the leads of LDRs connected to resistors using a wire as shown.
Step 6
Now connect a servo motor to the Perforated metal strip using Screw.
Apply glue to the servo to fix it firmly.
Step 7
Take another straight Perforated metal strip and bend it as shown in the figure.
Step 8
Now place the set up of solar panel and first servo motor to the metal strip of
second servo motor as shown.
Project Code
1 #include <Servo.h>
2 //defining Servos
3 Servo servohori;
4 int servoh = 0;
7
8 Servo servoverti;
9 int servov = 0;
12 //Assigning LDRs
17
18 void setup ()
19 {
20 servohori.attach(10);
21 servohori.write(0);
22 servoverti.attach(9);
23 servoverti.write(0);
24 delay(500);
25 }
26
27 void loop()
28 {
29 servoh = servohori.read();
30 servov = servoverti.read();
36 // calculating average
41
42 if (avgtop < avgbot)
43 {
44 servoverti.write(servov +1);
45 if (servov > servovLimitHigh)
46 {
47 servov = servovLimitHigh;
48 }
49 delay(10);
50 }
52 {
53 servoverti.write(servov -1);
54 if (servov < servovLimitLow)
55 {
56 servov = servovLimitLow;
57 }
58 delay(10);
59 }
60 else
61 {
62 servoverti.write(servov);
63 }
64
65 if (avgleft > avgright)
66 {
67 servohori.write(servoh +1);
69 {
70 servoh = servohLimitHigh;
71 }
72 delay(10);
73 }
74 else if (avgright > avgleft)
75 {
76 servohori.write(servoh -1);
80 }
81 delay(10);
82 }
83 else
84 {
85 servohori.write(servoh);
86 }
87 delay(50);
88 }
Arduino Based Solar Tracking System hosted with by GitHub view raw
If you are the one who loves to craft inspiring projects then Arduino solar tracker is for
you. But still, if you are unable to design projects on your own that may be due to the lack
of components or some other issues. To them, we bought the Best Solar Panel Kits for
Homes that completely satisfies their requirements.
In this article, detailed information on solar panels like prices, power usage and
performance is given for the convenience of users. Make a try with these wonderful
solar panel kits to install them in your homes.
Related Posts:
Sun Tracking Solar Panel
Arduino Joystick Interface - Control Servo using…
How to make a Simple Servo Motor Tester Circuit?
Bluetooth Controlled Servo Motor using Arduino,…
Interfacing Flex Sensor with Arduino - Hookup Guide…
Controlling a Servo Motor with STM32F103C8T6 Blue Pill
FILED UNDER: ARDUINO
Comments
Venkat says
MARCH 15, 2016 AT 1:58 PM
How much power the panel is producing and how much the servos are consuming?
Reply
Anusha says
MAY 12, 2016 AT 12:27 AM
This designed only for tracking sun and increasing its efficiency….Power of the
solar panel is not considered…Servo motors used here consume very less
power..They are powered from arduino board it self
Reply
Sandeep says
MAY 5, 2018 AT 10:22 PM
Good
Reply
Mark.g says
JUNE 5, 2019 AT 11:37 AM
Can you please explain the steps for the programm….what do you declare of
each entry into the programm?
Reply
shahin says
DECEMBER 19, 2018 AT 10:07 PM
good job
Reply
Y.D.Stien says
DECEMBER 27, 2018 AT 9:09 PM
Reply
Ferit says
APRIL 10, 2016 AT 11:43 AM
Reply
excelent
Reply
Page excellent , and excellent projects for beginners im a student and I think this is
awesome because we need projects like this to be best. congratulations !
Reply
Purushothaman J says
APRIL 19, 2016 AT 8:24 AM
nice one
Reply
Purushothaman J says
APRIL 19, 2016 AT 8:25 AM
smart project
Reply
Antonio says
MAY 14, 2016 AT 8:53 AM
It could be a self sufficient system! Optimizes solar power generation, that could
power back the optimizer system itself! A win-win game! Very nice
Reply
greetings to you sir and all on this site. please i want to work this project in my school.
as my second year project in the university. What i want to ask is the solar panel
tracker tracking the sun light intensity for other panels on 100w or others?thank you
will be waiting for your reply
Reply
sir,if one has about 10 100w solar panels how can he connect the solar tracker,and
how many connection of the solar straker does he need
Reply
Dhruv jain says
JULY 16, 2016 AT 10:47 AM
Hello,
I tried makin the project bt d motors r moving very slow. They r not moving as fast as
given in d video. I tried changin d servo motor bt d isssue remains d same. Cn der b
ny oder prob
Reply
Thomas says
AUGUST 23, 2016 AT 7:59 AM
Hi, Anyone else noticed that the diagram might be wrong? It states 100k resistors,
however i believe it should be 10k? 10k is also listed in the picture text step 3
Reply
Is there any calculation required for angle by which servo motor will move…?
Reply
Gord. says
SEPTEMBER 9, 2017 AT 8:44 AM
Reply
SAmmy98 says
SEPTEMBER 24, 2016 AT 5:56 AM
Reply
Embedded says
NOVEMBER 10, 2016 AT 6:25 AM
Reply
Hanzla says
MAY 30, 2017 AT 8:48 AM
good
Reply
santhosh says
MARCH 13, 2017 AT 8:46 AM
Reply
Roby says
MARCH 19, 2017 AT 2:28 PM
Where can i found the metal strip that is used in the project?
Reply
Hey I want the advantage and application of Arduino based solar tracker
Reply
Reply
Anusha says
JUNE 20, 2017 AT 6:39 AM
Reply
Euloge says
APRIL 20, 2017 AT 6:17 AM
Thanks a lot!
Reply
Nagaraj says
APRIL 29, 2017 AT 10:55 AM
Sir plz help I connected ckt as per ur instructions but .. Model is not working
Reply
Anusha says
JUNE 21, 2017 AT 8:42 AM
Hi, Please check the connections once again. Try to calibrate the servos and LDR
before connecting.
Reply
andzer says
MAY 8, 2017 AT 5:52 AM
Hi, the arduino code has to change. As it is now, it is not possible to use the High/Low
limits for servos…
Reply
Anusha says
JUNE 21, 2017 AT 8:40 AM
The limits for Servo motors are made as per our convenience. Please calibrate
the servos and change the max limits for the servos.
Reply
hey , i thought that too, my motors arent working , pls can u send me the
corrected program
.pls the corrected code?
Reply
Sir, when I When I combined that source code with code for ESP8266 to display the
value of the LDR sensor on Thingspeak, the servo motor is not running. how to handle
it? Thanks before.
Reply
Anusha says
JUNE 21, 2017 AT 8:40 AM
Hi, we haven’t tried this particular setup. We will try it and update as soon as
possible.
Reply
hayder says
MAY 18, 2017 AT 11:31 AM
thanx
Reply
Hanzla says
MAY 29, 2017 AT 5:15 AM
Reply
Reply
How about using just two analog inputs? Place two LDR’s on adjacent sides of the
solar panels, not in the corners. One of the LDR’s works as a pull-up resistor and the
other one works as the pull-down resistor.
More thoroughly: connect 5V to the top side LDR, connect the other leg of the top side
LDR to analog pin A0, connect A0 further to the bottom side LDR. And the other leg of
the bottom side LDR to ground. Now, when the top gets more light, A0 voltage rises.
When panel twists upwards, the bottom LDR gets more light and A0 drops back to the
middle voltage. Similar connection for left and right and A1.
This setup might need additional resistors to assure that when the panel faces the
sun and both LDR’s get equally much light, the total resistance won’t drop too low to
draw too much current from the 5V. So you still need your 4 resistors, but you need
only two analog input ports and the programming might become easier.
Reply
Anusha says
JULY 12, 2017 AT 4:01 AM
Hi, This is actually a great idea and you can complete with just two Analog pins.
Try to share your work (in case you have implemented) so that others can benefit
from it.
Reply
Reply
Reply
calvin says
JULY 4, 2017 AT 7:30 PM
im using motor Ls-3006, once i connected everything and uploaded the program,
the motor keep rotating (more the 180 degree). How can i control the rotation angle of
the motor
Reply
Anusha says
JULY 12, 2017 AT 4:00 AM
Hi, You should use maximum limits for both sides (left and right) and restrict your
servo to rotate with in those limits.
Reply
Cindy says
JULY 5, 2017 AT 9:23 AM
For this code, are we supposed to put in any values? If yes, what should we put?
,servoh = servohori.read();
servov = servoverti.read();
Reply
Anusha says
JULY 12, 2017 AT 4:00 AM
Hi, By values, if you mean any user inputs, then we need to set the Servo motor
limits for both the servos. servoh = servohori.read();servov = servoverti.read();
This statement returns the current position of the servo in the form of angle
(between 0 and 180).
Reply
roshan says
JULY 14, 2017 AT 6:20 AM
i used the code provided above but it giving me error .plz help me fast i have project
on monday
Reply
Anusha says
JULY 20, 2017 AT 2:56 AM
Reply
Ahmed says
DECEMBER 10, 2017 AT 12:09 PM
Reply
Chong says
AUGUST 1, 2017 AT 5:23 AM
Reply
Charles says
AUGUST 8, 2017 AT 3:06 PM
Which compiler is used? the code wont work for atmel studio 7 unless more
peripherals and initialization is added
Reply
Glenn says
AUGUST 19, 2017 AT 12:16 AM
Could the servos be replaced with 12V linear motors, and the power to them be 12V
instead of 5V? I am new to this & looking to learn.
Thanks
Reply
Dale says
AUGUST 23, 2017 AT 3:37 AM
How can i make this together with a data Logger and also what’s the code for that?
Reply
jackie says
SEPTEMBER 13, 2017 AT 1:13 AM
hi, may i know you are using 180 degrees or 360 degrees servo motor?
Reply
EH Staff says
OCTOBER 9, 2017 AT 1:49 AM
Reply
keshaxa says
SEPTEMBER 15, 2017 AT 11:44 AM
Hello sir ,
Can u please give us the parts required and their details .so we can do it easily
Reply
mohsin says
SEPTEMBER 17, 2017 AT 7:24 AM
i want to provide power supply to arduino from battery or something else.so what
should i do
Reply
ibrahim says
SEPTEMBER 20, 2017 AT 9:25 AM
hi,
how can i use dc motor for this project.
Reply
Reply
Omar says
OCTOBER 6, 2017 AT 8:44 AM
Reply
EH Staff says
OCTOBER 9, 2017 AT 2:54 AM
Hi, We have used a 5mm LDR (Minimum Resistance of 400Ω and Maximum
Resistance of 1MΩ).
Reply
AgreVidya says
FEBRUARY 11, 2018 AT 8:52 AM
So it is working successfully??
Reply
Sagar says
OCTOBER 10, 2017 AT 8:51 AM
can anyone tell me about all the components name and their rating so i can purchase
them easily.
Reply
Abhishek says
OCTOBER 24, 2017 AT 2:39 AM
Reply
Can Another servo will work for this code instead of SG90
Reply
Ravi says
DECEMBER 26, 2017 AT 2:22 AM
Rajiv says
NOVEMBER 16, 2017 AT 8:45 PM
Can any one send me the application of solar tracking system using the ardiuno uno…
Plzzz it’s urgent….
Reply
Mert says
DECEMBER 12, 2017 AT 2:27 PM
When I took light and push it to LDR the panel is not stopping.It has a little bit
movements.If we take out the light the panel does not stay in the same position.Can
anyone say reason?
Reply
manos says
DECEMBER 21, 2017 AT 9:59 AM
Reply
Harshavardhan says
DECEMBER 28, 2017 AT 8:00 PM
plzz.. help me with the resistors at LDR is it 100k or 10k
or did they booth work .and how it impacts on analog read values …?
Reply
Shivani says
JANUARY 13, 2018 AT 7:32 AM
Reply
siddharth says
JANUARY 22, 2018 AT 12:13 PM
Super i done it
Reply
Reply
Gokul says
MARCH 30, 2018 AT 8:35 AM
Can you explain step 5 pls…
Reply
very…gooood!
Reply
Charan says
FEBRUARY 3, 2018 AT 12:43 PM
Reply
Adam says
FEBRUARY 6, 2018 AT 8:30 AM
Can you please help which one is the servo motor using for horizontal and vertical
rotation in the diagram
Reply
Reply
Hello this nice project., but i want to know all the materials for that project??
Reply
Reply
AgreVidya says
FEBRUARY 11, 2018 AT 8:55 AM
Hi..
Good idea..
But i want to know about solar panel which u used for this prpject…
Plz provide full information
Reply
REA says
FEBRUARY 14, 2018 AT 1:18 AM
Hi,
Could you please send the specifications for the servo motors and the LDR’s.
Reply
hera says
FEBRUARY 19, 2018 AT 5:06 AM
what if I only want to make a single axis? which LDR are used? the top ones? I still
confused about the movement of servo, which is the horizontal one
Reply
ABCDE says
FEBRUARY 20, 2018 AT 8:16 PM
Reply
Hi there.
I am having difficulty externally powering the Ardiuno in this project. It seems to only
work if I use the USB connection to my computer, but for the final project, I was
hoping to use a 9V battery, I know the Ardiuno is equipped with a voltage regulator, so
this shouldn’t be a problem, but the servos act extremely weird when the power
supply changes.
If anyone has ideas please let me know.
Reply
md.pappu says
MARCH 7, 2018 AT 2:10 AM
thank you
Reply
Jaswant says
MARCH 10, 2018 AT 12:58 PM
Sir can you tell me how we download program code of this project to upload uno
Reply
PRANAY says
MARCH 18, 2018 AT 12:35 PM
Reply
PRANAY says
MARCH 22, 2018 AT 12:46 AM
in my setup the servos are rotating very slow than that of shown in video ? what can i
don to increase its speed ? can decreasing resistance help?
Reply
Reply
sonu says
MARCH 27, 2018 AT 11:09 AM
Reply
Gokul says
MARCH 31, 2018 AT 9:15 AM
Can anyone explain step 5 for VCC and gnd I’m stuck there
Reply
Lovpreet says
APRIL 5, 2018 AT 6:23 PM
the panel moves with a jerk when operated. the motion is not smooth. what could be
the possible reason?
Reply
SANDHYAM says
APRIL 6, 2018 AT 4:47 AM
Reply
Anbu says
APRIL 9, 2018 AT 12:26 PM
Reply
Ravi says
APRIL 10, 2018 AT 4:00 AM
Arduino IDE.
Reply
xeexee says
MAY 22, 2018 AT 9:30 AM
hi, can this project be built with a heliostat mirror other than a solar panel
Reply
SHRUTI says
MAY 24, 2018 AT 8:44 AM
Reply
HOW MUCH POWER RATING IS SERVO MOTOR CAN USE. Please send the value
such as power, current, voltage rating.
Reply
CAN I USE LDR MODULE INSTEAD OF LDR? SHOULD I NEED TO CHANGE THE
PROGRAM
Reply
There doesn’t seem to be a sketch available to program the Arduino. Where might
that be found?
Reply
DIPAYAN DAS says
AUGUST 17, 2018 AT 9:16 AM
Reply
jahnavi says
OCTOBER 8, 2018 AT 6:49 AM
may i know which servo motor is used for west east movements i.e., vertical
movements from circuit diagram.
Reply
Reply
Reply
Avishesh says
DECEMBER 4, 2018 AT 5:03 AM
Reply
Is the Solar Cell powering the Arduino or are we using a different battery for the
Arduino.
Reply
Akhilesh says
FEBRUARY 21, 2019 AT 9:02 AM
Reply
Analog inputs of the Photo resistor voltages can only be taken by A0,A1,A2,A3,A4,A5
NOT NORMAL DIGITAL PINS LIKE 1,2,4,6……
Reply
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
POST COMMENT
KITS
SUBSCRIBE FOR UPDATES
SUBSCRIBE
Number System
TS EAMCET 2019
FOLLOW US
Youtube
Google Plus