wk 234
-
Upload
bhargav-cho-chweet -
Category
Documents
-
view
184 -
download
1
Transcript of wk 234
Improved Structure of Solar Tracker to power up
household Appliances
The Design and Implementation of a Solar Tracking Generating Power System
1
IndexTechnical Specifications --- 4
IEEE Reference Citation --- 5
Project Abstract --- 7
Project Block Diagram --- 9
Introduction --- 11
Solar Cell Description --- 13
Flowchart --- 16
Explanation of each block --- 18
AT89S52 Microcontroller --- 23
LCD Interfacing --- 34
Regulated Power Supply --- 39
DC Motor Interfacing --- 45
Stepper Motor Interfacing --- 53
Software Tools --- 55
Keil Compiler --- 54
Proload Flash --- 55
Source Code --- 58
Advantages --- 70
Applications --- 62
Conclusion --- 74
Reference --- 76
The Design and Implementation of a Solar Tracking Generating Power System
2
Tables & Diagrams
Block Diagram --- 10
Flowchart --- 17
Block Diagram of 89S52 --- 24
MCU Flash Circuit --- 32
Modes of flash programming --- 31
16X2 LCD Pin Diagram --- 36
LCD Pin Discretion --- 37
Block Diagram of Power Supply --- 41
The Design and Implementation of a Solar Tracking Generating Power System
3
Technical Specifications
Title of the project : The Design and Implementation of maximum
Power Tracking System by automatic control of
Solar panel direction according to the sun direction
(Model Sunflower)
Domain : Renewable Energy Management, Embedded
Design, Energy System
Software : Embedded C, Keil, Proload
Microcontroller : AT89S52
Power Supply : +5V, 750mA Regulated Power Supply
Display : 16 X 2 Alphanumeric LCD
Crystal : 11.0592MHz
Applications : Emergency lighting, water heaters, Hotels,
Hostels and House hold applications and
industrial applications
Developed By : M/S Wine Yard Technologies
Phone : 040-6464 6363
Website : www.WineYardProjects.com
The Design and Implementation of a Solar Tracking Generating Power System
4
IEEE Reference
The Design and Implementation of a Solar Tracking Generating Power System
5
Design and Implementation of Maximum Power Tracking System by
Automatic control of Solar Panel Direction according to the Sun
Direction (Model Sun Flower)
IEEE Reference:
A microprocessor controlled automatic sun tracker
Koyuncu, B.; Balasubramanian, K.
Consumer Electronics, IEEE Transactions on
Volume 37, Issue 4, Nov 1991 Page(s):913 - 917
Digital Object Identifier 10.1109/30.106958
Summary:
A microprocessor-based automatic sun-tracking system is proposed. This unit
controls the movement of a solar panel that rotates and follows the motion of the sun.
There are two limit switches attached to the panel to mark its maximum angular positions
in the east and west. The status of the limit switches is read by the microprocessor and
indicates that the maximum angular position in either direction has been reached and the
panel should not be driven any further. As the plane of the panel is always kept normal to
the direction of the sun, maximum thermal energy is obtained from the solar panels
The Design and Implementation of a Solar Tracking Generating Power System
6
Abstract
The Design and Implementation of a Solar Tracking Generating Power System
7
Abstract
Solar energy systems have emerged as a viable source of
renewable energy over the past two or three decades, and are now
widely used for a variety of industrial and domestic applications. Such
systems are based on a solar collector, designed to collect the sun’s
energy and to convert it into either electrical power or thermal energy.
In general, the power developed in such applications depends
fundamentally upon the amount of solar energy captured by the
collector, and thus the problem of developing tracking schemes
capable of following the trajectory of the sun throughout the course of
the day on a year-round basis has received significant coverage in this
project.
In Aden city (Yemen), the improvement in the performance of a
solar cooker during summer was found to be as much as 40% for
higher elevation angle and 70% for lower elevation angle, based on the
developed tracking algorithms. Moreover, it was shown that the
amount of solar energy captured by a tilted collector could be
increased by more than 40% by adjusting the tilt angle on a seasonal
basis.
This project is designed with AT89S52 MCU. Depending upon the light
falls on LDR the data will be read by the Microcontroller and the
direction of the motor will be changed. With this direction the Solar
plates which are fixed to the stand will also rotates to gain the
maximum sun rays.
The Design and Implementation of a Solar Tracking Generating Power System
8
This project uses regulated 12V, 500mA power supply. 7805 three terminal voltage
regulator is used for voltage regulation. Bridge type full wave rectifier is used to rectify
the ac out put of secondary of 230/12V step down transformer.
Block Diagram
The Design and Implementation of a Solar Tracking Generating Power System
9
The Design and Implementation of a Solar Tracking Generating Power System
10
Power supply to all sections
Step down T/F
Bridge Rectifier
Filter Circuit Regulator
AT89S52
Transistor Switching
Circuit
16 X 2 LCD
H BridgeDriver
DCMotor
Contrast Control
CrystalReset
High Sensitive
LDR
Transistor Switching
Circuit
High Sensitive
LDR
Mechanical Coupling to Solar Panel
Solar PanelSolar Panel Lead Acid Battery
Lead Acid Battery
InverterInverterHome
Appliances Bulb
Home Appliances
Bulb
IntroductionIntroduction
The Design and Implementation of a Solar Tracking Generating Power System
11
IntroductionIntroductionThe green energy also called the regeneration energy, has gained much attention
nowadays. Green energy can be recycled, much like solar energy, water power, wind
power, biomass energy, terrestrial heat, temperature difference of sea, sea waves,
morning and evening tides, etc [1, 2]. Among these, solar energy is the most powerful
resource that can be used to generate power. So far the efficiency of generating power
from solar energy is relatively low. Thus, increasing the efficiency of generating power
of solar energy is very important. In the past, solar cells have been hooked with fixed
elevating angles. They do not track the sun and therefore, the efficiency of power
generation is low. For example, the elevating angle of a solar cell for the largest volume
of illumination in daytime is 23.5°in southern Taiwan. Since the fixed-type solar panel
can not obtain the optimal solar energy, the transformation efficiency of solar energy is
limited.
Many scholars have proposed different methods for tracking the sun [3-9]. Many
different light source sensors, light intensity sensors, intelligent vision techniques, and
CCD equipments were applied to compute the absorbed time of the sun radiation in
everyday for measuring the volume of solar energy. So far the majority of solar cell
panels worldwide are hooked with fixed angles. Thus, it is clear that the method of
tracking the sun is a technique worthy of being developed. In this paper, the main goal is
to design and implement a solar tracking control system using field programmable gate
array (FPGA). The CdS light sensitive resistors are used. From the experimental results,
the proposed tracking system is verified more efficiently in generating energy than the
fixed system.
The Design and Implementation of a Solar Tracking Generating Power System
12
SSOLAR OLAR CCELL ELL DDESCRIPTIONESCRIPTION
The Design and Implementation of a Solar Tracking Generating Power System
13
The solar cell is composed of the semiconductors of the P-N junctions [10-11]. It can
convert light into electric energy. Therefore we can assume that electricity produced
using sunlight shining on the solar cell can be used like common electricity. The
equivalent circuit of the solar cell is shown in Fig. 1. The current supply I ph represents
the electric current generated from the sun beaming on the solar cell. Rj is the non-linear
impedance of the P-N junction. Dj is a P-N junction diode, Rsh and Rs represent the
equivalent lineup with the interior of the materials and connecting resistances in series.
Usually in general analysis, Rsh is large, and the value of Rs is small. Therefore in order
to simplify the process of analysis, one can ignore Rsh and Rs . The symbol Ro represents
the external load. I and V represent the output current and the voltage of the solar cell,
respectively. From the equivalent circuit, and based on the characteristics of the P-N
junction, (1) presents the connection between the output current I and the output voltage
V :
Where np represents the parallel integer of the solar cell; ns represents the series
connected integer of the solar cell; q represents the contained electricity in an electro
(1.6×10−19 Columbic); k is the Boltzmann constant (1.38×10−23 J / °K ); T is the
temperature of the solar cell (absolute temperature °K ); and A is the ideal factor of the
solar cell ( A = 1 ~ 5 ). The current sat I in (1) represents the reversion saturation current
of the solar power. Further, sat I can be determined by using the following formula:
The Design and Implementation of a Solar Tracking Generating Power System
14
Where Tr represents the reference temperature of the solar cell; Irr is the reversion
saturation current at the time when the solar cell reaches its temperature Tr ; and EGap is
the energy needed for crossing the energy band gap for the semiconductor materials. (the
crystalline EGap ≅ 1.1eV ). From the study we are able to know that when the
temperature is fixed, the stronger the sunlight is, and the higher the open-circuit voltage
and short-circuit current are. Here we can see the obvious effects of illumination on the
short-circuit current, rather than the open-circuit current. Therefore the solar cell can
provide higher output rate as the sunlight becomes stronger, i.e. solar cell facing the sun.
The Design and Implementation of a Solar Tracking Generating Power System
15
MCUMCU
Flow Chart
The Design and Implementation of a Solar Tracking Generating Power System
16
The Design and Implementation of a Solar Tracking Generating Power System
17
MCU sends a stop signal to motor
Explanation of Each BlockExplanation of Each Block
The Design and Implementation of a Solar Tracking Generating Power System
18
AT89S52 MCU:
AT89S52 is 8-bit microcontroller from Atmel Semiconductors. This comes into
8051 family microcontroller. This is the heart of the project. The complete control logic
program is stored in this microcontroller. It sends and receives control and data signals to
LCD, Stepper motor and to the other Devices based on the program logic.
Solar Panel:
This is a photo voltaic cell. This converts light energy into electrical energy. The
output voltage of the solar panel depends on the amount of light falling on the panel.
Voltage Sampling Circuit:
The output voltage of the solar panel is given to voltage sampling circuit. This is a
voltage divide network. The sample voltage is given to Analog to Digital converter
circuit.
High Sensitivity LDR
This is a light dependent resistor. The resistance of the device is inversely
proportional to the amount of light falling on its surface. This is used to detect the day –
night mode.
Transistor Switching Circuit
In this section a NPN transistor is used as a switch. The transistor is driven into
saturation and cut off region based on the output voltage of the LDR. This sends a logic
HIGH or LOW signal to microcontroller.
The Design and Implementation of a Solar Tracking Generating Power System
19
H-BRIDGE:
An H-bridge is an electronic circuit which enables DC electric motors to be run
forwards or backwards. These circuits are often used in robotics. H-bridges are available
as integrated circuits, or can be built from discrete components.
DC Motor
The DC motor is used to rotate the solar panel. The DC motor makes actual and
exact number of turns or degrees of rotation instructed by the microcontroller.
16X2 LCD:
16 X 2 LCD is used to display the operating instructions and status of the output.
HD44780U is used in the project. The HD44780U dot-matrix liquid crystal display
controller and driver LSI displays alphanumeric, Japanese kana characters, and symbols.
It can be configured to drive a dot-matrix liquid crystal display under the control of a 4-
or 8-bit microprocessor. Since all the functions such as display RAM, character
generator, and liquid crystal driver, required for driving a dot-matrix liquid crystal
display are internally provided on one chip, a minimal system can be interfaced with this
The Design and Implementation of a Solar Tracking Generating Power System
20
controller/driver. A single HD44780U can display up to one 8-character line or two 8-
character lines. The HD44780U has pin function compatibility with the HD44780S which
allows the user to easily replace an LCD-II with an HD44780U. The HD44780U
character generator ROM is extended to generate 208 5X8 dot character fonts and 32
5X10 dot character fonts for a total of 240 different character fonts.
Contrast Control:
It is a simple variable resistor (preset) with linear characteristics. This is used to adjust
the contrast of the display.
The Design and Implementation of a Solar Tracking Generating Power System
21
Reset:
Reset control circuit is used to reset the microcontroller at any stage of work. This
section also comprises of auto power on reset. If the reset switch is pressed, the
microcontroller restarts and the function will start from the begin. This circuit is
connected to 9th pin of microcontroller.
Crystal:
A crystal is used to supply clock frequency to the microcontroller. The clock
frequency is 11.0592MHz. 11.0592 MHz crystals are often used because it can be
divided to give you exact clock rates for most of the common baud rates for the
UART, especially for the higher speeds (9600, 19200). Despite the "oddball" value, these
crystals are readily available and commonly used.
Power Supply Section:
This project needs 5V regulated DC power supply. This power supply is built
with a full wave bridge rectifier, C- filter and a three terminal voltage regulator. An LED
is provided for visual identification of the power supply. 230V / 18V step down
transformer is used to step down the AC 230 V to 18V AC.
Fig13: Power supply
The Design and Implementation of a Solar Tracking Generating Power System
22
RegulatorFilterBridge Rectifier
Step down transformer
230V AC 50Hz
D.C Output
AT89S52 Microcontroller
The Design and Implementation of a Solar Tracking Generating Power System
23
Description
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller
with 8K bytes of in-system programmable Flash memory. The device is manufactured
using Atmel’s high-density nonvolatile memory technology and is compatible with the
indus-try-standard 89S52 instruction set and pinout.
The on-chip Flash allows the program memory to be reprogrammed in-system or
by a conventional nonvolatile memory pro-grammer. 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 con-tents but freezes the oscillator, disabling all other chip functions until the next
interrupt or hardware reset.
The Design and Implementation of a Solar Tracking Generating Power System
24
Pin Configuration
The Design and Implementation of a Solar Tracking Generating Power System
25
Block Diagram
The Design and Implementation of a Solar Tracking Generating Power System
26
Pin Description
Port 0 :
Port 0 is an 8-bit open drain bidirectional 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 dur-ing program verification. External pull-ups are required
during program verification.
Port 1:
Port 1 is an 8-bit bidirectional 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 inter-nal 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 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, as shown
in the follow-ing table. Port 1 also receives the low-order address bytes during Flash
programming and verification.
The Design and Implementation of a Solar Tracking Generating Power System
27
Port 2
Port 2 is an 8-bit bidirectional 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 inter-nal pull-ups and can be used as inputs. As inputs, Port 2 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory
and dur-ing accesses to external data memory that use 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 use 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 bidirectional 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 inter-nal pull-ups and can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current (IIL) because of the pull-ups. Port 3
receives some control signals for Flash programming and verification. Port 3 also serves
the functions of various special features of the AT89S52, as shown in the fol-lowing
table.
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to
disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is
enabled.
ALE/PROG:
Address Latch Enable (ALE) 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
The Design and Implementation of a Solar Tracking Generating Power System
28
(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. Note, however, that one ALE pulse is skipped dur-ing 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 (PSEN) is the read strobe to external program memory.
When the AT89S52 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 exter-nal data memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up to
FFFFH. Note, however, that 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 12-volt programming enable voltage (VPP) during Flash programming.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2 :
Output from the inverting oscillator amplifier.
The Design and Implementation of a Solar Tracking Generating Power System
29
PROGRAMMING THE FLASH:
The AT89S52 is normally shipped with the on-chip Flash memory array in the
erased state (that is, contents = FFH) and ready to be programmed. The programming
interface accepts either a high-voltage (12-volt) or a low-voltage (VCC) program enable
signal. The low-voltage programming mode provides a convenient way to program the
AT89S52 inside the user’s system, while the high-voltage programming mode is
compatible with conventional third party Flash or EPROM programmers. The AT89S52
is shipped with either the high-voltage or low-voltage programming mode enabled. The
respective top-side marking and device signature codes are listed in the following table.
The AT89S52 code memory array is programmed byte-byte in either
programming mode. To program any nonblank byte in the on-chip Flash Memory, the
entire memory must be erased using the Chip Erase Mode.
Programming Algorithm:
Before programming the AT89S52, the address, data and control signals should
be set up according to the Flash programming mode table. To program the AT89S52, the
following steps should be considered:
1. Input the desired memory location on the address lines.
2. Input the appropriate data byte on the data lines.
The Design and Implementation of a Solar Tracking Generating Power System
30
3. Activate the correct combination of control signals.
4. Raise EA/VPP to 12V for the high-voltage programming mode.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-
write cycle is self-timed and typically takes no more than 1.5 ms.
Repeat steps 1 through 5, changing the address and data for the entire array or until the
end of the object file is reached.
Data Polling:
The AT89S52 features Data Polling to indicate the end of a write cycle. During a
write cycle, an attempted read of the last byte written will result in the complement of the
written datum on PO.7. Once the write cycle has been completed, true data are valid on
all outputs, and the next cycle may begin. Data Polling may begin any time after a write
cycle has been initiated.
Ready/Busy:
The progress of byte programming can also be monitored by the RDY/BSY
output signal. P3.4 is pulled low after ALE goes high during programming to indicate
BUSY. P3.4 is pulled high again when programming is done to indicate READY.
Chip Erase:
The entire Flash array is erased electrically by using the proper combination of
control signals and by holding ALE/PROG low for 10 ms. The code array is written with
all “1”s. The chip erase operation must be executed before the code memory can be re-
programmed.
Reading the Signature Bytes: The signature bytes are read by the same procedure as a
normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must
be pulled to a logic low. The values returned are as follows.
The Design and Implementation of a Solar Tracking Generating Power System
31
(030H) = 1EH indicates manufactured by Atmel
(031H) = 51H indicates 89S52
(032H) = FFH indicates 12V programming
(032H) = 05H indicates 5V programming
Programming Interface:
Every code byte in the Flash array can be written and the entire array can be
erased by using the appropriate combination of control signals. The write operation cycle
is self timed and once initiated, will automatically time itself to completion. All major
programming vendors offer worldwide support for the Atmel microcontroller series.
Tables: Flash Programming Modes
The Design and Implementation of a Solar Tracking Generating Power System
32
The Design and Implementation of a Solar Tracking Generating Power System
33
Fig: Programming and Verifying the Flash
The Design and Implementation of a Solar Tracking Generating Power System
34
LCD Interfacing
Description:
The HD44780U dot-matrix liquid crystal display controller and driver LSI
displays alphanumerics, Japanese kana characters, and symbols. It can be configured to
drive a dot-matrix liquid crystal display under the control of a 4- or 8-bit microprocessor.
Since all the functions such as display RAM, character generator, and liquid crystal
driver, required for driving a dot-matrix liquid crystal display are internally provided on
one chip, a minimal system can be interfaced with this controller/driver. A single
HD44780U can display up to one 8-character line or two 8-character lines. The
HD44780U has pin function compatibility with the HD44780S which allows the user to
easily replace an LCD-II with an HD44780U. The HD44780U character generator ROM
is extended to generate 208 5 X 8 dot character fonts and 32 5 X 10 dot character fonts
for a total of 240 different character fonts. The low power supply (2.7V to 5.5V) of the
HD44780U is suitable for any portable battery-driven product requiring low power
dissipation.
The most commonly used Character based LCD’s are based on Hitachi's
HD44780 controller or other which are compatible with HD44580. In this tutorial, we
will discuss about character based LCD’s, their interfacing with various microcontrollers,
various interfaces (8-bit/4-bit), programming, special stuff and tricks you can do with
these simple looking LCD’s which can give a new look to your application.
Pin Description:
The most commonly used LCD’s found in the market today are 1 Line, 2 Line or
4 Line LCD’s which have only 1 controller and support at most of 80 charachers, where
as LCD’s supporting more than 80 characters make use of 2 HD44780 controllers.
Most LCD’s with 1 controller has 14 Pins and LCD’s with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections). Pin description is shown in the
table below.
The Design and Implementation of a Solar Tracking Generating Power System
35
Fig10: LCD Pin Diagram
Table 1: Character LCD pins with 1 Controller
Pin No. Name Description
Pin no. 1 D7 Data bus line 7 (MSB)Pin no. 2 D6 Data bus line 6Pin no. 3 D5 Data bus line 5Pin no. 4 D4 Data bus line 4
The Design and Implementation of a Solar Tracking Generating Power System
Pin no. 1 VSS Power supply (GND)Pin no. 2 VCC Power supply (+5V)Pin no. 3 VEE Contrast adjust
Pin no. 4 RS0 = Instruction input1 = Data input
Pin no. 5 R/W0 = Write to LCD module1 = Read from LCD module
Pin no. 6 EN Enable signalPin no. 7 D0 Data bus line 0 (LSB)Pin no. 8 D1 Data bus line 1Pin no. 9 D2 Data bus line 2Pin no. 10 D3 Data bus line 3Pin no. 11 D4 Data bus line 4Pin no. 12 D5 Data bus line 5Pin no. 13 D6 Data bus line 6Pin no. 14 D7 Data bus line 7 (MSB)
36
Pin no. 5 D3 Data bus line 3Pin no. 6 D2 Data bus line 2Pin no. 7 D1 Data bus line 1Pin no. 8 D0 Data bus line 0 (LSB)
Pin no. 9 EN1Enable signal for row 0 and 1 (1stcontroller)
Pin no. 10 R/W0 = Write to LCD module1 = Read from LCD module
Pin no. 11 RS0 = Instruction input1 = Data input
Pin no. 12 VEE Contrast adjustPin no. 13 VSS Power supply (GND)Pin no. 14 VCC Power supply (+5V)
Pin no. 15 EN2Enable signal for row 2 and 3 (2ndcontroller)
Pin no. 16 NC Not Connected
Table 2: Character LCD pins with 2 Controller
Sending Commands to LCD
To send commands we simply need to select the command register. Everything is same as we have done in the initialization routine. But we will summarize the common steps and put them in a single subroutine. Following are the steps:
Move data to LCD port select command register select write operation send enable signal wait for LCD to process the command
CODE:void LCD_command(unsigned char var){ LCD_data = var; //Function set: 2 Line, 8-bit, 5x7 dots LCD_rs = 0; //Selected command register LCD_rw = 0; //We are writing in instruction register LCD_en = 1; //Enable H->L LCD_en = 0; LCD_busy(); //Wait for LCD to process the command}// Using the above function is really simple// var will carry the command for LCD// e.g.
The Design and Implementation of a Solar Tracking Generating Power System
37
//// LCD_command(0x01);
Sending Data to LCD
To send data we simply need to select the data register. Everything is same as the command routine. Following are the steps:
Move data to LCD port select data register select write operation send enable signal wait for LCD to process the data
Keeping these steps in mind we can write LCD command routine as.
CODE:void LCD_senddata(unsigned char var){ LCD_data = var; //Function set: 2 Line, 8-bit, 5x7 dots LCD_rs = 1; //Selected data register LCD_rw = 0; //We are writing LCD_en = 1; //Enable H->L LCD_en = 0; LCD_busy(); //Wait for LCD to process the command}// Using the above function is really simple// we will pass the character to display as argument to function// e.g.//// LCD_senddata('A');
The Design and Implementation of a Solar Tracking Generating Power System
38
Power Supply Design
The Design and Implementation of a Solar Tracking Generating Power System
39
POWER SUPPLY:
The input to the circuit is applied from the regulated power supply. The a.c. input
i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a
rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to
get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any
a.c components present even after rectification. Now, this voltage is given to a voltage
regulator to obtain a pure constant dc voltage.
Fig: Power supply
The Design and Implementation of a Solar Tracking Generating Power System
40
RegulatorFilterBridge Rectifier
Step down transformer
230V AC 50Hz
D.C Output
Transformer:
Usually, DC voltages are required to operate various electronic equipment and
these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus
the a.c input available at the mains supply i.e., 230V is to be brought down to the
required voltage level. This is done by a transformer. Thus, a step down transformer is
employed to decrease the voltage to a required level.
Fig11: Transformer
Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a
bridge rectifier is used because of its merits like good stability and full wave rectification.
The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using
both half cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure.
The Design and Implementation of a Solar Tracking Generating Power System
41
The circuit has four diodes connected to form a bridge. The ac input voltage is applied to
the diagonally opposite ends of the bridge. The load resistance is connected between the
other two ends of the bridge.
Fig 12: Rectifier Circuit
For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct,
whereas diodes D2 and D4 remain in the OFF state. The conducting diodes will be in
series with the load resistance RL and hence the load current flows through RL.
For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series
with the load resistance RL and hence the current flows through RL in the same direction
as in the previous half cycle. Thus a bi-directional wave is converted into a unidirectional
wave.
The Design and Implementation of a Solar Tracking Generating Power System
42
Fig13: Rectifier output Waveforms
The Design and Implementation of a Solar Tracking Generating Power System
43
Filter:
Capacitive filter is used in this project. It removes the ripples from the output of rectifier
and smoothens the D.C. Output received from this filter is constant until the mains
voltage and load is maintained constant. However, if either of the two is varied, D.C.
voltage received at this point changes. Therefore a regulator is applied at the output stage.
Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage regulator
is an electrical regulator designed to automatically maintain a constant voltage level. In
this project, power supply of 5V and
12V are required. In order to obtain
these voltage levels, 7805 and 7812
voltage regulators are to be used.
The first number 78 represents
positive supply and the numbers 05,
12 represent the required output voltage levels. The L78xx series of three-terminal
positive regulators is available in TO-220, TO-220FP, TO-3, D2PAK and DPAK
packages and several fixed output voltages, making it useful in a wide range of
applications. These regulators can provide local on-card regulation, eliminating the
distribution problems associated with single point regulation. Each
type employs internal current limiting, thermal shut-down and safe
area protection, making it essentially indestructible. If adequate heat
sinking is provided, they can deliver over 1 A output current. Although
designed primarily as fixed voltage regulators, these devices can be
used with external components to obtain adjustable voltage and
currents.
The Design and Implementation of a Solar Tracking Generating Power System
44
DC Motor Interfacing
The Design and Implementation of a Solar Tracking Generating Power System
45
BASICS OF DC MOTOR
The speed of a DC motor is directly proportional to the supply voltage, so if we
reduce the supply voltage from 12 Volts to 6 Volts, the motor will run at half the speed.
How can this be achieved when the battery is fixed at 12 Volts? The speed controller
works by varying the average voltage sent to the motor. It could do this by simply
adjusting the voltage sent to the motor, but this is quite inefficient to do. A better way is
to switch the motor's supply on and off very quickly. If the switching is fast enough, the
motor doesn't notice it, it only notices the average effect.
When you watch a film in the cinema, or the television, what you are actually
seeing is a series of fixed pictures, which change rapidly enough that your eyes just see
the average effect - movement. Your brain fills in the gaps to give an average effect.
Now imagine a light bulb with a switch. When you close the switch, the bulb
goes on and is at full brightness, say 100 Watts. When you open the switch it goes off (0
Watts). Now if you close the switch for a fraction of a second, then open it for the same
amount of time, the filament won't have time to cool down and heat up, and you will just
get an average glow of 50 Watts. This is how lamp dimmers work, and the same principle
is used by speed controllers to drive a motor. When the switch is closed, the motor sees
12 Volts, and when it is open it sees 0 Volts. If the switch is open for the same amount of
time as it is closed, the motor will see an average of 6 Volts, and will run more slowly
accordingly. The graph below shows the speed of a motor that is being turned on and off
H-BRIDGE:
An H-bridge is an electronic circuit which enables DC electric motors to be run
forwards or backwards. These circuits are often used in robotics. H-bridges are available
as integrated circuits, or can be built from discrete components.
The Design and Implementation of a Solar Tracking Generating Power System
46
Fig14: H-Bridge Circuit
The two basic states of an H-bridge.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). When the switches S1 and S4 (according to the first figure)
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.
Operation
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
motors terminals are shorted, or to let the motor 'free run' to a stop, as the motor is
effectively disconnected from the circuit. The following table summarizes operation.
The Design and Implementation of a Solar Tracking Generating Power System
47
S1 S2 S3 S4 Result
1 0 0 1 Motor moves right
0 1 1 0 Motor moves left
0 0 0 0 Motor free runs
0 1 0 1 Motor brakes
H-Bridge Driver:
The switching property of this H-Bridge can be replaced by a Transistor or a
Relay or a MOSFET or even by an IC. Here we are replacing this with an IC named
L293D as the driver whose description is as given below.
Features:
600mA OUTPUT CURRENT CAPABILITY
PER CHANNEL
1.2A PEAK OUTPUT CURRENT (non repetitive)
PER CHANNEL
ENABLE FACILITY
OVERTEMPERATURE PROTECTION
LOGICAL "0" INPUT VOLTAGE UP TO 1.5 V
(HIGH NOISE IMMUNITY)
INTERNAL CLAMP DIODES
The Design and Implementation of a Solar Tracking Generating Power System
48
DESCRIPTION:
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. The L293D is assembled in a 16 lead plastic
package which has 4 center pins connected together and used for heat sinking The
L293DD is assembled in a 20 lead surface mount which has 8 center pins connected
together and used for heat sinking.
BLOCK DIAGRAM
Fig: Block Diagram of H-Bridge
The Design and Implementation of a Solar Tracking Generating Power System
49
ABSOLUTE MAXIMUM RATINGS:
PIN CONNECTIONS:
Fig: Pin Diagram of L293D H-Bridge
The Design and Implementation of a Solar Tracking Generating Power System
50
LIGHT DEPENDENT RESISTOR:
An LDR is an input transducer (sensor) which converts
brightness (light) to
resistance. It is made from
cadmium
sulphide (CdS) and the
resistance
decreases as the
brightness of
light falling on the
LDR increases.
LDR’s 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 1,000,000
ohms, but when they are illuminated with light, the resistance drops dramatically.
Thus in this project, LDR plays an important role in controlling the electrical
appliances based on the intensity of light i.e., if the intensity of light is more (during
daytime) the loads will be in off condition. And if the intensity of light is less (during
nights), the loads will be switched on.
The Design and Implementation of a Solar Tracking Generating Power System
51
Fig:
In the above circuit we are controlling the load with an LDR device which in turn
depends on the transistor and a switch i.e., nothing but the operation of the above circuit
behaves like a transistor as a switch.
A transistor is a semi conductor device commonly used to amplify or switch electronic
signals.
In electronics, a switch is an electrical component that can break an electrical circuit,
interrupting the current or diverting it from one conductor to another.
• Transistor can be used as an electronic switch, in grounded-emitter configuration.
• Transistors are commonly used as electronic switches, for both high power
applications including switched mode power supply and low power applications
such as logic gates.
• In a grounded-emitter transistor circuit, such as the light-switch circuit shown, as
the base voltage rises the base and collector current rise exponentially, and the
collector voltage drops because of the collector load resistor.
• If the emitter-base and base-collector are in forward bias then it act as a switch.
• At that instant the collector to emitter is shorted, it act as a closed switch.
The Design and Implementation of a Solar Tracking Generating Power System
52
LEAD ACID BATTERY
The Design and Implementation of a Solar Tracking Generating Power System
53
Lead-acid batteries are the most common in PV systems because their initial cost is
lower and because they are readily available nearly everywhere in the world. There are
many different sizes and designs of lead-acid batteries, but the most important
designation is that they are deep cycle batteries. Lead-acid batteries are available in both
wet-cell (requires maintenance) and sealed no-maintenance versions. AGM and Gel-cell
deep-cycle batteries are also popular because they are maintenance free and they last a lot
longer.
Lead acid batteries are reliable and cost effective with an exceptionally long life.
The Lead acid batteries have high reliability because of their ability to withstand
overcharge, over discharge vibration and shock. The use of special sealing techniques
ensures that our batteries are leak proof and non-spillable. Other critical features include
the ability to withstand relatively deeper discharge, faster recovery and more chances of
survival if subjected to overcharge. The batteries have exceptional charge acceptance,
large electrolyte volume and low self-discharge, which make them ideal as zero-
maintenancebatteries.
Lead acid batteries are manufactured/ tested using CAD (Computer Aided
Design). These batteries are used in Inverter & UPS Systems and have the proven ability
to perform under extreme conditions. The batteries have electrolyte volume, use PE
Separators and are sealed in sturdy containers, which give them excellent protection
against leakage and corrosion.
Features
Manufactured/tested using CAD
Electrolyte volume
PE Separators
Protection against leakage
The Design and Implementation of a Solar Tracking Generating Power System
54
Number of batteries needed:
If you use the numbers from the sample load numbers link at the end of the page,
you turn out needing 6310W peak and a total of 20950Wh/day. This comes out at 51
Amps peak and a total of 174 Amp Hours in a day at 120 Volts. To handle these peak
loads, it is important to use electrical wiring of the correct gauge to carry the current. 51
Amps @ 120 Volts (or 526 Amps@12vDC) is hazardous. One should not forget that
batteries have a limited life span. Any system should be designed such that you can easily
replace batteries without disrupting much of your load. You may need to diagnose to
determine what batteries have lost their ability to retain a charge.
Battery connections:
Lead-acid batteries are normally available in blocks of 2V, 6V or 12V. In most
cases, to generate the necessary operating voltage and the capacity of the batteries for the
Solar Inverter, many batteries have to be connected together in parallel and/or in series.
Following three examples are shown:
Parallel Connection:
The Design and Implementation of a Solar Tracking Generating Power System
55
Series Connection:
The Design and Implementation of a Solar Tracking Generating Power System
56
Parallel-Series Connection:
The Design and Implementation of a Solar Tracking Generating Power System
57
INVERTER
The Design and Implementation of a Solar Tracking Generating Power System
58
An inverter is an electrical device that converts direct current (DC) to alternating
current (AC); the converted AC can be at any required voltage and frequency with the
use of appropriate transformers, switching, and control circuits.
Solid-state inverters have no moving parts and are used in a wide range of
applications, from small switching power supplies in computers, to large electric
utility high-voltage direct current applications that transport bulk power. Inverters are
commonly used to supply AC power from DC sources such as solar panels or batteries.
There are two main types of inverter. The output of a modified sine wave inverter
is similar to a square wave output except that the output goes to zero volts for a time
before switching positive or negative. It is simple and low cost and is compatible with
most electronic devices, except for sensitive or specialized equipment, for example
certain laser printers. A pure sine wave inverter produces a nearly perfect sine wave
output (<3% total harmonic distortion) that is essentially the same as utility-supplied grid
power. Thus it is compatible with all AC electronic devices. This is the type used in grid-
tie inverters. Its design is more complex, and costs 5 or 10 times more per unit
power. The electrical inverter is a high-power electronic oscillator. It is so named
because early mechanical AC to DC converters was made to work in reverse, and thus
was "inverted", to convert DC to AC.
The inverter performs the opposite function of a rectifier.
The Design and Implementation of a Solar Tracking Generating Power System
59
Software Tools
The Design and Implementation of a Solar Tracking Generating Power System
60
KEIL SOFTWARE:
Keil compiler is a software used where the machine language code is written and
compiled. After compilation, the machine source code is converted into hex code which
is to be dumped into the microcontroller for further processing. Keil compiler also
supports C language code.
STEPS TO WRITE AN ASSEMBLY LANGUAGE PROGRAM IN KEIL AND
HOW TO COMPILE IT:
1. Install the Keil Software in the PC in any of the drives.
2. After installation, an icon will be created with the name “Keil uVision3”. Just
drag this icon onto the desktop so that it becomes easy whenever you try to write
programs in keil.
3. Double click on this icon to start the keil compiler.
4. A page opens with different options in it showing the project workspace at the
leftmost corner side, output window in the bottom and an ash coloured space for
the program to be written.
5. Now to start using the keil, click on the option “project”.
6. A small window opens showing the options like new project, import project, open
project etc. Click on “New project”.
7. A small window with the title bar “Create new project” opens. The window asks
the user to give the project name with which it should be created and the
destination location. The project can be created in any of the drives available. You
can create a new folder and then a new file or can create directly a new file.
The Design and Implementation of a Solar Tracking Generating Power System
61
8. After the file is saved in the given destination location, a window opens where a
list of vendors will be displayed and you have to select the device for the target
you have created.
9. The most widely used vendor is Atmel. So click on Atmel and now the family of
microcontrollers manufactured by Atmel opens. You can select any one of the
microcontrollers according to the requirement.
10. When you click on any one of the microcontrollers, the features of that particular
microcontroller will be displayed on the right side of the page. The most
appropriate microcontroller with which most of the projects can be implemented
is the AT89S52. Click on this microcontroller and have a look at its features. Now
click on “OK” to select this microcontroller.
11. A small window opens asking whether to copy the startup code into the file you
have created just now. Just click on “No” to proceed further.
12. Now you can see the TARGET and SOURCE GROUP created in the project
workspace.
13. Now click on “File” and in that “New”. A new page opens and you can start
writing program in it.
14. After the program is completed, save it with any name but with the .asm
extension. Save the program in the file you have created earlier.
15. You can notice that after you save the program, the predefined keywords will be
highlighted in bold letters.
16. Now add this file to the target by giving a right click on the source group. A list of
options open and in that select “Add files to the source group”. Check for this file
where you have saved and add it.
17. Right click on the target and select the first option “Options for target”. A window
opens with different options like device, target, output etc. First click on “target”.
The Design and Implementation of a Solar Tracking Generating Power System
62
18. Since the set frequency of the microcontroller is 11.0592 MHz to interface with
the PC, just enter this frequency value in the Xtal (MHz) text area and put a tick
on the Use on-chip ROM. This is because the program what we write here in the
keil will later be dumped into the microcontroller and will be stored in the inbuilt
ROM in the microcontroller.
19. Now click the option “Output” and give any name to the hex file to be created in
the “Name of executable” text area and put a tick to the “Create HEX file” option
present in the same window. The hex file can be created in any of the drives. You
can change the folder by clicking on “Select folder for Objects”.
20. Now to check whether the program you have written is errorless or not, click on
the icon exactly below the “Open file” icon which is nothing but Build Target
icon. You can even use the shortcut key F7 to compile the program written.
21. To check for the output, there are several windows like serial window, memory
window, project window etc. Depending on the program you have written, select
the appropriate window to see the output by entering into debug mode.
22. The icon with the letter “d” indicates the debug mode.
23. Click on this icon and now click on the option “View” and select the appropriate
window to check for the output.
24. After this is done, click the icon “debug” again to come out of the debug mode.
25. The hex file created as shown earlier will be dumped into the microcontroller with
the help of another software called Proload.
The Design and Implementation of a Solar Tracking Generating Power System
63
PROLOAD:
Proload is a software which accepts only hex files. Once the machine code is
converted into hex code, that hex code has to be dumped into the microcontroller placed
in the programmer kit and this is done by the Proload. Programmer kit contains a
microcontroller on it other than the one which is to be programmed. This microcontroller
has a program in it written in such a way that it accepts the hex file from the keil
compiler and dumps this hex file into the microcontroller which is to be programmed. As
this programmer kit requires power supply to be operated, this power supply is given
from the power supply circuit designed above. It should be noted that this programmer kit
contains a power supply section in the board itself but in order to switch on that power
supply, a source is required. Thus this is accomplished from the power supply board with
an output of 12volts or from an adapter connected to 230 V AC.
Steps to work with Proload:
1. Install the Proload Software in the PC.
2. Now connect the Programmer kit to the PC (CPU) through serial cable.
3. Power up the programmer kit from the ac supply through adapter.
4. Now place the microcontroller in the GIF socket provided in the programmer kit.
5. Click on the Proload icon in the PC. A window appears providing the information
like Hardware model, com port, device type, Flash size etc. Click on browse
option to select the hex file to be dumped into the microcontroller and then click
on “Auto program” to program the microcontroller with that particular hex file.
6. The status of the microcontroller can be seen in the small status window in the
bottom of the page.
The Design and Implementation of a Solar Tracking Generating Power System
64
7. After this process is completed, remove the microcontroller from the programmer
kit and place it in your system board. Now the system board behaves according to
the program written in the microcontroller.
ADVANTAGESADVANTAGES
The Design and Implementation of a Solar Tracking Generating Power System
65
Advantages:
Highly sensitive
Works according to the sun direction
Fit and Forget system
Night – Day mode sensing
Low cost and reliable circuit
Complete elimination of manpower
The Design and Implementation of a Solar Tracking Generating Power System
66
APPLICATIONSAPPLICATIONS
The Design and Implementation of a Solar Tracking Generating Power System
67
Applications:
Street lights
Garden Lights
Solar water heater
Hotels, hostels and house hold applications
Offices
Industries
The Design and Implementation of a Solar Tracking Generating Power System
68
CCONCLUSIONONCLUSION
The Design and Implementation of a Solar Tracking Generating Power System
69
CONCLUSION
This project presents a solar tracking power generation system. The tracking
controller based on the closed loop algorithm is designed and implemented with Atmel
89S52 MCU in embedded system domain. Set up on the solar tracking system, the light
sensitivity resistors are used to determine the night – day vision. The proposed solar
tracking power generation system can track the sun light automatically. Thus, the
efficiency of solar energy generation can be increased. Experimental work has been
carried out carefully. The result shows that higher generating power efficiency is indeed
achieved using the solar tracking system. The proposed method is verified to be highly
beneficial for the solar power generation.
The Design and Implementation of a Solar Tracking Generating Power System
70
REFERENCEREFERENCE
The Design and Implementation of a Solar Tracking Generating Power System
71
REFERENCE
Text Books:
Website:
www.howstuffworks.com
www.answers.com
www.radiotronix.com
www.WineYardProjects.com
Magazines:
Electronics for you
Electrikindia
The Design and Implementation of a Solar Tracking Generating Power System
72