You are on page 1of 49

A Novel wireless self powered

Microcontroller based monitoring circuit for

Photo Voltaic panels in Grid connected

Chapter 1
1.1 Abstract
The project aims in designing an embedded system which is capable of operating from the power
supply obtained by the photo voltaic panel (self-powered). The system consists of a
Microcontroller which acts as a control unit for the whole system. The obtained energy from
photo voltaic panel is fed to regulated power supply unit which provides 5V DC required for the
operation of the Microcontroller. Also, the voltage is fed to the Microcontroller through voltage
measuring circuit which measures the energy obtained and displays on LCD and also, transmit
this information using Zigbee based transmitter. In the receiver section this information is fed to
Microcontroller which is interfaced to PC. The energy obtained is displayed in the hyper terminal
of PC. The Microcontroller is programmed using powerful Embedded C programming. Zigbee is
a wireless technology developed as an open global standard to address the unique needs of lowcost, low-power, wireless sensor networks. Zigbee is the set of specs built around the IEEE
802.15.4 wireless protocol. As Zigbee is the upcoming technology in wireless field, we had tried
to demonstrate its

way of functionality and various aspects like kinds, advantages and

disadvantages using a small application of controlling the any kind of electronic devices and
machines. The Zigbee technology is broadly adopted for bulk and fast data transmission over a
dedicated channel.

1.2 project objectives

The main objectives of the project are:
1. Usage of solar energy.
2. Voltage measurement and display on PC.
3. Wireless data transmission.

1.3 Learning Outcomes

The project provides the following learnings:
1. Interfacing PC to Microcontroller.
2. Interfacing Zigbee modules to Microcontroller.
3. Interfacing LCD to Microcontroller.
4. Photovoltaic panel.

1.4 Main building blocks

The main building blocks of the project are:
1. Regulated Power Supply.
2. Microcontroller.
3. MAX 232.
4. Crystal oscillator.
5. Reset.
6. LCD with driver.
7. Zigbee module.
8. Crystal oscillator.
9. LED indicators.

Chapter 2
Block Diagram
2.1 Transmitter side block diagram

2.2 Receiver Side block diagram

Chapter 3
Component Discription
The Power Supply unit is used to provide a constant 5 volts Regulated Supply to
different ICs this is standard circuits using external 12 VDC adapter and fixed 3-pin voltage
regulator. Diode is added in series to avoid Reverse Voltage Protection.


Resistor is a passive component used to control current in a circuit. Its resistance is given by the
ratio of voltage applied across its terminals to the current passing through it. Thus a particular
value of resistor, for fixed voltage, limits the current through it. They are omnipresent in
electronic circuits.

An electric resistor is a two-terminal passive component specifically used to oppose and limit
current. A resistor works on the principle of Ohms Law which states that voltage across the
terminals of a resistor is directly proportional to the current flowing through it.

The different value of resistances are used to limit the currents or get the desired voltage drop
according to the current-voltage rating of the device to be connected in the circuit. For example,
if an LED of rating 2.3V and 6mA is to be connected with a supply of 5V, a voltage drop of 2.7V
(5V-2.3V) and limiting current of 6mA is required. This can be achieved by providing a resistor
of 450 connected in series with the LED.

Resistors can be either fixed or variable. The low power resistors are comparatively smaller in
size than high power resistors. The resistance of a resistor can be estimated by their colour codes
or can be measured by a multimeter. There are some non linear resistors also whose resistance
changes with temperature or light. Negative temperature coefficient (NTC), positive temperature
coefficient (PTC) and light dependent resistor (LDR) are some such resistors. These special
resistors are commonly used as sensors. Read and learn about internal structure and working of
a resistor.

Pin Diagram:


Capacitor is a passive component used to store charge. The charge (q) stored in a capacitor is the
product of its capacitance (C) value and the voltage (V) applied to it. Capacitors offer infinite
reactance to zero frequency so they are used for blocking DC components or bypassing the AC
signals. The capacitor undergoes through a recursive cycle of charging and discharging in AC
circuits where the voltage and current across it depends on the RC time constant. For this reason,
capacitors are used for smoothing power supply variations. Other uses include, coupling the

various stages of audio system, tuning in radio circuits etc. These are used to store energy like in
a camera flash.
Capacitors may be non-polarized/polarized and fixed/variable. Electrolytic capacitors are
polarized while ceramic and paper capacitors are examples of non polarized capacitors. Since
capacitors store charge, they must be carefully discharged before troubleshooting the circuits.
The maximum voltage rating of the capacitors used must always be greater than the supply
voltage. Click to learn more about working of a capacitor along with its internal structure.

A Diode is the simplest two-terminal unilateral semiconductor device. It allows current to flow
only in one direction and blocks the current that flows in the opposite direction. The two
terminals of the diode are called as anode and cathode. The symbol of diode is as shown in the
figure below.

