Top Banner
SOLAR TRACKING SYSTEM CHAPTER -1 INTRODUCTION Solar tracking system is to utilize the maximum power from the sun. Now a day we are in heavy need to use the solar power as in the coming days everything we use might depend on this kind of systems. 1.1 INTRODUCTION Solar energy refers to the utilization of the radiant energy from the Sun. Solar power is used interchangeably with solar energy, but refers more specifically to the conversion of sunlight into electricity by photovoltaic, concentrating solar thermal devices, or by an experimental technology such as a solar chimney or solar pond.Solar panels are Photovoltaic cells which gives voltage directly if you place them in sun light. Here if you change the position of panels the power output will vary. Means, direct sunrays on solar panel can give good output otherwise there might be decrease in the value of their outputs. So we have to track the path where the maximum power will attain. Solar panel devices are of two types that collect energy from the sun. One is solar photovoltaic modules which use solar cells to convert light from the sun into electricity and the other is solar thermal collector which converts the sun’s energy to heat water or another fluid such as oil or antifreeze. In this project we are using the photovoltaic type.The solar panel gives Page | 1 Gandhiji institute of science and technology
84
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: solar tracking system

SOLAR TRACKING SYSTEM

CHAPTER -1

INTRODUCTION

Solar tracking system is to utilize the maximum power from the sun. Now a day we are in

heavy need to use the solar power as in the coming days everything we use might depend on this

kind of systems.

1.1 INTRODUCTION

Solar energy refers to the utilization of the radiant energy from the Sun. Solar power is

used interchangeably with solar energy, but refers more specifically to the conversion of sunlight

into electricity by photovoltaic, concentrating solar thermal devices, or by an experimental

technology such as a solar chimney or solar pond.Solar panels are Photovoltaic cells which gives

voltage directly if you place them in sun light. Here if you change the position of panels the

power output will vary. Means, direct sunrays on solar panel can give good output otherwise

there might be decrease in the value of their outputs. So we have to track the path where the

maximum power will attain.

Solar panel devices are of two types that collect energy from the sun. One is solar

photovoltaic modules which use solar cells to convert light from the sun into electricity and the

other is solar thermal collector which converts the sun’s energy to heat water or another fluid

such as oil or antifreeze. In this project we are using the photovoltaic type.The solar panel gives

the voltage directly to the microcontroller through ADC. This solar panel should be fixed on the

stepper motor shaft so that it can easily rotate 180 degrees. The microcontroller controls the

stepper motor to rotate in desired direction. In order to attain maximum power output the

microcontroller accesses the solar panel direction continuously, which is on the shaft of stepper

motor.

If maximum output attains it waits for the solar panel to acquire energy from the sun and

gives the output voltage to the microcontroller. If the output of the solar panel is going to reduce,

it again starts checking for the maximum output path. This is a cyclic process.

Page | 1Gandhiji institute of science and technology

Page 2: solar tracking system

SOLAR TRACKING SYSTEM

1.2. OBJECTIVE

The main aim of our project is to make the panel to rotate according to the sun direction from

morning to evening automatically so that the panel grabs the solar energy to maximum extent

possible throughout the day. This method of power generation is simple and is taken from natural

resource. This need only maximum sunlight to generate power. This project helps for power

generation by setting the equipment to get maximum sunlight automatically. This system is tracking

for maximum intensity of light. When there is decrease in intensity of light, this system

automatically changes its direction to get maximum intensity of light.

1.3. EXISTING MODEL

The existing technology of the solor tracking system is solar parllel plat system.In this

system solar plat is constant and parllel to the sun risess due to this reason the solar pannel is get a

maximum energy when sunlight is parllel to the pannel.So using this system we cannot utilize the

maximum redundency energy of the sunlight and solar pannal in effective manner.

Page | 2Gandhiji institute of science and technology

Page 3: solar tracking system

SOLAR TRACKING SYSTEM

CHAPTER-2

PROPOSAL

2.1 BLOCK DIAGRAM

Fig. 2.1 Block diagram of solar tracking system.

Page | 3Gandhiji institute of science and technology

Page 4: solar tracking system

SOLAR TRACKING SYSTEM

2.2. ARCHITECTURE OF AT89S52

Fig.2.2 Architecture of 8052 microcontroller.

Page | 4Gandhiji institute of science and technology

Page 5: solar tracking system

SOLAR TRACKING SYSTEM

2.3 BLOCK DIAGRAM DISCRIPTION

2.3.1. POWER SUPPLY SECTION

Fig . 2.3 Power Supply Block Diagram

Unregulated DC power supply

Page | 5Gandhiji institute of science and technology

Page 6: solar tracking system

SOLAR TRACKING SYSTEM

Also be a block rectifier such as WO4 or even four individual diodes such as 1N4004

types. (See later rectifier ratings).The principal advantage of a bridge rectifier is you do not need A

bridge rectifier D1 to D4 rectifies the ac from the transformer secondary, which may a centre tap on

the secondary of the transformer. A further but significant advantage is that the ripple frequency at

the output is twice the line frequency (i.e. 50 Hz or 60 Hz) and makes filtering somewhat easier. As

a design example consider we wanted a small unregulated bench supply for our projects.

Here we will go for a voltage of about 12 - 13V at a maximum output current (IL) of

500ma (0.5A). Maximum ripple will be 2.5% and load regulation is5%.  Now the RMS secondary

voltage (primary is whatever is consistent with your area) for our power transformer T1 must be our

desired output Vo PLUS the voltage drops across D2 and D4 (2 * 0.7V) divided by 1.414.This

means that V sec = [13V + 1.4V] / 1.414 which equals about 10.2V.

Depending on the VA rating of your transformer, the secondary voltage will vary

considerably in accordance with the applied load. The secondary voltage on a transformer advertised

assay 20VA will be much greater if the secondary is only lightly loaded.

If we accept the 2.5% ripple as adequate for our purposes then at 13V this  becomes 13 *

0.025 = 0.325 V rms. The peak to peak value is 2.828 times this value. V rip= 0.325V X 2.828 =

0.92 V and this value is required to calculate the value of C1. Also required for this calculation is the

time interval for charging pulses. If you are on a 60Hzsystem it 1/ (2 * 60) = 0.008333 which is 8.33

milliseconds. For a 50Hz system it is 0.01 sec or 10 milli seconds. Remember the tolerance of the

type of capacitor used here is very loose. The important thing to be aware of is the voltage rating

should be at least 13V X 1.414 or 18.33. Here you would use at least the standard 25V or higher

(absolutely not 16V). With our rectifier diodes or bridge they should have a PIV rating of 2.828

times the V sec or at least 29V. Don't search for this rating because it doesn't exist. Use the next

highest standard or even higher. The current rating should be at least twice the load current

maximum i.e. 2 X 0.5A or 1A.

A good type to use would be 1N4004, 1N4006 or 1N4008types.These are rated 1 Amp at

400PIV, 600PIV and 1000PIV respectively. Always be on the lookout for the higher voltage ones

when they are on special.

TRANSFORMER RATING

Page | 6Gandhiji institute of science and technology

Page 7: solar tracking system

SOLAR TRACKING SYSTEM

– In our example above we were taking 0.5A out of the V sec of 10V. The VA required is

10 X 0.5A = 5VA. This is a small PCB mount transformer available in Australia and probably

elsewhere. This would be an absolute minimum and if you anticipated drawing the maximum current

all the time then go to a higher VA rating. The two capacitors in the primary side are small value

types and if you don't know precisely and I mean precisely what you are doing then OMIT them.

Their loss won't cause you heartache or terrible problems.

THEY MUST BE HIGH VOLTAGE TYPES RATED FOR A.C USE

The fuse F1 must be able to carry the primary current but blow under  excessive current; in

this case we use the formula from the diagram. Here N = 240V /10V or perhaps 120V / 10V. The

fuse calculates in the first instance to [2 X 0.5A] / [240/ 10] or .04A or 40 ma. In the second case

08A or 80 ma.

The difficulty here is to find suitable fuses of that low a current and voltage rating. In

practice you use the closest you can get (often 100 mass). Don't take that too literal and use 1A or

5A fuses.

CONSTRUCTION

The whole project MUST be enclosed in a suitable box. The main switch (preferably double

pole) must be rated at 240V or 120V at the current rating. All exposed parts within the box MUST

be fully insulated, preferably with heat shrink tubing.

4.1 RECTIFIERS

In-order to work with any components basic requirement is power supply. In this section

there is a requirement of two different voltage levels.

Those are

1) 5V DC power supply.

2) 9V DC power supply.

Now the aim is to design the power supply section which converts 230V AC in to 5V

DC. Since 230V AC is too high to reduce it to directly 5V DC, therefore we need a Step-down

transformer that reduces the line voltage to certain voltage that will help us to convert it in to a

5V DC. Considering the efficiency factor of the bridge rectifier, we came to a conclusion to

choose a transformer, whose secondary voltage is 3 to 4 V higher than the required voltage i.e.

5V. For this application 0-9V transformers is used, since it is easily available in the market.

Page | 7Gandhiji institute of science and technology

Page 8: solar tracking system

SOLAR TRACKING SYSTEM

The output of the transformer is 9V AC; it feed to rectifier that converts AC to pulsating

DC. As we all know that there are 3 kind of rectifiers that is

1) half wave

2) Full wave and

3) Bridge rectifier

Here we short listed to use Bridge rectifier, because half wave rectifier has we less in

efficiency. Even though the efficiency of full wave and bridge rectifier are the same, since there

is no requirement for any negative voltage for our application, we gone with bridge rectifier.

Since the output voltage of the rectifier is pulsating DC, in order to convert it into pure

DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter.

The most easy way to regulate this voltage is by using a 7805 voltage regulator, whose

output voltage is constant 5V DC irrespective of any fluctuation in line Volts.

REGULATORS

Voltage regulator

A voltage regulator is a piece of equipment designed for the maintenance of a constant

level of voltage. Several types of voltage regulators exist and each have their own advantages

and disadvantages. Most voltage regulators work by using an internal fixed voltage as a

reference to be compared to the voltage being put out.

