+ All Categories
Home > Engineering > Solar Tracking system

Solar Tracking system

Date post: 16-Apr-2017
Category:
Upload: navreet-singh
View: 168 times
Download: 3 times
Share this document with a friend
52
Solar Tracking System A project Report Submitted by NAVREET SINGH In partial fulfilment for the award of the degree of B.TECH IN ELECTRICAL ENGINEERING At CT INSTITUTE OF ENGINEERING, MANAGEMENT AND TECHNOLOGY JALANDHAR
Transcript
Page 1: Solar Tracking system

Solar Tracking System

A project Report

Submitted by

NAVREET SINGH

In partial fulfilment for the award of the degree

of

B.TECH

IN

ELECTRICAL ENGINEERING

At

CT INSTITUTE OF ENGINEERING, MANAGEMENT AND TECHNOLOGY

JALANDHAR

Page 2: Solar Tracking system

ABSTRACT:-

Trackers direct solar panels or modules toward the sun. These devices change their orientation throughout the day to follow the sun’s path to maximize energy capture.

In photovoltaic systems, trackers help minimize the angle of incidence (the angle that a ray of light makes with a line perpendicular to the surface) between the incoming light and the panel, which increases the amount of energy the installation produces. Concentrated solar photovoltaics and concentrated solar thermal have optics that directly accepts sunlight, so solar trackers must be angled correctly to collect energy. All concentrated solar systems have trackers because the systems do not produce energy unless directed correctly toward the sun.Single-axis solar trackers rotate on one axis moving back and forth in a single direction. Different types of single-axis trackers include horizontal, vertical, tilted, and polar aligned, which rotate as the names imply. Dual-axis trackers continually face the sun because they can move in two different directions. Types include tip-tilt and azimuth-altitude. Dual-axis tracking is typically used to orient a mirror and redirect sunlight along a fixed axis towards a stationary receiver. Because these trackers follow the sun vertically and horizontally they help obtain maximum solar energy generation.

2

Page 3: Solar Tracking system

ACKNOWLEDMENT

I would like to express my sincere gratitude to my Supervisors Er.Sonam Jain for their advices, guidance, continuous encouragement and their generous dedication of precious time throughout the work of this thesis.

Furthermore, I would like to thank all of my friends for their help and support. Finally I dedicate the thesis to all the members of my family for their moral support and patience during this research work.

3

Page 4: Solar Tracking system

TABLE OF CONTENTS

Contents Page No.

Abstract 2

Acknowledgement 3

Table of Contents 5

List of Figures 5

Chapter 1: INTRODUCTION 6

Chapter 2: LITERATURE REVIEW 7-39

2.1 Block Diagram 7

2.2 Schematic Diagram 8 2.3 Component’s Description 10 2.3.1 Transformer 10 2.3.2 Specification of Transformer 12 2.3.3 Resistors 12 3. Resistor Colour Code 14 4. Capacitor 15 5. Diode 17 6. Transistor 19 7. Power Supply 22 8. Microcontrollers 24 8.1 8051 Microcontrollers 25 8.2 Pin Configuration of 8051 26 9. Dc Motor 32 10. Isolators 34 11. Program 38

4

Page 5: Solar Tracking system

LIST OF FIGURES

Fig No. Figure Description Page No.

Fig 1.1 Block Diagram 7

Fig 1.2 Schematic Diagram 8

Fig 1.3 Transformer 10

Fig 1.4 Resistors 13

Fig 1.5 Diode 17

Fig 1.6 Rectifier 18

Fig 1.7 Series Diode 18

Fig 1.8 Transistor 19

Fig 1.10 LED 20

Fig 1.11 Voltage Regulator 21

Fig 1.12 Power Supply 22

Fig 1.13 Microcontrollers 24

Fig 1.14 Pin Diagram 26

Fig 1.15 Dc Motor 32

Fig 1.16 Isolators 33

Fig 1.17 H Bridge Circuit 34

Fig 1.18 Op Amp Circuit Working 35

LIST OF TABLES

Table No. Table Description Page No.

Table 1.1 Resistor Colour Code 15

Table 1.2 Alternate Function 29

5

Page 6: Solar Tracking system

1.Introduction

