You are on page 1of 90

ABSTRACT The following document details the research and development of an Automatic Solarradiation tracker.

Fossil fuels are a relatively short-term energy source; consequently,the uses of alternative sources such as solar energy are becoming more wide spread.To make solar energy more viable, the efficiency of solar array systems must be maximized. A feasible approach to maximizing the efficiency of solar array systemsis sun tracking. Proposed in this report is a system that controls the movement of a solar array so that it is constantly aligned towards the direction of the sun.Solar modules are devices that cleanly convert sunlight into electricity and offer a practical solution to the problem of power generation in remote areas. The solartracker designed and constructed in this project offers a reliable and affordable method of aligning a solar module with the sun in order to maximize its energy output. Automatic Sun Tracking System is a hybrid hardware/software prototype, which automatically provides best alignment of solar panel with the sun, to get maximum output (electricity).

1. INTRODUCTION Renewable energy solutions are becoming increasingly popular.

Photovoltaic (solar)systems are but one example. Maximizing power output from a solar system is desirable to increase efficiency. In order to maximize power output from the solar panels, one needs to keep the panels aligned with the sun. As such, a means of tracking the sun is required. This is a far more cost effective solution than purchasing additional solar panels. It has been estimated that the yield from solar panels can be increased by 30 to 60 percent by utilizing a tracking system instead of a stationary array [1]. This project develops an automatic tracking system which will keep the solar panels aligned with the sun in order to maximize efficiency. This paper begins with presenting background theory in light sensors and stepper motorsas they apply to the project. The paper continues with specific design methodologiespertaining to photocells, stepper motors and drivers, microcontroller selection, voltage regulation, physical construction, and a software/system operation explanation. The paper concludes with a discussion of design results and future work.

2. Background Information This section presents background information on the main subsystems of the project. Specifically, this section discusses photocell and stepper motor theory in order to provide a better understanding as to how they relate to the solar tracker.

LDR

LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. Normally the resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but when they are illuminated with light resistance drops dramatically. LIGHT DEPENDENT RESISTOR

Time Photoconductor Constant Spectral Band

Cadmium Sulphide CdS

100 milli sec

0.47 to 0.72 um

Cadmium CdSe

Selenide 10 milli sec 0.6 to 0.77 um

Lead Sulphide PbS

410 micro sec

1 to 3.2 um

10.2 Lead Selenide PbSe sec

micro 1.52 to 4.2 um

Now when the device is dark, its resistance is called as dark resistance. This resistance is typically of the order of 1013 ohms. When light falls on it, its resistance decreases up to several kilo ohms or even hundreds of ohms, depending on the intensity of light, falling on it. The spectral response characteristics of two commercial cells were compared in our laboratory. And we found that there is almost no response to the radiation of a wavelength which was shorter than 300nm. It was very interesting to note that the

Cadmium Sulphide cell has a peak response nearer or within the green color of the spectrum within a range of 520nm. Thus it can be used nearer to the infra-red region up to 750nm. It was found that the maximum response ofCadmium Sulphoselenide is in the yellow-orange range at 615nm and also it can be used in the infra-red region up to about 970nm. 2.1 INTRODUCTION TO STEPPER MOTOR The stepper motor is an electromagnetic device that converts digital pulses into mechanical shaft rotation. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The sequence of the applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied. Many advantages are achieved using this kind of motors, such as higher simplicity, since no brushes or contacts are present, low cost, high reliability, high torque at low speeds, and high accuracy of motion. Many systems with stepper motors need to control the acceleration/ deceleration when changing the speed.

Bipolar v/s. Unipolar Stepper Motors The two common types of stepper motors are the bipolar motor and the unipolar motor. The bipolar and unipolar motors are similar, except that the unipolar has a center tap on each winding. The bipolar motor needs current to be driven in both directions through the windings, and a full bridge driver is needed .The center tap on the unipolar motor allows a simpler driving circuit, limiting the current flow to one direction. The main drawback with the unipolar motor is the limited capability to energize all windings at any time, resulting in a lower torque compared to the bipolar2.2 Bipolar v/s. Unipolar Stepper Motors The two common types of stepper motors are the bipolar motor and the unipolar motor. The bipolar and unipolar motors are similar, except that the

unipolar has a center tap on each winding. The bipolar motor needs current to be driven in both directions through the windings, and a full bridge driver is needed .The center tap on the unipolar motor allows a simpler driving circuit, limiting the current flow to one direction. The main drawback with the unipolar motor is the limited capability to energize all windings at any time, resulting in a lower torque compared to the bipola

STEPPER MOTOR CONNECTION DIAGRAM The wires from the Logic PCB connector to the stepper motor are as follows

STEPPER MOTOR DRIVER The ULN2003 / MC1413 is a 7-bit 50V 500mA TTL-input NPN darlington driver.This is more than adequate to control a four phase unipolar stepper motor such as the KP4M4-001.