Types of Voltage Regulators

Series Pass Voltage Regulator

Series pass regulators are considered the least effective type of voltage regulator. Its

power is continuously dissipated, thus making it more unreliable than other types Series pass

voltage regulators are most effective when used in high voltage systems because their efficiency

increases with high voltage. Series pass voltage regulators remain popular because they are the

least expensive type.

Shunt Voltage Regulator

Shunt voltage regulators are more efficient than series pass types because their power

is usually not dissipated until the battery approaches full capacity. Shunt regulators are popular

because of regulator circuitry is fairly simple compared to other types of voltage regulators. This

type is popular because it is inexpensive for use in systems using 1,000 watts of power or less.

Page | 8Gandhiji institute of science and technology

Page 9: solar tracking system

SOLAR TRACKING SYSTEM

Step Down Series Switch Regulator

The step-down series switch regulator, like the series pass regulator, increases

efficiency as the voltage output increases. The increased complexity of the circuitry, however,

makes this type less reliable than either the series-pass or shunt types. That complexity of the

circuitry also makes the step-down series more expensive than the other types.

Step-Up Shunt Switching Regulator

The step-up shunt switching regulator has the highest efficiency as a result of its

complex circuitry. That complexity makes the cost of this type of regulator so high that it is

impractical to use for certain purposes.

It is also worth noting that the step-up shunt switching regulator must be used under stable

conditions as it has tendency to oscillate when used at maximum power.

Cost

The costs of the different types of regulators are based on general usage. The actual cost

of each type, but especially the first three types listed here, will vary depending upon the

individual model as well as the quality of parts and workmanship. A higher quality series pass

regulator, for example, might cost more than a lower quality step down series switch regulator.

7805 voltage regulator

7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed

linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not

give the fixed voltage output. The voltage regulator IC maintains the output voltage at a

constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805

provides +5V regulated power supply. Capacitors of suitable values can be connected at input

and output pins depending upon the respective voltage levels.

Pin Diagram

Page | 9Gandhiji institute of science and technology

Page 10: solar tracking system

SOLAR TRACKING SYSTEM

Pin description

Fig.2.4 Pin Diagram of Regulator

Pin No Function Name

1 Input voltage (5V-18V) Input

2 Ground (0V) Ground

3 Regulated output; 5V (4.8V-5.2V) Output

Table 2.1 Pin Description Of Regulator

FILTER

Overview

Fig.2.5 Output of Filter

As we have already seen, the rectifier circuitry takes the initial ac sine wave from the

transformer or other source and converts it to pulsating dc. A full-wave rectifier will produce the

waveform shown to the right, while a half-wave rectifier will pass only every other half-cycle to

its output. This may be good enough for a basic battery charger, although some types of

rechargeable batteries still won't like it. In any case, it is nowhere near good enough for most

electronic circuitry. We need a way to smooth out the pulsations and provide a much "cleaner"

dc power source for the load circuit.

To accomplish this, we need to use a circuit called a filter. In general terms, a  filter is any

circuit that will remove some parts of a signal or power source, while allowing other parts to

Page | 10Gandhiji institute of science and technology

Page 11: solar tracking system

SOLAR TRACKING SYSTEM

continue on without significant hindrance. In a power supply, the filter must remove or

drastically reduce the ac variations while still making the desired dc available to the load

circuitry.

Filter circuits aren't generally very complex, but there are several variations. Any given

filter may involve capacitors, inductors, and/or resistors in some combination. Each such

combination has both advantages and disadvantages, and its own range of practical application.

We will examine a number of common filter circuits on this page.

A Single Capacitor

Fig.2.6 Full wave Rectifier

If we place a capacitor at the output of the full-wave rectifier as shown to the left, the

capacitor will charge to the peak voltage each half-cycle, and then will discharge more

slowly through the load while the rectified voltage drops back to zero before beginning the

next half-cycle. Thus, the capacitor helps to fill in the gaps between the peaks, as shown in

red in the first figure to the righ.Although we have used straight lines for simplicity, the

decay is actually the normal exponential decay of any capacitor discharging through a load

resistor. The extent to which the capacitor voltage drops depends on the capacitance of the

capacitor and the amount of current drawn by the load; these two factors effectively form the

RC time constant for voltage decay.

Fig.2.7 Output Of Full wave Rectifier

As a result, the actual voltage output from this combination never drops to zero,

but rather takes the shape shown in the second figure to the right. The blue portion of the

Page | 11Gandhiji institute of science and technology

Page 12: solar tracking system

SOLAR TRACKING SYSTEM

waveform corresponds to the portion of the input cycle where the rectifier provides current to the

load, while the red portion shows when the capacitor provides current to the load. As you can

see, the output voltage, while not pure dc, has much less variation (or ripple, as it is called) than

the unfiltered output of the rectifier. A half-wave rectifier with a capacitor filter will

only recharge the capacitor on every other peak shown here, so the capacitor will discharge

considerably more between input pulses. Nevertheless, if the output voltage from the filter can be

kept high enough at all times, the capacitor filter is sufficient for many kinds of loads, when

followed by a suitable regulator circuit.

RC Filters:

Fig.2.8 RC Filter

In order to reduce the ripple still more without losing too much of the dc output,

we need to extend the filter circuit a bit. The circuit to the right shows one way to do this. This

circuit does cause some dc loss in the resistor, but if the required load current is low, this is an

acceptable loss.

To see how this circuit reduces ripple voltage more than it reduces the dc output voltage,

consider a load circuit that draws 10 mA at 20 volts dc. We'll use 100 µf capacitors and a 100  

resistor in the filter.

For dc, the capacitors are effectively open circuits. Therefore any dc losses will be in

that 100  resistor. For a load current of 10 mA (0.01 A), the resistor will drop

100 × 0.01 = 1 volt. Therefore, the dc output from the rectifier must be 21 volts, and the dc loss

in the filter resistor amounts to 1/21, or about 4.76% of the rectifier output. This is generally

quite acceptable.

On the other hand, the ripple voltage (in the USA) exists mostly at a frequency of 120 Hz

(there are higher-frequency components, but they will be attenuated even more than the 120 Hz

component). At this frequency, each capacitor has a reactance of about 13.26 . Thus R and C2

form a voltage divider that reduces the ripple to about 13% of what came from the rectifier.

Page | 12Gandhiji institute of science and technology

Page 13: solar tracking system

SOLAR TRACKING SYSTEM

Therefore, for a dc loss of less than 5%, we have attenuated the ripple by almost 87%. This is a

substantial amount of ripple reduction, although it doesn't remove the ripple entirely.

If the amount of ripple is still too much for the particular load circuit, additional filtering or a

regulator circuit will be required.

LC Filters

Fig.2.9 LC Filter

While the RC filter shown above helps to reduce the ripple voltage, it introduces

excessive resistive losses when the load current is significant. To reduce the ripple even more

without a lot of dc resistance, we can replace the resistor with an inductor as shown in the circuit

diagram. In this circuit, the two capacitors store energy as before, and attempt to maintain a

constant output voltage between input peaks from the rectifier.

At the same time, the inductor stores energy in its magnetic field, and releases energy as

needed in its attempt to maintain a constant current through itself. This provides yet another

factor that attempts to smooth out the ripple voltage. In some cases, C1 is omitted from this

filter circuit. The result is a lower dc output voltage, but improved ripple removal. The choice is

a trade-off, and must be made according to the specific requirements in each individual case.

For dc, the inductance has only the resistance of the wire that comprises the coil, which

amounts to a few ohms. Meanwhile, the capacitors still operate as open circuits at dc, so they do

not reduce the dc output voltage. However, at the basic ripple frequency of 120 Hz, a 10 Henry

inductance has a reactance of: XL = 2 fL = 7540 at the same time, a 100 µf capacitor at the

same ripple frequency has a reactance of: XC = 1/2 fc = 13.26ohms.

Thus, L and C2 form a voltage divider that drastically reduces the ripple component (to

less than 0.2%) while leaving the desired dc output nearly alone. This configuration may provide

sufficiently pure dc for some applications, without the need for any following regulator at all.

The drawback of this approach is that a 10 Henry inductor is as large as some power

transformers, with a heavy iron core. It takes up a lot of space and is relatively expensive. This is

Page | 13Gandhiji institute of science and technology

Page 14: solar tracking system

SOLAR TRACKING SYSTEM

why the RC filter circuit may be preferred to the LC filter, provided the ripple reduction is

sufficient and the power loss in the resistor is not excessive.

2.3.2 INTRODUCTION TO 8086 MICROCONTROLLER

Microcontrollers as the name suggests are small controllers. They are like single chip

computers that are often embedded into other systems to function as processing/controlling unit.

For example the remote control you are using probably has microcontrollers inside that do

decoding and other controlling functions. They are also used in automobiles, washing machines,

microwave ovens, toys ... etc, where automation is needed.

Micro-controllers are useful to the extent that they communicate with other devices, such

as sensors, motors, switches, keypads, displays, memory and even other micro-controllers. Many

interface methods have been developed over the years to solve the complex problem of balancing

circuit design criteria such as features, cost, size, weight, power consumption, reliability,

availability, manufacturability. Many microcontroller designs typically mix multiple interfacing

methods. In a very simplistic form, a micro-controller system can be viewed as a system that

reads from (monitors) inputs, performs processing and write to (control) outputs.

Embedded system means the processor is embedded into the required applications. An

embedded product uses a microprocessor or microcontroller to do one task only. In an embedded

system, there is only one application software that is typically burned into ROM. Example:

printer, keyboard, video game player.

Microprocessor - A single chip that contains the CPU or mo.st of the computer

Microcontroller - A single chip used to control other devices

Microcontroller differs from a microprocessor in many ways. First and the most important

is its functionality. In order for a microprocessor to be used, other components such as memory,

or components for receiving and sending data must be added to it. In short that means that

microprocessor is the very heart of the computer. On the other hand, microcontroller is designed

to be all of that in one. No other external components are needed for its application because all

necessary peripherals are already built into it. Thus, we save the time and space needed to

construct devices.

Page | 14Gandhiji institute of science and technology

