+ All Categories
Home > Documents > Chapter 1

Chapter 1

Date post: 27-Nov-2014
Category:
Upload: nour-eldien-maged
View: 483 times
Download: 1 times
Share this document with a friend
Popular Tags:
152
INSTRUCTION SET SUMMARY Project Supervisor: Prof. Dr. Abdu El Latif Project member Nour El dien maged hamed Project name 1
Transcript
Page 2: Chapter 1

TABLE OF CONTENT

Chapter 1

Solar cell history and technology

ACKNOWLEDGEMENTS

Introduction

Light Sensor Theory

Simple explanation

Photo generations of charge carriers

Charge carrier separation

The p-n junction

Connection to an external load

Equivalent circuit of solar cell

Characteristic equation

Open-circuit voltage and short-circuit current

Effect of physical size

Cell temperature

Series resistance Shunt resistance

Reverse saturation current

Ideality factor

History of solar cells

Applications

2

Page 3: Chapter 1

Efficiency

Cost

Materials

Crystalline silicon

Chapter 2

Pic16f877a microchip technology

Abstract

Types of solar tracking system

MICROPROCESSOR BASED FIBRE OPTIC PRESSURE SENSOR

Controlling using fuzzy logic circuits

Solar tracking system using Altera Nios II processor

Pic16f877a microchip technology

WHAT IS A PIC MICROCONTROLLER? WHAT CAN IT DO?

Parameters and Features

Analog Features:

Special Microcontroller Features:

Peripheral Features:

Core architecture

Data space (RAM)

Code space

Word size

Instruction set

3

Page 4: Chapter 1

Performance

Advantages

Pin configurations

PIC16F874A/877A BLOCK DIAGRAM

Memory organization

Programming environments

Analogue to digital converter module

INSTRUCTION SET SUMMARY

READ-MODIFY-WRITE OPERATIONS

PIC16F87XA INSTRUCTION SET

Chapter 3

Solar tracking system

I catch the sun

Abstract

Solar Energy

How Solar Energy is used?

Why tracking systems

Types of tracking systems

Structure design

Material used (Teflon)

Applications and why I used Teflon

Mechanical design

4

Page 5: Chapter 1

Solid Works

Machine parts

Circuit design

Stepper motor

Two-phase stepper motors

Stepper motors control circuits

Stepper motor drive circuits

Half stepping

Micro stepping

Full step

Stepper motor ratings and specifications

Project Implementation

Mikroc programing language

Circuit design implementation

Problems I have met in implementation

Solution I discovered ….

Final circuit

Final code

Solar tracker verification and testing

Conclusion

Chapter 4

5

Page 6: Chapter 1

Conclusion and scope for future works

Conclusion

Scope for Future Work

Applications for the System

References

Acknowledgements

6

Page 7: Chapter 1

In the name of ALLAH, who is the most merciful, the most compassionate; the one and only supreme power, the one whose will makes everything possible, and the one without whose will the simplest is impossible.

All thanks to our beloved Family members for their prayers, guidance, support and care. They dreamed for our future and advised us to work hard to fulfill their dreams. Without their moral and financial support it would not have been possible for us to become supreme professionals.

We are really thankful to Dr. Abdu el Latif, my project supervisor for his kind support and guidance during each and every phase of this project.

Finally, we are also indebted to the Modern academy of Engineering & Technology, which supported us throughout our stay by providing their best teachers, equipped labs and with suitable conditions for us to work on the project.

Chapter 17

Page 8: Chapter 1

Solar cell history and technology

Abstract

Solar energy is rapidly advancing as an important means of renewable energy resource. More energy is produced by tracking the solar panel to remain aligned to the sun at a right angle to the rays of light. This paper describes in detail the design and construction of a prototype for solar tracking system with two degrees of freedom, which detects the sunlight using photocells. The control circuit for the solar tracker is based on a PIC16F877A microcontroller .This is programmed to detect the sunlight through the photocells and then actuate the motor to position the solar panel where it can receive maximum sunlight.

Introduction

These days electrical generation is typically provided by fossil fuels such as coal, natural gas, and oil and also as nuclear power some of today’s most serious environmental

8

Page 9: Chapter 1

problems can be linked to world electricity production based primarily on the use of non-renewable resources. Currently one third of the world population do not have access to electricity and are not connected to the national grid, one solution to this problem is renewable energy in the form of photovoltaic (PV) systems.Despite high capital cost, PV systems are still a viable solution for rural areas . Studies suggest that the rate at which fossil fuels are consumed today, there are high chances that they will deplete by the end of this century. For a long time, it has been thought that atomic energy would be a solution for the growing energy problem, but in recent times solar energy has proved to be an efficient, more secure and safe way of providing energyConcepts related to the solar energy have constantly been under heavy research and development. The basic objective is to optimize the energy produced from photovoltaic cells, by making the overall systems more efficient and cost effective. Most solar panels are statically aligned; they have a fixed position at a certain angle towards the sky. Therefore, the time and intensity of direct sunlight falling upon the solar panel is greatly reduced, resulting in low power output from the photovoltaic (PV) cells.Solar tracking system is the solution to this issue as it plays a major role in overall solar energy optimization.In order to ensure maximum power output from PV cells, the sunlight’s angle of incidence needs to be constantly perpendicular to the solar panel. This requires constant tracking of the sun’s apparent daytime motion, and hence develops an automated sun tracking system which carries the solar panel and positions it in such a way that direct sunlight is always focused on the PV cells This paper is about moving a solar panel along with the direction of sunlight; it uses a gear motor to control the position of the solar panel, which obtains its data from a PIC16F84A microcontroller. The objective is to design and implement an automated, double-axis solar-tracking mechanism using embedded system design in order to optimize the efficiency of overall solar energy output.Two light dependent resistors (LDR) is used for each degree of freedom. LDRs are basically photocells that are sensitive to light.Software will be developed which would allow the PIC to detect and obtain its data from the two LDRs and then compare their resistance. The two LDRs will be positioned in such a way, so that if one of the two comes under a shadow, the MCU will detect the difference in resistance and thus actuate the motor to move the solar panel at a position where the light upon both LDRs is equal. Two separate but identical circuits will be utilized for both axes

9

Page 10: Chapter 1

Light Sensor Theory

LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. 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.

   

The animation opposite shows that when the torch is turned on, the resistance of the LDR falls, allowing current to pass through it.

This is an example of a light sensor circuit :

10

Page 11: Chapter 1

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 and current flows into the base of the first transistor and then the second transistor. The LED lights.

The preset resistor can be turned up or down to increase or decrease resistance, in this way it can make the circuit more or less sensitive.

A light sensor is the most common electronic component which can be easily found. The simplest optical sensor is a photo resistor or photocell which is a light sensitive resistor these are made of two types, cadmium sulfide (CdS) and gallium arsenide(GaAs) The sun tracker system designed here uses the cadmium sulfide (CdS) photocell for sensing the light. This photocell is a passive component whose resistance is inversely proportional to the amount of light intensity directed towards it. It is connected in series with capacitor. The photocell to be used for the tracker is based on its dark resistance and light saturation resistance. The term light saturation means that further increasing the light intensity to the CdS cells will not decrease its resistance any further. Figure 1 shows the dimensions of the light dependent resistor. Light intensity is measured in Lux, the illumination of sunlight is approximately 30,000 lux, Figure 1 shows how a typical light dependent resistor behaves in terms of its resistance with changes to light intensity.From the graph shown in figure 2 it can be clearly seen that the resistance of the LDR is inversely proportional to the light intensity that as the light intensity increases the resistance of the LDR decreases

11

Page 12: Chapter 1

Figure 1

Figure 2

12

Page 13: Chapter 1

Simple explanation for solar cells

A solar cell (also called photovoltaic cell) is a solid state device that converts the energy of sunlight directly into electricity by the photovoltaic effect. Assemblies of cells are used to make solar modules, also known as solar panels. The energy generated from these solar modules, referred to as solar power, is an example of solar energy.

Photovoltaic is the field of technology and research related to the practical application of photovoltaic cells in producing electricity from light, though it is often used specifically to refer to the generation of electricity from sunlight.

Cells are described as photovoltaic cells when the light source is not necessarily sunlight. These are used for detecting light or other electromagnetic radiation near the visible range, for example infrared detectors, or measurement of light intensity.

1. Photons in sunlight hit the solar panel and are absorbed by semiconducting materials, such as silicon.

2. Electrons (negatively charged) are knocked loose from their atoms, allowing them to flow through the material to produce electricity. Due to the special composition of solar cells, the electrons are only allowed to move in a single direction.

3. An array of solar cells converts solar energy into a usable amount of direct current (DC) electricity.

Photo generations of charge carriers

When a photon hits a piece of silicon, one of three things can happen:

1. the photon can pass straight through the silicon — this (generally) happens for lower energy photons,

2. the photon can reflect off the surface3. The photon can be absorbed by the silicon, if the photon energy is higher than the

silicon band gap value. This generates an electron-hole pair and sometimes heat, depending on the band structure.

13

Page 14: Chapter 1

Band diagram of a silicon solar cell

When a photon is absorbed, its energy is given to an electron in the crystal lattice. Usually this electron is in the valence band, and is tightly bound in covalent bonds between neighboring atoms, and hence unable to move far. The energy given to it by the photon "excites" it into the conduction band, where it is free to move around within the semiconductor. The covalent bond that the electron was previously a part of now has one fewer electron — this is known as a hole. The presence of a missing covalent bond allows the bonded electrons of neighboring atoms to move into the "hole," leaving another hole behind, and in this way a hole can move through the lattice. Thus, it can be said that photons absorbed in the semiconductor create mobile electron-hole pairs.

A photon need only have greater energy than that of the band gap in order to excite an electron from the valence band into the conduction band. However, the solar frequency spectrum approximates a black body spectrum at ~6000 K, and as such, much of the solar radiation reaching the Earth is composed of photons with energies greater than the band gap of silicon. These higher energy photons will be absorbed by the solar cell, but the difference in energy between these photons and the silicon band gap is converted into heat (via lattice vibrations — called phonons) rather than into usable electrical energy.

Charge carrier separation

There are two main modes for charge carrier separation in a solar cell:

1. drift of carriers, driven by an electric field established across the device2. Diffusion of carriers due to their random thermal motion, until they are captured by

the electrical fields existing at the edges of the active region.

In thick solar cells there is no electric field in the active region, so the dominant mode of charge carrier separation is diffusion. In these cells the diffusion length of minority carriers (the length that photo-generated carries can travel before they recombine) must be large

14

Page 15: Chapter 1

compared to the cell thickness. In thin film cells (such as amorphous silicon), the diffusion length of minority carriers is usually very short due to the existence of defects, and the dominant charge separation is therefore drift, driven by the electrostatic field of the junction, which extends to the whole thickness of the cell

The p-n junction

The most commonly known solar cell is configured as a large-area p-n junction made from silicon. As a simplification, one can imagine bringing a layer of n-type silicon into direct contact with a layer of p-type silicon. In practice, p-n junctions of silicon solar cells are not made in this way, but rather by diffusing an n-type dopant into one side of a p-type wafer (or vice versa).

If a piece of p-type silicon is placed in intimate contact with a piece of n-type silicon, then a diffusion of electrons occurs from the region of high electron concentration (the n-type side of the junction) into the region of low electron concentration (p-type side of the junction). When the electrons diffuse across the p-n junction, they recombine with holes on the p-type side. The diffusion of carriers does not happen indefinitely, however, because charges build up on either side of the junction and create an electric field. The electric field creates a diode that promotes charge flow, known as drift current, that opposes and eventually balances out the diffusion of electrons and holes. This region where electrons and holes have diffused across the junction is called the depletion region because it no longer contains any mobile charge carriers. It is also known as the space charge region.

Connection to an external load

Ohmic metal-semiconductor contacts are made to both the n-type and p-type sides of the solar cell, and the electrodes connected to an external load. Electrons that are created on the n-type side, or have been "collected" by the junction and swept onto the n-type side, may travel through the wire, power the load, and continue through the wire until they reach the p-type semiconductor-metal contact. Here, they recombine with a hole that was either created as an electron-hole pair on the p-type side of the solar cell, or a hole that was swept across the junction from the n-type side after being created there.

The voltage measured is equal to the difference in the quasi Fermi levels of the minority carriers, i.e. electrons in the p-type portion and holes in the n-type portion.

15

Page 16: Chapter 1

Equivalent circuit of a solar cell

The equivalent circuit of a solar cell

The schematic symbol of a solar cell

To understand the electronic behavior of a solar cell, it is useful to create a model which is electrically equivalent, and is based on discrete electrical components whose behavior is well known. An ideal solar cell may be modeled by a current source in parallel with a diode; in practice no solar cell is ideal, so a shunt resistance and a series resistance component are added to the model. The resulting equivalent circuit of a solar cell is shown on the left. Also shown, on the right, is the schematic representation of a solar cell for use in circuit diagrams.

16

Page 17: Chapter 1

Characteristic equation

From the equivalent circuit it is evident that the current produced by the solar cell is equal to that produced by the current source, minus that which flows through the diode, minus that which flows through the shunt resistor:

I = IL − ID − ISH

Where

I = output current (amperes) IL = photo generated current (amperes) ID = diode current (amperes) ISH = shunt current (amperes).

The current through these elements is governed by the voltage across them:

VI = V + IRS

Where

VI = voltage across both diode and resistor RSH (volts) V = voltage across the output terminals (volts) I = output current (amperes) RS = series resistance (Ω).

