0% found this document useful (0 votes)
463 views

Zigbee Based Indrustrial Security System: Bachelor of Technology

ZIGBEE BASED INDRUSTRIAL SECURITY SYSTEM A Main project thesis submitted in partial fulfillment of the requirement for the award of degree BACHELOR OF TECHNOLOGY In ELECTRONICS AND COMMUNICATIONS ENGINEERING.

Uploaded by

Sashikanth Betha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
463 views

Zigbee Based Indrustrial Security System: Bachelor of Technology

ZIGBEE BASED INDRUSTRIAL SECURITY SYSTEM A Main project thesis submitted in partial fulfillment of the requirement for the award of degree BACHELOR OF TECHNOLOGY In ELECTRONICS AND COMMUNICATIONS ENGINEERING.

Uploaded by

Sashikanth Betha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 76

ZIGBEE BASED INDRUSTRIAL SECURITY SYSTEM

A Main project thesis submitted in partial fulfillment of the requirement for the award of degree

BACHELOR OF TECHNOLOGY
In

ELECTRONICS AND COMMUNICATIONS ENGINEERING By P.PAVAN KUMAR (08GJ1A0441) B.SRINIVAS (08GJ1A0404) A.RAMESH (08GJ1A0401) Ch.RAHUL RAJ(08GJ1A041

Under the esteemed guidance of

Internal Guide
MS.PS.LAKSHMI Assistant Professor E.C.E Department

Head of the Department


B.SashiKanth Assistant Professor E.C.E Department

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINNERING Al-Aman College of Engineering (An Unaided Self financing Muslim Minority Institution) Affiliated to J.N.T.U. Kakinada & Approved by A.I.C.T.E. Gudilova, Anandapuram (M), Visakhapatnam-531173.

ZIGBEE BASED INDRUSTRIAL SECURITY SYYSTEM


A Main project thesis submitted in partial fulfillment of the requirement for the award of degree

BACHELOR OF TECHNOLOGY
In

ELECTRONICS AND COMMUNICATIONS ENGINEERING By P.PAVAN KUMAR (08GJ1A0441) B.SRINVAS (08GJ1A0404) A.RAMESH (08GJ1A0411) Ch.RAHUL RAJ(08GJ1A0410) Under the esteemed guidance of

Internal Guide
MS.PS.LAKSHMI Assistant Professor E.C.E Department

Head of the Department


B.SashiKanth Assistant Professor E.C.E Department

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINNERING Al-Aman College of Engineering


(An Unaided Self financing Muslim Minority Institution)

Affiliated to J.N.T.U. Kakinada & Approved by A.I.C.T.E. Gudilova, Anandapuram (M), Visakhapatnam-531173.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINNERING Al-Aman College of Engineering (An Unaided Self financing Muslim Minority Institution) Affiliated to J.N.T.U. Kakinada & Approved by A.I.C.T.E. Gudilova, Anandapuram (M), Visakhapatnam-531173.

CERTIFICATE

This is to certify that P.PAVAN KUMAR (08GJ1A0441), A.RAMESH (08GJ1A0401),

B.SRINVAS (08GJ1A0404),CH.RAHUL RAJ(08GJ1A0410) of year B.Tech (ECE) has carried out a main project work on ZIGBEE BASED INDRUSTRIAL SECURITY SYSTEM under the excellent guidance of MS.PS.LAKSHMI, Assistant Professor in the partial fulfillment for the award of the Degree Of Bachelor of Technology in Electronics and Communications Department in Al-Aman College of Engineering, Visakhapatnam(Affiliated to J.N.T.U Kakinada, A.P) is a bonafide record of work done by them.

Internal Guide
MS.PS.LAKSHMI Assistant Professor E.C.E Department

Head of the Department


B.SashiKanth, M.Tech Assistant Professor E.C.E Department

ACKNOWLEDGEMENTS
It gives us immense pleasure to express our gratitude to everyone who has helped us in the successful completion of our partial project entitled ZIGBEE BASED INDRUSTRIAL SECURITY SYSTEM. In the completion of our Main Project we would take this opportunity to thank the following people without whose help and co-operation many things would have become very tough for us. We extend our sincere heartfelt thanks to our guide Mr. PS.LAKSHMI, Assistant Professor whose valuable inputs have made us richer in terms of knowledge and for guiding us at a place where we are not familiar with. We are particularly grateful to Mr. B. SashiKanth, Head of the Department (ECE) who encouraged us to select this project. We wish to thank our G. Madhusudan Rao, Project Director, who has supported us in doing this mini project. We even thank T. Eshwar Lal, Principal Finally, we would like to thank our parents, friends and all others who made our work more productive, beautiful and meaningful. P.PAVAN KUMAR (08GJ1A0441) A.RAMESH (08GJ1A0401) B.SRINVAS (08GJ1A0404) Ch.RAHUL RAJ(08GJ1A0410)

ZIGBEE BASED INDRUSTRIAL SECURITY SYSTEM


TABLE OF CONTENTS

Chapter No

Description

Page

Synopsis List of Figures List of Tables


1

AN OVERVIEW

1.1 1.2 1.3

EMBEDDED SYSTEMS BLOCK DIAGRAM SOFTWARE REQUIREMENTS 1.3.1 KIEL SOFTWARE

1.5
2

HARDWARE REQUIRMENTS AND APPLICATIONS

POWER SUPLY
2.1 BLOCK DIAGRAM STEP DOWN TRANSFORMER

2.2 2.3 2.4 2.5 2.6


3

RECTIFIER FILTERING UNIT VOLTAGE REGULATOR SPECIFICATIONS

MICRO CONTROLLER AND REGISTERS 3.1 3.2 MICRO CONTROLLER ARCHITECTURE MICROCONTROLLER

3.3 3.4 3.5


4

PIN CONFIGURATION ATMEL89C51 PIN DESCRIPTION MEMORY IN 8051

LCD 4.1 4.2 4.3 4.4 4.5 4.6 LCD DISPLAY DESCRIPTION
OPERATION LED BACK LIGHT SETTING BAUD RATE SENSORS

4.6.1 4.6.2
5

USE OF SENSOR TYPES OF SENSOR

PIZEO ELECTRIC BUZZER 5.1 PIZEO ELECTRIC BUZZER WITHOUT CAPACITIOR 5.1.1 5.1.2 5.1.3 5.2
5.3 5.4

FEATURES APPLICATIONS SOUND MEASURMENT METHOD

KIEL SOFTWARE
KIEL CROSS COMPLIER ARM PROJECT DEVELOPMENT CYCLE

LIGHT DEPENDENT RESISTOR 6.1 PROGRAMMING 6.1.1 6.1.2 PROGRAM FOR TRANSMISSION PROGRAM FOR RECEVIER

ZIGBEE 7.1 7.2 7.3 7.4 7.5 7.6 OVERVIEW NETWORK MODES ZIGBEE ALLIANCES ZIGBEE DEVICES ZIGBEE APPLICATIONS CHARACTERSTICS

TARANG
8.1 8.2 8.3 FEATURES NET FEATURES MESH FEATURES

ZIGBEE BASED INDUSTRIAL SECURITY SYSTEM LIST OF FIGURES


Figure No Description Page No

1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 2.1 2.2 2.3 2.4 2.5 3.1 3.2

BLOCK DIAGRAM POWER SUPPLY BLOCK DIAGRAM OPERATION OF POWER SUPPLY GRAPHS OF RECTIFIER VON NEUMAN ARCHITECTURE HARVARD ARCHITECTURE PIN DIAGRAM RSET CIRCUIT CLOCK CIRCUIT MEMORY BLOCK DIAGRAM OF 8051 RAM MEMORY SFR REGISTER BLOCK LDR SCREEN SOUND MEASURING SYSTEM ZIGBEE PROTOCOL MODEL ZIGBEE STACK ARCHITECTURE ZIGBEE NETWORK TOPOLOGY

3.3 3.4 3.5 3.6

NODES TYPE OF ZIGBEE BEACON REQUEST UART DATA FRAME API FRAMES

ABSTRACT

ZigBee Building Automation/INDUSTRIAL automation offers a global standard for interoperable products enabling the secure and reliable monitoring and control of commercial building systems. It is the only BACnet approved wireless mesh network standard for commercial buildings. Owners, operators and tenants can benefit from increased energy savings and ensure the lowest lifecycle costs with this green and easy-to-install robust wireless network. By using ZigBee Building Automation products in your building, you can contribute toward satisfying credits in the categories of Sustainable Sites, Energy and Atmosphere, Indoor Environmental Quality under the U.S. Green Building Council's LED green building certification program. As zig-bee is the upcoming technology for wireless data transmission in low cost, low power consumption, low data rate. We had tried to demonstrate its way of functionality and various aspects like kinds, advantages and disadvantages using a small application of controlling the any kind of electronic and electrical devices and machines. The zig-bee technology is broadly adopted for bulk and fast data transmission over a dedicated channel In this project we will be developing a front end application in C ,to operate Devices in industry, which will be a user interface on the PC through which The signal from the controller kit will be transmitted using a zig-bee . Then the signals are received by the Zig-bee module connected to PC unit. ADVANTAGES 1. Devices are operated without using of wired network

2. Control the devices from theremote place reducing the powe consumption and time 3. One of the best secure data transmission for different applications like Wireless light switching Electrical meters with in home display

BLOCK DESIGN PROPOSAL FOR THE SYSTEM:

FIRE SENSOR(G8) DRIVER CKT EMBEDDED CONTROLLER

LED

LDR(LIGHT SENSOR) ZIGBEE

PERSONAL COMPUTER

ZIGBEE

HARDWARE REQUIREMENT FOR IMPLEMENTATION OF THE FUNCTION MODULE:


CONTROLLER (ARM LPC 2148/AT89S52). ZIG BEE MODULES. PERSONAL COMPUTER POWER SUPPLY UNIT RELAYS MAX 232 IC. MISCELLINOIUS COMPONENTS. FIRE SENSOR( G-8) LIGHT SENSOR ( LDR)

SOFTWARE REQUIREMENT FOR IMPLEMENTATION OF THE FUNCTION MODULE FOR AT89S52 BASED:
The KEIL U version IDE which Keil C51 Product is a complete software development environment for the 8051 microcontroller family. Us Flash+ Ver. 4.0.0 programmer for MCS51 microcontrollers developed by UC micro systems.

LANGUAGE:

All editions provide a complete Embedded C/C++ development environment and KEIL includes extensive middleware libraries.

PLATFORM:

WINDOWS XP.

CHAPTER- 1 INTRODUCTION

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. 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. communication mediums were twisted pair, optical fiber, infrared, and generally wireless radio. BLOCK DIAGRAM:

FIRE SENSOR DRIVER CIRCUIT LDR

EMBEDDED SYSTEM

LED

ZIGBEE

P.C

ZIGBEE

HARDWARE REQUIREMENT FOR IMPLEMENTATION OF THE FUNCTION MODULE:


CONTROLLER (ARM LPC 2148/AT89S52). ZIG BEE MODULES. PERSONAL COMPUTER POWER SUPPLY UNIT RELAYS MAX 232 IC. MISCELLINOIUS COMPONENTS. FIRE SENSOR( G-8) LIGHT SENSOR ( LDR)

SOFTWARE REQUIREMENT FOR IMPLEMENTATION OF THE FUNCTION MODULE FOR AT89S52 BASED:
The KEIL U version IDE which Keil C51 Product is a complete software development environment for the 8051 microcontroller family. Us Flash+ Ver. 4.0.0 programmer for MCS51 microcontrollers developed by UC micro systems.

LANGUAGE:

All editions provide a complete Embedded C/C++ development environment and KEIL includes extensive middleware libraries.

PLATFORM:

WINDOWS XP.

CHAPTER-2 POWER SUPPLY

POWER SUPPLY BLOCK DIAGRAM:

STEP DOWN TRANSFORMER

RECTIFIER FILTER REGULATOR

As we all know any invention of latest technology cannot be activated without the source of power. So it this fast moving world we deliberately need a proper power source which will be apt for a particular requirement. All the electronic components starting from diode to Intel ICs only work with a DC supply ranging from _+5v to _+12. We are utilizing for the same, the cheapest and commonly available energy source of 230v-50Hz and stepping down, rectifying, filtering and regulating the voltage. This will be dealt briefly in the forth-coming sections.

Figure 2.1 operation of power supply

STEP DOWN TRANSFORMER:


When AC is applied to the primary winding of the power transformer it can either be stepped down or up depending on the value of DC needed. In our circuit the transformer of 230v/15-0-15v is used to perform the step down operation where a 230V AC appears as 15V AC across the secondary winding. One alteration of input causes the top of the transformer to be positive and the bottom negative. The next alteration will temporarily cause the reverse. The current rating of the transformer used in our project is 2A. Apart from stepping down AC voltages, it gives isolation between the power source and power supply circuits.

RECTIFIER UNIT:

In the power supply unit, rectification is normally achieved using a solid state diode. Diode has the property that will let the electron flow easily in one direction at proper biasing condition. As AC is applied to the diode, electrons only flow when the anode and cathode is

negative. Reversing the polarity of voltage will not permit electron flow. A commonly used circuit for supplying large amounts of DC power is the bridge rectifier. A bridge rectifier of four diodes (4*IN4007) are used to achieve full wave rectification. Two diodes will conduct during the negative cycle and the other two will conduct during the positive half cycle. The DC voltage appearing across the output terminals of the bridge rectifier will be somewhat lass than 90% of the applied rms value. Normally one alteration of the input voltage will reverse the polarities. Opposite ends of the transformer will therefore always be 180 deg out of phase with each other. For a positive cycle, two diodes are connected to the positive voltage at the top winding and only one diode conducts. At the same time one of the other two diodes conducts for the negative voltage that is applied from the bottom winding due to the forward bias for that diode. In this circuit due to positive half cycleD1 & D2 will conduct to give 10.8v pulsating DC. The DC output has a ripple frequency of 100Hz. Since each altercation produces a resulting output pulse, frequency = 2*50 Hz. The output obtained is not a pure DC and therefore filtration has to be done.

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

1000f/25v

: for the reduction of ripples from the pulsating.

10f/25v

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

O, 1f : for bypassing the high frequency disturbances.

VOLTAGE REGULATORS:
The voltage regulators play an important role in any power supply unit. The primary purpose of a regulator is to aid the rectifier and filter circuit in providing a constant DC voltage to the device. Power supplies without regulators have an inherent problem of changing DC voltage values due to variations in the load or due to fluctuations in the AC liner voltage. With a regulator connected to the DC output, the voltage can be maintained within a close tolerant region of the desired output. IC7812 and 7912 is used in this project for providing +12v and 12v DC supply.

SPECIFICATIONS:
Resistors R1 and R2 maintain line load regulation. At the secondary side of the transformer, Applied voltage = 15v Conducting drop across the diodes = 2*0.6= 1.2v Without capacitor: Frequency = 100Hz Vavg = (15-1.2)v = 13.8c pulsating DC

With capacitor: V=Vavg *1.414(form factor)= 19.51v frequency = oHz With 7812 voltage regulator: V0= +12v With 7912 voltage regulator:V0= -12v

CHAPTER-3 MICROCONTROLLER AND REGISTERS

MICROCONTROLLER:
1.1 Microcontroller Architectures:
A microcontroller is a structure that integrates in a single chip a microprocessor, a certain amount of memory, and a number of peripheral interfaces. The Central Processing Unit (CPU) is connected to the other subsystems of the microcontroller by means of the address and data buses. Depending on how the CPU accesses the program memory, there are two possible architectures for microcontrollers, called Von Neumann, and Harvard. Figure 1.1 shows the structure of a computer with Von Neumann architecture, where all the resources, including program memory, data memory, and I/O registers, are connected to the CPU by means of a unique address and data bus.

A typical microcontroller having Von Neumann architecture is 68HC11 from Motorola. In HC11, all resources are identified by unique addresses in the same address space, and can be accessed using the same instructions For example, in case of the instruction: LDAA <address>; load accumulator a from <address> the operand indicated by the label <address> can be any of the microcontrollers resources, from I/O ports, to ROM constants. This way of accessing resources allows the existence of complex instructions like this:

ASL 35, x; arithmetic shift left the memory ;location with the address ;obtained by adding 35 to the ;index register X. Therefore, the Von Neumann microcontrollers tend to have a large instruction set, including some really complex instructions. This is the reason why computers having the Von Neumann architecture are often called CISC, or Complex Instruction Set

Computers. The main disadvantage of this architecture is that the more complex the instruction, The longer it takes to fetch, decode, execute it, and store the result. The instruction in the above example takes six machine cycles to execute, while the instruction for Integer divide, IDIV, needs no less than 41 machine cycles to complete. The Harvard architecture was created to increase the overall speed of computers in the early years, when very slow magnetic core memory was used to store the Program. It includes an additional, separate bus to access the program memory

Atmel At89c51 Pin out and Description:


The smallest current device is the ATMEL 89c51, a 40 Pin FLASH variant with 2 timers, UART, 500mA. ATMEL was the first with standard FLASH, and with more program cycles than other custom FLASH. These parts compete with OTP and MASK product on price, but eliminate inventory problems and the hidden costs of OTP development.

Why we go for AT89C51?


The AT89C51 is a low power, high performance CMOS 8-bit microcontroller with 4Kbytes of Flash programmable and erasable read only memory (PEROM). This device is compatible with the industry standard 8051 instruction set and pin out. The on-chip Flash allows the program memory to be quickly reprogrammed using a nonvolatile memory programmer such as the PG302 (with the ADT87 adapter). By combining an industry standard 8-bit CPU with Flash on a monolithic chip, the 8951 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.

Features of AT89C51:
1. It is a 8-bit microcontroller. 2. It has a flash memory of 4KB for storing the program. 3. It has RAM of 128 bytes. 4. It has 32 I/O ports -Port 0 (pin 39 to pin 32). -Port 1 (pin 1 to pin 8). -Port 2 (pin 21 to pin 28). -Port 3 (pin 10 to pin 17). 5. It has four register banks. 6. It has two 16-bit timers. -Timer 0 -Timer 1 7. It has full duplex asynchronous serial port. 8. It can support up to 64KB of external memory with the help of PC and 9. It has 16-bit address bus. 10. Six interrupts with two priority levels -2 general purpose interrupts (INT0, INT1). -4 preprogrammed interrupt (Timer0, Timer1, Serial interrupt, Reset interrupt). 11. Wide range of frequency of operation (0 to 24 MHz). DPTR.

12. It will operate on 5V dc supply. 13. It can support maximum of 500mA of current.

In addition, the 8951 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Power Down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

PIN DIAGRAM:

Fig 3.1: Microcontroller Pin Diagram.

18: Port 1: Each of these pins can be used as either input or output. Also, pins 1 and 2 (P1.0 and P1.1) have special functions associated with Timer 2.

9: Reset Signal: High logical state on this input halts the MCU and clears all the registers. Bringing this pin back to logical state zero starts the program anew as if the power had just been turned on. In another words, positive voltage impulse on this pin resets the MCU. Depending on the device's purpose and environs, this pin is usually connected to the push-button, reset-upon-start circuit or a brown out reset circuit. The image shows one simple circuit for safe reset upon starting the controller. It is utilized in situations when power fails to reach its optimal voltage.

Fig 3.2: Reset Circuit 10-17: Port 3: As with Port 1, each of these pins can be used as universal input or output. However, each pin of Port 3 has an alternative function: Pin 10: RXD - Serial input for asynchronous communication or serial output for synchronous communication

Pin 11: TXD - Serial output for asynchronous communication or clock output for synchronous communication. Pin 12: INT0 - Input for interrupt 0 Pin 13: INT1 - Input for interrupt 1 Pin 14: T0 - Clock input of counter 0 Pin 15: T1 - Clock input of counter 1 Pin 16: WR - Signal for writing to external (add-on) RAM memory Pin 17: RD - Signal for reading from external RAM memory 18-19: X2 and X1: Input and output of internal oscillator. Quartz crystal controlling the frequency commonly connects to these pins. Capacitances within the oscillator mechanism (see the image) are not critical and are normally about 30pF. New MCUs work at frequencies from 0Hz to 50MHz+.

Fig 3.3: Clock Circuit. 20: GND: Ground 21- 28: Port 2: If external memory is not present, pins of Port 2 act as universal input/output. If external memory is present, then these pins serve as the location of the

higher address byte, i.e. addresses A8 A15. It is important to note that in cases when not all the 8 bits are used for addressing the memory (i.e. memory is smaller than 64kB), the rest of the unused bits are not available as input/output. 29: PSEN: MCU activates this bit (brings to low state) upon each reading of byte (instruction) from program memory. If external ROM is used for storing the program, PSEN is directly connected to its control pins. 30: ALE: Before each reading of the external memory, MCU sends the lower byte of the address register (addresses A0 A7) to port P0 and activates the output ALE. External register (74HCT373 or 74HCT375 circuits are common), memorizes the state of port P0 upon receiving a signal from ALE pin, and uses it as part of the address for memory chip. During the second part of the mechanical MCU cycle, signal on ALE is off, and port P0 is used as Data Bus. In this way, by adding only one cheap integrated circuit, data from port can be multiplexed and the port simultaneously used for transferring both addresses and data. 31: EA: Bringing this pin to the logical state zero designates the ports P2 and P3 for transferring addresses regardless of the presence of the internal memory. This means that even if there is a program loaded in the MCU it will not be executed, but the one from the external ROM will be used instead. Conversely, bringing the pin to the high logical state causes the controller to use both memories, first the internal, and then the external (if present). 32-39: Port 0: Similar to Port 2, pins of Port 0 can be used as universal input/output, if external memory is not used. If external memory is used, P0 behaves as address output (A0 A7) when ALE pin is at high logical level, or as data output (Data Bus) when ALE pin is at low logical level. 40: VCC: Power +5V

INPUT OUTPUT (I/O) PORTS


Every MCU from 8051 family has 4 I/O ports of 8 bits each. This provides the user with 32 I/O lines for connecting MCU to the environs. Port 0 Port 0 has two fold role: if external memory is used, it contains the lower address byte (A0-A7), otherwise all bits of the port are either input or output. Another feature of this port comes to play when it has been designated as output. Port 0 lacks the "pull up" resistor (resistor with +5V on one end).

Therefore, to get one (5V) on the output, external "pull up" resistor needs to be added for connecting the pin to the positive pole.

Port 1
This is "true" I/O port, devoid of dual function characteristic for Port 0. Having the "pull up" resistor, Port 1 is fully compatible with TTL circuits.

Port 2
When using external memory, this port contains the higher address byte (addresses A8 A15). Otherwise, it can be used as universal I/O port.

Port 3
Beside its role as universal I/O port, each pin of Port 3 has an alternate function. In order to use one of these functions, the pin in question has to be designated as input, i.e. the appropriate bit of register P3 needs to be set. From a hardware standpoint, Port 3 is similar to Port 0.

Memory in 8051 Microcontroller:


The 8051 has three very general types of memory. The memory types are illustrated in the following figure: On-Chip Memory, External Code Memory, and External RAM.

Fig 3.4: Memory Block Diagram.

On-Chip Memory refers to any memory (Code, RAM, or other) that physically exists on the microcontroller itself. External Code Memory is code (or program) memory that resides offchip. This is often in the form of an external EPROM. External RAM is RAM memory that resides off-chip. This is often in the form of standard static RAM or flash RAM. During the runtime, microcontroller uses two different types of memory: one for holding the program being executed (ROM memory), and the other for temporary storage of data and auxiliary variables (RAM memory).

ROM memory
In this MCU contain 4 kilobytes of the flash memory on the chip. It is of EEPROM. We can use 12v to program MCU. This option is cost-effective only for large series. The main purpose of ROM is to store the programs to be executed.

RAM memory
RAM is used for storing temporary data and auxiliary results generated during the runtime. Apart from that, RAM comprises a number of registers: hardware counters and timers, I/O ports, buffer for serial connection, etc. With older versions, RAM spanned 256 locations, while new models feature additional 128 registers. First 256 memory locations form the basis of RAM (addresses 0 FFh) of every 8051 MCU. Locations that are available to the user span addresses from 0 to 7Fh, i.e. first 128 registers, and this part of RAM is split into several blocks as can be seen in the following figure.

Fig 3.5: Ram Memory.


The main purpose of RAM is to provide synchronization between ROM and CPU so as to increase the speed of microcontroller.

Bit Memory
The 8051, being a communications-oriented microcontroller, gives the user the ability to access a number of bit variables. These variables may be either 1 or 0. There are 128 bit variables available to the user, numbered 00h through 7Fh.

Special Function Register (SFR) Memory


Special Function Registers (SFRs) are areas of memory that control specific functionality of the 8051 processor. It may appear that SFR is part of Internal Memory. However, when using this method of memory access (its called direct address), any instruction that has an address of 00h through 7Fh refers to an Internal RAM memory address; any instruction with an address of 80h through FFh refers to an SFR control register.

Register Banks:
General Purpose registers:

The 8051 uses 8 "R" registers which are used in many of its instructions. These "R" registers are numbered from 0 through 7 (R0, R1, R2, R3, R4, R5, R6, and R7). These registers are generally used to assist in manipulating values and moving data from one memory location to another .

SFR Registers (Special Function Registers)


SFR registers can be seen as a sort of control panel for managing and monitoring the microcontroller.

Fig 3.6:

Special Function Registers.

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.

USING TIMERS TO MEASURE TIME:

Obviously, one of the primary uses of timers is to measure time. 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. .

Timer SFRs
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). An SFR has a numeric address. It is often useful to know the numeric address that corresponds to an SFR name. The SFRs relating to timers are: When you enter the name of an SFR into an assembler, it internally converts it to a number.