Page 15: solar tracking system

SOLAR TRACKING SYSTEM

MICROPROCESSOR VS MICROCONTROLLER

Microprocessor

CPU is stand-alone, RAM, ROM, I/O, timer are separate

Designer can decide on the amount of ROM, RAM and I/O ports.

expensive

versatility general-purpose

Microcontroller:

• CPU, RAM, ROM, I/O and timer are all on a single chip

• fix amount of on-chip ROM, RAM, I/O ports

• for applications in which cost, power and space are critical

• single-purpose

SELECTION OF MICROCONTROLLER

As we know that there so many types of micro controller families that are available in the

market.

Those are

1) 8051 Family

2) AVR microcontroller Family

3) PIC microcontroller Family

4) ARM Family

Basic 8051 family is enough for our application; hence we are not concentrating on higher

end controller families.

In order to fulfill our application basic that is AT89C51 controller is enough. But still we

selected AT89S52 controller because of inbuilt ISP (in system programmer) option.

There are minimum six requirements for proper operation of microcontroller.

Those are:

1) power supply section

2) pull-ups for ports (it is must for PORT 0)

3) Reset circuit

4) Crystal circuit\

5) ISP circuit (for program dumping)

Page | 15Gandhiji institute of science and technology

Page 16: solar tracking system

SOLAR TRACKING SYSTEM

6) EA/VPP pin is connected to Vcc.

PORT0 is open collector that’s why we are using pull-up resistor which makes PORT0 as an I/O

port. Reset circuit is used to reset the microcontroller. Crystal circuit is used for the

microcontroller for timing pluses. In this project we are not using external memory that’s why

EA/VPP pin in the microcontroller is connected to Vcc that indicates internal memory is used for

this appli

MICROCONTROLLER 89S52

FEATURES

• 8K Bytes of In-System Reprogrammable Flash Memory

• Endurance: 1,000 Write/Erase Cycles

• Fully Static Operation: 0 Hz to 24 MHz

• 256 x 8-bit Internal RAM

• 32 Programmable I/O Lines

• Three 16-bit Timer/Counters

• Eight Interrupt Sources

• Programmable Serial Channel

• Low-power Idle and Power-down Modes

DESCRIPTION

The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with

8Kbytes of Flash programmable and erasable read only memory (PEROM). The on-chip Flash

allows the program memory to be reprogrammed in-system or by a conventional nonvolatile

memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the

Atmel AT89C52 is a powerful microcomputer, which provides a highly flexible and cost-

effective solution to many embedded control applications

PIN DIAGRAM - 8086

Page | 16Gandhiji institute of science and technology

Page 17: solar tracking system

SOLAR TRACKING SYSTEM

Fig.2.10 Pin Diagram of Micro controller 8086

PIN DESCRIPTION

VCC - Supply voltage.

GND - Ground.

Port 0: Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can

sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-

impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus

during accesses to external program and data memory. In this mode, P0 has internal pull-ups.

Port 0 also receives the code bytes during Flash programming and outputs the code bytes during

program verification. External pull-ups are required during program verification.

Port 1: Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output

buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high

by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being

pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1

Page | 17Gandhiji institute of science and technology

Page 18: solar tracking system

SOLAR TRACKING SYSTEM

can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter

2 trigger input (P1.1/T2EX), respectively.

PORT PIN ALTERNATE FUNCTIONS

P1.0 T2 (external count input to Timer/Counter 2), clock-out

P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control

Port 2:

Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers

can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the

internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled

low will source current (I IL) because of the internal pull-ups. Port 2 emits the high-order

address byte during fetches from external program memory and during accesses to external data

memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong

internal pull-ups when emitting 1s.

During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits

the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits

and some control signals during Flash programming and verification.

Port 3: Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers

can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the

internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled

low will source current (I IL) because of the pull-ups. Port 3 also serves the functions of various

special features of the AT89C51. Port 3 also receives some control signals for Flash

programming and verification.

PORT PIN ALTERNATE FUNCTIONS

P3.0 RXD (serial input port)

P3.1 TXD (serial output port)

P3.2 INT0 (external interrupt 0)

P3.3 INT1 (external interrupt 1)

P3.4 T0 (timer 0 external input)

P3.5 T1 (timer 1 external input)

P3.6 WR (external data memory write strobe)

Page | 18Gandhiji institute of science and technology

Page 19: solar tracking system

SOLAR TRACKING SYSTEM

P3.7 RD (external data memory read strobe).

RST:

Reset input. A high on this pin for two machine cycles while the oscillator is running resets

the device.

ALE/PROG:

Address Latch Enable is an output pulse for latching the low byte of the address during accesses

to external memory. This pin is also the program pulse input (PROG) during flash programming.

In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be

used for external timing or clocking purposes. However, that one ALE pulse is skipped during

each access to external data memory. If desired, ALE operation can be disabled by setting bit 0

of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC

instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if

the microcontroller is in external execution mode.

PSEN:

Program Store Enable is the read strobe to external program memory. When the AT89C52 is

executing code from external program memory, PSEN is activated twice

each machine cycle, except that two PSEN activations are skipped during each access to

external data memory.

EA/VPP:

External Access Enable (EA) must be strapped to GND in order to enable the device to fetch

code from external pro-gram memory locations starting at 0000H up to FFFFH. However, if lock

bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for

internal program executions. This pin also receives the 12V programming enable voltage (VPP)

during Flash programming when 12V programming is selected.

XTAL1:

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2:

It is an output from the inverting oscillator amplifier.

Page | 19Gandhiji institute of science and technology

Page 20: solar tracking system

INTERRUPT CONTROL

ON-CHIP ROM FOR PROGRAM

CODE

ON-CHIP RAM

TIMER/COUNTER

TIMER 1

TIMER 0

OSC

BUS CONTROL

4 I/O PORTS

SERIAL PORT

CPU

EXTERNAL INTERRUPTS

COUNTER INPUTS

P0 P1 P2 P3 Tx Rx

SOLAR TRACKING SYSTEM

BLOCK DIAGRAM OF 8086

Fig.2.11 Block Diagram Of micro controller 8086

ARCHITECHTURE OF 8052 MICROCONTROLLER

Architecture of 89S52

OSCILLATOR CHARACTERISTICS

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier,

which can be configured for use as an on-chip oscillator. Either a quartz crystal or ceramic

resonator may be used. To drive the device from an external clock source, XTAL2 should be left

unconnected while XTAL1 is driven. There are no requirements on the duty cycle of the external

clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop,

but minimum and maximum voltage high and low time specifications must be observed.

Page | 20Gandhiji institute of science and technology

Page 21: solar tracking system

SOLAR TRACKING SYSTEM

IDLE MODE

In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active.

The mode is invoked by software. The content of the on-chip RAM and all the special functions

registers remain unchanged during this mode. The idle mode can be terminated by any enabled

interrupt or by a hardware reset. It should be noted that when idle is terminated by a hardware

reset, the device normally resumes program execution, from where it left off, up to two machine

cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to

internal RAM in this event, but access to the port pins is not inhibited. To eliminate the

possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction

following the one that invokes Idle should not be one that writes to a port pin or to external

memory.

OSCILLATOR CONNECTIONS

Oscillator Connections

Fig.2.12 Oscillator

Note: C1, C2 = 30 pF ± 10 pF for Crystals

= 40 pF ± 10 pF for Ceramic Resonators

Page | 21Gandhiji institute of science and technology

Page 22: solar tracking system

SOLAR TRACKING SYSTEM

Fig.2.13 External Clock drives Configuration.

2.3.3 SELECTION OF DRIVER

In electronics, a driver is an electrical circuit or other electronic component used to

control another circuit or other component, such as a high-power transistor. The term is used, for

example, for a specialized computer chip that controls the high-power transistors in DC-to-DC

voltage converters. An amplifier can also be considered the driver for loudspeakers, or a constant

voltage circuit that keeps an attached component operating within a broad range of input

voltages. In this project we are using L293D IC to amplify the signals

CONNECTIONS OF DRIVER

In this application driver is used to increase the strength of signals .The 2nd and 7th pins of

this IC are connected to the PORT1.0 and PORT1.1 of Microcontroller. The 10th and 15th pin of

this IC are connected to the PORT1.2 and PORT1.3 of Microcontroller.

L293D

The Device is a monolithic integrated high voltage, high current four channel driver

designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays

solenoids, DC and stepping motors) and switching power transistors. To simplify use as two

bridges each pair of channels is equipped with an enable input. A separate supply input is

provided for the logic, allowing operation at a lower voltage and internal clamp diodes are

included. This device is suitable for use in switching applications at frequencies up to 5 kHz.

FEATURES

Supply Voltage from 4.5 V to 3.5v

Separate Input-Logic Supply

Internal ESD Protection

- Thermal Shutdown

- High-Noise-Immunity Inputs

Page | 22Gandhiji institute of science and technology

Page 23: solar tracking system

SOLAR TRACKING SYSTEM

- Functional Replacements for SGS L293 and SGS L293D

- Output Current 1 A per Channel (600 MA for L293D)

- Peak Output Current 2 A per Channel (1.2 A for L293D)

- Output Clamp Diodes for Inductive Transient Suppression (L293D)

PIN DIAGRAM

Fig.2.14 Pin Diagram Of Driver

DESCRIPTION

The L293D is quadruple high-current half-H driver. It designed to provide bidirectional

drive currents of up to 1 A at voltages from 4.5 V to 36 V and to drive inductive loads such as

relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage

loads in positive-supply applications. All inputs are TTL compatible. Each output is a complete

totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source.

Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled

by 3,4EN. When an enable input is high the associated drivers are enabled and their outputs are

active in phase with their inputs. When the enable input is low, those drivers are disabled and

their outputs are off and in the high-impedance state. With the proper data inputs, each pair of

drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications. On

the L293D, external high-speed output clamp diodes should be used for inductive transient

suppression. A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize

device power dissipation. The L293D is characterized for operation from 0°C to 70°C.

Page | 23Gandhiji institute of science and technology

Page 24: solar tracking system

