Sie sind auf Seite 1von 167

PROTECTION AND CONTROL OF LOW VOLTAGE

MOTORS USED IN INDUSTRIAL APPLICATIONS

CONTENTS
S.No.

Contents

1.

Abbreviations

2.

Abstract

3.

Introduction

5.

Block diagram

6.

Block diagram Description

7.

Schematic

8.

Schematic Description (pin to pin connectivity)

9.

Circuit Description

10.

Hardware components

Page

outside

a. Microcontroller (max 50 pages)


b. MAX 232
c. Power supply
d. ZIGBEE Transceiver
e. ADC
f. Temperature sensor
g. Current & Voltage sensor
h. Induction motor
i. LCD
j. Relay

11.

Software components
a. About Keil
b. Embedded C

12.

Source Code

13.

Conclusion or Synopsis

OUT SIDE

14.

Advantages

15.

Applications

16.

Bibliography

ABBREVIATIONS

Symbol

Name

ACC
B
PSW
SP
DPTR
DPL
DPH
P0
P1
P2
P3
IP
IE
TMOD
TCON
T2CON
T2MOD
TH0
TL0
TH1
TL1
TH2
TL2
SCON
SBUF
PCON

Accumulator
B register
Program status word
Stack pointer
Data pointer 2 bytes
Low byte
High byte
Port0
Port1
Port2
Port3
Interrupt priority control
Interrupt enable control
Timer/counter mode control
Timer/counter control
Timer/counter 2 control
Timer/counter mode2 control
Timer/counter 0high byte
Timer/counter 0 low byte
Timer/counter 1 high byte
Timer/counter 1 low byte
Timer/counter 2 high byte
Timer/counter 2 low byte
Serial control
Serial data buffer
Power control

FIGURE LOCATIONS
S.No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

Figure
Components of Typical Linear Power
Supply
An Electrical Transformer
Bridge Rectifier
Bridge Rectifier Positive Cycle
Bridge Rectifier Negative Cycle
Three terminal voltage Regulator
Functional Diagram of Microcontroller
Pin Diagram of Microcontroller
Oscillator connections
External clock drive connections
A register
B register
RAM
RAM Allocation
Register Banks
PSW
DPTR
SP
PORT 0
TL0 and TH0
DB9
Connecting Microcontroller to PC

Types of SIM Structures


Smart Card Pin-out
Smart Card Reader
LCD
MAX 232 Pin-out
MAX 232 Operating circuit
MAX 232 Logic output
Relay
Project
New Project
Select Target device

Page No.

34
35
36
37
38
39
40
41
42
43
44
45
46

Select device for Target


Copy 8051 startup code
Source group 1
New file
Opened new file
File Save
Add files to the source group
Adding files to the source group
Compilation
After Compilation
Build
Selecting the Ports to be visualized
Start Debugging

INTRODUCTION
1.1 EMBEDDED SYSTEMS:
Embedded systems are designed to do some specific task, rather than be a
general-purpose computer for multiple tasks. Some also have real time performance
constraints that must be met, for reason such as safety and usability; others may have low
or no performance requirements, allowing the system hardware to be simplified to reduce
costs.

An embedded system is not always a separate block - very often it is physically


built-in to the device it is controlling. The software written for embedded systems is often
called firmware, and is stored in read-only memory or flash convector chips rather than a
disk drive. It often runs with limited computer hardware resources: small or no keyboard,
screen, and little memory.
Wireless communication has become an important feature for commercial
products and a popular research topic within the last ten years. There are now more
mobile phone subscriptions than wired-line subscriptions. Lately, one area of commercial
interest has been low-cost, low-power, and short-distance wireless communication used
for \personal wireless networks." Technology advancements are providing smaller and
more cost effective devices for integrating computational processing, wireless
communication, and a host of other functionalities. These embedded communications
devices will be integrated into applications ranging from homeland security to industry
automation and monitoring. They will also enable custom tailored engineering solutions,
creating a revolutionary way of disseminating and processing information. With new
technologies and devices come new business activities, and the need for employees in
these technological areas. Engineers who have knowledge of embedded systems and
wireless communications will be in high demand. Unfortunately, there are few adorable
environments available for development and classroom use, so students often do not learn
about these technologies during hands-on lab exercises. The communication mediums
were twisted pair, optical fiber, infrared, and generally wireless radio.

INTRODUCTION TO THE PROJECT:


As low voltage motors are critical assets in todays industrial applications this paper
will review the applications of microcontroller-based protection and control on low
voltage motors in industrial facilities. It will review principles of low voltage motor
protection (thermal overload, ground fault, unbalance of voltage, current etc.).
Induction machines play a pivotal role in industry and there is a strong demand for
their reliable and safe operation. They are generally reliable but eventually do wear out.
Faults and failures of induction machines can lead to excessive downtimes and generate

large losses in terms of maintenance and lost revenues, and this motivates the
examination of condition monitoring. On condition monitoring involves taking
measurements on a machine while it is operating in order to detect faults with the aim of
reducing both unexpected failures and maintenance costs. This paper surveys the current
trends in on-line fault detection and diagnosis of induction machines and identifies future
research areas.
Condition monitoring of electric machinery can significantly reduce the cost of
maintenance and the risk of unexpected failures by allowing the early detection of
potentially catastrophic faults. In condition based maintenance, one does not schedule
maintenance or machine replacement based on previous records or statistical estimates of
machine failure. Rather, one relies on the information provided by condition monitoring
systems assessing the machine's condition. Thus the key for the success of condition
based maintenance is having an accurate means of condition assessment and fault
diagnosis.
Wireless sensor network for condition monitoring uses measurements taken while a
machine is operating, to determine if a fault exists. Different types of sensors can be used
to measure signals to detect these faults. Various signal processing techniques can be
applied to these sensor signals to extract particular features which are sensitive to the
presence of faults. Finally, in the fault detection stage, a decision needs to be made as to
whether a fault exists or not. The project is to monitor the operation conditions of singlephase Induction motors. This system is based on a low-cost electronic device that can
acquire and pre-process current, voltages and temperatures, and transmit processed keyinformation related to the motor operation conditions using ZIGBEE wireless technology.

BLOCK DIAGRAM:
MONITORING SECTION:

POWER
SUPPLY
ZIGBEE
TRANSCEIVER

MICRO
CONTROLLER

PC

MAX
232

MOTOR SECTION:

Micro
controller
LCD display

POWER
SUPPLY

Ground Fault
Sensor
A
D
C

ZIGBEE
TRANSCEIVER

Temperature
Sensor
Voltage
Sensor
Current
Sensor
Motor
Motor Driver

Main power supply

BLOCK DIAGRAM EXPLANATION:


This Project mainly consists of Power Supply section, Microcontroller section,
Zigbee transceiver, PC, MAX 232, LCD display section, Sensors, ADC, Relay and
Motor.
Power Supply Section:
This section is meant for supplying Power to all the sections mentioned above. It
basically consists of a Transformer to step down the 230V ac to 12V ac followed by
diodes. Here diodes are used to rectify the ac to dc. After rectification the obtained

rippled dc is filtered using a capacitor Filter. A positive voltage regulator is used to


regulate the obtained dc voltage.
Microcontroller Section:
This section forms the control unit of the whole project. This section basically
consists of a Microcontroller with its associated circuitry like Crystal with capacitors,
Reset circuitry, Pull up resistors (if needed) and so on. The Microcontroller forms the
heart of the project because it controls the devices being interfaced and communicates
with the devices according to the program being written.
Zigbee transceiver:
Transceiver is a device which acts as both transmitter and receiver. This operates
with 2.8-3.4V. Range of the transceiver module is 30-70m in urban areas and 1-1.5km in
outdoor (LOS). The transceiver has an on-chip wire antenna and it operates at a
frequency of 2.4GHz.The data received from the microcontroller is organized based on
the ZIGBEE protocol standards and then modulated. Along with the data, source address
and destination address are added and sent. This organized data is send to the receiver
through RF antenna.

MAX- 232
To allow compatibility among data communication equipment made by various
manufactures, an interfacing standard called RS232 was set by the Electronic Industries
Association (EIA). This RS-232 standard is used in PCs and numerous types of
equipment .However, since the standard was set long before the advent of the TTL logic
family, its input and output voltage levels are not TTL compatible. In RS-232 ,a 1 is
represented by -3 to -25V,while a 0 bit is +3 to +25V,making -3 to +3 undefined. For this
reason, to connect any RS-232 to a microcontroller system we must use voltage
converters such as MAX232 to convert the TTL logic levels to the RS-232 voltage levels
and vice versa.
So here we are using this MAX-232 to have compatibility between the PC and
microcontroller.

LCD Display Section:


This section is basically meant to show up the status of the project. This project
makes use of Liquid Crystal Display to display / prompt for necessary information.
Sensors:
This part of the system consists of various sensors, temperature, Ground fault, voltage
and current. These sensors sense various parameters of motor- temperature, voltage and
current and are then sent to the Analog to Digital Converter. Here Microcontroller will
send obtained data from ADC to remote areas using Zigbee transmission. That data which
is received at the receiver side is displayed on PC.
ADC:
ADC is a device converting signals from analog to digital format. This is used to
convert the sensor values which are in analog format to digital form and provide it to
microcontroller.

Relay:
In this project Relays are used to the Trip the Motor and boiler. A relay is an electrical
switch that opens and closes under control of another electrical circuit. In the original
form, the switch is operated by an electromagnet to open or close one or many sets of
contacts.

Motor:
Motor is an output device.

SCHEMATIC:
MONITORING SECTION:

MOTOR SECTION:

SCHEMATIC DESCRIPTION:

Firstly, the required operating voltage for Microcontroller 89C51 is 5V. Hence the
5V D.C. power supply is needed by the same. This regulated 5V is generated by first
stepping down the 230V to 12V by the step down transformer.
In the Power supply the step downed a.c. voltage is being rectified by the Bridge
Rectifier. The diodes used are 1N4007. The rectified a.c voltage is now filtered using a
C filter. Now the rectified, filtered D.C. voltage is fed to the Voltage Regulator. This
voltage regulator allows us to have a Regulated Voltage. In Power supply the voltage
given to Microcontroller 5V is generated using 7805. The rectified; filtered and regulated
voltage is again filtered for ripples using an electrolytic capacitor 100F. Now the output
from the first section is fed to 40 th pin of 89c51 microcontroller to supply operating
voltage and from other power supply to circuitry.
The microcontroller 89c51 with Pull up resistors at Port0 and crystal oscillator of
11.0592 MHz crystal in conjunction with couple of capacitors of is placed at 18 th & 19th
pins of 89c51 to make it work (execute) properly.
In monitoring section

PC connections:
Pins

connections

VCC (+5v)

This pin is connected to the 7th (TXD) of the MAX -232 IC

This pin is connected to the 8th (RXD) of the MAX -232 IC

GND

GND

Output of max 232 i.e., 11th pin is connected to P3.1 of Microcontroller.

Zigbee connections to microcontroller


Xbee 2

This pin is connected to P3.0 pin of the microcontroller

In motor section
LCD connections to Micro controller:

Pins

Connections

VSS (ground)

VCC (+5V)

10k pot

RS, this pin is connected to P2.7 of the micro controller

R/w, this pin is connected to P2.6 of the micro controller

EN, this pin is connected to P2.5 of the micro controller

7-14

(D0-D7) these pins are connected to the port (P0) of the micro controller

In this project we are using the ADC0808, which is interfaced to the micro
controller. The output lines or data lines of the ADC are connected to port P1, ALE pin is
connected to pin P3.4, which enables the address, SC pin is connected to P3.5, which
indicates the Start Conversion to the ADC, EOC is connected to P3.6, which indicates the
End Of Conversion i.e.; the data is ready to receive by the controller. Here A, B pins of
the ADC is connected to P3.2, P3.3 respectively, which is used to select a particular
channel of the ADC. The parameters like temperature sensor, voltage sensor and current
sensor are given to IN0, IN1 and IN2 respectively which are acting as the analog inputs.
Zigbee connection
Xbee 2-P3.0
Xbee 3-P3.1
Motor:
The motor is connected with a mains supply, but it is switched and controlled with
Relay which is connected to P2.0 of microcontroller pin.
Boiler Section through relay and ground fault detection circuit through transistor logic
are connected to P2.2 and P2.1respectively.

CIRCUIT DESCRIPTION:

This section gives an overview of the whole circuitry and hardware


involved in the project. The aim of the project is to protect and control the
low voltage motors used in industries.
In this project we are giving power supply to all units, it basically
consists of a Transformer to step down the 230V ac to 18V ac followed by
diodes. Here diodes are used to rectify the ac to dc. After rectification the
obtained rippled dc is filtered using a capacitor Filter. A positive voltage
regulator is used to regulate the obtained dc voltage.
But here in this project two power supplies are used one is meant to
supply operating voltage for Microcontroller and the other separate supply
for boiler section.
In this project a ZIGBEE communication system was developed to
monitor the operation conditions of single-phase induction motor. This
system is based on a low-cost electronic device that can acquire and preprocess current, ground fault, voltages and temperatures, and transmit
processed key-information related to the motor operation conditions.
Information about operating parameters of motor can be sent to a central
processing unit allowing knowledge of key-information of the motor in the
plant. If the parameters like voltage, temperature, current etc exceed the
threshold value automatic motor is off. The various parameter data is
displayed on PC. This data can be used in the implementation of effective
motor management strategies targeting motor efficiency optimization, proper
replacement and sizing and optimized rewinding.
In motor Section, sensors are placed to monitor the operating conditions
of motor, parameters like Current, Voltage, Ground fault and Temperature
Sensors. These sensors will measure the current, voltage, ground fault
detection and temperature of motor respectively.

In motor section, the sensors parameters range as follows


Voltage: If the voltage crosses the limit (220V- 230V) then motor will
be off, if the voltage is in that particular limit then motor will be on.
Current: If the current value exceeds the threshold value 30mA then
automatic motor will be off.
Temperature: Whenever the motor is ON, the boiler section through
relay circuit is ON then temperature sensor will measure the
temperature of boiler, if the temperature crosses above 50 0C then
automatic motor will be off. If motor is off boiler circuit will be off.
Ground fault: Ground fault circuit is having two electrical wires, one
wire is connected to the supply and other wire is connected to the
microcontroller through transistor logic. Whenever the two wires are
short circuited, supply is connected, transistor is on and a high logic
will be going to controller pin. Then automatically motor is off using
relay circuit.
Sensors will produce analogical data but controller will not understand
this data so here ADC is used to convert the data from analog to digital.
Output of the ADC is given to the microcontroller, controller process this
data and compares with the predefined data and the values are displayed on
LCD. Using wireless communication i.e. Zigbee, this data is transferred to
control section, there we can monitor all the parameters of Motor on PC.

HARDWARE COMPONENTS:
The Hardware components used in this project are

Regulated Power Supplies


Microcontroller
LCD
Motor
Zigbee Transceivers
MAX 232
Temperature sensor
Voltage & Current sensors
ADC
Relays

REGULATED POWER SUPPLY


The power supplies are designed to convert high voltage AC mains electricity to a
suitable low voltage supply for electronic circuits and other devices. A RPS (Regulated
Power Supply) is the Power Supply with Rectification, Filtering and Regulation being
done on the AC mains to get a Regulated power supply for Microcontroller and for the
other devices being interfaced to it.
A power supply can by broken down into a series of blocks, each of which performs a
particular function. A d.c power supply which maintains the output voltage constant
irrespective of a.c mains fluctuations or load variations is known as Regulated D.C
Power Supply

For example a 5V regulated power supply system as shown below:

Transformer:
A transformer is an electrical device which is used to convert electrical
power from one Electrical circuit to another without change in frequency.
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 in output voltage, step-down
transformers decrease in output voltage. Most power supplies use a step-down
transformer to reduce the dangerously high mains voltage 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.

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.

An Electrical Transformer
Turns ratio = Vp/ VS = Np/NS
Power Out= Power In
VS X IS=VP X IP
Vp

Np

primary
number

of

(input)
turns

on

voltage
primary

coil

Ip = primary (input) current

RECTIFIER:
A circuit which is used to convert ac to dc is known as RECTIFIER. The process
of conversion ac to dc is called rectification
TYPES OF RECTIFIERS:

Half wave Rectifier

Full wave rectifier


1. Centre tap full wave rectifier.
2. Bridge type full bridge rectifier.

Comparison of rectifier circuits:


Type of Rectifier
Parameter

Half wave

Full wave

Bridge

Number of diodes
1

PIV of diodes
Vm
D.C output voltage
Vdc,at

Vm/
0.318Vm

2Vm
2Vm/
0.636Vm

Vm
2Vm/
0.636Vm

no-load
Ripple factor
Ripple
frequency
Rectification

1.21

0.482

0.482

2f

2f

efficiency
Transformer

0.406

0.812

0.812

Utilization

0.287

0.693

0.812

Factor(TUF)
RMS voltage Vrms

Vm/2

Vm/2

Vm/2

Full-wave Rectifier:
From the above comparison we came to know that full wave bridge rectifier as more
advantages than the other two rectifiers. So, in our project we are using full wave bridge
rectifier circuit.

Bridge Rectifier: A bridge rectifier makes use of four diodes in a bridge arrangement to
achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired as shown and with single component bridges where the
diode bridge is wired internally.
A bridge rectifier makes use of four diodes in a bridge arrangement as shown in fig
(a) to achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired as shown and with single component bridges where the diode
bridge is wired internally.

Fig (A)

Operation:
During positive half cycle of secondary, the diodes D2 and D3 are in forward biased
while D1 and D4 are in reverse biased as shown in the fig(b). The current flow direction
is shown in the fig (b) with dotted arrows.

Fig (B)

During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward
biased while D2 and D3 are in reverse biased as shown in the fig(c). The current flow
direction is shown in the fig (c) with dotted arrows.

Fig(C)
Filter:
A Filter is a device which removes the a.c component of rectifier output
but allows the d.c component to reach the load

Capacitor Filter:
We have seen that the ripple content in the rectified output of half wave rectifier is
121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high
percentages of ripples is not acceptable for most of the applications. Ripples can be
removed by one of the following methods of filtering.
(a) A capacitor, in parallel to the load, provides an easier by pass for the ripples voltage
though it due to low impedance. At ripple frequency and leave the D.C. to appear at the
load.
(b) An inductor, in series with the load, prevents the passage of the ripple current (due to
high impedance at ripple frequency) while allowing the d.c (due to low resistance to d.c)
(c) Various combinations of capacitor and inductor, such as L-section filter

section

filter, multiple section filter etc. which make use of both the properties mentioned in (a)
and (b) above. Two cases of capacitor filter, one applied on half wave rectifier and
another with full wave rectifier.

Filtering is performed by a large value electrolytic capacitor connected across the


DC supply to act as a reservoir, supplying current to the output when the varying DC
voltage from the rectifier is falling. The capacitor charges quickly near the peak of the
varying DC, and then discharges as it supplies current to the output. Filtering
significantly increases the average DC voltage to almost the peak value (1.4 RMS
value).
To calculate the value of capacitor(C),
C = *3*f*r*Rl
Where,
f = supply frequency,
r = ripple factor,
Rl = load resistance
Note: In our circuit we are using 1000F hence large value of capacitor is placed
to reduce ripples and to improve the DC component.

Regulator:
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or
variable output voltages. The maximum current they can pass also rates them. Negative
voltage regulators are available, mainly for use in dual supplies. Most regulators include
some automatic protection from excessive current ('overload protection') and overheating
('thermal protection'). Many of the fixed voltage regulators ICs have 3 leads and look
like power transistors, such as the 7805 +5V 1A regulator shown on the right. The
LM7805 is simple to use. You simply connect the positive lead of your unregulated DC
power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative
lead to the Common pin and then when you turn on the power, you get a 5 volt supply
from the output pin.

Fig 6.1.6 A Three Terminal Voltage Regulator


78XX:
The Bay Linear LM78XX is integrated linear positive regulator with three
terminals. The LM78XX offer several fixed output voltages making them useful in wide
range of applications. When used as a zener diode/resistor combination replacement, the
LM78XX usually results in an effective output impedance improvement of two orders of
magnitude, lower quiescent current. The LM78XX is available in the TO-252, TO-220 &
TO-263packages,

Features:
Output Current of 1.5A
Output Voltage Tolerance of 5%
Internal thermal overload protection
Internal Short-Circuit Limited
Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V.

MICROCONTROLLER
Introduction:
A Micro controller consists of a powerful CPU tightly coupled with memory
RAM, ROM or EPROM), various I / O features such as Serial ports, Parallel Ports,
Timer/Counters, Interrupt Controller, Data Acquisition interfaces-Analog to Digital
Converter (ADC), Digital to Analog Converter (ADC), everything integrated onto a
single Silicon Chip.

It does not mean that any micro controller should have all the above said features
on chip, Depending on the need and area of application for which it is designed, The ONCHIP features present in it may or may not include all the individual section said above.
Any microcomputer system requires memory to store a sequence of instructions
making up a program, parallel port or serial port for communicating with an external
system, timer / counter for control purposes like generating time delays, Baud rate for
the serial port, apart from the controlling unit called the Central Processing Unit
Advantages of microcontrollers:
A system is developed with a microprocessor, the designer has to go for external memory
such as RAM, ROM or EPROM and peripherals and hence the size of the PCB will be
large enough to hold all the required peripherals. But, the micro controller has got all
these peripheral facilities on a single chip so development of a similar system with a
micro controller reduces PCB size and cost of the design.
One of the major differences between a micro controller and a microprocessor is that a
controller often deals with bits , not bytes as in the real world application, for example
switch contacts can only be open or close, indicators should be lit or dark and motors can
be either turned on or off and so forth.