It is recommended to connect a 12v zener diode between the power supply and VDD(Pin 9) on the chip, to absorb reverse (or "back") EMF from the magnetic field collapsing when motor coils are switched off.

It has been seen that out of the five wires two are grouped as common. The other four are the windings that have to give supply to. Major crux here is to identify the common line. Just take the multimeter and check the resistance between the

wires.Hold one wire a common and it must bear a resistance of 75 ohms with all the other wires then that is the common wire. 2.5 Connection of the Circuit:

Use Microcontroller PIC16F877A to give +5v supply to pins a,b,c,d one by one thats: a=5v,b=0,c=0,d=0 a=0,b=5v,c=0,d=0 a=0,b=0,c=5v,d=0 a=0,b=0,c=0,d=5v Then the motor will run.

2.6 Unipolar Stepper Motor: In the construction of unipolar stepper motor there are four coils. One end of each coil is tide together and it gives common terminal which is always connected with positive terminal of supply. The other ends of each coil are given for interface. Specific colour code may also be given. Like in this motor orange is first coil (L1), brown is second (L2), yellow is third (L3), black is fourth (L4) and red for common terminal. By means of controlling a stepper motor operation we can Increase or decrease the RPM (speed) of it Increase or decrease number of revolutions of it

Change its direction means rotate it clockwise or anticlockwise To vary the RPM of motor we have to vary the PRF (Pulse Repetition Frequency).Number of applied pulses will vary number of rotations and last to change direction we have to change pulse sequence. So, all these three things just depend on applied pulses. Now there are three different modes to rotate this motor 1. Single coil excitation 2. Double coil excitation 3. Half step excitation

In half step excitation mode motor will rotate at half the specified given step resolution. Means if step resolution is 1.8 degree then in this mode it will be 0.9 degree. Step resolution means on receiving on 1 pulse motor will rotate that muchdegree. If step resolution is 1.8 degree then it will take 200 pulses for motor to compete 1 revolution (360 degree). SPECIFICATION OF THE STEPPER MOTOR: Max rated current per coil: 0.75 Ampere, unipolar, 6 wires The motors rotation has several direct relationships to these applied input pulses. The sequence of the applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied. 2.7 STEPPER MOTOR ADVANTAGES AND DISADVANTAGES Advantages: 1. The rotation angle of the motor is proportional to the input pulse. 2. The motor has full torque at standstill (if the windings are energized) 3. Precise positioning and repeatability of movement since good stepper motors have an accuracy of 3 5% of a step and this error is non cumulative from one step to the next.

4. Excellent response to starting/ stopping/reversing. 5. Very reliable since there are no contact brushes in the motor. Therefore, the life of the motor is simply dependant on the life of the bearing. 6. The motors response to digital input pulses provides open-loop control, making the motor simpler and less costly to control. 7. It is possible to achieve very low speed synchronous rotation with a load that is directly coupled to the shaft. 8. A wide range of rotational speeds can be realized as the speed is proportional to the frequency of the input pulses. Disadvantages: 1. Resonances can occur if not properly controlled. 2. Not easy to operate at extremely high speeds. 2.8 Open Loop Operation One of the most significant advantages of a stepper motor is its ability to be accurately controlled in an open loop system. Open loop control means no feedback information about position is needed. This type of control eliminates the need for

expensive sensing and feedback devices such as optical encoders. Position of stepper motor is known simply by keeping track of the input step pulses. 2.9 Stepper Motor Types There are three basic stepper motor types. They are: Variable-reluctance Permanent-magnet Hybrid

2.9.1 Variable-reluctance (VR) This type of stepper motor has been around for a long time. It is probably the easiest to understand from a structural point of view. This type of motor consists of a soft iron multi-toothed rotor and a wound stator. When the stator windings are energized with DC current the poles become magnetized. Rotation occurs when the rotor teeth

are

attracted

to

the

energized

stator

poles.

2.9.2 Permanent Magnet (PM) Often referred to as a tin can or canstock motor the permanent magnet step motor is a low cost and low resolution type motor with typical step angles of 7.5 to 15. (48 24 steps/revolution) PM motors as the motor name implies have permanent magnets added to the motor structure. The rotor no longer has teeth as with the VR motor. Instead the rotor is magnetized with alternating north and south poles situated in a straight line parallel to the rotor shaft. These magnetized rotor poles provide an increased magnetic flux intensity and because of this the PM motor exhibits improved torque characteristics when compared with the VR type.

2.9.3 Hybrid (HB) The hybrid stepper motor is more expensive than the PM stepper motor but provides better performance with respect to step resolution, torque and speed. Typical step angles for the hybrid stepper motor, range from 3.6 to 0.9 (100 400 steps per revolution). The hybrid stepper motor combines the best features of both the PM and VR type stepper motors. The rotor is multi-toothed like the VR motor and contains an