SOLAR TRACKING SYSTEM

Fig. 2.3

BLOCK DIAGRAM :

Fig.2.15 Block Diagram of Driver

Page | 24Gandhiji institute of science and technology

Page 25: solar tracking system

SOLAR TRACKING SYSTEM

Fig.2.2 Function Table Of Driver

Fig.2.16 Inputs & Outputs of Driver

Page | 25Gandhiji institute of science and technology

Page 26: solar tracking system

SOLAR TRACKING SYSTEM

Fig.2.17 Two-phase Motor Driver

2.3.4 INTRODUCTION TO DC MOTOR

A direct current (DC) motor is another widely used device that translate electrical

Pulses into mechanical movement. In the DC motor we have only + and – leads connecting them

to a DC voltage source moves the motor in one direction .By reversing the polarity, the DC

motor will move in the opposite direction. One can easily experiment with DC motor. For

example, small fans used in any mother boards to cool the CPU are run by DC motors. By

connecting their leads to the + and – voltage source, the DC motor moves .While a stepper motor

moves in steps of 1 to 50degrees,the DC motor moves continuously. In a stepper motor, if we

know the starting position we can easily count the number of steps the motor has moved and

calculate the final position of the motor. This is not possible in a DC motor. The maximum speed

of a DC motor is indicated in rpm and is given in the data sheet. The DC motor has two rpms: no

load and loaded. The manufacturer’s data sheet gives the no -load rpm.the no-load rpm can be

from a few thousand to tens of thousands. The rpm is reduced when moving a load and it

decreases as the load is increased. For example, a drill turning a screw has a much lower rpm

Page | 26Gandhiji institute of science and technology

Page 27: solar tracking system

SOLAR TRACKING SYSTEM

speed then when it is in the no-load situation.DC motors also have voltage and current ratings.

The nominal voltage is the voltage for that motor under normal conditions, and can be from 1 to

150v, depending on the motor. As we increase the voltage, the rpm goes up. The current rating is

the current consumption when the nominal voltage is applied with no load, and can be from

25mA to a few amps. As the load increases, the rpm is decreased, unless the current or voltage

provided to the motor is increased, which in turn increases the torque. With a fixed voltage, as

the load increases, the current (power) consumption of a DC motor is increased. If we overload

the motor it will stall, and that can damage the motor due to the heat generated by high current

consumption.

INTRODUCTION TO MOTORS

A motor is a machine which converts energy into rotating motion. The dictionary definition of

motor is broader than that but when engineers and mechanics talk about motors they are almost

always talking about rotating motion.

There are different names for devices which convert energy into other types of motion.

A DC motor is a motor that uses direct electrical current (DC) as the source of its energy. An AC

motor is a motor that uses alternating electrical current (AC) as the source of its energy. AC

current is the type of electricity provided by household wall outlets. DC current is the type of

electricity provided by batteries.

A gear motor is a motor with an attached set of gears driving a secondary drive shaft. Practical

motor designs result in motors that spin too fast for most uses. As a result, almost all gear sets

are used to "gear down" the motor. The geared down drive shaft spins slower than the direct

motor drive shaft. The geared down drive shaft also spins "harder". Motor speed is generally

measured in revolutions per minute (RPM). Rotating force is called torque and for hobby motors

is generally measured in inch-ounces or centimeter-grams. For now, just remember that the

higher the number the harder the motor turns. Gearing down a motor reduces its RPM (speed)

but increases its torque. Gears are generally contained within a housing that protects the gears

from interference and which provides a bearing surface for the various gear shafts and drive

shafts. The term gear box generally refers to the entire system of gears, shafts, bearings and

housing.

When you apply energy to a motor it spins as fast and hard as its design allows for

that energy level and output load. If you increase the energy supply it spins faster and harder. If

Page | 27Gandhiji institute of science and technology

Page 28: solar tracking system

SOLAR TRACKING SYSTEM

you attach a load the motor will slow down. If you continue increasing the load it slows ever

more until the motors capability to work is exceeded. When the extreme load causes the motor to

stop it is said to be stalled. Reducing the load causes the motor spin faster. If you entirely remove

the load the motor is said to be "free running" and operates at its maximum speed for that input

energy level.

Electric motors both ac and dc motors, come in many shapes and sizes. Some are standardized

electric motors for general-purpose applications. Other electric motors are intended for specific

tasks. In any case, electric motors should be selected to satisfy the dynamic requirements of the

machines on which they are applied without exceeding rated electric motor temperature.

Thus, the first and most important step in electric motor selection is determining load

characteristics -- torque and speed versus time. Electric motor selection is also based on mission

goals, power available, and cost.

An electric motor uses electrical energy to produce mechanical energy. The reverse process for

using mechanical energy to produce electrical energy is accomplished by a generator or dynamo.

Electric motors are found in household appliances such as fans, refrigerators, washing machines,

pool pumps, floor vacuums, and fan-forced ovens. They are also found in many other devices

such as computer equipment, in its disk drives, printers, and fans; and in some sound and video

playing and recording equipment as DVD/CD players and recorders, tape players and recorders,

and record players. Electric motors are also found in several kinds of toys such as some kinds of

vehicles and robotic toys.

The classic division of electric motors has been that of direct current (DC) type vs. Alternating

Current (AC) types. This is more a de facto convention, rather than a rigid distinction. For

example, many classic DC motors run on AC power, these motors being referred to as universal

motors.

COMPARISON OF MOTOR TYPES:

Type Advantages Disadvantages Typical Application Typical Drive

AC Induction

(Shaded Pole)

Least expensive

Long life

high power

Rotation slips from

frequency

Low starting torque

FansUni/Poly-phase

AC

Page | 28Gandhiji institute of science and technology

Page 29: solar tracking system

SOLAR TRACKING SYSTEM

AC Induction

(split-phase capacitor)

High power

high starting torque

Rotation slips from

frequencyAppliances

Uni/Poly-phase

AC

AC SynchronousRotation in-sync with freq

long-life (alternator)More expensive

Clocks

Audio turntables

tape drives

Uni/Poly-phase

AC

Stepper DCPrecision positioning

High holding torque

Slow speed

Requires a controller

Positioning in printers and floppy

drivesMultiphase DC

Brushless DC electric

motor

Long lifespan

low maintenance

High efficiency

High initial cost

Requires a controller

Hard drives

CD/DVD players

electric vehicles

Multiphase DC

Brushed DC electric

motor

Low initial cost

Simple speed control

(Dynamo)

High maintenance

(brushes)

Low lifespan

Treadmill exercisers

automotive startersDirect (PWM)

(Fig) 2.3 Types of motors

A DC motor is an electric motor that runs on direct current (DC) electricity. DC motors were

used to run machinery, often eliminating the need for a local steam engine or internal combustion

engine. DC motors can operate directly from rechargeable batteries, providing the motive power

for the first electric vehicles. Today DC motors are still found in applications as small as toys

and disk drives, or in large sizes to operate steel rolling mills and paper machines. Modern DC

motors are nearly always operated in conjunction with power electronic devices.

Two important performance parameters of DC motors are the motor constants, Kv and Km.

Contents [hide]

1 Brush

2 Brushless

3 Uncommitted

4 Connection types

4.1 Series connection

4.2 Shunt connection

Page | 29Gandhiji institute of science and technology

Page 30: solar tracking system

SOLAR TRACKING SYSTEM

4.3 Compound connection

5 See also

6 External links 7 References

Brush Main article: Brushed DC electric motor

This is a brushed DC electric motor generating torque directly from DC power supplied to the

motor by using internal commutation, stationary permanent magnets. Torque is produced by the

principle of Lorentz force, which states that any current-carrying conductor placed within an

external magnetic field experiences a force known as Lorentz force. The commentator consists of

a split ring 80 degree shows the effects of having a split ring.

The brushed DC electric motor generates torque directly from DC power supplied to the motor

by using internal commutation, stationary magnets (permanent or electromagnets), and rotating

electrical magnets.

Like all electric motors or generators, torque is produced by the principle of Lorentz force, which

states that any current-carrying conductor placed within an external magnetic field experiences a

torque or force known as Lorentz force. Advantages of a brushed DC motor include low initial

cost, high reliability, and simple control of motor speed. Disadvantages are high maintenance

and low life-span for high intensity uses. Maintenance involves regularly replacing the brushes

and springs which carry the electric current, as well as cleaning or replacing the commentator.

These components are necessary for transferring electrical power from outside the motor to the

spinning wire windings of the rotor inside the motor.[edit]Brushless Main articles: Brushless DC

electric motor and Switched reluctance motor Brushless DC motors use a rotating permanent

magnet or soft magnetic core in the rotor, and stationary electrical magnets on the motor

housing. A motor controller converts DC to AC. This design is simpler than that of brushed

motors because it eliminates the complication of transferring power from outside the motor to the

spinning rotor. Advantages of brushless motors include long life span, little or no maintenance,

and high efficiency. Disadvantages include high initial cost, and more complicated motor speed

controllers.

Some such brushless motors are sometimes referred to as "synchronous motors" although they

have no external power supply to be synchronized with, as would be the case with normal AC

synchronous motors.

[Edit]Uncommitted

Page | 30Gandhiji institute of science and technology

Page 31: solar tracking system

SOLAR TRACKING SYSTEM

Other types of DC motors require no commutation.

Homopolar motor – A homopolar motor has a magnetic field along the axis of rotation and an

electric current that at some point is not parallel to the magnetic field. The name homopolar

refers to the absence of polarity change.

Homopolar motors necessarily have a single-turn coil, which limits them to very low voltages.

This has restricted the practical application of this type of motor.

Ball bearing motor – A ball bearing motor is an unusual electric motor that consists of two ball

bearing-type bearings, with the inner races mounted on a common conductive shaft, and the

outer races connected to a high current, low voltage power supply. An alternative construction

fits the outer races inside a metal tube, while the inner races are mounted on a shaft with a non-

conductive section (e.g. two sleeves on an insulating rod). This method has the advantage that

the tube will act as a flywheel. The direction of rotation is determined by the initial spin which is

usually required to get it going.

[Edit]Connection types