The TMOD SFR (Timer Mode):


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:

Bit Name

Explanation of Function When this bit is set the timer will only run when INT1

Timer

GATE1 (P3.3) is high. When this bit is clear the timer will run 1 regardless of the state of INT1. When this bit is set the timer will count events on T1

C/T1

(P3.5). When this bit is clear the timer will be 1 incremented every machine cycle.

5 4

T1M1 T1M0

Timer mode bit (see below) Timer mode bit (see below) When this bit is set the timer will only run when INT0

1 1

GATE0 (P3.2) is high. When this bit is clear the timer will run 0 regardless of the state of INT0. When this bit is set the timer will count events on T0

C/T0

(P3.4). When this bit is clear the timer will be 0 incremented every machine cycle.

1 0

T0M1 T0M0

Timer mode bit (see below) Timer mode bit (see below)

0 0

Four bits (two for each timer) are used to specify a mode of operation. The modes of operation are:

TxM1 0 0 1 1

TxM0 0 1 0 1

Timer Mode 0 1 2 3

Description of Mode 13-bit Timer. 16-bit Timer 8-bit auto-reload Split timer mode

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

TCON (88h) SFR


Bit Name Bit Address Explanation of Function Timer

TF1

8Fh

Timer 1 Overflow. This bit is set by the microcontroller when Timer 1 overflows. Timer 1 Run. When this bit is set Timer 1 is turned on. When this bit is clear Timer 1 is off. Timer 0 Overflow. This bit is set by the microcontroller when Timer 0 overflows.