axially magnetized concentric magnet around its shaft. The teeth on the rotor provide an even better path which helps guide the magnetic flux to preferred locations in the airgap. This further increases the detent, holding and dynamic torque characteristics of the motor when compared with both the VR and PM types.

2.10 Applications of Stepper Motor A stepper motor can be a good choice whenever controlled movement is required. They can be used to advantage in applications where you need to control rotation angle, speed, position and synchronism. Because of the inherent advantages listed previously, stepper motors have found their place in many different applications.

Some of these include printers, plotters, high end office equipment, hard disk drives, medical equipment, fax machines, automotive and many more.

2.11 The Rotating Magnetic Field

When a phase winding of a stepper motor is energized with current a magnetic flux is developed in the stator. The direction of this flux is determined by the Right Hand Rule which states: If the coil is grasped in the right hand with the fingers pointing in the direction of the current in the winding (the thumb is extended at a 90 angle to the fingers), then the thumb will point in the direction of the magnet ic field. The rotor then aligns

itself so that the flux opposition is minimized. In this case the motor would rotate clockwise so that its south pole aligns with the north pole of the stator and its north pole aligns withthe south pole of stator. To get the motor to rotate we must provide a sequence of energizing the stator windings in such a fashion that provides a rotating magnetic flux field which the rotor follows due to magnetic attraction.

2.12 Torque Generation The torque produced by a stepper motor depends on several factors: The step rate The drive current in the windings The drive design or type In a stepper motor a torque is developed when the magnetic fluxes of the rotor and stator are displaced from each other. The stator is made up of a high permeability magnetic material. The presence of this high permeability material causes the magnetic flux to be confined for the most part to the paths defined by the stator structure in the same fashion that currents are confined to the conductors of an electronic circuit. This serves to concentrate the flux at the stator poles. The torque

output produced by the motor is proportional to the intensity of the magnetic flux generated when the winding is energized. The basic relationship which defines the intensity of the magnetic flux is defined by: H = (N * i) / l Where: N = Number of winding turns i = Current H = Magnetic field intensity l = Magnetic flux path length This relationship shows that the magnetic flux intensity and consequently the torque is proportional to the number of winding turns and the current and inversely proportional to the length of the magnetic flux path. It has been seen that the same frame size stepper motor could have very different torque output capabilities simply by changing the winding parameters.

2.13 Phases, Poles and Stepping Angles Usually stepper motors have two phases, but three- and five-phase motors also exist. A bipolar motor with two phases has one winding/phase and a unipolar motor has one winding, with a center tap per phase. Sometimes the unipolar stepper motor is referred to as a four phase motor, even though it has only two phases. Motors that have two separate windings per phase also existthese can be driven in either bipolar or unipolar mode. A pole can be defined as one of the regions in a magnetized body where the magnetic flux density is concentrated. Both the rotor and the stator of a step motor have poles. In reality several more poles are added to both the rotor and stator structure in order to increase the number of steps per revolution of the motor, or in other words to provide a smaller basic (full step) stepping angle. The permanent magnet stepper motor contains an equal number of rotor and stator pole pairs. Typically the PM motor has 12 pole pairs. The stator has 12 pole pairs per phase. The hybrid type stepper motor has a rotor with teeth. The rotor is split into two parts, separated by a permanent magnet making half of the teeth south poles and half north poles. The number of pole pairs is equal to the number of teeth on one of the rotor halves. The stator of a hybrid

motor also has teeth to build up a higher number of equivalent poles (smaller pole itch, number of equivalent poles = 360/teeth pitch) compared to the main poles, on which the winding coils are wound. It is the relationship between the number of rotor poles and the equivalent stator poles, and the number the number of phases that determines the full-step angle of a stepper motor. Step Angle : The angle with which the stepper motor turns for a single pulse if supply to one wire or a pair is called step angle. N Ph N Stepangle

NPh = Number of equivalent poles per Phase = number of rotor poles Ph = Number of phases N = Total number of poles for all phases together If the rotor and stator tooth pitch is unequal, a more-complicated relationship exist

CHAPTER 2 AT89C51 Description The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4Kbytes of Flash programmable and erasable read only memory (PEROM). The deviceis manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pinout. The on-chipFlash allows the program memory to be reprogrammed in-system or by a conven-tional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.

Pin Configurations

Block Diagram

AT89C51 Application circuits

The AT89C51 provides the following standard features: 4Kbytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bittimer/counters, a five vector two-level interrupt architecture,a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logicfor operation down to zero frequency and supports twosoftware selectable power saving modes. The Idle Modestops the CPU while allowing the RAM, timer/counters,serial port and interrupt system to continue functioning. ThePower-down Mode saves the RAM contents but freezesthe oscillator disabling all other chip functions until the nexthardware reset.