Solar energy is the radiant light and heat from sun that has been harnessed since ages. Only a Miniscule of the solar power received by the Earth (174 per watts ) is enough to meet the present-day energy demand. At the same time, the usage of solar energy today is only a very tiny fraction of the total energy demand.The sun energy is available in the form of radiation over visible light and infrared region albeit at a very low intensity. Most commonly used ways of harvesting the radiant solar energy is using photovoltaic panels which basically are interconnected assemblies of photovoltaic cells. The photovoltaic systems receive solar energy mainly in the visible light and near infrared regions of the spectrum.

The light power is converted directly into dc electric current. Photovoltaic energy conversion efficiency in most systems, however, is only in teens. Amount of the harvested solar energy is critically dependent on the orientation of the solar panel. The solar energy collection is very inefficient in stationary panels. The efficiency of solar energy collection in photovoltaic solar panels at any location can be optimized when the panel a) faces the sun and b) continuously tracks the sun during the day in one or two axis. This tracking can be controlled in a feed forward or feedback controlled manner. The later has obvious advantages.

[1] It have used a feedback controlled one-axis mechanism that compares voltages from two small solar cells mounted on a big solar panel assembly and activates a stepper motor to adjust the east-west alignment.

[2]It uses an open-loop embedded control system for the solar tracker. This paper describes a two-axis feedback controlled tracking system which directly uses sun rays as the feedback signals.

6

Page 7: Solar Tracking system

2.1 Block Diagram

7

Page 8: Solar Tracking system

Fig.1.1

2.2 Schematic Diagram

8

Page 9: Solar Tracking system

Fig.1.2

1. (IN4007)2. Capacitor

9

Page 10: Solar Tracking system

3. Voltage Regulator 4. Resistor

Material Used

1. Transformer 2. Diodes3. Microcontroller4. Crystal5. LDR6. LM3587. Motor8. Opto coupler9. Transistor 805010. Transistor 855011. Wooden body12. IC bases13. Ribbon wire14. Jumper wire15. Soldering Iron16. Soldering Wire17. Multimeter18. PCB19. Cutter20. Screw & Nuts

2.3 Components’ Description

10

Page 11: Solar Tracking system

2.3.1 TRANSFORMER

Transformer works on the principle of mutual inductance. We know that if two coils or windings are placed on the core of iron, and if we pass alternating current in one winding, back emf or induced voltage is produced in the second winding. We know that alternating current always changes with the time. So if we apply AC voltage across one winding, a voltage will be induced in the other winding. Transformer works on this same principle. It is made of two windings wound around the same core of iron. The winding to which AC voltage is applied is called primary winding. The other winding is called as secondary winding. Transformers are of two types Step Up transformer and Step Down transformer.

Fig.1.3

Step Up transformer: - These transformers are used to increase the voltage level at the output means Voltage at secondary winding is more than the primary winding. In this transformer secondary winding has more number of turns than primary winding. These types of transformers are generally used in power station.

Step Down transformer: - These transformers are used to decrease the voltage level at the output winding means voltage of secondary winding is less than the primary winding. In this transformer secondary winding has less number of turns than primary winding. These types of transformers have major applications in electronics industry. Further these are divided into two categories

Simple Transformer11

Page 12: Solar Tracking system

A) Central tapped transformer

Simple Transformer: - It’s a four wire transformer. These types of transformer have 2 wires on primary winding and 2 wires on secondary output. Symbol of this transformer is shown below. Voltage rating of these transformer expressed as 6V, 12V, 24V etc.

Central Tapped transformer: - It’s a 5 Wire transformer. This type of transformer has 2 wires on primary winding and 3 wires on secondary. Middle one is known as Common. Voltage rating of these transformer expressed as 6-0-6 V,12-0-12 V, 24-0-24 V etc.

12

Page 13: Solar Tracking system

Central Tapped transformer

2.3.2 Specification of transformer:-

While purchasing a transformer generally two considerations have to be kept in mind, first one is voltage rating and second is current rating. Voltage rating depends upon the circuit’s operating voltage its generally 5 or 12 Volt so 6 or 12 Volt transformers are generally used. Current rating of transformer depends upon the load of circuit. If our load current is more than the transformer current then due to loading effects transformer can burn out. So to protect our transformer, current rating of transformer should be more than the load current. All transformer comes with different current rating e.g. 6 V transformer is available in 500m A, 750mA, 1A, 2A so on. One thing should be kept in mind as the ampear increases cost of transformer also increases. We have to choose best one according to our circuit requirements.