By the Shockley diode equation, the current diverted through the diode is:

Where

I0 = reverse saturation current (amperes) n = diode ideality factor (1 for an ideal diode) q = elementary charge k = Boltzmann's constant T = absolute temperature

At 25°C, volts.

By Ohm's law, the current diverted through the shunt resistor is:

17

Page 18: Chapter 1

Where

RSH = shunt resistance (Ω).

Substituting these into the first equation produces the characteristic equation of a solar cell, which relates solar cell parameters to the output current and voltage:

An alternative derivation produces an equation similar in appearance, but with V on the left-hand side. The two alternatives are identities; that is, they yield precisely the same results.

In principle, given a particular operating voltage V the equation may be solved to determine the operating current I at that voltage. However, because the equation involves I on both sides in a transcendental function the equation has no general analytical solution. However, even without a solution it is physically instructive. Furthermore, it is easily solved using numerical methods. (A general analytical solution to the equation is possible using Lambert's W function, but since Lambert's W generally itself must be solved numerically this is a technicality.)

Since the parameters I0, n, RS, and RSH cannot be measured directly, the most common application of the characteristic equation is nonlinear regression to extract the values of these parameters on the basis of their combined effect on solar cell behavior.

Open-circuit voltage and short-circuit current

When the cell is operated at open circuit, I = 0 and the voltage across the output terminals is defined as the open-circuit voltage. Assuming the shunt resistance is high enough to neglect the final term of the characteristic equation, the open-circuit voltage VOC is:

Similarly, when the cell is operated at short circuit, V = 0 and the current I through the terminals is defined as the short-circuit current. It can be shown that for a high-quality solar cell (low RS and I0, and high RSH) the short-circuit current ISC is:

18

Page 19: Chapter 1

Effect of physical size

The values of I0, RS, and RSH are dependent upon the physical size of the solar cell. In comparing otherwise identical cells, a cell with twice the surface area of another will, in principle, have double the I0 because it has twice the junction area across which current can leak. It will also have half the RS and RSH because it has twice the cross-sectional area through which current can flow. For this reason, the characteristic equation is frequently written in terms of current density, or current produced per unit cell area:

Where

J = current density (amperes/cm2) JL = photo generated current density (amperes/cm2) J0 = reverse saturation current density (amperes/cm2) rS = specific series resistance (Ω-cm2) rSH = specific shunt resistance (Ω-cm2).

This formulation has several advantages. One is that since cell characteristics are referenced to a common cross-sectional area they may be compared for cells of different physical dimensions. While this is of limited benefit in a manufacturing setting, where all cells tend to be the same size, it is useful in research and in comparing cells between manufacturers. Another advantage is that the density equation naturally scales the parameter values to similar orders of magnitude, which can make numerical extraction of them simpler and more accurate even with naive solution methods.

There are practical limitations of this formulation. For instance, certain parasitic effects grow in importance as cell sizes shrink and can affect the extracted parameter values. Recombination and contamination of the junction tend to be greatest at the perimeter of the cell, so very small cells may exhibit higher values of J0 or lower values of RSH than larger cells that are otherwise identical. In such cases, comparisons between cells must be made cautiously and with these effects in mind.

This approach should only be used for comparing solar cells with comparable layout. For instance, a comparison between primarily quadratic solar cells like typical crystalline silicon solar cells and narrow but long solar cells like typical thin film solar cells can lead to wrong assumptions caused by the different kinds of current paths and therefore the influence of for instance a distributed series resistance rS

19

Page 20: Chapter 1

Cell temperature

Effect of temperature on the current-voltage characteristics of a solar cell

Temperature affects the characteristic equation in two ways: directly, via T in the exponential term, and indirectly via its effect on I0 (strictly speaking, temperature affects all of the terms, but these two far more significantly than the others). While increasing T reduces the magnitude of the exponent in the characteristic equation, the value of I0 increases exponentially with T. The net effect is to reduce VOC (the open-circuit voltage) linearly with increasing temperature. The magnitude of this reduction is inversely proportional to VOC; that is, cells with higher values of VOC suffer smaller reductions in voltage with increasing temperature. For most crystalline silicon solar cells the change in VOC with temperature is about -0.50%/°C, though the rate for the highest-efficiency crystalline silicon cells is around -0.35%/°C. By way of comparison, the rate for amorphous silicon solar cells is -0.20%/°C to -0.30%/°C, depending on how the cell is made.

The amount of photo generated current IL increases slightly with increasing temperature because of an increase in the number of thermally generated carriers in the cell. This effect is slight, however: about 0.065%/°C for crystalline silicon cells and 0.09% for amorphous silicon cells.

The overall effect of temperature on cell efficiency can be computed using these factors in combination with the characteristic equation. However, since the change in voltage is much stronger than the change in current, the overall effect on efficiency tends to be similar to that on voltage. Most crystalline silicon solar cells decline in efficiency by 0.50%/°C and most amorphous cells decline by 0.15-0.25%/°C. The figure above shows I-V curves that might typically be seen for a crystalline silicon solar cell at various temperatures.

20

Page 21: Chapter 1

Series resistance

Effect of series resistance on the current-voltage characteristics of a solar cell

As series resistance increases, the voltage drop between the junction voltage and the terminal voltage becomes greater for the same flow of current. The result is that the current-controlled portion of the I-V curve begins to sag toward the origin, producing a significant decrease in the terminal voltage V and a slight reduction in ISC, the short-circuit current. Very high values of RS will also produce a significant reduction in ISC; in these regimes, series resistance dominates and the behavior of the solar cell resembles that of a resistor. These effects are shown for crystalline silicon solar cells in the I-V curves displayed in the figure to the right.

Losses caused by series resistance are in a first approximation given by Ploss=VRsI=I2RS and increase quadratic ally with (photo-) current. Series resistance losses are therefore most important at high illumination intensities.

21

Page 22: Chapter 1

Shunt resistance

Effect of shunt resistance on the current–voltage characteristics of a solar cell

As shunt resistance decreases, the current diverted through the shunt resistor increases for a given level of junction voltage. The result is that the voltage-controlled portion of the I-V curve begins to sag toward the origin, producing a significant decrease in the terminal current I and a slight reduction in VOC. Very low values of RSH will produce a significant reduction in VOC. Much as in the case of a high series resistance, a badly shunted solar cell will take on operating characteristics similar to those of a resistor. These effects are shown for crystalline silicon solar cells in the I-V curves displayed in the figure to the right.

Reverse saturation current

Effect of reverse saturation current on the current-voltage characteristics of a solar cell

22

Page 23: Chapter 1

If one assumes infinite shunt resistance, the characteristic equation can be solved for VOC:

Thus, an increase in I0 produces a reduction in VOC proportional to the inverse of the logarithm of the increase. This explains mathematically the reason for the reduction in VOC that accompanies increases in temperature described above. The effect of reverse saturation current on the I-V curve of a crystalline silicon solar cell is shown in the figure to the right. Physically, reverse saturation current is a measure of the "leakage" of carriers across the p-n junction in reverse bias. This leakage is a result of carrier recombination in the neutral regions on either side of the junction.

Ideality factor

Effect of ideality factor on the current-voltage characteristics of a solar cell

The ideality factor (also called the emissivity factor) is a fitting parameter that describes how closely the diode's behavior matches that predicted by theory, which assumes the p-n junction of the diode is an infinite plane and no recombination occurs within the space-charge region. A perfect match to theory is indicated when n = 1. When recombination in the space-charge region dominate other recombination, however, n = 2. The effect of changing ideality factor independently of all other parameters is shown for a crystalline silicon solar cell in the I-V curves displayed in the figure to the right.

Most solar cells, which are quite large compared to conventional diodes, well approximate an infinite plane and will usually exhibit near-ideal behavior under Standard Test Condition (n ≈ 1). Under certain operating conditions, however, device operation may be dominated by recombination in the space-charge region. This is characterized by a significant increase in I0 as well as an increase in ideality factor to n ≈ 2. The latter tends to

23

Page 24: Chapter 1

increase solar cell output voltage while the former acts to erode it. The net effect, therefore, is a combination of the increase in voltage shown for increasing n in the figure to the right and the decrease in voltage shown for increasing I0 in the figure above. Typically, I0 is the more significant factor and the result is a reduction in voltage

History of solar cells

The term "photovoltaic" comes from the Greek φῶς (phōs) meaning "light", and "voltaic", meaning electric, from the name of the Italian physicist Volta, after whom a unit of electro-motive force, the volt, is named. The term "photo-voltaic" has been in use in English since 1849.

The photovoltaic effect was first recognized in 1839 by French physicist A. E. Becquerel. However, it was not until 1883 that the first solar cell was built, by Charles Fritts, who coated the semiconductor selenium with an extremely thin layer of gold to form the junctions. The device was only around 1% efficient. In 1888 Russian physicist Aleksandr Stoletov built the first photoelectric cell (based on the outer photoelectric effect discovered by Heinrich Hertz earlier in 1887). Albert Einstein explained the photoelectric effect in 1905 for which he received the Nobel prize in Physics in 1921. Russell Ohl patented the modern junction semiconductor solar cell in 1946, which was discovered while working on the series of advances that would lead to the transistor.

Bell produces the first practical cell

The modern photovoltaic cell was developed in 1954 at Bell Laboratories. The highly efficient solar cell was first developed by Daryl Chapin, Calvin Souther Fuller and Gerald Pearson in 1954 using a diffused silicon p-n junction. At first, cells were developed for toys and other minor uses, as the cost of the electricity they produced was very high - in relative terms, a cell that produced 1 watt of electrical power in bright sunlight cost about $250, comparing to 2 to $3 for a coal plant.

Solar cells were rescued from obscurity by the suggestion to add them to the Vanguard I satellite. In the original plans, the satellite would be powered only by battery, and last a short time while this ran down. By adding cells to the outside of the fuselage, the mission time could be extended with no major changes to the spacecraft or its power systems. There was some skepticism at first, but in practice the cells proved to be a huge success, and solar cells were quickly designed into many new satellites, notably Bell's own Telstar.

Improvements were slow over the next two decades, and the only widespread use was in space applications where their power-to-weight ratio was higher than any competing technology. However, this success was also the reason for slow progress; space users were willing to pay anything for the best possible cells, there was no reason to invest in lower-cost solutions if this would reduce efficiency. Instead, the price of cells was determined largely by the semiconductor industry; their move to integrated circuits in the 1960s led to the availability of larger boules at lower relative prices. As their price fell, the price of the

24

Page 25: Chapter 1

resulting cells did as well. However these effects were limited, and by 1971 cell costs were estimated to be $100 a watt.

Berman's price reductions

In the late 1960s, Elliot Berman was investigating a new method for producing the silicon feedstock in a ribbon process. However, he found little interest in the project and was unable to gain the funding needed to develop it. In a chance encounter, he was later introduced to a team at Exxon who were looking for projects 30 years in the future. The group had concluded that electrical power would be much more expensive by 2000, and felt that this increase in price would make new alternative energy sources more attractive, and solar was the most interesting among these. In 1969, Berman joined the Linden, New Jersey Exxon lab, Solar Power Corporation (SPC).

His first major effort was to canvas the potential market to see what possible uses for a new product were, and they quickly found that if the dollars per watt was reduced from then-current $100/watt to about $20/watt there was significant demand. Knowing that his ribbon concept would take years to develop, the team started looking for ways to hit the $20 price point using existing materials.

The first improvement was the realization that the existing cells were based on standard semiconductor manufacturing process, even though that was not ideal. This started with the boule, cutting it into disks called wafers, polishing the wafers, and then, for cell use, coating them with an anti-reflective layer. Berman noted that the rough-sawn wafers already had a perfectly suitable anti-reflective front surface, and by printing the electrodes directly on this surface, two major steps in the cell processing were eliminated. The team also explored ways to improve the mounting of the cells into arrays, eliminating the expensive materials and hand wiring used in space applications with a printed circuit board on the back, acrylic plastic on the front, and silicone based glue between the two potting the cells. But the largest improvement in price point was Berman's realization that existing silicon was effectively "too good" for solar cell use; the minor imperfections that would ruin a boule (or individual wafer) for electronics would have little effect in the solar application.

Putting all of these changes into practice, the company started buying up "reject" silicon from existing manufacturers at very low cost. By using the largest wafers available, thereby reducing the amount of wiring for a given panel area, and packaging them into panels using their new methods, by 1973 SPC was producing panels at $10 and selling them at $20, a five-fold decrease in prices in two years.

25

Page 26: Chapter 1

Applications

Polycrystalline photovoltaic cells laminated to backing material in a module

Solar cells are often electrically connected and encapsulated as a module. Photovoltaic modules often have a sheet of glass on the front (sun up) side, allowing light to pass while protecting the semiconductor wafers from abrasion and impact due to wind-driven debris, rain, hail, et cetera. Solar cells are also usually connected in series in modules, creating an additive voltage. Connecting cells in parallel will yield a higher current. Modules are then interconnected, in series or parallel, or both, to create an array with the desired peak DC voltage and current.

To make practical use of the solar-generated energy, the electricity is most often fed into the electricity grid using inverters (grid-connected photovoltaic systems); in stand-alone systems, batteries are used to store the energy that is not needed immediately. Solar panels can be used to power or recharge portable devices.

Efficiency