See also: Excitation (magnetic)

There are three types of connections used for DC electric motors: series, shunt and compound.

These types of connections configure how the motor's field and armature windings are

connected. The type of connection is significant because it determines the characteristics of the

motor and is selected for speed/torque requirements of the load. [1]

[Edit]Series connection

A series DC motor connects the armature and field windings in series with a common D.C.

power source. This motor has poor speed regulation since its speed varies approximately

inversely to load. However, a series DC motor has very high starting torque and is commonly

used for starting high inertia loads, such as trains, elevators or hoists.[2] With no mechanical

load on the series motor, the current is low, the magnetic field produced by the field winding is

weak, and so the armature must turn faster to produce sufficient counter-EMF to balance the

supply voltage (and internal voltage drops). For some types of motor, the speed may be higher

than can be safely sustained by the motor. In a no-load condition, the motor may increase its

speed until the motor mechanically destroys itself. This is called a runaway condition. The

speed/torque characteristic is also useful in applications such as dragline excavators, where the

digging tool moves rapidly when unloaded but slowly when carrying a heavy load.

Page | 31Gandhiji institute of science and technology

Page 32: solar tracking system

SOLAR TRACKING SYSTEM

Series motors called "universal motors" can be used on alternating current. Since the armature

voltage and the field direction reverse at (substantially) the same time, torque continues to be

produced in the same direction. Since the speed is not related to the line frequency, universal

motors can develop higher-than-synchronous speeds, making them lighter than induction motors

of the same rated mechanical output. This is a valuable characteristic for hand-held power tools.

Universal motors for commercial power frequency are usually small, not more than about 1 kW

output. However, much larger universal motors were used, fed by special low-frequency traction

power networks to avoid problems with commutation under heavy and varying loads.

[Edit]Shunt connection

A shunt DC motor connects the armature and field windings in parallel or shunt with a common

D.C. power source. This type of motor has good speed regulation even as the load varies, but

does not have as high of starting torque as a series DC motor.[3] It is typically used for

industrial, adjustable speed applications, such as machine tools, winding/unwinding machines

and tensionless.

[Edit]Compound connection

A compound DC motor connects the armature and fields windings in a shunt and a series

combination to give it characteristics of both a shunt and a series DC motor.[4] This motor is

used when both a high starting torque and good speed regulation is needed. The motor can be

connected in two arrangements: cumulatively or differentially. Cumulative compound motors

connect the series field to aid the shunt field, which provides higher starting torque but less speed

regulation.

Differential compound DC motors have good speed regulation and are typically operated at

constant speed. They are commonly used in elevators, air compressors, conveyors and punch

presses.

Fig.2.18 dc motor

Page | 32Gandhiji institute of science and technology

Page 33: solar tracking system

SOLAR TRACKING SYSTEM

2.3.5 SOLAR PANEL

A solar panel is a device that collects and converts solar energy into electricity or

heat. It transfers energy from the sun into electricity or heat which can be used by (for example)

nearby buildings.

Fig.2.19 Solar panel

Solar (photovoltaic) panels convert energy in the form of light from the sun into

electrical energy. Between 4 and 22 percent of the energy falling on a panel is actually converted

to usable electrical energy. The rest is reflected or turned into heat. These panels should not be

confused with those used for solar water heating, which simply use the sun's energy to heat water

directly.

A solar cell or photovoltaic cell is a device that converts solar energy into

electricity by the photovoltaic effect. Photovoltaic is the field of technology and research related

to the application of solar cells as solar energy. Sometimes the term solar cell is reserved for

devices intended specifically to capture energy from sunlight, while the term photovoltaic cell is

used when the source is unspecified.

Page | 33Gandhiji institute of science and technology

Page 34: solar tracking system

SOLAR TRACKING SYSTEM

2.3.6 INTRODUCTION TO LIGHT EMITTING DIODE (LED)

A light-emitting diode (LED) is a semiconductor diode that emits incoherent

narrow spectrum light when electrically biased in the forward direction of the pn-junction, as in

the common LED circuit. This effect is a form of electroluminescence.

While sending a message in the form of bits such as 1,the data is sent to the

receiver side correspondingly the LED glows representing the data is being received

simultaneously when we send 8 as a data the LED gets off .

As in the simple LED circuit, The effect is a form of electroluminescence where incoherent and

narrow-spectrum light is emitted from the p-n junction.

LED’s are widely used as indicator lights on electronic devices and increasingly

in higher power applications such as flashlights and area lighting. An LED is usually a small area

(less than 1 mm2) light source, often with optics added to the chip to shape its radiation pattern

and assist in reflection. The color of the emitted light depends on the composition and condition

of the semi conducting material used, and can be infrared, visible, or ultraviolet. Besides

lighting, interesting applications include using UV-LED’s for sterilization of water and

disinfection of devices, and as a grow light to enhance photosynthesis in plants.

Page | 34Gandhiji institute of science and technology

Page 35: solar tracking system

SOLAR TRACKING SYSTEM

COLOR CODING:

Color Potential Difference

Infrared - 1.6 V

Red - 1.8 V to 2.1 V

Orange - 2.2 V

Yellow - 2.4 V

Green - 2.6 V

Blue - 3.0 V to 3.5 V

White - 3.0 V to 3.5 V

Ultraviolet - 3.5V

Fig.2.4 color coding of led

Page | 35Gandhiji institute of science and technology

Page 36: solar tracking system

SOLAR TRACKING SYSTEM

(Close-up of a typical LED in its case showing the internal structure)

ADVANTAGES

LED’s have many advantages over other technologies like lasers. As compared to laser

diodes or IR sources

LED’s are conventional incandescent lamps. For one thing, they don't have a filament

that will burn out, so they last much longer. Additionally, their small plastic bulb makes

them a lot more durable. They also fit more easily into modern electronic circuits.

The main advantage is efficiency. In conventional incandescent bulbs, the light-

production process involves generating a lot of heat (the filament must be warmed).

Unless you're using the lamp as a heater, because a huge portion of the available

electricity isn't going toward producing visible light.

LED’s generate very little heat. A much higher percentage of the electrical power is

going directly for generating light, which cuts down the electricity demands considerably.

LED’s offer advantages such as low cost and long service life. Moreover LED’s have

very low power consumption and are easy to maintain.

DISADVANTAGES

LED’s performance largely depends on the ambient temperature of the operating

environment.

LED’s must be supplied with the correct current.

LED’s do not approximate a "point source" of light, so cannot be used in applications

needing a highly collimated beam.

But the disadvantages are quite negligible as the negative properties of LED’s do not apply and

the advantages far exceed the limitations.

Page | 36Gandhiji institute of science and technology

Page 37: solar tracking system

SOLAR TRACKING SYSTEM

Miniature

These are mostly single-die LEDs used as indicators, and they come in various sizes from

2 mm to 8 mm, through-hole and surface mount packages. They usually do not use a

separate heat sink.[83] Typical current ratings ranges from around 1 am to above 20 am. The small

size sets a natural upper boundary on power consumption due to heat caused by the high current

density and need for a heat sink.

Common package shapes include round, with a domed or flat top, rectangular with a flat

top (as used in bar-graph displays), and triangular or square with a flat top. The encapsulation

may also be clear or tinted to improve contrast and viewing angle.

There are three main categories of miniature single die LEDs:

Low-current — typically rated for 2 am at around 2 V (approximately 4 maw consumption).

Standard — 20 am LEDs at around 2 V (approximately 40 maw) for red, orange, yellow, and

green, and 20 am at 4–5 V (approximately 100 maw) for blue, violet, and white.

Ultra-high-output — 20 am at approximately 2 V or 4–5 V, designed for viewing in direct

sunlight.

Five- and twelve-volt LEDs are ordinary miniature LEDs that incorporate a suitable

series resistor for direct connection to a 5 V or 12 V supply.

Mid-range

Medium-power LEDs are often through-hole-mounted and used when an output of a few

lumen is needed.

They sometimes have the diode mounted to four leads (two cathode leads, two anode

leads) for better heat conduction and carry an integrated lens. An example of this is the Super

flux package, from Philips Lucile’s. These LEDs are most commonly used in light panels,

emergency lighting, and automotive tail-lights. Due to the larger amount of metal in the LED,

they are able to handle higher currents (around 100 m A). The higher current allows for the

higher light output required for tail-lights and emergency lighting.

Page | 37Gandhiji institute of science and technology

Page 38: solar tracking system

SOLAR TRACKING SYSTEM

High-power

High-power LEDs (HPLED) can be driven at currents from hundreds of am to more

than an ampere, compared with the tens of am for other LEDs. Some can emit over a thousand

lumens.[84][85] Since overheating is destructive, the HPLEDs must be mounted on a heat sink to

allow for heat dissipation. If the heat from a HPLED is not removed, the device will fail in

seconds. One HPLED can often replace an incandescent bulb in a flashlight, or be set in an array

to form a powerful LED lamp. Some well-known HPLEDs in this category are the Lucile’s

Rebel Led, Orem Opt Semiconductors Golden Dragon, and Cree X-lamp. As of September 2009,

some HPLEDs manufactured by Cree Inc. now exceed 105 lm/W [86] (e.g. the Lamp XP-G LED

chip emitting Cool White light) and are being sold in lamps intended to replace incandescent,

halogen, and even fluorescent lights, as LEDs grow more cost competitive.

LEDs have been developed by Seoul Semiconductor that can operate on AC power

without the need for a DC converter. For each half-cycle, part of the LED emits light and part is

dark, and this is reversed during the next half-cycle. The efficacy of this type of HPLED is

typically 40 lm/W.[87] A large number of LED elements in series may be able to operate directly

from line voltage. In 2009, Seoul Semiconductor released a high DC voltage LED capable of

being driven from AC power with a simple controlling circuit. The low-power dissipation of

these LEDs affords them more flexibility than the original AC LED design.[88]

Page | 38Gandhiji institute of science and technology

Page 39: solar tracking system

SOLAR TRACKING SYSTEM

CHAPTER 3

CIRCUIT OPERATION

3.1 SCHEMATIC DIAGRAM