TR1 8Eh

TF0

8Dh

TR0 8Ch

Timer 0 Run. When this bit is set Timer 0 is turned on. When this bit is clear Timer 0 is off.

CHAPTER-4

LCD

LCD
LCD DISPLAY:
A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a thin, flat panel made up of any number of color or monochrome pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector. It is often utilized in battery-powered electronic devices because it uses very small amounts of electric power.

FIG4.1 LCD SCREEN

DESCRIPTION:
BPI-216 LCD modules combine a serial interface with a 2-line by 16-character LCD. The combination receives serial data at 2400 or 9600 baud (switch selectable) and displays it on the LCD. The unit has two modes: text and instruction. It defaults to text mode; any data received appears on the screen. Send the string HELLO and HELLO appears on the LCD. To distinguish text from instructions (e.g., clear screen, position cursor, etc.), the interface looks for an instruction prefix (ASCII 254). The byte following this prefix is treated as an instruction. After the instruction code, the unit returns to text mode. This product replaces BPK-series serial LCD modules, which function identically. The primary difference is in the physical layout of the

circuit board, which has been optimized for 2x16 LCDs. The LCD Serial board (without an LCD; BPK-000) remains available for other applications.

BASIC OPERATION:
Once the BPI-216 is properly connected and configured to match the baud rate of the computer/program that will be talking to it serially, data sent to it will appear on the display. For example, if you send Hello then Hello appears on the display. The cursor (printing position) automatically moves from left to right. You can also send instructions to the BPI-216. To identify a particular byte as an instruction, precede it with the instruction prefix character, ASCII 254 (0FE hex, 11111110 binary). The interface treats the byte immediately after the prefix as an instruction, then automatically returns to data mode. Example: The clear-screen instruction is ASCII 1. To clear the screen, send <254><1> (where the <> symbols mean single bytes set to these values, not text as typed from the keyboard).