The efficiency of a solar cell may be broken down into reflectance efficiency, thermodynamic efficiency, charge carrier separation efficiency and conductive efficiency. The overall efficiency is the product of each of these individual efficiencies.

Due to the difficulty in measuring these parameters directly, other parameters are measured instead: thermodynamic efficiency, quantum efficiency, VOC ratio, and fill factor. Reflectance losses are a portion of the quantum efficiency under "external quantum efficiency". Recombination losses make up a portion of the quantum efficiency, VOC ratio,

26

Page 27: Chapter 1

and fill factor. Resistive losses are predominantly categorized under fill factor, but also make up minor portions of the quantum efficiency, VOC ratio.

Crystalline silicon devices are now approaching the theoretical limiting efficiency of 29%.

Cost

The cost of a solar cell is given per unit of peak electrical power. Manufacturing costs necessarily including the cost of energy required for manufacture. Solar-specific feed in tariffs vary worldwide, and even state by state within various countries. Such feed-in tariffs can be highly effective in encouraging the development of solar power projects.

High-efficiency solar cells are of interest to decrease the cost of solar energy. Many of the costs of a solar power plant are proportional to the area of the plant; a higher efficiency cell may reduce area and plant cost, even if the cells themselves are more costly. Efficiencies of bare cells, to be useful in evaluating solar power plant economics, must be evaluated under realistic conditions. The basic parameters that need to be evaluated are the short circuit current, open circuit voltage.

The chart at the right illustrates the best laboratory efficiencies obtained for various materials and technologies, generally this is done on very small, i.e. one square cm, cells. Commercial efficiencies are significantly lower.

A low-cost photovoltaic cell is a thin-film cell intended to produce electrical energy at a price competitive with traditional (fossil fuels and nuclear power) energy sources. This includes second and third generation photovoltaic cells, that is cheaper than first generation (crystalline silicon cells, also called wafer or bulk cells).

Grid parity, the point at which photovoltaic electricity is equal to or cheaper than grid power, can be reached using low cost solar cells. It is achieved first in areas with abundant

27

Page 28: Chapter 1

sun and high costs for electricity such as in California and Japan. Grid parity has been reached in Hawaii and other islands that otherwise use diesel fuel to produce electricity. George W. Bush had set 2015 as the date for grid parity in the USA. Speaking at a conference in 2007, General Electric's Chief Engineer predicted grid parity without subsidies in sunny parts of the United States by around 2015.

The price of solar panels fell steadily for 40 years, until 2004 when high subsidies in Germany drastically increased demand there and greatly increased the price of purified silicon (which is used in computer chips as well as solar panels). One research firm predicted that new manufacturing capacity began coming on-line in 2008 (projected to double by 2009) which was expected to lower prices by 70% in 2015. Other analysts warned that capacity may be slowed by economic issues, but that demand may fall because of lessening subsidies. Other potential bottlenecks which have been suggested are the capacity of ingot shaping and wafer slicing industries, and the supply of specialist chemicals used to coat the cells.

Materials

Different materials display different efficiencies and have different costs. Materials for efficient solar cells must have characteristics matched to the spectrum of available light. Some cells are designed to efficiently convert wavelengths of solar light that reach the Earth surface. However, some solar cells are optimized for light absorption beyond Earth's atmosphere as well. Light absorbing materials can often be used in multiple physical configurations to take advantage of different light absorption and charge separation mechanisms.

Materials presently used for photovoltaic solar cells include monocrystalline silicon, polycrystalline silicon, amorphous silicon, cadmium telluride, and copper indium selenide/sulfide.

Many currently available solar cells are made from bulk material that are cut into wafers between 180 to 240 micrometers thick that are then processed like other semiconductors.

Other materials are made as thin-films layers, organic dyes, and organic polymers that are deposited on supporting substrates. A third group are made from nanocrystals and used as quantum dots (electron-confined nanoparticles). Silicon remains the only material that is well-researched in both bulk and thin-film forms.

28

Page 29: Chapter 1

Crystalline silicon

Basic structure of a silicon based solar cell and its working mechanism.

By far, the most prevalent bulk material for solar cells is crystalline silicon (abbreviated as a group as c-Si), also known as "solar grade silicon". Bulk silicon is separated into multiple categories according to crystallinity and crystal size in the resulting ingot, ribbon, or wafer.

1. mono crystalline silicon (c-Si): often made using the Czochralski process. Single-crystal wafer cells tend to be expensive, and because they are cut from cylindrical ingots, do not completely cover a square solar cell module without a substantial waste of refined silicon. Hence most c-Si panels have uncovered gaps at the four corners of the cells.

2. Poly- or multi crystalline silicon (poly-Si or mc-Si): made from cast square ingots — large blocks of molten silicon carefully cooled and solidified. Poly-Si cells are less expensive to produce than single crystal silicon cells, but are less efficient. US DOE data shows that there were a higher number of multi crystalline sales than mono crystalline silicon sales.

3. Ribbon silicon is a type of multi crystalline silicon: it is formed by drawing flat thin films from molten silicon and results in a mult icy stalline structure. These cells have lower efficiencies than poly-Si, but save on production costs due to a great reduction in silicon waste, as this approach does not require sawing from ingots.

Analysts have predicted that prices of polycrystalline silicon will drop as companies build additional poly silicon capacity quicker than the industry’s projected demand. On the other hand, the cost of producing upgraded metallurgical-grade silicon, also known as UMG Si, can potentially be one-sixth that of making poly silicon.

29

Page 30: Chapter 1

Thin films

Thin-film technologies reduce the amount of material required in creating a solar cell. Though this reduces material cost, it may also reduce energy conversion efficiency. Thin-film silicon cells have become popular due to cost, flexibility, lighter weight, and ease of integration, compared to wafer silicon cells.

Cadmium telluride solar cell

A cadmium telluride solar cell uses a cadmium telluride (CdTe) thin film, a semiconductor layer to absorb and convert sunlight into electricity. Solarbuzz has reported that the lowest quoted thin-film module price stands at US$1.76 per watt-peak, with the lowest crystalline silicon (c-Si) module at $2.48 per watt-peak.

The cadmium present in the cells would be toxic if released. However, release is impossible during normal operation of the cells and is unlikely during fires in residential roofs.[22] A square meter of CdTe contains approximately the same amount of Cd as a single C cell Nickel-cadmium battery, in a more stable and less soluble form.

Copper-Indium Selenide

Copper indium gallium selenide (CIGS) is a direct-band gap material. It has the highest efficiency (~20%) among thin film materials (see CIGS solar cells). Traditional methods of fabrication involve vacuum processes including co-evaporation and sputtering. Recent developments at IBM and Nanosolar have been targeting to lower the cost by using non-vacuum solution processes.

Gallium arsenide multi junction

High-efficiency multi junction cells were originally developed for special applications such as satellites and space exploration, but at present, their use in terrestrial concentrators might be the lowest cost alternative in terms of $/kWh and $/W.[23] These multi junction cells consist of multiple thin films produced using metal organic vapor phase epitaxial. A triple-junction cell, for example, may consist of the semiconductors: GA As, Ge, and GaInP2. Each type of semiconductor will have a characteristic band gap energy which, loosely speaking, causes it to absorb light most efficiently at a certain color, or more precisely, to absorb electromagnetic radiation over a portion of the spectrum. The semiconductors are carefully chosen to absorb nearly the entire solar spectrum, thus generating electricity from as much of the solar energy as possible.

GA As based multi junction devices are the most efficient solar cells to date. In October 2010, triple junction metamorphic cell reached a record high of 42.3%.

This technology is currently being utilized in the Mars Exploration Rover missions which

30

Page 31: Chapter 1

Organic/polymer solar cells

Organic solar cells are a relatively novel technology, yet hold the promise of a substantial price reduction (over thin-film silicon) and a faster return on investment. These cells can be processed from solution, hence the possibility of a simple roll-to-roll printing process, leading to inexpensive, large scale production.

Organic solar cells and polymer solar cells are built from thin films (typically 100 nm) of organic semiconductors including polymers, such as polyphenylene vinylene and small-molecule compounds like copper phthalocyanine (a blue or green organic pigment) and carbon fullerenes and fullerene derivatives such as PCBM. Energy conversion efficiencies achieved to date using conductive polymers are low compared to inorganic materials. However, it improved quickly in the last few years and the highest NREL (National Renewable Energy Laboratory) certified efficiency has reached 6.77%. In addition, these cells could be beneficial for some applications where mechanical flexibility and disposability are important.

These devices differ from inorganic semiconductor solar cells in that they do not rely on the large built-in electric field of a PN junction to separate the electrons and holes created when photons are absorbed. The active region of an organic device consists of two materials, one which acts as an electron donor and the other as an acceptor. When a photon is converted into an electron hole pair, typically in the donor material, the charges tend to remain bound in the form of an exciton, and are separated when the exciton diffuses to the donor-acceptor interface. The short exciton diffusion lengths of most polymer systems tend to limit the efficiency of such devices. Nanostructured interfaces, sometimes in the form of bulk hetero junctions, can improve performance.

Silicon thin films

Silicon thin-film cells are mainly deposited by chemical vapor deposition (typically plasma-enhanced (PE-CVD)) from silane gas and hydrogen gas. Depending on the deposition parameters, this can yield:

1. Amorphous silicon 2. Proto crystalline silicon or3. Nano crystalline silicon), also called microcrystalline silicon.

It has been found that proto crystalline silicon with a low volume fraction of Nano crystalline silicon is optimal for high open circuit voltage. These types of silicon present dangling and twisted bonds, which results in deep defects (energy levels in the band gap) as well as deformation of the valence and conduction bands (band tails). The solar cells made from these materials tend to have lower energy conversion efficiency than bulk silicon, but are also less expensive to produce. The quantum efficiency of thin film solar cells is also lower due to reduced number of collected charge carriers per incident photon.

31

Page 32: Chapter 1

An amorphous silicon (a-Si) solar cell is made of amorphous or microcrystalline silicon and its basic electronic structure is the p-i-n junction. As the amorphous structure has a higher absorption rate of light than crystalline cells, the complete light spectrum can be absorbed with a very thin layer of photo-electrically active material. A film only 1 micron thick can absorb 90% of the usable solar energy. The production of a-Si thin film solar cells uses glass as a substrate and deposits a very thin layer of silicon by plasma-enhanced chemical vapor deposition (PECVD). A-Si manufacturers are working towards lower costs per watt and higher conversion efficiency with continuous research and development on Multi junction solar cells for solar panels. An well Technologies Limited recently announced its target for multi-substrate-multi-chamber PECVD, to lower the cost to USD0.5 per watt.

Amorphous silicon has a higher band gap than crystalline silicon which means it absorbs the visible part of the solar spectrum more strongly than the infrared portion of the spectrum. As nc-Si has about the same band gap as c-Si, the nc-Si and a-Si can advantageously be combined in thin layers, creating a layered cell called a tandem cell. The top cell in a-Si absorbs the visible light and leaves the infrared part of the spectrum for the bottom cell in nc-Si.

Recently, solutions to overcome the limitations of thin-film crystalline silicon have been developed. Light trapping schemes where the weakly absorbed long wavelength light is obliquely coupled into the silicon and traverses the film several times can significantly enhance the absorption of sunlight in the thin silicon films. Thermal processing techniques can significantly enhance the crystal quality of the silicon and thereby lead to higher efficiencies of the final solar cells.

32

Page 33: Chapter 1

Chapter 2

Microchip technology

Abstract

In this chapter we will talk about the ways of making control of the motion of solar tracking system.

There are many ways of controlling. And we will concentrate on the micro chipping technology. And ways of making solar tracking systems

Types of solar tracking system

Active solar tracking systems explained

Solar panel tracking systems are a good choice when enough land is available to space panels adequately. Shading problems must be considered, as they are more of an issue when the panel arrays are moving fixed pole mount as well as tracking arrays.

There are two kind of active solar tracking systems:

1. Astronomical or Chronological: The electronic system calculates the current position of the Sun at the location and the tracking motor moves the solar modules perpendicular to the Sun at pre-set times intervals using precise coordinates.

2. Sensor controlled: Instead of aligning the modules using the astronomical position of the Sun, a tracking system fitted with light sensor points the solar panels towards the brightest points in the sky. Under a complete overcast sky for example, the modules will be in a horizontal position.

Why use an active solar tracking system?

Making the most of our solar power energy requires highly efficient solar cells and advanced sun tracking systems. Sun tracking allows the solar cells to face the strongest sunlight while it is available, they need to be able to detect the strength of sunlight in different directions to determine the best location for the strongest sunlight.

33

Page 34: Chapter 1

The solar plates must be constantly adjusted to the correct angle and direction by the sun tracker system, which requires a multi-axis motion control system.

Because sun tracker systems are installed in outdoor areas in direct sunlight, the devices in the system needs to be able to withstand harsh environments and have wide operating temperatures.

Passive solar tracking systems explained

How a passive solar tracking system works

A thermo hydraulic system consisting of two tube tanks is placed at the sides of the photovoltaic panels, if the PV array is not aligned with the Sun, the fluid in the tanks will heat unevenly resulting in pressure difference that will drive the fluid through a connecting pipe into the tube tank with the lowest temperature.

The liquid is moved from side to side and this allows gravity to turn the tracker to follow the sun, the shift in weight will cause the photovoltaic solar panels to rotate and face the Sun.

PV panels using passive solar tracking system

34

Page 35: Chapter 1

Passive solar tracking systems advantages:

Less expensive than active solar tracking systems.