The characteristics of a diode closely match to that of a switch. An ideal switch when open
does not conduct current in either directions and in closed state conducts in both directions.
The characteristic of a diode is as shown in the figure below.

Ideally, in one direction that is indicated by the arrow head diode must behave short circuited and
in other one that opposite to that of the direction of arrow head must be open circuited. By ideal
characteristics, the diodes is designed to meet these features theoretically but are not achieved
practically. So the practical diode characteristics are only close to that of the desired.

Diodes are used in various applications like rectification, clipper, clamper, voltage multiplier,
comparator, sampling gates and filters.
Rectification The rectification means converting AC voltage into DC voltage. The
common rectification circuits are half wave rectifier (HWR), full wave rectifier (FWR) and
bridge rectifier.

Half wave rectifier: This circuit rectifies either positive or negative pulse of the
input AC. The figure is as shown below:

Full wave rectifier: This circuit converts the entire AC signal into DC. The figure is
as shown below:

Bridge rectifier: This circuit converts the entire AC signal into DC. The figure is as
shown below:

Clipper- Diode can be used to clip off some portion of pulse without distorting the
remaining part of the waveform. The figure is as shown below:

Clamper A clamping circuit restricts the voltage levels to exceed a limit by shifting the
DC level. The peak to peak is not affected by clamping. Diodes with resistors and capacitors are
used to make clamping circuits. Sometimes independent DC sources can be used to provide
additional shift. The figure is as shown below:


The current that flows through a diode is given by the equation:

where ID - diode current. (Positive for forward and negative for reverse)
IS - constant reverse saturation current
V - applied voltage. (Positive for forward and negative for reverse)
- factor dependent upon the nature of semiconductor. (1 for
germanium and 2 for silicon)
VT - volt equivalent of temperature which is given by T/11600. (T is
Temperature in Kelvin)
When a forward voltage is applied at the terminals of a diode, the diode begins to conduct.
During conduction, the cut in or threshold voltage exceeds the applied forward voltage. The
threshold voltage for a germanium diode is 0.3V and for silicon diode is 0.7V. The forward
current (miliampere range) initially increases linearly and then increases exponentially for high

When a a reverse voltage is applied, a reverse saturation current flows through the diode. The
diode continues to be in the non conducting state until the reverse voltage drops below the zener
voltage. As the reverse voltage approximates the peak inverse voltage a breakdown called as the
Avalanche breakdown occurs. During the breakdown, the minority charge carriers ionize the
stable atoms which are followed by a chain ionization to generate a large number of free charge
carriers. Thus the diode becomes short circuited and gets damaged.

Note: When diodes are connected in series their equivalent peak inverse voltage is increased
while in parallel connection the current carrying capacity is increased.

As the temperature increases, the electron pairs generated thermally also increases thereby
increasing the conductivity in both directions. The reverse saturation current also increases with
the increase in temperature. The change is 11% per C for a germanium diode and 8% per C for
a silicon diode. On the other hand the diode current is doubled for every 10C rise. With increase
in voltage, the firing voltage in forward characteristics is reduced while peak reverse voltage is

Note: The peak inverse voltage can be reduced by increasing the doping level. The same
concept is used to design zener diodes.


All electrical relays have one thing in common--they control things where it is inconvenient or
impossible for a person to flip a switch. For example, electrical relays are used to turn on the
motor to open an automatic garage door, as well as to turn on a furnace.
Many modern relays are "solid state," meaning they use transistor-like devices to do their work.
Electromechanical relays, however, are still in use, and the working parts are easy to see and
understand. They include an electromagnet, which is turned on by a low-voltage control circuit,
and a contact switch, which in turn controls the load circuit. When the electromagnet is
energized, it behaves just like someone flipping a light switch, by pulling the switch up or down.
Poles and Throws
A simple electrical circuit requires two wires. Break one wire leading to a lamp, and it goes
out. That is exactly what most household switches do. Called a single pole switch, it opens one
wire in the circuit. Because it only turn the light on or off, it is also called single throw. This type
of switch is labeled SPST. For a "three-way" circuit, however, a different kind of switch is
required; it is never off, it just routes one side of the circuit over one of two wires. If both
switches are set on the same wire, the lamp goes on. I f they are set on different wires, the
lamp goes off. This kind of switch is a single pole, double throw (because it has two "on"
positions), or SPDT.

The main circuit breaker in any building is another type of switch. It positively disconnects all
of the power to the building, so it breaks both sides of the circuit. This is a double pole switch,
and because it is only on or off, it is a single throw, so it is a DPST switch.
The DPDT relay is the fourth kind of simple switch. The "DP" means that it is double pole, so
it switches both sides of the circuit, and the "DT" means that rather than just turning on and
off, it switches from one set of wires to another.