RESISTORS

The flow of charge (or current) through any material, encounters an opposing force similar in many respect to mechanical friction. This opposing force is called resistance of the material. It is measured in ohms. In some electric circuits resistance is deliberately introduced in the form of the resistor.

Resistors are of following types: Wire wound resistors.

1. Carbon resistors.

2. Metal film resistors.

Wire Wound Resistors:

Wire wound resistors are made from a long (usually Ni-Chromium) wound on a ceramic core. Longer the length of the wire, higher is the resistance. So depending on the value of resistor required in a circuit, the wire is cut and wound on a ceramic core. This entire

13

Page 14: Solar Tracking system

assembly is coated with a ceramic metal. Such resistors are generally available in power of 2 watts to several hundred watts and resistance values from 1ohm to 100k ohms. Thus wire wound resistors are used for high currents.

Carbon Resistors:

Carbon resistors are divided into three types:

Carbon composition resistors are made by mixing carbon grains with binding material (glue) and moduled in the form of rods. Wire leads are inserted at the two ends. After this an insulating material seals the resistor. Resistors are available in power ratings of 1/10, 1/8, 1/4 , 1/2 , 1.2 watts and values from 1 ohm to 20 ohms.

a. Carbon film resistors are made by deposition carbon film on a ceramic rod. They are cheaper than carbon composition resistors.

b. Cement film resistors are made of thin carbon coating fired onto a solid ceramic substrate. The main purpose is to have more precise resistance values and greater stability with heat. They are made in a small square with leads.

Fig.1.4

Metal Film Resistors:

They are also called thin film resistors. They are made of a thin metal coating deposited on a cylindrical insulating support. The high resistance values are not precise in value; however, such resistors are free of inductance effect that is common in wire wound resistors at high frequency.

14

Page 15: Solar Tracking system

Variable Resistors:

Potentiometer is a resistor where values can be set depending on the requirement. Potentiometer is widely used in electronics systems. Examples are volume control, tons control, brightness and contrast control of radio or T.V. sets.

3. RESISTOR COLOR CODE

Table1.1

Color 1st band 2nd band 3rd band (multiplier) 4th band (tolerance) Temp. Coefficient

Black 0 0 ×100

Brown 1 1 ×101 ±1% (F) 100 ppm

Red 2 2 ×102 ±2% (G) 50 ppm

Orange 3 3 ×103 15 ppm

Yellow 4 4 ×104 25 ppm

15

Page 16: Solar Tracking system

Green 5 5 ×105 ±0.5% (D)

Blue 6 6 ×106 ±0.25% (C)

Violet 7 7 ×107 ±0.1% (B)

Gray 8 8 ×108 ±0.05% (A)

White 9 9 ×109

Gold ×10−1 ±5% (J)

Silver ×10−2 ±10% (K)

None ±20% (M)

4. CAPACITORS

A capacitor can store charge, and its capacity to store charge is called capacitance. Capacitors consist of two conducting plates, separated by an insulating material (known as dielectric). The two plates are joined with two leads. The dielectric could be air, mica, paper, ceramic, polyester, polystyrene, etc. This dielectric gives name to the capacitor. Like paper capacitor, mica capacitor etc.

Types of Capacitors:- Capacitors are of two Types Fixed and variable capacitor.

Fixed types of capacitor are further of two types:-

Polar Capacitor:- Those capacitor have polarity are known as polar capacitor. Electrolytic capacitor are the example of polar capacitors.

16

Page 17: Solar Tracking system

Non Polar Capacitor:- Those capacitor have no polarity are known as NON- polar capacitor. Ceramic capacitor are the example of non polar capacitors

Electrolytic Capacitor: Electrolytic capacitors have an electrolyte as a dielectric. When such an electrolyte is charged, chemical changes takes place in the electrolyte. If its one plate is charged positively, same plate must be charged positively in future. We call such capacitors as polarized. Normally we see electrolytic capacitor as polarized capacitors and the leads are marked with positive or negative on the can. Non-electrolyte capacitors have dielectric material such as paper, mica or ceramic. Therefore, depending upon the dielectric, these capacitors are classified.