LED BACKLIGHT:
On models equipped with an LED backlight (marked L[x] in the lower left corner of the interface board), you may turn on the backlight by setting the BL switch ON. The backlight will be on whenever power is applied. There is also a pair of solder pads near the backlight switch to allow you to control the backlight with an external switch or circuit.

SETTING THE BAUD RATE:


Set the BPS switch down for 2400 baud; up for 9600. At either rate, the serial characteristics are no parity, 8 data bits, and 1 stop bit. The interface reads the BPS switch only at startup. Change the BPS setting only with the power off. The Backlight (BL) may be turned on or off at any time.

LCD Instructions
Instruction/Action Code

A Clear Screen Scroll display one character left (all lines) Scroll display one character right (all lines) Home (move cursor to top/left character position) Move cursor one character left Move cursor one character right Turn on visible underline cursor Turn on visible blinking-block cursor Make cursor invisible Blank the display (without clearing) 8 Restore the display (with cursor hidden) Set cursor position (DDRAM address) Set pointer in character-generator (CG) RAM

1 24 28 2 16 20 14 13 12

12 28 + addr 64 + addr

SENSORS:
A sensor is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. For example, a mercury-in-glass thermometer converts the measured temperature into expansion and contraction of a liquid which can be read on a calibrated glass tube. A thermocouple converts temperature to an output voltage which can be read by a voltmeter. For accuracy, most sensors are calibrated against known standards.