INTRODUCTION TO ATMEL MICROCONTROLLER


SERIES: 89C51 Family, TECHNOLOGY: CMOS
The major Features of 8-bit Micro controller ATMEL 89C51:

8 Bit CPU optimized for control applications

Extensive Boolean processing (Single - bit Logic) Capabilities.

On - Chip Flash Program Memory

On - Chip Data RAM

Bi-directional and Individually Addressable I/O Lines

Multiple 16-Bit Timer/Counters

Full Duplex UART

Multiple Source / Vector / Priority Interrupt Structure

On - Chip Oscillator and Clock circuitry.

On - Chip EEPROM

SPI Serial Bus Interface

Watch Dog Timer

8051 BLOCK DIAGRAM:

Fig. 6.2.1 Architecture of AT89C51

PIN CONFIGURATION:

Pin Diagram of AT89C51

Pin Description:
VCC

Supply voltage.

GND

Ground.

Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high
impedance inputs. Port 0 may also be configured to be the multiplexed low order
address/data bus during accesses to external program and data memory. In this mode P0
has internal pull-ups. Port 0 also receives the code bytes during Flash programming, and
outputs the code bytes during program verification. External pull-ups are required during
program verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 1 also receives the low-order address bytes during Flash programming and
verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory
and during accesses to external data memory that use 16-bit addresses (MOVX @
DPTR). In this application it uses strong internal pull-ups. When emitting 1s. During
accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits
the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification.
Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are

pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current (IIL) because of the pull-ups. Port 3
also serves the functions of various special features of the AT89C51 as listed below:

Alternate Functions of PORT3


Port 3 also receives some control signals for Flash programming and verification.
Port Loading and Interfacing
The output buffers of Ports 1, 2, and 3 can each drive 4 LS TTL inputs. These
ports on NMOS versions can be driven in a normal manner by a TTL or NMOS circuit.
Both NMOS and CMOS pins can be driven by open-collector and open-drain outputs, but
note that0-to-1 transitions will not be fast. In he NMOS device, if the pin is driven by an
open-collector output, a 0-to-1 transition will have to be driven by the relatively weak
depletion mode FET in the CMOS device, an input 0turns off pull-up pFET3, leaving
only the very weak pull-up pFET2 to drive the transition. Port 0 output buffers can each
drive 8 LS TTL inputs. They do, however, require external pull-ups to drive NMOS
inputs, except when being used as the ADDRESS/DATA bus for external memory.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.

ALE/PROG
Address Latch Enable 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.
PSEN
Program Store Enable is the read strobe to external program memory. When the
AT89C51 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 memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up to
FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on
reset. EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming, for
parts that require 12-volt VPP.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2
Output from the inverting oscillator is amplifier.

Oscillator Characteristics
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
21. 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 Fig 6.2.3. 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 flipflop, but minimum and maximum voltage high and low time specifications must be
observed.
Idle Mode
In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain
active. The mode is invoked by software. The content of the on-chip RAM and all the
special functions registers remain unchanged during this mode. The idle mode can be
terminated by any enabled interrupt or by a hardware reset. It should be noted that when
idle is terminated by a hard ware reset, the device normally resumes program execution,
from where it left off, up to two machine cycles before the internal reset algorithm takes
control. On-chip hardware inhibits access to internal RAM in this event, but access to the
port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin
when Idle is terminated by reset, the instruction following the one that invokes Idle
should not be one that writes to a port pin or to external memory.

Fig 6.2.3 External Clock Drive Configuration

Tab 6.2.2 Status of External Pins


Power down Mode
In the power down mode the oscillator is stopped, and the instruction that invokes
power down is the last instruction executed. The on-chip RAM and Special Function
Registers retain their values until the power down mode is terminated. The only exit
from power down is a hardware reset. Reset redefines the SFRs but does not change the
on-chip RAM. The reset should not be activated before VCC is restored to its normal
operating level and must be held active long enough to allow the oscillator to restart and
stabilize.
Power on reset:
When power is turned on, the circuit holds the RST pin high for an amount of
time that depends on the capacitor value and the rate at which it charges.
To ensure a valid reset, the RST pin must be held high long enough to allow the
oscillator to start up plus two machine cycles. On power up, Vcc should rise within
approximately 10ms. The oscillator start-up time depends on the oscillator frequency. For
a 10 MHz crystal, the start-up time is typically 1ms.With the given circuit, reducing Vcc
quickly to 0 causes the RST pin voltage to momentarily fall below 0V. How ever, this
voltage is internally l limited and will not harm the device.
Memory organization:
* Logical Separation of Program and Data Memory *
All Atmel Flash micro controllers have separate address spaces for program and
Data memory as shown in Fig 1.The logical separation of program and data memory
Allows the data memory to be accessed by 8 bit addresses. This can be more quickly
Stored and manipulated by an 8 bit CPU Nevertheless 16 Bit data memory addresses
Can also be generated through the DPTR register.

Program memory can only be read. There can be up to 64K bytes of directly
addressable program memory. The read strobe for external program memory is the
Program Store Enable Signal (PSEN) Data memory occupies a separate address space
from program memory. Up to 64K bytes of external memory can be directly addressed in
the external data memory space. The CPU generates read and write signals, RD and Wr,
during external data memory accesses. External program memory and external data
memory can be combined by applying the RD and PSEN signals to the inputs of AND
gate and using the output of the fate as the read strobe to the external program/data
memory.
Program memory:
Fig 1.1 shows the map of the lower part of the program memory, after reset, the
CPU begins execution from location 0000h. As shown in Fig 1.1 each interrupt is
assigned a fixed location in program memory. The interrupt causes the CPU to jump to
that location, where it executes the service routine. External Interrupt 0 for example, is
assigned to location 0003h. If external Interrupt 0 is used, its service routine must begin
at location 0003h. If the I interrupt in not used its service location is available as generalpurpose program memory.
Fig.2: Program Memory.
0033h
Timer 2

002Bh

Serial Port
Timer 1

0023h
001Bh

External

8 Bytes

Interrupt 1

0013h

Timer 0

000Bh

External
Interrupt 0

0003h

Reset

0000h

The interrupt service locations are spaced at 8 byte intervals 0003h for External
interrupt 0, 000Bh for Timer 0, 0013h for External interrupt 1,001Bh for Timer1, and so

on. If an Interrupt service routine is short enough (as is often the case in control
applications) it can reside entirely within that 8-byte interval. Longer service routines can
use a jump instruction to skip over subsequent interrupt locations. If other interrupts are
in use. The lowest addresses of program memory can be either in the on-chip Flash or in
an external memory. To make this selection, strap the External Access (EA) pin to either
Vcc or GND. For example, in the AT89C51 with 4K bytes of on-chip Flash, if the EA pin
is strapped to Vcc, program fetches to addresses 0000h through 0FFFh are directed to
internal Flash. Program fetches to addresses 1000h through FFFFh are directed to
external memory.
Data memory:
The Internal Data memory is dived into three blocks namely, Refer Fig (1.1.1)

The lower 128 Bytes of Internal RAM.

The Upper 128 Bytes of Internal RAM.

Special Function Register.

FFh

Accessible

Accessible

Upper

By Indirect

By Direct

128

Addressing

Addressing

80h

only.

79h
Accessible
Lower

Special Function Register

By Direct

128

and Indirect

00h

Addressing

(Ports, Status and Control Bits)

Internal Data memory Addresses are always 1 byte wide, which implies an
address space of only 256 bytes. However, the addressing modes for internal RAM can in

fact accommodate 384 bytes. Direct addresses higher than 7Fh access one memory space,
and indirect addresses higher than 7Fh access a different Memory Space.
The lowest 32 bytes are grouped into 4 banks of 8 registers. Program instructions
call out these registers as R0 through R7. Two bits in the Program Status Word (PSW)
Select, which register bank, is in use. This architecture allows more efficient use of code
space, since register instructions are shorter than instructions that use direct addressing.
The next 16-bytes above the register banks form a block of bit addressable
memory space. The micro controller instruction set includes a wide selection of single bit instructions and this instruction can directly address the 128 bytes in this area. These
bit addresses are 00h through 7Fh. either direct or indirect addressing can access all of the
bytes in lower 128 bytes. Indirect addressing can only access the upper 128. The upper
128 bytes of RAM are only in the devices with 256 bytes of RAM.
The Special Function Register includes Port latches, timers, peripheral controls
etc., direct addressing can only access these register. In general, all Atmel micro
controllers have the same SFRs at the same addresses in SFR space as the AT89C51 and
other compatible micro controllers. However, upgrades to the AT89C51 have additional
SFRs. Sixteen addresses in SFR space are both byte and bit Addressable. The bit
Addressable SFRs are those whose address ends in 000B. The bit addresses in this area
are 80h through FFh.
FFFFh

FFFFh
External

External
FFh
EA = 0

EA = 1

External

External
-0000-

PSEN
Fig.1.1 89C51 MEMORY STRUCTURE

0000h
00h
RD WR

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 the case 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.
Register - specific instruction:
Some Instructions are specifiec to a certain register. For example some instruction
always operates on the Accumulator, so no address byte is needed to point OT ir. Inthese
cases, the opcode itself points to the correct register. Instruction that regger to
Accumulator as A assemble as Accumulator - specific Opcodes.

PROGRAM STATUS WORD:


Program Status Word Register in Atmel Flash Micro controller:
CY

AC

F0

RS1

RS0

OV

---

PSW 7

PSW0:

P
PSW 0

PSW 6

PSW 1

PSW 5

PSW 2

PSW 4

PSW 3

Parity of Accumulator Set By Hardware To 1 if it contains an Odd number


of 1s, otherwise it is reset to 0.

PSW1:

User Definable Flag

PSW2:

Overflow Flag Set By Arithmetic Operations

PSW3:

Register Bank Select

PSW4:

Register Bank Select

PSW5:

General Purpose Flag.

PSW6:

Auxiliary Carry Flag Receives Carry Out from


Bit 1 of Addition Operands

PSW7:

Carry Flag Receives Carry Out From Bit 1 of ALU Operands.


The Program Status Word contains Status bits that reflect the current state of the

CPU. The PSW shown if Fig resides in SFR space. The PSW contains the Carry Bit, The
auxiliary Carry (For BCD Operations) the two - register bank select bits, the Overflow
flag, a Parity bit and two user Definable status Flags.
The Carry Bit, in addition to serving as a Carry bit in arithmetic operations also
serves the as the Accumulator for a number of Boolean Operations .The bits RS0 and
RS1 select one of the four register banks. A number of instructions register to these RAM

locations as R0 through R7.The status of the RS0 and RS1 bits at execution time
determines which of the four banks is selected.
The Parity bit reflect the Number of 1s in the Accumulator .P=1 if the
Accumulator contains an even number of 1s, and P=0 if the Accumulator contains an
even number of 1s. Thus, the number of 1s in the Accumulator plus P is always even.
Two bits in the PSW are uncommitted and can be used as general-purpose status flags.
Immediate constants:
The value of a constant can follow the opcode in program memory For example.
MOV A, #100 loads the Accumulator with the decimal number 100. The same number
could be specified in hex digit as 64h.
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 dividing by two flip flops 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

Timers:
The 8051 comes equipped with two timers, both of which may be controlled, set,
read, and configured individually. The 8051 timers have three general functions: 1)
Keeping time and/or calculating the amount of time between events, 2) Counting the
events themselves, or 3) Generating baud rates for the serial port.
The three timer uses are distinct so we will talk about each of them
separately. The first two uses will be discussed in this chapter while the use of timers for
baud rate generation will be discussed in the chapter relating to serial ports.
How does a timer count?
How does a timer count? The answer to this question is very simple: A timer
always counts up. It doesnt matter whether the timer is being used as a timer, a counter,
or a baud rate generator: A timer is always incremented by the microcontroller.
Programming Tip: Some derivative chips actually allow the program to configure
whether the timers count up or down. However, since this option only exists on some
derivatives it is beyond the scope of this tutorial which is aimed at the standard 8051. It is
only mentioned here in the event that you absolutely need a timer to count backwards,
you will know that you may be able to find an 8051-compatible microcontroller that does
it.
USING TIMERS TO MEASURE TIME
Obviously, one of the primary uses of timers is to measure time. We will discuss
this use of timers first and will subsequently discuss the use of timers to count events.
When a timer is used to measure time it is also called an "interval timer" since it is
measuring the time of the interval between two events.
How long does a timer take to count?
First, its worth mentioning that when a timer is in interval timer mode (as
opposed to event counter mode) and correctly configured, it will increment by 1 every
machine cycle. As you will recall from the previous chapter, a single machine cycle
consists of 12 crystal pulses. Thus a running timer will be incremented:
11,059,000 / 12 = 921,583

921,583 times per second. Unlike instructions--some of which require 1 machine cycle,
others 2, and others 4--the timers are consistent: They will always be incremented once
per machine cycle. Thus if a timer has counted from 0 to 50,000 you may calculate:
50,000 / 921,583 = .0542
.0542 seconds have passed. In plain English, about half of a tenth of a second, or onetwentieth of a second.
Obviously its not very useful to know .0542 seconds have passed. If you want to
execute an event once per second youd have to wait for the timer to count from 0 to
50,000 18.45 times. How can you wait "half of a time?" You cant. So we come to
another important calculation.
Lets say we want to know how many times the timer will be incremented in .05
seconds. We can do simple multiplication:
.05 * 921,583 = 46,079.15.
This tells us that it will take .05 seconds (1/20th of a second) to count from 0 to
46,079. Actually, it will take it .049999837 seconds--so were off by .000000163
seconds--however, thats close enough for government work. Consider that if you were
building a watch based on the 8051 and made the above assumption your watch would
only gain about one second every 2 months. Again, I think thats accurate enough for
most applications--I wish my watch only gained one second every two months!
Obviously, this is a little more useful. If you know it takes 1/20th of a second to
count from 0 to 46,079 and you want to execute some event every second you simply
wait for the timer to count from 0 to 46,079 twenty times; then you execute your event,
reset the timers, and wait for the timer to count up another 20 times. In this manner you
will effectively execute your event once per second, accurate to within thousandths of a
second. Thus, we now have a system with which to measure time. All we need to review
is how to control the timers and initialize them to provide us with the information we
need.
Timer SFRs:
As mentioned before, the 8051 has two timers which each function essentially the
same way. One timer is TIMER0 and the other is TIMER1. The two timers share two

SFRs (TMOD and TCON) which control the timers, and each timer also has two SFRs
dedicated solely to itself (TH0/TL0 and TH1/TL1).

The TMOD SFR:


The TMOD SFR is used to control the mode of operation of both timers. Each bit
of the SFR gives the microcontroller specific information concerning how to run a timer.
The high four bits (bits 4 through 7) relate to Timer 1 whereas the low four bits (bits 0
through 3) perform the exact same functions, but for timer 0.
The individual bits of TMOD have the following functions:

As you can see in the above chart, four bits (two for each timer) are used to specify a
mode of operation. The modes of operation are:

13-bit Time Mode (mode 0):


Timer mode "0" is a 13-bit timer. When the timer is in 13-bit mode, TLx
will count from 0 to 31. When TLx is incremented from 31, it will "reset" to 0 and
increment THx. Thus, effectively, only 13 bits of the two timer bytes are being used: bits
0-4 of TLx and bits 0-7 of THx. This also means, in essence, the timer can only contain

8192 values. If you set a 13-bit timer to 0, it will overflow back to zero 8192 machine
cycles later.
16-bit Time Mode (mode 1):
Timer mode "1" is a 16-bit timer. This is a very commonly used mode. It
functions just like 13-bit mode except that all 16 bits are used. TLx is incremented from 0
to 255. When TLx is incremented from 255, it resets to 0 and causes THx to be
incremented by 1. Since this is a full 16-bit timer, the timer may contain up to 65536
distinct values. If you set a 16-bit timer to 0, it will overflow back to 0 after 65,536
machine cycles.
8-bit Time Mode (mode 2):
Timer mode "2" is an 8-bit auto-reload mode. When a timer is in mode 2,
THx holds the "reload value" and TLx is the timer itself. Thus, TLx starts counting up.
When TLx reaches 255 and is subsequently incremented, instead of resetting to 0 (as in
the case of modes 0 and 1), it will be reset to the value stored in THx.
The benefit of auto-reload mode is, if you want the timer to always have a
value from 200 to 255. If you use mode 0 or 1, youd have to check in code to see if the
timer had overflowed and, if so, reset the timer to 200. This takes precious instructions of
execution time to check the value and/or to reload it. When you use mode 2 the
microcontroller takes care of this for you. Once youve configured a timer in mode 2 you
dont have to worry about checking to see if the timer has overflowed nor do you have to
worry about resetting the value--the microcontroller hardware will do it all for you. The
auto-reload mode is very commonly used for establishing a baud rate for serial
transmission and receiving.
Split Timer Mode (mode 3):
Timer mode "3" is a split-timer mode. When Timer 0 is placed in mode 3,
it essentially becomes two separate 8-bit timers. That is to say, Timer 0 is TL0 and Timer
1 is TH0. Both timers count from 0 to 255 and overflow back to 0. All the bits that are
related to Timer 1 will now be tied to TH0.
While Timer 0 is in split mode, the real Timer 1 (i.e. TH1 and TL1) can be
put into modes 0, 1 or 2 normally--however, you may not start or stop the real timer 1

since the bits that do that are now linked to TH0. The real timer 1, in this case, will be
incremented every machine cycle no matter what.
The only real use of split timer mode is if you need to have two separate
timers and, additionally, a baud rate generator. In such case you can use the real Timer 1
as a baud rate generator and use TH0/TL0 as two separate timers.
The TCON SFR:
There is one more SFR that controls the two timers and provides valuable
information about them. The TCON SFR has the following structure:

As you may notice, weve only defined 4 of the 8 bits. Thats because the other 4 bits of
the SFR dont have anything to do with timers--they have to do with Interrupts and they
will be discussed in the chapter that addresses interrupts.
Initializing a timer:
As youll recall, we first must decide what mode we want the timer to be in. In
this case we want a 16-bit timer that runs continuously; that is to say, it is not dependent
on any external pins. We must first initialize the TMOD SFR. Since we are working with
timer 0 we will be using the lowest 4 bits of TMOD. The first two bits, GATE0 and C/T0
are both 0 since we want the timer to be independent of the external pins. 16-bit mode is
timer mode 1 so we must clear T0M1 and set T0M0. Effectively, the only bit we want to
turn on is bit 0 of TMOD. Thus to initialize the timer we execute the instruction: MOV
TMOD,#01h

Timer 0 is now in 16-bit timer mode. However, the timer is not running. To start
the timer running we must set the TR0 bit, we can do that by executing the instruction:
SETB TR0
Upon executing these two instructions timer 0 will immediately begin counting, being
incremented once every machine cycle (every 12 crystal pulses).
Detecting Timer Overflow:
Often it is necessary to just know that the timer has reset to 0. That is to say, you
are not particularly interest in the value of the timer but rather you are interested in
knowing when the timer has overflowed back to 0. Whenever a timer overflows from its
highest value back to 0, the microcontroller automatically sets the TFx bit in the TCON
register. This is useful since rather than checking the exact value of the timer you can just
check if the TFx bit is set. If TF0 is set it means that timer 0 has overflowed; if TF1 is set
it means that timer 1 has overflowed.
We can use this approach to cause the program to execute a fixed delay.
Timers as Event counters:
The 8051 provides us with a way to use the timers to count events. If we want to
use Timer 0 to count the number of events, set the C/T0 bit of the TMOD SFR. However,
if we set C/T0, timer 0 will monitor the P3.4 line. Instead of being incremented every
machine cycle, timer 0 will count events on the P3.4 line. So if we connect any sensor to
P3.4 and let the 8051 do the work. Then, when we want to know how many have
occurred, we just read the value of timer 0. The value of timer 0 will be the number of
events that have occurred.
The 8051 counts one to zero transitions on the P3.4 line. This means that when
there is a raise on the P3.4 pin the 8051 will not count anything since this is a 0-1
transition. However, when the sensor will fall back to a low ("0") state. This is a 1-0
transition and at that instant the counter will be incremented by 1.
It is important to note that the 8051 checks the P3.4 line each instruction cycle (12
clock cycles). This means that if P3.4 is low, goes high, and goes back low in 6 clock
cycles it will probably not be detected by the 8051. This also means the 8051 event
counter is only capable of counting events that occur at a maximum of 1/24th the rate of
the crystal frequency. That is to say, if the crystal frequency is 12.000 MHz it can count a

maximum of 500,000 events per second (12.000 MHz * 1/24 = 500,000). If the event
being counted occurs more than 500,000 times per second it will not be able to be
accurately counted by the 8051.