Pin Description VCC Supply voltage. GND Ground. Port 0 Port 0 is an 8-bit open-drain bi-directional I/O port. As anoutput port, each pin can sink eight TTL inputs. When 1 sare written to port 0 pins, the pins can be used as high-impedance inputs.Port 0 may also be configured to be the multiplexed loworder address/data bus during accesses to external pro-gram and data memory. In this mode P0 has internal pullups.Port 0 also receives the code bytes during Flash program-ming, and outputs the code bytes during program verification. External pullups are required during program verification. Port 1 Port 1 is an 8-bit bi-directional I/O port with internal pullups.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 pullups 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

pullups. Port 1 also receives the low-order address bytes during Flash programming and verification. Port 2 Port 2 is an 8-bit bi-directional I/O port with internal pullups.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 pullups and can be used as inputs. As inputs, 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 isweakly pulled high. Setting the ALE-disable bit has noeffect if the microcontroller is in external execution mode. PSEN Program Store Enable is the read strobe to external pro-gram memory. When the AT89C51 is executing code from external pro-gram 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 inorder to enable the device to fetch code from external pro-gram memory locations starting at 0000H up to FFFFH.Note, however, that if lock bit 1 is programmed, EA will beinternally latched on reset. EA should be strapped to VCC for internal program executions.This pin also receives the 12-volt programming enable volt-age (VPP) during Flash programming, for parts that require 12-volt VPP. PSEN Program Store Enable is the read strobe to external program memory. When the AT89C51 is executing code from external pro-gram 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 inorder to enable the device to fetch code from external pro-gram memory locations starting at 0000H up to FFFFH.Note, however, that if lock bit 1 is programmed, EA will beinternally latched on reset. EA should be strapped to VCC for internal

programexecutions.This pin also receives the 12-volt programming enable volt-age (VPP) during Flash programming, for parts that require 12-volt VPP.

Flash Programming and Verification Characteristics T = 0C to 70C, V = 5.0 10%

ADC 3.6 Introduction to ADC The analog-to-digital (A/D) converter module can have up to eight analog inputs for adevice. The analog input charges a sample and hold capacitor. The output of the sample and hold capacitor is the input into the converter. The converter then generates a digital result of this analog level via successive approximat ion. This A/Dconversion, of the analog input signal, results in a corresponding 10-bit digital number. The analog reference voltages (positive and negative supply) are software selectable to either the devices supply voltages (AVDD, AVss) or the voltage level on the AN3/VREF+ and AN2/VREFpins. The A/D converter has a unique feature of being able to operate while the device is in SLEEP mode. DESCRIPTION The ADC0808, ADC0809 data acquisition component is a monolithic CMOS device with an 8-bit analog-to-digitalconverter, 8-channel multiplexer and microprocessor compatible control logic. The 8-bit A/D converter uses successive approximation as the conversion technique. The converter features a high impedance chopper stabilized comparator, a 256R voltage divider with analog switch tree and a successive approximation register.The 8-channel multiplexer can directly access any of 8-single-ended analog signals.The device eliminates the need

for external zero and full-scale adjustments. Easy interfacing to microprocessors is provided by the latched and decoded multiplexer address inputs and latched TTL TRI-STATE outputs.The design of the ADC0808, ADC0809 has been optimized by incorporating the most desirable aspects of several A/D conversion techniques. The ADC0808, ADC0809 offers high speed, high accuracy, minimal temperature dependence, excellent long-term accuracy and repeatability, and consumes minimal power.