USE OF SENSORS:
Sensors are used in everyday objects such as touch-sensitive elevator buttons (tactile sensor) and lamps which dim or brighten by touching the base. There are also innumerable applications for sensors of which most people are never aware. Applications include cars, machines, aerospace, medicine, manufacturing and robotics. A sensor is a device which receives and responds to a signal. A sensor's sensitivity indicates how much the sensor's output changes when the measured quantity changes. For instance, if the mercury in a thermometer moves 1 cm when the temperature changes by 1 C, the sensitivity is 1 cm/C (it is basically the slope Dy/Dx assuming a linear characteristic). Sensors that measure very small changes must have very high sensitivities. Sensors also have an impact on what they measure; for instance, a room temperature thermometer inserted into a hot cup of liquid cools the liquid while the liquid heats the thermometer. Sensors need to be designed to have a small effect on what is measured, making the sensor smaller often improves this and may introduce other advantages. Technological progress allows more and more sensors to be manufactured on a microscopic scale as micro sensors using MEMS technology. In most cases, a micro sensor reaches a significantly higher speed and sensitivity compared with macroscopic approaches.

TYPES OF SENSORS:

Electric current, electric potential, magnetic, radio Environment, weather, moisture, humidity Flow, fluid velocity Navigation instruments Position, angle, displacement, distance, speed, acceleration Optical, light, imaging Pressure Force, density, level Thermal, heat, temperature Proximity, presence

CHAPTER-5 Piezoelectronic Buzzers

PIEZEO ELECTRIC BUZZER Piezoelectronic Buzzers(without circuit) PS Series(Pin Terminal/Lead)

FEATURES: The PS series are high-performance buzzers that employ unimorph piezoelectric elements and
are designed for easy incorporation into various circuits. They feature extremely low power consumption in comparison to electromagnetic units. Because these buzzers are designed for external excitation, the same part can serve as both a musical tone oscillator and a buzzer. They can be used with automated inserters. Moisture-resistant models are also available. The lead wire type (PS1550L40N) with both-sided adhesive tape installed easily is prepared.

APPLICATIONS:
Electric ranges, washing machines, computer terminals, various devices that require speech synthesis output.

SOUND MEASURING METHOD:

DC power supply

Driver output

Piezo electric

Standard microphon e

Amp

Filter

Recorder

Frequency meter

Kiel software: KIEL COMPILER: Introduction to Micro vision Keil (IDE) Keil is a cross compiler. So first we have to understand the concept of compilers and cross compilers. After then we shall learn how to work with keil..

Concept of compiler: -

Compilers are programs used to convert a High Level Language to object code. Desktop compilers produce an output object code for the underlying microprocessor, but not for other

microprocessors. I.E the programs written in one of the HLL like C will compile the code to run on the system for a particular processor like x86 (underlying microprocessor in the computer). For example compilers for Dos platform is different from the Compilers for Unix platform

So if one wants to define a compiler then compiler is a program that translates source code into object code. The compiler derives its name from the way it works, looking at the entire piece of source code and collecting and reorganizing the instruction. See there is a bit little difference between compiler and an interpreter. Interpreter just interprets whole program at a time while compiler analyzes and execute each line of source code in succession, without looking at the entire program. The advantage of interpreters is that they can execute a program immediately. Secondly programs produced by compilers run much faster than the same programs executed by an interpreter. However compilers require some time before an executable program emerges. Now as compilers translate source code into object code, which is unique for each type of computer, many compilers are available for the same language.

Concept of cross compiler: -

A cross compiler is similar to the compilers but we write a program for the target processor (like 8051 and its derivatives) on the host processors (like computer of x86).

It means being in one environment you are writing a code for another environment is called cross development. And the compiler used for cross development is called cross compiler

So the definition of cross compiler is a compiler that runs on one computer but produces object code for a different type of computer. Cross compilers are used to generate software that