SERIAL COMMUNICATION
THEORY:
In order to connect micro controller to a modem or a pc to modem a serial port is
used. Serial is a very common protocol for device communication that is standard on
almost every PC. Most computers include two RS-232 based serial ports. Serial is also a
common communication protocol that is used by many devices for instrumentation;
numerous GPIB-compatible devices also come with an RS-232 port. Furthermore, serial
communication can be used for data acquisition in conjunction with a remote sampling
device.
The concept of serial communication is simple. The serial port sends and receives
bytes of information one bit at a time. Although this is slower than parallel
communication, which allows the transmission of an entire byte at once, it is simpler and
can be used over longer distances. For example, the IEEE 488 specifications for parallel
communication state that the cabling between equipment can be no more than 20 meters
total, with no more than 2 meters between any two devices. Serial, however, can extend
as much as 1200 meters.
Typically, serial is used to transmit ASCII data. Communication is completed
using 3 transmission lines: (1) Ground, (2) Transmit, and (3) Receive. Since serial is
asynchronous, the port is able to transmit data on one line while receiving data on
another. Other lines are available for handshaking, but are not required. The important
serial characteristics are baud rate, data bits, stop bits, and parity. For two ports to
communicate, these parameters must match.
Baud rate:

It is a speed measurement for communication. It indicates the number of

bit transfers per second. For example, 300 baud is 300 bits per second. When a clock
cycle is referred it means the baud rate. For example, if the protocol calls for a 4800 baud
rate, then the clock is running at 4800Hz. This means that the serial port is sampling the

data line at 4800Hz. Common baud rates for telephone lines are 14400, 28800, and
33600. Baud rates greater than these are possible, but these rates reduce the distance by
which devices can be separated. These high baud rates are used for device
communication where the devices are located together, as is typically the case with GPIB
devices.
Data bits:
A measurement of the actual data bits in a transmission. When the computer sends a
packet of information, the amount of actual data may not be a full 8 bits. Standard values
for the data packets are 5, 7, and 8 bits. Which setting chosen depends on what
information transferred? For example, standard ASCII has values from 0 to 127 (7 bits).
Extended ASCII uses 0 to 255 (8 bits). If the data being transferred is simple text
(standard ASCII), then sending 7 bits of data per packet is sufficient for communication.
A packet refers to a single byte transfer, including start/stop bits, data bits, and parity.
Since the number of actual bits depends on the protocol selected, the term packet is used
to cover all instances.
Stop bits:
Used to signal the end of communication for a single packet. Typical values are 1, 1.5,
and 2 bits. Since the data is clocked across the lines and each device has its own clock, it
is possible for the two devices to become slightly out of sync. Therefore, the stop bits not
only indicate the end of transmission but also give the computers some room for error in
the clock speeds. The more bits that are used for stop bits, the greater the lenience in
synchronizing the different clocks, but the slower the data transmission rate.
Parity:
A simple form of error checking that is used in serial communication. There are four
types of parity: even, odd, marked, and spaced. The option of using no parity is also
available. For even and odd parity, the serial port sets the parity bit (the last bit after the
data bits) to a value to ensure that the transmission has an even or odd number of logic
high bits. For example, if the data is 011, then for even parity, the parity bit is 0 to keep

the number of logic-high bits even. If the parity is odd, then the parity bit is 1, resulting in
3 logic-high bits. Marked and spaced parity does not actually check the data bits, but
simply sets the parity bit high for marked parity or low for spaced parity. This allows the
receiving device to know the state of a bit to enable the device to determine if noise is
corrupting the data or if the transmitting and receiving device clocks are out of sync.
WHAT IS RS 232C
RS-232 (ANSI/EIA-232 Standard) is the serial connection found on IBMcompatible PCs. It is used for many purposes, such as connecting a mouse, printer, or
modem, as well as industrial instrumentation. Because of improvements in line drivers
and cables, applications often increase the performance of RS-232 beyond the distance
and speed listed in the standard. RS-232 is limited to point-to-point connections between
PC serial ports and devices. RS-232 hardware can be used for serial communication up to
distances of 50 feet .
DB-9 pin connector

12345
6789
(Out of computer and exposed end of cable)
Pin Functions:
Data:

TxD on pin 3, RxD on pin 2

Handshake:

RTS on pin 7, CTS on pin 8, DSR on pin 6,


CD on pin 1, DTR on pin 4

Common:

Common pin 5(ground)

Other:

RI on pin 9

The method used by RS-232 for communication allows for a simple connection of three
lines: Tx, Rx, and Ground. The three essential signals for 2 way RS-232
Communications are these:

TXD: carries data from DTE to the DCE.


RXD: carries data from DCE to the DTE
SG: signal ground

Connection Diagram:

SFRs Used for Serial Communication:


SCON:

TMOD:

T1:

BAUD RATE CALCULATION:


Internal timer stages are as fallows

Divided by X box can be replaced with T1 timer so that by changing the value of timer
we can obtain the required baud rate.
Let XClk

11.0592 Mhz

Baud Rate

(XClk / 12 / 16 / 2 / X )

For attaining 9600 baud Rate


X can be calculated =

11.0592 x 106 / 12 / 16 / 2 / 9600

So set the 2s Complement of 3 in Timer 1 so that we can achieve 9600 baud rates.
Note: Assuming 8-bit Auto reload mode and 8-bit variable baud rate modes.

FLOW CHART:
TX Loop:

RX Loop:

MAX 232
Introduction:
Serial RS-232 (V.24) communication works with voltages (-15V ... -3V for high
[sic]) and +3V ... +15V for low [sic]) which are not compatible with normal computer
logic voltages. On the other hand, classic TTL computer logic operates between 0V ...
+5V (roughly 0V ... +0.8V for low, +2V ... +5V for high). Modern low-power logic
operates in the range of 0V ... +3.3V or even lower.
o, the maximum RS-232 signal levels are far too high for computer logic
electronics, and the negative RS-232 voltage for high . Therefore, to receive serial data
from an RS-232 interface the voltage has to be reduced, and the low and high voltage
level inverted. In the other direction (sending data from some logic over RS-232) the low
logic voltage has to be "bumped up", and a negative voltage has to be generated, too.
Logic Voltages

ll this can be done with conventional analog electronics, e.g. a particular power
supply and a couple of transistors or the once popular 1488 (transmitter) and 1489
(receiver) ICs. However, since more than a decade it has become standard in amateur
electronics to do the necessary signal level conversion with an integrated circuit (IC)
from the MAX232 family (typically a MAX232A or some clone). In fact, it is hard to
find some
The MAX232 & MAX232A
The MAX 232 translates RS232 voltages to TTL voltages. RS232 represent a
binary 1 or HI anywhere between 3V to 12V, a zero logic or LOW, between 3V and
12V. TTL in the other hand responds to 0 to 2.1V as logic zero and 2.8V to 5V as a HI.
The MAX 232 provides voltage translation so the TTL PIC 16F84 can understand the
messages sent to it from the computer. A serial cable is also provided to connect the
MAX232 to the PC and jumper cables to connect the MAX232 to the micro controller.
The MAX232 from Maxim was the first IC which in one package contains the
necessary drivers (two) and receivers (also two), to adapt the RS-232 signal voltage
levels to TTL logic. It became popular, because it just needs one voltage (+5V) and
generates the necessary RS-232 voltage levels (approx. -10V and +10V) internally. This
greatly simplified the design of circuitry. Circuitry designers no longer need to design and
build a power supply with three voltages (e.g. -12V, +5V, and +12V), but could just
provide one +5V power supply, e.g. with the help of a simple 78x05 voltage converter.
MAX232 (A) DIP Package

DIP Package of MAX 232A


A Typical Application
The MAX232(A) has two receivers (converts from RS-232 to TTL voltage levels) and
two drivers (converts from TTL logic to RS-232 voltage levels). This means only two of
the RS-232 signals can be converted in each direction. The old MC1488/1498 combo
provided four drivers and receivers.
Typically a pair of a driver/receiver of the MAX232 is used for

TX and RX and the second one for

CTS and RTS.

There are not enough drivers/receivers in the MAX232 to also connect the DTR, DSR,
and DCD signals. Usually these signals can be omitted when e.g. communicating with a
PC's serial interface. If the DTE really requires these signals either a second MAX232 is
needed, or some other IC from the MAX232 family can be used (if it can be found in
consumer electronic shops at all). An alternative for DTR/DSR is also given below.
Maxim's data sheet explains the MAX232 family in great detail, including the pin
configuration and how to connect such an IC to external circuitry. This information can
be used as-is in own design to get a working RS-232 interface. Maxim's data just misses
one critical piece of information: How exactly to connect the RS-232 signals to the IC. So
here is one possible example:

MAX232 to RS232 DB9 Connection as a DCE


MAX232 Pin Nbr. MAX232 Pin Name Signal
7
T2out
CTS
8
R2in
RTS
9
R2out
RTS
10
T2in
CTS
11
T1in
TX

Voltage
RS-232
RS-232
TTL
TTL
TTL

DB9 Pin
7
8
n/a
n/a
n/a

12
13
14
15

R1out
R1in
T1out
GND

RX
RX
TX
GND

TTL
RS-232
RS-232
0

n/a
2
3
5

Connections between MAX 232 & RS 232


In addition one can directly wire DTR (DB9 pin 4) to DSR (DB9 pin 6) without going
through any circuitry. This gives automatic (brain dead) DSR acknowledgement of an
incoming DTR signal.
Sometimes pin 6 of the MAX232 is hard wired to DCD (DB9 pin 1). This is not
recommended. Pin 6 is the raw output of the voltage pump and inverter for the -10V
voltage. Drawing currents from the pin leads to a rapid breakdown of the voltage, and as
a consequence to a breakdown of the output voltage of the two RS-232 drivers. It is better
to use software which doesn't care about DCD, but does hardware-handshaking via
CTS/RTS only. The circuitry is completed by connecting five capacitors to the IC as it
follows. The MAX232 needs 1.0F capacitors, the MAX232A needs 0.1F capacitors.
MAX232 clones show similar differences. It is recommended to consult the
corresponding data sheet. At least 16V capacitor types should be used. If electrolytic or
tantalic capacitors are used, the polarity has to be observed. The first pin as listed in the
following table is always where the plus pole of the capacitor should be connected to.
External Capacitors

The 5V power supply is connected to+5V: Pin 16 GND: Pin 15

MAX232(A) external Capacitors


Capacitor + Pin - Pin Remark
C1
1
3
C2
4
5
C3
2
16
This looks non-intuitive, but because pin 6 is
C4

GND 6

on -10V, GND gets the + connector, and not the


-

C5
16
GND
Drawbacks of MAX232:
The MAX-232 chip receives data from the receiver, and converts it to the
standard RS-232 data format that can be read in by a serial port on a personal
computer or workstation.
For the RS-232 interface, a standard MAX232 chip is used for level conversion.
Both use the on chip USART and thus the same firmware.

CONNECTIONS IN MAX 232:


If you wanted to do a general RS-232 connection, you could take a bunch
of long wires and solder them directly to the electronic circuits of the equipment you are
using, but this tends to make a big mess and often those solder connections tend to break
and other problems can develop. To deal with these issues, and to make it easier to setup
or take down equipment, some standard connectors have been developed that is
commonly found on most equipment using the RS-232 standards.
These connectors come in two forms: A male and a female connector. The female
connector has holes that allow the pins on the male end to be inserted into the connector.
This is a female "DB-9" connector (properly known as DE9F):

Fig.6.5.1 Female Connector


The female DB-9 connector is typically used as the "plug" that goes into a typical PC. If
you see one of these on the back of your computer, it is likely not to be used for serial

communication, but rather for things like early VGA or CGA monitors (not SVGA) or for
some special control/joystick equipment.
And this is a male "DB-9" connector (properly known as DE9M):

Fig 6.5.2 Male Connector


This is the connector that you are more likely to see for serial communications on a
"generic" PC. Often you will see two of them side by side (for COM1 and COM2).
Special equipment that you might communicate with would have either connector, or
even one of the DB-25 connectors listed below.
The wiring of RS-232 devices involves first identifying the actual pins that are being
used. Here is how a female DB-9 connector is numbered:

If the numbers are hard to read, it starts at the top-right corner as "1", and goes left until
the end of the row and then starts again as pin 6 on the next row until you get to pin 9 on
the bottom-left pin. "Top" is defined as the row with 5 pins.
The male connector (like what you have on your PC) is simply this same order, but
reversed from right to left.
Here each pin is usually defined as:

1
2
3
4
5
6
7
8
9

9-pin 25-pin
8
3
2
20
7
6
4
5
22

pin definition
DCD (Data Carrier Detect)
RX (Receive Data)
TX (Transmit Data)
DTR (Data Terminal Ready)
GND (Signal Ground)
DSR (Data Set Ready)
RTS (Request To Send)
CTS (Clear To Send))
RI (Ring Indicator)

Tab 6.5.4 Pin Definition of Connectors


One thing to keep in mind when discussing these pins and their meaning is that they are
very closely tied together with modems and modem protocols. Often you don't have a
modem attached in the loop, but you still treat the equipment as if it were a modem on a
theoretical level.
BAUD RATES:
I'm going to go on a bit of a rant here. Baud and BPS (Bits Per Second) are usually not
the same thing, although they are often used interchangeable, particular in marketing
literature. Only originally they were the same. There are several ways to determine what
the actual data rate of a particular piece of equipment is, but in popular marketing
literature, or even general reference texts, they will almost always refer to "Baud Rate",
even if they are referring to bits per second.
Language purists and engineers who know what they are talking about will go into a
more literal definition of Baud meaning the number of changes to the transmission media
per second in a modulated signal. If each transmission event contains more than one bit
of information, than Baud and BPS are not the same. E.g. if each event contains two bits
(two bits modulated in an event), then the BPS of such a transmission would be twice as
large as the Baud rate. This is not a theoretical case. Typical "high speed" modems use

sophisticated modulation on the telephone line, were the bit rate and Baud rate differ
significantly on the line. It is important to know this when you build measurement
equipment, decoders (demodulators), encoders (modulators), and all sorts of transmission
equipment for a particular protocol.
However, software developers typically like to ignore the difference of bit rate and baud
rate, because in their small world, a bit can either have the value true or false - an "event"
(a bit) always only has two possible states. They have no basic unit which can e.g. hold
four different states. In other words, on the software site the modulation has already been
flattened by the demodulator. If a modulation was used which can e.g. transmit 8 bits in
an event, the software developer sees them already as a series of 8 consecutive bits, each
either true or false. The demodulator took care of that. When it got an event it turned the
single 8-bit event into eight single-bit events. Software developers don't see the original
single entity with 256 different states (voltages, phases). Since the modulation has been
flattened they don't experience the difference between Baud rate and bit rate any more.
This is not the fault of the people who defined a Baud or a BPS. It is just a (welcome)
limitation of digital computer hardware.
Baud is actually a shortened term named in honor of mile Baudot, a French inventor of
early teleprinter machines that replaced the telegraph key using Morse Code. Basically
two typewriters that could be connected to each other with some wires. He came up with
some of the first digital character encoding schemes, and the character codes were
transmitted with a serial data connection. Keep in mind this was being done largely
before computers were invented. Indeed, some of these early tele-printer devices were
connected to the very first computers like the ENIAC or UNIVAC, simply because they
were relatively cheap and mass produced at that point.
In order for serial data communication to happen, you need to agree on a clock signal, or
baud rate, in order to get everything to be both transmitted and received properly. This is
where the language purists get into it, because it is this clock signal that actually drives
the "baud rate". Let's start more at

Tele printers evolved, and eventually you have Western Union sending tele-printer
"cablegrams" all around the world. If you hear of a TELEX number, this is the relic of
this system, which is still in use at the present time, even with the internet. By rapidly
glossing over a whole bunch of interesting history, you end up with the United States
Department of Justice (DOJ) in a lawsuit with AT&T. Mind you this was an earlier antitrust lawsuit prior to the famous/infamous 1982 settlement. The reason this is important is
because the DOJ insisted that Western Union got all of the digital business (cable grams...
and unfortunately this got to be read as computer equipment as well), and AT&T got
modulated frequencies, or in other words, you could talk to your mother on Mother's Day
on their equipment. When computers were being built in the 1950s, people wanted some
way to connect different pieces of computer equipment together to "talk" to each other.
This finally resulted in the RS-232 standard that we are discussing on this page.
While Western Union was permitted to carry digital traffic, often the connections weren't
in or near computer centers. At this time AT&T found a loophole in the anti-trust
settlement that could help get them into the business of being a "carrier" of computer
data. They were also offering to transmit computer data at rates considerably cheaper
than Western Union was going to charge. Hence, the modem was born.

Interrupts:
As the name implies, an interrupt is some event which interrupts normal program
execution. As stated earlier, program flow is always sequential, being altered only by
those instructions which expressly cause program flow to deviate in some way. However,
interrupts give us a mechanism to "put on hold" the normal program flow, execute a
subroutine, and then resume normal program flow as if we had never left it. This
subroutine, called an interrupt handler, is only executed when a certain event (interrupt)
occurs. The event may be one of the timers "overflowing," receiving a character via the
serial port, transmitting a character via the serial port, or one of two "external events."
The 8051 may be configured so that when any of these events occur the main program is
temporarily suspended and control passed to a special section of code which presumably
would execute some function related to the event that occurred. Once complete, control

would be returned to the original program. The main program never even knows it was
interrupted.
The ability to interrupt normal program execution when certain events occur
makes it much easier and much more efficient to handle certain conditions. If it were not
for interrupts we would have to manually check in our main program whether the timers
had overflows, whether we had received another character via the serial port, or if some
external event had occurred. Besides making the main program ugly and hard to read,
such a situation would make our program inefficient since wed be burning precious
"instruction cycles" checking for events that usually dont happen.
We can configure the 8051 so that any of the following events will cause an interrupt:
Timer 0 Overflow.
Timer 1 Overflow.
Reception/Transmission of Serial Character.
External Event 0.
External Event 1.
Obviously we need to be able to distinguish between various interrupts and
executing different code depending on what interrupt was triggered. This is accomplished
by jumping to a fixed address when a given interrupt occurs as shown below.

By consulting the above chart we see that whenever Timer 0 overflows (i.e., the TF0 bit
is set), the main program will be temporarily suspended and control will jump to 000BH.
It is assumed that we have code at address 000BH that handles the situation of Timer 0
overflowing.

Setting up Interrupts:

By default at power up, all interrupts are disabled. This means that even if, for
example, the TF0 bit is set, the 8051 will not execute the interrupt. Your program must
specifically tell the 8051 that it wishes to enable interrupts and specifically which
interrupts it wishes to enable.
Your program may enable and disable interrupts by modifying the IE SFR (A8h):

As you can see, each of the 8051s interrupts has its own bit in the IE SFR. You enable a
given interrupt by setting the corresponding bit.
However, before enabling any interrupt, you must set bit 7 of IE. Bit 7, the Global
Interrupt Enable/Disable, enables or disables all interrupts simultaneously. That is to say,
if bit 7 is cleared then no interrupts will occur, even if all the other bits of IE are set.
Setting bit 7 will enable all the interrupts that have been selected by setting other bits in
IE. This is useful in program execution if you have time-critical code that needs to
execute. In this case, you may need the code to execute from start to finish without any
interrupt getting in the way. To accomplish this you can simply clear bit 7 of IE (CLR
EA) and then set it after your time-critical code is done.

Interrupt priorities:
The 8051 automatically evaluates whether an interrupt should occur after every
instruction. When checking for interrupt conditions, it checks them in the following
order:
External 0 Interrupt
Timer 0 Interrupt
External 1 Interrupt
Timer 1 Interrupt
Serial Interrupt

This means that if a Serial Interrupt occurs at the exact same instant that an External 0
Interrupt occurs, the External 0 Interrupt will be executed first and the Serial Interrupt
will be executed once the External 0 Interrupt has completed.
The 8051 offers two levels of interrupt priority: high and low. By using interrupt
priorities you may assign higher priority to certain interrupt conditions. Interrupt
priorities are controlled by the IP SFR (B8h). The IP SFR has the following format:

When considering interrupt priorities, the following rules apply:

Nothing can interrupt a high-priority interrupt--not even another high priority


interrupt.

A high-priority interrupt may interrupt a low-priority interrupt.

A low-priority interrupt may only occur if no other interrupt is l ready executing.

If two interrupts occur at the same time, the interrupt with higher priority will
execute first. If both interrupts are of the same priority the interrupt which is
serviced first by polling sequence will be executed first.

When an interrupt is triggered, the following actions are taken automatically by the
microcontroller:

The current Program Counter is saved on the stack, low-byte first.

Interrupts of the same and lower priority are blocked.

In the case of Timer and External interrupts, the corresponding interrupt flag is
cleared.

Program execution transfers to the corresponding interrupt handler


vector address.

The Interrupt Handler Routine executes.


Take special note of the third step: If the interrupt being handled is a Timer or

External interrupt, the microcontroller automatically clears the interrupt flag before
passing control to your interrupt handler routine. This means it is not necessary that you
clear the bit in your code.

ZIGBEE TRANSCEIVER
6.1 Pin Diagram

Fig: 6.1 Pin diagram of X-Bee Transceiver

MaxStreams XBee Zigbee modules feature a UART interface, which allows any
microcontroller or microprocessor to immediately use the services of the Zigbee protocol.
All a Zigbee hardware designer has to do in this ase is ensure that the hosts serial port
logic levels are compatible with the XBees 2.8- to 3.4-V logic levels. The logic level
conversion can be performed using either a standard RS-232 IC or logic level translators
such as the 74LVTH125 when the host is directly connected to the XBee UART. The
below table gives the pin description of transceiver.

Table: 6.1 Pin Description of X-Bee Transceiver

Pin

Name

Direction

Description

1
2
3
4
5
6

Vcc
DOUT
DIN/CONFIG
DO8
RESET
PWM0/RSSI

