Вы находитесь на странице: 1из 66

SYNOPSIS

SYNOPSIS

This automated system is implemented using microcontroller which controls


the stepper motor coupled solar panel. This mechanism does not require any sensor or
synchronization for tracking the sun. In this mechanism, the solar panels make a
rotation of two directions based on the voltage from the LDR. In terms of daily energy
generation, the presented tracking- scheme provides about 30% more energy output as
compared to the flat PV module (module kept stationary on ground) and about 15%
more energy output as compared to PV module with single axis tracking. This system
is connected with the two LDR. The sensor values will be in analog format so we have
to use the ADC module for convert the voltage and then it will give the output of
digital signal. The stepper motor with solar panel is connected with the
microcontroller via port pin using the relay. The microcontroller will check the voltage
of the two LDR. According to the voltage coming from the LDR the position of the
stepper motor will be changed automatically using the relays. The position will be
displayed in the LCD which is interfaced with the microcontroller.
CONTENTS
CONTENTS

1. INTRODUCTION

2. BLOCK DIAGRAM

3. BLOCK DIAGRAM DESCRIPTION

4. CIRCUIT DIAGRAM

5. INTRODUCTION TO SUN TRACKING

6. INTRODUCTION TO STEPPER MOTOR

7. WORKING PRINCIPLE

8. COMPONENTS DESCRIPTION

9. ADVANTAGES

10. APPLICATIONS

11. PROGRAM

12. CONCLUSION

13. BIBLIOGRAPHY
INTRODUCTION
INTRODUCTION

Energy is the primary and most universal measure of all kinds of work by
human beings and nature. Primarily, it is the gift of the nature to the mankind in
various forms. The consumption of the energy is directly proportional to the progress
of the mankind. With ever growing population, improvement in the living standard of
the humanity, industrialization of the developing countries, the global demand for
energy increases day by day.

The primary source of energy is fossil fuel, however the finiteness of fossil fuel
resources and large scale environmental degradation caused by their widespread use,
particularly global warming, urban air pollution and acid rain, strongly suggests that
harnessing of non-conventional, renewal and environmental friendly

As the sources of conventional energy deplete day by day, resorting to


alternative sources of energy like solar and wind energy has become need of the hour.

Solar powered lighting systems are already available in rural as well as urban
areas. These include solar lanterns, solar home lightning system, solar street lights,
solar garden lights and solar power packs. All of them consist of four components;
solar photovoltaic module, rechargeable battery, solar charge controller and load.

In the solar powered lightning systems, the solar charge controller plays an
important role as the systems overall success depends mainly on it. It is considered as
an indispensible link between the solar panel, battery and load.
BLOCK
DIAGRAM
BLOCK DIAGRAM

FIG: BLOCK DIAGRAM OF STEPPER MOTOR CONTROL BASED ON


SOLAR TRACKING SYSTEM
BLOCK
DIAGRAM
DESCRIPTION
BLOCK DIAGRAM DESCRIPTION

MICROCONTROLLER

It is the major part of the system. The microcontroller controls all the
operations. The solar panel is aligned according to the intensity of sunlight under the
control of the microcontroller.

SENSOR

The system consists of two sensors, each composed of LDR. One unit is made
up of four LDRs. These are placed at the four corners of the solar panel. The intensity
of sunlight is sensed by the LDR and the output is sent to the controller. The control
unit analyzes it and decides the direction in which the panel has to be rotated, so that it
gets maximum intensity of light.

The other unit of sensor is also composed of LDRs which is meant for the
control of a lighting load.

STEPPER MOTOR

Servo motor is used to rotate the panel in desired direction. It is controlled by


the controller.

SOLAR PANEL

Solar panel is used for the conversion of solar energy directly into electricity. It
is composed of photo voltaic cells, which convert solar energy into electrical energy.

CHARGE CONTROL

It is meant to control the charging of battery. It sends the status of battery to the
microcontroller unit.

BATTERY

It is for the storage of energy received from the panel. A rechargeable battery is
normally employed for this purpose.
LOAD CONTROL

Load control is meant for the control of the load. It receives control signals
from the controller and controls the load.

LOAD

Different types of load can be controlled as per the requirements. Here a load
for lighting purpose is controlled.
CIRCUIT
DIAGRAM
CIRCUIT DIAGRAM

FIG: CIRCUIT DIAGRAM


INTRODUCTION
TO
SUN TRACKING
INTRODUCTION TO SUN TRACKING

BACKGROUND

As the range of applications for solar energy increases, so does the need for
improved materials and methods used to harness this power source. There are several
factors that affect the efficiency of the collection process. Major influences on overall
efficiency include solar cell efficiency, intensity of source radiation and storage
techniques. The materials used in solar cell manufacturing limit the efficiency of a
solar cell. This makes it particularly difficult to make considerable improvements in
the performance of the cell, and hence restricts the efficiency of the overall collection
process. Therefore, the most attainable method of improving the performance of solar
power collection is to increase the mean intensity of radiation received from the
source.