More reliable and in need of less maintenance.

Do not consume electricity and require no motor.

Less likely to suffer lightning damage.

Passive solar tracking systems disadvantages:

Not as efficient as active solar tracking systems.

Tend to be sluggish, particularly in the morning.

MICROPROCESSOR BASED FIBRE OPTIC PRESSURE SENSOR

The system works on the principle of micro bending of optical fibers. Low cost, constructional simplicity, versatility and microcomputer compatibility are some of the

important features of the proposed device. The design of the instrument involves a fiber optic sensor, hardware and software parts.

35

Page 36: Chapter 1

Hardware design details:

Sensor:

The sensor used for pressure measurement is based on micro bending principle. The sensor has 2 ft. long fiber of 50 micrometer core diameter. The Fiber is placed between two corrugated surfaces, out of which the upper one is movable and the lower is fixed. Optical power is taken from a 6.0 V drywell torch bulb and is given to the core of the fiber. On application of continuous physical pressure varying from .02 Kg/cm2 to 20 Kg/cm2 on the upper surface, the fiber undergoes a proportional micro bending resulting into losses and attenuation of the optical signal. A pin photodiode (SI 100S) acts as photo detector at the receiving end of the fiber. Signal Conditioner: Signal from photo detector is amplified through a DC Amplifier using OPAMP 741. The analog amplified output needs to be converted to Digital Signal before it is applied to a Microprocessor which is done through ADC 0809.

Controlling using fuzzy logic circuits

In most research literature, a fuzzy controller system is commonly defined as a system that emulates a human expert. In this case, the knowledge of the human operator would be put in the form of a set of fuzzy linguistic rules. These rules would produce an approximate decision in the same manner a human would do.

36

Page 37: Chapter 1

The fuzzy controller is composed of the following four elements. These are fuzzification, rule base, inference mechanism and defuzzification. A fuzzification interface converts the crisp inputs into the fuzzy membership values that are used in the rule base in order to execute the related rules so that an output can be generated

A rule base consists of a data table which includes information related to the system. An inference mechanism emulates the experts decision making in interpreting and applying knowledge about how best to control the plant.

A defuzzification interface converts the conclusions of the inference mechanism into the crisp inputs for the process.

The related simulation results are given in the following figures. The system responses from both FL and PI controllers for fixed angular position are plotted on the same graph for better comparison. is shown the output of the system for FL and PI controllers. It was

observed that the FLC gives faster response and less overshoot than PI controller.

37

Page 38: Chapter 1

Solar tracking system using Altera Nios II processor

The design combines a Nios II processor with a two-axis motor tracking controller to integrate peripherals such as microprocessor, memory, and I/O into one Altera FPGA based on system-on-a-programmable-chip (SOPC) concepts.

This integration accelerates development while maintaining design flexibility, reduces the circuit board costs with a single-chip solution

Solar Tracker Control Block Diagram

The implemented the system’s logic low design using the Nios II processor control circuit. shows the tracking control flow chart. The system starts when we turn on the tracking control circuit’s power supply switch. The tracking control circuit performs system tracking, energy saving, and system protection, as well as a designed control mode and external anti-interference measures. External interference includes weather influences, such as wind, sand, rain, snow, hail, salt damage

Tracking Control Flow Chart38

Page 39: Chapter 1

the Nios II processor is the control center and integrates our two-axis control chip. The system determines which data is fed back to the FPGA using a photography sensor. It conducts the tracking control rule operation to calculate the angle required by the motor and adjusts motor’s current angle. It also moves the solar panel to achieve optimal power.

System Architecture

39

Page 40: Chapter 1

For the hardware design, we first used a balance sensor to set the system’s zero point. Then, we designed a tracking sensor to determine the orientation of the solar light source. The signals fed back by the sensor form the basis of the controller input. The control design outputs the signals to control the two axis step motor and the solar tracking control system. The following sections introduce the hardware.

Pic16f877a microchip technology

WHAT IS A PIC MICROCONTROLLER? WHAT CAN IT DO?

PIC microcontrollers (Programmable Interface Controllers), are electronic circuits that can be programmed to carry out a vast range of tasks. They can be programmed to be timers or to control a production line and much more. They are found in most electronic devices such as alarm systems, computer control systems, phones, in fact almost any electronic device. Many types of PIC microcontrollers exist,

although the best are probably found in the GENIE range of programmable microcontrollers.

These are programmed and simulated by Circuit Wizard software.PIC Microcontrollers are relatively cheap and can be bought as pre-built circuits or as kits that can be assembled by the user.

40

Page 41: Chapter 1

You will need a computer to run software, such as Circuit Wizard, allowing you to program a PIC microcontroller circuit. A fairly cheap, low specification computer should run the software with ease. The computer will need a serial port or a USB port. This is used to connect the computer to the microcontroller circuit.

Software such as, Genie Design Studio can be downloaded for free. It can be used to program microcontroller circuits. It allows the programmer to simulate the program, before downloading it to a PIC microcontroller IC (Integrated Circuit). Simulating the program on screen, allows the programmer to correct faults and to change the program.The software is quite easy to learn, as it is flow chart based. Each ‘box’ of a flow chart has a purpose and replaces numerous lines of text programming code. This means that a program can be written quite quickly, with fewer mistakes.

Parameters and Features

41

Page 42: Chapter 1

Analog Features:

• 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)• Brown-out Reset (BOR)• Analog Comparator module with:- Two analog comparators- Programmable on-chip voltage reference (VREF) module- Programmable input multiplexing from device inputs and internal voltage reference- Comparator outputs are externally accessible

Special Microcontroller Features:

• 100,000 erase/write cycle Enhanced Flash program memory typical• 1,000,000 erase/write cycle Data EEPROM memory typical• Data EEPROM Retention > 40 years• Self-reprogrammable under software control• In-Circuit Serial Programming (ICSP™) via two pins• Single-supply 5V In-Circuit Serial Programming• Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation• Programmable code protection• Power saving Sleep mode• Selectable oscillator options

Peripheral Features:

42

Page 43: Chapter 1

• Timer0: 8-bit timer/counter with 8-bit pre scalar• Timer1: 16-bit timer/counter with pre scalar, can be incremented during Sleep via external crystal/clock• Timer2: 8-bit timer/counter with 8-bit period register, pre scalar - Capture is 16-bit, max. Resolution is 12.5 ns- Compare is 16-bit, max. Resolution is 200 ns- PWM max. Resolution is 10-bit• Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™ (Master/Slave)• Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address detection• Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls (40/44-pin only)• Brown-out detection circuitry for Brown-out Reset (BOR)

Core architecture

The PIC architecture is characterized by its multiple attributes:

Separate code and data spaces (Harvard architecture) for devices other than PIC32, which has a Von Neumann architecture.

A small number of fixed length instructions Most instructions are single cycle execution (2 clock cycles), with one delay cycle on

branches and skips One accumulator (W0), the use of which (as source operand) is implied (i.e. is not

encoded in the op-code) All RAM locations function as registers as both source and/or destination of math

and other functions. A hardware stack for storing return addresses A fairly small amount of addressable data space (typically 256 bytes), extended

through banking Data space mapped CPU, port, and peripheral registers The program counter is also mapped into the data space and writable (this is used to

implement indirect jumps).

There is no distinction between memory space and register space because the RAM serves the job of both memory and registers, and the RAM is usually just referred to as the register file or simply as the registers.

Data space (RAM)

43

Page 44: Chapter 1

PICs have a set of registers that function as general purpose RAM. Special purpose control registers for on-chip hardware resources are also mapped into the data space. The addressability of memory varies depending on device series, and all PIC devices have some banking mechanism to extend addressing to additional memory. Later series of devices feature move instructions which can cover the whole addressable space, independent of the selected bank. In earlier devices, any register move had to be achieved via the accumulator.

To implement indirect addressing, a "file select register" (FSR) and "indirect register" (INDF) are used. A register number is written to the FSR, after which reads from or writes to INDF will actually be to or from the register pointed to by FSR. Later devices extended this concept with post- and pre- increment/decrement for greater efficiency in accessing sequentially stored data. This also allows FSR to be treated almost like a stack pointer (SP).

External data memory is not directly addressable except in some high pin count PIC18 devices.

Code space

The code space is generally implemented as ROM, EPROM or flash ROM. In general, external code memory is not directly addressable due to the lack of an external memory interface. The exceptions are PIC17 and select high pin count PIC18 devices

Word size

All PICs handle (and address) data in 8-bit chunks. However, the unit of addressability of the code space is not generally the same as the data space. For example, PICs in the baseline and mid-range families have program memory addressable in the same word size as the instruction width, i.e. 12 or 14 bits respectively. In contrast, in the PIC18 series, the program memory is addressed in 8-bit increments (bytes), which differ from the instruction width of 16 bits.

In order to be clear, the program memory capacity is usually stated in number of (single word) instructions, rather than in bytes.

Stacks

44

Page 45: Chapter 1

PICs have a hardware call stack, which is used to save return addresses. The hardware stack is not software accessible on earlier devices, but this changed with the 18 series devices.

Hardware support for a general purpose parameter stack was lacking in early series, but this greatly improved in the 18 series, making the 18 series architecture more friendly to high level language compilers.

Instruction set

A PIC's instructions vary from about 35 instructions for the low-end PICs to over 80 instructions for the high-end PICs. The instruction set includes instructions to perform a variety of operations on registers directly, the accumulator and a literal constant or the accumulator and a register, as well as for conditional execution, and program branching.

Some operations, such as bit setting and testing, can be performed on any numbered register, but bi-operand arithmetic operations always involve W (the accumulator), writing the result back to either W or the other operand register. To load a constant, it is necessary to load it into W before it can be moved into another register. On the older cores, all register moves needed to pass through W, but this changed on the "high end" cores.

PIC cores have skip instructions which are used for conditional execution and branching. The skip instructions are 'skip if bit set' and 'skip if bit not set'. Because cores before PIC18 had only unconditional branch instructions, conditional jumps are implemented by a conditional skip (with the opposite condition) followed by an unconditional branch. Skips are also of utility for conditional execution of any immediate single following instruction.

The 18 series implemented shadow registers which save several important registers during an interrupt, providing hardware support for automatically saving processor state when servicing interrupts.

In general, PIC instructions fall into 5 classes:

1. Operation on working register (WREG) with 8-bit immediate ("literal") operand (move literal to WREG), andlw (AND literal with WREG). One instruction peculiar to the PIC is retlw, load immediate into WREG and return, which is used with computed branches to produce lookup tables.

2. Operation with WREG and indexed register. The result can be written to either the Working register. or the selected register .

3. Bit operations. These take a register number and a bit number, and perform one of 4 actions: set or clear a bit, and test and skip on set/clear. The latter are used to perform conditional branches. The usual ALU status flags are available in a numbered register so operations such as "branch on carry clear" are possible.

4. Control transfers. Other than the skip instructions previously mentioned, there are only two: go to and call.

45

Page 46: Chapter 1

5. A few miscellaneous zero-operand instructions, such as return from subroutine, and sleep to enter low-power mode.

Performance

The architectural decisions are directed at the maximization of speed-to-cost ratio. The PIC architecture was among the first scalar CPU designs and is still among the simplest and cheapest. The Harvard architecture—in which instructions and data come from separate sources—simplify timing and microcircuit design greatly, and this benefits clock speed, price, and power consumption.

The PIC instruction set is suited to implementation of fast lookup tables in the program space. Such lookups take one instruction and two instruction cycles. Many functions can be modeled in this way. Optimization is facilitated by the relatively large program space of the PIC (e.g. 4096 x 14-bit words on the 16F690) and by the design of the instruction set, which allows for embedded constants. For example, a branch instruction's target may be indexed by W, and execute a "RETLW" which does as it is named - return with literal in W.

Execution time can be accurately estimated by multiplying the number of instructions by two cycles; this simplifies design of real-time code. Similarly, interrupt latency is constant at three instruction cycles. External interrupts have to be synchronized with the four clock instruction cycle; otherwise there can be a one instruction cycle jitter. Internal interrupts are already synchronized. The constant interrupt latency allows PICs to achieve interrupt driven low jitter timing sequences. An example of this is a video sync pulse generator. This is no longer true in the newest PIC models, because they have a synchronous interrupt latency of three or four cycles.

Advantages

The PIC architectures have these advantages:

Small instruction set to learn RISC architecture Built in oscillator with selectable speeds Easy entry level, in circuit programming plus in circuit debugging PICKit units

available from Microchip.com for less than $50 Inexpensive microcontrollers Wide range of interfaces including I2C, SPI, USB, USART, A/D, programmable

Comparators, PWM, LIN, CAN, PSP, and Ethernet

Pin configurations

46

Page 47: Chapter 1

47

Page 48: Chapter 1

48

Page 49: Chapter 1

49

Page 50: Chapter 1

PIC16F874A/877A BLOCK DIAGRAM

50

Page 51: Chapter 1

MEMORY ORGANIZATION

There are three memory blocks in each of the PIC16F87XA devices. The program memory and data memory have separate buses so that concurrent access can occur and is detailed

in this section. The EEPROM data memory block is detailed in Section 3.0 “Data EEPROM and Flash Program Memory”. Additional information on device memory may

be found in the PIC micro Mid-Range MCU Family Reference

51

Page 52: Chapter 1

Programming environments