DPDT stands for double pole double throw relay. Relay is an electromagnetic device used to
separate two circuits electrically and connect them magnetically. They are often used to interface
an electronic circuit, which works at a low voltage to an electrical circuit which works at a high
voltage. Relays are available in different configuration of operating voltages like 6V, 9V, 12V,
24V etc.
There are two sections input and output. The input section consists of a coil with two pins which
are connected to the ground and the input signal. The output section consists of contactors which
connect or disconnect mechanically. The output section consists of six contactors with two sets.
Each set has three changeover contacts, namely, normally open (NO), normally closed (NC) and
common (COM). When no supply is given the COM is connected to NC. When the operating
voltage is applied the relay coil gets energized and the COM changes contact to NO.

DPDT relay can be used to power wither one device/appliance or another. While SPDT relay
can only switch the output circuit between on and off states; a DPDT relay can also be used to
change the polarity at the terminals of a device connected at output. For example, to drive a DC
motor in both clockwise and anticlockwise directions, following connections can be done. Pins 2
& 7 can be provided with Vcc (9V for motor) and ground, respectively. The first motor terminal
can be connected to pins 3 & 4 while the other terminal to pins 5 & 6. In case no input signal is
given, the motor would rotate in one direction (say clockwise, depending upon the connection of
its terminals). When an input signal is provided, the contactors change their positions, resulting
in the anticlockwise rotation of motor.
Pin Diagram:

7805 IC
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear voltage
regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed
voltage output. The voltage regulator IC maintains the output voltage at a constant value. The
xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V
regulated power supply. Capacitors of suitable values can be connected at input and output pins
depending upon the respective voltage levels.

Light emitting diodes

Light emitting diodes (LEDs) are semiconductor light sources. The light emitted from LEDs
varies from visible to infrared and ultraviolet regions. They operate on low voltage and power.
LEDs are one of the most common electronic components and are mostly used as indicators in
circuits. They are also used for luminance and optoelectronic applications.

Based on semiconductor diode, LEDs emit photons when electrons recombine with holes on
forward biasing. The two terminals of LEDs are anode (+) and cathode (-) and can be identified
by their size. The longer leg is the positive terminal or anode and shorter one is negative

The forward voltage of LED (1.7V-2.2V) is lower than the voltage supplied (5V) to drive it in a
circuit. Using an LED as such would burn it because a high current would destroy its p-n gate.
Therefore a current limiting resistor is used in series with LED. Without this resistor, either low
input voltage (equal to forward voltage) or PWM (pulse width modulation) is used to drive the
LED. Get details about internal structure of a LED.


BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of resistance, is
commonly used to amplify current. A small current at its base controls a larger current at
collector & emitter terminals.

BC547 is mainly used for amplification and switching purposes. It has a maximum current gain
of 800. Its equivalent transistors are BC548 and BC549.

The transistor terminals require a fixed DC voltage to operate in the desired region of its
characteristic curves. This is known as the biasing. For amplification applications, the transistor
is biased such that it is partly on for all input conditions. The input signal at base is amplified and
taken at the emitter. BC547 is used in common emitter configuration for amplifiers. The voltage
divider is the commonly used biasing mode. For switching applications, transistor is biased so
that it remains fully on if there is a signal at its base. In the absence of base signal, it gets
completely off.


When AC is applied to the primary winding of the power transformer it can either be
stepped down or up depending on the value of DC needed. In our circuit the transformer of
230v/15-0-15v is used to perform the step down operation where a 230V AC appears as 15V AC
across the secondary winding. One alteration of input causes the top of the transformer to be
positive and the bottom negative. The next alteration will temporarily cause the reverse. The
current rating of the transformer used in our project is 2A. Apart from stepping down AC
voltages, it gives isolation between the power source and power supply circuitries.
In the power supply unit, rectification is normally achieved using a solid state diode.
Diode has the property that will let the electron flow easily in one direction at proper biasing
condition. As AC is applied to the diode, electrons only flow when the node and cathode is
negative. Reversing the polarity of voltage will not permit electron flow.
A commonly used circuit for supplying large amounts of DC power is the bridge rectifier.
A bridge rectifier of four diodes (4*IN4007) are used to achieve full wave rectification. Two
diodes will conduct during the negative cycle and the other two will conduct during the positive
half cycle. The DC voltage appearing across the output terminals of the bridge rectifier will be
somewhat lass than 90% of the applied rms value. Normally one alteration of the input voltage
will reverse the polarities. Opposite ends of the transformer will therefore always be 180 deg out
of phase with each other.
For a positive cycle, two diodes are connected to the positive voltage at the top winding
and only one diode conducts. At the same time one of the other two diodes conducts for the
negative voltage that is applied from the bottom winding due to the forward bias for that diode.
In this circuit due to positive half cycleD1 & D2 will conduct to give 10.8v pulsating DC. The
DC output has a ripple frequency of 100Hz. Since each altercation produces a resulting output
pulse, frequency = 2*50 Hz. The output obtained is not a pure DC and therefore filtration has to
be done.


