Professional Documents
Culture Documents
Microcontroller Based Solar Tracker PDF
Microcontroller Based Solar Tracker PDF
FACULTY OF ENGINEERING
BY
F17/39433/2011
Project report submitted in partial fulfilment 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 acknowledge 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.
Signature: ….………………………………………………………………………………………
Date: ……………………………………………………………………………………………
Approved by:
Signature: ……………………………………………………………………………………
DEDICATION
To my family for their support during my university education and to my colleagues who helped
me when I needed them.
i
ACKNOWLEDGEMENT
This project required a large time commitment, not only on my part, but of a few others. I would
like to take this opportunity to thank them.
First and foremost, I would like to thank my supervisor, Mr Ombura, for his guidance in the
implementation of this project.
I particularly thank Mr Kinyua for his insight, his advice and help towards the overall success of
this project. Also, special thanks to Mr Ondeng for providing me with the raspberry pi
microcontroller which was the very core of my project.
Finally, I would like to extend my heartfelt gratitude towards family, friends and classmates, for
their encouragement and insight as well as the numerous hours we spent in the library
researching on our respective projects and the time we took to go and acquire the various
parameters needed in the project design and implementation.
Above everything else, I would like to give thanks to the Almighty God.
ii
TABLE OF CONTENTS
LIST OF FIGURES ......................................................................................................................................... vi
LIST OF TABLES ......................................................................................................................................... vii
ABBREVIATIONS AND ACRONYMS .................................................................................................viii
ABSTRACT...................................................................................................................................................... ix
1 INTRODUCTION.................................................................................................................................... 1
1.1 General background ......................................................................................................................... 1
1.2 Problem statement ............................................................................................................................ 2
1.3 Project justification .......................................................................................................................... 2
1.4 Objectives of Study.......................................................................................................................... 2
1.5 Scope of project ................................................................................................................................ 3
1.6 Methodology ..................................................................................................................................... 3
1.7 Project report organization ............................................................................................................. 4
2 LITERATURE REVIEW ....................................................................................................................... 5
2.1 Introduction ....................................................................................................................................... 5
2.2 Types of Solar Trackers and Solar Tracking Techniques ........................................................ 5
2.2.1 Single Axis Solar Tracking System ..................................................................................... 5
2.2.2 Dual Axis Solar Tracking System ........................................................................................ 6
2.2.3 Active Solar Tracking ............................................................................................................. 7
2.2.4 Passive Solar Tracking ........................................................................................................... 7
2.2.5 Chronological Solar Tracking ............................................................................................... 7
2.3 Solar tracking in relation to revolution of the earth .................................................................. 7
2.4 Solar Tracking with Algorithms ................................................................................................... 8
2.4.1 Solar altitude angle .................................................................................................................. 9
2.4.2 Solar azimuth angle ................................................................................................................. 9
2.4.3 Elevation angle ......................................................................................................................... 9
2.4.4 Solar zenith angle .................................................................................................................... 9
2.5 Nature of Solar Irradiation ............................................................................................................. 9
2.5.1 Solar Constant ........................................................................................................................10
2.5.2 Sunlight ....................................................................................................................................10
iii
2.5.3 Sun chart diagram ..................................................................................................................11
2.6 Fixed and Tracking collectors .....................................................................................................12
2.6.1 Fixed collectors ......................................................................................................................12
2.6.2 Tracking collectors ................................................................................................................13
2.7 Merits and demerits of Solar Energy .........................................................................................13
2.7.1 Merits .......................................................................................................................................13
2.7.2 Demerits ...................................................................................................................................14
3 DESIGN AND IMPLEMENTATION ..............................................................................................15
3.1 Light sensor theory ........................................................................................................................15
3.1.1 Characteristics of LDRs .......................................................................................................15
3.1.2 Construction and operation of an LDR .............................................................................16
3.1.3 Light Sensor Design ..............................................................................................................19
3.2 Analog-to-Digital converter .........................................................................................................20
3.3 Stepper motor and driver theory .................................................................................................21
3.3.1 Characteristics of stepper motors .......................................................................................21
3.3.2 Types of stepper motors .......................................................................................................22
3.3.3 Working principle of the stepper motor ............................................................................23
3.3.4 Step Angle ...............................................................................................................................26
3.3.5 Advantages of stepper motor...............................................................................................26
3.3.6 Disadvantages of stepper motors ........................................................................................27
3.4 Motor Driver Circuitry ..................................................................................................................27
3.5 Limit switches .................................................................................................................................28
3.6 Microcontroller (RASPBERRY PI 1 MODEL B+)................................................................28
3.7 Power Supply ..................................................................................................................................29
3.8 Software Design .............................................................................................................................30
3.8.1 Design Tool.............................................................................................................................30
3.8.2 Algorithm for motor control ................................................................................................31
4 SIMULATION, RESULTS AND ANALYSIS ...............................................................................32
4.1 Simulation ........................................................................................................................................32
4.2 Results ..............................................................................................................................................32
iv
4.21 LDR outputs for a bright sunny day on 27th April 2016 ...........................................................33
4.22 LDR outputs for a cloudy morning and bright sunny afternoon on 28 th April 2016 ...........33
4.23 LDR outputs for a cloudy day on 29th April 2016 ......................................................................34
4.24 Solar panel readings for a cloudy morning and bright sunny day on 28 th April 2016 ........34
4.3 Analysis ............................................................................................................................................35
5 CONCLUSION AND RECOMMENDATIONS ............................................................................39
5.1 Recommendations for further work ...........................................................................................39
5.2 Conclusion .......................................................................................................................................39
REFERENCES ................................................................................................................................................40
APPENDICES .................................................................................................................................................41
Appendix One: Code used in the Raspberry pi ....................................................................................41
Appendix Two: The control commands for the 28BYJ-48 stepper motor ........................................46
Appendix Three: Screenshot of some of the readings obtained ...........................................................46
v
LIST OF FIGURES
Figure 1-1: Block Diagram of Solar Tracker .............................................................................................. 4
Figure 2-1: Single axis tracker ....................................................................................................................... 6
Figure 2-2: Dual axis tracker .......................................................................................................................... 6
Figure 2-3: Motion of the Earth around the Sun ........................................................................................ 8
Figure 2-4: Observer at position Q Illuminated by Sun Rays ................................................................. 8
Figure 2-5: Sunpath Diagram of Nairobi ...................................................................................................12
Figure 3-1: Resistance vs. Illumination curve for a typical LDR .........................................................16
Figure 3-2: LDR construction ......................................................................................................................17
Figure 3-3: Cds photocell circuit .................................................................................................................18
Figure 3-4: Light sensor design ...................................................................................................................19
Figure 3-5: MCP3008 ADC .........................................................................................................................20
Figure 3-6: Torque vs. Speed characteristics curve of a Stepper Motor .............................................22
Figure 3-7: 4-Phase unipolar stepper motor windings ............................................................................23
Figure 3-8: Different drive modes on a 4-phase unipolar stepper motor ............................................25
Figure 3-9: Pin out diagram of ULN2003 stepper driver IC .................................................................27
Figure 3-10: Raspberry Pi header ................................................................................................................29
Figure3-11:Flow chart of the assembly .........................................................................................................30
Figure 3-12: Solar tracker schematic ..........................................................................................................31
Figure 4-1: Graph of results of table 4-1 ......................................................................................................35
Figure 4-2: Graph of results of table 4-2 ......................................................................................................36
Figure 4-3: Graph of results for table 4-3 ....................................................................................................37
Figure 4-4: Graphical comparison of output power readings of table 4-4 ..............................................37
vi
LIST OF TABLES
Table 2-1: Range of Sunlight .......................................................................................................................11
Table 3-1: Photocell resistance testing data ..............................................................................................17
Table 3-2: Full Stepping ................................................................................................................................23
Table 3-3: Half Stepping ...............................................................................................................................24
Table 4-1: LDR readings on day 1 ..............................................................................................................33
Table 4-2: LDR reading on day 2 ................................................................................................................33
Table 4-3: LDR reading on day 3 ................................................................................................................34
Table 4-4: Solar panel ratings .........................................................................................................................35
vii
ABBREVIATIONS AND ACRONYMS
viii
ABSTRACT
This project is set up to find a viable and cost effective way of maximizing the use of a solar
panel to harness energy. Impending scarcity of nonrenewable resources, has led people to
consider the use of other sources of energy. From all other resources, solar energy is
comparatively abundant and it is very easy to convert to electrical energy. Using the solar panel
to convert sun’s energy to electrical is very common, but because of the transition of the Sun
from east to west, the fixed solar panel may not be able to generate maximum energy. The
proposed system seeks to solve this problem via an arrangement for the solar panel to track the
sun.
For extraction of maximum energy from the sun, the plane of the solar collector should always
be perpendicular to the incident radiation. The movement of the earth affects the radiation
intensity received by the solar collector hence the need for a solar tracker.
This project therefore involves the design and implementation of a microcontroller based solar
tracker system using raspberry pi microcontroller expected to be used in solar panels. The solar
tracker used is a dual axis solar tracker which ensures the optimization of the solar panel by
making sure that sunlight is incident upon the panel at any given time of day. The prototype’s
operation is achieved by connecting two stepper motors to a solar panel such that the panel
maintains its face always perpendicular to the sun in relation to the signals received by the
microcontroller from two light sensors. The programmed microcontroller hence delivers stepped
pulses in periodical time intervals for the stepper motor to rotate the mounted solar panel as
desired.
The performance and characteristic of the solar tracker are hence analyzed.
ix
1 INTRODUCTION
1.1 General background
In the development of any nation, energy is the main driving factor in the world today. There is
an extensive amount of energy that gets extracted, distributed, converted and consumed each and
every day in the world today. Fossil fuels account for about 85 percent of energy that is
produced. Fossil fuel resources are limited and also using them is known to cause global
warming because of emission of greenhouse gases thereby leading to the need for alternate
sources of energy.
Renewable energy is rapidly gaining momentum as an alternative source of energy since fossil
fuel prices are varying every other day in the market. The most used renewable energies are
solar, wind, gas and biomass but the most employed is solar energy.
The sun radiates energy in the form of electromagnetic energy and the amount of
electromagnetic radiation that reaches the earth from the sun is referred to as solar radiation.
Theoretically, solar energy levels reaches around 1366 W/ on the surface of the earth. This
simply means that for every square meter of surface area on a solar collecting platform that faces
the sun, the system will nearly be able to collect around 1 kW of solar energy(if it is 100%
efficient)[1] thus solar energy has impressive magnitude and provides more energy than present
day human technology. Solar panels inarguably convert radiation from the sun into electrical
energy. The panels are manufactured from semiconductor materials, such as silicon. Their
efficiency is 24.5% on the higher side. Solar energy is being used as an alternative energy source
due to the fact that it is readily available and environmentally friendly. It is hence critical for
people to gain an understanding and appreciation of technologies associated with solar panels.
Solar energy is geared toward providing affordable, sustainable and reliable supply of energy
that will simulate high and sustained economic growth. Utilization of solar energy is low despite
the abundant availability of solar energy resource. In Kenya for example, solar energy is mainly
used for photovoltaic systems, water heating and drying of agricultural resource in solar farms.
The systems are used mainly for telecommunication, lighting, protection of pipelines, and water
pumping. The major factor affecting exploitation of solar energy resource in the country is the
high capital cost and low awareness of its economic benefits as well as lack of adherence to
system standards by suppliers. Compared to hydroelectric power supplied by the government
which costs about ksh20 per unit ,the cost of solar energy is comparatively lower which results in
high profit margins in institutions and industrial areas as well as in our homes if we use it.
With solar energy rapidly gaining recognition as a cost effective source of energy, the Kenyan
government has made it mandatory for property developers and home owners to set up solar
water heating systems due to the increasing demand for electricity and in order to reduce
wastage.
1
Research has been conducted over the years to be able to increase the efficiency of the solar
panel. Three ways of increasing the efficiency of the solar panels are through maximizing the
power output, increasing cell efficiency and use of a solar tracking system[10].
The solar tracking system is the most productive since as opposed to the other two methods it
leads to the most power generation. MPPT’s for example, are productive but cannot increase
generation of power when the sun is not aligned with the system hence it is advantageous to have
the solar panels track the sun’s trajectory as it moves across the sky. This tracking movement
tends to maximize the amount of power absorbed by the solar panels. It has been estimated that
the use of a tracking system over a fixed system can increase the power output by up to 30%[11].
To design a system that is able to control the position of solar panel in accordance with the
position of the sun.
To invent a more affordable solar tracker as opposed to commercial made solar trackers.
2
1.5 Scope of project
The project explored use of a solar panel coupled to two stepper motors because of their high
speed and low power consumption, to track the sun both in the horizontal and vertical direction
so that maximum light is incident upon the panel at any given time of day. Four light sensors
mounted on the solar panel were be able to detect the sun’s rays, that is, a pair for each axis
movement. The voltages at the two corresponding edges of the solar panel were compared and
the raspberry pi microcontroller used their difference as the error that the stepper motors have to
rotate through a corresponding angle to adjust the position of solar panel till the two LDR
voltage inputs are equal. Since the LDRs produce analog output voltage and raspberry pi
microcontroller can only read digital output, an external Analog-to-Digital converter was applied
to the system.
The code for the microcontroller was constructed using python programming language which is
the main programming language for the raspberry pi microcontroller. The stepper motor was
driven by an IC as the raspberry pi is not capable of handling the power requirements of the
stepper motor. This IC is the ULN2003APG chip which forms the driver circuit.
1.6 Methodology
As stated before, the aim of the project was to analyze the performance of a dual axis solar
tracking system. The project consists of three main structures which are the input, controller and
output.
The inputs were from the Light dependent resistors which were arranged in a voltage divider
circuit, the raspberry pi is the controller and the stepper motors are the output. The overall block
diagram is presented in fig 1-1 in the next page. In this project, the raspberry pi receives analog
input from four Light dependent resistor’s and converts the input into digital signal using an
Analog-to-digital converter then it sends the signals to two stepper motors in order to determine
the movement of the panel.
The three stages were designed independently before being joined into one system this ensures
that if there were any errors, they were considered independently and corrected.
3
Sensor 1
Sensor 2 Stepper
motor
RASPBERRY
ADC PI
driver 1 Stepper motor 1
Sensor 3
MCU Stepper
motor
driver 2 Stepper motor 2
Sensor 4
Chapter 1: This covers the introduction of the project report describing the justification for
doing the project, the objectives, methodology and scope of the work.
Chapter 2: This covers the literature review that is based on the background of the problem.
There is an overview of the methods used for tracking and how tracking the
movement of the sun optimizes the efficiency of solar panels.
Chapter 3: This chapter involves the design and implementation of the project.
Chapter 5: This chapter has the discussion, conclusion and recommendations for further
work with regard to this project.
4
2 LITERATURE REVIEW
2.1 Introduction
The increasing demand for energy has led to renewable energy sources being more popular as
well as the technologies involved in their conversion to electricity, solar energy being the most
popular out of any of the others since it is the cleanest most abundant renewable energy source
available.
The tapping of usable electricity from the sun was made possible with the discovery of the
photoelectric mechanism and development of the solar cell. The solar cell is a semiconductor
material which converts visible light into direct current. When sunlight hits a solar cell, the
energy knocks electrons free from their atoms allowing them to flow through the material. Solar
arrays, which are a series of solar cells electrically connected with generation of a DC voltage
that can be used on a load, are increasingly being used since their efficiencies are becoming
higher. They are extremely popular in remote areas where there is no connection to the grid. The
cost of solar cells is also decreasing with time thus the conversion of solar energy to electric
energy is becoming economically feasible. Therefore, to harvest more energy it is desirable that
the energy conversion units are simple reliable and low cost with high efficiency.
Solar panels are usually used to absorb the sun radiation for generating electricity. A solar panel
is made from solar cells combined into modules of about 40 cells. The most efficient solar panels
are usually made from amorphous silicon or non-silicon materials such as cadmium telluride. In
large companies, the solar panels are usually placed in a system of panels or mirrors at tilt angles
in order to generate maximum power. However, these may not be very efficient and is also very
costly hence the need for solar tracking devices. A solar tracker is a device which orients a
payload towards the sun’s direction hence ensuring that it is always exposed to the sun no matter
the time of day or location of the panel.
5
Figure 2-1: Single axis tracker
2.2.2 Dual Axis Solar Tracking System
These trackers have two degrees of freedom added to the system. This means that the panel can
move in both east-west and north-south direction for maximum absorption of sunlight. Two
linear actuators are normally improvised in such a tracking system hence they are more efficient
than the single axis solar trackers. The dual axis capability is essential since solar panels need to
track the sun in a three-dimensional space using both azimuth and elevation drives[12].
6
The methods employed in the above techniques can be further subdivided into the following
drive modes :
The earth revolves around the sun and also rotates about its axis from west to east. Each rotation
is completed in a period of 24 hours and is responsible for the occurrence of day and night which
is a solar day. Each revolution around the sun takes a period of about 365 days. The earth’s orbit
is elliptical due to the fact that the distance between the earth and sun keeps changing. The
earth’s axis makes an angle of 66.5 degrees to the ecliptic plane and as a result the earth attains
four critical positions with reference to the sun[14].
The figure on the next page illustrates the motion of the earth around the sun:
7
Figure 2-3: Motion of the Earth around the Sun
2.4 Solar Tracking with Algorithms
The sun vector is an imaginary line running from the location of the solar tracker system directly
into the centre of the sun. The sun vector is essential for steering the PV panels to continuously
face the sun’s direction in order to maintain maximum solar energy. A solar position algorithm
determines the position of the sun at any given time for a specific location. The diagram in figure
2-4 below shows an observer at position Q illuminated by sun ray observed along sun vector SQ
showing solar tracking azimuth and zenith angles[1].
8
The different sun angles are usually determined mathematically using the following methods:
Solar radiation data is used to predict the performance of many different systems from heating
loads. The spectrum of electromagnetic radiation emitted from sun surface extends from 0.2 µm
to 3 µm. It can also be stated that about 7% of the emitted energy falls in ultraviolet zone of
spectrum and 42% ranges in the visible zone while 5% ranges in infrared zone thus the sun is
considered a black body in thermal balance at a temperature of about 5780K[1]. Due to Albert
Einstein’s famous law E= , 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. Upon crossing the earth atmosphere,
solar radiation is subjected to many phenomena such as reflection, absorption with new radiation
and diffusion.
9
The total power of the sun can be estimated by the law of Stefan and Boltzmann given below:
Direct radiation: this is the part of radiation reaching the earth surface in the direction of the
solar rays without going through absorptions and reflections and is also referred to as beam
radiation .It travels on a straight line from the sun to the surface of the earth.
Diffuse radiation: this is the part reaching the earth from all directions. It is 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[12].
The determination of the solar constant is facilitated by solar spectral-irradiance curves. These
are obtained with a recording spectrobolometer (a combined spectroscope and bolometer for
determining the wavelength distribution of radiant energy emitted by a source) and referenced to
a measurement obtained from a pyrheliometer that determines the total radiation at the same
time.
2.5.2 Sunlight
Photometry enables us 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.
The luminous flux (or lux) is commonly used and is the measure of the perceived power of light
meaning the intensity 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
10
the SI unit for a solid angle; the two-dimensional angle in three dimensional space that an object
subtends at a point.
1 =1 ∙ =1 ∙ ∙ (2.3)
i.e. a flux of 10 lumen, concentrated over an area of 1 square metre, lights up that area with
illuminance of 10 lux[11].
Sunlight ranges between 400 lux and approximately 130000 lux. The range of sunlight can be
shown on the table below:
11
Key:
For collectors that are fixed, the projection area on the area that is perpendicularly oriented to the
direction of radiation is given by S = Socosθ, where θ changes in the interval (-π/2, +π/2) during
the day. The angular velocity of the sun as it moves across the sky is given by ω = 2π/T
=7.27× rad/s with the differential of the falling energy given by dW = ISdt. Assuming that
the maximum radiation intensity I = 1100 W/ The energy per unit that is calculated for the
whole day neglecting atmospheric influence is given by the equation on the next page:
12
(2.4)
(2.5)
Comparing the theoretical results from the two scenarios above, more energy is calculated for the
tracking collector. However, the Sun’s rays reaching the earth’s surface go through the thick
layer of the atmosphere in both cases. Nonetheless, the tracking collector has a greater exposure
to the Sun’s energy in any given day[5].
13
vi) Grid-connected solar electricity can be used locally thus reducing transmission/distribution
losses.
vii) It is estimated that world oil reserves are expected to be depleted in future however, solar
energy is expected to last forever.
viii) For large companies, it is possible to have a high return on investment because of the free
energy solar panels produce.
ix) Despite the high initial capital cost of building a solar power plant, operating costs are
extremely low compared to existing power technologies.
2.7.2 Demerits
i) Solar electricity is not available at night and is less available in cloudy weather conditions
and therefore, a storage or complementary power system is required.
ii) Solar panels have a high initial capital cost during installation resulting in a time lag of many
years for savings on energy bills to match initial investments.
iii) Solar power stations do not match the power output of conventional power stations of similar
size and are expensive to build.
iv) The batteries used when solar power is used to charge them can be large and heavy, taking up
plenty of space and needing frequent replacement.
Due to the fact that the advantages of using solar power outweigh the disadvantages, the use of
solar power to harness energy should be considered as a clean and ultimately feasible energy
source.
14
3 DESIGN AND IMPLEMENTATION
3.1 Light sensor theory
A light sensor is the most common electronic component which can be easily found. The
simplest optical sensor is a photon resistor or photocell which is a light dependent resistor.
A Light Dependent Resistor (LDR) or a photo resistor is a device whose resistivity is a function
of the incident electromagnetic radiation. Hence, they are light sensitive devices. They are made
up of semiconductor materials having high resistance. There are two types of photo conductive
material; cadmium sulfide (CdS) and gallium arsenide (GaAs)[7]. The sun tracker system
designed here uses four cadmium sulfide (CdS) photocells for sensing the light.
(3.1)
The value of C depends on the cadmium sulphide used and on the manufacturing process. Values
around 0.7 to 0.9 are quite common.
15
The figure below shows resistance vs. illumination curve for a typical LDR.
Photocells or LDR’s are nonlinear devices. There sensitivity varies with the wavelength of light
incident on them. Some photocells might not at all response to a certain range of wavelengths.
Based on the material used different cells have different spectral response curves.
When light is incident on a photocell it usually takes about 8 to 12ms for the change in resistance
to take place, while it takes one or more seconds for the resistance to rise back again to its initial
value after removal of light. This phenomenon is called the resistance recovery rate.
LDRs have good power and voltage handling capabilities, similar to those of a conventional
resistor. Their only significant defect is that they are fairly slow acting, taking tens or hundreds
of milliseconds to respond to sudden changes in light level[6].
The photo-resistor, CdS, or LDR finds many uses as a low cost photo sensitive element.
16
Figure 3-2: LDR construction
In this system light sensor is used to measure light intensity then generate corresponding analog
output value. The analog value is thus converted to digital voltage. This system does not need a
real time clock (RTC) to move annual direction i.e. north to south. This operation is done by
light sensor, by comparing the light intensity it can move in horizontal axis and vertical axis and
thus always get maximum sun light[7]. Photocell resistance was measured under dark conditions,
average light conditions, and bright light conditions. The results are listed on table 3-1 below:
To utilize the photocell, it is placed in series with a 10k resistor. The resistor value is chosen so
as to achieve the widest output range possible. A voltage divider is thus formed and the output at
the junction is determined by the two resistances. The divider circuit is shown on the next page:
17
Figure 3-3: Cds photocell circuit
The relationship between the resistance (resistance of the LDR) and light intensity (Lux) for a
typical LDR is given in the following equation:
(3.2)
From the relationship given below the input – output relationship for a voltage divider circuit,
can be said to be:
(3.3)
Where,
The selected 10K resistor resulted in the following minimum and maximum voltages.
18
Thus, the output swing is 1.37 V results. While this is not ideal, it was determined to be
sufficient for the project and additional amplification was not pursued.
The concept of using two LDRs for sensing is illustrated in figure 3-4 above .The stable position
is when the two LDRs having the same light intensity and the sun is directly overhead. When the
light source moves, i.e. the sun moves from west to east, the level of intensity falling on both the
19
LDRs changes and this change causes a shadowing effect on one of the sensors thus causing the
panel to adjust till the sun is directly overhead once more.
The four LDRs were placed perpendicularly to each other separated by opaque partitions.
Positioning of the sensors was very important since their position would eventually determine
how the system is going to adjust with the change in position of the sun. For each axis
movement, the average of two sensors were responsible. When sensors are normal to the sun,
there is no shadow of object on the LDRs and the concentrated beam of light which falls on the
LDRs is same and thus there is no movement of the system. However, if a sensor is not normal
to the sun, there should be shadow of object on one of the LDRs. Therefore, the panel will adjust
automatically depending on the two quadrants where the light beam is concentrated on. The
average of these sensors can find the position of sun.
20
The Serial Peripheral Interface (SPI) is a communication protocol used to transfer data between
micro-computers like the Raspberry Pi and peripheral devices like light sensors. SPI uses four
separate connections to communicate with the target device. These connections are the serial
clock (CLK), Master Input Slave Output (MISO), Master Output Slave Input (MOSI) and Chip
Select (CS).[3]
The clock pin sense pulses at a regular frequency,that is, the speed at which the Raspberry Pi and
SPI device agree to transfer data to each other. For the ADC, clock pulses are sampled on their
rising edge, on the transition from low to high.
The MISO pin is a data pin used for the Raspberry Pi to receive data from the ADC. Data is
read from the bus after every clock pulse.
The MOSI pin sends data from the Raspberry Pi to the ADC. The ADC will take the value of
the bus on the rising edge of the clock. This means the value must be set before the clock is
pulsed.
The Chip Select line chooses which particular SPI device is in use. If there are multiple SPI
devices, they can all share the same CLK, MOSI, and MISO. However, only the selected
device has the Chip Select line set low, while all other devices have their CS lines set high. A
high Chip Select line tells the SPI device to ignore all of the commands and traffic on the rest
of the bus.
The 5v stepper motor was chosen because of its low power consumption and could be powered
directly from the pi without the risk of damaging it since they do not take a great deal of current.
The 5v stepper motors have a built in gear head with a 64:1 ratio allowing for some torque and
precision and allowing for instant on full speed sequencing. There are 4 square waves driving the
motor with 2/3 offset. The vertical axis needed higher torque hence the 12 v stepper motor was
chosen and powered from an external supply.
21
Stepper motors have a unique Torque v/s Speed characteristic. In general stepper motors have
very high torque compared to the other type of motors but this torque decreases rapidly as the
speed of the shaft in the motor increases. The torque of the stepper motor remains fairly constant
as the speed starts to increase but after a certain “cut-off speed” is reached, the torque starts to
decrease rapidly until it becomes zero as the speeds keeps increasing.
The proposed sun tracker uses a permanent magnet unipolar stepper motor since it is readily
available in the market and its working principle is quite simple[8]. Unipolar motor windings
with center tap is shown in the figure on the next page:
22
.
The center taps are connected to a positive voltage while the coil ends are alternately grounded to
cause a reversal of the field direction in that winding .The number of phases is equal to twice the
number of coils[3]. The motor is rotated by applying power to the windings in a sequence as
shown below:
23
b) Half step sequence
Half-stepping is achieved by first energizing one coil, then two coils, then one coil, etc., in a
sequence. In Half mode step sequence, motor step angle reduces to half the angle in full mode.
So the angular resolution is also increased meaning it becomes double the angular resolution in
full mode. Also in half mode sequence the number of steps gets doubled as that of full mode[3].
This project utilizes half-stepping as it is usually preferred over full mode in unipolar motors.
Table 3-3 below shows the pattern of energizing the coils
c) MicroStepping
Microstepping is a technique that increases motor resolution by controlling both the direction
and amplitude of current flow in each winding. Current is proportioned in the windings
according to sine and cosine functions. Microstepping can divide a motor’s basic step up to 256
times. Microstepping improves low speed smoothness and minimizes low speed resonance
effects. It produces roughly 30% less torque than dual phase full stepping. However,
microstepping is only applicable in bipolar motors.
24
Figure 3-8: Different drive modes on a 4-phase unipolar stepper motor
25
3.3.4 Step Angle
Step angle of the stepper motor is defined as the angle traversed by the motor in one step. To
calculate step angle, 360 is divided by number of steps a motor takes to complete one revolution.
In half mode, the number of steps taken by the motor to complete one revolution gets doubled, so
step angle reduces to half. As in above examples, Stepper Motor rotating in full mode takes 4
steps to complete a revolution, So step angle can be calculated as:
Step Angle,
This enables one to calculate step angle for any stepper motor. Knowing stepper motor's step
angle helps calibrate the rotation of motor and also helps in moving the motor to correct angular
position.
26
3.3.6 Disadvantages of stepper motors
Require a dedicated control circuit
Use more current than D.C. motors
Torque reduces at higher speeds
Resonances can occur if not properly controlled.
Not easy to operate at extremely high speeds.
In this circuit the four pins “Controller pin 1, 2, 3 and 4” will control the motion and direction of
the stepper motor according to the step sequence sent by the controller.
27
This module functions to forward or reverse the direction of the motor according to the signal
from raspberry pi.
The activation of these limit switches can cause electrical contacts to either ‘break’(Normally
Closed switch(NC)) or ‘make’(Normally Open switch(NO)) or do both depending on which
switches are interconnected.
4 USB ports hence better hot plug and over current behavior.
An Ethernet port.
40 pin connectors.
Low power consumption which is achieved by replacing linear regulators with switching
regulators hence power consumption is between 0.5W and 1W.
It has a Broadcom BCM2835 system on a chip which includes an ARMI176JZF-S 700 MHz
processor, Video Core IV GPU, and a micro SD card.
The foundation provides the following operating systems RASPBIAN, PIDORA, OPENELEC,
RASPBMC, RISC OS and also Python as the main programming language, with the support for
BBC BASIC, C and Perl. The main advantage of python language is its simplicity.[3]
28
Figure 3-10: Raspberry Pi header
29
3.8 Software Design
3.8.1 Design Tool
Start
Initialize steppers
Sleep 1
Compare the data minute
Yes
Yes
Yes
Top-bottom> Is limit
threshold switch 1=1?
Generate
drive signal
for stepper
Yes motor 1
Is limit
Bottom-top>
switch 2=1?
threshold Yes
Yes
Yes Sleep 1
Right-left> minute
threshold KEY:
Generate Top Average values of LDR1
drive signal and LDR2 at the top
for stepper
motor 2 Bottom Average values of LDR3
and 4 at the bottom
Left-right>
threshold Average values of LDR1
Yes
Left
and 3 on the left
In order to prevent the solar panel spinning all the way round, the panel is limited vertically
using two limit switches. In general applications, the panel should be rotated towards East
direction in order to make it ready for operation on the next day. The proposed system sends no
signals during night times by sensing low or none sunshine intensities and stays as pointing at
west direction after the sun set. The raspberry pi is also skipped to sleep mode and consumes low
energy. During the sun rise, the LDR senses the sunlight automatically and the panel is moved
towards East direction in a short time; thus no need any extra circuitry and software to do this.
Since the sun does not always follow the same path throughout the year, the mechanism
developed will allow the system to automatically track the sun no matter which ever path it
follows.
4.2 Results
The results in this project were obtained from LDRs for both a PV solar tracker and another
which was fixed. For three days these reading were recorded and tabulated as shown in the tables
on the next page. From the previous chapter, it was shown that LDR outputs are voltages
depending on light intensity falling on its surface. The Vcc to the raspberry pi and to the LDRs is
3.3volts.
As previously discussed, the MCP3008 ADC is a 10 bit ADC meaning it can have 1024 voltage
step and 3.3V when converted to digital values are in the range of 0-1023. This conversion can
be done using the relation below:
= (4.1)
32
4.21 LDR outputs for a bright sunny day on 27th April 2016
4.22 LDR outputs for a cloudy morning and bright sunny afternoon on 28th April 2016
33
4.23 LDR outputs for a cloudy day on 29th April 2016
Table 4-3: LDR reading on day 3
Time in hours LDR readings for fixed panel LDR readings for tracking panel
LDR11 LDR12 LDR13 LDR14 LDR1 LDR2 LDR3 LDR4
06:15 487 485 482 480 506 499 511 513
07:07 499 505 507 498 575 576 573 572
08:01 565 567 569 564 678 674 679 670
09:05 798 805 801 800 886 884 891 886
10:00 865 863 863 860 889 884 887 882
11:00 940 943 947 948 954 950 960 955
12:00 973 975 970 969 987 984 983 981
13:00 997 995 991 994 1008 1003 1005 999
14:28 982 989 989 984 1000 999 987 985
15:34 904 899 907 901 994 996 991 988
16:09 893 895 890 888 983 989 983 984
17:11 858 860 861 858 896 900 890 885
18:00 797 799 800 793 754 767 745 769
4.24 Solar panel readings for a cloudy morning and bright sunny day on 28th April 2016
34
Table 4-4: Solar panel ratings
Maximum power 1.8W
4.3 Analysis
Intensity 1200
1000
LDR1
800 LDR2
600 LDR3
LDR4
400
LDR11
200 LDR12
0 LDR13
06:30
07:45
09:00
10:19
11:12
12:37
13:45
15:50
16:32
17:00
08:00
14:30
1834
LDR14
Time
Figure 4-1: Graph of results of table 4-1
35
Intensity 1200
1000 LDR1
800 LDR2
LDR3
600
LDR4
400 LDR11
LDR12
200
LDR13
0 LDR14
Time
36
Intensity
1200
LDR1
1000
LDR2
800
LDR3
600 LDR4
400 LDR11
200 LDR12
0 LDR13
08:01
09:05
15:34
16:09
06:15
07:07
10:00
11:00
12:00
13:00
14:28
17:11
18:00
LDR14
Output Power(W)
1.5
1 FIXED
TRACKING
0.5
0
06:05
07:01
08:00
10:00
11:00
13:22
14:00
15:29
16:19
18:00
09:13
12:13
17:00
Time
37
The labeling of the curves is as follows:
LDR11 indicates photo resistor 1 reading for a fixed solar panel installation
LDR12 indicates photo resistor 2 reading for a fixed solar panel installation
LDR13 indicates photo resistor 3 reading for a fixed solar panel installation
LDR14 indicates photo resistor 4 reading for a fixed solar panel installation
LDR1 indicates photo resistor 1 reading for solar panel with tracker
LDR2 indicates photo resistor 2 reading for solar panel with tracker
LDR3 indicates photo resistor 3 reading for solar panel with tracker
LDR4 indicates photo resistor 4 reading for solar panel with tracker
From the curves, the maximum sunlight occurs around midday with the maximum solar
intensity at hours between 1200Hrs and 1400Hrs. In the morning and late evening the intensity
seems to be diminishing and the panel with the tracker is supposed to sleep when the output from
the LDRs is zero, meaning it is nightfall or there is no sunlight falling on it. This way it is able to
save power therefore further increasing the efficiency of the solar tracker and solar panel.
Another observation is that for the solar panel fitted with the tracker, the four LDR values are
close since the tracking system follows sun movement by motor turning the solar panel until the
two values of the LDRs are equal and the motion is stopped to save power. Sunny days or days
with least cloud cover register the highest LDR outputs and the cloudy ones, the lowest LDR
values[6].
Using the collected voltage and current data from the solar panels, we multiply the values
together to get the power output of the panels. The power readings from the solar panel indicate
a significant increase in output power when the tracker is used as opposed to when it isn’t. Dual
axis system high power capturing property is clear from the graphical comparison.
The results obtained on the both the three test days are very important as they signify the
importance of a tracking system and the effects of weather condition on power generation of a
PV system. The power generated by the standstill panel as well as the solar tracker was almost
the same during the afternoon hours, when the sun is directly on the zenith. There was only a
slight difference in the power generated because the solar tracker was tracking the sun constantly
and therefore was in the perfect position, but the standstill panel was also in the optimal place to
generate the maximum possible power. The difference was not large and therefore the gain in
efficiency during the afternoon period was around the range of 8-10%.The fact that the tracker
based system outperformed the standstill panel by a margin of about 26% on a normal sunny day
and by a margin of about 29% even on a cloudy day manifests the importance of such a system.
38
5 CONCLUSION AND RECOMMENDATIONS
5.1 Recommendations for further work
With the available time and resources, the objective of the project was met. The project is able to
be implemented on a much larger scale. For future projects, one may consider the use of more
efficient sensors, but which are cost effective and consume little power. This would further
enhance efficiency while reducing costs. It should also be noted that the solar cells can be placed
in a spherical housing inorder to prevent dust particles from settling on the sensors. An automatic
dust sensor can also be provided to clean the solar plate. Use of rainfall sensors can be also
implemented for future systems and fault indicators can also be incorporated in the system to
make it more reliable.
The project performs the required functions envisioned at the proposal phase. However, while
satisfied with software operation and simulation, less satisfaction was obtained from two
hardware areas. One issue deals with the photocell. It was discovered that the photocell needs to
be shielded such that light can be directed narrowly to its surface.
5.2 Conclusion
Dual axis tracker perfectly aligns with the sun direction and tracks the sun movement in a more
efficient way and has a tremendous performance improvement. The experimental results clearly
show that dual axis tracking is superior to fixed module systems. Power captured by dual axis
solar tracker is high during the whole observation time period and it maximizes the conversion of
solar irradiance into electrical energy output. The proposed system is also cost effective as a little
modification in single axis tracker provided prominent power rise in the system. Through the
experiments, it was found that dual axis tracking can increase energy by about 24.5% over the
fixed arrays.
The objective of this work is to design such a system that increases the overall solar insolation on
a PV system and thereby significantly increasing its efficiency. So a prototype was developed for
a dual axis tracker for a 2W panel to be able to achieve a 20-30 % increase in efficiency of the
system compared to a standstill PV system.
39
REFERENCES
[1] “Sun Tracking and Solar Renewable Energy Harvesting: Solar Energy Harvesting ”
, Gerro Prinsloo, Robert Dobson,2014, 1, 4-5
[5] “Fabrication of Dual-Axis Solar Tracking Controller Project”, Nader Barsoum, Curtin
[6] M. F. Khan and R. L. Ali, “Automatic sun tracking system,” presented at the All
http://www.embedded.com, 2006.
[10] “Microcontroller based automatic sun tracking system”, International Journal of Electrical
[11] A. K. Saxena and V. Dutta (1990), “A versatile microprocessor based controller for solar
[12] David Cooke, "Single vs. Dual Axis Solar Tracking", Alternate Energy eMagazine, April
2011.
Verlag.
40
APPENDICES
Appendix One: Code used in the Raspberry pi
#!/usr/bin/python
import spidev
import time
import math
import os
PINSA = [17,18,21,22]
PINSB = [4,25,24,23]
SEQA = [(17,),(17,18),(18,),(18,21),(21,),(21,22),(22,),(22,17)]
RSEQA = [(22,),(22,21),(21,),(21,18),(18,),(18,17),(17,),(17,22)]
SEQB = [(4,),(4,25),(25,),(25,24),(24,),(24,23),(23,),(23,4)]
RSEQB = [(23,),(23,24),(24,),(24,21),(25,),(25,4),(4,),(4,23)]
DELAY = 0.001
gpio.setmode(gpio.BCM)
gpio.setup(pin, gpio.OUT)
41
gpio.setup(pin, gpio.OUT)
time.sleep(DELAY)
spi = spidev.SpiDev()
spi.open(0,0)
def get_adc(adcnum):
r = spi.xfer2([1,(8+adcnum)<<4,0])
42
return adcout
try:
while True:
get_adc(0)
time.sleep(0.05)
get_adc(1)
time.sleep(0.05)
get_adc(2)
time.sleep(0.05)
get_adc(3)
time.sleep(0.05)
gpio.setmode(gpio.BCM)
43
gpio.setup(limit1, gpio.IN) #set pins as input
time.sleep(0.001)
gpio.setmode(gpio.BCM)
gpio.setup(limit2, gpio.IN)
time.sleep(0.001)
time.sleep(0.05)
time.sleep(0.05)
time.sleep(0.05)
time.sleep(0.05)
threshold = 5
time.sleep(0.05)
time.sleep(0.05)
elif (gpio.input(limit2)== True) and (diff2 > threshold or -1*threshold >diff2) and (top >
bottom):
time.sleep(0.01)
elif (gpio.input(limit1)== True) and (diff2 > threshold or -1*threshold >diff2) and (bottom >
top):
stepper(RSEQA,PINSA)
time.sleep(0.01)
if (diff1 > threshold or -1*threshold > diff1) and (left > right):
stepper(SEQB,PINSB)
time.sleep(0.01)
elif (diff1 > threshold or -1*threshold > diff1) and (right > left):
stepper(RSEQB,PINSB)
time.sleep(0.01)
except KeyboardInterrupt
gpio.cleanup()
45
Appendix Two: The control commands for the 28BYJ-48 stepper motor
STEPPER MOTOR 1 AND 2
Forward Reverse
0001 1000
0010 0100
0100 0010
1000 0001
46