can run on computers with a new architecture or on special-purpose devices that cannot host their own compilers. Cross compilers are very popular for embedded development, where the target probably couldn't run a compiler. Typically an embedded platform has restricted RAM, no hard disk, and limited I/O capability. Code can be edited and compiled on a fast host machine (such as a PC or Unix workstation) and the resulting executable code can then be downloaded to the target to be tested. Cross compilers are beneficial whenever the host machine has more resources (memory, disk, I/O etc) than the target. Keil C Compiler is one such compiler that supports a huge number of host and target combinations. It supports as a target to 8 bit microcontrollers like Atmel and Motorola etc.

Why do we need cross compiler?


There are several advantages of using cross compiler. Some of them are described as follows By using this compilers not only can development of complex embedded systems be completed in a fraction of the time, but reliability is improved, and maintenance is easy. Knowledge of the processor instruction set is not required. A rudimentary knowledge of the 8051s memory architecture is desirable but not necessary. Register allocation and addressing mode details are managed by the compiler. The ability to combine variable selection with specific operations improves program readability. Keywords and operational functions that more nearly resemble the human thought process can be used. Program development and debugging times are dramatically reduced when compared to assembly language programming. The library files that are supplied provide many standard routines (such as formatted output, data conversions, and floating-point arithmetic) that may be incorporated into your application.

Existing routine can be reused in new programs by utilizing the modular programming techniques available with C.

The C language is very portable and very popular. C compilers are available for almost all target systems. Existing software investments can be quickly and easily converted from or adapted to other processors or environments.

Keil C cross compiler: -

Keil is a German based Software development company. It provides several development tools like IDE (Integrated Development environment) Project Manager Simulator Debugger C Cross Compiler, Cross Assembler, Locator/Linker

Keil Software provides you with software development tools for the ARM microcontrollers. With these tools, you can generate embedded applications for the multitude of ARM derivatives. Keil provides following tools for ARM development 1. 2. 3. 4. 5. ARM Optimizing C Cross Compiler, Macro Assembler, ARM Utilities (linker, object file converter, library manager), Source-Level Debugger/Simulator, Vision for Windows Integrated Development Environment.

The keil ARM tool kit includes three main tools, assembler, compiler and linker. An assembler is used to assemble your ARM assembly program A compiler is used to compile your C source code into an object file A linker is used to create an absolute object module suitable for your in-circuit emulator. Now after going through the concept of compiler and cross compilers lets we start with Keil C cross compiler.

ARM project development cycle: These are the steps to develop ARM project using keil 1. Create source files in C or assembly. 2. Compile or assemble source files. 3. Correct errors in source files. 4. Link object files from compiler and assembler. 5. Test linked application

CHAPTER-5 LIGHT DEPENDENT RESISTOR(LDR)

LDR
LDR PROGRAM: #include <reg52.h> #define LCD P2

Void delay_ms(unsigned int i) { Unsigned int j; While (i-->0) { for(j=0;j<500;j++) { ; } } }