NEED OF SUN TRACKING

Each day, the sun rises in the east, moves across the sky, and sets in the west.
Whenever the sun is shining on us, it is sending energy in our direction. If there is a
solar cell to turn and look at the sun all day, then it would be receiving the maximum
amount of sunlight possible and converting it into the more useful energy form
electricity. It is seen that the sun appears to follow a path that is nearly directly
overhead. However, for locations north or south of the tropics (e.g., latitudes greater
than 23.5 degrees), the sun never reaches a position that is directly overhead. Instead,
it follows a path across the southern or the northern part of the sky.

OBJECTIVE OF THE WORK

If a solar cell is configured so that it faces the sun continually as it moves


across the sky from east to west, the most electrical energy possible can be obtained.
One way to do this, of course, is by hand. However, keeping a solar cell facing the sun
throughout the day is not a very efficient use of a persons time. Going outside to a
solar cell every hour to turn it toward the sun might be possible, but this would still
not be an efficient method. A photo sensor is employed to control the solar cell
tracking system. For example, if the photo sensor is not aligned with sun rays, then it
could turn on the motor until it is once again aligned. If the motor is attached to the
frame holding the solar cell, then the solar cell could be moved to face the sun. As
long as the photo sensor is in alignment with the sun, nothing happens.

However, when the sun moves across the sky and is not in proper alignment
with the photo sensor, then a motor moves the frame until the photo sensor is in the
sun once more. This could have the effect of keeping the solar cell facing the sun as it
moves across the required human attention. The solar tracker system includes a frame
on which a solar cell could be mounted. The frame is to move so that it faces the sun
as it travels across the sky during the day. The frame could be driven by an electric
motor that turns on and off in response to the movement of the sky.

SOLAR ENERGY

One of the most important problems facing the world today is the energy
problem. This problem is resulted from the increase of demand for electrical energy
and high cost of fuel. The solution was in finding another renewable energy sources
such as solar energy, wind energy, potential energy...etc. Nowadays, solar energy has
been widely used in our life, and it's expected to grow up in the next years.

Solar energy has many advantages:

1. Need no fuel

2. Has no moving parts to wear out

3. Non-polluting & quick responding

4. Adaptable for on-site installation

5. Easy maintenance

6. Can be integrated with other renewable energy sources

7. Simple & efficient


Tracking systems try to collect the largest amount of solar radiation and convert
it into usable form of electrical energy (DC voltage) and store this energy into
batteries for different types of applications. The sun tracking systems can collect more
energy than what a fixed panel system collects.

TRACKING TECHNIQUES

There are several forms of tracking currently available; these vary mainly in the
method of implementing the designs. The two general forms of tracking used are fixed
control algorithms and dynamic tracking. The inherent difference between the two
methods is the manner in which the path of the sun is determined. In the fixed control
algorithm systems, the path of the sun is determined by referencing an algorithm that
calculates the position of the sun for each time period. That is, the control system does
not actively find the sun's position but works it out given the current time, day, month,
and year. The dynamic tracking system, on the other hand, actively searches for the
sun's position at any time of day (or night). Common to both forms of tracking is the
control system. This system consists of some method of direction control, such as DC
motors, stepper motors, and servo motors, which are directed by a control circuit,
either digital or analog.

RELEVANCE OF SOLAR TRACKERS

For people living in remote communities, often in third world countries, access
to grid-connected electricity is not always possible. Often the nearest utility is a long
distance from homes and the cost of developing the infrastructure that would allow for
access to the grid is prohibitive.

Remote communities in third world countries are of course not the only ones
that suffer this dilemma. Australia is a large country with many farmers and
communities that are remote from the local grid and in these cases alternative sources
of electrical power must be obtained.
EQUIVALENT CIRCUIT OF SOLAR CELL

Figure.4: Equivalent Circuit of Solar Cell

To understand the electronic behaviour of a solar cell, it is useful to create a


model which is electrically equivalent, and is based on discrete electrical components
whose behaviour is well known. An ideal solar cell may be modelled by a current
source in parallel with a diode. In practice no solar cell is ideal, so a shunt resistance
and a series resistance component are added to the model. The result is the "equivalent
circuit of a solar cell" as shown above.

ACTIVE SOLAR TRACKERS

Active trackers measure the light intensity from the sun to determine where the
solar modules should be pointing. Light sensors are positioned on the tracker at
various locations or in specially shaped holders. If the sun is not facing the tracker
directly there will be a difference in light intensity on one light sensor compared to
another and this difference can be used to determine in which direction the tracker has
to tilt in order to be facing the sun.

TYPES OF SOLAR TRACKERS

There are many different types of solar tracker which can be grouped into
single axis and double axis models.

SINGLE AXIS SOLAR TRACKERS

Single axis solar trackers can either have a horizontal or a vertical axle. The
horizontal type is used in tropical regions where the sun gets very high at noon, but
the days are short. The vertical type is used in high latitudes (such as in UK) where the
sun does not get very high, but summer days can be very long. These have a manually
adjustable tilt angle of 0 - 45 and automatic tracking of the sun from East to West.
They use the PV modules themselves as light sensor to avoid unnecessary tracking
movement and for reliability. At night the trackers take up a horizontal position.