Microcontrollers were originally programmed only in assembly language, but various high-level programming languages are now also in common use to target microcontrollers. These languages are either designed especially for the purpose, or versions of general purpose languages such as the C programming language. Compilers for general purpose languages will typically have some restrictions as well as enhancements to better support the unique characteristics of microcontrollers. Some microcontrollers have environments to aid developing certain types of applications. Microcontroller vendors often make tools freely available to make it easier to adopt their hardware.

Many microcontrollers are so quirky that they effectively require their own non-standard dialects of C, such as SDCC for the 8051, which prevent using standard tools (such as code libraries or static analysis tools) even for code unrelated to hardware features. Interpreters are often used to hide such low level quirks.

Interpreter firmware is also available for some microcontrollers. For example, BASIC on the early microcontrollers Intel 8052; BASIC and FORTH on the Zilog Z8 as well as some modern devices. Typically these interpreters support interactive programming.

Simulators are available for some microcontrollers, such as in Microchip's MPLAB environment and the Revolution Education PICAXE range. These allow a developer to analyze what the behavior of the microcontroller and their program should be if they were using the actual part. A simulator will show the internal processor state and also that of the outputs, as well as allowing input signals to be generated. While on the one hand most simulators will be limited from being unable to simulate much other hardware in a system, they can exercise conditions that may otherwise be hard to reproduce at will in the physical implementation, and can be the quickest way to debug and analyze problems.

Recent microcontrollers are often integrated with on-chip debug circuitry that when accessed by an in-circuit emulator via JTAG, allow debugging of the firmware with a debugger.

52

Page 53: Chapter 1

ANALOG-TO-DIGITAL CONVERTER (A/D) MODULE

The Analog-to-Digital (A/D) Converter module has five inputs for the 28-pin devices and eight for the 40/44-pin devices.The conversion of an analog input signal results in a corresponding 10-bit digital number. The A/D module has high and low-voltage reference input that is software selectable to some combination of VDD, VSS, RA2 or RA3. The A/D converter has a unique feature of being able to operate while the device is in Sleep mode. To operate in Sleep, the A/D clock must be derived from the A/D’s internal RC oscillator.

The A/D module has four registers. These registers are:

• A/D Result High Register (ADRESH)

• A/D Result Low Register (ADRESL)

• A/D Control Register 0 (ADCON0)

• A/D Control Register 1 (ADCON1)

The ADCON0 register, shown in Register 11-1, controls the operation of the A/D module. The ADCON1 register, shown in Register 11-2, configures the functions of the port pins. The port pins can be configured as analog inputs (RA3 can also be the voltage reference) or as digital I/O.Additional information on using the A/D module can be found in the PIC micro® Mid-Range MCU Family Reference Manual (DS33023).

REGISTER 11-1: ADCON0 REGISTER (ADDRESS 1Fh)

R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0

ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE — ADONBit 7 bit0

53

Page 54: Chapter 1

Bit 7-6 ADCS1:ADCS0: A/D Conversion Clock Select bits (ADCON0 bits in bold)

ADCON1<ADCS2>

ADCON0<ADCS1:ADCS0>

Clock Conversion

0 00FOSC/2

0 01FOSC/8

0 10FOSC/32

0 11FRC (clock derived from the internal A/D RC oscillator)

1 00FOSC/4

1 01FOSC/16

1

1

10

11

FOSC/64

FRC (clock derived from the internal A/D RC oscillator)

bit 5-3 CHS2:CHS0: Analog Channel Select bits000 = Channel 0 (AN0)001 = Channel 1 (AN1)010 = Channel 2 (AN2)011 = Channel 3 (AN3)100 = Channel 4 (AN4)101 = Channel 5 (AN5)110 = Channel 6 (AN6)111 = Channel 7 (AN7)Note: The PIC16F873A/876A devices only implement A/D channels 0 through 4; the unimplemented selections are reserved. Do not select any unimplemented channels with these devices. bit 2 GO/DONE: A/D Conversion Status bitWhen ADON = 1:1 = A/D conversion in progress (setting this bit starts the A/D conversion which is automatically

54

Page 55: Chapter 1

Cleared by hardware when the A/D conversion is complete)0 = A/D conversion not in progress bit 1 Unimplemented: Read as ‘0’ bit 0 ADON: A/D On bit1 = A/D converter module is powered up0 = A/D converter module is shut-off and consumes no operating current

Legend:R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’- n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown

55

Page 56: Chapter 1

Note: On any device Reset, the port pins that are multiplexed with analog functions (ANx) are forced to be an analog input.

56

Page 57: Chapter 1

57

Page 58: Chapter 1

The ADRESH: ADRESL registers contain the 10-bit result of the A/D conversion. When the A/D conversion is complete, the result is loaded into this A/D Result register pair, the GO/DONE bit (ADCON0<2>) is cleared and the A/D interrupt flag bit ADIF is set. The block diagram of the A/D module is shown in Figure 11-1. After the A/D module has been configured as desired, the selected channel must be acquired before the conversion is started. The analog input channels must have their corresponding TRIS bits selected as inputs. To determine sample time, see Section “A/D Acquisition Requirements”. After this acquisition time has elapsed, the A/D conversion can be started. To do an A/D Conversion, follow these steps: 1. Configure the A/D module:

• Configure analog pins/voltage reference and digital I/O (ADCON1)• Select A/D input channel (ADCON0)• Select A/D conversion clock (ADCON0)• Turn on A/D module (ADCON0)

2. Configure A/D interrupts (if desired):• Clear ADIF bit• Set ADIE bit• Set PEIE bit• Set GIE bit3. Wait the required acquisition time.4. Start conversion:• Set GO/DONE bit (ADCON0)5. Wait for A/D conversion to complete by either:• Polling for the GO/DONE bit to be cleared (interrupts disabled); OR• Waiting for the A/D interrupt6. Read A/D Result registers pair (ADRESH: ADRESL), clear bit ADIF if required.7. For the next conversion, go to step 1 or step 2 as required. The A/D conversion time per bit is defined as TAD.

INSTRUCTION SET SUMMARY

The PIC16 instruction set is highly orthogonal and is comprised of three basic categories:• Byte-oriented operations• Bit-oriented operations• Literal and control operationsEach PIC16 instruction is a 14-bit word divided into an opcode which specifies the instruction type and one or more operands which further specify the operation of the

58

Page 59: Chapter 1

instruction. The formats for each of the categories are presented in Figure 15-1, while the various opcode fields are summarized in Table 15-1.Table 15-2 lists the instructions recognized by the MPASM™ Assembler. A complete description of each instruction is also available in the PIC micro® Mid-Range MCU Family Reference Manual (DS33023). For byte-oriented instructions, ‘f’ represents a file register designator and‘d’ represents a destination designator. The file register designator specifies which file register is to be used by the instruction.

The destination designator specifies where the result of the operation is to be placed. If‘d’ is zero, the result is placed in the W register. If‘d’ is one, the result is placed in the file register specified in the instruction. For bit-oriented instructions, ‘b’ represents a bit field designator which selects the bit affected by the operation, while ‘f’ represents the address of the file in which the bit is located.For literal and control operations, ‘k’ represents an eight or eleven-bit constant or literal value.

One instruction cycle consists of four oscillator periods; for an oscillator frequency of 4 MHz, this gives a normal instruction execution time of 1 μs. All instructions are executed within a single instruction cycle, unless a conditional test is true, or the program counter is changed as a result of an instruction. When this occurs, the execution takes two instruction cycles with the second cycle executed as a NOP.All instruction examples use the format ‘0xhh’ to represent a hexadecimal number, where ‘h’ signifies a hexadecimal digit.

READ-MODIFY-WRITE OPERATIONS

Any instruction that specifies a file register as part of the instruction performs a Read-Modify-Write (R-M-W) operation. The register is read, the data is modified, and the result is stored according to either the instruction or the destination designator‘d’. A read operation is performed on a register even if the instruction writes to that register. For example, a “CLRF PORTB” instruction will read PORTB, clear all the data bits, then write the result back to PORTB. This example would have the unintended result that the condition that sets the RBIF flag would be cleared.

59

Page 60: Chapter 1

60

Page 61: Chapter 1

PIC16F87XA INSTRUCTION SET

61

Page 62: Chapter 1

Chapter 3

Solar tracking system

I catch the sun

Abstract:

This chapter shows the potential system benefits of simple tracking solar system using a stepper motor and light sensor.This method is increasing power collection efficiency by developing a device that tracks the sun to keep the panel at a right angle to its rays. A solar tracking system is designed, implemented and experimentally tested. The design details and the experimental results are shown.

Solar energy is rapidly advancing as an important means of renewable energy resource. More energy is produced by tracking the solar panel to remain aligned to the sun at a right angle to the rays of light. This paper describes in detail the design and construction of a prototype for solar tracking system with two degrees of freedom, which detects the sunlight using photocells.The control circuit for the solar tracker is based on a PIC16F877A microcontroller (MCU). This is programmed to detect the sunlight through the photocells and then actuate the motor to position the solar panel where it can receive maximum sunlight.

62

Page 63: Chapter 1

Solar Energy

Solar energy is the radiant light and heat from the Sun that has been exploiting by humans since ancient times using a range of ever-evolving technologies.

Solar radiation along with secondary solar resources such as wind and wave power, hydroelectricity and biomass account for most of the available renewable energy on Earth. Only a little fraction of the available solar energy is used.

Solar energy refers primarily to the use of solar radiation for practical ends. However, all renewable energies, other than geothermal and tidal, derive their energy from the sun. Solar technologies are broadly characterized as either passive or active depending on the way they capture, convert and distribute sunlight. Active solar techniques use photovoltaic panels, pumps, and fans to convert sunlight into useful outputs. Passive solar techniques include selecting materials with favorable thermal properties, designing spaces that naturally circulate air, and referencing the position of a building to the Sun. Active solar technologies increase the supply of energy and are considered supply side technologies, while passive solar technologies reduce the need for alternate resources and are generally considered demand side technologies.

How Solar Energy is used? Generate electricity using photovoltaic solar cells. Generate electricity using concentrated solar power.

Generate electricity by heating trapped air which rotates turbines in a solar Updraft tower.

Generate hydrogen using photo electrochemical cells. Heat and cool air through use of solar chimneys. Heat buildings, directly, through passive solar building design. Heat foodstuffs, through solar ovens.

Heat water or air for domestic hot water and space heating needs usingSolar-thermal panels.

Solar air conditioning

Why tracking systems

Global warming has increased the demand and request for green energy produced by renewable sources - like solar power.

The solar cell market has to be as efficient as possible in order not to lose market shares on the global energy marketplace. There are two main ways to make the solar cells more efficient, either by improving the actual cell or by installing the solar panels on a tracking base that follows the sun.

63

Page 64: Chapter 1

The end-user will prefer the tracking solution rather than a fixed ground system because:

The efficiency increases by 30-40% (= more money). The space requirement for a solar park is reduced, and they keep the same output. The return of the investment timeline is reduced. The tracking system amortizes itself within 4 years (on average).

Advantages to using a tracker system like this will depend mainly on it's placement in determining how well it will increase the effectiveness of the panels. They can be used most effectively in areas with low horizons and locations that are shade free from dawn to dusk each day. Throughout the year the tracking array will be able to utilize the wide open access to gain every available electron from the sun.

This way, energy production is at an optimum and energy output is increased year round. This is especially significant throughout the summer months with its long days of sunlight available to capture and when, at many Northern latitudes, the sun rises in the northeast and sets in the northwest, no energy will be lost.

For those with limited space this means that a smaller array only needs to be installed, a huge advantage for those smaller sites with only a small area to place equipment

64

Page 65: Chapter 1

Types of tracking systems

Nowadays, there are many types of solar tracker in the market as there are single axis, dual-axis, active and passive trackers. In order for these trackers to sustain in the market, thus the tracker must be designed to meet the user's requirement. the optimum solar tracker shall be a dual-axis solar tracker. Anyway, a low cost dual-axis solar tracker will be designed for higher efficiency and will be discussed in this project.

1- Single axis tracking system.

. Tracking the sun from east in the morning to west in the evening will increase the efficiency of the solar panel by 20-62% depending on whom you ask and where you are in the world. Near the equator, you will have the highest benefit of tracking the sun.

2-Dual axis tracking systems

Dual axis tracking is typically used to orient a mirror, to redirect sunlight along a fixed axis towards a stationary target or receiver however you can also gain extra yield on you PV cells. I can provide you with quality actuators that move your panels.

A type of mounting that supports the weight of the solar tracker and allows it to move in two directions to locate a specific target. One axis of support is horizontal (called the altitude) and allows the telescope to move up and down. The other axis is vertical andallows the telescope to swing in a circle parallel to the ground. This makes it easy to

65

Page 66: Chapter 1

position the telescope: swing it around in a circle and then lift it to the target. However, tracking an object as the Earth turns is more complicated. The telescope needs to be adjusted in both directions while tracking, which requires a computer to control the telescope

3-My solar tracking system (for home use)

Active trackers use motors and gear trains to direct the tracker as commanded by a controller responding to the solar direction.

Active two-axis trackers are also used to orient heliostats - movable mirrors that reflect sunlight toward the absorber of a central power station. As each mirror in a large field will have an individual orientation these are controlled programmatically through a central computer system, which also allows the system to be shut down when necessary.

Light-sensing trackers typically have two photo sensors, such as photodiodes, configured differentially so that they output a null when receiving the same light flux. Mechanically, they should be Omni directional (i.e. flat) and are aimed 90 degrees apart. This will cause the steepest part of their cosine transfer functions to balance at the steepest part, which translates into maximum sensitivity.