Ceramic Capacitor: Such capacitors have disc or hollow tabular shaped dielectric made of ceramic material such as titanium dioxide and barium titanate. Thin coating of silver compounds is deposited on both sides of dielectric disc, which acts as capacitor plates. Leads are attached to each sides of the dielectric disc and whole unit is encapsulated in a moisture proof coating. Disc type capacitors have very high value up to 0.001uf. Their working voltages range from 3V to 60000V. These capacitors have very low leakage current. Breakdown voltage is very high.

17

Page 18: Solar Tracking system

5.Diode:-

Diodes are semiconductor devices which might be described as passing current in one direction only. Diodes have two terminal, an anode and a cathode. The cathode is always identified by a dot, ring or some other mark. Diode is a unidirectional device. In this current flows in only one direction.

Fig.1.5

Diodes can be used as voltage regulators, tuning devices in rf tuned circuits, frequency multiplying devices in rf circuits, mixing devices in rf circuits, switching applications or can be used to make logic decisions in digital circuits. There are also diodes which emit "light", of course these are known as light-emitting-diodes or LED's.

A rectifying diode of the 1N4001-07 ( 1A) type or even one of the high power, high current stud mounting types. You will notice the straight bar end has the letter "k", this denotes the "cathode" while the "a" denotes anode. Current can only flow from anode to cathode and not in the reverse direction, hence the "arrow" appearance. This is one very important property of diodes.

The principal early application of diodes was in rectifying 50 / 60 Hz AC mains to raw DC which was later smoothed by choke transformers and / or capacitors. This procedure is still carried out today and a number of rectifying schemes for diodes have evolved, half wave, full wave and bridge, full wave and bridge rectifiers.

18

Page 19: Solar Tracking system

Fig.1.6

As examples in these applications the half wave rectifier passes only the positive half of successive cycles to the output filter through D1. During the negative part of the cycle D1 does not conduct and no current flows to the load. In the full wave application it essentially is two half wave rectifiers combined and because the transformer secondary is centre tapped, D1 conducts on the positive half of the cycle while D2 conducts on the negative part of the cycle. Both add together. This is more efficient. The full wave bridge rectifier operates essentially the same as the full wave rectifier but does not require a centre tapped transformer. Further discussion may be seen on the topic power supplies

1N400X series Diode:-

Features

• Diffused Junction

• High Current Capability and Low Forward Voltage Drop

• Low Reverse Leakage Current

Fig.1.719

Page 20: Solar Tracking system

6. Transistor:-

The schematic representation of a transistor is shown. Note the arrow pointing down towards the emitter. This signifies it's an NPN transistor a transistor is basically a current amplifier. Say we let 1mA flow into the base. We may get 100mA flowing into the collector. Note: The currents flowing into the base and collector exit through the emitter (sum off all currents entering or leaving a node must equal zero). The gain of the transistor will be listed in the datasheet as either βDC or Hfe. The gain won't be identical even in transistors with the same part number. The gain also varies with the collector current and temperature.

Fig.1.8

Fig.1.9

20

Page 21: Solar Tracking system

LED: - LED means light emitting diode. Its function is similar to the diode. But these are not made up from silicon or germanium. These are generally used as an indicating device. There are variety of LEDs are available in market depending upon their size and colour.

Fig.1.10

Polarity of LED: - LED have polarity. We can judge its polarity by watching flags in its structure. Bigger flag is known as cathode and smaller flag is known as anode as shown below.

21

Page 22: Solar Tracking system

Voltage Regulator The LM78XX 3-terminal positive voltage regulators employ internal current-limiting, thermal shutdown and safe-area compensation, making them essentially indestructible. Heat sinking is provided; they can deliver over 1.0A output current. They are intended as fixed voltage regulators in a wide range of applications including local (on-card) regulation for elimination of noise and distribution problems associated with single-point regulation. In addition to use as fixed voltage regulators.

Fig.1.11

Features

■ Output current up to 1 A

■ Output voltages of 5; 6; 8; 9; 12; 15; 18; 24 V

■ Thermal overload protection

22

Page 23: Solar Tracking system

■ Short circuit protection

Crystal: - It’s a 2 terminal component. This component has no polarity. Its basic function to generate a Square Wave of some fixes frequency. Its value is measure in MHz

7.Power supply: -