void cmd_lcd(unsigned char c) { unsigned char temp; temp=c>>4; LCD=temp<<4|0x02; //logical or with 0x02 since rs(rs=0) & en(en=1) are LCD=0; //transmit low byte LCD=c<<4|0x02; LCD=0; //connected to p2.0 & p2.1 respectively

delay_ms(2); //delay 2 milliseconds }

void init_lcd(void) { delay_ms(10); //delay 10 milliseconds cmd_lcd(0x28); //4 bit initialize, 5x7 character font, 16x2 display cmd_lcd(0x0c); //lcd on, cursor on cmd_lcd(0x06); //right shift cursor automatically after each character is displayed cmd_lcd(0x01); //clear lcd }

void write_lcd(unsigned char c) { unsigned char temp; temp=c>>4; LCD=temp<<4|0x03; //logical or with 0x03 since rs(rs=1) & en(en=1) are LCD=0; LCD=c<<4|0x03; LCD=0; delay_ms(2); }

void display_lcd(unsigned char *s) { while(*s)

write_lcd(*s++); }

void integer_lcd(int n) { unsigned char c[6]; unsigned int i=0; if(n<0) { write_lcd('-'); SBUF='-'; n=-n; } if(n==0) { write_lcd('0'); SBUF='0'; } while(n>0) { c[i++]=(n%10)+48; n/=10; } while(i-->=1) { write_lcd(c[i]); SBUF=c[i];

} }

void float_lcd(float f) { int n; float temp; n=f; integer_lcd(n); write_lcd('.'); SBUF='.'; temp=f-n; if(temp>=0.00&&temp<=0.09) write_lcd('0'); f=temp*100; n=f; integer_lcd(n); }

TRANSMITTER:

#include<reg52.h> #include "lcd.h"

sbit LDR = P1^0;

sbit FIRE = P1^1;

sbit buzzer = P0^7;

unsigned char str[20]; void transmit(unsigned char *);

void intr(void) interrupt 4 { if(TI) TI=0; if(RI) { RI=0; } }

void main() { TMOD=0X20; SCON=0X50; IE=0X90; TH1=0XFD; TR1=1; buzzer=0; int_lcd();

display_lcd("ZIGBEE BASED"); cmd_lcd(0xc0); display_lcd("INDUSTRIAL SECURITY"); delay_ms(2000); // cmd_lcd(0x01); transmit(" ZIGBEE BASED INDUSTRIAL SECURITY SYSTEM \r\n\r\n");

transmit("==================================================== ===\r\n\r\n"); while(1) {

if(LDR==1) { buzzer=1; cmd_lcd(0x01); display_lcd("LOW LIGHT ");

transmit("LOW LIGHT\r\n\r\n"); delay_ms(1000); buzzer=0; delay_ms(200); cmd_lcd(0x80); display_lcd("ZIGBEE BASED");

cmd_lcd(0xc0); display_lcd("INDUSTRIAL SECURITY"); } else if(FIRE==1) { buzzer=1; cmd_lcd(0x01); display_lcd("FIRE DETECTED "); transmit("FIRE DETECTED\r\n\r\n"); delay_ms(1000); buzzer=0; delay_ms(200); cmd_lcd(0x80); display_lcd("ZIGBEE BASED"); cmd_lcd(0xc0); display_lcd("INDUSTRIAL SECURITY"); } else { cmd_lcd(0x80); display_lcd("ZIGBEE BASED"); cmd_lcd(0xc0); display_lcd("INDUSTRIAL SECURITY");

} void transmit(unsigned char *s) { while(*s) { SBUF=*s++; delay_ms(100); } }

RECEVIER:

#include<reg52.h>

sbit buzzer = P0^7;

void delay_ms(unsigned int i) { unsigned int j; while(i-->0) { for(j=0;j<500;j++) {

; } } } void intr(void) interrupt 4 { unsigned char c; if(TI) TI=0; if(RI) { c=SBUF; if(c=='@') buzzer=1;

SBUF=c;

RI=0; } }

unsigned char *c,*s="wel to the world\r\n";

void main() { IE=0X90; TMOD=0X20;

SCON=0X50; TH1=0XFD; TR1=1; buzzer=0; while(1); { // while(!TI); // } TI=0;

CHAPTER-6 ZIGBEE

ZIGBEE TECHNOLOGY
6.1: OVERVIEW OF ZIGBEE TECHNOLOGY:
In order to meet the aim of low-cost and low power for wireless network, IEEE Standard Board developed a low-rate WPAN standard 802.15.4 in 2000. IEEE802.15.4 defines the PHY layer and MAC layer. PHY layer defines the entity norms of the low-power radio transferred in the 2.4GHz at the lowest 250kb / s transmission rate. MAC layer defines the principle how to share air routes by many 802.15.4 radio signals worked in the same area. However, the definition of the PHY layer and MAC layer is not sufficient to ensure that different devices can be dialogue each other, so ZigBee appears.

ZigBee is a software protocol that includes network, security and application based on IEEE802.15.4. ZigBee is a kind of wireless communication technology that has the character of short range, low transfer rate, low power, low complexity, high reliability, and high scalability. ZigBee can be used in industrial control, home gateways, consumer electron products, medical equipment and other fields, and it will have broad prospects for development. ZigBees protocol is simple, easy to achieve, needs less system resources. Figure 5.1(a) shows the reference model for its protocol structure.

Figure 6.1(a): ZigBee Protocol Model.

ZigBee is an intelligent digital protocol, operating at three frequencies, with the

commonest one being at 2.4 GHz. At this operating frequency, data rates up to 250 kbit/s are claimed. This is a relatively low bandwidth, compared to other protocols such as Bluetooth. However, the low transmission rate reduces power consumption, with a typical module consuming 45 Ma when transmitting. When not transmitting, the current consumption can be reduced to less than 50ptA in the so-called sleep mode. ZigBee has a transmitting range of up to 30 m, but this can be increased by using one of the connection topologies available with the protocol. By using mesh networking, distances over 1 km could feasibly be achieved, as ZigBee allows up to 65,000 nodes within an individual network. Other network topologies include the simple direct connection and the star arrangement, the latter being ideally suited to industrial sensing, with multiple transmitters streaming data back to a central receiver unit. ZigBee also performs well in electrically noisy environments.

Fig 6.2(b): ZigBee stack Architecture. 6.2: IEEE 802.15.4:


IEEE 802.15.4 is a standard which specifies the physical layer and medium access control for low-rate wireless personal area networks (LR-WPAN's).This standard was chartered to investigate a low data rate solution with multi-month to multi-year battery life and very low complexity. It is operating in an unlicensed, international frequency band. Potential applications are sensors, interactive toys, smart badges, remote controls, and home automation.802.15.4 Is part of the 802.15 wireless personal-area network effort at the IEEE.It is a simple packet-based radio protocol aimed at very low-cost, battery-operated widgets and sensors (whose batteries last years, not hours) that can intercommunicate and send low-bandwidth data to a centralized device. 6.2.1: 802.15.4 Protocol Features:

Data rates of 250 kbps with 10-100 meter range. Two addressing modes; 16-bit short and 64-bit IEEE addressing. Support for critical latency devices, such as joysticks. CSMA-CA channel access. Automatic network establishment by the coordinator Fully handshaked protocol for transfer reliability Power management to ensure low power consumption.

16 channels in the 2.4GHz ISM band Low duty cycle - Provides long battery life Low latency Support for multiple network topologies: Static, dynamic, star and mesh Direct Sequence Spread Spectrum (DSSS) Up to 65,000 nodes on a network 128-bit AES encryption Provides secure connections between devices

6.3: NETWORK MODEL OF ZIGBEE TECHNOLOGY:


ZigBee network is composed of many independent work nodes. ZigBee has three types of wireless network models: satellite shape, cluster tree shape, and reticular shape. ZigBee network equipment is divided into semi-function devices (RFD) and full-function devices (FFD). RFD nodes can act as network terminal nodes, they cannot communicate with each other directly, they can send and receive data through FFD nodes, and do not have routing and relay function. FFD can be used as a router, coordination, and terminal node, can communicate with sub-node controlled, collect data and send instructions. ZigBee network has strong network robustness and system reliability. ZigBee network topology is shown in Figure 6.3.The wireless ordering dish system uses ZigBee technology to realize the wireless communication.

Figure 6.4: ZigBee Network Topology.

6.4: ZIGBEE ALLIANCE:


ZigBee wireless technology has been originated from zigbee alliance, which is responsible for wireless sensors, wireless technology, network layers, application layers, low cost, security, optimized for low duty cycle, low power (nothing but battery life as multiple months to years) and multiple topologies. Multiple topologies are nothing but the ZigBee network topologies which are clearly shown in above figure. The addressing space of ZigBee is up to 18, 450, 000, 000, 000, 000, 000 devices (64 bit IEEE address), which are nothing but 65,535 networks. The range is up to 50 m typically or (5 500 m based environment).

5.5 :ZIGBEE DEVICES:


There are two physical device types for the ZigBee network (for the low system cost).The below shown figure clearly shows the ZigBee devices in a topology.

a) Full Function Device (FFD):


The full function device explains the following functions

FFD Can function in any topology FFD has the Capable of being the Network coordinator FFD can Capable of being a coordinator FFD can talk to any other device

Fig 6.5: Network topology identifying ZigBee devices. b) Reduced Function Device (RFD):
The Reduced function device explains the following functions. RFD is limited to star topology RFD Cannot become a network coordinator RFD can talk only to a network coordinator RFD is very simple to implement

6.6: ZIGBEE NETWORKS: 6.6.1: ZIGBEE Network Formation:


A ZigBee Personal Area Network (PAN) consists of one coordinator and one or more routers and/or end devices. A ZigBee Personal Area Network (PAN) is created when a coordinator selects a channel and PAN ID to start on. Once the coordinator has started a PAN, it can allow router and end device nodes to join the PAN. When a router or end device joins a PAN, it receives a 16-bit network address and can transmit data to or receive data from other devices in the PAN. Routers and the coordinator can allow other devices to join the PAN, and can assist in sending data through the network to ensure data is routed correctly to the intended recipient device. When a router or coordinator allows an end device to join the PAN, the end device that joined becomes a child of the router or coordinator that allowed the join. End devices, however can transmit or receive data but cannot route data from one node to another, nor can they allow devices to join the PAN. End devices must always communicate directly to the parent they joined to. The parent router or coordinator can oute data on behalf of an end device child to ensure it reaches the correct destination. End devices are intended to be battery powered and can support low power modes.

The network address of the PAN coordinator is always 0. When a router joins a PAN, it can also allow other routers and end devices to join to it. Joining establishes a parent/child relationship between two nodes. The node that allowed the join is the parent, and the node that joined is the child. The parent/child relationship is not necessary for routing data.

Fig 6.6.1:Nodes Types/Sample of a Basic ZigBee Network Topology.

Starting a ZigBee Coordinator:


When a coordinator first comes up, it performs an energy scan on multiple channels (frequencies) to select an unused channel to start the PAN. After removing channels with high detected energy levels, the coordinator issues an 802.15.4 beacon request command on the remaining, low energy level channels. Nearby routers or coordinators that have already joined a PAN respond to the beacon request frame with a small beacon transmission indicating the PAN identifier (PAN ID) that they are operating on, and whether or not they are allowing joining. The coordinator will attempt to start on an unused PAN ID and channel. After starting, the coordinator may allow other devices to join its PAN. Joining a Router: When a router first comes up, it must locate and join a ZigBee PAN. To do this, it issues an 802.15.4 beacon request command on multiple channels to locate nearby PANs. Nearby routers and coordinators that have already joined a PAN respond to the beacon request frame with a small beacon transmission, indicating which channel and PAN ID they are operating on. The router listens on each channel for these beacon frames. If a valid PAN is found from one of the received beacons, the router issues a join request to the device that sent the beacon. If joining succeeds, the router will then receive a join confirmation from the device, indicating the join was successful. Once the router joins the PAN, it can communicate with other devices on the PAN and allow new devices to join to it.

Joining an End Device: When an end device first comes up, it must also locate and join a PAN. End devices follow the same process as a router to join a PAN. Once the end device has successfully joined a PAN, it can communicate with other devices on the PAN. However, since end devices cannot route data, they must always communicate directly with their parent and allow the parent to route data in its behalf. 5.6.2:Demonstration of Beacon Request and Beacon Transmission that takes place during joining:

Fig 6.6.2 :Beacon Request and Beacon Transmission 6.6.3 :ZigBee Network Communications:
ZigBee supports device addressing and application layer addressing. Device addressing specifies the destination address of the device a packet is destined to. Application layer addressing indicates a particular application recipient, known as a ZigBee endpoint, along with a message type field called a Cluster ID.

6.6.4: ZigBee Device Addressing:


The 802.15.4 protocol upon which the ZigBee protocol is built specifies two address types: 16-bit network addresses 64-bit Addresses 16-bit Network Addresses: A 16-bit network address is assigned to a node when the node joins a network. The network address is unique to each node in the network. However, network addresses are not static - it can change. 64-bit Addresses: Each node contains a unique 64-bit address. The 64-bit address uniquely identifies a node and is permanent.

6.7: API OPERATION:


As an alternative to Transparent Operation, API (Application Programming Interface) Operations are available. API operation requires that communication with the module be done through a structured interface (data is communicated in frames in a defined order). The API specifies how commands, command responses and module status messages are sent and received from the module using a UART Data Frame.

6.7.1 API Frame Specifications:


Two API modes are supported and both can be enabled using the AP (API Enable) command. Use the following AP parameter values to configure the module to operate in a particular mode: AP = 1: API Operation AP = 2: API Operation (with escaped characters) API Operation (AP parameter = 1) When this API mode is enabled (AP = 1), the UART data frame structure is defined as follows:

Fig: 6.7.1(a): UART Data Frame Structure. API Operation - with Escape Characters (AP parameter = 2) When this API mode is enabled (AP = 2), the UART data frame structure is defined as follows:

Fig: 6.7.1(b) :UART Data Frame Structure-with escape control characters. 6.7.2: API FRAMES:
Frame data of the UART data frame forms an API-specific structure as follows

Fig 6.7.2 API Frames.

Table 6.7.2: API Frame Names and Values: API Frame Names Modern Status Advanced Modern Status AT Command AT Command-Queue Parameter Value AT Command Response Remote Command Request Remote Command Response Values 0x8A 0x8C 0x08 0x09 0x88 0x17 0x97

ZigBee Transmit Request

0x10

Explicit Addressing ZigBee Command 0x11 Frame ZigBee Transmit Status ZigBee Receive Packet (AO=0) ZigBee Explicit Rx Indicator (AO=1) XBee Sensor Read Indicator (AO=0) Node Identification Indicator (AO=0) 0x8B 0x90 0x91 0x94 0x95

6.8: CHARACTERISTICS OF ZIGBEE NETWORK:


In an industrial application, there are some characteristics which are desired for a wireless data networks. a) Range: ZigBee transmission range is designed up to 10- 100 m. In industrial RF environments at least 50 m range is required. b) Data Rate: The data rate varies from 20 250 kbps in 2.4 GHz, 40 Kbps at 915MHz, and 20 Kbps at 868MHz. In industrial sensing and control applications required data rates vary widely by application but are often low and intermittent. c) Network Latency: The time required for a device to join a network is 30 milliseconds and to start communication is 15 milliseconds. In industries latency varies with the application. It varies widely by application. Multi-hop nature of mesh networks increases latency. And ZigBee nodes need to wake up very quickly, transmit and/or receive and go back to sleep. Advantage of ZigBee network is that, it need not synchronize with other node before joining and beginning of communication. d) Power profile: ZigBee has been developed specifically to permit low power consumption and years of battery life. e) Operating frequency: ZigBee supports most of the widely used unlicensed ISM bands in Europe, NA, and around the world. : ZigBee uses unlicensed 2.4GHz band, which is also called as ISM (Industrial, Scientific and Medical) band. f) Flexibility: The network technology should be flexible in terms of the uses to which it might be put. It should be agnostic to the type of sensors or output devices attached and able to be implemented for different device types without a lot of device specific