Since the motors consume energy, one wants to use them only as necessary. So instead of a continuous motion, the heliostat is moved in discrete steps. Also, if the light is below some threshold there would not be enough power generated to warrant reorientation. This is also true when there is not enough difference in light level from one direction to another, such as when clouds are passing overhead. Consideration must be made to keep the tracker from wasting energy during cloudy periods.

66

Page 67: Chapter 1

The system can carry a solar cell produce 18 v and 3 watts power can be used in many applications like (TV, radio, charging battery) and many apps for personal use …it’s all free with unlimited sun light…

Structure design

The solar tracking system consists of dual axis (vertical motor & horizontal motor). The both motions controlled by 2 LDR’s per motor, by checking which LDR on shadow, the motion of motors determined to guarantee that the light is equal in both LDR’s. therefor solar panel is completely vertical to the sun light to get maximum energy.

67

Page 68: Chapter 1

Material used (Teflon)

In chemistry, poly tetra fluoro ethylene (PTFE) is a synthetic fluoro polymer of tetra fluoro ethylene that finds numerous applications. PTFE is most well-known by the DuPont brand name Teflon.

PTFE is a fluorocarbon solid, as it is a high-molecular-weight compound consisting wholly of carbon and fluorine. PTFE is hydrophobic: neither water nor water-containing substances wet PTFE, as fluorocarbons demonstrate mitigated London dispersion forces due to the high electronegativity of fluorine. PTFE has one of the lowest coefficients of friction against any solid.

PTFE is used as a non-stick coating for pans and other cookware. It is very non-reactive, partly because of the strength of carbon–fluorine bonds, and so it is often used in containers and pipework for reactive and corrosive chemicals. Where used as a lubricant, PTFE reduces friction, wear, and energy consumption of machinery.

68

Page 69: Chapter 1

Properties

PTFE is often used to coat non-stick frying pans as it is hydrophobic and possesses fairly high heat resistance.

69

Page 70: Chapter 1

PTFE is a thermoplastic polymer, which is a white solid at room temperature, with a density of about 2.2 g/cm3. According to DuPont, its melting point is 327 °C (621 °F), but its mechanical properties degrade above 260 °C (500 °F). PTFE gains its properties from the aggregate effect of carbon-fluorine bonds, as do all fluorocarbons.

Property Value

Density 2200 kg/m3

Melting point 327°C

Young's modulus 0.5 GPa

Yield strength 23 MPa

Coefficient of friction 0.05–0.10

Dielectric constant ε=2.1,tan(δ)<5(-4)

Dielectric constant (60 Hz) ε=2.1,tan(δ)<2(-4)

Dielectric strength (1 MHz) 60 MV/m

The coefficient of friction of plastics is usually measured against polished steel. PTFE's coefficient of friction is 0.05 to 0.10, which is the third-lowest of any known solid material (BAM being the first, with a coefficient of friction of 0.02; diamond-like carbon being second-lowest at 0.05). PTFE's resistance to van der Waals forces means that it is the only known surface to which a gecko cannot stick.

PTFE has excellent dielectric properties. This is especially true at high radio frequencies, making it suitable for use as an insulator in cables and connector assemblies and as a material for printed circuit boards used at microwave frequencies. Combined with its high melting temperature, this makes it the material of choice as a high-performance substitute for the weaker and lower melting point polyethylene that is commonly used in low-cost applications.

Because of its chemical inertness, PTFE cannot be cross-linked like an elastomer. Therefore, it has no "memory" and is subject to creep. This is advantageous when used as a seal, because the material creeps a small amount to conform to the mating surface. However, to keep the seal from creeping too much, fillers are used, which can also improve wear resistance and reduce friction. Sometimes, metal springs apply continuous force to PTFE seals to give good contact, while permitting a beneficially low percentage of creep

70

Page 71: Chapter 1

Applications and why I used Teflon

Owing to its low friction, it is used for applications where sliding action of parts is needed: plain bearings, gears, slide plates, etc. In these applications, it performs significantly better than nylon and acetyl; it is comparable to ultra-high-molecular-weight polyethylene (UHMWPE), although UHMWPE is more resistant to wear than Teflon. For these applications, versions of Teflon with mineral oil or molybdenum disulfide embedded as additional lubricants in its matrix are being manufactured. Its extremely high bulk resistivity makes it an ideal material for fabricating long-life electrets, useful devices that are the electrostatic analogues of magnets.

Gore-Tex is a material incorporating a fluoro polymer membrane with microspores. The roof of the Hubert H. Humphrey Metro dome in Minneapolis is one of the largest applications of Teflon PTFE coatings, using 20 acres (81,000 m2) of the material in a double-layered, white dome, made with PTFE-coated fiberglass, that gives the stadium its distinctive appearance. The Millennium Dome in London is also made substantially of PTFE.

Powdered PTFE is used in pyrotechnic compositions as oxidizers together with powdered metals such as aluminum and magnesium. Upon ignition, these mixtures form carbonaceous soot and the corresponding metal fluoride, and release large amounts of heat. Hence they are used as infrared decoy flares and igniters for solid-fuel rocket propellants.

In optical radiometry, sheets made from PTFE are used as measuring heads in spectra diameters and broadband radiometers (e.g., IL luminance meters and UV radiometers) due to its capability to diffuse a transmitting light nearly perfectly. Moreover, optical properties of PTFE stay constant over a wide range of wavelengths, from UV up to near infrared. In this region, the relation of its regular transmittance to diffuse transmittance is negligibly small, so light transmitted through a diffuser (PTFE sheet) radiates like Lambert's cosine law. Thus, PTFE enables sinusoidal angular response for a detector measuring the power of optical radiation at a surface, e.g., in solar irradiance measurements.

PTFE is also used to coat certain types of hardened, armor-piercing bullets, so as to prevent the increased wear on the firearm's rifling that would result from the harder projectile; however it is not the PTFE itself that gives the bullet its armor-piercing property.

PTFE's high corrosion resistance makes it ideal for laboratory environments as containers, as magnetic stirrer coatings, and as tubing for highly corrosive chemicals such as hydrofluoric acid, which will dissolve glass containers

PTFE is also widely used as a thread seal tape in plumbing applications, largely replacing paste thread dope. PTFE grafts can be used to bypass steno tic arteries in peripheral vascular disease, if a suitable autologous vein graft is not available. PTFE can be used to prevent insects climbing up surfaces painted with the material. PTFE is so slippery that

71

Page 72: Chapter 1

insects cannot get a grip and tend to fall off. For example, PTFE is used to prevent ants climbing out of formic aria.

Mechanical design

For the first time I thought about the mechanical design more than the circuit design…it’s

the first time I make a design for a machine … Then I used a simulation program for

designing the motion of tow axis and this is a short description for the program used and the machine I designed

Solid Works is a 3D mechanical CAD (computer-aided design) program that runs

on Microsoft Windows and is being developed by a subsidiary of Assault Systems, S. A. (France). Solid Works is currently used by over 1.3 million engineers and designers at more than 130,000 companies worldwide

72

Page 73: Chapter 1

Modeling methodology

Solid Works is a Para solid-based solid modeler, and utilizes a parametric feature-based approach to create models and assemblies.

Parameters refer to constraints whose values determine the shape or geometry of the model or assembly. Parameters can be either numeric parameters, such as line lengths or circle diameters, or geometric parameters, such as tangent, parallel, concentric, horizontal or vertical, etc. Numeric parameters can be associated with each other through the use of a relation, which allows them to capture design intent.

Design intent is how the creator of the part wants it to respond to changes and updates. For example, you would want the hole at the top of a beverage can to stay at the top surface, regardless of the height or size of the can. Solid Works allows you to specify that the hole is

73

Page 74: Chapter 1

a feature on the top surface, and will then honor your design intent no matter what the height you later gave to the can.

Features refer to the building blocks of the part. They are the shapes and operations that construct the part. Shape-based features typically begin with a 2D or 3D sketch of shapes such as bosses, holes, slots, etc. This shape is then extruded or cut to add or remove material from the part. Operation-based features are not sketch-based, and include features such as fillets, chamfers, shells, applying draft to the faces of a part, etc.

(Screen shot captured from a Solid Works top-down design approach.)

Building a model in Solid Works usually starts with a 2D sketch (although 3D sketches are available for power users). The sketch consists of geometry such as points, lines, arcs, conics (except the hyperbola), and splines. Dimensions are added to the sketch to define the size and location of the geometry. Relations are used to define attributes such as tangency, parallelism, perpendicularity, and concentricity. The parametric nature of Solid Works means that the dimensions and relations drive the geometry, not the other way around. The dimensions in the sketch can be controlled independently, or by relationships to other parameters inside or outside of the sketch.

In an assembly, the analog to sketch relations are mates. Just as sketch relations define conditions such as tangency, parallelism, and concentricity with respect to sketch geometry, assembly mates define equivalent relations with respect to the individual parts or components, allowing the easy construction of assemblies. Solid Works also includes additional advanced mating features such as gear and cam follower mates, which allow modeled gear assemblies to accurately reproduce the rotational movement of an actual gear train.

Finally, drawings can be created either from parts or assemblies. Views are automatically generated from the solid model, and notes, dimensions and tolerances can then be easily added to the drawing as needed. The drawing module includes most paper sizes and standards

Machine parts

74

Page 75: Chapter 1

And this is the machine I designed with full details and dimensions

(Screen shot captured from a Solid Works top-down design approach.)

75

Page 76: Chapter 1

76

Page 77: Chapter 1

77

Page 78: Chapter 1

78

Page 79: Chapter 1

79

Page 80: Chapter 1

80

Page 81: Chapter 1

81

Page 82: Chapter 1

82

Page 83: Chapter 1

Circuit design

For well-known how the circuit works u must know how to what is motor and why I used stepper and how can u drive it with micro controller…let’s talk about stepper motor

Stepper motor

A stepper motor (or step motor) is a brushless, electric motor that can divide a full rotation into a large number of steps. The motor's position can be controlled precisely without any feedback mechanism (see Open-loop controller), as long as the motor is carefully sized to the application. Stepper motors are similar to switched reluctance motors (which are very large stepping motors with a reduced pole count, and generally are closed-loop commutated).

Fundamentals of operation

Stepper motors operate differently from DC brush motors, which rotate when voltage is applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. The electromagnets are energized by an external control circuit, such as a microcontroller. To make the motor shaft turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted to the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet, they are slightly offset from the next electromagnet.

So when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one

and from there the process is repeated. Each of those slight rotations is called a "step", with an integer number of steps making a full rotation. In that way, the motor can be turned by a precise angle.

Stepper motor characteristics

1. Stepper motors are constant power devices.2. As motor speed increases, torque decreases. (Most motors exhibit maximum torque

when stationary, however the torque of a motor when stationary (holding torque) defines the ability of the motor to maintain a desired position while under external load).

3. The torque curve may be extended by using current limiting drivers and increasing the driving voltage (sometimes referred to as a 'chopper' circuit; there are several off the shelf driver chips capable of doing this in a simple manner).

83

Page 84: Chapter 1

4. Steppers exhibit more vibration than other motor types, as the discrete step tends to snap the rotor from one position to another (called a decent). The vibration makes stepper motors noisier than DC motors.

5. This vibration can become very bad at some speeds and can cause the motor to lose torque or lose direction. This is because the rotor is being held in a magnetic field which behaves like a spring. On each step the rotor overshoots and bounces back and forth, "ringing" at its resonant frequency. If the stepping frequency matches the resonant frequency then the ringing increases and the motor comes out of synchronism, resulting in positional error or a change in direction. At worst there is a total loss of control and holding torque so the motor is easily overcome by the load and spins almost freely.

6. The effect can be mitigated by accelerating quickly through the problem speeds range, physically damping (frictional damping) the system, or using a micro-stepping driver.

7. Motors with a greater number of phases also exhibit smoother operation than those with fewer phases (this can also be achieved through the use of a micro stepping drive)

Stepper Motor Advantages and Disadvantages

Advantages:

1. The rotation angle of the motor is proportional to the input pulse.

2. The motor has full torque at standstill (if the windings are energized)

3. Precise positioning and repeatability of movement since good stepper motors have an accuracy of 3 – 5% of a step and this error is non cumulative from one step to the next.

4. Excellent response to starting/ stopping/reversing.

5. Very reliable since there are no contact brushes in the motor. Therefore, the life of the motor is simply dependent on the life of the bearing.

6. The motors response to digital input pulses provides open-loop control, making the motor simpler and less costly to control.

7. It is possible to achieve very low speed synchronous rotation with a load that is directly coupled to the shaft.

8. A wide range of rotational speeds can be realized as the speed is proportional to the frequency of the input pulses.

Disadvantages:

1. Resonances can occur if not properly controlled.

84

Page 85: Chapter 1

2. Not easy to operate at extremely high speeds.

Two-phase stepper motors

There are two basic winding arrangements for the electromagnetic coils in a two phase stepper motor: bipolar and unipolar.

Unipolar motors

A unipolar stepper motor has two windings per phase, one for each direction of magnetic field. Since in this arrangement a magnetic pole can be reversed without switching the direction of current, the commutation circuit can be made very simple (e.g. a single transistor) for each winding. Typically, given a phase, one end of each winding is made common: giving three leads per phase and six leads for a typical two phase motor. Often, these two phase commons are internally joined, so the motor has only five leads.