Power supply is the essential part of any device or project. We are using microcontroller and LED. These components needs +5V DC supply. So we need a power supply circuit of +5V DC. Power supply circuit includes step down transformer, rectifier circuit, filter circuit and regulator circuit. An indicating component is also attached with the power supply to indicate the power ON condition of power supply unit.

Fig.1.12

Now the aim is to design the power supply section which converts 230V AC in to 5V DC. Since 230V 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

23

Page 24: Solar Tracking system

a 5V DC. Considering the efficiency factor of the full wave, we came to a conclusion to choose a transformer, whose secondary voltage is 3-4 higher than the required voltage. Thus a step down transformer of 9 V and 500 mA is used to step down the AC power supply. This transformer can provide current up to 750 mA. Our circuit load is below 750 mA. So there will not be any loading effect on transformer. Output of transformer is given to the rectifier circuit. We are using a central tapped full wave rectifier. In this rectifier we are using 1N4007 pn diode to rectify AC voltage. Output of this rectifier is not purely DC. Output of rectifier is rippled DC. So we need some filtering section to rectify these ripples. Output voltage of rectifier can be calculated by:-

Vout = (Vin * √2)- (Forward voltage drop of diode)

1N4007 is a silicon semiconductor material based diode. So in this case forward Voltage drop is .7 V. Final output of this rectifier be:-

Vout= (12*√2)- .7

Vout= 16.1 V

Rectifier circuit is build of capacitor. A capacitor of 1000uF,25V is used to filter the ripples. Output of capacitor is almost pure DC. But its voltage is 16V and we need +5V DC. So we are using a voltage regulator to get the desired +5V DC. A 7805 voltage regulator is a suitable component for this purpose. Output of 7805 regulator is +5V DC. A capacitor of 470uf, 10V is used to further filter out the critical ripples. A LED is used as an indicating device. Most of LED operates at 1.5 to 2.5V voltage range with 8-10 mA. LED used here is of 5mm size. We consider that LED operating at 1.6V with 8mA current. We can calculate the value of resistor using the KVC law.

Total Voltage= Voltage across resistor+ Voltage across LED

LED and resistor are connected in series so same current will flow. Means 8mA current will flow through the resistor.Now Total Voltage is =5VVoltage across resistor is =1.6vCurrent is = 10mASo our equation will be5V= (10mA * resistance) + 1.6V3.4V=10mA * resistanceResistance =3.4/10mA= 340 ohm

Thus we can calculate the any series resistor for any input voltage and LED.

24

Page 25: Solar Tracking system

8. MICROCONTROLLERS (MCU)

Figure shows the block diagram of a typical microcontroller, which is a true computer on a chip. The design incorporates all of the features found in micro-processor CPU, ALU, PC, SP, and registers. It also added the other features needed to make a complete computer: ROM, RAM, I/O,timer & counters,and clock circuit.

Fig.1.13

Structure of microprocessor and microcontroller

DIFFERENCE BETWEEN MICROCONTROLLER & MICROPROCESSOR

It is very clear from figure that in microprocessor we have to interface additional circuitry for providing the function of memory and ports, for example we have to interface external RAM for data storage, ROM for program storage, programmable peripheral interface (PPI) 8255 for the Input Output ports, 8253 for timers, USART for serial port. While in the microcontroller RAM, ROM, I/O ports, timers and serial communication ports are in built. Because of this it is called as “system on chip”. So in micro-controller there is no necessity of additional circuitry which is interfaced in the microprocessor because memory and input output ports are inbuilt in the microcontroller. Microcontroller gives the satisfactory performance for small applications. But for large applications the memory requirement is limited because only 64 KB memory is available for program storage. So for large applications we prefer microprocessor than microcontroller due to its high processing speed.

25

Page 26: Solar Tracking system

8.1 8051 MICROCONTROLLER

Description:-

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8Kbytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density non-volatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interruptor hardware reset.

Features:-

• 8K Bytes of In-System Programmable (ISP) Flash Memory– Endurance: 1000 Write/Erase Cycles• 4.0V to 5.5V Operating Range• Fully Static Operation: 0 Hz to 33 MHz• Three-level Program Memory Lock• 256 x 8-bit Internal RAM• 32 Programmable I/O Lines• Three 16-bit Timer/Counters• Eight Interrupt Sources• Full Duplex UART Serial Channel• Low-power Idle and Power-down Modes• Interrupt Recovery from Power-down Mode• Watchdog Timer• Dual Data Pointer• Power-off Flag• Fast Programming Time• Flexible ISP Programming (Byte and Page Mode)