Figure: Single Axis Solar Tracker

DUAL AXIS TRACKERS

Figure: Double Axis Tracker

Double axis solar trackers have both a horizontal and a vertical axle and so can
track the Sun's apparent motion exactly anywhere in the world. This type of system is
used to control astronomical telescopes, and so there is plenty of software available to
automatically predict and track the motion of the sun across the sky. Dual axis trackers
track the sun both East to West and North to South for added power output (approx
40% gain) and convenience.
INTRODUCTION
TO
STEPPER MOTOR
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.

Figure: Stepper motor

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 bipolar
motor. The unipolar stepper motor can be used as a bipolar motor by disconnecting the
center tap. In unipolar there are 5 wires. One common wire and four wires to which
power supply has to be given in a serial order to make it drive. Bipolar can have 6
wires and a pair of wires is given supply at a time to drive it in steps.

Figure: A 2- phase (winding) unipolar Stepper Schematic.

Figure: A two phase (winding) bipolar stepper motor.

STEPPER MOTOR CONNECTION DIAGRAM

The wires from the Logic PCB connector to the stepper motor are as follows

Black +12V common


Red Coil1
Brown Coil3
Green Coil2
White Coil4

Figure: PCB Connector


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.

DRIVING A STEPPER MOTOR:

IDENTIFY THE WIRE: Common and windings

Figure: Connection to identify the common winding

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.
CONNECTION OF THE CIRCUIT

Figure: Connection of ULN with motor

Figure: Compact design

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.
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.

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.
WORKING
PRINCIPLE
WORKING PRINCIPLE

This project consists of few sun light sensors and a motorized mechanism for
rotating the panel in the direction of sun. Microcontroller based control system takes
care of sensing sunlight and controlling the motorized mechanism. This system works
continuously without any interruption. The main controlling device of the project is
Microcontroller to which LDRs and stepper motor with panel setup to its shaft are
interfaced. The Microcontroller gets input from LDR sensors regarding the direction
of sun and controller process this information and controls the movement of solar
panel attached to Stepper motor. The system also displays the voltage generated on
LCD display unit. This achieves the goal of tracking sun.
COMPONENTS
DESCRIPTION
COMPONENTS DESCRIPTION

Regulated Power Supply

Power supply is a supply of electrical power. A device or system that supplies


electrical or other types of energy to an output load or group of loads is called a power
supply unit or PSU. The term is most commonly applied to electrical energy supplies,
less often to mechanical ones, and rarely to others. A power supply may include a
power distribution system as well as primary or secondary sources of energy.

Conversion of one form of electrical power to another desired form and


voltage, typically involving converting AC line voltage to a well regulated lower-
voltage DC for electronic devices. Low voltage, low power DC power supply units are
commonly integrated with the devices they supply, such as computers and household
electronics.

FIG: BLOCK DIAGRAM OF POWER SUPPLY

A regulated power supply is very much essential for several electronic devices
due to the semiconductor material employed in them have a fixed rate of current as
well as voltage. The device may get damaged if there is any deviation from the fixed
rate. The AC power supply gets converted into constant DC by this circuit. By the
help of a voltage regulator DC, unregulated output will be fixed to a constant voltage.
The circuit is made up of linear voltage regulator 7805 along with capacitors and
resistors with bridge rectifier made up from diodes. From giving an unchanging
voltage supply to building confident that output reaches uninterrupted to the
appliance, the diodes along with capacitors handle elevated efficient signal conveyor.
Description:

The regulated power supply is a device that mechanized on DC voltages and


also it can uphold its output accurately at a fixed voltage all the time although if there
is a significant alteration in the DC input voltage.

ICs regulator is mainly used in the circuit to maintain the exact voltage which
is followed by the power supply. A regulator is mainly employed with the capacitor
connected in parallel to the input terminal and the output terminal of the IC regulator.
For the checking of gigantic alterations in the input as well as in the output filter,
capacitors are used. While the bypass capacitors are used to check the small period
spikes on the input and output level. Bypass capacitors are mainly of small values that
are used to bypass the small period pulses straightly into the Earth.

A circuit diagram having regulator IC and all the components arrangement


revealed in the figure below.

Regulated Power Supply Circuit

As we have made the whole circuit till now to be operated on the 5V DC


supply, so we have to use an IC regulator for 5V DC. And the most generally used IC
regulators get into the market for 5V DC regulation use is 7805. So we are connecting
the similar IC in the circuit as U1.
IC 7805 is a DC regulated IC of 5V. This IC is very flexible and is widely
employed in all types of circuit like a voltage regulator. It is a three terminal device
and mainly called input , output and ground. Pin diagram of the IC 7805 is shown in
the diagram below.

Pin Diagram of IC 7805

In the circuit diagram C2 as well as C3 are filter capacitor while bypass


