Solar Tracker For Solar Panel PDF
Solar Tracker For Solar Panel PDF
Solar Tracker For Solar Panel PDF
FACULTY OF ENGINEERING
BY
F17/2381/2009
Project report submitted in partial fulfillment of the requirement for the award for the
degree of
1) I understand what plagiarism is and I am aware of the university policy in this regard.
2) I declare that this final year project report is my original work and has not been submitted
elsewhere for examination, award of a degree or publication. Where other people’s work
or my own work has been used, this has properly been acknowledged and referenced in
accordance with the University of Nairobi’s requirements.
3) I have not sought or used the services of any professional agencies to produce this work.
4) I have not allowed, and shall not allow anyone to copy my work with the intention of
passing it off as his/her own work.
5) I understand that any false claim in respect of this work shall result in disciplinary action,
in accordance with University anti-plagiarism policy.
Approved by:
Signature:……………………… Date…………………………
ii
DEDICATION
To my family for their support during my university education, particularly my Dad and sister
Linda Oloka for always being available for me and their unwavering support.
iii
ACKNOWLEDGEMENT
I would like to express my gratitude to Mr. S.A. Ahmed, who was my supervisor, for his
constant guidance in the implementation of this project. I must particularly thank him for his
commitment and unrelenting effort to see me do all the assignments appertaining to this project
and finally I can say I am done. He was always available for consultation and ensured there was
no laxity in the implementation of the project. I particularly thank him for his insight, his advice
and help towards the overall success of this project. Without his encouragement, I am not sure if
the project would have been implemented as successfully as is the case.
Mr. Wangai of the mechanical workshop laboratory was very resourceful when it came to
building the mechanical structure and working on the PCB. I would also like to extend my
gratitude towards the examiner, Prof. Mwangi for taking his time to go through this project
documentation and also handling the presentation of the project.
Finally, I would also like to thank my friends and classmates with whom we spent sleepless
nights at times when trying to get some concepts right. My classmate Edkevin Chege was one
such person. My good friend Timothy Ndung’u Kyalo was very instrumental in helping with the
software part for which I was not too well conversant. Finally, I was able to come up with a
working project. Guys, that moral support and psyche could not have come at a better time and
for a better cause. I also thank my brother George Bush who was instrumental when it came to
designing the body of the project that was to hold the panel.
Above everything else, I thank the Lord for seeing me thus far with all this work. His guidance is
something I could not do without.
iv
TABLE OF CONTENTS
ACKNOWLEDGEMENT ...................................................................................................... iv
ABSTRACT............................................................................................................................. xi
v
2.5.2 Passive solar tracking .................................................................................................... 10
3.5 Crystal................................................................................................................................. 22
vi
3.7 Microcontroller ................................................................................................................... 25
REFERENCES ........................................................................................................................ 42
APPENDIXES ......................................................................................................................... 43
Appendix Two: Code for obtaining the results from the LDRs .................................................. 46
Appendix Three: Code for obtaining the stored values of readings from the LDRs in Volts ....... 49
vii
LIST OF TABLES
Table 2.1: Range of the brightness of sunlight (lux).....................................................................9
Table 4.1: Results for cloudy Morning and Sunny Afternoon for 6th and 7th April 2015 ............ 34
Table 4.2: LDR outputs for bright sunny day on 2nd April 2015 ................................................ 35
Table 4.3: Results for LDR outputs for a cloudy day on 12th April 2015 .................................... 36
viii
LIST OF FIGURES
Figure 2.1: Solar Cell .................................................................................................................5
Figure 3.3: The input circuit that employs a voltage divider. ..................................................... 19
Figure 4.2: Graph for bright sunny day of 2nd April 2015 .......................................................... 36
Figure 4.3: Graph of LDR outputs for a cloudy day on 12th April 2015 ..................................... 37
ix
ABBREVIATIONS AND ACRONYMS
ADC Analog to Digital Converter
EEPROM Electrical Erasable programmable Read Only Memory
D Diode
DC Direct current
GND Ground
I Current
I/O Input/ Output
IDE Integrated Development Environment
LDR Light Dependent Resistor
LED Light Emitting Diode
LUX Luminous Flux
LED Light Emitting Diode
MAX Maximum
MCU Microcontroller
MIN Minimum
VCC Supply voltage
UV Ultra Violet Light
PV Photovoltaic panels
R Resistor
x
ABSTRACT
Solar energy is fast becoming a very important means of renewable energy resource. With solar
tracking, it will become possible to generate more energy since the solar panel can maintain a
perpendicular profile to the rays of the sun. Even though the initial cost of setting up the tracking
system is considerably high, there are cheaper options that have been proposed over time. This
project discuses the design and construction of a prototype for solar tracking system that has a
single axis of freedom. Light Dependent Resistors (LDRs) are used for sunlight detection.
Silicon solar cells produced an efficiency of 20% for the first time in 1985. Whereas there has
been a steady increase in the efficiency of solar panels, the level is still not at its best. Most
panels still operate at less than 40%. As a result, most people are forced to either purchase a
number of panels to meet their energy demands or purchase single systems with large outputs.
There are types of solar cells with relatively higher efficiencies but they tend to be very costly.
One of the ways to increase the efficiency of solar panels while reducing costs is to use tracking.
Through tracking, there will be increased exposure of the panel to the sun, making it have
increased power output. The trackers can either be dual or single axis trackers. Dual trackers are
more efficient because they track sunlight from both axes.
A single tracking system was used. It is cheaper, less complex and still achieves the required
efficiency. In terms of costs and whether or not the system is supposed to be implemented by
those that use solar panels, the system is viable. The increase in power is considerable and
therefore worth the small increase in cost. Maintenance costs are not likely to be high.
xi
CHAPTER ONE: INTRODUCTION
When it comes to the development of any nation, energy is the main driving factor. There is an
enormous quantity of energy that gets extracted, distributed, converted and consumed every
single day in the global society. Fossil fuels account for around 85 percent of energy that is
produced. Fossil fuel resources are limited and using them is known to cause global warming
because of emission of greenhouse gases. There is a growing need for energy from such sources
as solar, wind, ocean tidal waves and geothermal for the provision of sustainable and power.
Solar panels directly convert radiation from the sun into electrical energy. The panels are mainly
manufactured from semiconductor materials, notably silicon. Their efficiency is 24.5% on the
higher side. Three ways of increasing the efficiency of the solar panels are through increase of
cell efficiency, maximizing the power output and the use of a tracking system.
Maximum power point tracking (MPPT) is the process of maximizing the power output from the
solar panel by keeping its operation on the knee point of P-V characteristics. MPPT technology
will only offer maximum power which can be received from stationary arrays of solar panels at
1
any given time. The technology cannot however increase generation of power when the sun is
not aligned with the system.
Solar tracking is a system that is mechanized to track the position of the sun to increase power
output by between 30% and 60% than systems that are stationary. It is a more cost effective
solution than the purchase of solar panels.
There are various types of trackers that can be used for increase in the amount of energy that can
be obtained by solar panels. Dual axis trackers are among the most efficient, though this comes
with increased complexity. Dual trackers track sunlight from box axes. They are the best option
for places where the position of the sun keeps changing during the year at different seasons.
Single axis trackers are a better option for places around the equator where there is no significant
change in the apparent position of the sun.
The level to which the efficiency is improved will depend on the efficiency of the tracking
system and the weather. Very efficient trackers will offer more efficiency because they are able
to track the sun with more precision. There will be bigger increase in efficiency in cases where
the weather is sunny and thus favorable for the tracking system [1].
2
supposed to track the sun’s movement in the sky. In order to save power, it is supposed to sleep
during the night by getting back into an horizontal position. There is implementation of an
algorithm that solves the motor control that is then written into C- program on Arduino IDE.
1.4 Objectives
The project was carried out to satisfy two main objectives:
Design a system that tracks the solar UV light for solar panels.
Prove that the tracking indeed increases the efficiency considerably. The range of
increase in efficiency is expected to be between 30 and 40 percent.
3
1.6 Methodology
The circuit of the solar tracker system is divided into three sections. There is the input stage that
is composed of sensors and potentiometers, a program in embedded software in the
microcontroller and lastly the driving circuit that has the servo motor. The input stage has two
LDRs that are so arranged to form a voltage divider circuit. A C program loaded into the Atmega
328P forms the embedded software. There is a metallic frame that houses the components. The
three stages are designed independently before being joined into one system. This approach,
similar to stepwise refinement in modular programming, has been employed as it ensures an
accurate and logical approach which is straight forward and easy to understand. This also ensures
that if there are any errors, they are independently considered and corrected.
4
CHAPTER 2: LITERATURE REVIEW
2.1 Introduction
A solar tracker is a device used for orienting a photovoltaic array solar panel or for concentrating
solar reflector or lens toward the sun. The position of the sun in the sky is varied both with
seasons and time of day as the sun moves across the sky. Solar powered equipment work best
when they are pointed at the sun. Therefore, a solar tracker increases how efficient such
equipment are over any fixed position at the cost of additional complexity to the system. There
are different types of trackers.
Extraction of usable electricity from the sun became possible with the discovery of the
photoelectric mechanism and subsequent development of the solar cell. The solar cell is a
semiconductor material which converts visible light into direct current. Through the use of solar
arrays, a series of solar cells electrically connected, there is generation of a DC voltage that can
be used on a load. There is an increased use of solar arrays as their efficiencies become higher.
They are especially popular in remote areas where there is no connection to the grid.
Photovoltaic energy is that which is obtained from the sun. A photovoltaic cell, commonly
known as a solar cell, is the technology used for conversion of solar directly into electrical
power. The photovoltaic cell is a non mechanical device made of silicon alloy.
5
The photovoltaic cell is the basic building block of a photovoltaic system. The individual cells
can vary from 0.5 inches to 4 inches across. One cell can however produce only 1 or 2 watts that
is not enough for most appliances. Performance of a photovoltaic array depends on sunlight.
Climatic conditions like clouds and fog significantly affect the amount of solar energy that is
received by the array and therefore its performance. Most of the PV modules are between 10 and
20 percent efficient [4].
6
The movement of the earth round the sun is known as revolution. It also happens from west to
east and takes a period of 365 days. The orbit of the earth is elliptical. Because of this the
distance between the earth and the sun keeps changing. The apparent annual track of the sun via
the fixed stars in the celestial sphere is known as the ecliptic. The earth’s axis makes an angle of
66.5 degrees to the ecliptic plane. Because of this, the earth attains four critical positions with
reference to the sun [7].
The total power of the sun can be estimated by the law of Stefan and Boltzmann.
T is the temperature that is about 5800K, r is the radius of the sun which is 695800 km and σ is
the Boltzmann constant which is 1.3806488 × 10 -23 m2 kg s-2 K-1. The emissivity of the surface is
denoted by ϵ. Because of Einstein’s famous law E=mc2 about millions of tons of matter are
converted to energy each second. The solar energy that is irradiated to the earth is 5.1024 Joules
per year. This is 10000 times the present worldwide energy consumption per year.
Solar radiation from the sun is received in three ways: direct, diffuse and reflected.
7
Direct radiation: is also referred to as beam radiation and is the solar radiation which travels on a
straight line from the sun to the surface of the earth.
Diffuse radiation: is the description of the sunlight which has been scattered by particles and
molecules in the atmosphere but still manage to reach the earth’s surface. Diffuse radiation has
no definite direction, unlike direct versions.
Reflected radiation: describes sunlight which has been reflected off from non-atmospheric
surfaces like the ground [8].
2.4 Sunlight
Photometry enables us to determine the amount of light given off by the Sun in terms of
brightness perceived by the human eye. In photometry, a luminosity function is used for the
radiant power at each wavelength to give a different weight to a particular wavelength that
models human brightness sensitivity. Photometric measurements began as early as the end of the
18th century resulting in many different units of measurement, some of which cannot even be
converted owing to the relative meaning of brightness. However, the luminous flux (or lux) is
commonly used and is the measure of the perceived power of light. Its unit, the lumen, is
concisely defined as the luminous flux of light produced by a light source that emits one candela
of luminous intensity over a solid angle of one steradian. The candela is the SI unit of luminous
intensity and it is the power emitted by a light source in a particular direction, weighted by a
luminosity function whereas a steradian is the SI unit for a solid angle; the two-dimensional
angle in three-dimensional space that an object subtends at a point.
Sunlight ranges between 400 lux and approximately 130000 lux, as summarized in the table
below.
8
Table 2.1: Range of the brightness of sunlight (lux)
Luminous flux (lux)
Time of day
Sunrise or sunset on a clear day 400
Overcast day 1000
Full day (not direct sun) 10000 – 25000
Direct sunlight 32000 – 130000
9
2.4.3 Azimuth angle
This is the compass direction from which the sunlight is coming. At solar noon, the sun is
directly south in the northern hemisphere and directly north in the southern hemisphere. The
azimuth angle varies throughout the day. At the equinoxes, the sun rises directly east and sets
directly west regardless of the latitude. Therefore, the azimuth angles are 90 degrees at sunrise
and 270 degrees at sunset [8].
10
2.5.4 Single axis trackers
Single axis trackers have one degree of freedom that act as the axis of rotation. The axis of
rotation of single axis trackers is aligned along the meridian of the true North. With advanced
tracking algorithms, it is possible to align them in any cardinal direction. Common
implementations of single axis trackers include horizontal single axis trackers (HSAT),
horizontal single axis tracker with tilted modules (HTSAT), vertical single axis trackers (VSAT),
tilted single axis trackers (TSAT) and polar aligned single axis trackers (PSAT) [8].
11
Figure 2.5: Sun path diagram for Nairobi
Key:
12
Through the use of the chart, it is possible to ascertain the position of the sun at different times
and seasons so that the panel can be fixed for maximum output. Fixed trackers are cheaper in
tropical countries like Kenya. For countries beyond +10 degrees North and -10 degrees South of
the equator, there is need for serious tracking. This is because the position of the midday sun
varies significantly.
The chart shows that the position of the sun is highest between 1200h and 1400h. For the periods
outside this range, the collectors are obliquely oriented to the sun and therefore only a fraction
reaches the surface of absorption.
sin ωt 2IS
W= IS cos ωt dt = I S = ,( )
ω ω
= 3.03 × 10 W/m2 day
= 8.41 kWh/m2 day, (3)
13
= 13.2kWh/m2 day.(5)
Comparing the theoretical results for the two cases, more energy is obtained from the second
case, for the tracking collector. However, as the rays of the sun travel towards the earth, they go
through the thick layers of the atmosphere in both of the cases. That notwithstanding, the
tracking collector has more exposure to the sun’s energy at any given time.
The efficiency of solar cells is determined as the fraction of incident power that is converted to
electricity. It is defined as:
[6]
14
The input power for efficiency calculations is 1 kW/m2 or 100 mW/cm2. Thus the input power
for a 100 × 100 mm2 cell is 10 W.
2.9.1 Benefits
Solar energy is a clean and renewable energy source.
Once a solar panel is installed, the energy is produced at reduced costs.
Whereas the reserves of oil of the world are estimated to be depleted in future, solar
energy will last forever.
It is pollution free.
Solar cells are free of any noise. On the other hand, various machines used for pumping
oil or for power generation are noisy.
Once solar cells have been installed and running, minimal maintenance is required. Some
solar panels have no moving parts, making them to last even longer with no maintenance.
On average, it is possible to have a high return on investment because of the free energy
solar panels produce.
Solar energy can be used in very remote areas where extension of the electricity power
grid is costly.
15
Because merits are more than the demerits, the use of solar power is considered as a clean and
viable source of energy. The various limitations can be reduced through various ways.
16
CHAPTER 3: DESIGN AND IMPLEMENTATION
17
Normally the resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but when
they are illuminated with light resistance drops dramatically. When the light level is low the
resistance of the LDR is high. This prevents current from flowing to the base of the transistors.
Consequently the LED does not light. However, when light shines onto the LDR its resistance
falls.
Concept of using two LDRs for sensing is explained in the figure above. The stable position is
when the two LDRs having the same light intensity.When the light source moves, i.e. the sun
moves from west to east, the level of intensity falling on both the LDRs changes and this change
is calibrated into voltage using voltage dividers. The changes in voltage are compared using
built-in comparator of microcontroller and motor is used to rotate the solar panel in a way so as
to track the light source.
18
such that the widest output range is achieved. The photocell resistance is measured under bright
light, average light and dark light conditions. The results are listed in the table below.
19
From the given relationship, the input-output relationship for the voltage divider circuit is given
by:
Rpot
V =V
LDR + Rpot
In this case,
20
When the shaft of the motor is at the desired position, power supply to the motor is stopped. If
the shaft is not at the right position, the motor is turned in the right direction. The desired
position is sent through electrical pulses via the signal wire. The speed of the motor is
proportional to the difference between the actual position and the position that is desired.
Therefore, if the motor is close to the desired position, it turns slowly. Otherwise, it turns fast.
This is known as proportional control [7].
The servo motor expects to see a pulse after every 20 milliseconds and the length of the pulse
will determine how far the motor will turn. For instance, a 1.5ms pulse makes the motor to turn
in the 90 degrees position. If the pulse was shorter than 1.5ms, it will move to 0 degrees and a
longer pulse moves it to 180 degrees. This is shown below.
21
For applications where there is requirement of high torque, servos are preferable. They will also
maintain the torque at high speeds, up to 90% of the rated torque is available from servos at high
speeds. Their efficiencies are between 80 to 90%.
A servo is able to supply approximately twice their rated torque for short periods of time,
offering enough capacity to draw from when needed. In addition, they are quiet, are available in
AC and DC, and do not suffer from vibrations.
Servo motors are more expensive than other types of motors. Servos require gear boxes,
especially for lower operation speeds. The requirement for a gear box and position encoder
makes the designs more mechanically complex. Maintenance requirements will also increase.
3.5 Crystal
Crystal oscillators are electronic oscillator circuits that use inverse piezoelectric effect. With this
effect, when electric field is applied across certain materials they will produce mechanical
deformation. Therefore a crystal uses mechanical resonance of a vibrating crystal of piezoelectric
material so that there is creation of an electric signal with precise frequency. They have high
stability, are low cost and quality factor which makes them superior over such resonators as LC
circuits, ceramic resonators and turning forks.
22
Figure 3.6 circuit diagram of a crystal
The optimal values of the capacitors depend on whether a quartz crystal or ceramic resonator is
being used. It will also depend on application-specific requirements on start-up time and
frequency tolerance. Crystal oscillators are not built into ICs because they cannot be easily
fabricated with IC processes and the size is physically larger than IC circuits.
The internal oscillators of microcontrollers are RC oscillators. The reason why crystal oscillators
are used is because the quality factor is on the order of 100000 while that of RC oscillators is on
the order of 100. Therefore, the crystal oscillator has lower phase noise and lower variation in
output frequency.
23
Figure 3.7: Voltage Regulator Circuit LM7805
The pin diagram of the 7805 is shown below.
The maximum value for input to the voltage regulator is 35V. it also comes with a provision for
a heat sink. In cases where the voltage is near 7.5V there is no heat production and therefore
there is o need for a heat sink. If the voltage output is more, the excess electricity will be
liberated as heat.
24
3.7 Microcontroller
Microcontroller is a single chip micro computer made through VLSI fabrication. A
microcontroller also called an embedded controller because the microcontroller and its support
circuits are often built into, or embedded in, the devices they control. A microcontroller is
available in different word lengths like microprocessors (4bit,8bit,16bit,32bit,64bit and 128 bit
microcontrollers are available today).
25
Figure 3.9: Microcontroller Architecture
3.7.1 ATmega328P
The ATmega328P is a low-power CMOS 8-bit microcontroller based on the AVR enhanced
RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega328P
achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize
power consumption versus processing speed.
It has 28 pins. There are 14 digital I/O pins from which 6 can be used as PWM outputs and 6
analog input pins. The I/O pins account for 20 of the pins. The 20 pins can act as input to the
circuit or as output. Whether they are input or output is set in the software.
Two of the pins are for the crystal oscillator and are supposed to provide a clock pulse for the
Atmega chip. The clock pulse is needed for synchronization so that communication occurs in
synchrony between the Atmega chip and a device connected to it. Two of the pins, Vcc and
GND are for powering the chip. The microcontroller requires between 1.8-5.5V of power to
operate.
26
Figure 3.10: Atmega 328P
The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This must be or else
the Atmega328 wouldn't be capable of interpreting analog signals. Because there is an ADC, the
chip can interpret analog input, which is why the chip has 6 pins for analog input. The ADC has
3 pins set aside for it to function- AVCC, AREF, and GND. AVCC is the power supply, positive
voltage, that for the ADC. The ADC needs its own power supply in order to work. GND is the
power supply ground. AREF is the reference voltage that the ADC uses to convert an analog
signal to its corresponding digital value. Analog voltages higher than the reference voltage will
be assigned to a digital value of 1, while analog voltages below the reference voltage will be
assigned the digital value of 0. Since the ADC for the Atmega328 is a 10-bit ADC, meaning it
produces a 10-bit digital value, it converts an analog signal to its digital value, with the AREF
value being a reference for which digital values are high or low. Thus, a portrait of an analog
signal is shown by this digital value; thus, it is its digital correspondent value [7].
27
The last pin is the RESET pin. This allows a program to be rerun and start over.
The table below gives a description for each of the pins and their functions.
28
There are various features that make the ATmega 328P a good choice for the project:
Arduino IDE
The software design was done using Arduino IDE which was used for the programming. The
pargram was written using the C language. The Proteus circuit editing software was used for
drawing the PCB circuit. The design of the circuit was done using Eagle software.
29
START
(S2-S1)>e
STOP
30
3.9 Algorithm for Motor Control
The algorithm gives the description of the general steps undertaken for the project:
The flow chart of figure is an illustration of how the algorithm is implemented. The inputs into
the system are the two LDR voltages into pins 23 and 24 of the Atmega 328. There is then the
conversion of the analog voltages into their digital values. The larger of the two signals is sent to
the circuit which drives the DC motor to the direction with more light intensity. The block
diagram of the solar tracking system is shown below.
After that, all the components are assembled as is illustrated in the diagram below. The input
stage comprises the LDRs which feed the voltage outputs to the microcontroller. From the LDRs
are potentiometers that are used for varying the resistance. When there is plenty of sunshine, the
potentiometers are adjusted to their maximum value that is 10K. For days when the weather is
not very sunny, the resistance is reduced by varying the potentiometer to ensure readings are
more easily taken. The LDRs are connected to pins 4 and 5.
The embedded software design has the C code loaded into the Atmega 328P. The code that was
used is shown at the appendix of the report. The resistor R1 is a pull up resistor for preventing
the microcontroller from continually resetting.
Pins 8 and 22 are grounded as specified by the specifications of the microcontroller. Digital pin 9
is connected to the signal pin of the servo motor and serves to control the movement of the servo.
There is also the power pin of the servo that is connected to power. The last servo pin is
grounded. Pins 9 and 10 are for the quartz crystal. There are various switches that control the
powering of different components. The LED indicates when the circuit is powered and the entire
system is functional.
31
There is a reset button for positioning the panel to an initial position which is at an inclination of
40 degrees. This is done preferably in the evening after the sun has set. It makes the LDR go
back to an initial position, ready for tracking sunlight on the next day. There is also a push button
for initializing the servo motor. It switches it on, leaving it on standby mode.
Pins 7, 20 and 21 are for powering the microcontroller. It requires 5V. The inputs to the LDR are
simulated. The hardware schematic diagram is shown in figure
32
CHAPTER 4: RESULTS, SIMULATIONS AND ANALYSIS
4.1 Results
The results for the project were gotten from LDRs for the solar tracking system and the panel
that has a fixed position. The results were recorded for four days, recorded and tabulated. The
outputs of the LDRs were dependent on the light intensity falling on their surfaces. Arduino has
a serial that communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer
through a USB. If these functions are thus used, pins 0 and 1 can be used for digital input or
output.
Arduino environment’s built in serial monitor can be used to communicate with the arduino
board. To collect the results, a code was written that made it possible to collect data from the
LDRs after every one hour. The values from the two LDRs are to be read and recorded at the
given intervals.
The LDRs measure the intensity of light and therefore they are a valid indication of the power
that gets to the surface of the solar panel. As a result, by measuring the light intensity at a given
time, it will be possible to get the difference in efficiency between the tracking panel and the
fixed one. The light intensity is directly proportional to the power output of the solar panel.
A code was written that made it possible to obtain readings from the two LDRs at intervals of
one hour. The EEPROM came in handy in this. It is the memory whose values are kept when the
board is turned off. The ATmega 328P has 1024 bytes of EEPROM.
To get the values at the end of the day, the Arduino board was used to connect the
microcontroller to the computer. The RX and TX pins are used for the connection. The code for
reading the values that were recorded is loaded into the microcontroller. The various values are
obtained and converted into volts. The Vcc to the microcontroller and the LDRs is 5volts. The
Atmega 328P has 1024 voltage steps and 5volts. When they are converted into digital values, the
values will be in the range of 0-1023. The conversion is done using the relation below.
∗
LDR Output = Volts
33
The results were obtained for different days. Getting results from different days was helpful in
that it made it possible to compare the various values gotten from different weather conditions.
The values obtained were recorded and used to draw graphs to show the relations.
Table 4.1: Results for cloudy Morning and Sunny Afternoon for 6th and 7th April 2015
LDR readings for Fixed Panel LDR readings for a Tracking
Panel
Time LDR1 LDR2 LDR12 LDR22
0630Hrs 0.196 0.176 1.477 1.487
0730Hrs 0.249 0.210 1.804 1.839
0830Hrs 0.225 0.196 2.757 2.933
0930Hrs 0.723 0.567 3.631 3.783
1030Hrs 0.733 0.816 3.900 3.798
1130Hrs 3.211 2.297 3.910 3.969
1230Hrs 4.888 4.941 4.990 4.990
1330Hrs 3.803 3.910 4.985 4.990
1430Hrs 3.456 4.057 4.976 4.985
1530Hrs 3.930 3.846 4.941 4.892
1630Hrs 1.999 1.544 4.824 4.594
1730Hrs 1.090 1.144 3.128 2.981
1830Hrs 0.718 0.787 0.982 0.968
34
6
Table 4.2: LDR outputs for bright sunny day on 2nd April 2015
35
6
Figure 4.2: Graph for bright sunny day of 2nd April 2015
Table 4.3: Results for LDR outputs for a cloudy day on 12th April 2015
LDR Readings for Fixed Panel LDR Readings for a Tracking
Panel
Time LDR1 LDR2 LDR12 LDR22
0630Hrs 0.147 0.117 0.274 0.244
0730Hrs 0.161 0.156 0.547 0.601
0830Hrs 0.274 0.205 1.090 1.075
0930Hrs 0.435 0.279 1.227 1.276
1030Hrs 0.572 0.547 1.271 1.305
1130Hrs 1.041 0.816 1.618 1.569
1230Hrs 2.175 1.965 2.165 2.151
1330Hrs 1.975 1.794 1.848 1.794
1430Hrs 1.119 1.623 1.090 1.075
1530Hrs 1.022 1.510 0.982 0.943
1630Hrs 0.543 1.017 0.762 0.728
1730Hrs 0.264 0.367 0.547 0.538
1830Hrs 0.064 0.103 0.327 0.220
36
6
Figure 4.3: Graph of LDR outputs for a cloudy day on 12th April 2015
Key points to note:
LDR1 is the photo resistor 1 reading for a solar panel that is fixed.
LDR2 indicates the 2nd photo resistor for a fixed solar panel.
LDR 12 indicates the 1st photo resistor reading in the tracking solar panel.
LDR 22 indicates the 2nd photo resistor for a tracking solar panel.
4.2 Analysis
From the curves, it can be seen that the maximum sunlight occurs at around midday, with
maximum values obtained between 1200 hours and 1400 hours. In the morning and late evening,
intensity of sunlight diminishes and the values obtained are less that those obtained during the
day. After sunset, the tracking system is switched off to save energy. It is switched back on in the
morning.
37
For the panel fitted with the tracking system, the values of the LDRs are expected to be close.
This is because whenever they are in different positions there is an error generated that enables
its movement. The motion of the panel is stopped when the values are the same, meaning the
LDRs receive the same intensity of sunlight. For the fixed panel, the values vary because the
panel is at a fixed position. Therefore, at most times the LDRs are not facing the sun at the same
inclination. This is apart from midday when they are both almost perpendicular to the sun.
Days with the least cloud cover are the ones that have the most light intensity and therefore the
outputs of the LDRs will be highest. For cloudy days, the values obtained for the tracking system
and the fixed system do not differ too much because the intensity of light is more or less
constant. Any differences are minimal. The tracking system is most efficient when it is sunny. It
will be able to harness most of the solar power which will be converted into energy.
In terms of the power output of the solar panels for tracking and fixed systems, it is evident that
the tracking system will have increased power output. This is because the power generated by
solar panels is dependent on the intensity of light. The more the light intensity the more the
power that will be generated by the solar panel.
The increase in efficiency can be calculated. However, it is important to note that there will be
moments when the increase in power output for the tracking system in comparison with the fixed
system is minimal, notably on cloudy days. This is expected because there will not be much
difference in the intensity of sunlight for the two systems. Similarly, on a very hot day at midday,
both systems have almost the same output because the sun is perpendicularly above. As such,
both systems receive almost the same amount of irradiation.
A few values can be used to illustrate the difference in efficiency between the two systems:
For a bright sunny day, we can take the averages for LDR22 and LDRS 2 for the entire day. We
then use 5 as the base because it is the maximum value of the LDR output. It is calculated as a
percentage and the two values compared. While this may not give the clearest indication of the
exact increase in efficiency, it shows that the tracking system has better efficiency.
38
For LDR 22:
4.027
∗ 100 = 80.54%
5
For LDR 2:
2.856
∗ 100 = 57.14%
5
The difference between the two values is 23.4%. this means the LDR for the tracking system has
an increased efficiency of 23.4%.
39
CHAPTER FIVE: DISCUSSION, CONCLUSION AND RECOMMENDATIONS FOR
FURTHER WORK
5.1 Discussion
The objective of the project was to design a system that tracks the sun for a solar panel. This was
achieved through using light sensors that are able to detect the amount of sunlight that reaches
the solar panel. The values obtained by the LDRs are compared and if there is a significant
difference, there is actuation of the panel using a servo motor to the point where it is almost
perpendicular to the rays of the sun.
This was achieved using a system with three stages or subsystems. Each stage has its own role.
The stages were;
The input stage is designed with a voltage divider circuit so that it gives desired range of
illumination for bright illumination conditions or when there is dim lighting. This made it
possible to get readings when there was cloudy weather. The potentiometer was adjusted to cater
for such changes. The LDRs were found to be most suitable for this project because their
resistance varies with light. They are readily available and are cost effective. Temperature
sensors for instance would be costly.
The control stage has a microcontroller that receives voltages from the LDRs and determines the
action to be performed. The microcontroller is programmed to ensure it sends a signal to the
servo motor that moves in accordance with the generated error.
The final stage was the driving circuitry that consisted mainly of the servo motor. The servo
motor had enough torque to drive the panel. Servo motors are noise free and are affordable,
making them the best choice for the project.
40
5.2 Conclusion
A solar panel that tracks the sun was designed and implemented. The required program was
written that specified the various actions required for the project to work. As a result, tracking
was achieved. The system designed was a single axis tracker. While dual axis trackers are more
efficient in tracking the sun, the additional circuitry and complexity was not required in this case.
This is because Kenya lies along the equator and therefore there are no significant changes in the
apparent position of the sun during the various seasons. Dual trackers are most suitable in
regions where there is a change in the position of the sun.
This project was implemented with minimum resources. The circuitry was kept simple, while
ensuring efficiency is not affected.
Shading has adverse effects on the operation of solar panels. Shading of a single cell will have an
effect on the entire panel because the cells are usually connected in series. With shading
therefore, the tracking system will not be able to improve efficiency as is required.
41
REFERENCES
[1] A.K. Saxena and V. Dutta, “A versatile microprocessor based controller for solar
http://www.embedded.com, 2006.
1999.
[5] M. F. Khan and R. L. Ali, “Automatic sun tracking system,” presented at the All
[6] “Fabrication of Dual-Axis Solar Tracking Controller Project”, Nader Barsoum, Curtin
University, Sarawak, Malaysia, Intelligent Control and Automation, 2011, 2, 57-68.
[7]Antonio L. Luque; Viacheslav M. Andreev (2007). Concentrator Photovoltaics. Springer
Verlag.
[8]David Cooke, "Single vs. Dual Axis Solar Tracking", Alternate Energy eMagazine, April
2011
42
APPENDIXES
Servo tiltServo;
void setup() {
Serial.begin(9600);
tiltServo.attach(servoPin);
attachInterrupt(0, initialize, RISING);
attachInterrupt(1, activateServo, RISING);
}
void loop() {
if (commence){
if ( difference >= -20 && difference <= 20 ){
Serial.println("e");
lastPosition = tiltServo.read();
}
else if (difference < -20){
if (switchSides){
sumErrors = 0;
wait = 0;
switchSides = false;
}
tilt(1);
}
else if (difference > 20){
43
if (!switchSides){
sumErrors = 0;
wait = 0;
switchSides = true;
}
tilt(0);
}
}
int PID(){
wait = abs(difference) + abs(sumErrors); // PI controller. Assuming Kp and Ki are equal to 1
sumErrors += difference; // get the integral of errors
44
void activateServo(){ // activate servo movement
if (commence) commence = false;
else
commence = true;
}
45
Appendix Two: Code for obtaining the results from the LDRs
#include <EEPROM.h>
#include <Servo.h>
Servo tiltServo;
void setup() {
Serial.begin(9600);
tiltServo.attach(servoPin);
attachInterrupt(0, initialize, RISING);
}
void loop() {
ldrValue1 = analogRead(LDR1); // get analog reading of LDR1
ldrValue2 = analogRead(LDR2); // get analog reading of LDR2
if (addr < 24)logData();
difference = ldrValue1 - ldrValue2; // calculate difference between the two values
if (digitalRead(3) == HIGH){
if ( difference >= -20 && difference <= 20 ){
Serial.println("equilibrium");
lastPosition = tiltServo.read();
}
else if (difference < -20){
Serial.println("turn left");
if (switchSides){
sumErrors = 0;
wait = 0;
switchSides = false;
}
tilt(1);
}
46
else if (difference > 20){
Serial.println("turn right");
if (!switchSides){
sumErrors = 0;
wait = 0;
switchSides = true;
}
tilt(0);
}
}
//Serial.print("LDR1: "); Serial.println(ldrValue1);
//Serial.print("LDR2: "); Serial.println(ldrValue2);
Serial.print("Difference: "); Serial.println(difference);
//Serial.print("Sum: "); Serial.println("sumErrors");
//Serial.println("");
}
int PID(){
wait = abs(difference) + abs(sumErrors); // PI controller. Assuming Kp and Ki are equal to 1
sumErrors += difference; // get the integral of errors
47
void logData(){
time = millis()/1000;
if (time >= 3600){
EEPROM.write(addr, (float(ldrValue1)/4));
addr++;
EEPROM.write(addr, (float(ldrValue2)/4));
addr++;
time = 0;
}
delay(10);
}
48
Appendix Three: Code for obtaining the stored values of readings from the LDRs in Volts
#include <EEPROM.h>
void setup()
{
// initialize serial and wait for port to open:
Serial.begin(9600);
}
void loop()
{
while(address < 26){
// read a byte from the current address of the EEPROM
float value = float(EEPROM.read(address)) * 4;
value = (value * 5)/1023;
Serial.print(address);
Serial.print("\t");
Serial.print(value);
Serial.print("V");
Serial.println();
delay(500);
}
}
49
Appendix Four: Screenshot of some of the readings obtained
50