26

Page 27: Solar Tracking system

8.2 PIN CONFIGURATION OF 8051 MICROCONTROLLER

Although 8051 family members come in different packages such DIP(dual in line package),QFP(Quad flat package), and LLC(leadless chi0p carrier),they all have 40 pins that are dedicated to various functions such as I/O,RD,WR, address, data and interrupts.

VCC:

Pin 40 provides supply voltage to the chip. The voltage source is +5 Volts.

GND:

Pin 20 is the ground.

Fig.1.14

FIG 28: PIN DIAGRAM OF THE P89C51

XTAL1 and XTAL2:

The 8051 has an on chip oscillator but requires an external clock to run it. Most often a quartz crystal oscillator is connected to inputs XTAL1 (pin 19) and XTAL2 (pin 18). The quartz crystal oscillator connected to XTAL1 and X

TAL2 also needs two capacitors of 27 pf value. One side of each capacitor is connected to the ground. Speed refers to the maximum oscillator frequency connected to XTAL .When the 8051 is connected to a crystal oscillator is powered up we can observe the frequency on the XTAL2 pin using the oscilloscope.

27

Page 28: Solar Tracking system

RST:

Pin 9 is the RESET pin. It is an input and is active high. Upon applying a high pulse to this pin the microcontroller well reset and terminate all activities. This is often referred to as a power on reset .Activating a power on reset will cause all values the registers to be lost. It will set program counter to all 0s.

In order for the RESET input to be effective it must have a minimum duration of two machine cycles. In other words the high pulse must be high for a minimum of two machine cycles before it is allowed to go low.

EA:

The 8051 family members such as the 8751/52, 89C51/52 or DS89C4*0 all come with on chip ROM to store programs. In such cases the EA pin is connected to Vcc. For family

28

Page 29: Solar Tracking system

members such as the 8031 and 8032 in which there is no on chip ROM, code is stored on an external ROM and is fetched by 8031/32. Therefore for the 8031 the EA pin must be connected to GND to indicate that the code is stored externally. EA which stands for “external access” is pin number 31 in the DIP packages. It is an input pin and must be connected to either Vcc or GND. In other words it cannot be unconnected.

PSEN:

This is an output pin. PSEN stands for “program store enable”. In an 8031 based system in which an external ROM holds the program code, this pin is connected to the OE pin of the ROM.

ALE: ALE stands for “address latch enable. It is an output pin and is active high. When connecting an 8031 to external memory, port 0 provides both address and data. In other words the 8031 multiplexes address and data through port 0 to save pins. The ALE pin is used for de-multiplexing the address and data by connecting to G pin of the 74LS373 chip.

PORTS 0,1,2,3:

All the ports upon RESET are configured as input, since P0-P3 have value FFH on them. The following is a summary of features of P0-P3.

PORT 0:

Port 0 is also designated as AD0-AD7 allowing it to be used for both address and data. When connecting an 8051/31 to an external memory, port 0 provides both address and data. The 8051 multiplexes address and data through port 0 to save pins. ALE indicates if p0 has address A0-A7.in the 8051 based systems where there is no external memory connection the pins of P0 must be connected externally to 10k-ohm pull-up resistor. This is due to the fact that P0 is an open drain, unlike P1, P2 and P3. Open drain is a term used for MOS chips in the same way that open collector is used for TTL chips. In many systems using the 8751, 89c51 or DS89c4*0 chips we normally connect P0 to pull up resistors.

PORT 1, PORT 2:

In 8051 based systems with no external memory connection both P1 and P2 are used as simple I/O. however in 8031/51 based systems with external memory connections P2 must be used along with P0 to provide the 16-bit address for the external memory. P2 is also designated as A8-A15 indicating its dual function. Since an 8031/51 is capable of accessing 64k bytes of external memory it needs a path for the 16 bits of address. While P0 provides the lower 8 bits via A0-a7 it is the job P2 to provide bits A8-A15 of the address. In other words when the 8031/51 is connected to external memory P2 is used for the upper 8 bits of the 16 bit address and it cannot be used for I/O.

