Sun Tracking Solar Panel: Outline
Sun Tracking Solar Panel: Outline
(https://www.electronicshub.org)
Home (https://www.electronicshub.org)
AVR Microcontroller (https://www.electronicshub.org/free-project-circuits/embedded/avr/), DIY Projects
(https://www.electronicshub.org/diy-projects/), Electronics (https://www.electronicshub.org/free-project-
circuits/electronics/), Embedded (https://www.electronicshub.org/free-project-circuits/embedded/), Free Project
Circuits (https://www.electronicshub.org/free-project-circuits/), Solar
(https://www.electronicshub.org/previews/solar/)
Outline
Introduction
As the non renewable energy resources are decreasing, use of renewable resources for
producing electricity is increasing. Solar panels are becoming more popular day by day.
We have already read a post about how to install solar panel for home. Solar panel
absorbs the energy from the Sun, converts it into electrical energy and stores the
energy in a battery.
This energy can be utilized when required or can be used as a direct alternative to the
grid supply. Utilization of the energy stored in batteries is mentioned in below given
applications.
The position of the Sun with respect to the solar panel is not xed due to the rotation of
the Earth. For an e cient usage of the solar energy, the Solar panels should absorb
energy to a maximum extent.
This can be done only if the panels are continuously placed towards the direction of the
Sun. So, solar panel should continuously rotate in the direction of Sun. This article
describes about circuit that rotates solar panel.
Two light dependent resistors are arranged on the edges of the solar panel. Light
dependent resistors produce low resistance when light falls on them. The servo motor
connected to the panel rotates the panel in the direction of Sun. Panel is arranged in
such a way that light on two LDRs is compared and panel is rotated towards LDR which
have high intensity i.e. low resistance compared to other. Servo motor rotates the panel
at certain angle.
When the intensity of the light falling on right LDR is more, panel slowly moves towards
right and if intensity on the left LDR is more, panel slowly moves towards left. In the
noon time, Sun is ahead and intensity of light on both the panels is same. In such cases,
panel is constant and there is no rotation.
ATmega328 Microcontroller
ATmega328 is an AVR family micro controller. It is based on advanced RISC architecture.
It is an 8-bit controller. It has 32K Bytes of Programmable Flash memory, 1K Bytes of
EEPROM and 2K Bytes of SRAM. It has 23 programmable I/O pins. It supports peripheral
features like two 8-bit timers, one 16-bit timer, 6 channel ADC with 10-bit resolution,
programmable USART, Serial Peripheral Interface
(https://www.electronicshub.org/basics-serial-peripheral-interface-spi/), 2 wire serial
interface (I2C), etc.
Solar Panel
Solar panel is placed on a piece of cardboard (just for demonstration) and the bottom of
the cardboard is connected to Servo motor. Solar panel consists of photovoltaic cells
arranged in an order. Photovoltaic cell is nothing but a solar cell. Solar cell is made up of
semiconductor material silicon.
When a light ray from Sun is incident on the solar cell, some amount of energy is
absorbed by this material. The absorbed energy is enough for the electrons to jump
from one orbit to other inside the atom. Cells have one or more electric eld
(https://www.electronicshub.org/basics-of-electric- eld/) that directs the electrons which
creates current. By placing metal contact energy can be obtained from these cells.
LDR
Light Dependent Resistors or LDRs are the resistors whose resistance values depend on
intensity of the light. As the intensity of light falling on the LDR increases, resistance
value decreases. In dark, LDR will have maximum resistance. LDR will output an analog
value which should be converted to digital. This can be done using analog to digital
converter.
By connecting a battery to the solar panel, you can store the energy generated by the
solar cells and this energy can be used when required. There are separate charge
controller circuits dedicated to e ciently control the charge acquired from solar panels
and charge the batteries.
Code
In a previous tutorial, I have shown you “How to Burn Bootloader to ATmega328
(https://www.electronicshub.org/burn-bootloader-on-atmega328/)”. In this tutorial, you
can understand how to upload code to the ATmega328 Microcontroller using Arduino
IDE.
The code for the project is given below.
1 #include <Servo.h>
2
3 Servo myservo;
4 int ldr1 = 4;
5 int ldr2 = 5;
6 int val1;
7 int val2;
8 int pos=90;
9
10 void setup()
11 {
12 myservo.attach(11);
13 Serial.begin(9600);
14 myservo.write(pos);
15 }
16
17
18
19 void loop()
20 {
21 val1 = analogRead(ldr1);
22 val2 = analogRead(ldr2);
23 val1 = map(val1, 0, 1023, 0, 180);
24 val2 = map(val2, 0, 1023, 0, 180);
25 if(val1 > (val2+50))
26 {
27 if(pos<180)
28 pos=pos+1;
29 myservo.write(pos);
30 Serial.println("backward");
31 delay(10);
32 }
33 else if(val2 > (val1+50))
34 {
35 if(pos>0)
36 pos=pos-1;
37 myservo.write(pos);
38 Serial.println("forward");
39 delay(10);
40 }
41
42 }
os/3deabec4a261deae22273de59bd041f8/raw/ecfe14f6e17d1637e3d820b30530840a03f0fd79/Sun_Tracking_Solar_Panel.ino)
❤
Sun_Tracking_Solar_Panel.ino (https://gist.github.com/elktros/3deabec4a261deae22273de59bd041f8#file-
sun_tracking_solar_panel-ino) hosted with by GitHub (https://github.com)
Related Posts:
Do Solar Panels Store Energy (https://www.electronicshub.org/do-solar-panels-
store-energy/)
Solar Panel Sizes and Weights - Complete Guide
(https://www.electronicshub.org/solar-panel-size/)
Do Solar Lights Require Direct Sunlight? (https://www.electronicshub.org/solar-
lights-need-sunlight/)
What Size Solar Panel to Charge 12V Batteries?
(https://www.electronicshub.org/what-size-solar-panel-to-charge-12v-battery/)
How Many Solar Panels to Charge a Car? (https://www.electronicshub.org/solar-
panels-to-charge-a-car/)
Want to Know More About Solar Panel Monitoring?
(https://www.electronicshub.org/solar-panel-monitoring/)
58 Responses
SARAVANAN says:
very super projects will be given .Thank u for this help everyone must use this sun
tracking solar panel.
Reply
priyanka says:
↪
We are doing the same project but instead of using microcontroller we are going to
used Labview sofware.Is there any specific rating for the solar panel in this project.
So,please do help.
Reply
Administrator says:
↪
No specific rating for the panel. In this project, the solar panel only moves in the
direction of Sun in order to produce more power.
Reply
balaji says:
↪
Hoe can i use lab view for this project ? pls guide me
Reply
ram says:
↪
Asad says:
Hello dear. Have you done the project if yes then can you help me please as i am
doing it as my semester project. Here is my mail, your contact will be appreciated.
Thank you.
Reply
Reply
Navin says:
Reply
kamlesh says:
Reply
prasad says:
↪
Reply
Reply
p.suganya says:
Reply
Avinash says:
Is there any code required for the microcontroller.
Reply
ashish says:
Reply
Anusha says:
↪
Yes it requires code but it is not practically implemented..We will update it soon
Reply
Reply
Deepak says:
Code plz
Reply
Reply
David says:
↪
Please guide me… I’m under going to this project…. In very short time to submit this
project
Reply
Reply
Reply
Anusha says:
↪
Here Motor driver L293D can drive upto 30v maximum.So you can use motor upto
30v.While Solar Panel Rating is selected depending on your application
Reply
asrul says:
can you help me by sending the code programming for this project because it will help me
for my final year project
Reply
Hello Sir, we are currently working on this concept, and stuck up in coding part, can you
help us in that, Please…
Reply
ravinder says:
saini_ravinder@hotmail.com (mailto:saini_ravinder@hotmail.com)
Reply
muhib says:
Reply
Jhonatan says:
Can you please send me the code?
This is my email adress : projeto.geogebra@gmail.com
(mailto:projeto.geogebra@gmail.com)
Thanks
Reply
can anybody suggest how to learn progamming code and how dump it into the kit
Reply
sandesh says:
Reply
am currently working on this project can any one send me a code pls my mail id is
avinash051297@gmail.com (mailto:avinash051297@gmail.com)
Reply
Ajay says:
it is an very good idea, but what happen if we use lens to concentrate sun light on the
panel.
Reply
James G says:
↪
Then you would overheat the cell, that might destroy the cell also the heat creates
inefficient pannel.
Reply
jimil says:
↪
we can use mirror… which is improve efficiency by 33% if its on good position with
all solar panels in lines.
Reply
Pse members iam currently doing the same project pse any body with the code send it to
me on bwireemma6@gmail.com (mailto:bwireemma6@gmail.com)
Thanx in advance
Reply
Gunasankari R says:
Reply
Reply
Reply
Mudasir says:
Reply
Reply
vivek says:
iam unable to find the code for this project.expecting a code soon
Reply
Reply
Vijay says:
Hii..sir it is good project which gives much more efficiency then the normal solar panel .. I
am also making the same project so .. I need a help that the exact ratings of the motor
and solar panel and I want to know how the connections are give .. plz as much as quick
rply me.. I need to do submit my project in very less time .. plz ..
Reply
Did anyone respond to your Question I want to do this project for my Engineering class,
Do you buy the parts from them are buy online somewhere else
Reply
Pls guys I’m a final year student in electrical electronics engineering department
Reply
Ajith says:
Reply
uday says:
what is the name of the driver IC used for controlling the stepper motor
Reply
Ravi says:
↪
L293D
Reply
Abcd says:
↪
No its ULN2003
Reply
Reply
Thank u soo much electronics hub… This article helped us in our final year project….. The
language used in your article is very easy to understand….also helped in external
viva….tysm
Reply
If you put the 2 photocells in series across the power supply and take the centrepoint to a
processor input, you only need the single input line. If voltage is around half supply keep
motor still. If higher, drive one way; if lower, drive the other way.
Reply
Ryan says:
Reply
Can you please give me some more references for this project since I am a sy student
and don”t know much about micro controller?
Reply
Asad says:
Reply
Pranav patil says:
Reply
Sunny says:
Can any one help me the detailed circuit connection for this project, im confused.
Reply
samuel says:
Reply
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Post Comment
(htt (htt
ps:/ ps:/ (htt
/w /ww ps:/
ww. (htt w.y /w
fac p:// out ww.
(https://www.electronicshub.org)
ebo twit ube. inst
ter. co
ok.cco m/uagr
om/ am.
Getelec m/e ser/
Our Latest Newletters co
Get Greath_o
Contentelec
tron m/e
That You Love.
No Ads Or
icsh rg)
Spams, tron
We Promise.
h_o
ub. icsh rg/)
Enter your email org) ubo Sign Up
rg)
Your Privacy Is Important To Us
General
Projects
Projects
Tutorials