Output
Input
Output
Input
Output

Power Supply
UART Data Out
UART Data In
Digital Output 8
Module Reset
PWM Output 0/RX Signal Strength Indicator

7
8
9
10
11
12
13
14
15

PWM1
[reserved]
DDR/SLEEP_RQ/DI8
GND
AD4/DIO4
CTS/DIO7
ON/SLEEP
VREF
Associate/AD5/DIO5

Output
Input
Either
Either
Output
Input
Either

PWM Output 1
Do not connect
Pin Sleep Control Line or Digital Input 8
Ground
Analog Input 4 or Digital I/O 4
Clear-to-Send Flow Control or Digital I/O 7
Module Status Indicator
Voltage Reference for A/D Inputs
Associated Indicator, Analog Input 5 or Digital

16

RTS/AD6/DIO6

Either

I/O 5
Request-to-Send Flow Control, Analog Input 6 or

Either
Either
Either
Either

Digital I/O 6
Analog Input 3 or Digital I/O 3
Analog Input 2 or Digital I/O 2
Analog Input 1 or Digital I/O 1
Analog Input 0 or Digital I/O 0

17
18
19
20

AD3/DIO3
AD2/DIO2
AD1/DIO1
AD0/DIO0

Design Notes:
Minimum connections: VCC, GND, DOUT & DIN
Minimum connections for updating firmware: VCC, GND, DIN, DOUT, RTS and

DTR
Signal Direction is specified with respect to the module
Module includes a 50k pull-up resistor attached to RESET
Several of the input pull-ups can be configured using the PR command
Unused pins should be left disconnected

6.2 Features
Performance:
Table: 6.2 Performance characteristics

Parameters

Value

Indoor/Urban Range

30m

Outdoor RF (LOS)

100m

Transmit Power Output

1mW (0dBm)

RF Data Rate

250,000bps

Serial Interface Data Rate

1200-115200bps

Receiver Sensitivity

-92dBm

Power Requirements:
Table: 6.3 Power Requirement characteristics

Parameters

Value

Supply Voltage

2.8 - 3.4V

Transmit Current

45mA

Receive Current

50mA

General:
Table: 6.4 General characteristics

Parameters

Value

Operating Frequency

ISM 2.4GHz

Dimensions

2.468 x 2.761

Operating Temperature

-40o to 85o C

Antenna Options

Integrated Chip Antenna

Networking and Security:


Table: 6.5 Networking and Security characteristics

Parameters

Value

Supported Network Topologies

Point-to-point, Point-to-multipoint,
Peer-to-peer

Number of Channels

16 Direct Sequence Channels

Addressing Options

PAN ID, Channel and Addresses

6.3 System Data Flow Diagram

Fig: 6.2 Data Flow Diagram

The X-Bee RF Modules interface to a host device through a logic-level


asynchronous Serial port. Through its serial port, the module can communicate with any
logic and voltage
Compatible UART; or through a level translator to any serial device.
Data is presented to the X-Bee module through its DIN pin, and it must be in the
asynchronous serial format, which consists of a start bit, 8 data bits, and a stop bit.
Because the input data goes directly into the input of a UART within the X-Bee module,
no bit inversions are necessary within the asynchronous serial datastream. All of the
required timing and parity checking is automatically taken care of by the X-Bees UART.
Just in case you are producing data faster than the X-Bee can process and transmit
it, both X-Bee modules incorporate a clear-to-send (CTS) function to throttle the data
being presented to the X-Bee modules DIN pin. You can eliminate the need for the CTS
signal by sending small data packets at slower data rates.
If the microcontroller wants to send data to transceiver, it will send RTS (Request
to Send) signal. If the transceiver is idle it sends CTS (Clear to Send) signal. The RTS
and CTS signals are active low. When microcontroller receives CTS command it will
send data to the transceiver through DIN pin. The transceiver will send the data to
microcontroller through DOUT pin. The communication between transceiver and the
microcontroller at the transmitter and receiver is similar. The communication between
transmitter and receiver is through RF communication.

6.4 Serial Data

Fig: 6.3 Serial Data Sequence


For example:
UART data packet 0x1F (decimal number is 31) as transmitted through the RF
module.
Data enters the module UART through the DI pin (pin 3) as an asynchronous
serial signal. The signal should idle high when no data is being transmitted. Each data
byte consists of a start bit (low), 8 data bits (least significant bit first) and a stop bit
(high). The following figure illustrates the serial bit pattern of data passing through the
module.
The module UART performs tasks, such as timing and parity checking, that are
needed for data communications. Serial communications depend on the two UARTs to
be configured with compatible settings (baud rate, parity, start bits, stop bits, data bits).
X-Bee RF Modules operate in Transparent Mode. When operating in this mode,
the modules act as a serial line replacement - all UART data received through the DI pin
is queued up for RF transmission. When RF data is received, the data is sent out the DO
pin.

Serial-to-RF Packetization
Data is buffered in the DI buffer until one of the following causes the data to be
packetized and transmitted:
No serial characters are received for the amount of time determined by the RO
(Packetization Timeout) parameter. If RO = 0, packetization begins when a
character is received.
The maximum number of characters that will fit in an RF packet (100) is
received.
The Command Mode Sequence (GT + CC + GT) is received. Any character
buffered in the DI buffer before the sequence is transmitted.

If the module cannot immediately transmit (for instance, if it is already receiving RF


data), the serial data is stored in the DI Buffer. The data is packetized and sent at any RO
timeout or when 100 bytes (maximum packet size) are received.
If the DI buffer becomes full, hardware or software flow control must be
implemented in order to prevent overflow (loss of data between the host and module).

6.5 Internal Data Flow

Fig: 6.4 Internal Data Flow Diagram


DI (Data In) Buffer:

When serial data enters the RF module through the DI pin (pin 3), the data is
stored in the DI Buffer until it can be processed.
Hardware Flow Control (CTS):
When the DI buffer is 17 bytes away from being full; by default, the module deasserts CTS (high) to signal to the host device to stop sending data [refer to D7 (DIO7
Configuration) parameter]. CTS are re-asserted after the DI Buffer has 34 bytes of
memory available.
How to eliminate the need for flow control:
Send messages that are smaller than the DI buffer size.
Interface at a lower baud rate [BD (Interface Data Rate) parameter] than the
throughput data rate.
Case in which the DI Buffer may become full and possibly overflow:
If the module is receiving a continuous stream of RF data, any serial data that
arrives on the DI pin is placed in the DI Buffer. The data in the DI buffer will be
transmitted over-the-air when the module is no longer receiving RF data in the network.
DO (Data Out) Buffer:
When RF data is received, the data enters the DO buffer and is sent out the serial
port to a host device. Once the DO Buffer reaches capacity, any additional incoming RF
data is lost.
Hardware Flow Control (RTS):
If RTS is enabled for flow control (D6 (DIO6 Configuration) Parameter = 1), data
will not be sent out the DO Buffer as long as RTS (pin 16) is de-asserted.
Two cases in which the DO Buffer may become full and possibly overflow:

If the RF data rate is set higher than the interface data rate of the module, the
module will receive data from the transmitting module faster than it can send the
data to the host.
If the host does not allow the module to transmit data out from the DO buffer
because of being held off by hardware or software flow control.

6.6

I/O Data Format


I/O data begins with a header. The first byte of the header defines the number of

samples forthcoming. A sample is comprised of input data and the inputs can contain
either DIO or ADC. The last 2 bytes of the header (Channel Indicator) define which
inputs are active. Each bit represents either a DIO line or ADC channel.

Fig: 6.5 Header of I/O Data Format

Sample data follows the header and the channel indicator frame is used to
determine how to read the sample data. If any of the DIO lines are enabled, the first 2
bytes are the DIO data and the ADC data follows. ADC channel data is stored as an
unsigned 10-bit value right-justified on a 16-bit boundary.
Sample Data

Fig: 6.6 Sample Data of I/O Data Format

6.7 Networks:
The following IEEE 802.15.4 network types are supported by the Zigbee RF
modules:
NonBeacon
NonBeacon (w/ Coordinator)
The following terms will be used to explicate the network operations:
Table 6.6: Terms and definitions:
Term
PAN

Definition
Personal Area Network - A data communication network that

Coordinator

includes one or more End Devices and optionally a Coordinator.


A Full-function device (FFD) that provides network synchronization

End Device

by polling nodes [NonBeacon (w/ Coordinator) networks only]


When in the same network as a Coordinator - RF modules that rely
on a Coordinator for synchronization and can be put into states of

Association

sleep for low-power applications.


The establishment of membership between End Devices and a
Coordinator. Association

is

only

applicable

in

NonBeacon

(w/Coordinator) networks.
6.7.1NonBeacon:
By default, XBee/XBee-PRO RF Modules are configured to support NonBeacon
communications. NonBeacon systems operate within a Peer-to-Peer network topology
and therefore are not dependent upon Master/Slave relationships. This means that
modules remain synchronized without use of master/server configurations and each

module in the network shares both roles of master and slave. MaxStream's peer-to-peer
architecture features fast synchronization times and fast cold start times. This default
configuration accommodates a wide range of RF data applications.
A peer-to-peer network can be established by configuring each module to operate
as an End Device (CE = 0), disabling End Device Association on all modules (A1 = 0)
and setting ID and CH parameters to be identical across the network.

Figure 6.7: NonBeacon Peer-to-Peer Architecture


6.7.2 NonBeacon (w/ Coordinator):
A device is configured as a Coordinator by setting the CE (Coordinator Enable)
parameter to 1. Coordinator power-up is governed by the A2 (Coordinator Association)
parameter.
In a NonBeacon (w/ Coordinator) system, the Coordinator can be configured to
use direct or indirect transmissions. If the SP (Cyclic Sleep Period) parameter is set to
0, the Coordinator will send data immediately. Otherwise, the SP parameter determines
the length of time the Coordinator will retain the data before discarding it. Generally, SP
(Cyclic Sleep Period) and ST (Time before Sleep) parameters should be set to match the
SP and ST settings of the End Devices.
6.7.3 Association:
Association is the establishment of membership between End Devices and a
Coordinator and is only applicable in NonBeacon (w/ Coordinator) networks. The
establishment of membership is useful in scenarios that require a central unit

(Coordinator) to relay messages to or gather data from several remote units (End
Devices), assign channels or assign PAN IDs.
An RF data network that consists of one Coordinator and one or more End
Devices form a PAN (Personal Area Network). Each device in a PAN has a PAN
Identifier [ID (PAN ID) parameter]. PAN IDs must be unique to prevent
miscommunication between PANs. The Coordinator PAN ID is set using the ID (PAN ID)
and A2 (Coordinator Association) commands.
An End Device can associate to a Coordinator without knowing the address, PAN
ID or channel of the Coordinator. The A1 (End Device Association) parameter bit fields
determine the flexibility of an End Device during association. The A1 parameter can be
used for an End Device to dynamically set its destination address, PAN ID and/or
channel.
Coordinator / End Device Setup and Operation
To configure a module to operate as a Coordinator, set the CE (Coordinator
Enable) parameter to 1. Set the CE parameter of End Devices to 0 (default).
Coordinator and End Devices should contain matching firmware versions.
Non Beacon (w/ Coordinator) Systems
In a Non Beacon (w/ Coordinator) system, the Coordinator can be configured to
use direct or indirect transmissions. If the SP (Cyclic Sleep Period) parameter is set to 0,
the Coordinator will send data immediately. Otherwise, the SP parameter determines the
length of time the Coordinator will retain the data before discarding it. Generally, SP
(Cyclic Sleep Period) and ST (Time before Sleep) parameters should be set to match the
SP and ST settings of the End Devices.
Coordinator Power-up
Coordinator power-up is governed by the A2 (Coordinator Association)
command. On power-up, the Coordinator undergoes the following sequence of events:
1. Check A2 parameter- Reassign_PANID Flag:

Set (bit 0 = 1) - The Coordinator issues an Active Scan. The Active Scan selects one
channel and transmits a Beacon Request command to the broadcast address (0xFFFF) and
broadcast PAN ID (0xFFFF). It then listens on that channel for beacons from any
Coordinator operating on that channel. The listen time on each channel is determined by
the SD (Scan Duration) parameter value.
Once the time expires on that channel, the Active Scan selects another channel
and again transmits the Beacon Request as before. This process continues until all
channels have been scanned, or until 5 PANs have been discovered. When the Active
Scan is complete, the results include a list of PAN IDs and Channels that are being used
by other PANs. This list is used to assign an unique PAN ID to the new Coordinator. The
ID parameter will be retained if it is not found in the Active Scan results. Otherwise, the
ID (PAN ID) parameter setting will be updated to a PAN ID that was not detected.
Not Set (bit 0 = 0) - The Coordinator retains its ID setting. No Active Scan is performed.
For example: If the PAN ID of a Coordinator is known, but the operating channel is not;
the A1 command on the End Device should be set to enable the Auto_Associate and
Reassign Channel bits. Additionally, the ID parameter should be set to match the PAN
ID of the associated Coordinator.
2. Check A2 parameter - Reassign Channel Flag (bit 1)
Set (bit 1 = 1) - The Coordinator issues an Energy Scan. The Energy Scan selects one
channel and scans for energy on that channel. The duration of the scan is specified by the
SD (Scan Duration) parameter. Once the scan is completed on a channel, the Energy Scan
selects the next channel and begins a new scan on that channel. This process continues
until all channels have been scanned.
When the Energy Scan is complete, the results include the maximal energy values
detected on each channel. This list is used to determine a channel where the least energy
was detected. If an Active Scan was performed (Reassign_PANID Flag set), the channels
used by the detected PANs are eliminated as possible channels. Thus, the results of the
Energy Scan and the Active Scan (if performed) are used to find the best channel
(channel with the least energy that is not used by any detected PAN). Once the best
channel has been selected, the CH (Channel) param-eter value is updated to that channel.

Not Set (bit 1 = 0) - The Coordinator retains its CH setting. An Energy Scan is not
performed.
3. Start Coordinator
The Coordinator starts on the specified channel (CH parameter) and PAN ID (ID
parameter). Note, these may be selected in steps 1 and/or 2 above. The Coordinator will
only allow End Devices to associate to it if the A2 parameter Allow Association flag is
set. Once the Coordinator has successfully started, the Associate LED will blink 1 time
per second. (The LED is solid if the Coordinator has not started.)
4. Coordinator Modifications
Once a Coordinator has started:
Modifying the A2 (Reassign_Channel or Reassign_PANID bits), ID, CH or MY
parameters will cause the Coordinators MAC to reset (The Coordinator RF module
(including volatile RAM) is not reset). Changing the A2 AllowAssociation bit will not
reset the Coordinators MAC. In a non-beaconing system, End Devices that associated to
the Coordinator prior to a MAC reset will have knowledge of the new settings on the
Coordinator. Thus, if the Coordinator were to change its ID, CH or MY settings, the End
Devices would no longer be able to communicate with the non-beacon Coordinator. Once
a Coordinator has started, the ID, CH, MY or A2 (Reassign_Channel or Reassign_PANID
bits) should not be changed.
End Device Power-up
End Device power-up is governed by the A1 (End Device Association) command.
On power-up, the End Device undergoes the following sequence of events:
1. Check A1 parameter Auto Associate Bit
Set (bit 2 = 1) - End Device will attempt to associate to a Coordinator.
Not Set (bit 2 = 0) - End Device will not attempt to associate to a Coordinator. The End
Device will operate as specified by its ID, CH and MY parameters. Association is
considered complete and the Associate LED will blink quickly (5 times per second).
When the Auto Associate bit is not set, the remaining steps (2-3) do not apply.
2. Discover Coordinator (if Auto-Associate Bit Set)

The End Device issues an Active Scan. The Active Scan selects one channel and
transmits a Beacon Request command to the broadcast address (0xFFFF) and broadcast
PAN ID (0xFFFF). It then listens on that channel for beacons from any Coordinator
operating on that channel. The listen time on each channel is determined by the SD
parameter.
Once the time expires on that channel, the Active Scan selects another channel
and again transmits the Beacon Request command as before. This process continues until
all channels have been scanned, or until 5 PANs have been discovered. When the Active
Scan is complete, the results include a list of PAN IDs and Channels that are being used
by detected PANs.
The End Device selects a Coordinator to associate with according to the A1 parameter
Reassign_PANID and Reassign_Channel flags:
Reassign_PANID Bit Set (bit 0 = 1) - End Device can associate with a PAN with any ID
value.
Reassign_PANID Bit Not Set (bit 0 = 0) - End Device will only associate with a PAN
whose ID setting matches the ID setting of the End Device.
Reassign_Channel Bit Set (bit 1 = 1) - End Device can associate with a PAN with any
CH value.
Reassign_Channel Bit Not Set (bit 1 = 0)- End Device will only associate with a PAN
whose CH setting matches the CH setting of the End Device.
After applying these filters to the discovered Coordinators, if multiple candidate
PANs exist, the End Device will select the PAN whose transmission link quality is the
strongest. If no valid Coordinator is found, the End Device will either go to sleep (as
dictated by its SM (Sleep Mode) parameter) or retry Association.
Note - An End Device will also disqualify Coordinators if they are not allowing
association (A2 Allow Association bit); or, if the Coordinator is not using the same
NonBeacon scheme as the End Device. (They must both be programmed with
NonBeacon code.)
3. Associate to Valid Coordinator
Once a valid Coordinator is found (step 2), the End Device sends an Association
Request message to the Coordinator. It then waits for an Association Confirmation to be

sent from the Coordinator. Once the Confirmation is received, the End Device is
Associated and the Associate LED will blink rapidly (2 times per second). The LED is
solid if the End Device has not associated.
4. End Device Changes once an End Device has associated
Changing A1, ID or CH parameters will cause the End Device to disassociate and
restart the Association procedure.
If the End Device fails to associate, the AI command can give some indication of
the failure.

6.8 Zigbee Addressing:


Every RF data packet sent over-the-air contains a Source Address and Destination
Address field in its header. The RF module conforms to the 802.15.4 specification and
supports both short 16-bit addresses and long 64-bit addresses. A unique 64-bit IEEE
source address is assigned at the factory and can be read with the SL (Serial Number
Low) and SH (Serial Number High) commands. Short addressing must be configured
manually. A module will use its unique 64-bit address as its Source Address if its MY
(16-bit Source Address) value is 0xFFFF or 0xFFFE. To send a packet to a specific
module using 64-bit addressing: Set Destination Address (DL + DH) to match the Source
Address (SL + SH) of the intended destination module. To send a packet to a specific
module using 16-bit addressing: Set DL (Destination Address Low) parameter to equal
the MY parameter and set the DH (Destination Address High) parameter to 0.
6.8.1 Unicast Mode
By default, the RF module operates in Unicast Mode. Unicast Mode is the only
mode that supports retries. While in this mode, receiving modules send an ACK
(acknowledgement) of RF packet reception to the transmitter. If the transmitting module
does not receive the ACK, it will re-send the packet up to three times or until the ACK is
received.
Short 16-bit addresses.
The module can be configured to use short 16-bit addresses as the Source Address
by setting (MY < 0xFFFE). Setting the DH parameter (DH = 0) will configure the
Destination Address to be a short 16-bit address (if DL < 0xFFFE). For two modules to
communicate using short addressing, the Destination Address of the transmitter module

must match the MY parameter of the receiver. The following table shows a sample
network configuration that would enable Unicast Mode communications using short 16bit addresses.
Table 6.7: Unicast Network Configuration (using 16-bit addressing)
Parameter
MY(source address)
DH(Destination High)
DL(Destination Low)

RF Module 1
0x01
0
0x02

RF Module 2
0x02
0
0x01

Long 64-bit addresses:


The RF modules serial number (SL parameter concatenated to the SH parameter)
can be used as a 64-bit source address when the MY (16-bit Source Address) parame-ter
is disabled. When the MY parameter is disabled (set MY = 0xFFFF or 0xFFFE), the
modules source address is set to the 64-bit IEEE address stored in the SH and SL
parameters. When an End Device associates to a Coordinator, its MY parameter is set to
0xFFFE to enable 64- bit addressing. The 64-bit address of the module is stored as SH
and SL parameters. To send a packet to a specific module, the Destination Address (DL +
DH) on one module must match the Source Address (SL + SH) of the other.
6.8.2 Broadcast Mode:
Any RF module within range will accept a packet that contains a broadcast
address. When configured to operate in Broadcast Mode, receiving modules do not send
ACKs (Acknowledgements) and transmitting modules do not automatically re-send
packets as is the case in Unicast Mode. To send a broadcast packet to all modules
regardless of 16-bit or 64-bit addressing, set the destination addresses of all the modules
as shown below.
Sample Network Configuration (All modules in the network):
DL (Destination Low Address) = 0x0000FFFF
DH (Destination High Address) = 0x00000000 (default value)

6.8Modes of Operation
The Transceiver operates in five modes .They are
1. Idle Mode
2. Receive mode
3. Transmit Mode
4. Sleep Mode
5. Command Mode

Fig: 6.7 Different Modes of Operation


The operation of Transceiver in each mode is explained below

1. Idle mode

When not receiving or transmitting data, the RF module is in Idle Mode. The
module shifts into the other modes of operation under the following conditions:

Transmit Mode (Serial data is received in the DI Buffer)


Receive Mode (Valid RF data is received through the antenna)
Sleep Mode (Sleep Mode condition is met)
Command Mode (Command Mode Sequence is issued)