PORT 3:

Port 3 occupies a total of 8 pins 10 through 17. It can be used as input or output. P3 does not need any pull-up resistors the same as P1 and P2 did not. Although port 3 is configured as input port upon reset this is not the way it is most commonly used. Port 3 has the additional function of providing some extremely important signals such as interrupts.

29

Page 30: Solar Tracking system

Port 3 Alternate functions:

Table1.2

P3 Bit Function Pin

P3.0 RxD 10

P3.1 TxD 11

P3.2 INT0 12

P3.3 INT1 13

P3.4 T0 14

P3.5 T1 15

P3.6 WR 16

P3.7 RD 17

Difference between RAM and ROM

• RAM is used for data storage while ROM is used for program storage.

• Data of RAM can be changed during processing while data of ROM can’t

be changed during processing.

• We can take an example of calculator. If we want to perform addition of

two numbers then we type the two numbers in calculator, this is saved in

the RAM, but the Algorithms by which the calculation is performed is saved

in the ROM. Data which is given by us to calculator can be changed but the

algorithm or program by which calculation is performed can’t be changed.

30

Page 31: Solar Tracking system

PROGRAMMING MODEL

In programming model of 8051 we have different types of registers are available and te4hse

registers are used to store temporarily data is then the information could be a byte of data to

be processed or an address pointing to the data to be fetched the majority of registers is 8051

are 8-bikt registers.

a) ACCUMULATOR (REGISTER A):

Accumulator is a mathematical register where all the arithmetic and logical operations are

done is this register and after execution of instructions the outpour data is stored in the

register is bit addressable near. We can access any of the single bit of this register.

b) B REGISTER:

B register is same as that of accumulator of. It is also an 8 bit register and every bit of this is

accessible. This is also a mathematical register B which is used mostly for multiplication and

division.

c) PSW (PROGRAM STATUS WORD) Register:

Program status word register is an 8 bit register. It is also referred to as the flag register.

Although the PSW register is 8 bits wide, only 6 bits of it are used by the 8051. The unused

bits are user-definable flags. Four of the flags are called conditional flags, meaning that they

indicate some conditions that result after an instruction is executed. These four are CY

(carry), AC (auxiliary carry), P (parity) and OV (overflow).

Table.1.3

CY PSW.7 Carry Flag

AC PSW.6 Auxiliary

Carry Flag

F0 PSW.5 Available to

the user for

General

Purpose

RS1 PSW.4 Register

31

Page 32: Solar Tracking system

Bank

Selector Bit 1

RS0 PSW.3 Register

Bank

Selector Bit 0

OV PSW.2 Overflow

Flag

-- PSW.1 User

Definable Bit

P PSW.0 Parity Flag.

c) SP (STACK POINTER, ADDRESS 81H):

This is the stack pointer of the microcontroller. This SFR indicates where the next value to be taken from the stack will be read from in Internal RAM. If you push a value onto the stack, the value will be written to the address of SP + 1. That is to say, if SP holds the value 07h, a PUSH instruction will push the value onto the stack at address 08h. This SFR is modified by all instructions, which modify

The stack, such as PUSH, POP, LCALL, RET, RETI, and whenever interrupts are provoked by the microcontroller.

d) DPL/DPH (DATA POINTER LOW/HIGH, ADDRESSES 82H/83H):

The SFRs DPL and DPH work together to represent a 16-bit value called the Data Pointer.

The data pointer is used in operations regarding external RAM and some instructions

involving code memory. Since it is an unsigned two-byte integer value, it can represent

values from 0000h to FFFFh (0 through 65,535 decimal).

Two instructions which are used to start and terminate program.

• ORG → this instruction indicate the origin of program ORG 3000H

→ means program starts from 3000H loc

→ this instruction hasn’t take any memory space. It is used to show the

starting address of program.32

Page 33: Solar Tracking system

• END → this instruction show the END of program or it is used to terminate

the program.

9. DC MOTOR

Fig.1.15

PRINCIPLE OF OPERATION

In any electric motor, operation is based on simple electromagnetism. A current-carrying conductor generates a magnetic field; when this is then placed in an external magnetic field, it will experience a force proportional to the current in the conductor, and to the strength of the external magnetic field. As you are well aware of from playing with magnets as a kid, opposite (North and South) polarities attract, while like polarities (North and North, South and South) repel. The internal configuration of a DC motor is designed to harness the magnetic interaction between a current-carrying conductor and an external magnetic field to generate rotational motion.