Filter circuits which are usually capacitors acting as a surge arrester always follow the
rectifier unit. This capacitor is also called as a decoupling capacitor or a bypassing capacitor, is
used not only to short the ripple with frequency of 120Hz to ground but also to leave the
frequency of the DC to appear at the output. A load resistor R1 is connected so that a reference to
the ground is maintained. C1R1 is for bypassing ripples. C2R2 is used as a low pass filter, i.e. it
passes only low frequency signals and bypasses high frequency signals. The load resistor should
be 1% to 2.5% of the load.
1000f/25v : for the reduction of ripples from the pulsating.

: for maintaining the stability of the voltage at the load side.O,


: for bypassing the high frequency disturbances.


The LM78XX series of three terminal regulators is available with several fixed output
voltages making them useful in a wide range of applications. One of these is local on card
regulation, eliminating the distribution problems associated with single point regulation. The
voltages available allow these regulators to be used in logic systems, instrumentation, HiFi, and
other solid state electronic equipment. Although designed primarily as fixed voltage regulators
these devices can be used with external components to obtain adjustable voltages and currents.
The LM78XX series is available in an aluminum TO-3 package which will allow over 1.0A load
current if adequate heat sinking is provided. Current limiting is included to limit the peak output
current to a safe value. Safe area protection for the output transistor is provided to limit internal
power dissipation.
If internal power dissipation becomes too high for the heat sinking provided, the thermal
shutdown circuit takes over preventing the IC from overheating. Considerable effort was
expanded to make the LM78XX series of regulators easy to use and minimize the number of
external components. It is not necessary to bypass the output, although this does improve

transient response. Input bypassing is needed only if the regulator is located far from the filter
capacitor of the power supply. For output voltage other than 5V, 12V and 15V the LM117 series
provides an output voltage range from 1.2V to 57V.
Output current in excess of 1A
Internal thermal overload protection
No external components required
Output transistor safe area protection
Internal short circuit current limit
Available in the aluminum TO-3 package

Fig: 3.2 plastic Package of Voltage Regulator

These voltage regulators are monolithic integrated circuits designed as fixedvoltage
regulators for a wide variety of applications including local, oncard regulation. These regulators
employ internal current limiting, thermal shutdown, and safearea compensation. With adequate
heat sinking they can deliver output currents in excess of 1.0 A. Although designed primarily as a
fixed voltage regulator, these devices can be used with external components to obtain adjustable
voltages and currents.

Output Current in Excess of 1.0 A

No External Components Required

Internal Thermal Overload Protection

Internal Short Circuit Current Limiting

Output Transistor SafeArea Compensation

Output Voltage Offered in 2% and 4% Tolerance

Available in Surface Mount D2PAK and Standard 3Lead Transistor


Fig: 3.3 MC78XX Voltage Regulator

A common ground is required between the input and the output voltages. The input
voltage must remain typically 2.0 V above the output voltage even during the low point on the
input ripple voltage.
XX- These two digits of the type number indicate nominal voltage.
Cin- is required if regulator is located an appreciable distance from power supply filter.
CO- is not needed for stability; however, it does improve transient response. Values of
less than 0.1 mF could cause instability.


Fig: 3.4 Transformer

Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most
power supplies use a step-down transformer to reduce the dangerously high mains voltage (230V
in UK) to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There is
no electrical connection between the two coils, instead they are linked by an alternating magnetic

field created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core.

Fig: 3.5 Step Down Transformer

Transformers waste very little power so the power out is (almost) equal to the power in. Note
that as voltage is stepped down current is stepped up.

The ratio of the number of turns on each coil, called the turns ratio, determines the ratio
of the voltages. A step-down transformer has a large number of turns on its primary (input) coil
which is connected to the high voltage mains supply, and a small number of turns on its
secondary (output) coil to give a low output voltage.

Fig: 3.6 Circuit Diagram Of Power Supply

The +5 volt power supply is based on the commercial 7805 voltage regulator
IC.This IC contains all the circuitry needed to accept any input voltage from 8 to 18 volts
and produce a steady +5 volt output, accurate to within 5% (0.25 volt). It also contains
current-limiting circuitry and thermal overload protection, so that the IC won't be damaged
in case of excessive load current; it will reduce its output voltage instead.
The 1000f capacitor serves as a "reservoir" which maintains a reasonable input
voltage to the 7805 throughout the entire cycle of the ac line voltage. The two rectifier
diodes keep recharging the reservoir capacitor on alternate half-cycles of the line voltage,
and the capacitor is quite capable of sustaining any reasonable load in between charging
The 10f and .01f capacitors serve to help keep the power supply output voltage
constant when load conditions change. The electrolytic capacitor smooths out any long-term
or low frequency variations. However, at high frequencies this capacitor is not very