2. Transmit Mode
RF data packets:
When not receiving or transmitting data, the RF module is in Idle Mode. The
module shifts into the each transmitted data packet contains a Source Address and
Destination Address field. The Source Address matches the address of the transmitting
module as specified by the MY (Source Address) parameter (if MY >= 0xFFFE), the SH
(Serial Number High) parameter or the SL (Serial Number Low) parameter. The
<Destination Address> field is created from the DH (Destination Address High) and DL
(Destination Address Low) parameter values. The Source Address and/or Destination
Address fields will either contain a 16-bit short or long 64-bit long address.
There are two methods to transmit data. They are
1. Direct Transmission
If the source address matches the destination address then Data is transmitted
immediately to the Destination Address. A NonBeaconing Coordinator can be configured
to use only Direct Transmission by setting the SP (Cyclic Sleep Period) parameter to 0.
Also, a NonBeaconing Coordinator using indirect transmissions will revert to direct
transmission if it knows the destination module is awake. To enable this behavior, the ST
(Time before Sleep) value of the Coordinator must be set to match the ST value of the
End Device. Once the End Device either transmits data to the Coordinator or polls the
Coordinator for data, the Coordinator will use direct transmission for all subsequent data
transmissions to that module address until ST time (or number of beacons) occurs with no

activity (at which point it will revert to using indirect transmissions for that module
address). No activity means no transmission or reception of messages with a specific
address. Global messages will not reset the ST timer.
2. Indirect Transmission
A packet is retained for a period of time and is only transmitted after the
destination module (Source Address = Destination Address) requests the data. To
configure Indirect Transmissions in a PAN (Personal Area Network), the SP (Cyclic
Sleep Period) parameter value on the Coordinator must be set to match the longest sleep
value of any End Device. The SP parameter represents time in NonBeacon systems and
beacons in Beacon-enabled systems. The sleep period value on the Coordinator
determines how long (time or number of beacons) the Coordinator will retain an indirect
message before discarding it. In NonBeacon networks, an End Device must poll the
Coordinator once it wakes from Sleep to determine if the Coordinator has an indirect
message for it. For Cyclic Sleep Modes, this is done automatically every time the module
wakes (after SP time). For Pin Sleep Modes, the A1 (End Device Association) parameter
value must be set to enable Coordinator polling on pin wake-up. Alternatively, an End
Device can use the FP (Force Poll) command to poll the Coordinator as needed.
Indirect Transmissions can only occur on a Coordinator. Thus, if all nodes in a
network are End Devices, only Direct Transmissions will occur. Indirect Transmissions
are useful to ensure packet delivery to a sleeping node. The Coordinator currently is able
to retain up to 2 indirect messages.

CCA (Clear Channel Assessment)


Prior to transmitting a packet, a CCA (Clear Channel Assessment) is performed
on the channel to determine if the channel is available for transmission. The detected
energy on the channel is compared with the CA (Clear Channel Assessment) parameter
value. If the detected energy exceeds the CA parameter value, the packet is not
transmitted. Also, a delay is inserted before a transmission takes place. This delay is
settable using the RN (Back off Exponent) parameter. If RN is set to 0, then there is no
delay before the first CCA is performed. The RN parameter value is the equivalent of the

minBE parameter in the 802.15.4 specification. The transmit sequence follows the
802.15.4 specification. By default, the MM (MAC Mode) parameter = 0. On a CCA
failure, the module will attempt to resend the packet up to two additional times. When in
Unicast packets with RR (Retries) = 0, the module will execute two CCA retires.
Broadcast packets always get two CCA retires.

Acknowledgement
If the transmission is not a broadcast message, the module will expect to receive
an acknowledgement from the destination node. If an acknowledgement is not received,
the packet will be resent up to 3 more times. If the acknowledgement is not received after
all transmissions, an ACK failure is recorded.

Sleep Mode
Sleep Modes enable the RF module to enter states of low-power consumption
when not in use. In order to enter Sleep Mode, one of the following conditions must be
met (in addition to the module having a non-zero SM parameter value):
Sleep_RQ (pin 9) is asserted.
The module is idle (no data transmission or reception) for the amount of time
defined by the ST (Time before Sleep) parameter. (ST is only active when SM =
4-5).
The SM command is central to setting Sleep Mode configurations. By default,
Sleep Modes are disabled (SM = 0) and the module remains in Idle/Receive Mode. When
in this state, the module is constantly ready to respond to serial or RF activity.

Higher Voltages
Sleep Mode current consumption is highly sensitive to voltage. Voltages above
3.0V will cause much higher current consumption.

Command mode
To modify or read RF Module parameters, the module must first enter into
Command Mode a state in which incoming characters are interpreted as commands.

Two Command Mode options are supported: AT Command Mode and API Command
Mode.

6.8 AT Command Mode


To Enter AT Command Mode:
Send the 3-character command sequence +++ and observe guard times before
and after the command characters.
AT Command Mode Sequence (for transition to Command Mode):
No characters sent for one second [GT (Guard Times) parameter = 0x3E8].
Input three plus characters (+++) within one second [CC (Command Sequence
Character) Parameter = 0x2B].
No characters sent for one second [GT (Guard Times) parameter = 0x3E8].
All of the parameter values in the sequence can be modified to reflect user
preferences.

To Send AT Commands:

Fig: 6.8 Syntax for sending AT Commands


The preceding example would change the RF module Destination Address (Low)
to 0x1F. To store the new value to non-volatile (long term) memory, subsequently send

the WR (Write) command. For modified parameter values to persist in the modules
registry after a reset, changes must be saved to non-volatile memory using the WR
(Write) Command. Otherwise, parameters are restored to previously saved values after
the module is reset.

System Response
When a command is sent to the module, the module will parse and execute the
command. Upon successful execution of a command, the module returns an OK
message. If execution of a command results in an error, the module returns an ERROR
message.

To Exit AT Command Mode:


1. Send the ATCN (Exit Command Mode) command (followed by a carriage return).
2. If no valid AT Commands are received within the time specified by CT (Command
Mode
Timeout) Command, the RF module automatically returns to Idle Mode.

6.8.1 AT Commands Description:


SH (Serial Number High) Command
The SH command is used to read the high 32 bits of the RF module's unique
IEEE 64-bit address. The module serial number is set at the factory and is read-only.
AT Command: ATSH
Parameter Range: 0 - 0xFFFFFFFF [read-only]
Related Commands: SL (Serial Number Low), MY (Source Address).
SL (Serial Number Low) Command
The SL command is used to read the low 32 bits of the RF module's unique IEEE
64-bit address. The module serial number is set at the factory and is read-only.
AT Command: ATSL
Parameter Range: 0 - 0xFFFFFFFF [read-only]

Related Commands: SH (Serial Number High), MY (Source Address)


DH (Destination Address High) Command
The DH command issued to set and read the upper 32 bits of the RF module's 64bit destination address. When combined with the DL (Destination Address Low)
parameter, it defines the destination address used for transmission.
A module will only communicate with other modules having the same channel
(CH parameter); PAN ID (ID parameter) and destination address (DH + DL parameters).
To transmit using a 16-bit address, set the DH parameter to zero and the DL
parameter less than 0xFFFF. 0x000000000000FFFF (DL concatenated to DH) is the
broadcast address for the PAN.
AT Command: ATDH
Parameter Range: 0 - 0xFFFFFFFF
Default Parameter Value: 0
Related Commands: DL (Destination Address Low), CH (Channel), ID (PAN VID)
DL (Destination Address Low) Command
The DL command is used to set and read the lower 32 bits of the RF module's 64bit destination address. When combined with the DH (Destination Address High)
parameter, it defines the destination address used for transmission. A module will only
communicate with other modules having the same channel (CH parameter), PAN ID (ID
parameter) and destination address (DH + DL parameters).
To transmit using a 16-bit address, set the DH parameter to zero and the DL
parameter less than 0xFFFF. 0x000000000000FFFF (DL concatenated to DH) is the
broadcast address for the PAN.
AT Command: ATDL
Parameter Range: 0 - 0xFFFFFFFF
Default Parameter Value: 0
Related Commands: DH (Destination Address High), CH (Channel), ID (PAN VID)
DN (Destination Node) Command

The DN command is used to resolve a NI (Node Identifier) string to a physical


address. The following events occur upon successful command execution:
1. DL and DH are set to the address of the module with the matching NI (Node
Identifier).
2. OK is returned.
3. RF module automatically exits AT Command Mode.
If there is no response from a modem within 200 msec or a parameter is not
specified (left blank), the command is terminated and an ERROR message is returned.
AT Command: ATDN
Parameter Range: 20-character ASCII String
Minimum Firmware Version Required: v1.x80
BD (Interface Data Rate) Command
The BD command is used to set and read the serial interface data rate used
between the RF module and host. This parameter determines the rate at which serial data
is sent to the module from the host. Modified interface data rates do not take effect until
the CN (Exit AT Command Mode) command is issued and the system returns the 'OK'
response.
When parameters 0-7 are sent to the module, the respective interface data rates are
used. The RF data rate is not affected by the BD parameter. If the interface data rate is set
higher than the RF data rate, a flow control configuration may need to be implemented.
AT Command: ATBD
Parameter Range: 0 - 7 (standard rates) 0x80-0x1C200 (non-standard rates)
Table: 6.6 Setting Different Baud Rate
Parameter
0
1
2
3
4

Configuration (bps)
1200
2400
4800
9600
19200

5
6
7
Default Parameter Value: 3

38400
57600
115200

CE (Coordinator Enable) Command


The CE command is used to set and read the behavior (End Device vs.
Coordinator) of the RF module.
AT Command: ATCE
Parameter Range: 0 1
Table: 6.7 Configuring the RF Module
Parameter
0
1

Configuration
End device
Coordinator

Default Parameter Value: 0


Minimum Firmware Version Required: v1.x80
CH (Channel) Command
The CH command is used to set/read the operating channel on which RF
connections are made between RF modules. The channel is one of three addressing
options available to the module. The other options are the PAN ID (ID command) and
destination addresses (DL & DH commands).
In order for modules to communicate with each other, the modules must share the
same channel number. Different channels can be used to prevent modules in one network
from listening to transmissions of another. Adjacent channel rejection is 23 dB.
The module uses channel numbers of the 802.15.4 standard.
Center Frequency = 2.405 + (CH - 11d) * 5 MHz (d = decimal)
AT Command: ATCH
Parameter Range: 0x0B - 0x1A (XBee) 0x0C - 0x17 (XBee-PRO)
Default Parameter Value: 0x0C (12 decimal)

Related Commands: ID (PAN ID), DL