capacitors are the C1 and C4.The electrolytic polarized capacitors are employed for
this purpose. For the purpose of filter capacitors normally 10mfd value of the
capacitor used. And in these projects we also used 100mfd value of the capacitor.
While in all kinds of circuit the value of bypass capacitor is 0.1 mfd. And in generally
un-polarized mainly disc capacitors employed for this purpose.

Currently we have the circuit for the 5V DC positive regulation and we are also
familiar with the component values used in the circuit. In the table below we have
mentioned the value in detail of all the components used in the circuit of 5V DC
positive regulator.
Fig: 7805 Voltage Regulator Circuit Diagram

The output generated from the unregulated DC output is susceptible to the


fluctuations of the input signal. IC voltage regulator is connected with bridge rectifier
in series in this project so to steady the DC output against the variations in the input
DC voltage. To obtain a stable output of 5V, IC 7805 is attached with 6-0-6V along
with 500mA step down transformer as well as with rectifier. To suppress the
oscillation which might generate in the regulator IC, C2 capacitor of 0.1 uF value is
used. When the power supply filter is far away from the regulated IC capacitor C2 is
used. Ripple rejection in the regulator is been improved by C4 capacitor (35uf) by
avoiding the ripple voltage to be amplified at the regulator output. The output voltage
is strengthen and deduction of the output voltage is done capacitor C3 (0.1uF). To
avoid the chance of the input get shorted D5 diode is used to save the regulator. If D5
is not presented in the circuit, the output capacitor can leave its charge immediately
during low impedance course inside the regulators.

Components required

1. Step down transformer (1A, 230V or 110V primary secondary should be your
choice like 6V, 9V etc).
2. Diodes x 4 (1N4001 for low power 1N4007 for moderate power)

3. Capacitor (470F, 16V)

4. Voltage regulator IC 78XX (Here we have used 7805)

Working

Circuit consists of 4 parts: Step down transformer, bridge rectifier, capacitor


filter and voltage regulator IC.

The transformer step downs the high voltage AC to a low voltage AC.

During the positive half cycle of secondary voltage, diodes D2 and D3 are
forward biased and diodes D1 and D4 are reverse biased, now the current flows
through D2>Load>D3

During the negative half cycle of the secondary voltage, diodes D1 and D4 are
forward biased and diodes D2 and D3 are reverse biased Now the current flows
through D4>Load>D1

In both the cycles load current flows in same direction, hence we get a
pulsating DC voltage across the points B-B.
The pulsating content are called ripples and a filter capacitor is used to remove
the ripples from pulsating DC.

When the instantaneous values of pulsating DC voltage increases, the capacitor


gets charged up to peak value of the input.

When the instantaneous values of pulsating DC voltage decreases, the stored


voltage in the capacitor reverse biases the diodes D2 and D4. Hence it will not
conduct, now capacitor discharges through the load. Then voltage across the
capacitor decreases.

During the next cycle, when the peak voltage exceeds the capacitor voltage,
diode D2 or D4 forward biases accordingly, as a result capacitor again charges
to the peak value. This process continues. Hence we get almost smooth DC
voltage as shown.
Brown color indicates pulsating DC and Red color is the filtered DC voltage.

Then the filtered voltage is applied to the input of 7805 voltage regulator IC, it
in turn regulates the voltage for line and load fluctuations.

Brown color indicates capacitor output DC and Red color is the regulated 5V DC
from 7805.

LIQUID CRYSTAL DISPLAY (LCD)

Liquid crystal displays (LCDs) have materials, which combine the properties
of both liquids and crystals. Rather than having a melting point, they have a
temperature range within which the molecules are almost as mobile as they would be
in a liquid, but are grouped together in an ordered form similar to a crystal.
An LCD consists of two glass panels, with the liquid crystal material sand
witched in between them. The inner surface of the glass plates are coated with
transparent electrodes which define the character, symbols or patterns to be displayed
polymeric layers are present in between the electrodes and the liquid crystal, which
makes the liquid crystal molecules to maintain a defined orientation angle.

One each polarizes are pasted outside the two glass panels. These polarizes
would rotate the light rays passing through them to a definite angle, in a particular
direction. When the LCD is in the off state, light rays are rotated by the two polarizes
and the liquid crystal, such that the light rays come out of the LCD without any
orientation, and hence the LCD appears transparent.

When sufficient voltage is applied to the electrodes, the liquid crystal


molecules would be aligned in a specific direction. The light rays passing through the
LCD would be rotated by the polarizes, which would result in activating / highlighting
the desired characters. The LCDs are lightweight with only a few millimeters
thickness. Since the LCDs consume less power, they are compatible with low power
electronic circuits, and can be powered for long durations.

The LCD does not generate light and so light is needed to read the
display. By using backlighting, reading is possible in the dark. The LCDs have long
life and a wide operating temperature range. Changing the display size or the layout
size is relatively simple which makes the LCDs more customers friendly.

The LCDs used exclusively in watches, calculators and measuring instruments