requirements within the network or the protocol stack. ZigBee is flexible and can carry any type of data. g) Number of devices: ZigBee have a great capability to address the spectrum of industrial situations. 65536 nodes can be used in ZigBee. In certain situations where more than 3000 devices are needed, multiple subnets are formed instead of one large network. h) Security: ZigBee has security built in. 802.15.4 specifies use of the 128 bit Advanced Encryption Standard and its specification defines how to handle encryption key change and multi-hop transmission security.

6.9:ZIGBEE APPLICATIONS:
ZigBee enables broad-based deployment of wireless networks with low-cost, low-power solutions. It provides the ability to run for years on inexpensive batteries for a host of monitoring applications: Lighting controls AMR (Automatic Meter Reading) Smoke and CO detectors Wireless telemetry HVAC control Heating control Home security Environmental controls and shade controls, etc.

6.10 :ZIGBEE BENEFITS:


In all of its uses, ZigBee offers four inherent, beneficial characteristics:

Low cost Range and obstruction issues avoidance Multi-source products Low power consumption

6.11:TARANG F4L MODULE:


Tarang modules are designed with low to medium transmit power and for high reliability wireless networks. The modules require minimal power and provide reliable delivery of data between devices. The interfaces provided with the module help to directly fit into many industrial applications. The modules operate within the ISM 2.4-2.4835 GHz frequency band with IEEE 802.15.4 baseband.

6.11.1: Features :
Range - Outdoor line of sight: up to 50kms with directional antenna. Transmit Power: up to 1 watt / 30 dBm nominal. Receiver Sensitivity: up to 107 dBm. AT Command Modes for configuring Module Parameters Direct sequence spread spectrum technology. Analog to digital conversion and digital I/O line support.

TarangNet Features: Acknowledgement mode communication with retries


Each direct sequence channel has 64K unique network addresses. Source / destination addressing.

Uncast and broadcast communication.


Point to point, point to multi point and peer-to-peer topologies are possible.

TarangMesh Features: Mesh Networking

You might also like