efficient. Therefore, the .01f is included to bypass high-frequency changes, such as digital
IC switching effects, to ground.
The LED and its series resistor serve as a pilot light to indicate when the power
supply is on. I like to use a miniature LED here, so it will serve that function without being
obtrusive or distracting while I'm performing an experiment. I also use this LED to tell me
when the reservoir capacitor is completely discharged after power is turned off. Then I
know it's safe to remove or install components for the next experiment.
The P89V51RD2 is an 80C51 microcontroller with 64 kB Flash and 1024 bytes of data
RAM. A key feature of the P89V51RD2 is its X2 mode option. The design engineer canchoose
to run the application with the conventional 80C51 clock rate (12 clocks per machine cycle)
or select the X2 mode (6 clocks per machine cycle) to achieve twice
the throughput at
the same clock frequency. Another way to benefit from this feature is to keep the same
erformance by reducing the clock frequency by half, thus
dramatically reducing the EMI.
The Flash program memory supports both parallel programming and in serial InSystem Programming (ISP). Parallel programming mode offers gang-programming at high
speed, reducing
programming costs and time to market.ISP allows a device to be
reprogrammed in the end product under software control. The capability to field/update
the application firmware makes a wide range of applications possible. The P89V51RD2 is
also In-Application Programmable (IAP), allowing the Flash program memory to be
reconfigured even while the application is running.

80C51 Central Processing Unit 5 V Operating voltage from 0 to 40 MHz 64 kB of on-chip Flash
program memory with ISP (In-System Programming) and IAP (In-Application Programming)
Supports 12-clock (default) or 6-clock mode selection via software or ISP SPI (Serial Peripheral
Interface) and enhanced UART PCA (Programmable Counter Array) with PWM and
Capture/Compare functions Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each)
Three 16-bit timers/counters Programmable Watchdog timer (WDT) Eight interrupt sources with

four priority levels Second DPTR register Low EMI mode (ALE inhibit) TTL- and CMOScompatible logic levels




Supply voltage.




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 pullups. Port 0 also
receives the code bytes during Flash programming and outputs the code bytes during program
verification. External pullups are required during program verification.


Port 1 is an 8-bit bidirectional I/O port with internal pullups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the
internal pullups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled
low will source current (IIL) because of the internal pullups. 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 following table.
Port 1 also receives the low-order address bytes during Flash programming and

3.1 Table for port 0


Port 2 is an 8-bit bidirectional I/O port with internal pullups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the
internal pullups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled
low will source current (IIL) because of the internal pullups. Port 2 emits the high-order address
byte during fetches from external program memory and during accesses to external data memory

that use 16-bit addresses (MOVX @DPTR). In this application, Port 2 uses strong internal
pullups 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 is an 8-bit bidirectional I/O port with internal pullups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the
internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled
low will source current (IIL) because of the pullups. Port 3 also serves the functions of various
special features of the AT89S51, as shown in the following table.
Port 3 also receives some control signals for Flash programming and verification.