are the simple seven-segment displays, having a limited amount of numeric data. The
recent advances in technology have resulted in better legibility, more information
displaying capability and a wider temperature range. These have resulted in the LCDs
being extensively used in telecommunications and entertainment electronics. The
LCDs have even started replacing the cathode ray tubes (CRTs) used for the display of
text and graphics, and also in small TV applications.

Crystalonics dotmatrix (alphanumeric) liquid crystal displays are available in


TN, STN types, with or without backlight. The use of C-MOS LCD controller and
driver ICs result in low power consumption. These modules can be interfaced with a
4-bit or 8-bit microprocessor /Micro controller.

The built-in controller IC has the following features:


Correspond to high speed MPU interface (2MHz)
80 x 8 bit display RAM (80 Characters max)
9,920-bit character generator ROM for a total of 240 character fonts. 208 character
fonts (5 x 8 dots) 32 character fonts (5 x 10 dots)
64 x 8 bit character generator RAM 8 character generator RAM 8 character fonts (5 x
8 dots) 4 characters fonts (5 x 10 dots)
Programmable duty cycles
1/8 for one line of 5 x 8 dots with cursor
1/11 for one line of 5 x 10 dots with cursor
1/16 for one line of 5 x 8 dots with cursor
Wide range of instruction functions display clear, cursor home, display on/off, cursor
on/off, display character blink, cursor shift, display shift.
Automatic reset circuit, which initializes the controller / driver ICs after power on.

Micro Controller

A Microcontroller is a programmable digital processor with necessary


peripherals. Both microcontrollers and microprocessors are complex sequential digital
circuits meant to carry out job according to the program / instructions. Sometimes
analog input/output interface makes a part of microcontroller circuit of mixed mode
(both analog and digital nature).

PIC16F877A MICROCONTROLLER

A microcontroller is a compact microcomputer designed to govern the


operation of embedded systems in motor vehicles, robots, office machines, complex
medical devices, mobile radio transceivers, vending machines, home appliances, and
various other devices. A typical microcontroller includes a processor, memory, and
peripherals. As for this project microcontroller of PIC16F877A is used. This PIC acts
as the brain of this project as it will conduct what particular components action during
the particular time.
The microcontroller that has been used for this project is from PIC series. PIC
microcontroller is the first RISC based microcontroller fabricated in CMOS
(complimentary metal oxide semiconductor) that uses separate bus for instruction and
data allowing simultaneous access of program and data memory.

The main advantage of CMOS and RISC combination is low power


consumption resulting in a very small chip size with a small pin count. The main
advantage of CMOS is that it has immunity to noise than other fabrication techniques.

Various microcontrollers offer different kinds of memories. EEPROM,


EPROM, FLASH etc. are some of the memories of which FLASH is the most recently
developed. Technology that is used in pic16F877A is flash technology, so that data is
retained even when the power is switched off. Easy Programming and Erasing are
other features of PIC 16F877A.
CORE FEATURES:

High-performance RISC CPU

Only 35 single word instructions to learn

All single cycle instructions except for program branches which are two cycle

Operating speed: DC - 20 MHz clock inputDC - 200 ns instruction cycle

Up to 8K x 14 words of Flash Program Memory,

Up to 368 x 8 bytes of Data Memory (RAM)

Up to 256 x 8 bytes of EEPROM data memory

Pin out compatible to the PIC16C73/74/76/77

Interrupt capability (up to 14 internal/external

Eight level deep hardware stack

Direct, indirect, and relative addressing modes

Power-on Reset (POR)

Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)

Watchdog Timer (WDT) with its own on-chip RC Oscillator for reliable operation

Programmable code-protection

Power saving SLEEP mode

Selectable oscillator options

Low-power, high-speed CMOS EPROM/EEPROM technology

Fully static design

In-Circuit Serial Programming (ICSP) via two pins

Only single 5V source needed for programming capability


In-Circuit Debugging via two pins

Processor read/write access to program memory

Wide operating voltage range: 2.5V to 5.5V

High Sink/Source Current: 25 mA

Commercial and Industrial temperature ranges

Low-power consumption:

PERIPHERAL FEATURES:

Timer0: 8-bit timer/counter with 8-bit prescaler

Timer1: 16-bit timer/counter with prescaler, can be incremented during sleep

Via external crystal/clock

Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler

Two Capture, Compare, PWM modules

Capture is 16-bit, max resolution is 12.5 ns,

Compare is 16-bit, max resolution is 200 ns,

PWM max. Resolution is 10-bit

10-bit multi-channel Analog-to-Digital converter

Synchronous Serial Port (SSP) with SPI. (Master Mode) and I2C. (Master/Slave)

Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with

9- Bit addresses detection.

Brown-out detection circuitry for Brown-out Reset (BOR)


PIN DIAGRAM OF PIC 16F877A

PIN OUT DESCRIPTION

I/O PORTS:

Some pins for these I/O ports are multiplexed with an alternate function for the
peripheral features on the device. In general, when a peripheral is enabled, that pin
may not be used as a general purpose I/O pin.