(Destination Address Low, DH (Destination Address High)
ID (Pan ID) Command
The ID command is used to set and read the PAN (Personal Area Network) ID of
the RF module. Only modules with matching PAN IDs can communicate with each other.
Unique PAN IDs enable control of which RF packets are received by a module.
Setting the ID parameter to 0xFFFF indicates a global transmission for all PANs.
It does not indicate a global receives.
AT Command: ATID
Parameter Range: 0 - 0xFFFF
Default Parameter Value: 0x3332 (13106 decimal)
MY (16-bit Source Address) Command
The MY command is used to set and read the 16-bit source address of the RF
module.
By setting MY to 0xFFFF, the reception of RF packets having a 16-bit address is
disabled. The 64-bit address is the modules serial number and is always enabled.
AT Command: ATMY
Parameter Range: 0 - 0xFFFF
Default Parameter Value: 0
Related Commands: DH (Destination Address High), DL (Destination Address Low), CH
(Channel), ID (PAN ID)
NI (Node Identifier) Command
The NI command is used to set and read a string for identifying a particular node.
Rules:

Register only accepts printable ASCII data.


A string cannot start with a space.
A carriage return ends command
Command will automatically end when maximum bytes for the string have been
entered.

This string is returned as part of the ND (Node Discover) command. This


identifier is also used with the DN (Destination Node) command.
AT Command: ATNI
Parameter Range: 20-character ASCII string
Related Commands: ND (Node Discover), DN (Destination Node)
Minimum Firmware Version Required: v1.x80
WR (Write) Command
The WR command is used to write configurable parameters to the RF module's
nonvolatile memory. Parameter values remain in the module's memory until overwritten
by subsequent use of the WR Command.
If changes are made without writing them to non-volatile memory, the module
reverts back to previously saved parameters the next time the module is powered-on.
AT Command: ATWR
VR (Firmware Version) Command
The VR command is used to read which firmware version is stored in the module.
XBee version numbers will have four significant digits. The reported number will show
three or four numbers and is stated in hexadecimal notation. A version can be reported as
"ABC" or "ABCD". Digits ABC are the main release number and D is the revision
number from the main release. "D" is not required and if it is not present, a zero is
assumed for D. "B" is a variant designator. The following variants exist:
"0" = Non-Beacon Enabled 802.15.4 Code
"1" = Beacon Enabled 802.15.4 Code
AT Command: ATVR
Parameter Range: 0 - 0xFFFF [read only]
AP (API Enable) Command
The AP command is used to enable the RF module to operate using a frame based
API instead of using the default Transparent (UART) mode.
AT Command: ATAP

Parameter Range: 0 2
Table: 6.8 Enabling AP Command
Parameter
0
1
2

Configuration
Disabled (transparent operation )
API enabled
API enabled(with escaped characters)

Default Parameter Value: 0


Minimum Firmware Version Required: v1.x80
EA (ACK Failures) Command
The EA command is used to reset and read the count of ACK (acknowledgement)
failures. This parameter value increment when the module expires its transmission retries
without receiving an ACK on a packet transmission. This count saturates at its maximum
value. Set the parameter to 0 to reset count.
AT Command: ATEA
Parameter Range: 0 - 0xFFFF
Minimum Firmware Version Required: v1.x80
EC (CCA Failures) Command
The EC command is used to read and reset the count of CCA (Clear Channel
Assessment) failures. These parameter value increments when the RF module does not
transmit a packet due to the detection of energy that is above the CCA threshold level (set
with CA command). This count saturates at its maximum value.
Set the EC parameter to 0 to reset count.
AT Command: ATEC
Parameter Range: 0 - 0xFFFF
Related Command: CA (CCA Threshold)
Minimum Firmware Version Required: v1.x80

EE (AES Encryption Enable) Command


The EE command is used to set/read the parameter that disables/enables 128-bit
AES encryption. The XBee/XBee-PRO firmware uses the 802.15.4 Default Security
protocol and uses AES encryption with a 128-bit key. AES encryption dictates that all
modules in the network use the same key and the maximum RF packet size is 95 Bytes.
When encryption is enabled, the module will always use its 64-bit long address as
the source address for RF packets. This does not affect how the MY (Source Address),
DH (Destination Address High) and DL (Destination Address Low) parameters work.
AT Command: ATEE
Parameter Range: 0 - 1
Default Parameter Value: 0
Related Commands: KY (Encryption Key), AP (API Enable), MM (MAC Mode)
Minimum Firmware Version Required: v1.xA0
VL (Firmware Version - Verbose)
The VL command is used to read detailed version information about the RF
module.
The information includes:
Application builds date; MAC, PHY and boot loader versions; and builds dates.
AT Command: ATVL
Parameter Range: 0 - 0xFF
Default Parameter Value: 0x28 (40 decimal)
Minimum Firmware Version Required: v1.x80
ND (Node Discover) Command
The ND command is used to discover and report all modules on its current
operating channel (CH parameter) and PAN ID (ID parameter). ND also accepts an NI
(Node Identifier) value as a parameter. In this case, only a module matching the supplied
identifier will respond.

ND uses a 64-bit long address when sending and responding to an ND request.


The ND command causes a module to transmit a globally addressed ND command
packet. The amount of time allowed for responses is determined by the NT (Node
Discover Time) parameter.
AT Command: ATND
Range: optional 20-character NI value
Related Commands: CH (Channel), ID (Pan ID), MY (Source Address), SH (Serial
Number High), SL (Serial Number Low), NI (Node Identifier), NT (Node Discover
Time)
Minimum Firmware Version Required: v1.x80
AC (Apply Changes) Command
The AC command is used to explicitly apply changes to module parameter values.
Applying changes means that the module is re-initialized based on changes made to its
parameter values. Once changes are applied, the module immediately operates according
to the new parameter values.
This behavior is in contrast to issuing the WR (Write) command. The WR
command saves parameter values to non-volatile memory, but the module still operates
according to previously saved values until the module is re-booted or the CN (Exit AT
Command Mode) command is issued.
AT Command: ATAC
Minimum Firmware Version Required: v1.xA0
RE (Restore Defaults) Command
The RE command is used to restore all configurable parameters to their factory
default settings. The RE command does not write restored values to non-volatile
(persistent) memory. Issue the WR (Write) command subsequent to issuing the RE
command to save restored parameter values to non-volatile memory.
AT Command: ATRE

HV (Hardware Version) Command


The HV command is used to read the hardware version of the RF module.
AT Command: ATHV
Parameter Range: 0 - 0xFFFF [Read-only]
Minimum Firmware Version Required: v1.x80
CN (Exit Command Mode) Command
The CN command is used to explicitly exit the RF module from AT Command
Mode.
AT Command: ATCN

6.9 ZIGBEE ARCHITECTURE


The IEEE 802.15.4 standard and Zigbee wireless network technology are ideal for
the implementation of a wide range of low cost, low power and reliable control and
monitoring applications within the private home and industrial environment. The working
model of the IEEE 802.15.4 and Zigbee is illustrated in Figure 6.9.

Fig: 6.9 Zigbee Architecture

In the Zigbee architecture, the PHY layer and MAC layer are based on the IEEE
802.15.4 WPAN standard. Zigbee defines the NWK and APS layers. The software and
hardware vendor will provide the software stack with appropriate tools to allow an OEM
to create applications, which are added to the APL. The Physical (PHY) layer and
Medium Access Control (MAC) layer are based on the IEEE802.15.4 PAN standard. This
includes the actual radio hardware. Above the MAC and PHY are the Network (NWK)
and application layers defined by Zigbee.
The first two layers, the physical (PHY) and Medium Access Control (MAC) are
defined in the IEEE standard. The other layers that build on the PHY and MAC layers are
defined by the Zigbee alliance.

The PHY layer contains the RF transceiver and access to the other hardware and
control mechanisms. The function of the PHY is to activate and deactivate the radio
transceiver and other hardware specific services such as access to the channels.
The MAC layer is as described by the name a controlling device for radio medium.
It controls access to the physical radio channel and other services defined by the PHY
service. It is also responsible for a reliable transmission system through its services. The
services are about channel access and transmission techniques and validation of data
packets.
The network (NWK) layer is responsible for the network controlling functions. It
controls the mechanism for joining and leaving a network and for creating a network for
those devices which have the capability to do so. The NWK layer applies also security to
what is going to be data packets. The NWK layer is responsible for discovery and storing
information about the neighbors in the network. Responsibility for routing between
devices and routing of packets to their destination goes to this layer.
The application layer (APL) consists of three different blocks which have
different functionalities and responsibilities. The application support sub-layer (APS) is
responsible for maintaining a table of devices that are connected to each other, a binding
table. The APS layer provides an interface between the NWK layer and the APL with its
set of services.
The Zigbee device object (ZDO) is responsible for managing Zigbee devices in
the network. This could be discovering new device in the network and define its role in
the network it also determines the services the new device provides. Possible device types
are those defined in Zigbee standard and they are coordinators, routers and end devices.
The Application Frame (AF) contains application objects which can be
manufacturer defined application objects. An example of an application object is a power
switch. The security service provider (SSP) provides enhanced security options as
encryption with 128-bit key transport.

PHYSICAL LAYER
The physical layer is responsible for the radio hardware device. The standard defi
nes two

hardware

Platforms for the IEEE 802.15.4. One describes the 2.4 GHz spectrum and onethe 868/9
15 MHz spectrum.The lower band use different modulations technique and lower
data rate. Explanations for the different bands are given in the regulations section. The lo
wer band provides better radio performance when reviewing the frequency band and the
antenna performance .specifications in the rest of the report apply only for the 2.4GHz
band.
Frequency bands:
Table: 6.9 Operating Frequency Bands of Zigbee
PHY

Frequency

(MHz)

Band

Chip rate

Data parameters

Modulation Bit

Symbol rate

(k chips/s)

rate

(k symbol/s)

868-868.6

300

BPSK

(kb/s)
20

902-928

600

BPSK

2400-

2000

O-QPSK

(MHz)

865/

Spreading parameters

symbols

channels

20

Binary

40

40

Binary

1-10

250

62.5

16-ary

11-26

915

2400

2483.5

Orthogo
nal

Responsibility
The layer is responsible for the hardware and can be divided into the following tasks:

Activation and deactivation of radio transceiver.


Data transmission and reception.
Channel frequency selection.
Indicator for radio quality within channels and for packets.
Channel access assessment technique.

Layer service
The PHY data service is responsible of transport of MPDU between MAC peer
sub-layers through the PD-SAP. This is done by data primitives such as PD-DATA

request. The PLME is responsible for managing a database of managed objects by the
PHY. It is referred to as PHY information base (PIB). The PLME-SAP is responsible for
management commands between the MAC layer management entity (MLME) and the
PLME. The primitives that are provided are defined for the PLME. They provide for
example performing CCA, Energy Detection (ED) measurements or accessing the PIB
data base.
PHY enumeration descriptions, constants and PIB attributes are defined in a table
in the standard. The maximum PSDU that the PHY shall be able to receive from the
MAC layer is 127 octets as described in the introduction. Turnaround times for TX-to-RX
and RX-to-TX shall be a maximum of 12 data symbol periods. Each symbol is 4 bits
which gives a maximum turnaround time of 6 octet periods.
The spreading of the data decreases the raw data transfer but leads to a much
higher reliability in the transmission. Errors in the baseband chip sequence do not mean
errors in the raw data. The probability to recognize the correct symbol even if bit errors
have occurred is high. The O-QPSK modulation used is equivalent to MSK modulation.
It utilizes constant amplitude and enables use of relatively nonlinear amplifier designs
which means more simple and low cost construction.

MAC LAYER
The MAC layer is responsible for accessing the physical radio channel through
the PHY layer. It provides services to enable reliable single hop communication links
between devices in a network. The services are about channel access and transmission
techniques and validation of data packets.
Layer Service
The services provided by the MAC layer can be divided into these sub groups:

Providing a single-hop peer link between MAC entities.


Supporting PAN association and dissociation.
Using CSMA-CA mechanism for channel access.
Handling and maintaining of GTS mechanism.
Generate network beacons if device is coordinator.
Synchronization to network beacons.
Supporting device security.

Layer Structure
The structure communication model is similar to the PHY layer. The MAC layer
includes a management entity (MLME) which provides interface to management entities
on other devices. The MLME is also responsible of maintaining a data base of
management objects. The MAC sub-layer provides two services accessed through the
data entity and management. The services are provided for the PHY layer and next higher
layer. Data services provided by the MAC layer are those for requesting and confirming
data for example. Management services in the MAC layer is among others association
primitives, beacon primitives and channel scanning primitives.
CSMA-CA
The CSMA-CA algorithm implements time units called back off periods. In
slotted CSMA-CA the back off periods of every device in the network are aligned with
the super frame boundaries of the coordinator. In the unslotted CSMA-CA the back off
periods of devices in the network are not related in time to any other device 9in the PAN.
The IEEE 802.15.4 MAC sub layer controls the access to the radio channel using
the CSMA-CA (Carrier Sense Multiple Access with Collision Avoidance) method, and
handles network (dis)association and MAC layer security (AES-128 encryption based). It
is also responsible for flow control via acknowledgement and retransmission of data
packets, frame validation, and network synchronization as well as support to upper layers
for robust link operation. The Zigbee wireless technology specifies the network, security,
and application layers upon the IEEE 802.15.4 PHY and MAC layers. The Zigbee
Alliance also provides interoperability and conformance testing specifications.
Channel Access
There are two types of channel access in the IEEE 802.15.4 defined
communication system. They are based on contention which decides if the devices retain
their own time slot for communication. The contention based allows the devices to access
channel in the distributed way using CSMA-CA algorithm. With this contention free
method the network coordinator decides about the channel access with the use of
Guaranteed Time Slots (GTS) of the channel space. This contention free method is
suitable for latency sensitive devices that require short delay time and no competition of
the channel access.

Transmission
Transmission, reception and acknowledgements are procedures for sending data,
receiving data and for acknowledging that data has been received or sent. Retransmission
of data if error occurs if bounded to acknowledgments procedures that are optional.
Security
The MAC layer is responsible for providing security services when requested by
higher layers. The higher layers are responsible for information necessary to provide
needed security services. Key management, device authentication and freshness
protection may be services provided by higher layers but out of the scope for this
standard..
The IEEE 802.15.4 supports the following security services:

Access control
Data encryption
Frame integrity
Sequential freshness

The security can be implemented on both incoming and outgoing frames.


Access control provides and maintains an Access Control List (ACL). The list
contains devices that have been selected and approved for communicating with. Data
encryption security service uses a symmetric cipher to encrypt data for parties who do not
have the cryptographic key. In this standard the data encryption may be provided on
beacon payloads, command payloads and data payloads. Frame integrity service provides
assurance that data have not been modified by parties without the cryptographic key and
also that data originates from sources with the key. The service may be provided on
beacon frames, command frames and data frames. Sequential freshness uses a sequence
to protect from frames that are not the original in some manner.

NETWORK LAYER
The NWK layer is the first Zigbee layer. It is build upon the MAC and PHY
layers. The NWK layer provides services for routing and multi-hop communication
needed to build different network topologies it is required for correct functionality for
underlying layers. It acts as a interface for next higher layer, the application layer. It

includes a NWK layer management entity (NLME). The NLME and the NWK layer data
entity (NLDE) uses the NLME-SAP and the NLDE-SAP for communicating to other
layers.
The NLDE provides two kinds of services
Generate NWK Protocol Data Unit (NPDU) from next higher layer, APS layer.
Deliver NPDU to recipient or route it to the next step towards the destination.
The NLME provides the following services:

Configuring a new device


Starting a network
Joining and leaving a network
Addressing
Neighbor discovery
Route discovery
Reception control

Attributes
A list of constants is characterizing the NWK layer. A list of attributes is also
given and it is used to manage the NWK layer of a device. An attribute is a data entity
that represents a physical quantity or a state. The attribute data is sent using commands.
Building network
The procedures for building networks are build on those defined in the MAC
layer. Only coordinators are able to build a network. After that is guaranteed an ED scan
is performed followed by an active scan. When data is processed a PAN identifier is
selected, channel selection are made and a network address is assigned.
Joining network
Coordinators and routers can permit devices to join the network. The relationship
between the device that provides permission and the device that wants to join the network
is called a parent-child relationship. A parent can directly accept a child and join it to the
network with the 64 bit IEEE address. The child retains then a short logical address.
When a device wants to join a network first a scan procedure is performed. A suitable
parent is searched for from the neighbor table. Joining the network is then done by an

association request. If joining was successful the new device receives a 16 bit short
address for communication within the network. The devices are then updating the
information in their neighbor tables. Orphaning is the procedure that is performed when a
child loose connection to its network or to its parent.
The leaving of a network can be done either by request from the child or as a
request from the parent to force the child device to leave the network. Every device has
an associated depth. It tells the minimum hops a data frame has to perform through parent
links to reach the coordinator. The coordinator itself has 0 depth and its children have 1
depth. The maximum depth of the network is decided by the coordinator. Neighbor tables
shall contain information about devices within a specified transmission range. The
information shall be used for different purpose and contains basic device and network
information. It can also be increased with more information. A table entry shall be
updated each time a device receives a frame from the neighbor.
The addressing of joined devices can be assigned in two ways. Either as
distributed address assignment mechanism or as higher-layer addresses assignment
mechanism.

APL LAYER
The application layer is the second of two Zigbee layers. The application layer
houses the responsibility for overall device management. It is also responsible for
applications and service function within the application layer and to the NWK layer. The
application layer consists of the APS, AF and ZDO.
There are two addressing concepts for Zigbee devices. It consists of addressing
the specific radio hardware or the application object. They are called node addressing
respective endpoint addressing. A node refers to a single radio device. A node could
consist of several subunits where each subunit has a device description. Each subunit is
assigned its own specific endpoint which range from 1 to 240. Each endpoint has a
description that describes for example what it does and which attributes it has. Attributes
are variables that represent physical quantity or states. In a typical application an attribute
could be temperature and endpoints could be sensor applications for temperature and
humidity. A cluster is identifier of messages that are sent and are also container for

attributes. A Zigbee device would then represent a node that could be an indoors climate
report station and another Zigbee device node a controller and communication central for
a climate control centre.
Application support sub-layer (APS)
The APS provides interface between the NWK layer and application layer. The
services are offered via the two services, APS Data Entity (APSDE) and APS
Management Entity (APSME). The APSDE provides data transmission through its
APSDE-SAP and the management entity provides all other services through APSMESAP.
The APSDE provides these services
Generation of APDU-APS layer specific frame are generated
Binding-Transmission between matched devices
The APSME provides these services:
Interaction with Zigbee Stack
Binding-Ability to match devices
Security-Security relationships with use of keys
Transmission
If an indirect transmission is sent the originating device shall direct the
transmission to the Zigbee coordinator which handles message reflection. The Zigbee
coordinator contains the binding table and shall search for table entry that matches the
source address, the cluster identifier or the source endpoint field. The transmission shall
be directed to each of these matched entries. The source address is retained from the
NWK layer, the cluster identifier and the source endpoint is included in the frame. The
indirect transmission shall include the source endpoint or destination endpoint field
depending on direction with respect to the coordinator. If the transmission is towards the
coordinator for relay it shall contain destination endpoint. If it is directed from
coordinator after relay it shall contain the source endpoint. Acknowledgement is optional
and in indirect addressing the coordinator shall answer acknowledgement request from
originating devices and requesting acknowledgement from devices that frames are

relayed to. Retransmissions are bound to acknowledgement. When acknowledge is


enabled retransmission shall be performed if error occurs.

Application Framework (AF)


The application frame work is containing the application objects and provides
services that the application uses. The applications communicate through the APSDESAP. The control and management of application frame is performed by ZDO public
interfaces. The primitives is as for the APS sub-layer request, confirm and indication.
Endpoints
The application framework can house up to 240 application objects. Each one is
defined on an endpoint with index from 1 to 240, see figure 2.13. Endpoint 0 is reserved
and is used for interface to the ZDO and endpoint 255 is reserved for broadcasting of data
to all application objects.
ZDO
The ZDO is responsible for overall device management and handling of services.
It uses its services to implement three different logical Zigbee devices, coordinator, router
and end device. The ZDO is interfacing the management entities of the NWK and the
APS sub-layer.
The ZDO is responsible for assembling data configuration from end points to
implement these functions:

Device and service discovery


Security manager
Network manager
Node manager
TEMPERATURE SENSING CIRCUIT (temperature sensor):
The methods of temperature measurement may be divided into two main classes
according as the exchange of heat between the testing body and the hot system takes
place by contact or by radiation across a space. In the contact methods, thermometers or
thermocouples are used and they are immersed in solids or liquids. The thermodynamic

equilibrium between the hot body and the testing body is established by material contact.
In the non-contact methods, the thermodynamic equilibrium is established by the
radiation emitted as excited atom and molecules in the hot body return to the ground
state.
THERMISTOR:
Description and working
The word thermistor is an acronym for thermal resistor, i.e., a
temperature sensitive resistor. It is used to detect very small changes in temperature. The
variation in temperature is reflected through appreciable variation of the resistance of the
device. Thermistor with both negative-temperature-coefficients (NTC) and positive
temperature coefficient (PTC) are available, but NTC thermistors are more common. The
negative-temperature coefficient means that the resistance increases with the increase in
temperature.
The NTC thermistor are manufactured by sintering which is a
process in which powdered materials are fused together by the application of heat
semiconductor ceramic materials prepared from mixtures of metallic oxides of cobalt,
nickel, manganese etc. These materials have high negative temperature coefficient. The
PTC thermistors are made from doped barium titanate semi conducting material. This
material has a very large change in resistance for a small change in temperature. In this
project NTC thermistor is used.
Thermistors are manufactured in the form of beads, probes, disc,
washers and rods. The beads are made in diameter ranging from 0.15mm to 2.5mm.
These are useful where temperature sensing must be done in very limited spaces. Sealing
thermistor beads in glass rods up to 25mm in diameter forms the probes. These are more
rugged than beads and work well in liquids.

Fig 3.3 - SCHEMATIC SYMBOL


The discs and washers are made to meet certain industrial requirements. The discs
are used in moderate power applications in conjunction with time response applications.
The rods and washers are used for high power applications. Figure shows the schematic
symbol of a thermistor.
THERMISTOR CHARACTERISTICS:
Figure shows the thermistor characteristic (temperature-resistance characteristic)
for the NTC and PTC thermistor. It may be noted that NTC thermistor has a resistance of
about 10kilo ohms and 100kilo ohms at 50 C to 150 C respectively. It means that a
temperature change of 200 C has resulted in a 100:1 change in resistance

10k

1k

100
-50

50

100

150

Fig- 3.4: -THERMISTOR CHARACTERISTIC


In case of PTC thermistor, the curve rises rapidly. The temperature where the
resistance increases rapidly is called switching point. The switching point temperature
depends upon the particular type of PTC thermistor. The typical values of the switching
point temperature may range from 30 C to 160 C.

THERMISTOR APPLICATIONS:
Thermistors are extensively used in industrial, commercial, medical and household
applications. Some of the important applications of thermistor are:
1. Temperature measurement and control.
2. Liquid level measurement.
3. Temperature compensation in electronic circuits.
4. Flow rate measurement.

CURRENT TRANSFORMER

In electrical engineering, a current transformer (CT) is used for measurement of electric


currents. Current transformers, together with voltage transformers (VT) (potential
transformers (PT)), are known as instrument transformers. When current in a circuit is too

high to directly apply to measuring instruments, a current transformer produces a reduced


current accurately proportional to the current in the circuit, which can be conveniently
connected to measuring and recording instruments. A current transformer also isolates the
measuring instruments from what may be very high voltage in the monitored circuit.
Current transformers are commonly used in metering and protective relays in the
electrical power industry.

Design
Like any other transformer, a current transformer has a primary winding, a magnetic core,
and a secondary winding. The alternating current flowing in the primary produces a
magnetic field in the core, which then induces a current in the secondary winding circuit.
A primary objective of current transformer design is to ensure that the primary and
secondary circuits are efficiently coupled, so that the secondary current bears an accurate
relationship to the primary current.

The most common design of CT consists of a length of wire wrapped many times around
a silicon steel ring passed over the circuit being measured. The CT's primary circuit
therefore consists of a single 'turn' of conductor, with a secondary of many hundreds of
turns. The primary winding may be a permanent part of the current transformer, with a
heavy copper bar to carry current through the magnetic core. Window-type current
transformers are also common, which can have circuit cables run through the middle of
an opening in the core to provide a single-turn primary winding. When conductors

passing through a CT are not centered in the circular (or oval) opening, slight
inaccuracies may occur.

Current transformers used in metering equipment for three-phase 400 ampere electricity
supply
Shapes and sizes can vary depending on the end user or switchgear manufacturer. Typical
examples of low voltage single ratio metering current transformers are either ring type or
plastic moulded case. High-voltage current transformers are mounted on porcelain
bushings to insulate them from ground. Some CT configurations slip around the bushing
of a high-voltage transformer or circuit breaker, which automatically centers the
conductor inside the CT window.
The primary circuit is largely unaffected by the insertion of the CT. The rated secondary
current is commonly standardized at 1 or 5 amperes. For example, a 4000:5 CT would
provide an output current of 5 amperes when the primary was passing 4000 amperes. The
secondary winding can be single ratio or multi ratio, with five taps being common for
multi ratio CTs. The load, or burden, of the CT should be of low resistance. If the voltage
time integral area is higher than the core's design rating, the core goes into saturation
towards the end of each cycle, distorting the waveform and affecting accuracy.

Usage
Current transformers are used extensively for measuring current and monitoring the
operation of the power grid. Along with voltage leads, revenue-grade CTs drive the

electrical utility's watt-hour meter on virtually every building with three-phase service
and single-phase services greater than 200 amp.
The CT is typically described by its current ratio from primary to secondary. Often,
multiple CTs are installed as a "stack" for various uses. For example, protection devices
and revenue metering may use separate CTs to provide isolation between metering and
protection circuits, and allows current transformers with different characteristics
(accuracy, overload performance) to be used for the different purposes.

Safety precautions
Care must be taken that the secondary of a current transformer is not disconnected from
its load while current is flowing in the primary, as the transformer secondary will attempt
to continue driving current across the effectively infinite impedance. This will produce a
high voltage across the open secondary (into the range of several kilovolts in some
cases), which may cause arcing. The high voltage produced will compromise operator
and equipment safety and permanently affect the accuracy of the transformer.

What Are the Functions of a Current Transformer?

What Are the Functions of a Current Transformer?


A current transformer (CT) is a transformer which measures the current of another circuit.
It is coupled to an ammeter (A in the diagram) in its own circuit to perform this
measurement. Measuring high-voltage current directly would require insertion of

measuring instrumentation into the measured circuit--an unnecessary difficulty which


would draw down the very current meant to be measured. Also, the heat generated in the
measuring equipment from the high current could give false readings. Measuring current
indirectly with a CT is much more practical.

Relation to Voltage Transformer

1.
Voltage Transformer
The function of a current transformer (CT) can be understood better by comparing it to
the more commonly known voltage transformer (VT). Recall that in a voltage
transformer, an alternating current in one circuit sets up an alternating magnetic field in a
coil in the circuit. The coil is wrapped around an iron core, which spreads the magnetic
field, nearly undiminished, to another coil in a different circuit, one without a power
source.
The difference with a CT is that the circuit with power has, effectively, one loop. The
powered circuit goes through the iron core only once. A CT is, therefore, a step-up
transformer.

CT & VT Formulae

2.
Solenoid Magnetic Field
Recall also that the current and number of turns in the coils in a VT can be related as: i1
--- N1 = i2 --- N2. This is because for a coil (solenoid), B = mu --- i --- n, where mu here
means the magnetic permeability constant. Little intensity of B is lost from one coil to the
other with a good iron core, so the B equations for the two coils are effectively equal,
giving

us

i1

---

N1

i2

---

N2.

However, N1 = 1 for the primary in the case of the current transformer. Is the single
power line effectively the equivalent of one loop? Does the last equation reduce to i1 = i2
--- N2? No, because it was based on solenoid equations. For N1 = 1, the following
formula is more appropriate: B = mu --- i/(2r), where r is the distance of the center of
the wire to the point where B is measured or sensed (the iron core, in the transformer
case).

So

i1/(2r)

i2

---

N2.

i1 is, therefore, merely proportional to the ammeter-measured value i2, reducing current
measurement to a simple conversion.

Common Uses

3.
Electric Meter (Courtesy: Oak Ridge Nat'l Lab)

The one central function of a CT is to determine the current in a circuit. This is especially
useful for monitoring high-voltage lines throughout the power grid. Another ubiquitous
use of CTs is in domestic electric meters. A CT is coupled with a meter to measure what
electrical usage to charge the customer.

Instrument Safety

4.
Current Transformer (Courtesy: tradeindia.com)
Another function of CTs is protection of sensitive measuring equipment. By increasing
the number of (secondary) windings, N2, the current in the CT can be made much smaller
than the current in the primary circuit being measured. In other words, as N2 in the
formula

i1/(2r)

i2

---

N2

goes

up,

i2

goes

down.

This is relevant because high current produces heat which can damage sensitive
measuring equipment, such as the resistor in an ammeter. Reducing i2 protects the
ammeter. It also prevents heat from throwing off the accuracy of the measurement.

Protective Relays

5.
CT Mounted Over Bushing of Circuit Recloser (Courtesy: emadrlc.blogspot.com)

CTs also protect the main lines of the power grid. An overcurrent relay is a type of
protective relay (switch) that trips a circuit breaker if a high-voltage current exceeds a
certain preset value. Overcurrent relays use a CT to measure the current, since the current
of a high-voltage line could not be measured directly.

(OR)
CURRENT TRANSFORMERS

Basics of Operation and In-Service Testing


1.

INTRODUCTION

Current transformers are used in electric metering for large load situations to reduce the
current level presented to the metering circuit in order to make it more manageable and
safe. This paper presents the basics of operation of current transformers and discusses the
in-service testing of current transformers to assure accurate performance.
2.

BASICS OF OPERATION

2.1

Ratio

A current transformer (henceforth called a CT) is designed to produce a secondary


current, Is, that is directly proportional to its primary current, Ip, which is also called the
load current. In metering this proportionality is called the ratio of the CT and is
represented by:
Ip
Ratio =

x 5
Is

2.2

Rated Ratio

The ratio of a CT is referenced to a 5 amp secondary output for nominal full value input
current such that a CT ratio of 200 to 5 means that the CT would produce a secondary
current of 5 amps when exposed to a primary current of 200 amps. The CT manufacturer
classifies its CTs by its ratio value called the rated ratio which is stamped on the
nameplate of the CT and that is the certified operating value of the CT.
2.3.

Accuracy Class

The CT accuracy is determined by its certified accuracy class which is also stamped on
its nameplate. For example, a CT accuracy class of 0.3 means that the CT is certified by
the manufacturer to be accurate to within 0.3 percent of its rated ratio value for a primary
current of 100 percent of rated ratio. For primary currents of 10 percent of rated ratio the
specified accuracy for a given classification is double that of the 100 percent value or 0.6
percent for the above-stated case. The accuracy is relatively linear between these two
points. Hence a CT with a rated ratio of 200 to 5 with accuracy class of 0.3 would operate
within 0.45 percent of its rated ratio value for a primary current of 100 amps. To be more
explicit, for a primary current of 100.00 amps it is certified to produce a secondary
current between 2.489 amps and 2.511 amps.
2.4.

Rating Factor

Some CTs are certified to be accurate for primary current values greater than 100 percent
of the rated ratio, called over-range. This over-range is designated by a rating factor
representing the factor by which the upper limit of the primary current can be increased
and still remain within certified accuracy. Hence a 200 to 5 rated ratio CT with a rating
factor of 2 will remain within its accuracy certification up to 400 amps (200 amps times
2). The rating factor of the CT is stamped on the nameplate of the CT. Typical rating
factors are 1, 1.5, 2, 3, and 4.
Voltage Transformers:

Instrument transformers are used for measurement and protective application, together
with equipment such as meters and relays. Their role in electrical systems is of primary
importance as they are a means of "stepping down" the current or voltage of a system to
measurable values, such as 5A or 1A in the case of a current transformers or 110V or
100V in the case of a voltage transformer. This offers the advantage that measurement
and protective equipment can be standardized on a few values of current and voltage.

Voltage transformers

Current transformers

Voltage transformers
Principle of operation
The standards define a voltage transformer as one in which "the secondary voltage is
substantially proportional to the primary voltage and differs in phase from it by an angle
which is approximately zero for an appropriate direction of the connections."
This, in essence, means that the voltage transformer has to be as close as possible to the
"ideal" transformer. In an "ideal" transformer, the secondary voltage vector is exactly
opposite and equal to the primary voltage vector, when multiplied by the turns ratio.
In a "practical" transformer, errors are introduced because some current is drawn for the
magnetization of the core and because of drops in the primary and secondary windings
due to leakage reactance and winding resistance. One can thus talk of a voltage error,
which is the amount by which the voltage is less than the applied primary voltage, and
the phase error, which is the phase angle by which the reversed secondary voltage vector
is displaced from the primary voltage vector.

ADC MODULE

THEORY:
ADC is short for Analog Digital Converter, Sometimes called a A-D or A to D
Converter. An ADC is a device that converts a continuous analog signal to a multi-level
digital signal without altering its content. The signals that are monitored are sounds,
movement, and temperature into binary code for the PC.
(or)
Analog to digital (A/D, ADC) converters are electrical circuit devices that convert
continuous signals, such as voltages or currents, from the analog domain to the digital
domain where the signals are represented by numbers
Most processing equipment today are digital in nature, and they work with signals
which are binary valued. In a digital or binary representation, a signal is represented by a
word, which is composed of a finite number of bits. The processing of signals is
preferably carried out in the digital domain because digital processing is fast, accurate
and reliable. Analog to digital converters are widely used for converting analog signals to
corresponding digital signals for many electronic circuits. Analog to digital converters
allow the use of sophisticated digital signal processing systems to process analog signals,
which are common in the real world. Many modern electronic systems require conversion
of signals from analog to digital or from digital to analog form. Circuits for performing
these functions are now required in numerous common consumer devices such as digital
cameras, cellular telephones, wireless data network equipment, audio devices such as
MP3 players, and video equipment such as digital video disk (DVD) players, high
definition digital television (HDTV), and numerous other products. Analog to digital
converters (ADC's) form an essential link in the signal processing pathway at the
interface between the analog and digital domains. Advances in ADC technology have
increased the speed, lowered the cost, and reduced the power requirements of analog to
digital converters, and resulted in a proliferation of ADC applications.
Conversion involves quantizing and encoding. Quantizing means partitioning the
analog signal range into a number of discrete quanta and determining to which quantum
the input signal belongs. Encoding means assigning a unique digital code to each

quantum and determining the code that corresponds to the input signal. The most
common system is binary, in which there are 2n quanta (where n is some whole number),
numbered consecutively; the code is a set of n physical two-valued levels or bits (1 or 0)
corresponding to the binary number associated with the signal quantum.
The illustration shows a typical three-bit binary representation of a range of input signals,
partitioned into eight quanta. For example, a signal in the vicinity of 3/8; full scale
(between 5/16 and 7/16) will be coded 011 (binary 3).

A three-bit binary representation of a range of input signals.

There are four commonly used ADCs:

Parallel converter

Successive approximation ADC

Voltage-to-Frequency ADC

Integrating ADC

Applications of ADC:

Digital camera or scanner uses A/D converters to transform the variable charges in
CCD and CMOS chips into the binary data that represent pixels.

Cell phone and digital desk phone has an ADC converter that converts the pressure of
sound waves into PCM code Etc.

ADC0808:
This is 8-Bit P Compatible A/D Converters with 8-Channel Multiplexer. The
ADC0808 data acquisition component is a monolithic CMOS device with an 8-bit
analog-to-digital converter,8-channel multiplexer and microprocessor compatible Control

logic. The 8-bit A/D converter uses successive approximation as the conversion
technique. The converter features a high impedance chopper stabilized comparator, a
256R voltage divider with analog switch tree and a successive approximation register.
The 8-channel multiplexer can directly access any of 8-single-ended analog signals. The
device eliminates the need for external zero and full-scale adjustments. Easy interfacing
to microprocessors is provided by the latched and decoded multiplexer address inputs and
latched TTL TRI-STATE outputs.
Features

Easy interface to all microprocessors

Operates ratio metrically or with 5 VDC or analog span adjusted voltage reference

No zero or full-scale adjust required

8-channel multiplexer with address logic

0V to 5V input range with single 5V power supply

Outputs meet TTL voltage level specifications

ADC0808 equivalent to MM74C949

ADC0809 equivalent to MM74C949-1

Key Specifications

Resolution 8 Bits

Total Unadjusted Error 12 LSB and 1 LSB

Single Supply 5 VDC

Low Power 15 mW

Conversion Time

FUNCTIONAL DESCRIPTION:
The ADC0808 shown in figure can be functionally divided into 2 basic sub
circuits. These two sub circuits are an analog multiplexer and an A/D converter. The
multiplexer uses 8 standard CMOS analog switches to provide to up to 8 analog inputs.

The switches are selectively turned on, depending on the data latched into a 3-bit
multiplexer address register.
The second functional block, the successive approximation A/D converter,
transforms the analog output of the multiplexer to an 8-bit digital word. The output of the
multiplexer goes to one of two comparator inputs. The other input is derived from a 256R
resistor ladder, which is tapped by a MOSFET transistor switch tree. The converter
control logic controls the switch tree, funneling a particular tap voltage to comparator.
Based on the result of this comparison, the control logic and the successive
approximation register (SAR) will decide whether the next tap to be selected should be
higher or lower than the present tap on the resistor ladder. This algorithm is executed 8
times per conversion, once every 8-clock period, yielding a total conversion time of clock
periods.
When the conversion cycle is complete the resulting data is loaded into the TRISTATE output latch. The data in the output latch can be then be read by the host system
any time before the end of the next conversion. The TRI-STATE capability of the latch
allows easy interfaces to bus oriented systems.
The operation on these converters by a microprocessor or some control logic is
very simple. The controlling device first selects the desired input channel. To do this, a 3bit channel address is placed on the A, B, C in and out pins; and the ALE input is pulsed
positively, clocking the address into the multiplexer address register. To begin the
conversion, the START pin is pulsed. On the rising edge of this pulse the internal
registers are cleared and on the falling edge the start conversion is initiated.
As mentioned earlier, there are 8 clock periods per approximation. Even though
there is no conversion in progress the ADC0808 is still internally cycling through these 8
clock periods. A start pulse can occur any time during this cycle but the conversion will
not actually begin until the converter internally cycles to the beginning of the next 8
clock period sequence. As long as the start pin is held high no conversion begins, but
when the start pin is taken low the conversion will start within 8 clock periods. The EOC
output is triggered on the rising edge of the start pulse. It, too, is controlled by the 8 clock
period cycle, so it will go low within 8 clock periods of the rising edge of the start pulse.

One can see that it is entirely possible for EOC to go low before the conversion starts
internally, but this is not important, since the positive transition of EOC, which occurs at
the end of a conversion, is what the control logic is looking for.
Once EOC does go high this signals the interface logic that the data resulting from
the conversion is ready to be read. The output enable (OE) is then raised high. This
enables the TRI-STATE outputs, allowing the data to be read. Figure shows the timing
diagram.

Fig : - Functional block diagram of ADC


PIN DIAGRAM:

CONNECTION DIAGRAM:

SC (Chip Selection): By using this selection Bit you can select the Chip. After selecting
this bit the chip is ready to do operation. By using HIGH(1) you can select the this pin as
a active high.
ALE (Address Latch Enable):
ALE is to enable address latch of ADC, so that the selected channel is activated.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency, and
can be used for external timing or clocking. Note that one ALE pulse is skipped during
each access to external data memory. This pin is also the Program Pulse input (PROG)
during Flash programming.

EOC (End of Conversion): After End of ADC Conversion EOC bit is set to high.
CHANNEL SELECTION:

FLOW CHART:

Set callCSF

INDUCTION MOTOR:
AC induction motors are the most common motors used in industrial motion
control systems, as well as in main powered home appliances. Simple and rugged design,
low-cost, low maintenance and direct connection to an AC power source are the main
advantages of AC induction motors. Various types of AC induction motors are available
in the market. Different motors are suitable for different applications. Although AC
induction motors are easier to design than DC motors, the speed and the torque control in
various types of AC induction motors require a greater understanding of the design and
the characteristics of these motors. This application note discusses the basics of an AC
induction motor; the different types, their characteristics, the selection criteria for
different applications and
BASIC CONSTRUCTION AND OPERATING PRINCIPLE
Like most motors, an AC induction motor has a fixed outer
portion, called the stator and a rotor that spins inside with a carefully engineered air gap
between the two. Virtually all electrical motors use magnetic field rotation to spin their
rotors.
A three-phase AC induction motor is the only type where the rotating
magnetic field is created naturally in the stator because of the nature of the supply. DC
motors depend either on mechanical or electronic commutation to create rotating
magnetic fields.
A single-phase AC induction motor depends on extra electrical
components to produce this rotating magnetic field. Two sets of electromagnets are
formed inside any motor. In an AC induction motor, one set of electromagnets is formed
in the stator because of the AC supply connected to the stator windings. The alternating
nature of the supply voltage induces an Electromagnetic Force (EMF) in the rotor (just
like the voltage is induced in the transformer secondary) as per Lenzs law, thus
generating another set of electromagnets; hence the name induction motor. Interaction
between the magnetic field of these electromagnets generates twisting force, or torque. As
a result, the motor rotates in the direction of the resultant torque.

Stator
The stator is made up of several thin laminations of aluminum or cast iron.
They are punched and clamped together to form a hollow cylinder (stator core) with slots
as shown in Figure 1. Coils of insulated wires are inserted into these slots. Each grouping
of coils, together with the core it surrounds, forms an electromagnet (a pair of poles) on
the application of AC supply. The number of poles of an AC induction motor depends on
the internal connection of the stator windings. The stator windings are connected directly
to the power source. Internally they are connected in such a way, that on applying AC
supply, a rotating magnetic field is created.
Rotor

The rotor is made up of several thin steel laminations with evenly spaced bars,
which are made up of aluminum or copper, along the periphery. In the most popular type
of rotor (squirrel cage rotor), these bars are connected at ends mechanically and
electrically by the use of rings. Almost 90% of induction motors have squirrel cage
rotors. This is because the squirrel cage rotor has a simple and rugged construction. The
rotor consists of a cylindrical laminated core with axially placed parallel slots for
carrying the conductors. Each slot carries a copper, aluminum, or alloy bar. These rotor
bars are permanently short-circuited at both ends by means of the end rings, as shown in
Figure 2. This total assembly resembles the look of a squirrel cage, which gives the rotor
its name. The rotor slots are not exactly parallel to the shaft. Instead, they are given a
skew for two main reasons. The first reason is to make the motor run quietly by reducing
magnetic hum and to decrease slot harmonics. The second reason is to help reduce the
locking tendency of the rotor. The rotor teeth tend to remain locked under the stator teeth
due to direct magnetic attraction between the two. This happens when the number of
stator teeth is equal to the number of rotor teeth. The rotor is mounted on the shaft using
bearings on each end; one end of the shaft is normally kept longer than the other for
driving the load. Some motors may have an accessory shaft on the non-driving end for
mounting speed or position sensing devices. Between the stator and the rotor, there exists
an air gap, through which due to induction, the energy is transferred from the stator to the

rotor. The generated torque forces the rotor and then the load to rotate. Regardless of the
type of rotor used, the principle employed for rotation
Speed of an Induction Motor

The magnetic field created in the stator rotates at a synchronous speed (NS).

The magnetic field produced in the rotor because of the induced voltage
is alternating in nature. To reduce the relative speed, with respect to the stator, the rotor
starts running in the same direction as that of the stator flux and tries to catch up with the
rotating flux. However, in practice, the rotor never succeeds in catching up to the stator
field. The rotor runs slower than the speed of the stator field. This speed is called the
Base Speed (Nb). The difference between NS and Nb is called the slip. The slip varies
with the load. An increase in load will cause the rotor to slow down or increase slip. A
decrease in load will cause the rotor to speed up or decrease slip. The slip is expressed as
a percentage and can be determined with the following formula:
Single-Phase Induction Motor

There are probably more single-phase AC induction motors in use


today than the total of all the other types put together. It is logical that the least expensive,
lowest maintenance type motor should be used most often. The single-phase AC
induction motor best fits this description. As the name suggests, this type of motor has
only one stator winding (main winding) and operates with a single-phase power supply.
In all single-phase induction motors, the rotor is the squirrel cage type. The single-phase
induction motor is not self-starting. When the motor is connected to a single-phase power
supply, the main winding carries an alternating current. This current produces a pulsating

magnetic field. Due to induction, the rotor is energized. As the main magnetic field is
pulsating, the torque necessary for the motor rotation is not generated. This will cause the
rotor to vibrate, but not to rotate. Hence, the single phase induction motor is required to
have a starting mechanism that can provide the starting kick for the motor to rotate. The
starting mechanism of the single-phase induction motor is mainly an additional stator
winding (start/ auxiliary winding) as shown in Figure 3. The start winding can have a
series capacitor and/or a centrifugal switch. When the supply voltage is applied, current
in the main winding lags the supply voltage due to the main winding impedance. At the
same time, current in the start winding leads/lags the supply voltage depending on the
starting mechanism impedance. Interaction between magnetic fields generated by the
main winding and the starting mechanism generates a resultant magnetic field rotating in
one direction. The motor starts rotating in the direction of the resultant magnetic field.
Once the motor reaches about 75% of its rated speed, a centrifugal switch disconnects the
start winding. From this point on, the single-phase motor can maintain sufficient torque
to operate on its own. Except for special capacitor start/capacitor run types, all singlephase motors are generally used for applications up to 3/4 hp only. Depending on the
various start techniques, single phase AC induction motors are further classified as
described in the following sections.

(OR)
An induction motor or asynchronous motor is a type of alternating current motor
where power is supplied to the rotor by means of electromagnetic induction.
An electric motor turns because of magnetic force exerted between a stationary
electromagnet called the stator and a rotating electromagnet called the rotor. Different
types of electric motors are distinguished by how electric current is supplied to the
moving rotor. In a DC motor and a slip-ring AC motor, current is provided to the rotor
directly through sliding electrical contacts called commutators and slip rings. In an
induction motor, by contrast, the current is induced in the rotor without contacts by the
magnetic field of the stator, through electromagnetic induction. An induction motor is
sometimes called a rotating transformer because the stator (stationary part) is essentially
the primary side of the transformer and the rotor (rotating part) is the secondary side.

Unlike the normal transformer which changes the current by using time varying flux,
induction motors use rotating magnetic fields to transform the voltage. The current in the
primary side creates an electromagnetic field which interacts with the electromagnetic
field of the secondary side to produce a resultant torque, thereby transforming the
electrical energy into mechanical energy. Induction motors are widely used, especially
polyphase induction motors, which are frequently used in industrial drives.
Induction motors are now the preferred choice for industrial motors due to their rugged
construction, absence of brushes (which are required in most DC motors) andthanks to
modern power electronicsthe ability to control the speed of the motor.

Induction motors

Principle of operation and comparison to synchronous motors

A 3-phase power supply provides a rotating magnetic field in an induction motor.


The basic difference between an induction motor and a synchronous AC motor with a
permanent magnet rotor is that in the latter the rotating magnetic field of the stator will
impose an electromagnetic torque on the magnetic field of the rotor causing it to move
(about a shaft) and a steady rotation of the rotor is produced. It is called synchronous
because at steady state the speed of the rotor is the same as the speed of the rotating
magnetic field in the stator.
By way of contrast, the induction motor does not have any permanent magnets on
the rotor; instead, a current is induced in the rotor. To achieve this, stator windings are
arranged around the rotor so that when energized with a polyphase supply they create a
rotating magnetic field pattern which sweeps past the rotor. This changing magnetic field
pattern induces current in the rotor conductors. This current interacts with the rotating
magnetic field created by the stator and in effect causes a rotational motion on the rotor.
However, for these currents to be induced the speed of the physical rotor must be
less than the speed of the rotating magnetic field in the stator (the synchronous frequency
ns) or else the magnetic field will not be moving relative to the rotor conductors and no
currents will be induced. If by some chance this happens, the rotor typically slows
slightly until a current is re-induced and then the rotor continues as before. This
difference between the speed of the rotor and speed of the rotating magnetic field in the
stator is called slip. It is unit less and is the ratio between the relative speed of the

magnetic field as seen by the rotor (the slip speed) to the speed of the rotating stator field.
Due to this, an induction motor is sometimes referred to as an asynchronous machine.

Synchronous speed
Understanding the behavior of induction motors, it's useful to understand the differences
from a synchronous motor. That type of motor always runs at a synchronous speed- a
shaft rotation frequency that is an integer fraction of the supply frequency. The
synchronous speed of an induction motor is the same fraction of the supply.
It can be shown that the synchronous speed of a motor is determined by the following
formula:

ns

120 * f
P

Where ns is the (synchronous) speed of the rotor (in rpm), f is the frequency of
the AC supply (in Hz) and p is the number of magnetic poles per phase.
For example, a 6 pole motor operating on 60 Hz power would have a speed of:

ns=120*60
=

1200rpm

6
Note on the use of p - some texts refer to number of pole pairs per phase instead of
number of poles per phase. For example a 6 pole motor, operating on 60 Hz power, would
have 3 pole pairs. The equation of synchronous speed then becomes:

ns

60 * f
P

With P being the number of pole pairs per phase.


Slip

Typical

torque

curve as a function of
slip

The slip is a ratio


relative to the synchronous speed and is calculated using:
S

(ns - nr )
ns

Where
s is the slip, usually between 0 and 1
nr = rotor rotation speed (rpm)
ns = synchronous rotation speed (rpm)

Construction

Typical winding pattern for a 3 phase, 4 pole motor- (here phases are labeled W, U, V).
Note the interleaving of the pole windings and the resultant quadrupole field.
The stator consists of wound 'poles' that carry the supply current to induce a magnetic
field that penetrates the rotor. In a very simple motor, there would be a single projecting
piece of the stator (a salient pole) for each pole, with windings around it; in fact, to
optimize the distribution of the magnetic field, the windings are distributed in many slots
located around the stator, but the magnetic field still has the same number of north-south
alternations. The number of 'poles' can vary between motor types but the poles are always
in pairs (i.e. 2, 4, 6, etc.).
Induction motors are most commonly built to run on single-phase or three-phase power,
but two-phase motors also exist. In theory, two-phase and more than three phase
induction motors are possible; many single-phase motors having two windings and
requiring a capacitor can actually be viewed as two-phase motors, since the capacitor
generates a second power phase 90 degrees from the single-phase supply and feeds it to a
separate motor winding. Single-phase power is more widely available in residential
buildings, but cannot produce a rotating field in the motor (the field merely oscillates
back and forth), so single-phase induction motors must incorporate some kind of starting
mechanism to produce a rotating field. They would, using the simplified analogy of
salient poles, have one salient pole per pole number; a four-pole motor would have four
salient poles. Three-phase motors have three salient poles per pole number, so a four-pole
motor would have twelve salient poles. This allows the motor to produce a rotating field,
allowing the motor to start with no extra equipment and run more efficiently than a
similar single-phase motor.
There are three types of rotor:

Squirrel-cage rotor

The most common rotor is a squirrel-cage rotor. It is made up of bars of either solid
copper (most common) or aluminum that span the length of the rotor, and those solid
copper or aluminum strips can be shorted or connected by a ring or some times not, i.e.

the rotor can be closed or semi closed type. The rotor bars in squirrel-cage induction
motors are not straight, but have some skew to reduce noise and harmonics.

Slip ring rotor

A slip ring rotor replaces the bars of the squirrel-cage rotor with windings that are
connected to slip rings. When these slip rings are shorted, the rotor behaves similarly to a
squirrel-cage rotor; they can also be connected to resistors to produce a high-resistance
rotor circuit, which can be beneficial in starting

Solid core rotor

A rotor can be made from solid mild steel. The induced current causes the rotation.

Speed control

Typical torque curves for different line frequencies


The synchronous rotational speed of the rotor (i.e. the theoretical unloaded speed with no
slip) is controlled by the number of pole pairs (number of windings in the stator) and by
the frequency of the supply voltage.
However, for a loaded rotor, for any given drive frequency and current and mechanical
load, synchronous motors should be run in the 'operating zone' for that particular
induction motor. This is the shaft rotation speed range above the peak torque. In this zone
slightly increasing the slip speed increases the torque, and decreasing the slip decreases

the torque. Hence in this zone the motor will tend to run at constant speed. Below the
operating zone, the run speed tends to be unstable and may stall out or run at reduced
shaft speed, depending on the nature of the mechanical load.
Before the development of economical semiconductor power electronics, it was difficult
to vary the frequency to the motor and induction motors were mainly used in fixed speed
applications. As an induction motor has no brushes and is easy to control, many older DC
motors are now being replaced with THR induction motors and accompanying inverters
in industrial applications

Starting of induction motors


Single Phase
In a single phase induction motor, it is necessary to provide a starting circuit to start
rotation of the rotor. If this is not done, rotation may be commenced by manually giving a
slight turn to the rotor. The single phase induction motor may rotate in either direction
and it is only the starting circuit which determines rotational direction.
For small motors of a few watts, the start rotation is done by means of one or two single
turn(s) of heavy copper wire around one corner of the pole. The current induced in the
single turn is out of phase with the supply current and so causes an out-of-phase
component in the magnetic field, which imparts to the field sufficient rotational character
to start the motor. Starting torque is very low and efficiency is also reduced. Such shadedpole motors are typically used in low-power applications with low or zero starting torque
requirements, such as desk fans and record players.
Larger motors are provided with a second stator winding which is fed with an out-ofphase current to create a rotating magnetic field. The out-of-phase current may be derived

by feeding the winding through a capacitor or it may derive from the winding having
different values of inductance and resistance from the main winding.
In some designs, the second winding is disconnected once the motor is up to speed,
usually either by means of a switch operated by centrifugal force acting on weights on the
motor shaft or by a positive temperature coefficient thermistor which, after a few seconds
of operation, heats up and increases its resistance to a high value thereby reducing the
current through the second winding to an insignificant level. Other designs keep the
second winding continuously energized when running, which improves torque.

LIQUID CRYSTAL DISPLAY

A liquid crystal is a material (normally organic for LCDs) that will flow like a
liquid but whose molecular structure has some properties normally associated with solids.
The Liquid Crystal Display (LCD) is a low power device. The power requirement is
typically in the order of microwatts for the LCD. However, an LCD requires an external
or internal light source. It is limited to a temperature range of about 0C to 60C and
lifetime is an area of concern, because LCDs can chemically degrade.
There are two major types of LCDs which are:
1. Dynamic-scattering LCDs and
2. Field-effect LCDs
Field-effect LCDs are normally used in such applications where sourse of energy
is a prime factor(e.g., watches, portable instrumentation etc.).They absorb considerably
less power than the light-scattering type. However, the cost for field-effect units is
typically higher, and their hoight is limited to 2 inches. On the other hand, light-scattering

units are available up to 8 inches in height. Field-effect LCD is used in the project for
displaying the appropriate information.
The turn-on and turn-off time is an important consideration in all displays. The
response time of LCDs is in the range of 100 to 300ms.The lifetime of LCDs is steadily
increasing beyond 10,000+hours limit. Since the colour generated by LCD units is
dependent on the source of illumination, there is a wide range of colour choice.

LIQUID CRYSTAL DISPLAY:


The alphanumeric 16 character

X 2line LCD requires 8data lines and also 3 control

signals and they are interfaced to 3664.By using 2 ports, port 0&3 data pins are
connected to LCD as data bus. Port0 can be basically used as I/O port i.e. it can be
programmed as an input or as an output port.
That means if it is programmed as output port, suppose if it is required to read data
from LCD immediately it is not possible. Before reading the data it is required to make
the port as an input port. Data reading from LCD gives an erroneous reading & should
not be implemented. Because of this port5 is made as input / output port depending on the
situation. The control signals are connected to port 3 pins. They are EN bar & RS bar,
RW bar. At different instance such as data write / command write / data read etc. Various
signals are to be provided as indicated by the by the LCD manufacturers.
To interface the LCD, to the Micro controller it require an 8 bit and also three control
signals differentiate the data from the control words send to the LCD. The Micro
controller has to send the necessary control words followed by the data to be displayed.
Depending on the operation to be performed the control words are selected and
passes to the LCD. The data to be displayed on the LCD is to be sent in the

ASCII

format. Thus all the character to be displayed are converted into ASCII form and then
sent to the LCD along with different control words. The control words differentiated the
various operations and are executed. It is ao possible to read the LCD data if required.
The control signals to the LCD are also provided by the Micro controller. This is
also done through pins 3.5,3.6&3.7.Through program necessary control signals are
passed to the LCD by using the bits of the port. The remaining can be used for some other

purpose if there is a need. The software controls the necessary ports and performs the task
it is designed for. The software and associated hardware perform the LCD interface.

LCD MODULE
Gnd

vcc preset rs

rw en

d0

d1

d2

d3 d4 d5 d6 d7 vcc gnd

A liquid crystal is a material (normally organic for LCDs) that will flow like a
liquid but whose molecular structure has some properties normally associated with solids.
The Liquid Crystal Display (LCD) is a low power device. The power requirement is
typically in the order of microwatts for the LCD. However, an LCD requires an external
or internal light source. It is limited to a temperature range of about 0C to 60C and
lifetime is an area of concern, because LCDs can chemically degrade.

There are two major types of LCDs which are:


1) Dynamic-scattering LCD s
2) Field-effect LCD s
Field-effect LCD is normally used in such applications where source of energy is a prime
factor (e.g., watches, portable instrumentation etc.).They absorb considerably less power
than the light-scattering type. However, the cost for field-effect units is typically higher,
and their height is limited to 2 inches. On the other hand, light-scattering units are
available up to 8 inches in height. Field-effect LCD is used in the project for displaying
the appropriate information. The turn-on and turn-off time is an important consideration

in all displays. The response time of LCD s is in the range of 100 to 300ms.The lifetime
of LCD s is steadily increasing beyond 10,000+hours limit. Since the colour generated by
LCD units is dependent on the source of illumination, there is a wide range of colour
choice.

HARDWARE DIAGRAM:

RS (Command / Data):
This bit is to specify weather received byte is command or data. So that LCD can
recognize the operation to be performed based on the bit status.
RS

= 0

=>

Command

RS

= 1

=>

Data

RW (Read / Write):-

RW bit is to specify weather controller wants READ from LCD or WRITE to


LCD. The READ operation here is just ACK bit to know weather LCD is free or not.
RW = 0

=>

Write

RW = 1

=>

Read

EN (Enable LCD):EN bit is to ENABLE or DISABLE the LCD. When ever controller wants to write
some thing into LCD or READ acknowledgment from LCD it needs to enable the LCD.
EN

= 0

=>

High Impedance

EN

= 1

=>

Low Impedance

ACK (LCD Ready):ACK bit is to acknowledge the MCU that LCD is free so that it can send new
command or data to be stored in its internal Ram locations
ACK

= 1

=>

Not ACK

ACK = 0

=>

ACK

FLOWCHART:

Relays:
A relay is an electrically operated switch. Current flowing through the coil of the relay
creates a magnetic field which attracts a lever and changes the switch contacts. The coil
current can be on or off so relays have two switch positions and they are double throw
(changeover) switches.

Relays allow one circuit to switch a second circuit which can be completely
separate from the first. For example a low voltage battery circuit can use a relay to switch
a 230V AC mains circuit. There is no electrical connection inside the relay between the
two circuits, the link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V
relay, but it can be as much as 100mA for relays designed to operate from lower voltages.
Most ICs (chips) cannot provide this current and a transistor is usually used to amplify
the small IC current to the larger value required for the relay coil. The maximum output
current for the popular 555 timer IC is 200mA so these devices can supply relay coils
directly without amplification.
Relays are usuallly SPDT or DPDT but they can have many more sets of switch
contacts, for example relays with 4 sets of changeover contacts are readily available. For
further information about switch contacts and the terms used to describe them please see
the page on switches.
Most relays are designed for PCB mounting but you can solder wires directly to
the pins providing you take care to avoid melting the plastic case of the relay. The
supplier's catalogue should show you the relay's connections. The coil will be obvious
and it may be connected either way round. Relay coils produce brief high voltage 'spikes'
when they are switched off and this can destroy transistors and ICs in the circuit. To
prevent damage you must connect a protection diode across the relay coil.
The animated picture shows a working relay with its coil and switch contacts. You
can see a lever on the left being attracted by magnetism when the coil is switched on.
This lever moves the switch contacts. There is one set of contacts (SPDT) in the
foreground and another behind them, making the relay DPDT.

The relay's switch connections are usually labelled COM, NC and NO:

COM = Common, always connect to this, it is the moving part of the switch.

NC = Normally Closed, COM is connected to this when the relay coil is off.

NO = Normally Open, COM is connected to this when the relay coil is on.

Connect to COM and NO if you want the switched circuit to be on when the
relay coil is on.

Connect to COM and NC if you want the switched circuit to be on when the
relay coil is off.

Choosing a relay
You need to consider several features when choosing a relay:
1. Physical size and pin arrangement
If you are choosing a relay for an existing PCB you will need to ensure that its
dimensions and pin arrangement are suitable. You should find this information in
the supplier's catalogue.
2. Coil voltage
The relay's coil voltage rating and resistance must suit the circuit powering the
relay coil. Many relays have a coil rated for a 12V supply but 5V and 24V relays

are also readily available. Some relays operate perfectly well with a supply
voltage which is a little lower than their rated value.
3. Coil resistance
The circuit must be able to supply the current required by the relay coil. You can
use Ohm's law to calculate the current:
supply voltage
coil resistance
4. For example: A 12V supply relay with a coil resistance of 400
Relay coil current =

passes a current

of 30mA. This is OK for a 555 timer IC (maximum output current 200mA), but it
is too much for most ICs and they will require a transistor to amplify the current.

5. Switch ratings (voltage and current)


The relay's switch contacts must be suitable for the circuit they are to control. You
will need to check the voltage and current ratings. Note that the voltage rating is
usually higher for AC, for example: "5A at 24V DC or 125V AC".
6. Switch contact arrangement (SPDT, DPDT etc)
Most relays are SPDT or DPDT which are often described as "single pole
changeover" (SPCO) or "double pole changeover" (DPCO). For further
information please see the page on switches.

Protection diodes for relays


Transistors and ICs (chips) must be protected from the brief high voltage 'spike' produced
when the relay coil is switched off. The diagram shows how a signal diode (eg 1N4148)
is connected across the relay coil to provide this protection. Note that the diode is
connected 'backwards' so that it will normally not conduct. Conduction only occurs when
the relay coil is switched off, at this moment current tries to continue flowing through the
coil and it is harmlessly diverted through the diode. Without the diode no current could
flow and the coil would produce a damaging high voltage 'spike' in its attempt to keep the
current

flowing.

Reed relays
Reed relays consist of a coil surrounding a reed switch. Reed switches are normally
operated with a magnet, but in a reed relay current flows through the coil to create a
magnetic field and close the reed switch.

Reed relays generally have higher coil resistances than standard relays (1000

for

example) and a wide range of supply voltages (9-20V for example). They are capable of
switching much more rapidly than standard relays, up to several hundred times per
second; but they can only switch low currents (500mA maximum for example).

Relays and transistors compared


Like relays, transistors can be used as an electrically operated switch. For
switching small DC currents (< 1A) at low voltage they are usually a better choice than a
relay. However transistors cannot switch AC or high voltages (such as mains electricity)
and they are not usually a good choice for switching large currents (> 5A). In these cases
a relay will be needed, but note that a low power transistor may still be needed to switch
the current for the relay's coil! The main advantages and disadvantages of relays are listed
below:
Advantages of relays:

Relays can switch AC and DC, transistors can only switch DC.

Relays can switch high voltages, transistors cannot.

Relays are a better choice for switching large currents (> 5A).

Relays can switch many contacts at once.

Disadvantages of relays:
Relays are bulkier than transistors for switching small currents.

Relays cannot switch rapidly (except reed relays), transistors can switch many
times per second.

Relays use more power due to the current flowing through their coil.

Relays require more current than many chips can provide, so a low power
transistor may be needed to switch the current for the relay's coil.

SOFTWARE
Vision3
Vision3 is an IDE (Integrated Development Environment) that helps you write, compile,
and debug embedded programs. It encapsulates the following components:

A project manager.

A make facility.

Tool configuration.

Editor.

A powerful debugger.

To help you get started, several example programs (located in the \C51\Examples,
\C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided.
HELLO is a simple program that prints the string "Hello World" using the Serial
Interface.
Building an Application in Vision2
To build (compile, assemble, and link) an application in Vision2, you must:
1. Select Project - (for example, 166\EXAMPLES\HELLO\HELLO.UV2).
2. Select Project - Rebuild all target files or Build target.
Vision2 compiles, assembles, and links the files in your project.

Creating Your Own Application in Vision2


To create a new project in Vision2, you must:
1. Select Project - New Project.
2. Select a directory and enter the name of the project file.
3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from
the Device Database.

4. Create source files to add to the project.


5. Select Project - Targets, Groups, Files, Add/Files, select Source Group1, and add
the source files to the project.
6. Select Project - Options and set the tool options. Note when you select the target
device from the Device Database all special options are set automatically. You
typically only need to configure the memory map of your target hardware. Default
memory model settings are optimal for most applications.
7. Select Project - Rebuild all target files or Build target.
Debugging an Application in Vision2
To debug an application created using Vision2, you must:
1. Select Debug - Start/Stop Debug Session.
2. Use the Step toolbar buttons to single-step through your program. You may enter
G, main in the Output Window to execute to the main C function.
3. Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.
Starting Vision2 and creating a Project
Vision2 is a standard Windows application and started by clicking on the program icon.
To create a new project file select from the Vision2 menu
Project New Project. This opens a standard Windows dialog that asks you for the
new project file name.
We suggest that you use a separate folder for each project. You can simply use the icon
Create New Folder in this dialog to get a new empty folder. Then select this folder and
enter the file name for the new project, i.e. Project1.
Vision2 creates a new project file with the name PROJECT1.UV2 which contains a
default target and file group name. You can see these names in the Project
Window Files.
Now use from the menu Project Select Device for Target and select a CPU for your
project. The Select Device dialog box shows the Vision2 device database. Just select the
microcontroller you use. We are using for our examples the Philips 80C51RD+ CPU.
This selection sets necessary tool options for the 80C51RD+ device and simplifies in this
way the tool Configuration

Building Projects and Creating a HEX Files


Typical, the tool settings under Options Target are all you need to start a new
application. You may translate all source files and line the application with a click on the
Build Target toolbar icon. When you build an application with syntax errors, Vision2
will display errors and warning messages in the Output
Window Build page. A double click on a message line opens the source file on the
correct location in a Vision2 editor window.
Once you have successfully generated your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to
download the software into an EPROM programmer or simulator. Vision2 creates HEX
files with each build process when Create HEX files under Options for Target Output is
enabled. You may start your PROM programming utility after the make process when
you specify the program under the option Run User Program #1.

CPU Simulation
Vision2 simulates up to 16 Mbytes of memory from which areas can be mapped for
read, write, or code execution access. The Vision2 simulator traps and reports illegal
memory accesses being done.
In addition to memory mapping, the simulator also provides support for the integrated
peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU you have
selected are configured from the Device
Database selection
You have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral
using the controls in the dialog boxes.
Start Debugging

You start the debug mode of Vision2 with the Debug Start/Stop Debug Session
command. Depending on the Options for Target Debug Configuration, Vision2 will
load the application program and run the startup code Vision2 saves the editor screen
layout and restores the screen layout of the last debug session. If the program execution
stops, Vision2 opens an editor window with the source text or shows CPU instructions
in the disassembly window. The next executable statement is marked with a yellow
arrow. During debugging, most editor features are still available.
For example, you can use the find command or correct program errors. Program source
text of your application is shown in the same windows. The Vision2 debug mode differs
from the edit mode in the following aspects:
_ The Debug Menu and Debug Commands described on page 28 are Available. The
additional debug windows are discussed in the following.
_ The project structure or tool parameters cannot be modified. All build Commands are
disabled.
Disassembly Window
The Disassembly window shows your target program as mixed source and assembly
program or just assembly code. A trace history of previously executed instructions may
be displayed with Debug View Trace Records. To enable the trace history, set Debug
Enable/Disable Trace Recording.
If you select the Disassembly Window as the active window all program step commands
work on CPU instruction level rather than program source lines. You can select a text line
and set or modify code breakpoints using toolbar buttons or the context menu commands.
You may use the dialog Debug Inline Assembly to modify the CPU
instructions. That allows you to correct mistakes or to make temporary changes to the
target program you are debugging.
SOURCE CODE

1.

Click on the Keil uVision Icon on Desktop

2.

The following fig will appear

3.

Click on the Project menu from the title bar

4.

Then Click on New Project

5.

Save the Project by typing suitable project name with no extension in u r own
folder sited in either C:\ or D:\

6.

Then Click on save button above.

7.

Select the component for u r project. i.e. Atmel

8.

Click on the + Symbol beside of Atmel

9.

Select AT89C51 as shown below

10.

Then Click on OK

11.

The Following fig will appear

12.

Then Click either YES or NOmostly NO

13.

Now your project is ready to USE

14.

Now double click on the Target1, you would get another option Source group
1 as shown in next page.

15.

Click on the file option from menu bar and select new

16.

The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.

17.

Now start writing program in either in C or ASM

18.

For a program written in Assembly, then save it with extension . asm and
for C based program save it with extension .C

19.

Now right click on Source group 1 and click on Add files to Group Source

20.

Now you will get another window, on which by default C files will appear.

21.

Now select as per your file extension given while saving the file

22.

Click only one time on option ADD

23.

Now Press function key F7 to compile. Any error will appear if so happen.

24.

If the file contains no error, then press Control+F5 simultaneously.

25.

The new window is as follows

26.

Then Click OK

27.

Now Click on the Peripherals from menu bar, and check your required port as
shown in fig below

28.

Drag the port a side and click in the program file.

29.

Now keep Pressing function key F11 slowly and observe.

30.

You are running your program successfully

ADVANTAGES:
Using these technologies in everyday life is a current challenge to a number of
development teams all over the world. One of the applications for WSN (wireless
sensor network) is industrial equipment operation monitoring, allowing, to some
degree, replacing expensive wired communication systems.
If one considers that, in industrial applications, three-phase squirrel-cage
induction motors, hereafter denominated only by motors, account, in numbers, for
more than 90% of the installed electric motors, it is fair to say that a wireless
sensor network can be successfully used to monitor and evaluate their actual
operation conditions.
In the European Union, the average load factor for motors, in both industrial and
tertiary sectors, is 0.57. However, the average load factor per power range in some
sectors can be as low as 0.25. Individual motors in those ranges have even lower
load factors. Because the load factor is an average of the motor load during a
defined period, the motor load can vary between values lower and higher than the
load factor.
Motor over sizing is mainly due to the poor motor system design or due to the
gross overestimation of the mechanical power required by the load. Additionally,
motor over sizing is a widespread practice due to the motor market structure,
which is largely dominated by original equipment manufacturers (OEMs).
Motors with a wide load variation (e.g., between very low load and near full load)
during their duty cycle can also be found. In these cases, the motor is sized to
provide the load peak power, but it can operate during long periods with a very
low load. These situations lead to a reduction of both motor efficiency and power
factor. For specific conditions, the stator winding connection change from delta
(D) to star (Y) can significantly improve both motor efficiency and power factor.
This possibility is only available for motors designed to operate at the nominal
power with D connection and with access to the six winding terminals, which are
the vast majority.
The previous informations evidence the importance of the permanent motor
operation monitoring to provide in a central database, a track record of key

information on the motor power supply load profile and general health condition,
which are essential for the implementation of an effective motor management
strategies, including motor replacing and repair/ rewinding, which depend on the
identification of power supply problems, over-sized motor, variable load-motors,
etc.
DISADVANTAGES:
Expensive speed control
Speed control is expensive. The electronics required to handle an AC inverter drive are
considerably more expensive than those required to handle a DC motor. However, if
performance requirements can be met -- meaning that the required speed range is over
1/3rd of base speed -- AC inverters and AC motors are usually more cost-effective than
DC motors and DC drives for applications larger than about 10 horsepower, because of
cost savings in the AC motor.
Inability to operate at low speeds
Standard AC motors should not be operated at speeds less than about 1/3rd of base speed.
This is due to thermal considerations. A DC motor should be considered for these
applications

APPLICATIONS:
The AC Induction Motor is the most commonly used AC motor in industrial
applications because of its simplicity, rugged construction, and relatively low
manufacturing costs.
- Machine tools
- Cranes, elevators, vehicles
- Pumps, fans, compressors
- Presses, bending machines, rolling mills, etc.

- Elevators, lifts, feed motors


- Metal-cutting machine tools
- Slow-speed vehicles, c' high-speed vehicles
- Extruders

CONCLUSION:
The project PROTECTION AND CONTROL OF LOW VOLTAGE MOTORS USED
IN INDUSTRIAL APPLICATIONS has been successfully designed and tested.
Integrating features of all the hardware components used have developed it. Presence of
every module has been reasoned out and placed carefully thus contributing to the best
working of the unit. Secondly, using highly advanced ICs and with the help of growing
technology the project has been successfully implemented.

REFERENCES:

[1] The 8051 Micro controller and Embedded Systems by -Muhammad Ali Mazidi,
Janice Gillispie Mazidi
[2] Electronic Components -D.V.Prasad
[3] Wireless Communications - Theodore S. Rappaport
[4] Electrical Machines by J.B. Gupta
[5] W.Premerlani et al, Fundamental of motor thermal model and its application in
motor protection, 58th Annual Conference for Protective Relay Engineers, pp 127-142,
July 2005
[6] G.A.Macoy, T Litman et al, Energy Efficient selection of Motor handbook, pp 6,
Jan 1993.
[7] Information Guide for General Purpose Industrial AC Small and Medium SquirrelCage Induction Motor Standards, NEMA Standards Publication, 2002.
[8] IEEE Guide for AC Motor Protection IEEE, Std C37.96-2000 (Revision of IEEE Std
C37.96-1988)
[9] IEEE Guide for the Presentation of Thermal Limit Curves for Squirrel Cage Induction
Machines, Std 620-1996 (Revision of IEEE Std 620-1987)
[10] GE Multilin, MM300 Motor Management Relay - Instruction Manual.

Das könnte Ihnen auch gefallen