3.2 Table for port 3


Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives High for 96 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.


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 (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 during each access to external data memory. If desired, ALE operation can
be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a
MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable
bit has no effect if the microcontroller is in external execution mode.


Program Store Enable (PSEN) is the read strobe to external program memory. When the
AT89S51 is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to external data


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.


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


Output from the inverting oscillator amplifier.


XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2. There are no
requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.



Fig: 3.10 Fig Of Oscillator connection

TMOD (Timer Mode Register):









GATE: When set, start and stop of timer by hardware

When reset, start and stop of timer by software

C/T: Cleared for timer operation

Set for counter operation





13-bit timer mode

16-bit timer mode

8-bit timer mode

Split timer mode

TCON (Timer Control Register):

Address =88H
Bit addressable










Timer overflow flag. Set by hardware when the timer/counter overflows. It is cleared by
hardware, as the processor vectors to the interrupt service routine.


Timer run control bit. Set or cleared by software to turn timer or counter on/off.


Set by CPU when the external interrupt edge (H-to-L transition) is detected. It is
cleared by CPU when the interrupt is processed.


Set/cleared by software to specify falling edge/low-level triggered external


Chapter 4
Zigbee Transmission System
The IEEE 802.15.4 is a new personal wireless area network standard designed for applications
like wireless monitoring andcontrol of lights, security alarms, motion sensors, thermostats and

smoke detectors. IEEE 802.15.4 specifies physical and media access control layers that have
been optimised to ensure lowpower consumption. The MAC layer defines different network
topologies, including a star topology (with one node working as a networkcoordinator, like an
access point in IEEE 802.11), tree topology (where some nodes communicate through other
nodes to send data to the network coordinator),and mesh topology (where routing responsibilities
are distributed between nodesand master coordinator is not needed). In this report a star network
topology according to the 802.15.4 standard is simulated with simulator ns- 2. The goals of the
thesis are to build a simulation model and to investigate different functional modes of IEEE
802.15.4 and their impact on energy consumption and network performance. Different
application scenarios are evaluated. The simulation results are generated with parameter input
from ZMDs chip, ZMD44101.

4.1 Introduction
ZIGBEE is a new wireless technology guided by the IEEE 802.15.4 Personal Area Networks
standard. It is primarily designed for the wide ranging automation applications and to replace the
existing non-standard technologies. It currently operates in the 868MHz band at a data rate of
20Kbps in Europe, 914MHz band at 40Kbps in the USA, and the 2.4GHz ISM bands Worldwide
at a maximum data-rate of 250Kbps. Some of its primary features are:
. Standards-based wireless technology
. Interoperability and worldwide usability
. Low data-rates
. Ultra low power consumption
. Very small protocol stack
. Support for small to excessively large networks
. Simple design
. Security, and
. Reliability

In this chapter, focus has been on the evolution of zigbee, giving an account of other
complementary technologies, both proprietary and open source, followed by some intended
applications, and a detailed introduction about the various concepts of zigbee.

4.2 Motivation
The wireless market has been traditionally dominated by high end technologies, but so far
Wireless Personal Area Networking products have not been able to make a significant impact on
the market. While some technologies like the bluetooth have been quite a success story, in the
areas like computer peripherals, mobile devices, etc, they couldnt be expanded to the
automation arena. This led to the invention of the wireless low datarate personal area networking
technology, Zigbee (IEEE 802.15.4), for the home/Industrial automation. It has received a
tremendous boosting among the industry leaders and critics have been quick enough to indicate
that no less than 80 million zigbee products will be shipped by the end of 2006[8]. A group of
companies, called the Zigbee Alliance, have been working together to enable reliable, costeffective, low-power, wirelessly networked monitoring andcontrol products, based on 802.15.4.
The alliance has been putting considerable weight on the possible success of this technology.
Industry leaders like Ember, FreeScale, HoneyWell, Phillips, Motorola, Samsung, ZMD, and a
hundred such companies are backing it. Also the alliance is striving to make this technology
applicable worldwide by involving corporates around the globe. Currently the alliance
is worth over a hundred other companies and is continually growing. The size of this alliance
cannot ensure its popularity and widespread use, however, it does indicate a commitment of the
industry to focus on one technology rather than going haphazardly in designing their automation
products based on self-developed technologies.

4.3 Evolution of zigbee

During the last decade there has been an explosion of devices using sensor technologies for
control and monitoring purposes. Wired Sensors are now intended to be replaced with wireless
technologies. Corporates have been envisioning of a digital home where every device is
connected, and remotely
controlled and monitored. Even though a perfect digital home is yet a mirage, we are now able to
apply several technologies to suite our home and industrial networking needs. However, this
concept of a digitally connected home has received a luke warm response due to lack of viable
solutions. Over the years, several possible contenders have been identified. But none match the
robustness and reliability required for the automation applications. Robustness when it comes to
critical application scenarios as applicable to industrial needs and reliability when it comes to
power usage and prompt response.

4.4 Contenders

Several wireless technologies are already in existence and the first question that arises when we
speak of a new technology is why do we need yet another technology? Well, there are a number
of reasons to support our requirement for a new technology. Firstly is the non-availability of a
standard, reliable, worldwide applicable technology. To provide evidence to this statement a
small study of the existing standards and how they fail to fulfill the needs of a viable low-power,
low-datarate technology. Before we go on to describe the competing technologies, lets focus on
what we aim at. The current focus is on home/building/industrial applications. As is obvious, to
provide controlling and monitoring services, it is not necessary to have higher data rates.
Similarly, several of the application scenarios make it difficult to apply high power consuming
devices. So the two primary factors in this study is power consumption and data-rate. What
makes major technologies unfit for the current challenge is the very thing they are designed for.
Most technologies designed so far, primarily focus either directly or indirectly on the ability to
support higher datarates, with wider operating space (range), which has a direct impact on the
power requirements, which inturn influence the cost factor, size, complexity in design and

feasibility of application. None of them have been able to overcome these barriers to suite the
needs of home/industrial automation. The following subsections look at other peer technologies
which are predominantly used as networking, automation and sensor technologies. Their
feasibility to apply for home automation needs is studied, giving an account of how they fail to
provide a viable solution, and finally a solution leading to zigbee has been presented.

It would be wrong even to say, WI-FI ever was a contender for home automation. With its higher
bandwidth support and power thirsty features, it is highly unlikely it is used for home
automation, other than the applications that need Audio/Video transmissions.

Bluetooth is a short range communication technology, intended to replace cables connecting
portable and/or fixed electronic devices. Its key features being robust, low complexity, low
power and low cost technology. It utilizes the unlicensed 2.4GHz ISM Band, a globally available
frequency band, with frequency hopping and avoids interference by hopping to a new frequency
1600 times a second and using small packet size. It has a range of over 10 meters and can easily
extend to 100 meters with a power boost. It can transfer data at a maximum range of 720 Kbps.
With the current specifications a small network (called, piconet) can be formed with as many as
seven slave devices and a master coordinator. Also, several piconets can be linked together to
form a bigger network. Typical applications include, intelligent devices (PDAs, Cell phones,
PCs), data peripherals (mice, keyboards, joysticks, cameras, printers, lan access points), audio
peripherals (headsets, speakers, stereo receivers) and embedded applications[2]. Based on its
application sphere and its features, we can conclude bluetooth can be a good contender for
automation. But the effort of Bluetooth to cover more applications and provide quality of service
(QoS) has led to its deviation from the design goal of simplicity. The complexity of bluetooth
makes it expensive and inappropriate for some applications requiring low-cost and low-power

applications. Another major constraint being its lack of flexibility in its topologies as in the
scatternets. Research shows that Bluetooth faces scalability problems[3][4].
Using infrared radiation as a medium of short-range high-speed communication has been in
existence for over a decade now. Virtually every home appliance comes with an infrared
commander. Their popularity in the home appliance market brought down the prices of Infrared
emitters and detectors to throw away rates. Also the spectral band offers unlimited band and is
unregulated worldwide[5]. It is this technology that zigbee has set out to replace. A typical
household, currently use as many as 5-10 remote commanders. As more and more appliances are
intended to be remotely controlled, more infrared devices are used. Devices such as TVs, garage
door openers, and light and fan controls predominantly support one-way, point-to-point control.
Theyre not interchangeable and they dont support more than one device. Because most
remotely controlled devices are proprietary and not standardized among manufacturers, even
those remotes used for the same function (like turning on and off lights) are not interchangeable
with similar remotes from different manufacturers. So if there is a centralized controlling device
which can be used to form a network among all the devices present, as in a home area network,it
could be possible to solve some of these problems.

Z-Wave is a proprietary short-range low-datarate wireless technology, owned by Zensys Inc. The
provider has aligned with over a hundred other companies to provide building automation
services. Z-Wave is a wireless RF-based communications technology designed for residential
and light commercial control and status reading applications such as meter reading, lighting and
appliance control, HVAC, access control, intruder and fire detection, etc.
Z-Wave transforms any stand-alone device into an intelligent networked device that can be
controlled and monitored wirelessly. Z-Wave delivers high quality networking by focusing on
narrow bandwidth applications and substituting costly hardware with innovative software
solutions. Zensys claims that Z-Wave is superior to zigbee in several ways, such as operating at

908 MHz in the United States and at 868 MHz in Europe, meaning that it wont interfere with
WiFi as zigbee sometimes. In Zensys says zigbee requires 10 times the power that Z-Wave does.
This is one possible contending technology that may need to be watched noting its high pitched
claims of better performance than zigbee.

Of the few attempts to establish a standard for home networking that would control various home
appliances, the X-10 protocol is one of the oldest. It was introduced in 1978 for the Sears Home
Control System and the Radio Shack Plugn Power System. It uses power line wiring to send and
receive commands. The X-10 PRO code format is the de facto standard for power line carrier
transmission. X-10 transmissions are synchronized to the zero-crossing point of the AC power
line. A binary 1 is represented by a 1ms burst of 120KHz at the zero-cross point and binary 0 by
the absence of 120KHz. The network consists of transmitter units, receiver units, and
bidirectional units that can receive and
transmit X-10 commands. Receiving units work as remote control power switches to control
home appliances or as remote control dimmers for lamps. The transmitter unit is typically a
normally-open switch that sends a predefined X-10 command if the switch is closed. The X-10
commands enable you to change the status of the appliance unit (turn it on or off) or to control
the status of a lamp unit (on, off, dim, bright). Bidirectional units may send their current status
(on or off) upon request. A special code is used to accommodate the data transfer from analog
sensors. Currently, a broad range of devices that control home appliances using the X-10
protocol is available from Radio Shack or web retailers such as and Availability and simplicity have made X-10 the best-known home automation
standard. It enables plugand- play operation with any home appliance and doesnt require special
knowledge to configure and operate a home network. The downside of its simplicity is slow
speed, low reliability, and lack of security. The effective data transfer rate is 60bps, too slow for
any meaningful data communication between nodes. High redundancy in transition is dictated by
heavy signal degradation in the power line. For any power appliances, the X-10 transmission
looks like noise and is subject to removal by the power line filters. Reliability and security issues

rule out the use of the X-10 network for critical household applications like remote control of an
entry door.
The figure 1.1 illustrates the datarate and the operating range of zigbee in comparison to the
other famous wireless technologies.

There has been tremendous excitement on part of the corporates, the market and the consumers
alike because of the wide spectrum of applications that zigbee has to offer. It is a revolutionary
new technology built to compliment or replace existing not so successful technologies.

Automation is the buzz word for zigbee. It stands to automate our household, corporate buildings
and industries. Its control and monitoring capabilities offer an excellent platform for automation.
A host of application categories/scenarios are presented here:

. Monitoring: Surveillance systems, Fire alarms, Pressure sensors, Meter reading monitors,
Health and Environment monitors.

. Control: Health, Environment, Sensors, Home, Building and Industry Automation . Efficiency,

Theoretically there can be innumerable number of applications. It only depends on how better we
tend to harness the flexibility, and services offered by zigbee. As already stated, these are merely
applications that are intended/desired and there may be scenarios where this technology cannot
be successfully
applied. Firstly, these application scenarios can be applied broadly into three application spheres,
based on the complexity, feasibility and requirements posed by each sphere of application.
. Home
. Building
. Industrial
Each of the application categories, even though look very similar, apply differently to each of the
application spheres. For example, controlling the lighting system are no way similar to the home
and the Industrial application spheres. To have a better understanding on how well these
technologies can be applied to make our lives even more lazy and loathsome, lets go through
some of these applications in detail. Monitoring is a part of our daily activity. In industrial

applications there are personnel deployed to monitor certain critical situations. Its significance is
no way inferior in the home application sphere. At
home, the contents of the refrigerator, environmental, health and resource (water, power
consumption, gas, fuel, etc)management need constant monitoring. Imagine a situation where the
refrigerator shops for items that are frequently used but are currently low on stock. A simple
monitoring device, constantly monitoring the contents of the refrigerator, by waking up at
prescribed intervals, and informing the controlling station about the current inventory level, can
be installed. The controlling station, will be intelligent enough to decide if its time to shop for a
particular item and prepares the order form and either issues it to its master or directly to the
supermarket through the internet. Similarly, consider an industrial application where a bigger and
intelligent controlling node is stationed at a manufacturing plant. Several smaller nodes spread
across the plant which constantly keeps posting the central controlling node about the current
status of the individual machine. And now lets assume thermostats, boilers, pressure applying
devices, a motion detection camera for intruder detection, etc are operational across the plant.
These devices either wake up at regular intervals, or constantly monitorthe given
machine/application. Critical applications like security sensors need to be constantly active,
where as thermostats, pressure sensors, etc need not have a constant monitoring solution. And
any abnormalities that these sensors observe are reported back to the controlling station, which
then executes the appropriate service routines. It can call on the security staff, when the security
camera detects unwanted motion. Or it can merely relay the archived video of the past few
minutes back to the security control room. Similarly, a pressure threshold break can be reported
back to the concerned personnel. Similarly, this technology can be conveniently applied to obtain
better efficiency and conservation of scarce and precious resources.

. Configuring and running multiple systems from a single remote control

. Automate data acquisition from remote sensors to reduce user intervention

. Provide detailed data to improve preventive maintenance programs

. Reduce energy expenses through optimized HVAC management
. Allocate utility costs equitably based on actual consumption
There is no dearth of applications for this technology. But key to such implementations are cost,
power consumption and bandwidth requirements.

Chapter 5
Circuit diagram
5.1 Transmitter side circuit diagram

5.2 Receiver side circuit diagram

Chapter 6

The monitoring and control system of Solar PV Power Generation consists of three
layers: the sensor layer, the PLC field monitoring and control layer and the remote
network monitoring and control layer. The sensor layer is the lowest layer which is
in charge of collecting state information; the PLC field monitoring and control
layer is middle layer which is in charge of spot communicationtest and control,
collecting and processing information; the remote network monitoring and control
layer is in charge of realizing the optimized control, failure diagnosis. The solar
photovoltaic (PV) power generation utilizes solar PV array to achieve
photoelectric conversion. The amount of solar PV array is so large and the
distribution of solar PV array is so wide that in the sensor layer, it is difficult and
expensive to transmit signals with cable connection. On the other hand, the signals
are all weak the cable connection will consume the power of signals and
decrease the anti-jamming ability. ZigBee wireless sensor network can not only
save the cost but also realize signals lossless and reliable transmission. The
wireless communication technology ZigBee is a data communication network
protocol based on the underlying short-range data 802.15.4, which is a two-way
wireless communication technology of short range, low complexity, low power
consumption, low rate and low-cost [1-3].
It is mainly applied to the electronic equipments of short range, low power
consumption and low transmission speed to transmit data as well as the
transmission of periodic, intermittent and low reaction time data. The topological
structure of the wireless sensor network of ZigBee, photovoltaic power system, is
adopted. The device type of the network panel point includes FFD and RFD. FFD

acts as the network coordinator to establish, initialize, and configure network. As

the terminal panel point, RFD connects various kinds of sensors and deliver
information to FFD (RFD can only contact FFD and RFD cannot contact among
themselves). The Network will choose an FFD as the main FFD panel point from
which data will be transferred to network.

Chapter 7
1. The 8051 Microcontroller and Embedded systems by Muhammad Ali Mazidi and Janice
Gillispie Mazidi , Pearson Education.
2. ATMEL 89S52 Data Sheets.