F R O M I S P

AT8 9 S5 2 C R YSTAL

- +

B R I D G E R E C TI F I E R

1

4

3

2

R S T

P 1 . 0

V C C

10 uf /63VC

R ESET

XTA L 1

V C C

L E D

4 . 7 K

2 3 0 V , A . C

12

F R O M I S P

P2.4

1 0 0 0 u f / 3 5 V

P

2

V C C

P 1 . 2

GND

S

V C C

R8

R7

R6

R5

R4

R3

R2

R1 C

1 0 K P U L L U P

9 8 7 6 5 4 3 2 1

3 3 p f

C L K (M C P 3 2 0 1 )

D 5 (L C D )

P 1 . 7

P2.6

L C D

M,AXIMUM POWER POINT TRACKING USING SOLAR POWERPANELS WITH HIGH EFICIENCY

1 1W e d n e s d a y , F e b ru a ry 0 4 , 2 0 0 9

Tit le

S ize D o c u m e n t N u m b e r R e v

D a t e : S h e e t o f

R S T

V C C

GNDVCCVEERSRWEND0

D3D2

D4D5D6D7

LCD DISPLAY

D1

VCCGND

123456789

1 01 11 21 31 41 51 6

2 2 0 o h m

D 7 (L C D )

R8

R7

R6

R5

R4

R1

R2

R3 C

1 0 K P U L L U P

123456789

XTA L 2

1 1 . 0 5 9 2 M H z

P 0 . 1

GND

GND

V C C

P 0 . 6

GND

V C C

I

P 0 . 5

GND

GND

AT8 9 S5 2

2 0

1 81 7

2 9

3 0

1 9

3 29

1 01 11 21 31 41 51 6

4 03 93 83 73 63 53 43 3

2 8

2 72 62 52 42 32 22 1

12345678

3 1

G N D

XTA L 2(R D ) P 3 . 7

P S E N

A L E / P R O G

XTA L 1

P 0 . 7 / A D 7R S T

(R XD ) P 3 . 0(TXD ) P 3 . 1(I N T0 ) P 3 . 2(I N T1 ) P 3 . 3(T0 ) P 3 . 4(T1 ) P 3 . 5(W R ) P 3 . 6

V C CP 0 . 0 / A D 0P 0 . 1 / A D 1P 0 . 2 / A D 2P 0 . 3 / A D 3P 0 . 4 / A D 4P 0 . 5 / A D 5P 0 . 6 / A D 6

P 2 . 7 / A 1 5

P 2 . 6 / A 1 4P 2 . 5 / A 1 3P 2 . 4 / A 1 2P 2 . 3 / A 1 1P 2 . 2 / A 1 0

P 2 . 1 / A 9P 2 . 0 / A 8

(T2 ) P 1 . 0(T2 E X) P 1 . 1P 1 . 2P 1 . 3P 1 . 4(M O S I ) P 1 . 5(M I S O ) P 1 . 6(S C K ) P 1 . 7

E A / V P P

C S (M C P 3 2 0 1 )

P 1 . 5

G N D

P 1 . 6

1 B (U L N 2 0 0 3 )

F R O M I S P

MC P3 2 0 1

2

3

5

6

7

1 8

4

I N +

I N -

C S / S H D N

D O U T

C L K

V R E F V C C

V S S

XTA L 2

AT8 9 S5 2 ISP

8.2KR

V C C

D 4 (L C D )

P2.7

POW ER SU PPL Y(5 V D C )

D 6 (L C D )

R8

R7

R6

R5

R4

R1

R2

R3C

1 0 K P U L L U P

1 2 3 4 5 6 7 8 9

P 0 . 7

1 0 4 p f

P 1 . 1

3 3 p f

E N (L C D )

D O U T(M C P 3 2 0 1 )

4 B (U L N 2 0 0 3 )

V C CV C C

R S T

U L N 2 0 0 3

1234

1 61 51 41 3

78

56

1 21 11 09

1 B2 B3 B4 B

1 C2 C3 C4 C

7 BG N D

5 B6 B

5 C6 C7 C

C O M

SW

ITC

H

S O L A R P A N E L

12

V C C = 5 V

GND

G N D

1 23 45 67 89 1 0

P 0 . 3

7805 REG1 3

V I N V O U T

TR I M P O T

5 K

P 0 . 4

GND

P2.5TRANSFORMER

V C C

(9V,1 AMP)

GND

R S (L C D )

STEPPER MOTOR

123

4 5 6

3 B (U L N 2 0 0 3 )

XTA L 1

GND

3 3 p f

2 B (U L N 2 0 0 3 )

Page | 39Gandhiji institute of science and technology

Page 40: solar tracking system

SOLAR TRACKING SYSTEM

3.2 CIRCUIT DISCRIPTION

DESIGNING

In order to fulfill this application there are few steps that has been performed i.e.

1) Designing the power supply for the entire circuitry.

2) Selection of microcontroller that suits our application.

3) Selection of ADC.

Complete studies of all the above points are useful to develop this project.

3.2.1 SELECTION OF MICROCONTROLLER

As we know that there so many types of micro controller families that are available in the

market.

Those are

1) 8051 Family

2) AVR microcontroller Family

3) PIC microcontroller Family

4) ARM Family

Basic 8051 family is enough for our application; hence we are not concentrating on higher end

controller families.

In order to fulfill our application basic that is AT89C51 controller is enough. But still we

selected AT89S52 controller because of inbuilt ISP (in system programmer) option.

There are minimum six requirements for proper operation of microcontroller.

Those are:

Page | 40Gandhiji institute of science and technology

Page 41: solar tracking system

SOLAR TRACKING SYSTEM

3) power supply section

4) pull-ups for ports (it is must for PORT0)

5) Reset circuit

6) Crystal circuit

7) ISP circuit (for program dumping)

8) EA/VPP pin is connected to Vcc.

PORT0 is open collector that’s why we are using pull-up resistor which makes

PORT0 as an I/O port. Reset circuit is used to reset the microcontroller. Crystal circuit is used

for the microcontroller for timing pluses. In this project we are not using external memory that’s

why EA/VPP pin in the microcontroller is connected to Vcc that indicates internal memory is

used for this application.

3.2.2 SELECTION OF DRIVER

Driver is used increase the strength of signal. In this application we are using

stepper motor to rotate the solar panel .So to drive the stepper motor we have to increase the

strength of signal. In the market so many IC’s are available I selected ULN 2003 which is inbuilt

7 NPN transistors .And the working voltage of this IC is 5 volts which is same as

microcontroller working voltage .And in my board I no need to design any other power supply

section that’s why I selected this IC in my project.

3.2.3 SELECTION OF ADC

Here in this project I selected SPI protocol based MCP3201 ADC. In this project

ADC is used to convert analog voltage sent by the solar panel to digital voltage. We can use

parallel ADC (ADC 0804) but we need more pins to interface that, so to reduce port pins we can

use MCP3201, but to read the data from MCP3201 we can use SPI protocol.

Page | 41Gandhiji institute of science and technology

Page 42: solar tracking system

SOLAR TRACKING SYSTEM

CONNECTIONS TO MICROCONTROLLER

Microcontroller has 4 ports and every port has 8 pins We are connecting all

external components to this ports only .LCD is connected to the PORT zero and ULN2003 is

connected to PORT two and MCP 3201 which is acting as ADC is connected to the P1.0 and

P1.1 and P1.2 .

CONNECTIONS OF ADC

In this application ADC is used to convert from analog voltage to digital

voltage .The output of solar panel is connected to 2nd (input) pin of this IC .The output pins 7 th,

6th, 5th are connected to P1.0, P1.1, and P1.2 of controller

CONNECTIONS OF DRIVER IC (ULN 2003)

ULN 2003 has 16 pins in this 1st pin is connected to 2.7 pin and 2nd pin is connected to 2.6 and 3rd

pin is connected to 2.5 and 4th pin is connected to 2.4 pin of the microcontroller. And 8 th pin is

connected to ground 9th to Vcc and 13th to 16th pins are connected to the stepper motor. And other

pins are not connected.

CONNTCTOIONS TO THE STEPPER MOTOR

Stepper motor has 6 wires all this are connected to the ULN 2003 .In these two wires are

connected to Vcc and other wires are connected to the 13th to 16th pin of the ULN 2003.

Page | 42Gandhiji institute of science and technology

Page 43: solar tracking system

SOLAR TRACKING SYSTEM

3.3 CIRCUIT OPERATION

Whenever the power up we are written application program to rotate the solar panel till 360

degrees step by step to find maximum intensity .In this project we are using stepper motor to

rotate the solar panel .In this application we are using 12 steps to rotate the solar panel 360

degrees .we can measure the intensity per each step in form of voltage levels .So we can measure

12 voltage levels for 12 steps .Solar panel gives the intensity in the form of voltage and this

voltage gives to ADC, the ADC converts the analog voltage to digital voltage and this value is

given to the controller. After measuring all voltage values then we can find maximum value it

means there is maximum intensity .So we can place the solar panel where is the maximum

intensity.

After a particular time again we can rotate the solar panel step by step till 360 degrees, then we

can measure the voltage levels per each step and we can find the maximum intensity value in the

form of voltage. According the voltage value we can place the solar panel at particular position.

We can repeat this process.

Page | 43Gandhiji institute of science and technology

Page 44: solar tracking system

SOLAR TRACKING SYSTEM

CHAPTER 4

ADVANTAGES & DISADVANTAGES

4.1 ADVANTAGES

1.Solar tracking systems continually orient photovoltaic panels towards the sun and can help maximize your investment in your PV system. 2.One time investment, which provides higher efficiency & flexibility on dependency over other sources.3.Tracking systems can help reducing emissions and can contribute against global warming.4. Bulk implementations of tracking systems help reduced consumption of power by other sources. 5.It enhances the clean and emission free power production

4.2 Disadvantages

1. Initial investment is high on solar panels.2. It’s a bit of difficult for servicing, as the tracking systems are not quite popular regionally.3. Moving parts and gears which will require regular maintenance. 4.May require repair or replacement of broken parts over a long run.

4.3 Applications