These features make this device ideally suited to applications from process and machine control to consumer andautomotive applications. For 16-channel multiplexer with common output (sample/hold port) see ADC0816 datasheet. (SeeAN-247formore information.

BLOCK DIAGRAM

CONVERTER CHARACTERISTICS The Converter The heart of this single chip data acquisition system is its 8-bit analog-to-digital converter. The converter is designed to give fast, accurate, and repeatable conversions over a wide range of temperatures. The converter is partitioned into 3 major sections: the 256R ladder network, the successive approximation register, and the comparator. The converter's digital outputs are positive true.The 256R ladder network approach (Figure 3) was chosen over the conventional R/2R ladder because of its inherent monotonicity, which guarantees no missing digital codes. Monotonicity is particularly important in closed loop feedback control systems. A non-monotonic relationship can cause oscillations that will be catastrophic for the system. Additionally, the 256R network does not cause load variations on the reference voltage.The bottom resistor and the top resistor of the ladder network in Figure 3 are not the same value as the remainder of the network. The difference in these resistors causes the output characteristic to be symmetrical with the zero and full-scale points of the transfer curve. The first output transition occurs when the analog signalhas reached + LSB and succeeding output transitions occur every 1 LSB later up to full-scale.

The successive approximation register (SAR) performs 8 iterations to approximate the input voltage. For anySAR type converter, n-iterations are required for an n-bit converter. Figure 4 shows a typical example of a 3-bit converter. In the ADC0808, ADC0809, the approximation technique is extended to 8 bits using the 256Rnetwork. The A/D converter's successive approximation register (SAR) is reset on the positive edge of the start conversion start pulse. The conversion is begun on the falling edge of the start conversion pulse. A conversion in process will be interrupted by receipt of a new start conversion pulse. Continuous conversion may be accomplished by tying the end-of-conversion (EOC) output to the SC input. If used in this mode, an external start conversion pulse should be applied after power up. End-of-conversion will go low between 0 and 8 clock pulses after the rising edge of start conversion. The most important section of the A/D converter is the comparator. It is this section which is responsible for the ultimate accuracy of the entire converter. It is also the comparator drift which has the greatest influence on the repeatability of the device. A chopper-stabilized comparator provides the most effective method of satisfying all the converter requirements.

The chopper-stabilized comparator converts the DC input signal into an AC signal. This signal is then fed through a high gain AC amplifier and has the DC level restored. This technique limits the drift component of the amplifier since the drift is a DC component which is not passed by the AC amplifier. This makes the entire A/D converter extremely insensitive to temperature, long term drift and input offset errors.

TIMING DIAGRAM

OPERATION RATIOMETRIC CONVERSION The ADC0808, ADC0809 is designed as a complete Data Acquisition System (DAS) for ratiometric conversionsystems. In ratiometric systems, the physical variable being measured is expressed as a percentage of full-scalewhich is not necessarily related to an absolute standard. The voltage input to the ADC0808 is expressed by the equation VIN= Input voltage into the ADC0808 Vfs= Full-scale voltage VZ= Zero voltage DX= Data point being measured DMAX= Maximum data limit DMIN= Minimum data limit (1) A good example of a ratiometric transducer is a potentiometer used as a position sensor. The position of the wiper is directly proportional to the output voltage which is a ratio of the full-scale voltage across it. Since the data is represented as a

proportion of full-scale, reference requirements are greatly reduced, eliminating a large source of error and cost for many applications. A major advantage of the ADC 0808, ADC0809 is that the input voltage range is equal to the supply range so the transducers can be connected directly across the supply and their outputs connected directly into the multiplexer inputs, (Figure 11).Ratiometric transducers such as potentiometers, strain gauges, thermistor bridges, pressure transducers, etc.,are suitable for measuring proportional relation ships; however, many types of measurements must be referred to an absolute standard such as voltage or current. This means a system reference must be used which relates the full-scale voltage to the standard volt. For example, if VCC=VREF=5.12V, then the full-scale range is divided into 256 standard steps. The smallest standard step is 1 LSB which is then 20 mV. RESISTOR LADDER LIMITATIONS The voltages from the resistor ladder are compared to the selected into 8 times in a conversion. These voltages are coupled to the comparator via an analog switch tree which is referenced to the supply. The voltages at the top, center and bottom of the ladder must be controlled to maintain proper operation.The top of the ladder, Ref(+), should not be more positive than the supply, and the bottom of the ladder, Ref(), should not be more negative than ground. The center of the ladder voltage must also be near the center of the supply because the analog switch tree changes

from N-channel switches to P-channel switches. These limitations are automatically satisfied in ratiometric systems and can be easily met in ground referenced systems.Figure 12 shows a ground referenced system with a separate supply and reference. In this system, the supply must be trimmed to match the reference voltage. For instance, if a 5.12V is used, the supply should be adjusted to the same voltage within 0.1V.

The ADC0808 needs less than a milliamp of supply current so developing the supply from the reference is readily accomplished. In Figure 13 a ground referenced system is shown which generates the supply from the reference. The buffer shown can be an op amp of sufficient drive to supply the milliamp of supply current and the desired bus drive, or if a capacitive bus is driven by the outputs a large capacitor will supply the transient supply current as seen in Figure 14. The LM301 is over compensated to insure stability when loaded by the 10 F output capacitor.The top and bottom ladder voltages cannot exceed VCC and ground, respectively, but they can be symmetrically less than VCC and greater than ground. The center of the

ladder voltage should always be near the center of the supply. The sensitivity of the converter can be increased, (i.e., size of the LSB steps decreased) by using a symmetrical reference system. In Figure 15, a 2.5V reference is symmetrically centered about VCC/2 since the same current flows in identical resistors. This system with a 2.5V reference allows the LSB bit to be half the size of a 5V reference system.

CONVERTER EQUATIONS The transition between adjacent codes N and N+1 is given by: The center of an output code N is given by: The output code N for an arbitrary input are the integers within the range: Where: VIN=Voltage at comparator input VREF(+)=Voltage at Ref(+) VREF()=Voltage at Ref() VTUE=Total unadjusted error voltage (typically VREF(+)512) LCD 4.6 LCD LCD is used in our proposed scheme to display the values of in-circuit current. Forsimulation purpose, we can use LCD in a 4-bit Mode. For that, we require only fourd ata lines to be connected to the four port pins of PIC and three control signals to control the data flow and display.

LCD Pin Diagram:

BCM LCD Module Precautions in use of LCD Modules 2.1. Avoid applying excessive shocks to the module or making any alterations or modifications to it. 2.2. Dont make extra holes on the printed circuit board, modify its shape or change the components of LCD module. 2.3. Dont disassemble the LCD module. 2.4. Dont operate it above the absolute maximum rating.

2.5. Dont drop, bend or twist LCD. 2.6. Soldering: only to the I/O terminals. 2.7. Please storage in anti-static electricity container and clean environment.

3. General Specification

4. Absolute Maximum Rating

4. Electrical Characteristics

7. Interface Pin Function

8. Contour Drawing and Block Diagram

11. Instruction Table

12. Timing Characteristic

2.1 Write Mode Timing Diagram

12.2 Read Mode Timing Diagram

SOLAR TRACKER BLOCK DIAGRAM

CIRCUIT DIAGRAM

WORKING

LDR

A D C

DISPLAY

89C51 MC
MOTOR (Drine)

LDR

Stepper Motor

The above fighure shows that they are 2 Light Depending Resistance (LDR) are place in the solar panal with diagonal shape. The LDR is produced the intensity is goes to infinity then the intensity is move to ADC. The ADC is converted to the intensity and give them 89C51MC IC . The out put of the intensity to be display with the help of 16/2 LCD display.At the same time Micro contol to get the intensity to transffered stepper motor that intensity is used to the base of stepper motor is rotate it is helped to equal intensity comes on the LDR.

PROGRAM RS EN START1 EOC ADD_A ADD_B ADD_C ALE BUZZER EQU EQU EQU EQU EQU P2.4 P2.5 P2.6 P2.7 20H 21H EQU EQU EQU EQU P1.4 P1.5 P1.6 P1.7 P0.5 P0.4 P1.2 P1.3

INCREMENT EQU DECREMENT EQU MENU_BUTTON EQU TRESOLD SENSE1 EQU EQU

SENSE2

EQU EQU

22H 23H 24H

DIFFERENCE

STEPPER_DIRECTION EQU

;--------------------------------------------------------------------------

ORG 00H sJMP MAIN ORG 30H ;----------------------------------------------------------------------------

MAIN:

CLR BUZZER MOV A,#0H ANL A,#0FH ANL P2,#0F0H

ORL P2,A ACALL LCD_INIT ;INITIALIZE LCD MOV SP,#10H MOV TRESOLD,#5H MOV DIFFERENCE,#0H CLR STEPPER_DIRECTION MOV SENSE1,#0H MOV SENSE2,#0H ACALL INIT_MSG PROJECT DETAILS mov r0,#3h acall buz MOV A,#01H ACALL CMD ACALL THRESOLD_SET ;DISPLAY

;{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ {{{{{{{{{{{{{{{{

RUNNING:

ACALL ADC_READ ACALL DISP_SENSOR ACALL COMPARISON ACALL DISP_DIFFERENCE ACALL TRESOLD_CHK JB MENU_BUTTON,KJ mov r0,#2h acall buz ACALL THRESOLD_SET

KJ: GH:

JB INCREMENT,JK LCALL RIGHT JNB INCREMENT,GH

JK: HG:

JB DECREMENT,RUNNING LCALL LEFT JNB DECREMENT,HG SJMP RUNNING

;------------------------------------------------------------------------------INIT_MSG: ACALL LCD_INIT MOV DPTR,#MESSAGE1 ACALL DATA_DISPLAY MOV A,#0C0H ACALL CMD MOV DPTR,#MESSAGE2 ACALL DATA_DISPLAY ACALL DELAY1

MOV A,#01H ACALL CMD MOV DPTR,#MESSAGE3 ACALL DATA_DISPLAY MOV A,#0C0H ACALL CMD MOV DPTR,#MESSAGE4 ACALL DATA_DISPLAY ACALL DELAY1 RET ;----------------------------------------------------------------------------; LCD

;-----------------------------------------------------------------------------LCD_INIT: MOV DPTR,#MYCOMMAND

C1:

CLR A MOVC A,@A+DPTR JZ DATA_DISPLAY ACALL CMD INC DPTR SJMP C1

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""" DATA_DISPLAY: D1: PUSH ACC CLR A MOVC A,@A+DPTR JZ EXIT ACALL DAT INC DPTR SJMP D1 ;><><><><><><><><><><><><><

CMD: CLR RS ACALL LO RET ;><><><><><><><><><><><><>< DAT: SETB RS ACALL LO RET ;><><><><><><><><><><><><>< DELAY: HERE0: HERE: MOV R3,#10H MOV R4,#60H DJNZ R4,HERE DJNZ R3,HERE0 RET

;><><><><><><><><><><><><>< DELAY1: MOV R5,#20 MOV R3,#255 HERE01: HERE1: MOV R4,#255 DJNZ R4,HERE1 DJNZ R3,HERE01 DJNZ R5,HERE01 RET ;><><><><><><><><><><><><>< DELAY2: MOV R5,#5 MOV R3,#50 HERE011: MOTOR HERE11: DJNZ R4,HERE11 DJNZ R3,HERE011 DJNZ R5,HERE011 MOV R4,#200 ;FOR STEPPER

RET ;><><><><><><><><><><><><>< EXIT: POP ACC RET LO: ;><><><><><><><><><><><><>< ;8-BIT CODE

IS SPLIT INTO TWO 4-BIT NIBBLES. MOV R7,A ANL A,#0F0H SWAP A ANL P0,#0F0H ORL P0,A CALL ENABLE MOV A,R7 ANL A,#0FH ANL P0,#0F0H ORL P0,A

CALL ENABLE RET ENABLE: ;><><><><><><><><><><><><>< ;GIVE

HIGH-TO-LOW PULSE AT ENABLE PIN SETB EN CALL DELAY CLR EN RET ;><><><><><><><><><><><><>< ;-----------------------------------------------------------------------------;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""" ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""

THRESOLD_SET:push acc SETB BUZZER JNB MENU_BUTTON,$ CLR BUZZER MOV A,#01H ACALL CMD MOV DPTR,#TRSLD ACALL DATA_DISPLAY MOV A,#0C5H ACALL CMD MOV A,TRESOLD LCALL H2D ACALL DISP_VAL ;><><><><><><><><><><><><>< KEY1: PUSH ACC

MOV A,#0C5H ACALL CMD POP ACC JB INCREMENT,CHK3 setb buzzer INC A CJNE A,#251D,OK3 MOV A,#1 ;><><><><><><><><><><><><>< OK3: JNB INCREMENT,$ clr buzzer LCALL H2D ACALL DISP_VAL SJMP KEY1 ;><><><><><><><><><><><><><

CHK3:

JB DECREMENT,CHK4 setb buzzer DEC A CJNE A,#0,OK4 MOV A,#250 ;><><><><><><><><><><><><><

OK4:

JNB DECREMENT,$ clr buzzer LCALL H2D ACALL DISP_VAL SJMP KEY1 ;><><><><><><><><><><><><><

CHK4:

JB MENU_BUTTON,KEY1 SETB BUZZER JNB MENU_BUTTON,$

ACALL DELAY CLR BUZZER MOV TRESOLD,A pop acc mov r0,#5 acall buz MOV A,#01H ACALL CMD aJMP RUNNING

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""" H2D:PUSH ACC MOV 0F0H,#100D DIV AB MOV 60H,A

MOV A,0F0H MOV 0F0H,#10D DIV AB MOV 61H,A MOV A,0F0H MOV 62H,A POP ACC RET ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""" DISP_VAL: PUSH ACC MOV A,60H MOV DPTR,#ASCII MOVC A,@A+DPTR ACALL DAT ;DISPLAY 8-BIT DECIMAL VALUE

MOV A,61H MOVC A,@A+DPTR ACALL DAT MOV A,62H MOVC A,@A+DPTR ACALL DAT POP ACC RET ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""" ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""" ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""" ADC_READ: SETB ADD_A SETB ADD_B CLR ADD_C

CLR A SETB EOC SETB ALE NOP SETB START1 ACALL ADCDELAY CLR ALE

CLR START1

JB EOC,$ JNB EOC,$ ACALL ADCDELAY MOV A,P3 MOV SENSE1,A ACALL ADCDELAY ;><><><><><><><><><><><><>< CLR ADD_A CLR ADD_B SETB ADD_C

CLR A SETB EOC

SETB ALE NOP SETB START1 ACALL ADCDELAY CLR ALE CLR START1 JB EOC,$ JNB EOC,$ ACALL ADCDELAY MOV A,P3 MOV SENSE2,A mov a,#0f8h mov p1,a RET ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""

ADCDELAY:

MOV R5,#150 DJNZ R5,$ RET

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""' COMPARISON: MOV A,SENSE1 CJNE A,SENSE2,COMPARE MOV DIFFERENCE,#0 MOV DPTR,#MPPT MOV A,#0C3H ACALL CMD ACALL DATA_DISPLAY SJMP EXIT1 ;><><><><><><><><><><><><>< COMPARE:JNC BIG_SENSE1 MOV A,SENSE2

INC A SUBB A,SENSE1 MOV DIFFERENCE,A CLR STEPPER_DIRECTION IS GREATER SJMP EXIT1 ;><><><><><><><><><><><><>< BIG_SENSE1: MOV A,SENSE1 SUBB A,SENSE2 MOV DIFFERENCE,A SETB STEPPER_DIRECTION IS GREATER EXIT1: RET ;IF SENSOR 1 VALUE ;IF SENSOR 2 VALUE

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""

DISP_SENSOR: MOV A,#01 ACALL CMD MOV DPTR,#S1 ACALL DATA_DISPLAY MOV A,SENSE1 ACALL H2D ACALL DISP_VAL MOV A,#0C0H ACALL CMD MOV DPTR,#S2 ACALL DATA_DISPLAY MOV A,SENSE2 ACALL H2D ACALL DISP_VAL ACALL DELAY1

MOV A,#01 ACALL CMD RET ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""" DISP_DIFFERENCE:MOV DPTR,#DIFF MOV A,#80H ACALL CMD ACALL DATA_DISPLAY MOV A,DIFFERENCE LCALL H2D ACALL DISP_VAL ACALL DELAY1 MOV A,#01 ACALL CMD RET

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""" TRESOLD_CHK: MOV A,TRESOLD CLR C CJNE A,DIFFERENCE,STEPPER_CHK SJMP EXITT STEPPER_CHK: JNC EXITT MOV DPTR,#MESSAGE2 MOV A,#80H ACALL CMD ACALL DATA_DISPLAY MOV DPTR,#MPPT1 MOV A,#0C4H ACALL CMD ACALL DATA_DISPLAY JNB STEPPER_DIRECTION,RIGHT

;><><><><><><><><><><><><>< LEFT: MOV A,#66H MOV R2,#10 OF ROTATION STEP: RL A PUSH ACC ANL A,#0FH ANL P2,#0F0H ORL P2,A POP ACC ACALL DELAY2 DJNZ R2,STEP MOV A,#0H ANL A,#0FH ANL P2,#0F0H ORL P2,A ;;;CHANGE FOR NUMBER

SJMP EXITT ;><><><><><><><><><><><><>< RIGHT: MOV A,#66H MOV R2,#10 OF ROTATION STEP1: RR A PUSH ACC ANL A,#0FH ANL P2,#0F0H ORL P2,A POP ACC ACALL DELAY2 DJNZ R2,STEP1 MOV A,#0H ANL A,#0FH ANL P2,#0F0H ;;;CHANGE FOR NUMBER

ORL P2,A EXITT: MOV A,#01 ACALL CMD RET ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"" buz:setb buzzer acall delay2 clr buzzer acall delay2 djnz r0,buz ret ;;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"" MYCOMMAND: CODE0: DB DB 02H,28H,0CH,06H,01H,0 50H,53H,56H,59H

CODE1: CODE2: MESSAGE1: MESSAGE2: MESSAGE3: MESSAGE4: TRSLD: S1: S2: DIFF: MPPT: MPPT1: DB DB

DB DB DB DB DB DB DB "

51H,54H,57H,60H 52H,55H,58H,61H SOLAR",0

"TRACKING SYSTEM",0 " PRESENTED BY ",0 " ",0 "THRESHOLD LIMIT:",0 "SENSOR 1 : ",0 "SENSOR 2 : ",0

DB DB DB

"DIFFERENCE :",0 "MPPT MODE",0 "FOR MPPT",0

;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""" ASCII: ;ASCII LOOKUP TABLE

DB

30H,31H,32H,33H,34H,35H,36H,37H,38H,39H

END

APPLICATIONS The Solar Tracking System has the following applications: The Solar Tracking system can be utilized for tracking the sun and thus pointing the solar panel at the point of maximum solar intensity. It can also be utilized for automatic switching ON/OFF the street lights by mounting it over a street lights and switch ON whenever the solar goes below a threshold value as dictated by the program. It can also be employed with Stirling engine. something like that. ater heater or intensity

CONCLUSION In this thesis, the sun tracking system was implemented which is based onmicrocontroller. After examining the informat ion obtained in the data analysissection, it can be said that the proposed sun tracking solar array system is a feasiblemethod of maximizing the energy received from solar radiation. The controller circuitused to implement this system has been designed with a minimal number ofcomponents and has been integrated onto a single PCB for simple assembly. The useof stepper motors enables accurate tracking of the sun while keeping track of thearray's current position in relation to its initial position. The automatic solar radiation tracker is an efficient system for solar energy collection.It has been shown that the sun tracking systems can collect about 8% more energythan what a fixed panel system collects and thus high efficiency is achieved throughthis tracker.8% increase in efficiency is not the most significant figure; it can be more prominentin concentrating type reflectors.

You might also like