Additional Information on I/O ports may be found in the IC micro Mid-


Range Reference Manual,

PORTA AND THE TRISA REGISTER:


PORTA is a 6-bit wide bi-directional port. The corresponding data direction
register is TRISA. Setting a TRISA bit (=1) will make the corresponding PORTA pin
an input, i.e., put the corresponding output driver in a Hi-impedance mode. Clearing a
TRISA bit (=0) will make the corresponding PORTA pin an output, i.e., put the
contents of the output latch on the selected pin.

PORTB AND TRISB REGISTER:

PORTB is an 8-bit wide bi-directional port. The corresponding data direction


register is TRISB. Setting a TRISB bit (=1) will make the corresponding PORTB pin
an input, i.e., put the corresponding output driver in a hi-impedance mode. Clearing a
TRISB bit (=0) will make the corresponding PORTB pin an output, i.e., put the
contents of the output latch on the selected pin. Three pins of PORTB are multiplexed
with the Low Voltage Programming function; RB3/PGM, RB6/PGC and RB7/PGD.
The alternate functions of these pins are described in the Special Features Section.
Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on
all the pull-ups.

This is performed by clearing bit RBPU (OPTION_REG<7>). The weak pull-


up is automatically turned off when the port pin is configured as an output. The pull-
ups are disabled on a Power-on Reset.

PORTC AND THE TRISC REGISTER:

PORTC is an 8-bit wide bi-directional port. The corresponding data direction


register is TRISC. Setting a TRISC bit (=1) will make the corresponding PORTC pin
an input, i.e., put the corresponding output driver in a hi-impedance mode. Clearing a
TRISC bit (=0) will make the corresponding PORTC pin an output, i.e., put the
contents of the output latch on the selected pin. PORTC is multiplexed with several
peripheral functions. PORTC pins have Schmitt Trigger input buffers.

PORTD AND TRISD REGISTERS:


This section is not applicable to the 28-pin devices. PORTD is an 8-bit port
with Schmitt Trigger input buffers. Each pin is individually configurable as an input or
output. PORTD can be configured as an 8-bit wide microprocessor Port (parallel slave
port) by setting control bit PSPMODE (TRISE<4>). In this mode, the input buffers
are TTL.

PORTE AND TRISE REGISTER:

PORTE has three pins RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7, which


are individually configurable as inputs or outputs. These pins have Schmitt Trigger
input buffers.

The PORTE pins become control inputs for the microprocessor port when bit
PSPMODE (TRISE<4>) is set. In this mode, the user must make sure that the
TRISE<2:0> bits are set (pins are configured as digital inputs). Ensure ADCON1 is
configured for digital I/O. In this mode the input buffers are TTL.

PORTE pins are multiplexed with analog inputs. When selected as an analog
input, these pins will read as '0's. TRISE controls the direction of the RE pins, even
when they are being used as analog inputs. The user must make sure to keep the pins
configured as inputs when using them as analog inputs.

MEMORY ORGANISATION:

There are three memory blocks in each of the PIC16F877 MUCs. The
program memory and Data Memory have separate buses so that concurrent access can
occur.

PROGRAM MEMORY ORGANISATION:

The PIC16f877 devices have a 13-bit program counter capable of addressing


8K *14 words of FLASH program memory. Accessing a location above the physically
implemented address will cause a wraparound.

The RESET vector is at 0000h and the interrupt vector is at 0004h.

DATA MEMORY ORGANISTION:


The data memory is partitioned into multiple banks which contain the General
Purpose Registers and the special functions Registers. Bits RP1 (STATUS<6) and
RP0 (STATUS<5>) are the bank selected bits.

RP1:RP0 Banks
00 0
01 1
10 2
11 3

Each bank extends up to 7Fh (1238 bytes). The lower locations of each bank
are reserved for the Special Function Registers. Above the Special Function Registers
are General Purpose Registers, implemented as static RAM. All implemented banks
contain special function registers. Some frequently used special function registers
from one bank may be mirrored in another bank for code reduction and quicker
access.

EEPROM:

The data EEPROM and flash program memory are readable and writable
during normal operation over the entire VDD range. A bulk erase operation may not
be issued from user code (which includes removing code protection. The data memory
is not directly mapped in the register file space. Instead it is indirectly addressed
through the special function registers (SFR).

TIMERS

There are three timers used Timer 0, Timer1 and Timer2

Timer 0

8-bit timer/counter

Software programmable prescaler


Internal or external clock select

Readable writable

Interrupt on overflow

Edge selects for external clock.

Timer 1

Timer 1 can be used as timer or counter

It is 16-bit register

Software programmable prescaler

Interrupt on overflow

Readable and writable

The timer-1 module is a 16-bit timer/counter consisting two 8-bit register


(TMR1H) and TMR1L), which are readable and writable. The TMR1 register pair
(TMR1H:TMR1L) Increments from 0000h to FFFFH and rolls over to 0000h. The
tmr1 interrupt, if enabled, is generated on overflow, which is latched in interrupt flag
bit tmr1IF. This interrupt can be enabled/disabled by setting/clearing tmr1 interrupt
enable bit tmr1IE.