A microcontroller or stepper motor controller can be used to activate the drive transistors in the right order, and this ease of operation makes unipolar motors popular with hobbyists; they are probably the cheapest way to get precise angular movements.

Unipolar stepper motor coils

(For the experimenter, one way to distinguish common wire from a coil-end wire is by measuring the resistance. Resistance between common wire and coil-end wire is always half of what it is between coil-end and coil-end wires. This is because there is twice the length of coil between the ends and only half from center (common wire) to the end.) A quick way to determine if the stepper motor is working is to short circuit every two pairs and try turning the shaft, whenever a higher than normal resistance is felt, it indicates that the circuit to the particular winding is closed and that the phase is working.

85

Page 86: Chapter 1

The unipolar stepper motor has five or six wires and four coils (actually two coils divided by center connections on each coil). The center connections of the coils are tied together and used as the power connection. They are called unipolar steppers because power always comes in on this one pole.

86

Page 87: Chapter 1

Bipolar motor

Bipolar motors have a single winding per phase. The current in a winding needs to be reversed in order to reverse a magnetic pole, so the driving circuit must be more complicated; typically with an H-bridge arrangement (however there are several off the shelf driver chips available to make this a simple affair). There are two leads per phase, none are common.

Static friction effects using an H-bridge have been observed with certain drive topologies

Because windings are better utilized, they are more powerful than a unipolar motor of the same weight. This is due to the physical space occupied by the windings. A unipolar motor has twice the amount of wire in the same space, but only half used at any point in time, hence is 50% efficient (or approximately 70% of the torque output available). Though bipolar is more complicated to drive, the abundance of driver chips means this is much less difficult to achieve.

An 8-lead stepper is wound like a unipolar stepper, but the leads are not joined to common internally to the motor. This kind of motor can be wired in several configurations:

Unipolar. Bipolar with series windings. This gives higher inductance but lower current per

winding. Bipolar with parallel windings. This requires higher current but can perform better

as the winding inductance is reduced. Bipolar with a single winding per phase. This method will run the motor on only

half the available windings, which will reduce the available low speed torque but require less current.

Higher-phase count stepper motors

Multi-phase stepper motors with many phases tend to have much lower levels of vibration, although the cost of manufacture is higher. These motors tend to be called 'hybrid' and have more expensive machined parts, but also higher quality bearings. Though they are more expensive, they do have a higher power density and with the appropriate drive electronics are actually better suited to the application however price is always an important factor. Computer printers may use hybrid designs.

87

Page 88: Chapter 1

Stepper motors control circuits

To control the stepper, apply voltage to each of the coils in a specific sequence. The sequence would go like this:

Step wire 1 wire 2 wire 3 wire 41 High low high low2 low high high low3 low high low high4 high low low high

To control a unipolar stepper, you use a Darlington Transistor Array. The stepping sequence is as shown above. Wires 5 and 6 are wired to the supply voltage.

To control a bipolar stepper motor, you give the coils current using to the same steps as for a unipolar stepper motor. However, instead of using four coils, you use the both poles of the two coils, and reverse the polarity of the current.

The easiest way to reverse the polarity in the coils is to use a pair of H-bridges. The L293D dual H-bridge has two H-bridges in the chip, so it will work nicely for this purpose.

88

Page 89: Chapter 1

Once you have the motor stepping in one direction, stepping in the other direction is simply a matter of doing the steps in reverse order.

Knowing the position is a matter of knowing how many degrees per step, and counting the steps and multiplying by that many degrees. So for examples, if you have a 1.8-degree stepper, and it’s turned 200 steps, then it’s turned 1.8 x 200 degrees, or 360 degrees, or one full revolution.

Two-Wire Control

In every step of the sequence, two wires are always set to opposite polarities. Because of this, it’s possible to control steppers with only two wires instead of four, with a slightly more complex circuit. The stepping sequence is the same as it is for the two middle wires of the sequence above:

Step wire 1 wire 21 low high2 high high3 high low4 low low

89

Page 90: Chapter 1

The circuits for two-wire stepping are as follows:

Unipolar stepper two-wire circuit:

Bipolar stepper two-wire circuit:

90

Page 91: Chapter 1

Stepper motor I used in my solar tracking machine

91

Page 92: Chapter 1

Stepper motor drive circuits

Stepper motor performance is strongly dependent on the drive circuit. Torque curves may be extended to greater speeds if the stator poles can be reversed more quickly, the limiting factor being the winding inductance. To overcome the inductance and switch the windings quickly, one must increase the drive voltage. This leads further to the necessity of limiting the current that these high voltages may otherwise induce.

L/R drive circuits

L/R drive circuits are also referred to as constant voltage drives because a constant positive or negative voltage is applied to each winding to set the step positions. However, it is winding current, not voltage that applies torque to the stepper motor shaft. The current I in each winding is related to the applied voltage V by the winding inductance L and the winding resistance R. The resistance R determines the maximum current according to Ohm's law I=V/R. The inductance L determines the maximum rate of change of the current in the winding according to the formula for an Inductor dI/dt = V/L. Thus when controlled by an L/R drive, the maximum speed of a stepper motor is limited by its inductance since at some speed, the voltage U will be changing faster than the current I can keep up. In simple terms the rate of change of current is L / R (e.g. a 10mH inductance with 2 ohms resistance will take 5 MS to reach approx. 2/3 of maximum torque or around 0.1 sec to reach 99% of max torque). To obtain high torque at high speeds requires a large drive voltage with a low resistance and low inductance. With an L/R drive it is possible to control a low voltage resistive motor with a higher voltage drive simply by adding an external resistor in series with each winding. This will waste power in the resistors, and generate heat. It is therefore considered a low performing option, albeit simple and cheap.

92

Page 93: Chapter 1

Chopper drive circuits

Chopper drive circuits are also referred to as constant current drives because they generate a somewhat constant current in each winding rather than applying a constant voltage. On each new step, a very high voltage is applied to the winding initially.

This causes the current in the winding to rise quickly since dI / dt = V/L where V is very large.

The current in each winding is monitored by the controller, usually by measuring the voltage across a small sense resistor in series with each winding.

When the current exceeds a specified current limit, the voltage is turned off or "chopped", typically using power transistors.

When the winding current drops below the specified limit, the voltage is turned on again. In this way, the current is held relatively constant for a particular step position.

This requires additional electronics to sense winding currents, and control the switching, but it allows stepper motors to be driven with higher torque at higher speeds than L/R drives. Integrated electronics for this purpose are widely available.

Phase current waveforms

A stepper motor is a poly phase AC synchronous motor (see Theory below), and it is ideally driven by sinusoidal current. A full step waveform is a gross approximation of a sinusoid, and is the reason why the motor exhibits so much vibration.

Various drive techniques have been developed to better approximate a sinusoidal drive waveform: these are half stepping and micro stepping.

93

Page 94: Chapter 1

Different drive modes showing coil current on a 4-phase unipolar stepper motor

Wave drive

In this drive method only a single phase is activated at a time. It has the same number of steps as the full step drive, but the motor will have significantly less than rated torque. It is rarely used.

Full step drive (two phases on)

This is the usual method for full step driving the motor. Two phases are always on. The motor will have full rated torque.

Half stepping

When half stepping, the drive alternates between two phases on and a single phase on. This increases the angular resolution, but the motor also has less torque (approx. 70%) at the half step position (where only a single phase is on). This may be mitigated by increasing the current in the active winding to compensate. The advantage of half stepping is that the drive electronics need not change to support it.

Micro stepping

What is commonly referred to as micro stepping is actually "sine cosine micro stepping" in which the winding current approximates a sinusoidal AC waveform. Sine cosine micro stepping is the most common form, but other waveforms are used.

Regardless of the waveform used, as the micro steps become smaller, motor operation becomes smoother, thereby greatly reducing resonance in any parts the motor may be connected to, as well as the motor itself. Resolution will be limited by the mechanical striation, backlash, and other sources of error between the motor and the end device.

Gear reducers may be used to increase resolution of positioning.

Step size repeatability is an important step motor feature and a fundamental reason for their use in positioning.

Example: many modern hybrid step motors are rated such that the travel of every full step (example 1.8 Degrees per full step or 200 full steps per revolution) will be within 3% or 5% of the travel of every other full step; as long as the motor is operated within its specified operating ranges. Several manufacturers show that their motors can easily maintain the

94

Page 95: Chapter 1

3% or 5% equality of step travel size as step size is reduced from full stepping down to 1/10 stepping. Then, as the micro stepping divisor number grows, step size repeatability degrades. At large step size reductions it is possible to issue many micro step commands before any motion occurs at all and then the motion can be a "jump" to a new position.

Theory

A step motor can be viewed as a synchronous AC motor with the number of poles (on both rotor and stator) increased, taking care that they have no common denominator.

Additionally, soft magnetic material with many teeth on the rotor and stator cheaply multiplies the number of poles (reluctance motor). Modern steppers are of hybrid design, having both permanent magnets and soft iron cores.

To achieve full rated torque, the coils in a stepper motor must reach their full rated current during each step. Winding inductance and reverse EMF generated by a moving rotor tend to resist changes in drive current, so that as the motor speeds up, less and less time is spent at full current — thus reducing motor torque. As speeds further increase, the current will not reach the rated value, and eventually the motor will cease to produce torque.

Pull-in torque

This is the measure of the torque produced by a stepper motor when it is operated without an acceleration state.

At low speeds the stepper motor can synchronize itself with an applied step frequency and this pull-in torque must overcome friction and inertia. It is important to make sure that the load on the motor is frictional rather than inertial as the friction reduces any unwanted oscillations.

Pull-out torque

The stepper motor pull-out torque is measured by accelerating the motor to the desired speed and then increasing the torque loading until the motor stalls or misses’ steps. This measurement is taken across a wide range of speeds and the results are used to generate the stepper motor's dynamic performance curve. As noted below this curve is affected by drive voltage, drive current and current switching techniques. A designer may include a safety factor between the rated torque and the estimated full load torque required for the application.

95

Page 96: Chapter 1

Detent torque

Synchronous electric motors using permanent magnets have a remnant position holding torque (called detent torque or cogging, and sometimes included in the specifications) when not driven electrically. Soft iron reluctance cores do not exhibit this behavior.

Stepper motor ratings and specifications

Stepper motors nameplates typically give only the winding current and occasionally the voltage and winding resistance. The rated voltage will produce the rated winding current at DC: but this is mostly a meaningless rating, as all modern drivers are current limiting and the drive voltages greatly exceed the motor rated voltage.

A stepper's low speed torque will vary directly with current. How quickly the torque falls off at faster speeds depends on the winding inductance and the drive circuitry it is attached to, especially the driving voltage.

Steppers should be sized according to published torque curve, which is specified by the manufacturer at particular drive voltages or using their own drive circuitry.

Applications

Computer-controlled stepper motors are one of the most versatile forms of positioning systems. They are typically digitally controlled as part of an open loop system, and are simpler and more rugged than closed loop servo systems.

Industrial applications include high speed pick and place equipment and multi-axis CNC machines, often directly driving lead screws or ball screws. In the field of lasers and optics they are frequently used in precision positioning equipment such as linear actuators, linear stages, rotation stages, goniometers, and mirror mounts. Other uses are in packaging machinery, and positioning of valve pilot stages for fluid control systems.

Commercially, stepper motors are used in floppy disk drives, flatbed scanners, computer printers, plotters, slot machines, and many more devices.

96

Page 97: Chapter 1

Project Implementation

Now after known enough information about stepper and how we can drive it…I implemented at the first time a stepper driver using ULN2003A ( High-Voltage High-Current Darlington Transistor Array)

97

Page 98: Chapter 1

The ULN2002A, ULN2003A, ULN2003AI, ULN2004A, ULQ2003A, and ULQ2004A are high-voltage high-current Darlington transistor arrays. Each consists of seven npn Darlington pairs that feature high-voltage outputs with common-cathode clamp diodes for switching inductive loads. The collector-current rating of a single Darlington pair is 500 mA. The Darlington pairs can be paralleled for higher current capability. Applications include relay drivers, hammer drivers, lamp drivers, display drivers (LED and gas discharge), line drivers, and logic buffers.For 100-V (otherwise interchangeable) versions of the ULN2003A and ULN2004A, see the SN75468 and SN75469, respectively. The ULN2001A is a general-purpose array and can be used with TTL and CMOS technologies. The ULN2002A is designed specifically for use with 14-V to 25-V PMOS devices. Each input of this device has a Zener diodeand resistor in series to control the input current to a safe limit. The ULN2003A and ULQ2003A have a 2.7-kΩseries base resistor for each Darlington pair for operation directly with TTL or 5-V CMOS devices. The ULN2004A and ULQ2004A have a 10.5-kΩ series base resistor to allow operation directly from CMOS devicesthat use supply voltages of 6 V to 15 V. The required input current of the ULN/ULQ2004A is below that of the ULN/ULQ2003A, and the required voltage is less than that required by the ULN2002A.

98

Page 99: Chapter 1

APPLICATION INFORMATION

Micro C programing language

Mikro C is a powerful, feature rich development tool for PIC micros. It is designed to provide the customer with the easiest possible solution for developing applications for embedded systems, without compromising performance or control. MikroC provides a successful match featuring highly advanced IDE, ANSI compliant compiler, broad set of hardware libraries, comprehensive documentation, and plenty of ready-to-run examples.