10. ISOLATORS

Opto coupler (PC-817)

An isolator device to electrically insulate and isolate a separate component in a circuit board arrangement to allow for relatively fast and convenient diagnostic inspection of a circuit to locate failed components

In electronics, an opto-isolator, also called an optocoupler, photocoupler, or optical isolator, is "an electronic device designed to transfer electrical signals by utilizing light waves to provide coupling with electrical isolation between its input and output. The main purpose of an opto-isolator is "to prevent high voltages or rapidly changing voltages on one side of the circuit from damaging components or distorting transmissions on the other side

33

Page 34: Solar Tracking system

An opto-isolator contains a source (emitter) of light, almost always a near infrared light-emitting diode (LED), that converts electrical input signal into light, a closed optical channel (also called dielectrical channel[5]), and a photo sensor, which detects incoming light and either generates electric energy directly, or modulates electric current flowing from an external power supply. The sensor can be a photoresistor, a photodiode, a phototransistor. Pin diagram of PC 817 is shown below.

Fig.1.16

Working: - PC 817 is a 4 pin opto coupler as shown above. A series resistance of 470 ohm is used to limit the voltage across the diode. +5V power supply is connected to the first pin of IC, which is the anode pin diode. 2nd pin is connected to the port of microcontroller. When

34

Page 35: Solar Tracking system

the second pin is low then we get low output, when the input to 2nd pin high we get high voltage the output. Thus we isolate the voltage having the same logic level.

H-BRIDGE CIRCUIT

Fig.1.17

Working: - An H bridge is an electronic circuit which enables a voltage to be applied across a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards.

The term H Bridge is derived from the typical graphical representation of such a circuit. An H bridge is built with four switches (solid-state or mechanical).

35

Page 36: Solar Tracking system

When the switches S1 and S4 are closed (and S2 and S3 are open) a positive voltage will be applied across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this voltage is reversed, allowing reverse operation of the motor.

Using the nomenclature above, the switches S1 and S2 should never be closed at the same time, as this would cause a short circuit on the input voltage source. The same applies to the switches S3 and S4. This condition is known as shoot-through.

The two basic states of an H bridge

The H-bridge arrangement is generally used to reverse the polarity of the motor, but can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the motor's terminals are shorted, or to let the motor 'free run' to a stop, as the motor is effectively disconnected from the circuit.

OP-AMP Comparator Circuit Working

A comparator circuit compares two voltages and outputs either a 1 (the voltage at the plus side; VDD in the illustration) or a 0 (the voltage at the negative side) to indicate which is larger. Comparators are often used, for example, to check whether an input has reached some predetermined value. In most cases a comparator is implemented using a dedicated comparator IC, but op-amps may be used as an alternative. Comparator diagrams and op-amp diagrams use the same symbols.

Figure 4 shows a comparator circuit. Note first that the circuit does not use feedback. The circuit amplifies the voltage difference between Vin and VREF, and outputs the result at Vout. If Vin is greater than VREF, then voltage at Vout will rise to its positive saturation level; that is, to the voltage at the positive side. If Vin is lower than VREF, then Vout, will fall to its negative saturation level, equal to the voltage at the negative side.In practice, this circuit can be improved by incorporating a hysteresis voltage range to reduce

36

Page 37: Solar Tracking system

its sensitivity to noise. The circuit shown in Fig. 5, for example, will provide stable operation even when the Vin signal is somewhat noisy.

Fig.1.18

37

Page 38: Solar Tracking system

11. Program

ldr1 equ p1.0

ldr2 equ p1.1

mot1 equ p2.0

mot2 equ p2.1

org 00h

main:

jnb ldr1,act1

jnb ldr2,act2

clr mot1

clr mot2

call delay

call delay

jmp main

act1:

clr mot1

setb mot2

jmp main

38

Page 39: Solar Tracking system

act2:

setb mot1

clr mot2

jmp main

DELAY:

MOV R6,#255

AGAINR: MOV R7,#255

BACKR: NOP

NOP

NOP

NOP

NOP

NOP

DJNZ R7,BACKR

DJNZ R6,AGAINR

RET

end

39


Recommended