Timer-2

Timer2 is an 8-bit timer with a prescaler and a postscaler. IT can be used as the
PWM Time-base for the PWM mode of the CCP module(s). The TMR2 register is
readable and writable, and is cleared on any device reset.

The input clock (Fosc/4) has a prescale option of 1:1, 1:4 OR 1:16, selected by
control bits.

The timer2 module has an 8-bit period register PR2. Timer2 increments from
00h until it match PR2 and then resets to 00h on the next increment cycle. PR2 is a
readable and writable register. The PR2 register is initialized to FFh upon reset.
ANALOG TO DIGITAL CONVERTER (ADC)

There are two types of analog to digital converter is present in this IC. We use
10-bit ADC. The ADC module can have up to eight analog inputs for a device. The
analog input charges a sample and hold capacitor. The output of sample and hold
capacitor is the input into the converter. The converter then generates a digital result of
this analog level via successive approximation. The A/D conversion of the analog
input signal results in a corresponding10-bit digital number. The A/D module has
high and low voltage reference input that is software selectable to some combination
of VDD, VSS, and RA2 or RA3.

INTERRUPTS

The PIC16F87X FAMILY HAS UPTO 14 SOURCES OF INTERRUPT. The


interrupt control register (INTCON) records individual interrupt requests in flag bits.
IT also has individual interrupt requests in flag bits. IT also has individual and global
interrupt enables bits.

Though some modules may generate multiple interrupts such as (USART)


They have 14 sources. There is a minimum of one register used in the control and
status of the interrupts.

ADDRESSING MODES:

DIRECT ADDRESSING:

In direct addressing, the operand specified by an 8-bit address field in the


instruction. Only internal data RAM and SFRs can be directly addressed.

INDIRECT ADDRESSING:

In Indirect addressing, the instruction specifies a register that contains the


address of the operand. Both internal and external RAM can indirectly address.

The address register for 8-bit addresses can be either the Stack Pointer or R0 or
R1 of the selected register Bank. The address register for 16-bit addresses can be only
the 16-bit data pointer register, DPTR.
INDEXED ADDRESSING:

Program memory can only be accessed via indexed addressing this addressing
mode is intended for reading look-up tables in program memory. A 16 bit base register
(Either DPTR or the Program Counter) points to the base of the table, and the
accumulator is set up with the table entry number. Adding the Accumulator data to the
base pointer forms the address of the table entry in program memory.

Another type of indexed addressing is used in thecase jump instructions. In


this case the destination address of a jump instruction is computed as the sum of the
base pointer and the Accumulator data.

REGISTER INSTRUCTION:

The register banks, which contains registers R0 through R7, can be accessed by
instructions whose opcodes carry a 3-bit register specification. Instructions that access
the registers this way make efficient use of code, since this mode eliminates an
address byte. When the instruction is executed, one of four banks is selected at
execution time by the row bank select bits in PSW.

OSCILLATOR AND CLOCK CIRCUIT:

XTAL1 and XTAL2 are the input and output respectively of an inverting
amplifier which is intended for use as a crystal oscillator in the pioerce configuration,
in the frequency range of 1.2 MHz to 12 Mhz. XTAL2 also the input to the internal
clock generator.

To drive the chip with an internal oscillator, one would ground XTAL1 and
XTAL2. Since the input to the clock generator is divide by two filip flop there are no
requirements on the duty cycle of the external oscillator signal. However, minimum
high and low times must be observed.

The clock generator divides the oscillator frequency by 2 and provides a tow
phase clock signal to the chip. The phase 1 signal is active during the first half to each
clock period and the phase 2 signals are active during the second half of each clock
period.
CPU TIMING:

A machine cycle consists of 6 states. Each stare is divided into a phase / half,
during which the phase 1 clock is active and phase 2 half. Arithmetic and Logical
operations take place during phase1 and internal register - to register transfer take
place during phase 2

APPLICATIONS OF MICROCONTROLLERS

Microcontrollers are designed for use in sophisticated real time applications


such as

1. Industrial Control

2. Instrumentation and

3. Intelligent computer peripherals

They are used in industrial applications to control

Motor

Robotics

Discrete and continuous process control

In missile guidance and control

In medical instrumentation

Oscilloscopes

Telecommunication

Automobiles

For Scanning a keyboard

Driving an LCD

For Frequency measurements


Period Measurements

RESET

Reset is used for putting the microcontroller into a 'known' condition. That
practically means that microcontroller can behave rather inaccurately under certain
undesirable conditions. In order to continue its proper functioning it has to be reset,
meaning all registers would be placed in a starting position. Reset is not only used
when microcontroller doesn't behave the way we want it to, but can also be used when
trying out a device as an interrupt in program execution, or to get a microcontroller
ready when loading a program.

SOLAR CELL/PLATE