PIC and C fit together well: PIC is the most popular 8-bit chip in the world, used in a wide variety of applications, and C, prized for its efficiency, is the natural choice for developing embedded systems. It develops applications quickly and easily with the world's most intuitive C compiler for PIC Microcontrollers (families PIC12, PIC16, and PIC18).

99

Page 100: Chapter 1

Highly sophisticated IDE provides the power which is needed with the simplicity of a windows based point-and-click environment. With useful implemented tools, many practical code examples, broad set of built-in routines, and a comprehensive Help, mikroC makes a fast and reliable tool.

MikroC allows developing and deploying complex applications:

· Write C source code using the highly advanced Code Editor.

· Use the included MikroC libraries to dramatically speed up the development: data acquisition, memory, displays, conversions, communications…

· Monitor program structure, variables, and functions in the Code Explorer.

· Generate commented, human-readable assembly, and standard HEX compatible with all programmers.

· Inspect program flow and debug executable logic with the integrated Debugger. Get detailed reports and graphs on code statistics, assembly listing, calling tree…

100

Page 101: Chapter 1

MikroC window

The Code Editor is an advanced text editor fashioned to satisfy the needs of professionals. General code editing is same as working with any standard text-editor, including familiar Copy, Paste, and Undo actions, common for Windows environment. Advanced editor features include: Adjustable Syntax Highlighting, Code Assistant, Parameter Assistant, Code Templates (Auto Complete), Auto Correct for common types, Bookmarks and Go to Line.Customize these options from the Editor Settings dialog. To access the settings, choose Tools > Options from the drop-down menu, or click the Tools icon.

Code editor

101

Page 102: Chapter 1

Circuit design implementation

First I used a simulation program for my circuit design and I simulate the output before implementing it in real to avoid errors as much as I can

Simulation circuit

This circuit preform moving the motor according to LDR (Light Dependent Resistors) reading and comparing the result as the flow chart shown

102

Page 103: Chapter 1

Here is the flow chart of checking LDR’s and motor motion

And this is the code I have tried for the first time using mikro C for programming the microcontroller PIC 16f877a

sbit dir at portd.b0;

sbit plus at portd.b1;

float q1,q2,q3,q4;

int i=0;

void motor1stop (void);

void motor2stop (void);

void motor1 (void);

void motor2left (void);

void motor2right(void);

103

Page 104: Chapter 1

//////////////////////////////////////////////////////////////////

void main() {

trisb=0 ;

portb=0 ;

trisd =0;

portd=0;

while(1){

q1=adc_read(0);

q1=q1*0.00489;

q2=adc_read(1);

q2=q2*0.00489;

q3=adc_read(2);

q3=q3*0.00489;

q4=adc_read(3);

q4=q4*0.00489;

/////////////////////////////////////////////////////////////////

if (q1>q2)

{

motor2right();

}

if (q2>q1)

{

motor2left();

}

else {

104

Page 105: Chapter 1

motor2stop();

}

}

}

///////////////////////////////////////////////////////////////////////

void motor2right () {

portb=3; delay_ms(250);

portb=9; delay_ms(250);

portb=12; delay_ms(250);

portb=6; delay_ms(250) }

//////////////////////////////////////////////////////

void motor2left () {

portb=6; delay_ms(250);

portb=12; delay_ms(250);

portb=9; delay_ms(250);

portb=3; delay_ms(250);

}

//////////////////////////////////////////////////////

void motor1stop() {

portd=0

}

////////////////////////////////////////////////////

void motor2stop () {

portb=0;

}

105

Page 106: Chapter 1

And this is the first circuit I implement on simulation and in real

This implementation allows me to control the motion of motors by 2 LDR’s only

After this I realize that I can’t use it for my design for many reasons

Problems I have met in implementation

1- Stepper motors were unable to provide specified torque Stepper Motor Rated Torque 0.280 N*m Experimentally Observed Torque 0.019 N*m

106

Page 107: Chapter 1

Try and error circuits I have implemented

Solution I discovered ….

High power transistor driving motor

After this implementation I realized that the torque is not enough for moving the vertical motion on the machine then I tried to get more torque by using 4 high power transistors to amplify the current and make powerful torque that makes the plate moves normally..

107

Page 108: Chapter 1

Final circuit

And this is the final circuit that helps me to solve torque problem

This is schematic of our first test circuit. The PIC's output lines are first buffered by a 4050 hex buffer chip, and are then connected to an NPN transistor. The transistor used, TIP120, is actually a NPN Darlington (it is shown as a standard NPN). The transistors act like switches, activating one stepper motor coil at a time.

Due to a inductive surge created when a coil is toggled, a standard 1N4001 diode is usually placed across each transistor as shown in the figure, providing a safe way of dispersing the reverse current without damaging the transistor. The transistors do not need an external snubbing diode because they have a built in diode. So the diodes shown in the drawing are the internal diodes in the transistors.

108

Page 109: Chapter 1

The simplest way to operate a stepper motor with a PIC is with the full step pattern shown in Table 1. Each part of the sequence turns on only one transistor at a time, one after the other. After the sequence is completed, it repeats infinitely until power is removed.

109

Page 110: Chapter 1

Detailed software structure

This is the final view of my tracker

110

Page 111: Chapter 1

In this moment the tracker went straight ahead to my room’s lamp

Final code

This is the final code for tracker

sbit dir at portd.b0;

sbit plus at portd.b1;

float q1,q2,q3,q4;

int i=0;

void motor2left (void);

void motor2right(void);

//////////////////////////////////////////////////////////////////

void main() {

trisb=0 ;

portb=0 ;

trisd =0;

portd=0;

while (1){

q1=adc_read(0);

q2=adc_read(1);

111

Page 112: Chapter 1

q3=adc_read(2);

q4=adc_read(3);

/////////////////////////////////////////////////////////////////

if (q1-q2>8)

{

motor2right();

}

if (q2-q1>8)

{

motor2left();

}

///////////////////////////////////////////////////////////////////////

if(q4-q3>8) {

dir=0 ;

plus=1;

delay_ms(150);

plus=0;

delay_ms(150);

112

Page 113: Chapter 1

}

else if(q3-q4>8){

dir=1 ;

plus=1;

delay_ms(150);

plus=0;

delay_ms(150);

}

}

}

///////////////////////////////////////////////////////////////////////

void motor2right () {

portb=3; delay_ms(250);

portb=9; delay_ms(250);

portb=12; delay_ms(250);

portb=6; delay_ms(250);

}

//////////////////////////////////////////////////////

113

Page 114: Chapter 1

void motor2left () {

portb=6; delay_ms(250);

portb=12; delay_ms(250);

portb=9; delay_ms(250);

portb=3; delay_ms(250);

}

114

Page 115: Chapter 1

Solar tracker verification and testing

The first step in testing the solar tracker design is to verify whether the LDRs are working properly. The light intensity directed onto the LDR increases, its resistance therefore decreases. The next step is to use the Tektronix TDS1012 in order to test the signals generated by the LDR and then sent to the PIC. Tektronix TDS1012 oscilloscope is a digital graph displaying device; it draws a graph of an electrical signal. In most applications, the graph shows how signals change over time

115

Page 116: Chapter 1

Signal generated when one LDR is under shadow

116

Page 117: Chapter 1

Signal generated when both LDRs are under shadow

This figure Illustrate the result when one of the Two LDRs is covered. Channel 1 and 2 represent the RB0 and RB1 on the PIC Respectively. The signal represented by channel 1 illustrates that LRD1 is under shadow. The signal shown in the figure is sent to the motor drive from the PIC16F77A.

The motor is therefore actuated, and it runs until the resistance on both LDRs is the same. The signal is sent to PIC16F84A to be analyzed. In this case PIC does not send any signal to the motor drive as the resistance value on both LDRs is the same.

Conclusion

It has been proven through research that solar tracking system with single-axis freedom can increase energy output by approximately 20%, whereas the tracking system with double axis freedom can increase the output by more than 40%. Therefore this work was to

117

Page 118: Chapter 1

develop and implement a solar tracking system with both degree of freedom and which detected the sunlight using sensors. The control circuit for the solar tracker was based on a PIC16F877A microcontroller.

This PIC was the brain of the entire tracking system, and it was programmed to detect the sunlight through the sensors and then actuate the motor to position where maximum sunlight could be illuminated onto the surface of the solar panel

After many setbacks in testing of the solar tracker, a lot of time was needed to be set aside for verification and testing due to the unpredictability of the weather and debugging of errors.

The tracking implementation is successfully achieved with complete design of two degree of freedom using the PIC microcontroller.

Suitable components and gear dc motors are used for the prototype model, which exhibit a clear, stable and precise movement to face the sun.

Chapter 4

Conclusion and scope for future works

118

Page 119: Chapter 1

Conclusion

In this thesis, the sun tracking system was implemented which is based on PIC microcontroller. After examining the information obtained in the data analysis section, it can be said that the proposed sun tracking solar array system is a feasible method of maximizing the energy received from solar radiation. The controller circuit used to implement this system has been designed with a minimal number of components and has been integrated onto a single PCB for simple assembly.

The use of stepper motors enables accurate tracking of the sun while keeping track of the array's current position in relation to its initial position.

The automatic solar radiation tracker is an efficient system for solar energy collection.It has been shown that the sun tracking systems can collect about 8% more energy than what a fixed panel system collects and thus high efficiency is achieved through this tracker.

8% increase in efficiency is not the most significant figure; it can be more prominentin concentrating type reflectors.

Scope for Future Work

To improve the sun tracking, a stand-alone sun tracker can be designed using 18 series PIC microcontroller. In 18 series PIC microcontroller, data can be stored periodically in MMC card .We need not to do it manually (no need of rotation).

Alignment can be varied changing with season.

Moreover, concentrating type collectors are more efficient than flat plate collectors.We can make use of that to increase efficiency.

Else we can improve the design using mirrors that concentrate the sun light into one spot that can be used as boiler or heating transmitting from the sun

Concentrated solar power (CPS) is used to produce electricity (sometimes called solar thermoelectricity, usually generated through steam). Concentrated solar technology systems use mirrors or lenses with tracking systems to focus a large area of sunlight onto a small area. The concentrated light is then used as heat or as a heat source for a conventional power plant (solar thermoelectricity). The solar concentrators used in CSP systems can often also be used to provide industrial process heating or cooling, such as in solar air-conditioning.

119

Page 120: Chapter 1

Concentrating technologies exist in four common forms, namely parabolic trough, dish starlings, concentrating linear Fresnel reflector, and solar power tower. Although simple, these solar concentrators are quite far from the theoretical maximum concentration. For example, the parabolic trough concentration is about 1/3 of the theoretical maximum for the same acceptance angle, that is, for the same overall tolerances for the system. Approaching the theoretical maximum may be achieved by using more elaborate concentrators based on non-imaging optics.

Different types of concentrators produce different peak temperatures and correspondingly varying thermodynamic efficiencies, due to the differences in the way that they track the Sun and focus light. New innovations in CSP technology are leading systems to become more and more cost-effective.

Applications for the System

This sun-tracking system can be used, and implemented, into any application that currently uses stationary solar panels for collecting energy from the sun. However, for small appliances such as pocket calculators, which do not require large amounts of solar energy, this method would not be very beneficial. In domestic applications it would be beneficial in solar hot water systems, as well as, in larger household appliances.

A future use could be having a solar battery charger inside households for backup power usage. This backup power technique is currently gaining popularity within the commercial areas of society.

Currently households in remote areas of the world utilize solar energy for all of their daily requirements. In these situations extremely large solar arrays are needed such that enough power can be collected. A sun-tracking array would be very beneficial in these places, as it would mean a decrease in the array size, with an increase in the amount of power that can be received.

References

1-Mazidi M.A., McKinley R.D. and Causey D., “PIC Microcontroller and Embedded, Using Assembly and C for PIC18”, 1st ed., Prentice-Hall, 2006

2- Sedra A.S. and Smith K.C., “Microelectronic Circuits”, 5th ed., 2008

120

Page 121: Chapter 1

3- M.H. Rashid, “Power Electronics: Circuits, Devices and Applications,” 3rd Edition, 2004.

4-Dorin O. Neacsu, “Power Switching Converters”, 2006 by Taylor & Francis Group, LLC

5-Bimal .K. Bose, “Modern Power Electronics and AC Drives,” 2002, Pearson Education

6-N. Mohan T. M. Undeland and W. P. Robbins, “Power Electronics: Converters,

Applications, and Design”, 3rd Edition

7-Muhammad H. Rashid, “Power Electronics Handbook: Devices, Circuits and

Applications”, 2nd Edition, Academic Press, New York, 2006.

8-http://www.howstuffworks.com/solar_panel

9-http://en.wikipedia.org/wiki/Buck converter

10- http://en.wikipedia.org/wiki/battery (electrical)]

11-http://www.labcenter.co.uk

12-http://www.ccsinfo.com/

13-http://www.microchip.com/

14-[http:mikroC] “mikro C user manual” available at www.mikroe.com/pdf/mikroc/mikroc_manual.pdf

15-[http:motor] “Stepper motor Basics” available at www.solarbotics.net/library/pdflib/pdf/motorbas.pdf

16-[http: PIC] “PIC 16F8XA Datasheet” available at ww1.microchip.com/downloads/en/DeviceDoc/39582b.pdf

17-[http: Sun tracking] “Sun tracking Solar Array system” available at innovexpo.itee.uq.edu.au/1998 /thesis/larardei/s334936.pdf

121


Recommended