1. Can be used for small & medium scale power generations2. For power generation at remote places where power lines are not accessible.3 For domestic backup power systems.

Page | 44Gandhiji institute of science and technology

Page 45: solar tracking system

SOLAR TRACKING SYSTEM

CHAPTER 5

FUTURE SCOPE

Solar energy refers to the utilization of the radiant energy from the Sun. Solar

power is used interchangeably with solar energy, but refers more specifically to the conversion

of sunlight into electricity by photovoltaic, concentrating solar thermal devices, or by an

experimental technology such as a solar chimney or solar pond.Solar panels are Photovoltaic

cells which gives voltage directly if you place them in sun light. Here if you change the position

of panels the power output will vary. Means, direct sunrays on solar panel can give good output

otherwise there might be decrease in the value of their outputs. So we have to track the path

where the maximum power will attain.

Solar panel devices are of two types that collect energy from the sun. One is solar

photovoltaic modules which use solar cells to convert light from the sun into electricity and the

other is solar thermal collector which converts the sun’s energy to heat water or another fluid

such as oil or antifreeze. In this project we are using the photovoltaic type.The solar panel gives

the voltage directly to the microcontroller through ADC. This solar panel should be fixed on the

stepper motor shaft so that it can easily rotate 180 degrees. The microcontroller controls the

stepper motor to rotate in desired direction. In order to attain maximum power output the

microcontroller accesses the solar panel direction continuously, which is on the shaft of stepper

motor.

By using real time clock we can adjust the panel directions according to the sun angle

without using manpower

Page | 45Gandhiji institute of science and technology

Page 46: solar tracking system

SOLAR TRACKING SYSTEM

CHAPTER 6

Conclusion

A solar tracking system, comprising: a first set of solar heat gain transducers that produce

respective first electrical output signals to drive a reversible first motor for changing a vertical

angle of a solar collector; a second set of solar heat gain transducers that produce respective

second electrical output signals to drive a reversible second motor for changing a horizontal

angle of the solar collector; each of the transducers having a thermistor in thermal contact with a

thermal mass, wherein the thermal mass comprises a mass of conducting material to elevate in

temperature while illuminated by the sun, and wherein the thermistor senses the temperature of

the thermal mass and produces a corresponding one of the electrical output signals proportional

to the temperature; and each of the transducers having the thermistor and the thermal mass

contained in a solar energy collecting and heat insulating enclosure that is solar energy

transparent.

Page | 46Gandhiji institute of science and technology

Page 47: solar tracking system

SOLAR TRACKING SYSTEM

CHAPTER 7

REFERENCE

TEXT BOOKS REFERED

1. “The 8051 Microcontroller and Embedded Systems” by Muhammad Ali

Mazidi and Janice Gillispie Mazidi, Pearson Education.

2. 8051 Microcontroller Architecture, programming and application by KENNETH

JAYALA

3. ATMEL 89s52 Data sheets

4. Hand book for Digital IC’s from Analogic Devices

WEBSITES VIEWED

www.atmel.com

www.beyondlogic.org

www.dallassemiconductors.com

www.maxim-ic.com

www.alldatasheets.com

www.howstuffworks.com

Page | 47Gandhiji institute of science and technology

Page 48: solar tracking system

SOLAR TRACKING SYSTEM

APPENDIX A

A.1 INTRODUCTION TO EMBEDDED SYSTEMS

Embedded systems are electronic devices that incorporate microprocessors with in their implementations. The main purposes of the microprocessors are to simplify the system design and provide flexibility. Having a microprocessor in the device helps in removing the bugs, making modifications, or adding new features are only matter of rewriting the software that controls the device. Or in other words embedded computer systems are electronic systems that include a microcomputer to perform a specific dedicated application. The computer is hidden inside these products. Embedded systems are ubiquitous. Every week millions of tiny computer chips come pouring out of factories finding their way into our everyday products.

Embedded systems are self-contained programs that are embedded within a piece of hardware. Whereas a regular computer has many different applications and software that can be applied to various tasks, embedded systems are usually set to a specific task that cannot be altered without physically manipulating the circuitry. Another way to think of an embedded system is as a computer system that is created with optimal efficiency, thereby allowing it to complete specific functions as quickly as possible.

Embedded systems designers usually have a significant grasp of hardware technologies. They use specific programming languages and software to develop embedded systems and manipulate the equipment. When searching online, companies offer embedded systems development kits and other embedded systems tools for use by engineers and businesses.

Embedded systems technologies are usually fairly expensive due to the necessary development time and built in efficiencies, but they are also highly valued in specific industries. Smaller businesses may wish to hire a consultant to determine what sort of embedded systems will add value to their organization.

A.1.1 CHARACTERISTICS

Two major areas of differences are cost and power consumption. Since many embedded systems are produced in tens of thousands to millions of units range, reducing cost is a major concern. Embedded systems often use a (relatively) slow processor and small memory size to minimize costs.

The slowness is not just clock speed. The whole architecture of the computer is often intentionally simplified to lower costs. For example, embedded systems often use peripherals controlled by synchronous serial interfaces, which are ten to hundreds of times slower than comparable peripherals used in PCs. Programs on an embedded system often run with real-time constraints with limited hardware resources: often there is no disk drive, operating system,

Page | 48Gandhiji institute of science and technology

Page 49: solar tracking system

SOLAR TRACKING SYSTEM

keyboard or screen. A flash drive may replace rotating media, and a small keypad and LCD screen may be used instead of a PC's keyboard and screen.

Firmware is the name for software that is embedded in hardware devices, e.g. in one or more ROM/Flash memory IC chips. Embedded systems are routinely expected to maintain 100% reliability while running continuously for long periods, sometimes measured in years. Firmware is usually developed and tested too much harsher requirements than is general-purpose software, which can usually be easily restarted if a problem occurs.

A.1.2 PLATFORM

There are many different CPU architectures used in embedded designs. This in contrast to the desktop computer market which is limited to just a few competing architectures mainly the Intel/AMD x86 and the Apple/Motorola/IBM Power PC’s which are used in the Apple Macintosh. One common configuration for embedded systems is the system on a chip, an application-specific integrated circuit, for which the CPU was purchased as intellectual property to add to the IC's design.

A.1.3 TOOLS

Like a typical computer programmer, embedded system designers use compilers, assemblers and debuggers to develop an embedded system. Those software tools can come from several sources:

Software companies that specialize in the embedded market Ported from the GNU software development tools. Sometimes, development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor. Embedded system designers also use a few software tools rarely used by typical computer programmers. Some designers keep a utility program to turn data files into code, so that they can include any kind of data in a program. Most designers also have utility programs to add a checksum or CRC to a program, so it can check its program data before executing it.

A.1.4 OPERATING SYSTEM

They often have no operating system, or a specialized embedded operating system (often a real-time operating system), or the programmer is assigned to port one of these to the new system.

A.1.5 DEBUGGING

Debugging is usually performed with an in-circuit emulator, or some type of debugger that can interrupt the micro controller’s internal microcode. The microcode interrupt lets the debugger operate in hardware in which only the CPU works. The CPU-based debugger can be used to test and debug the electronics of the computer from the viewpoint of the CPU.

Developers should insist on debugging which shows the high-level language, with breakpoints and single stepping, because these features are widely available. Also, developers should write and use simple logging facilities to debug sequences of real-time events. PC or mainframe

Page | 49Gandhiji institute of science and technology

Page 50: solar tracking system

SOLAR TRACKING SYSTEM

programmers first encountering this sort of programming often become confused about design priorities and acceptable methods. Mentoring, code-reviews and ego less programming are recommended.

A.2 DESIGN OF EMBEDDED SYSTEMS:

The electronics usually uses either a microprocessor or a microcontroller. Some large or old systems use general-purpose mainframes computers or minicomputers.

A.2.1 START-UP

All embedded systems have start-up code. Usually it disables interrupts, sets up the electronics, tests the computer (RAM, CPU and software), and then starts the application code. Many embedded systems recover from short-term power failures by restarting (without recent self-tests). Restart times under a tenth of a second are common.

Many designers have found one of more hardware plus software-controlled LED’s useful to indicate errors during development (and in some instances, after product release, to produce troubleshooting diagnostics). A common scheme is to have the electronics turn off the LED(s) at reset, whereupon the software turns it on at the first opportunity, to prove that the hardware and start-up software have performed their job so far. After that, the software blinks the LED(s) or sets up light patterns during normal operation, to indicate program execution progress and/or errors. This serves to reassure most technicians/engineers and some users.

A.2.2 THE CONTROL LOOP

In this design, the software has a loop. The loop calls subroutines. Each subroutine manages a part of the hardware or software. Interrupts generally set flags, or update counters that are read by the rest of the software. A simple API disables and enables interrupts. Done right, it handles nested calls in nested subroutines, and restores the preceding interrupt state in the outermost enable. This is one of the simplest methods of creating an exocrine.

Typically, there's some sort of subroutine in the loop to manage a list of software timers, using a periodic real time interrupt. When a timer expires, an associated subroutine is run, or flag is set. Any expected hardware event should be backed-up with a software timer. Hardware events fail about once in a trillion times.

State machines may be implemented with a function-pointer per state-machine (in C++, C or assembly, anyway). A change of state stores a different function into the pointer. The function pointer is executed every time the loop runs.

Many designers recommend reading each IO device once per loop, and storing the result so the logic acts on consistent values. Many designers prefer to design their state machines to check only one or two things per state. Usually this is a hardware event, and a software timer. Designers recommend that hierarchical state machines should run the lower-level state machines before the higher, so the higher run with accurate information.

Page | 50Gandhiji institute of science and technology

Page 51: solar tracking system

SOLAR TRACKING SYSTEM

Complex functions like internal combustion controls are often handled with multi-dimensional tables. Instead of complex calculations, the code looks up the values. The software can interpolate between entries, to keep the tables small and cheap.

One major disadvantage of this system is that it does not guarantee a time to respond to any particular hardware event. Careful coding can easily assure that nothing disables interrupts for long. Thus interrupt code can run at very precise timings. Another major weakness of this system is that it can become complex to add new features. Algorithms that take a long time to run must be carefully broken down so only a little piece gets done each time through the main loop.