A solar cell or photovoltaic cell is a device that converts solar energy into
electricity by the photovoltaic effect. Sometimes the term solar cell is reserved for
devices intended specifically to capture energy from sunlight, while the term
photovoltaic cell is used when the source is unspecified. Assemblies of cells are used
to make solar panel, solar modules, or photovoltaic arrays. Photovoltaic is the field of
technology and research related to the application of solar cells for solar energy. Solar
cell efficiencies vary from 6% for amorphous silicon-based solar cells to 40.7% with
multiple junction research lab cells and 42.8% with multiple dies assembled into a
hybrid package. Solar cell energy conversion efficiencies for commercially available
multicrystalline Si solar cells are around 14- 19%. Solar cells can also be applied to
other electronics devices to make it self-power sustainable in the sun. There are solar
cell phone chargers, solar bike light and solar camping lanterns that people can adopt
for daily use.

STEPPER MOTOR

A stepper motor is an electro-mechanical device which converts electrical


pulses into discrete mechanical movements. 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 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.

FIG: STEPPER MOTOR


ADVANTAGES

ADVANTAGES
ADVANTAGES

1. Conservation of Non Renewable energy sources.

2. Voltage measuring display on LCD.

3. Maximum output can be obtained.

4. Efficient and low cost design.

5. Low power consumption.


APPLICATIONS

APPLICATIONS
APPLICATIONS

1. This energy can be utilized for simple house hold appliances.

2. This energy can be stored and utilized as backup power supply mainly in industries.
PROGRAM

PROGRAM

#include <16F73.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT //Crystal osc <= 4mhz
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //No brownout reset

#use delay(clock=4000000)

#define STEP_DELAY 200


#include "lcdx.c"
volatile struct
{
unsigned int stepper_nibble:4;
unsigned int unused:4;
}portc={0,0};

enum ldr
{LDR1=0,LDR2,LDR3,LDR4,V_METER};

#byte TRISC = 0x87


#byte portc = 0x07

unsigned int read_adc_channel(unsigned int);


void step_clockwise(void);
void step_anticlockwise(void);

void main()
{
unsigned int x,y;
float vltg = 0.0f;
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);
lcd_init();
TRISC = 0;
while(TRUE)
{
x = (read_adc_channel(LDR1) + read_adc_channel(LDR2))/2;
y = (read_adc_channel(LDR2) + read_adc_channel(LDR3))/2;
if(x-y < 10 && x-y > -10);
else if(x > y)
{
step_clockwise();
}
else if(x < y)
{
step_anticlockwise();
}

vltg = (float)read_adc_channel(V_METER)*12/(float)255;
vltg += vltg*.048f+0.4f;
printf(lcd_putc,"\fVoltage = %2.2f",vltg);
}
}

unsigned int read_adc_channel(unsigned int channel)


{
set_adc_channel(channel);
delay_us(20);
return read_adc();
}
void step_clockwise()
{
switch(portc.stepper_nibble)
{
case 0:
portc.stepper_nibble = 0x01;
break;
case 1:
portc.stepper_nibble = 0x02;
break;
case 2:
portc.stepper_nibble = 0x04;
break;
case 4:
portc.stepper_nibble = 0x08;
break;
case 8:
portc.stepper_nibble = 0x01;
break;
}
delay_ms(200);
}

void step_anticlockwise()
{
switch(portc.stepper_nibble)
{
case 0:
portc.stepper_nibble = 0x08;
break;
case 1:
portc.stepper_nibble = 0x08;
break;
case 2:
portc.stepper_nibble = 0x01;
break;
case 4:
portc.stepper_nibble = 0x02;
break;
case 8:
portc.stepper_nibble = 0x04;
break;
}
delay_ms(STEP_DELAY);
}
CONCLUSION

CONCLUSION AND SCOPE FOR FUTURE WORK

CONCLUSION
Thus, the sun tracking system was implemented which is based on PIC
microcontroller. After examining the information obtained in the data analysis section,
it can be said that the proposed sun tracking solar array system is a feasible method of
maximizing the energy received from solar radiation. The controller circuit used to
implement this system has been designed with a minimal number of components and
has been integrated onto a single PCB for simple assembly. The use of stepper motors
enables accurate tracking of the sun while keeping track of the array's current position
in relation to its initial position. The automatic solar radiation tracker is an efficient
system for solar energy collection. It has been shown that the sun tracking systems can
collect about 8% more energy than what a fixed panel system collects and thus high
efficiency is achieved through this tracker. 8% increase in efficiency is not the most
significant figure; it can be more prominent in concentrating type reflectors.

SCOPE FOR FUTURE WORK

To improve the sun tracking, a standalone sun tracker can be designed using 18
series PIC microcontroller. In 18 series PIC microcontroller, data can be stored
periodically in MMC card .We need not to do it manually (no need of
rotation).Alignment can be varied changing with season. Moreover, concentrating
type collectors are more efficient than flat plate collectors. It can be used to increase
efficiency.
REFERENCES

REFERENCES
www.microchip.com

www.national.com

Вам также может понравиться