This system's strength is its simplicity, and on small pieces of software the loop is usually so fast that nobody cares that it is not predictable. Another advantage is that this system guarantees that the software will run. There is no mysterious operating system to blame for bad behavior.

A.3 USER INTERFACES

Interface designers at PARC, Apple Computer, Boeing and HP minimize the number of types of user actions. For example, use two buttons (the absolute minimum) to control a menu system (just to be clear, one button should be "next menu entry" the other button should be "select this menu entry"). A touch-screen or screen-edge buttons also minimize the types of user actions.

Another basic trick is to minimize and simplify the type of output. Designs should consider using a status light for each interface plug, or failure condition, to tell what failed. A cheap variation is to have two light bars with a printed matrix of errors that they select- the user can glue on the labels for the language that she speaks.

For example, Boeing's standard test interface is a button and some lights. When you press the button, all the lights turn on. When you release the button, the lights with failures stay on. The labels are in Basic English.

Designers use colors. Red defines the users can get hurt- think of blood. Yellow defines something might be wrong. Green defines everything's OK.

Another essential trick is to make any modes absolutely clear on the user's display. If an interface has modes, they must be reversible in an obvious way. Most designers prefer the display to respond to the user. The display should change immediately after a user action. If the machine is going to do anything, it should start within 7 seconds, or give progress reports.

One of the most successful general-purpose screen-based interfaces is the two menu buttons and a line of text in the user's native language. It's used in pagers, medium-priced printers, network switches, and other medium-priced situations that require complex behavior from users. When there's text, there are languages. The default language should be the one most widely understood.

Page | 51Gandhiji institute of science and technology

Page 52: solar tracking system

SOLAR TRACKING SYSTEM

A.4 INTRODUCTION TO MICROCONTROLLER

Microcontrollers as the name suggests are small controllers. They are like single chip computers that are often embedded into other systems to function as processing/controlling unit. For example the remote control you are using probably has microcontrollers inside that do decoding and other controlling functions. They are also used in automobiles, washing machines, microwave ovens, toys ... etc, where automation is needed.

Micro-controllers are useful to the extent that they communicate with other devices, such as sensors, motors, switches, keypads, displays, memory and even other micro-controllers. Many interface methods have been developed over the years to solve the complex problem of balancing circuit design criteria such as features, cost, size, weight, power consumption, reliability, availability, manufacturability. Many microcontroller designs typically mix multiple interfacing methods. In a very simplistic form, a micro-controller system can be viewed as a system that reads from (monitors) inputs, performs processing and writes to (controls) outputs.

Embedded system means the processor is embedded into the required application. An embedded product uses a microprocessor or microcontroller to do one task only. In an embedded system, there is only one application software that is typically burned into ROM. Example: printer, keyboard, video game player

Microprocessor - A single chip that contains the CPU or most of the computer

Microcontroller - A single chip used to control other devices

Microcontroller differs from a microprocessor in many ways. First and the most important is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it. Thus, we save the time and space needed to construct devices.

MICROPROCESSOR VS MICROCONTROLLER:

Microprocessor

CPU is stand-alone, RAM, ROM, I/O, timer are separate Designer can decide on the amount of ROM, RAM and I/O ports. expensive

Page | 52Gandhiji institute of science and technology

Page 53: solar tracking system

SOLAR TRACKING SYSTEM

versatility general-purpose

Microcontroller

• CPU, RAM, ROM, I/O and timer are all on a single chip• fix amount of on-chip ROM, RAM, I/O ports• for applications in which cost, power and space are critical

Page | 53Gandhiji institute of science and technology

Page 54: solar tracking system

SOLAR TRACKING SYSTEM

APPENDIX B

Many companies provide the 8051 assembler, some of them provide shareware

version of their product on the Web, Kiel is one of them. We can download them from their

Websites. However, the size of code for these shareware versions is limited and we have to

consider which assembler is suitable for our application.

B.1 KIEL U VISION2

This is an IDE (Integrated Development Environment) that helps you write,

compile, and debug embedded programs. It encapsulates the following components:

. A project manager

. A make facility

. Tool configuration

. Editor

. A powerful debugger

To get start here are some several example programs

B.2 BUILDING AN APPLICATION IN UVISION2

To build (compile, assemble, and link) an application in uVision2, you must:

. Select Project–Open Project

(For example, \C166\EXAMPLES\HELLO\HELLO.UV2)

. Select Project - Rebuild all target files or Build target. UVision2 compiles, assembles,

and links the files in your project.

B.3 CREATING YOUR OWN APPLICATION IN UVISION2

To create a new project in uVision2, you must:

Page | 54Gandhiji institute of science and technology

Page 55: solar tracking system

SOLAR TRACKING SYSTEM

. Select Project - New Project.

. Select a directory and enter the name of the project file.

. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the

Device

. Database

. Create source files to add to the project.

. Select Project - Targets, Groups, and Files. Add/Files, select Source Group1, and add the

source files to the project.

. Select Project - Options and set the tool options. Note when you select the target device

from the Device Database all-special options are set automatically. You only need to

configure the memory map of your target hardware. Default memory model settings are

optimal for most.

B.4 DEBUGGING AN APPLICATION IN UVISION2

To debug an application created using uVision2, you must:

. Select Debug - Start/Stop Debug Session.

. Use the Step toolbar buttons to single-step through your program. You may enter G, main

in the Output Window to execute to the main C function.

. Open the Serial Window using the Serial #1 button on the toolbar.

. Debug your program using standard options like Step, Go, Break, and so on.

B.5 LIMITATIONS OF EVALUATION SOFTWARE

The following limitations apply to the evaluation versions of the C51, C251, or C166 tool

chains. C51 Evaluation Software Limitations:

Page | 55Gandhiji institute of science and technology

Page 56: solar tracking system

SOLAR TRACKING SYSTEM

. The compiler, assembler, linker, and debugger are limited to 2 Kbytes of object code but

source Code may be any size. Programs that generate more than 2 Kbytes of object code

will not compile, assemble, or link the startup code generated includes LJMP's and

cannot be used in single-chip devices supporting Less than 2 Kbytes of program space

like the Philips 750/751/752.

. The debugger supports files that are 2 Kbytes and smaller.

. Programs begin at offset 0x0800 and cannot be programmed into single-chip devices.

. No hardware support is available for multiple DPTR registers.

. No support is available for user libraries or floating-point arithmetic.

B.6 EVALUATION SOFTWARE

. Code-Banking Linker/Locator

. Library Manager.

. RTX-51 Tiny Real-Time Operating System

B.7 PERIPHERAL SIMULATION

The u vision2 debugger provides complete simulation for the CPU and on chip

peripherals of most embedded devices. To discover which peripherals of a device are supported,

in u vision2. Select the Simulated Peripherals item from the Help menu. You may also use the

web-based device database. We are constantly adding new devices and simulation support for

on-chip peripherals so be sure to check Device Database often.

Page | 56Gandhiji institute of science and technology

Page 57: solar tracking system

SOLAR TRACKING SYSTEM

APPENDIX CC.1 CODE#include <reg52.h>#include<lcd.h>#include<intrins.h>#define DELAY _nop_();

sbit CLK = P2^5;sbit DOUT= P2^4;sbit DIN = P2^3;sbit CS = P2^2;

sbit m1=P2^0;sbit m2=P2^1;

sbit s1 = P2^6;sbit s2 = P2^7;

sbit pin = P1^0;float adc_convert (void);void float_lcd(float f);unsigned char byte_write_read(unsigned char);void select_channel(void);float t;

unsigned int i,j,range=0;unsigned char channel,A,C;

void stop(){m1=m2=0;}void left(){m1=0;m2=1;}void right(){m1=1;m2=0;}

void TEMP(){ t=0;

Page | 57Gandhiji institute of science and technology

Page 58: solar tracking system

SOLAR TRACKING SYSTEM

i=0; channel=i; t=t+adc_convert(); t=t*1; }void main (void){m1=m2=0;s1=s2=1;pin=1;init_lcd();display_lcd("Solar ");cmd_lcd(0x01);cmd_lcd(0x80);display_lcd("T:"); while(1) { m1=m2=0; s1=s2=1; pin=1;

back:stop();do{cmd_lcd(0x80);display_lcd("T:");cmd_lcd(0x82);TEMP();float_lcd(t);display_lcd(" V ");delay_ms(15);}while(pin==1);stop();delay_ms(10);right();do{cmd_lcd(0x80);display_lcd("T:");cmd_lcd(0x82);TEMP();float_lcd(t);display_lcd(" V ");delay_ms(15);}while(s2==1 && pin==0);if(s2==0)stop();else goto back;delay_ms(10);left();do{

Page | 58Gandhiji institute of science and technology

Page 59: solar tracking system

SOLAR TRACKING SYSTEM

cmd_lcd(0x80);display_lcd("T:");cmd_lcd(0x82);TEMP();float_lcd(t);display_lcd(" V ");delay_ms(15);}while(s1==1 && pin==0);if(s1==0)stop();else goto back;

}}

float adc_convert (void) { // variables declaration unsigned char byte0,byte1,byte2; int i; float val; CLK=0; CS=1; CS=0; select_channel(); byte0=byte_write_read(A); byte1=byte_write_read(C); byte2=byte_write_read(0x00); CS=1; i=(byte1&0x0f); i=((i<<8)|byte2); val=(i*4.096)/4096; return val; }unsigned char byte_write_read (unsigned char a) { unsigned char c=0,mask=0x80; do { CLK=1; //delay_us(500); delay_ms(1); if(a&mask) DIN=1; else DIN=0;

Page | 59Gandhiji institute of science and technology

Page 60: solar tracking system

SOLAR TRACKING SYSTEM

CLK=0; //delay_us(500); delay_ms(1);

if(DOUT==1) c|=mask; mask>>=1; } while(mask>0); return c;}void select_channel (void){ unsigned char x; x=(channel*4)+0x60; A = x>>4; C = x<<4;}

Page | 60Gandhiji institute of science and technology