Project_work.doc (1)

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 107

Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 1

INTRODUCTION

The past several years have witnessed a rapid growth of wireless networking. Wireless
technologies are used to rapidly exchange images, data, audio, and other information
between remote locations. However, up to now wireless networking has been mainly
focused on high-speed communications, and relatively long range applications such as the
IEEE 802.11 Wireless Local Area Network (WLAN) standards. The first well known
standard focusing on Low-Rate Wireless Personal Area Networks (LR-WPAN) was
Bluetooth. However it has limited capacity for networking of many nodes. There are
many wireless monitoring and control applications in industrial and home environments
which require longer battery life, lower data rates and less complexity than those from
existing standards. For such wireless applications, a new standard called IEEE 802.15.4
has been developed by IEEE. The new standard is also called ZigBee, when additional
stack layers defined by the ZigBee Alliance are used. When deploying sensor networks,
the choice of communication protocol depends on the context in which the network is
used. The ZigBee protocol is designed for sensor networks used to control home lighting,
security systems, building automation, etc. These technologies are currently being applied
to improve healthcare around the world. For implementing a health monitoring system,
first of all, devices that measure patient's physiological signal should be needed. The
mobile system such as PDA receives physiological data from wearable sensor devices.
One user's health monitoring system has a few ZigBee devices to measure one user's
physiological data. Even if there are a lot of ZigBee devices nearby, the communication
should be accepted between only one user's ZigBee devices. So, the access control should
be implemented because there can be a lot of ZigBee devices nearby. In the device access
control mechanism, the physiological data must not be lost but a wireless communication
can lose a data. So,the reliable data transmission not to lose a physiological data in zigbee
based health monitoring system is proposed. with rapid improvements in medical
research, more and more health sensors have been developed to assist medical doctors in
monitoring their patients conditions. These sensors getting smaller, making it possible for
the sensors to be worn or to be implanted into the human body. Hence there may come a
day when governments require every citizen to wear a sensor to track their condition for

Dept. of PG Studies, VTU, Belgaum 1


Reliable Data Transmission in ZigBee Based Health Monitoring System

proactive healthcare. The sensors worn by individuals can be interconnected through a


network for efficient multi-model monitoring. In the literature, Wireless Personal Area
Networks (WPAN), such as Bluetooth and Zigbee have been proposed for connecting the
various health sensors.

1.1 Goal
The goal of this project is to develop a health monitoring system using ZigBee wireless
technology. This includes implementation of the ZigBee communication. To evaluate the
new standard, a literature study must be performed. A test application will also be
developed, in order to test the functionality of the ZigBee modules.

1.2 Motivation
Heart attack has become one of the number one killers in the world. However, if help is
given within 10minutes of an attack occurring, there is a chance that heart attack will not
cause death. We envisage a system that is integrated with a heart beat monitor. We study
the use of ZigBee WPANs for real time heart beat monitoring.

1.3 Existing Techniques


Currently most hospitals use ECG (Electrocardiography ) for monitoring heart rate but
do not have remote monitoring system. This project proposes a solution to upgrade
existing health monitoring systems in hospitals by providing remote monitoring
capability.

In this thesis we will study the ZigBee protocol and implement reliable data transmission
of patients physiological data measured by bio-sensors using ZigBee modules.

Dept. of PG Studies, VTU, Belgaum 2


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 2

LITERATURE SURVEY

The brief explanation of the Literature survey has mentioned in this section.

Key Contributions
David Cypher, Nicolas Chevrollier, Nicolas Montavont, and Nada Golmie, National
Institute of Standards and Technology proposed “Prevailing over Wires in Healthcare
Environments: Benefits and Challenges”

The objective of this article is to survey the benefits and challenges posed by the
deployment and operation of wireless communications in support of healthcare networks.
While the main advantage of wireless communications remains to provide ubiquitous
connectivity, thus allowing greater physical mobility and interoperability, a number of
engineering issues need to be addressed before this vision is realized. Their intent in this
article is to explore some of these issues, including deployment, interference, and
mobility, and provide insights for potential solutions. The reliance on network
technologies in healthcare and clinical environments for monitoring, diagnosis, surgery,
and treatment stresses the need for universal and wireless network interfaces that provide
reliable connectivity and untethered access to information. Since designing wireless
technologies from scratch in order to satisfy the needs of the healthcare industry may not
be a viable or economical option, the group is focusing instead on evaluating the
suitability of currently available and emerging technologies developed by the IEEE 802
Local Area Network/Metro Area Network standards organization. Part of this evaluation
work consists of matching medical device application requirements with the appropriate
wireless technology. While reliable connectivity constitutes a requirement for all
healthcare applications, additional constraints imposed on the timeliness and the
criticality of information delivery, such as bandwidth, delay, and loss, depend on the
specifics of the application considered.

E. Jovanov, A. Milenkovic, C. Otto, P. De Groen, B. Johnson, S. Warren and G. Taibi


presented “A WBAN System for Ambulatory Monitoring of Physical Activity and Health
Status: Applications and Challenges”

Dept. of PG Studies, VTU, Belgaum 3


Reliable Data Transmission in ZigBee Based Health Monitoring System

Recent technological advances in sensors, low power integrated circuits, and wireless
communications have enabled the design of low-cost, miniature, lightweight, intelligent
physiological sensor platforms that can be seamlessly integrated into a body area network
for health monitoring. Wireless body area networks (WBANs) promise unobtrusive
ambulatory health monitoring for extended periods of time and near real-time updates of
patients’ medical records through the Internet. A number of innovative systems for health
monitoring have recently been proposed. However, they typically rely on custom
communication protocols and hardware designs, lacking generality and flexibility. The
lack of standard platforms, system software support, and standards makes these systems
expensive. Bulky sensors, high price, and frequent battery changes are all likely to limit
user compliance. To address some of these challenges, they prototyped a WBAN utilizing
a common off-the-shelf wireless sensor platform with a ZigBee-compliant radio interface
and an ultra low-power microcontroller. The standard platform interfaces to custom
sensor boards that are equipped with accelerometers for motion monitoring and a bio-
amplifier for electrocardiogram or lectromyogram monitoring. Software modules for on-
board processing, communication, and network synchronization have been developed
using the TinyOS operating system. Although the initial WBAN prototype targets
ambulatory monitoring of user activity, the developed sensors can easily be adapted to
monitor other physiological parameters. In this paper, they discuss initial results,
implementation challenges, and the need for standardization in this dynamic and
promising research field. Wireless body area networks (WBANs) signify emerging
technology with the potential to revolutionize health care by allowing unobtrusive health
monitoring for extended periods of time.

In this paper, they present initial system development and integration experiences. They
also discuss major implementation issues and possible applications.

Emil Jovanov proposed “Wireless Technology and System Integration in Body Area
Networks for m-Health Applications”

m-Health integrates mobile computing, medical sensor, and communications technologies


for mobile health-care applications. Wireless Body Area Networks (WBANs) of
intelligent sensors represent an emerging technology for system integration with great
potentials for unobtrusive ambulatory health monitoring during extended periods of time.
However, system designers will have to resolve a number of issues, such as severe

Dept. of PG Studies, VTU, Belgaum 4


Reliable Data Transmission in ZigBee Based Health Monitoring System

limitations of sensor weight and size necessary to improve user’s compliance, sensor
resource constraints, intermittent availability of uplink connectivity, and reliability of
transmission, security, and interoperability of different platforms. They present current
and emerging wireless technologies and developments in pervasive and mobile
technologies that are vital for implementation of WBAN-based monitors and m-Health
system integration. They emphasize the problem of reliable system operation with
extremely low power consumption and discontinuous connectivity, which are typical for
ambulatory monitoring. The emerging m-Health concept represents the evolution of e-
health systems loosely defined as the use of the Internet for healthcare to mobile
applications without guaranteed Internet connectivity.

The advances in m-Health systems are driven by the developments in wireless


communications, pervasive, and wearable technologies. They share the same ultimate
design goals: minimization of weight and size of sensors that are critical for user’s
acceptance, portability, unobtrusiveness, ubiquitous connectivity, reliability, and seamless
system integration. Global connectivity is important for improved handling of emergency
situation, but also for an increasingly important user segment informal caregivers. A 1997
study found that almost one third of US adults, most of whom held full-time jobs, were
serving as informal caregivers – mostly to an elderly parent. A wearable health-
monitoring device using a Personal Area Network or Body Area Network can be
integrated into a user’s clothing. This system organization, however, is unsuitable for
lengthy, continuous monitoring, particularly during normal activity, such as intensive
training or computer-assisted rehabilitation. The most recent phase that provides patient
mobility and unobstructed use came with the introduction of wireless, intelligent, and
implantable sensors. A typical Wireless Body Area Network (WBAN) consists of a
number of inexpensive, lightweight, and miniature sensor platforms, each featuring one or
more physiological sensors, e.g. motion sensors, electrocardiograms (ECGs),
electromyograms (EMGs), and electro-encephalograms (EEGs). Typical example of this
type of application is ambulatory monitoring of user’s activity. The sensors could be
located on the body as tiny intelligent patches, integrated into clothing, or implanted
below the skin or muscles. In this paper they present main issues and technical challenges
of design and system integration of WBAN based m-Health systems.

Dept. of PG Studies, VTU, Belgaum 5


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 3

ZIGBEE

The concept of Zigbee is associated with controlling all electronic deceives and
communicating with them self in the surrounding by using simple our mobile or PC by
using this latest wireless technology. It is a specification for a suite of high level
communication protocols using small, low-power digital radios based on the IEEE
802.15.4-2003standard for wireless personal area networks (WPANs), such as wireless
headphones connecting with cell phones via short-range radio. The technology defined by
the ZigBee specification is intended to be simpler and less expensive than other WPANs,
such as Bluetooth. ZigBee is targeted at radio-frequency (RF) applications that require a
low data rate, long battery life, and secure networking. The ZigBee Alliance is a group of
companies that maintain and publish the ZigBee standard.

3.1 IEEE 802.15.4


The goal IEEE had when they specified the IEEE 802.15.4 standard was to provide a
standard for ultra-low complexity, ultra-low cost, ultra-low power consumption and low
data rate wireless connectivity among inexpensive devices. The raw data rate will be high
enough (maximum of 250 kb/s) for applications like sensors, alarms and toys.

3.1.1 Components of IEEE 802.15.4

IEEE 802.15.4 networks use three types of devices:

 The network Coordinator maintains overall network knowledge. It is the most


sophisticated one of the three types, and requires the most memory and computing
power.

 The Full Function Device (FFD) supports all IEEE 802.15.4 functions and features
specified by the standard. It can function as a network coordinator. Additional
memory and computing power make it ideal for network router functions or it could
be used in network-edge devices (where the network touches the real world).
 The Reduced Function Device (RFD) carries limited (as specified by the standard)
functionality to lower cost and complexity. It is generally found in network-edge

Dept. of PG Studies, VTU, Belgaum 6


Reliable Data Transmission in ZigBee Based Health Monitoring System

devices. The RFD can be used where extremely low power consumption is a
necessity.

3.1.2 Network Topologies

IEEE 802.15.4 can manage two types of networks, i.e., star topology or the peer-to peer
topology. Both the topologies are illustrated in Figure 2.1. In ZigBee, these two
topologies can be combined to build so-called mesh networks.

Figure 3.1 Network Topologies

3.1.3 Star Network Formation

The first FFD that is activated may establish its own network and become a Personal Area
Network (PAN) coordinator. Then both FFD and RFD devices can connect to the PAN
coordinator. All networks within the radio sphere of influence must have a unique PAN
identity. All nodes in a PAN must talk to the PAN Coordinator.

3.1.4 Peer-to-Peer Network Formation

In the peer-to-peer topology there is also a PAN coordinator, but it differs from the star
topology in that any device can communicate with any other device as long as they are in
the range of one another. The peer-to-peer topology allows more complex network
formations to be implemented, such as the mesh topology.

Dept. of PG Studies, VTU, Belgaum 7


Reliable Data Transmission in ZigBee Based Health Monitoring System

3.2 What is Zigbee


ZigBee is a home-area network designed specifically to replace the proliferation of
individual remote controls. ZigBee was created to satisfy the market's need for a cost-
effective, standards-based wireless network that supports low data rates, low power
consumption, security, and reliability. To address this need, the ZigBee Alliance, an
industry-working group is developing standardized application software on top of the
IEEE 802.15.4 wireless standard. The alliance is working closely with the IEEE to ensure
an integrated, complete, and interoperable network for the market. For example, the
working group will provide interoperability certification testing of 802.15.4 systems that
include the ZigBee software layer. The standard itself is regulated by a group known as
the ZigBee Alliance, with over 150 members world wide. It will also serve as the official
test and certification group for ZigBee devices.

While Bluetooth focuses on connectivity between large packet user devices, such as
laptops, phones, and major peripherals, ZigBee is designed to provide highly efficient
connectivity between small packet devices. As a result of its simplified operations, which
are one to two full orders of magnitude less complex than a comparable Bluetooth device,
pricing for ZigBee devices is extremely competitive, with full nodes available for a
fraction of the cost of a Bluetooth node.

ZigBee devices are actively limited to a through-rate of 250Kbps, compared to


Bluetooth's much larger pipeline of 1Mbps, operating on the 2.4 GHz ISM band, which is
available throughout most of the world.

ZigBee has been developed to meet the growing demand for capable wireless networking
between numerous low-power devices. In industry ZigBee is being used for next
generation automated manufacturing, with small transmitters in every device on the floor,
allowing for communication between devices to a central computer. This new level of
communication permits finely-tuned remote monitoring and manipulation. In the
consumer market ZigBee is being explored for everything from linking low-power
household devices such as smoke alarms to a central housing control unit, to centralized
light controls.

The specified maximum range of operation for ZigBee devices is 250 feet (76m),
substantially further than that used by Bluetooth capable devices, although security
concerns raised over "sniping" Bluetooth devices remotely, may prove to hold true for
ZigBee devices as well.

Dept. of PG Studies, VTU, Belgaum 8


Reliable Data Transmission in ZigBee Based Health Monitoring System

Due to its low power output, ZigBee devices can sustain themselves on a small battery for
many months, or even years, making them ideal for install-and-forget purposes, such as
most small household systems. Predictions of ZigBee installation for the future, most
based on the explosive use of ZigBee in automated household tasks in China, look to a
near future when upwards of sixty ZigBee devices may be found in an average American
home, all communicating with one another freely and regulating common tasks
seamlessly. ZigBee is the only standards-based technology that addresses the needs of
most remote monitoring and control and sensory network application.

3.3 Origins of ZigBee Name


Articles published by technology news organizations such as EDN
and Telecommunications Online claim that the term "ZigBee" originates from the zig-
zag waggle dance honeybees use to share critical information, such as the location,
distance, and direction of a newly discovered food source, with fellow hive members.
This is evocative of the invisible webs of connections existing in a fully wireless
environment. ZigBee device manufacturer Meshnetics refers to this communication
system as the "ZigBee Principle". However, no such term exists in apiology, the scientific
study of honeybees. Robert Metcalfe, inventor of Ethernet and a contributor on the initial
development of ZigBee, confirmed to a journalist in 2004 that the name was initially
meaningless and had been chosen from a long list on the basis that it had no trademark
liabilities.

3.4 Why is ZigBee Needed?


There are a multitude of standards like Bluetooth and WiFi that address mid to high data
rates for voice, PC LANs, video, etc. However, up till now there hasn't been a wireless
network standard that meets the unique needs of sensors and control devices. Sensors and
controls don't need high bandwidth but they do need low latency and very low energy
consumption for long battery lives and for large device arrays.

There are a multitude of proprietary wireless systems manufactured today to solve a


multitude of problems that don't require high data rates but do require low cost and very
low current drain. These proprietary systems were designed because there were no
standards that met their application requirements. These legacy systems are creating
significant interoperability problems with each other and with newer technologies.

Dept. of PG Studies, VTU, Belgaum 9


Reliable Data Transmission in ZigBee Based Health Monitoring System

Although ZigBee's underlying radio communication technology isn't revolutionary, it


goes well beyond single-purpose wireless devices such as garage door openers. It allows
wireless two-way communications between lights and switches, thermostats and furnaces,
hotel-room air-conditioners and the front desk. It travels across greater distances and
handles many sensors that can be linked to perform different tasks

The ZigBee Alliance is not pushing a technology; rather it is providing a standardized


base set of solutions for sensor and control systems.

 The physical layer was designed to accommodate the need for a low cost yet allowing
for high levels of integration. The use of direct sequence allows the analog circuitry
to be very simple and very tolerant towards inexpensive implementations.

 The media access control (MAC) layer was designed to allow multiple topologies
without complexity. The power management operation doesn't require multiple
modes of operation. The MAC allows a reduced functionality device (RFD) that
needn't have flash nor large amounts of ROM or RAM. The MAC was designed to
handle large numbers of devices without requiring them to be "parked".
 The network layer has been designed to allow the network to spatially grow without
requiring high power transmitters. The network layer also can handle large amounts
of nodes with relatively low latencies.
 ZigBee is poised to become the global control/sensor network standard. It has been
designed to provide the following features:

 Low power consumption, simply implemented

 Users expect batteries to last many months to years! Consider that a typical single
family house has about 6 smoke/CO detectors. If the batteries for each one only
lasted six months, the home owner would be replacing batteries every month!

 In contrast to Bluetooth, which has many different modes and states depending upon
your latency and power requirements, ZigBee/IEEE 802.15.4 has two major states:
active (transmit/receive) or sleep. The application software needs to focus on the
application, not on which power mode is optimum for each aspect of operation.

 Even mains powered equipment needs to be conscious of energy. ZigBee devices will
be more ecological than their predecessors saving megawatts at it full deployment.
Consider a future home that has 100 wireless control/sensor devices,

Dept. of PG Studies, VTU, Belgaum 10


Reliable Data Transmission in ZigBee Based Health Monitoring System

 Case 1: 802.11 Rx power is 667 mW (always on)@ 100 devices/home & 50,000
homes/city = 3.33 megawatts

 Case 2: 802.15.4 Rx power is 30 mW (always on)@ 100 devices/home & 50,000


homes/city = 150 kilowatts

 Case 3: 802.15.4 power cycled at .1% (typical duty cycle) = 150 watts

 Low cost to the users means low device cost, low installation cost and low
maintenance.

 ZigBee devices allow batteries to last up to years using primary cells (low cost)
without any chargers (low cost and easy installation). ZigBee's simplicity allows
for inherent configuration and redundancy of network devices provides low
maintenance.

 High density of nodes per network

 ZigBee's use of the IEEE 802.15.4 PHY and MAC allows networks to handle any
number of devices. This attribute is critical for massive sensor arrays and control
networks.

 Simple protocol, global implementation

 ZigBee's protocol code stack is estimated to be about 1/4th of Bluetooth's or


802.11's. Simplicity is essential to cost, interoperability, and maintenance. The
IEEE 802.15.4 PHY adopted by ZigBee has been designed for the 868 MHz band
in Europe, the 915 MHz band in N America, Australia, etc; and the 2.4 GHz band
is now recognized to be a global band accepted in almost all countries.

3.5 History
ZigBee-style networks began to be conceived about 1998, when many installers realized
that both WiFi and Bluetooth were going to be unsuitable for many applications. In
particular, many engineers saw a need for self-organizing ad-hoc digital radio networks.

 The IEEE 802.15.4 standard was completed in May 2003.


 In the summer of 2003, Philips Semiconductors, a major mesh network supporter,
ceased the investment. Philips Lighting has, however, continued Philips'
participation, and Philips remains a promoter member on the ZigBee Alliance
Board of Directors.

Dept. of PG Studies, VTU, Belgaum 11


Reliable Data Transmission in ZigBee Based Health Monitoring System

 The ZigBee Alliance announced in October 2004 that the membership had more
than doubled in the preceding year and had grown to more than 100 member
companies, in 22 countries. By April 2005 membership had grown to more than
150 companies, and by December 2005 membership had passed 200 companies.

 The ZigBee specifications were ratified on 14 December 2004.


 The ZigBee Alliance announces public availability of Specification 1.0 on 13 June
2005, known as ZigBee 2004 Specification.

 The ZigBee Alliance announces the completion and immediate member


availability of the enhanced version of the ZigBee Standard in September 2006,
known as ZigBee 2006 Specification.

 During the last quarter of 2007, ZigBee PRO, the enhanced ZigBee specification
was finalized.

3.6 Zig Bee Alliance


The ZigBee Alliance is an association of companies working together to define an open
global standard for making low-power wireless networks. The intended outcome of
ZigBee Alliance is to create a specification defining how to build different network
topologies with data security features and interoperable application profiles. The
association includes companies from a wide spectrum of categories, from chip
manufactures to system integration companies. A big challenge for the alliance is to make
the interoperability to work among different products. To solve this problem, the ZigBee
Alliance has defined different profiles, depending on what type of category the product
belongs to. For example there is an profile called Home Lightning that exactly defines
how different brands of home lightning-products should communicate with each
other.To get access to the specification one must become a member of the ZigBee
Alliance, but it became public later in the year 2005.Currently there are three different
types of ZigBee profiles:

 Private profile

 Interoperability NOT important. No ZigBee stamp on the product, but one can
claim "based on a ZigBee platform"

 Published profile

Dept. of PG Studies, VTU, Belgaum 12


Reliable Data Transmission in ZigBee Based Health Monitoring System

 A private profile is shared with others. No ZigBee stamp on the product, but one
can claim "based on a ZigBee platform"

 Public profile
 The official ZigBee profile.

3.7 Technology for WPAN


ZigBee-compliant products operate in unlicensed bands worldwide, including global
standard i.e. 2.4GHz, American and European standards. Raw data throughput rates of
250Kbps can be achieved at 2.4GHz (16 channels), 40Kbps at 915MHz (10 channels),
and 20Kbps at 868MHz (1 channel). The transmission distance is expected to range from
10 to 75m, depending on power output and environmental characteristics. Like Wi-Fi, it
uses direct-sequence spread spectrum in the 2.4GHz band, with offset- quadrature phase-
shift keying modulation. Channel width is 2MHz with 5MHz channel spacing. The 868
and 900MHz bands also use direct-sequence spread spectrum but with binary-phase-shift
keying modulation.ZigBee is broadly categorized as a low rate WPAN, and its closest
technology is Bluetooth. These are two different technologies with very different areas of
application and different means of designing for those applications. While Zigbee is
focused on control and automation, Bluetooth is focused on connectivity between laptops,
PDA’s replacing general cable. ZigBee uses low data rate, low power consumption, and
works with small packet devices; in contrast, Bluetooth uses a higher data rate, higher
power consumption, and works with large packet devices. ZigBee networks can support a
larger number of devices and a longer range between devices than that of Bluetooth. In
timing critical applications, ZigBee is designed to respond quickly, while Bluetooth takes
much longer and could be detrimental to the application.Zigbee works well because it
aims low. Controls and sensors don't need to send and receive much data so it has been
designed to transmit a bit slowly. It has a data rate of 250kbps, pitiful compared with Wi-
Fi, which is hitting throughput of 20Mbps or more. But because ZigBee transmits slowly,
it doesn't need much power, so batteries will last up to 10 years. Because it consumes
very little power, a sensor and transmitter that reports whether a door is open or closed,
for example, can run for up to five years on a single double-A battery. Also, operators are
much happier about adding ZigBee to their phones than faster technologies such as Wi-
Fi; therefore, the phone will be able to act as a remote control for all the ZigBee devices it
encounters.

Dept. of PG Studies, VTU, Belgaum 13


Reliable Data Transmission in ZigBee Based Health Monitoring System

3.8 ZIGBEE Characteristics


The focus of network applications under the IEEE802.15.4 / ZigBee standard include the
features of low power consumption, needed for only two major modes (Tx/Rx or Sleep),
high density of nodes per network, low costs and simple implementation.These features
are enabled by the following characteristics.

 2.4GHz and 868/915 MHz dual PHY modes.

This represents three license-free bands: 2.4-2.4835 GHz, 868-870 MHz and 902-928
MHz. The number of channels allotted to each frequency band is fixed at sixteen
(numbered 11-26), one(numbered 0) and ten (numbered 1-10) respectively. The higher
frequency band is applicable worldwide, and the lower band in the areas of North
America, Europe, Australia and New Zealand.

 Low power consumption, with battery life ranging from months to years. Considering
the number of devices with remotes in use at present, it is easy to see that more
numbers of batteries need to be provisioned every so often, entailing regular (as well
as timely), recurring expenditure. In the ZigBee standard, longer battery life is
achievable by either of two means: continuous network connection and slow but sure
battery drain, or intermittent connection and even slower battery drain.

 Maximum data rates allowed for each of these frequency bands are fixed as 250 kbps
@2.4 GHz,40 kbps @ 915 MHz, and 20 kbps @868 MHz.

 High throughput and low latency for low dutycycle applications (<0.1%)

 Channel access using Carrier Sense Multiple Access with Collision Avoidance
(CSMA - CA)

 Addressing space of up to 64 bit IEEE address devices, 65,535 networks

 50m typical range

 Fully reliable “hand-shaked” data transfer protocol.

 Different topologies as illustrated below: star,peer-to-peer, mesh.

Dept. of PG Studies, VTU, Belgaum 14


Reliable Data Transmission in ZigBee Based Health Monitoring System

Figure 3.2 ZigBee Topologies

3.9 OSI Overview


The Open System Interconnection (OSI) reference model, was developed by the
International Organization for Standardization (ISO) as a model for the computer protocol
architecture, and as a framework for developing protocol standards. The entire point of
the model is to separate networking into several distinct functions that operate at different
levels. Each layer is responsible for performing a specific task or set of tasks, and dealing
with the layers above and below it. An illustration of the general OSI-model and where
ZigBee is defined in the model can be seen in Figure 3.3.

Figure 3.3 OSI model

Dept. of PG Studies, VTU, Belgaum 15


Reliable Data Transmission in ZigBee Based Health Monitoring System

3.9.1 Physical Layer

The IEEE 802.15.4 specification defines three different frequency bands, in order to
conform with regulations in Europe, Japan, Canada and the United States. Table
2.1describes the frequency bands and data rates. Totally 27 channels are available across
the different frequency bands, as described in Table 2.2.

Frequency Bit Symbol


PHY Chip rate
band Modulation rate rate Symbols
(MHz) (kchips/s)
(MHz) (kb/s) (ksymbol/s)
868 868-868.6 300 BPSK 20 20 Binary
915 902-928 600 BPSK 40 40 Binary
2450 2400-2483.5 2000 O-QPSK 250 62.5 16-ary
Orthogonal

Table 3.1 Frequency bands and Data rates

Number of Channel Channel


Center frequency channels center frequency
(MHz) (N) (k)
(MHz)
868 1 0 868.3
915 10 1-10 906+2(k-1)
2450 16 11-26 2405+5(k-11)

Table 3.2 Channels and how to calculate them

Modulation / Spreading

The conversion of the binary data to a modulated signal in the 2450 MHz frequency band
can be described as the functional block diagram in Figure 2.3. The numbers show how
the binary data "0000b" is converted to a baseband chip sequence with pulse shaping.

Figure 3.4 Modulation and Spreading

Dept. of PG Studies, VTU, Belgaum 16


Reliable Data Transmission in ZigBee Based Health Monitoring System

Bit to Symbol

The first step is to encode all the data in the PHY Protocol Data Unit (PPDU) from binary
data to symbols. Each byte is divided into two symbols and the least significant symbol is
transmitted first. For multi-byte fields, the least significant byte is transmitted first, except
for security related fields where the most significant byte is transmitted first. Symbol to
chip. Each data symbol is mapped into a Pseudo-random (PN) 32-chip sequence. The
chip sequence is then transmitted at 2 MChip/s with the least significant chip (c 0)
transmitted first for each symbol. Table 2.3 shows the data symbol with corresponding
chip values.

Data symbol Chip values


(decimal) (C0 C1... C30 C31)
0 1101100111000011010100100010111
0
1 1110110110011100001101010010001
0
2 0010111011011001110000110101001
0
3 0010001011101101100111000011010
1
4 0101001000101110110110011100001
1
5 0011010100100010111011011001110
0
6 1100001101010010001011101101100
1
7 1001110000110101001000101110110
1
8 1000110010010110000001110111101
1
9 1011100011001001011000000111011
1
10 0111101110001100100101100000011
1
11 0111011110111000110010010110000
0
12 0000011101111011100011001001011
0
13 0110000001110111101110001100100
1

Dept. of PG Studies, VTU, Belgaum 17


Reliable Data Transmission in ZigBee Based Health Monitoring System

14 1001011000000111011110111000110
0
15 1100100101100000011101111011100
0

Table 3.3 Symbol to Chip Mapping

O-QPSK Modulation

The modulation format is Offset - Quadrature Phase Shift Keying (O-QPSK) with half-
sine pulse shaping, equivalent to Minimum Shift Keying (MSK). QPSK is an efficient
way to use the often limited bandwidth. Each signal element represents two bits, the
equation below shows how the O-QPSK can be expressed. By using Offset, phase
changes in the combined signal never exceeds 900. In the case using QPSK the maximum
phase change is 1800. O-QPSK provides a greater performance than QPSK when the
transmission channel has components with significant nonlinearity.

(3.1)

where fc is the center frequency and Tc is the time that Q is delayed to get the 90 0 phase
change. Equation 2.1 describes the O-QPSK modulated signal,  is the in-phase carrier
and Q the quadrature-phase carrier.

The use of half-sine pulse shaping eliminates any amplitude variation and turns the O-
QPSK into a constant envelope modulation. Equation 2.2 describes the half sine pulse
shaping.

(3.2)

Error-Vector Magnitude
The modulation accuracy of an IEEE 802.15.4 transmitter is determined with an Error
Vector Magnitude (EVM) measurement, see Figure 3.5. EVM is the scalar distance
between the two phasor end points representing the ideal and the actual measured chip

Dept. of PG Studies, VTU, Belgaum 18


Reliable Data Transmission in ZigBee Based Health Monitoring System

positions. Expressed in another way, it is the residual noise version of the signal and
distortion remaining after an ideal version of the signal has been stripped away.

Figure 3.5 Error Vector of OSI

(3.3)

The EVM for IEEE 802.15.4 is defined as shown in Equation 2.4.

(3.4)

where S is the
magnitude of the vector to the ideal constellation point, (j ,Qj) is the
error vector. The transmitter shall have EVM values of less than 35% when measured
with 1000 chips.

Transmit Power

The transmitter should be capable of transmitting at least -3 dBm. The device should
transmit as low power as possible to reduce interference to other devices and systems.
The definition of dBm is shown in Equation 3.5.

(3.5)

Dept. of PG Studies, VTU, Belgaum 19


Reliable Data Transmission in ZigBee Based Health Monitoring System

Note the following relationships:

0dBm = 1mW (3.6)


+30dBm = 0dBW (3.7)
0dBm = −30dBW (3.8)

Receiver Sensitivity

The receiver sensitivity is defined by two terms. One is Packet Error Rate (PER) which is
the average fraction of transmitted packets that are not detected correctly. The other term
is the threshold input signal power that yields a specified PER. In IEEE 802.15.4 a
compliant device shall have a sensitivity of -85 dBm or better.
Receiver ED

The receiver Energy Detection (ED) is intended to be used by the network layer as part of
a channel selection algorithm. It is an estimate of the received signal power within the
bandwidth of an IEEE 802.15.4 channel. No attempt is made to identify or decode signals
on the channel. The ED time shall be equal to 8 symbol periods.

LQI
The Link Quality Indication (LQI) is a characterization of the strength and/or quality of a
received packet. The measurement may be implemented using receiver ED, a Signal to
Noise Ratio (SNR) estimation, or a combination of these methods. The use of the LQI
result by the network or application layer is not part of the IEEE 802.15.4 standard.

CCA

Clear Channel Assessment (CCA) is used to decide whether the channel is busy or idle
and one of the following methods must be supported.

 CCA Mode 1: Energy above threshold. CCA shall report a busy medium upon
detecting any energy above the ED threshold.

Dept. of PG Studies, VTU, Belgaum 20


Reliable Data Transmission in ZigBee Based Health Monitoring System

 CCA Mode 2: Carrier sense only. CCA shall report a busy medium only upon the
detection of a signal with the modulation and spreading characteristics of IEEE
802.15.4. This signal may be above or below the ED threshold.

 CCA Mode 3: Carrier sense with energy above threshold. CCA shall report a busy
medium only upon the detection of a signal with the modulation and spreading
characteristics of IEEE 802.15.4 with energy above the ED threshold.

A busy channel shall be indicated by the Physical Layer Management Entity Confirm
(PLME-CCA.confirm) primitive with a status of BUSY. A clear channel shall be
indicated by the PLME-CCA.confirm primitive with a status of IDLE.

3.9.2 Medium Access Control Layer

The Medium Access Control (MAC) layer handles the network association and
disassociation and has an optional super frame structure with beacons for time
synchronization and a Guaranteed Time Slot (GTS) mechanism for high priority
communications

3.10 Hardware
There are currently an increasing number of manufactures of IEEE 802.15.4 2.4 GHz
transceiver chips.

Output
Sensitivity Voltage
Manufacturer Chip IRX (mA) ITX (mA) Power
Rx (dBm) (Volts)
(dBm)
Chipcon CC2420 19.7 17.4 -94 0 2.1-3.6
Ember EM2420 19.7 17.4 -94 0 2.1-3.6
Freescale MC13191 37 30 -91 3.6 2-2.4
Freescale MC13192 37 30 -92 3.6 2.-3.4
Freescale MC13193 37 30 -92 3.6 2.-3.4
CompXs CX1540 57 56 -90 3 2.7-3.3
Ubec uz2400 x x -93 0 x

Table 3.4 Short Comparison of the 2.4 GHz Transceiver Chips

The table does not show if the chip has extra features, such as an built-in ZigBee stack,
ADC or DAC.

3.11 Security

Dept. of PG Studies, VTU, Belgaum 21


Reliable Data Transmission in ZigBee Based Health Monitoring System

There are three types of security modes defined: unsecured mode, access control list and
secured mode.

3.11.1 Unsecured Mode


No security used.

3.11.2 Access Control List


No encryption used, but the network rejects frames from unknown devices.

3.11.3 Secured Mode


In the secured mode the devices can use the following security services.

 Access control list.


 Data encryption using the Advanced Encryption Standard (AES) 128 bit encryption
algorithm.
 Frame integrity is a security service that uses a Message Integrity Code (MIC) to
protect data from being modified by parties without the cryptographic key. It further
provides assurance that data come from a party with the cryptographic key.
 Sequential freshness is a security service that uses an ordered sequence of inputs to
reject frames that have been replayed. When a frame is received, the freshness value
is compared with the last known freshness value.

3.12 ZigBee Stack Architecture


ZigBee stack architecture follows the standard Open Systems Interconnection (OSI)
reference model; ZigBee's protocol stack is structured in layers. The first two layers,
physical (PHY) and media access (MAC), are defined by the IEEE 802.15.4 standard.
The layers above them are defined by the ZigBee Alliance.The ZigBee stack architecture
is shown below.

Dept. of PG Studies, VTU, Belgaum 22


Reliable Data Transmission in ZigBee Based Health Monitoring System

Figure 3.6 The overall ZigBee protocol stack

Dept. of PG Studies, VTU, Belgaum 23


Reliable Data Transmission in ZigBee Based Health Monitoring System

Fig 3.7 Detailed ZigBee stack Architecuture

The model has five layers namely -

1. Physical (PHY) layer


2. Media access control (MAC) layer
3. Network (NWK) and security layers
4. Application framework
5. Application profile

3.12.1 Physical Layer

The IEEE 802.15.4/Zigbee technology is specified with a wide range of low-power


features at physical (implementation-wise) and higher (operational) levels. The
operational power-saving features include low duty cycle operation together with strict
power management and low transmission overhead.The implementation of standard-
compliant radio-on-a-chip is mainly governed by the PHY specification. At the PHY
level, which is the main topic of this discussion, low power silicon devices can be
implemented by exploiting relatively low and controllable output power, constant-
envelope modulation, and relatively relaxed channel spacing and blocking requirements.
The main parameters of the IEEE 802.15.4 PHY are summarized in Table 1.

Parameter 2.4 GHz PHY 868/915 MHz PHY


Sensitivity @ 1% PER -85 dBm -92 dBm
Receiver Maximum Input Level -20 dBm
Adjacent Channel Rejection 0db
Alternate Channel Rejection 30 db
Output Power (Lowest Maximum) -3dBm
Transmit Modulation Accuracy EVM<35% for 1000 chips
Number of Channels 16 1/10
Channel Spacing 5 MHz Single-channel/2
MHz
Transmission Rates
Data Rate 250 kb/s 20/40 kb/s

Dept. of PG Studies, VTU, Belgaum 24


Reliable Data Transmission in ZigBee Based Health Monitoring System

Symbol Rate 62.5 ksymbol/s 20/40 ksymbol/s


Chip Rate 2 Mchip/s 300/600 kchip/s

Chip Modulation O-QPSK with half- BPSK with raised


since pulse shaping consine pulse
(MSK) shaping
RX-TX and TX-RX turnaround time 12 symbols

Table 3.5 IEEE 802.15.4 PHY parameters

The 2.4 GHz PHY of the IEEE 802.15.4 standard attracts a lot of focus from the wireless
industry because the globally available 2.4 GHz ISM band with the largest bandwidth
promotes world-wide market and flexibility of application designs. The technical
considerations in the following are specifically related to the 2.4 GHz PHY
implementation, but most of them are also valid for the 868/915 MHz PHY devices. The
modulation accuracy of an IEEE 802.15.4 transmitter is determined with an error vector
magnitude (EVM) measurement, which is graphically detailed in Figure 3.8.

Figure 3.8 Error Vector Magnitude

Dept. of PG Studies, VTU, Belgaum 25


Reliable Data Transmission in ZigBee Based Health Monitoring System

EVM is the scalar distance between the two phasor end points representing the ideal and
the actual measured chip positions. Expressed another way, it is the residual noise and
distortion remaining after an ideal version of the signal has been stripped away. The
offset-QPSK with half-sine pulse shaping modulation selected for the 2.4 GHz. PHY is
equivalent to minimum shift keying (MSK), which is a constant envelope modulation
scheme. This allows the use of simple,low-cost and relatively non-linear power amplifier
designs.

ZigBee-compliant products operate in unlicensed bands worldwide, including 2.4GHz


(global), 902 to 928MHz (Americas), and 868MHz (Europe). Raw data throughput rates
of 250Kbps can be achieved at 2.4GHz (16 channels), 40Kbps at 915MHz (10 channels),
and 20Kbps at 868MHz (1 channel). The transmission distance is expected to range from
10 to 75m,depending on power output and environmental characteristics. Like Wi-Fi,
Zigbee uses direct-sequence spread spectrum in the 2.4GHz band, with offset-quardrature
phase-shift keying modulation. Channel width is 2MHz with 5MHzchannel spacing. The
868 and 900MHz bands also use direct sequence spread spectrum but with binary-phase-
shift keying modulation.

Spreading Parameters Data Parameters


PHY Frequency Chip Bit
Symbol rate
(MHz) band (MHz) rate Modulation rate Symbols
(ksymbol/s)
(kchip/s) (kb/s)
868-868.6 300 BPSK 20 20 Binary
868/915
902-928 600 BPSK 40 40 Binary
868/915 20-bit PSSS
868-868.6 400 ASK 250 12.5
(optional)
902-928 1600 ASK 250 50 5-bit PSSS
16-ary
868/915 868-868.6 400 O-QPSK 100 25
orthogonal
(optional)
16-ary
902-928 1000 O-QPSK 250 62.5
orthogonal
16-ary
2450 2400-2483.5 2000 O-QPSK 250 62.5
orthogonal

Table 3.6 Frequency Bands and Data Rates

3.12.2 Media Access Control Layer

The media access control (MAC) layer was designed to allow multiple topologies without
complexity. The power management operation doesn't require multiple modes of
operation. The MAC allows a reduced functionality device (RFD) that needn't have flash

Dept. of PG Studies, VTU, Belgaum 26


Reliable Data Transmission in ZigBee Based Health Monitoring System

nor large amounts of ROM or RAM. The MAC was designed to handle large numbers of
devices without requiring them to be "parked".
Features
 Beacon Management
 Channel Access
 Guaranteed Time Slot (GTS ) management
 Frame Validation
 Acknowledged Frame Delivery
 Association / Dis-association with PAN coordinator

These features will be explained in Frame structure chapter.

3.12.3 Network Layer


The main functions of the network layer are to enable the correct use of the MAC sub-
layer and provide a suitable interface for use by the next upper layer, namely the
application layer. Its capabilities and structure are those typically associated to such
network layers, including routing.

On the one hand, the data entity creates and manages network layer data units from the
payload of the application layer and performs routing according to the current topology.
On the other hand, there is the layer control, which is used to handle configuration of new
devices and establish new networks: it can determine whether a neighboring device
belongs to the network and discovers new neighbors and routers. The control can also
detect the presence of a receiver, which allows direct communication and MAC
synchronization.

The routing protocol used by the Network layer is AODV(Ad hoc On-Demand Distance
Vector Routing ). In order to find the destination device, it broadcasts out a route request
to all of its neighbors. The neighbors then broadcast the request to their neighbors, etc
until the destination is reached. Once the destination is reached, it sends its route reply via
unicast transmission following the lowest cost path back to the source. Once the source
receives the reply, it will update its routing table for the destination address with the next
hop in the path and the path cost.

ZigBee's self-forming and self-healing mesh-network architecture lets data and control
messages pass from one node to another by multiple paths. This feature extends the

Dept. of PG Studies, VTU, Belgaum 27


Reliable Data Transmission in ZigBee Based Health Monitoring System

network range and improves data reliability. It may also be used to build large,
geographically dispersed networks with smaller networks linked to form a 'cluster-tree'
network. The NWK layer supports multiple network topologies including star, cluster
tree, and mesh, all of which are shown in Figure 3.9

Fig 3.9 Zigbee Network Topologies

In a star topology, one of the FFD-type devices assumes the role of network coordinator
and is responsible for initiating and maintaining the devices on the network. All other
devices, known as end devices, directly communicate with the coordinator. In a mesh
topology, the ZigBee coordinator is responsible for starting the network and for choosing
key network parameters, but the network may be extended through the use of ZigBee
routers. The routing algorithm uses a request-response protocol to eliminate suboptimal
routing. Ultimate network size can reach 264 nodes (more than we'll probably need).
Using local addressing, you can configure simple networks of more than 65,000 (216)
nodes, thereby reducing address overhead .

In summary,The responsibilities of the ZigBee NWK layer include:

 Starting a network: The ability to successfully establish a new network.


 Joining and leaving a network: The ability to gain membership (join) or relinquish
membership (leave) a network.
 Configuring a new device: The ability to sufficiently configure the stack for
operation as required.
 Addressing: The ability of a ZigBee coordinator to assign addresses to devices
joining the network.

Dept. of PG Studies, VTU, Belgaum 28


Reliable Data Transmission in ZigBee Based Health Monitoring System

 Synchronization within a network: The ability for a device to achieve


synchronization with another device either through tracking beacons or by polling.
 Security: applying security to outgoing frames and removing security to terminating
frames
 Routing: routing frames to their intended destinations.

3.12.4 Device Types (or) Node Types

The ZigBee standard has the capacity to address up to 65535 nodes in a single network.
However, there are only three general types of node:

 Coordinator
 End Device

 Router

These roles described below exist at the network level – a ZigBee node may also be
performing tasks at the application level independent of the role it plays in the network.
For instance, a network of ZigBee devices measuring temperature may have a
temperature sensor application in each node, irrespective of whether they are End
Devices, Routers or the Coordinator.

These node types are described below.

ZigBee coordinator(ZC) . The most capable device, the coordinator forms the root of
the network tree and might bridge to other networks. There is exactly one ZigBee
coordinator in each network since it is the device that started the network originally. It is
able to store information about the network, including acting as the Trust Centre &
repository for security keys.

All ZigBee networks must have one (and only one) Coordinator, irrespective of the
network topology.

In the Star topology, the Coordinator is the central node in the network.

 In the Tree and Mesh topologies, the Coordinator is the top (root) node in the
network.

Dept. of PG Studies, VTU, Belgaum 29


Reliable Data Transmission in ZigBee Based Health Monitoring System

 This is illustrated below, where the Coordinator is colour-coded in dark black.

Fig 3.10 Different Network Topologies

At the network level, the Coordinator is mainly needed at system initialization. The tasks
of the Coordinator at the network layer are:

 Selects the frequency channel to be used by the network (usually the one with the
least detected activity)
 Starts the network

 Allows other devices to connect to it (that is, to join the network)

The Coordinator can also provide message routing (for example, in a Star network),
security management and other services.

In some circumstances, the network will be able to operate normally if the Coordinator
fails or is switched off. This will not be the case if the Co-coordinator provides a routing
path through the network (for instance, in a Star topology, where it is needed to relay
messages). Similarly the Coordinator provides services at the Application layer and if
these services are being used (for example, Coordinator binding), the Coordinator must be
able to provide them at all times.

ZigBee Router (ZR): As well as running an application function a router can act as an
intermediate router, passing data from other devices.

Dept. of PG Studies, VTU, Belgaum 30


Reliable Data Transmission in ZigBee Based Health Monitoring System

Networks with Tree or Mesh topologies need at least one Router. The main tasks of a
Router are:

 Relays messages from one node to another


 Allows child nodes to connect to it

In a Star topology, these functions are handled by the Coordinator and, therefore, a Star
network does not need Routers. In Tree and Mesh topologies, Routers are located as
follows:

 In a Tree topology, Routers are normally located in network positions that allow
messages to be passed up and down the tree.
 In a Mesh topology, a Router can be located any where that a message passing
node is required.

However, in all topologies (Star, Tree and Mesh), Router devices can be located at the
extremities of the network, if they run applications that are needed in these locations - in
this case, the Router will not perform its message relay function, unless in a Mesh
network (see above).

ZigBee End Device (ZED): Contains just enough functionality to talk to the parent node
(either the coordinator or a router); it cannot relay data from other devices. This
relationship allows the node to be asleep a significant amount of the time thereby giving
long battery life. A ZED requires the least amount of memory, and therefore can be less
expensive to manufacture than a ZR or ZC.

End Devices are always located at the extremities of a network:

 In the Star topology, they are perimeter nodes


 In the Tree and Mesh topologies, they are leaf nodes

The main tasks of an End Device at the network level are sending and receiving
messages. Note that End Devices cannot relay messages and cannot allow other nodes to
connect to the network through them.

An End Device can often be battery-powered and, when not transmitting or receiving, can
sleep in order to conserve power.

Dept. of PG Studies, VTU, Belgaum 31


Reliable Data Transmission in ZigBee Based Health Monitoring System

3.12.5 ZigBee Network Model

Fig 3.11 ZigBee Network Model

The ZigBee Network Coordinator The ZigBee Network Node

 Sets up a network  Designed for battery powered or high


energy savings.

 Transmits network beacons  Searches for available networks

 Manages network nodes  Determines whether data is pending.

 Stores network node information  Transfers data from application.

 Routes messages between paired nodes  Can sleep for extended periods

 Typically operates in the receive state  Request data from network coordinator

Table 3.7 Zigbee Network Functionality

3.13 Application Layer


The application layer is the highest-level layer defined by the specification, and is the
effective interface of the ZigBee system to its end users. It comprises the majority of
components added by the ZigBee specification: both ZDO and its management

Dept. of PG Studies, VTU, Belgaum 32


Reliable Data Transmission in ZigBee Based Health Monitoring System

procedures, together with application objects defined by the manufacturer, are considered
part of this layer.

3.13.1 Main Components


The ZDO is responsible for defining the role of a device as either coordinator or end
device, as mentioned above, but also for the discovery of new (one-hop) devices on the
network and the identification of their offered services. It may then go on to establish
secure links with external devices and reply to binding requests accordingly.

The application support sublayer (APS) is the other main standard component of the
layer, and as such it offers a well-defined interface and control services. It works as a
bridge between the network layer and the other components of the application layer: it
keeps up-to-date binding tables in the form of a database, which can be used to find
appropriate devices depending on the services that are needed and those the different
devices offer. As the union between both specified layers, it also routes messages across
the layers of the protocol stack.

3.13.2 Communication Models

An application may consist of communicating objects which cooperate to carry out the
desired tasks. The focus of ZigBee is to distribute work among many different devices
which reside within individual ZigBee nodes which in turn form a network (said work
will typically be largely local to each device, for instance the control of each individual
household appliance).

The collections of objects that form the network communicate using the facilities
provided by APS, supervised by ZDO interfaces. The application layer data service
follows a typical request-confirm/indication-response structure. Within a single device,
up to 240 application objects can exist, numbered in the range 1-240. 0 is reserved for the
ZDO data interface and 255 for broadcast; the 241-254 range is not
currently in use but may be in the future.

Dept. of PG Studies, VTU, Belgaum 33


Reliable Data Transmission in ZigBee Based Health Monitoring System

Fig 3.12 Zigbee High-Level Communication Mode

There are two services available for application objects to use (in ZigBee 1.0):

i) the key-value pair service (KPV) is meant for configuration purposes. It enables
description, request and modification of object attributes through a simple
interface based on get/set and event primitives, some allowing a request for
response. Configuration uses compressed XML (full XML can be used) to provide
an adaptable and elegant solution.

ii) the message service is designed to offer a general approach to information


treatment, avoiding the necessity to adapt application protocols and potential
overhead incurred on by KPV. It allows arbitrary payloads to be transmitted over
APS frames.
iii) Addressing is also part of the application layer. A network node consists of an
802.15.4-conformant radio transceiver and one or more device descriptions
(basically collections of attributes which can be polled or set, or which can be
monitored through events). The transceiver is the base for addressing, and devices
within a node are specified by an endpoint identifier in the range 1-240.

3.13.3 Communication and Device Discovery


In order for applications to communicate, their comprising devices must use a common
application protocol (types of messages, formats and so on); these sets of conventions are
grouped in profiles. Furthermore, binding is decided upon by matching input and output
cluster identifiers, unique within the context of a given profile and associated to an
incoming our outgoing data flow in a device. Binding tables contain source and
destination pairs.

Dept. of PG Studies, VTU, Belgaum 34


Reliable Data Transmission in ZigBee Based Health Monitoring System

Depending on the available information, device discovery may follow different methods.
When the network address is known, the IEEE address can be requested using unicast
communication. When it is not, petitions are broadcast (the IEEE address being part of
the response payload). End devices will simply respond with the requested address, while
a network coordinator or a router will also send the addresses of all the devices associated
with it.

This extended discovery protocol permits external devices to find out about devices in a
network and the services that they offer, which endpoints can report when queried by the
discovering device (which has previously obtained their addresses). Matching services
can also be used.

The use of cluster identifiers enforces the binding of complementary entities by means of
the binding tables, which are maintained by ZigBee coordinators, as the table must be
always available within a network and coordinators are most likely to have a permanent
power supply; backups may be needed by some applications, whose higher-level layers
must manage. Binding requires an established communication link; after it exists, whether
to add a new node to the network is decided, according to the application and security
policies. Communication can happen right after the association. Direct addressing uses
both radio address and endpoint identifier, whereas indirect addressing requires every
relevant field (address, endpoint, cluster and attribute) and sends it to the network
coordinator, which maintains these associations and translates requests for
communication. Indirect addressing is particularly useful to keep some devices very
simple and minimize their need for storage. Besides these two methods, broadcast to all
endpoints in a device is available, and group addressing is used to communicate with
groups of endpoints belonging to a set of devices.

3.14 Security Services


As one of its defining features, ZigBee provides facilities for carrying out secure
communications, protecting establishment and transport of cryptographic keys, cyphering
frames and controlling devices. It builds on the basic security framework defined in IEEE
802.15.4. This part of the architecture relies on the correct management of symmetric
keys and the correct implementation of methods and security policies.

3.14.1 Basic Security Model

Dept. of PG Studies, VTU, Belgaum 35


Reliable Data Transmission in ZigBee Based Health Monitoring System

The basic mechanism to ensure confidentiality is the adequate protection of all keying
material. Trust must be assumed in the initial installation of the keys, as well as in the
processing of security information. In order for an implementation to globally work, its
general correctness (e.g., conformance to specified behaviors) is assumed.

Keys are the cornerstone of the security architecture; as such their protection is of
paramount importance, and keys are never supposed to be transported through an insecure
channel. There is a momentary exception to this rule, which occurs during the initial
phase of the addition to the network of a previously unconfigured device. The ZigBee
network model must take particular care of security considerations, as ad hoc networks
may be physically accessible to external devices and the particular working environment
cannot be foretold; likewise, different applications running concurrently and using the
same transceiver to communicate are supposed to be mutually trustworthy: for cost
reasons the model does not assume a firewall exists between application-level entities.

Within the protocol stack, different network layers are not cryptographically separated, so
access policies are needed and correct design assumed. The open trust model within a
device allows for key sharing, which notably decreases potential cost. Nevertheless, the
layer which creates a frame is responsible for its security. If malicious devices may exist,
every network layer payload must be cyphered, so unauthorized traffic can be
immediately cut off. The exception, again, is the transmission of the network key, which
confers a unified security layer to the network, to a new connecting device. Point-to-point
encryption is also supported.

Dept. of PG Studies, VTU, Belgaum 36


Reliable Data Transmission in ZigBee Based Health Monitoring System

3.14.2 Security Architecture


ZigBee uses 128-bit keys to implement its security mechanisms. A key can be associated
either to a network, being usable by both ZigBee layers and the MAC sublayer, or to a
link, acquired through preinstallation, agreement or transport. Establishment of link keys
is based on a master key which controls link key correspondence. Ultimately, at least the
initial master key must be obtained through a secure medium (transport or
preinstallation), as the security of the whole network depends on it. Link and master keys
are only visible to the application layer. Different services use different one-way
variations of the link key in order to avoid leaks and security risks.

Key distribution is one of the most important security functions of the network. A secure
network will designate one special device which other devices trust for the distribution of
security keys: the trust center. Ideally, devices will have the trust center address and
initial master key preloaded; if a momentary vulnerability is allowed, it will be sent as
described above. Typical applications without special security needs will use a network
key provided by the trust center (through the initially insecure channel) to communicate.

Thus, the trust center maintains both the network key and provides point-to-point
security. Devices will only accept communications originating from a key provided by
the trust center, except for the initial master key. The security architecture is distributed
among the network layers as follows:

 The MAC sublayer is capable of single-hop reliable communications. As a rule, the


security level it is to use is specified by the upper layers.
 The network layer manages routing, processing received messages and being capable
of broadcasting requests. Outgoing frames will use the adequate link key according to
the routing, if it is available; otherwise, the network key will be used to protect the
payload from external devices.
 The application layer offers key establishment and transport services to both ZDO and
applications. It is also responsible for the propagation across the network of changes
in devices within it, which may originate in the devices themselves (for instance, a
simple status change) or in the trust manager (which may inform the network that a
certain device is to be eliminated from it). It also routes requests from devices to the
trust center and network key renewals from the trust center to all devices. Besides
this, the ZDO maintains the security policies of the device. In summary, Security and

Dept. of PG Studies, VTU, Belgaum 37


Reliable Data Transmission in ZigBee Based Health Monitoring System

data integrity are key benefits of the ZigBee technology. ZigBee leverages the
security model of the IEEE 802.15.4 MAC sublayer which specifies four security
services:
 Access control—the device maintains a list of trusted devices within the network
 Data encryption, which uses symmetric key 128-bit advanced encryption standard
 Frame integrity to protect data from being modified by parties without cryptographic
keys
 Sequential freshness to reject data frames that have been replayed—the network
controller compares the freshness value with the last known value from the device and
rejects it if the freshness value has not been updated to a new value. The actual
security implementation is specified by the implementer using a standardized toolbox
of ZigBee security software.

3.15 Frame Structure

The main frames in Zigbee protocol are

 Data frame for all data transfers.


 Acknowledgement frame for successful frame receipt confirmations.
 MAC command frame.
 Beacon frame for transmission of beacons.

Figure 3.13 The four basic frame types defined in 802.15.4: Data, ACK,
MAC command, and beacon.

Dept. of PG Studies, VTU, Belgaum 38


Reliable Data Transmission in ZigBee Based Health Monitoring System

The data frame provides a payload of up to 104 bytes. The frame is numbered to ensure
that all packets are tracked. This frame structure improves reliability in difficult
conditions. A frame-check sequence ensures that packets are received without error. After
receiving a data packet, the receiver performs a 16-bit cyclic redundancy check (CRC) to
verify that the packet was not corrupted in transmission. With a good Cyclic Redundancy
Check, the receiver can automatically transmit an acknowledgement packet (depending
on application and network needs), allowing the transmitting station to know that the data
were received in an acceptable form. If the CRC indicates the packet was corrupt, the
packet is dropped and no acknowledgement is transmitted. When a developer configures
the network to expect acknowledgement, the transmitting station will retransmit the
original packet a specified number of times to ensure successful packet delivery. If the
path between the transmitter and receiver has become less reliable or a network failure
has occurred, ZigBee provides the network with self-healing capabilities when alternate
paths (if physically available) can be established autonomously.

Fig 3.14 Schematic view of the data frame and the PHY packet

The Physical Protocol Data Unit is the total information sent over the air. As shown in the
illustration above the Physical layer adds the following overhead:

Preamble Sequence 4 Octets


Start of Frame Delimiter 1 Octet
Frame Length 1 Octet

Dept. of PG Studies, VTU, Belgaum 39


Reliable Data Transmission in ZigBee Based Health Monitoring System

The MAC adds the following overhead:

Frame Control : 2 Octets


Data Sequence Number : 1 Octet
Address Information : 4 – 20 Octets
Frame Check Sequence : 2 Octets
In summary the total overhead for a single packet is therefore 15 -31 octets (120 bits);
depending upon the addressing scheme used (short or 64 bit addresses). Please note that
these numbers do not include any security overhead.

Another important structure for 802.15.4 is the acknowledgment (ACK) frame. It provides
feedback from the receiver to the sender confirming that the packet was received without
error. The device takes advantage of specified "quiet time" between frames to send a short
packet immediately after the data packet transmission.

Fig 3.15 Schematic view of the acknowledgement frame and the PHY
packet

MAC command frame provides the mechanism for remote control and configuration of
client nodes. A centralized network manager uses MAC to configure individual clients'
command frames no matter how large the network.

Fig 3.16 Schematic view of the MAC command frame and the PHY
packet

Dept. of PG Studies, VTU, Belgaum 40


Reliable Data Transmission in ZigBee Based Health Monitoring System

Finally, the beacon frame wakes up client devices, which listen for their address and go
back to sleep if they don't receive it. Beacons are important for mesh and cluster-tree
networks to keep all the nodes synchronized without requiring those nodes to consume
precious battery energy by listening for long periods of time. Security and data integrity
are key benefits of the ZigBee technology.

Fig 3.17 Schematic view of the beacon frame and the PHY packet

3.16 Super Frame Structure


The LR-WPAN standard allows the optional use of a super frame structure. The format of
the superframe is defined by the coordinator. The super frame is bounded by network
beacons, is sent by the coordinator and is divided into 16 equally sized slots. The beacon
frame is transmitted in the first slot of each super frame. If a coordinator does not wish to
use a super frame structure it may turn off the beacon transmissions. The beacons are
used to synchronize the attached devices, to identify the PAN, and to describe the
structure of the super frames. Any device wishing to communicate during the contention
access period (CAP) between two beacons shall compete with other devices using a
slotted CSMA-CA mechanism. All transactions shall be completed by the time of the next
network beacon.

Fig 3.18 Super Frame Structure

Dept. of PG Studies, VTU, Belgaum 41


Reliable Data Transmission in ZigBee Based Health Monitoring System

For low latency applications or applications requiring specific data bandwidth, the PAN
coordinator may dedicate portions of the active super frame to that application. These
portions are called guaranteed time slots (GTSs). The guaranteed time slots comprise the
contention free period (CFP), which always appears at the end of the active super frame
starting at a slot boundary immediately following the CAP. The PAN coordinator may
allocate up to seven of these GTSs and a GTS may occupy more than one slot period.
However, a sufficient portion of the CAP shall remain for contention based access of
other networked devices or new devices wishing to join the network. All contention based
transactions shall be complete before the CFP begins. Also each device transmitting in a
GTS shall ensure that its transaction is complete before the time of the next GTS or the
end of the CFP.

Fig 3.19 Super Frame Structure in Detail

3.17 Traffic Types


ZigBee/IEEE 802.15.4 addresses three typical traffic types. IEEE 802.15.4 MAC can
accommodate all the types.

i. Data is periodic. The application dictates the rate, and the sensor activates, checks for
data and deactivates.
ii. Data is intermittent. The application, or other stimulus, determines the rate, as in the
case of say smoke detectors. The device needs to connect to the network only when
communication is necessitated. This type enables optimum saving on energy.
iii. Data is repetitive, and the rate is fixed a priori. Depending on allotted time slots,
called GTS (guaranteed time slot), devices operate for fixed durations.

ZigBee employs either of two modes, beacon or non-beacon to enable the to-and-fro data
traffic. Beacon mode is used when the coordinator runs on batteries and thus offers
maximum power savings, whereas the non-beacon mode finds favour when the

Dept. of PG Studies, VTU, Belgaum 42


Reliable Data Transmission in ZigBee Based Health Monitoring System

coordinator is mains-powered. In the beacon mode, a device watches out for the
coordinator's beacon that gets transmitted at periodically, locks on and looks for messages
addressed to it. If message transmission is complete, the coordinator dictates a schedule
for the next beacon so that the device ‘goes to sleep'; in fact, the coordinator itself
switches to sleep mode. While using the beacon mode, all the devices in a mesh network
know when to communicate with each other. In this mode, necessarily, the timing circuits
have to be quite accurate, or wake up sooner to be sure not to miss the beacon. This in
turn means an increase in power consumption by the coordinator's receiver, entailing an
optimal increase in costs.

Figure 3.20 Beacon Network Communication

The non-beacon mode will be included in a system where devices are ‘asleep' nearly
always, as in smoke detectors and burglar alarms. The devices wake up and confirm their
continued presence in the network at random intervals. On detection of activity, the
sensors ‘spring to attention', as it were, and transmit to the ever waiting coordinator's
receiver (since it is mains powered).However, there is the remotest of chances that a
sensor finds the channel busy, in which case the receiver unfortunately would ‘miss a
call'.

Figure 3.21 Non-Beacon


Network Communication

Dept. of PG Studies, VTU, Belgaum 43


Reliable Data Transmission in ZigBee Based Health Monitoring System

3.18 Protocols
The protocols build on recent algorithmic research (Ad-hoc On-demand Distance Vector,
neuRFon) to automatically construct a low-speed ad-hoc network of nodes. In most large
network instances, the network will be a cluster of clusters. It can also form a mesh or a
single cluster. The current profiles derived from the ZigBee protocols support beacon and
non-beacon enabled networks.

In non-beacon-enabled networks (those whose beacon order is 15), an un-slotted


CSMA/CA channel access mechanism is used. In this type of network, ZigBee Routers
typically have their receivers continuously active, requiring a more robust power supply.
However, this allows for heterogeneous networks in which some devices receive
continuously, while others only transmit when an external stimulus is detected. The
typical example of a heterogeneous network is a wireless light switch: the ZigBee node at
the lamp may receive constantly, since it is connected to the mains supply, while a
battery-powered light switch would remain asleep until the switch is thrown. The switch
then wakes up, sends a command to the lamp, receives an acknowledgment, and returns
to sleep. In such a network the lamp node will be at least a ZigBee Router, if not the
ZigBee Coordinator; the switch node is typically a ZigBee End Device.

In beacon-enabled networks, the special network nodes called ZigBee Routers transmit
periodic beacons to confirm their presence to other network nodes. Nodes may sleep
between beacons, thus lowering their duty cycle and extending their battery life. Beacon
intervals may range from 15.36 milliseconds to 15.36 ms * 214 = 251.65824 seconds at
250 kbit/s, from 24 milliseconds to 24 ms * 214 = 393.216 seconds at 40 kbit/s and from
48 milliseconds to 48 ms * 214 = 786.432 seconds at 20 kbit/s. However, low duty cycle
operation with long beacon intervals requires precise timing which can conflict with the
need for low product cost.

In general, the ZigBee protocols minimize the time the radio is on so as to reduce power
use. In beaconing networks, nodes only need to be active while a beacon is being
transmitted. In non-beacon-enabled networks, power consumption is decidedly
asymmetrical: some devices are always active, while others spend most of their time
sleeping.

Dept. of PG Studies, VTU, Belgaum 44


Reliable Data Transmission in ZigBee Based Health Monitoring System

ZigBee devices are required to conform to the IEEE 802.15.4-2003 Low-Rate Wireless
Personal Area Network (WPAN) standard. The standard specifies the lower protocol
layers—the physical layer (PHY), and the medium access control (MAC) portion of the
data link layer (DLL). This standard specifies operation in the unlicensed 2.4 GHz,
915 MHz and 868 MHz ISM bands. In the 2.4 GHz band there are 16 ZigBee channels,
with each channel requiring 5 MHz of bandwidth. The center frequency for each channel
can be calculated as, FC = (2405 + 5*(k-11)) MHz, where k = 11, 12, ..., 26.

The radios use direct-sequence spread spectrum coding, which is managed by the digital
stream into the modulator. BPSK is used in the 868 and 915 MHz bands, and orthogonal
QPSK that transmits two bits per symbol is used in the 2.4 GHz band. The raw, over-the-
air data rate is 250 kbit/s per channel in the 2.4 GHz band, 40 kbit/s per channel in the
915 MHz band, and 20 kbit/s in the 868 MHz band. Transmission range is between 10
and 75 meters (33 and 246 feet), although it is heavily dependent on the particular
environment. The maximum output power of the radios is generally 0 dBm (1 mW).

The basic channel access mode specified by IEEE 802.15.4-2003 is "carrier sense,
multiple access/collision avoidance" (CSMA/CA). That is, the nodes talk in the same way
that people converse; they briefly check to see that no one is talking before they start.
There are three notable exceptions to the use of CSMA. Beacons are sent on a fixed
timing schedule, and do not use CSMA. Message acknowledgements also do not use
CSMA. Finally, devices in Beacon Oriented networks that have low latency real-time
requirements may also use Guaranteed Time Slots (GTS) which by definition does not
use CSMA.

3.19 ZigBee Benefits


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

 Low cost : The typical ZigBee radio is cost-effective. Chipset prices can be as low as
$12 each in quantities as few as 100 pieces. While the 802.15.4 and ZigBee stacks are
typically included in this cost, crystals and other discrete components are not; design-
in modules fall in the neighbourhood of $25 in similar quantities. This pricing
provides an economic justification for extending wireless networking to even the
simplest of devices.

Dept. of PG Studies, VTU, Belgaum 45


Reliable Data Transmission in ZigBee Based Health Monitoring System

 Range and obstruction issues avoidance : ZigBee routers double as input devices
and repeaters to create a form of mesh network. If two network points are unable to
communicate as intended, transmission is dynamically routed from the blocked node
to a router with a clear path to the data’s destination. This happens automatically, so
that communications continue even when a link fails unexpectedly. The use of low-
cost routers can also extend the network’s effective reach. When the distance between
the base station and a remote node exceeds the devices’ range, an intermediate node
or nodes can relay transmission, eliminating the need for separate repeaters (Figure 2).
 Multisource products : As an open standard, ZigBee provides customers with the
ability to choose vendors as needed. ZigBee Alliance working groups define
interoperability profiles to which ZigBee-certified devices must adhere. A ZigBee-
certified radio will interoperate with any other ZigBee-certified radio adhering to the
same profile. This promotes compatibility and competition, which allows the end
users to choose the best device for each particular network node, regardless of
manufacturer.
 Low power consumption : Basic ZigBee radios operate at 1 mW RF power and can
sleep when not involved in transmission (higher RF-power ZigBee radios for
applications needing greater range also provide the sleep function). Because this
makes battery-powered radios more practical than ever, wireless devices are free to be
placed without power cable runs in addition to eliminating data cable runs.

3.20 Applications
 Commercial systems: Vending machines, fleet management.
 Enterprise systems: Health care and patient monitoring, environmental monitoring
and hazards detection.
 Industrial systems: Remote controlled machines such as in tracking wind turbines.
 Military and government systems: Asset tracking, personnel monitoring and
surveillance.
 Transportation systems: Audio control and automation, security and access control.
 Consumer products: Cellular handsets, computer peripherals, remote controls and
other portable devices.
 Climate control: customize the temperatures of ac machines or thermostats as
differently needed.

Dept. of PG Studies, VTU, Belgaum 46


Reliable Data Transmission in ZigBee Based Health Monitoring System

 Home automation: turn on or off ovens, air conditioners, geysers, lights without any
hassles only when needed. Also sprinkle water to plants in garden monitoring
moisture content in soil.
 Private Security: this also acts like a private security to monitor kids or aged even
from office and alert in case of medical emergencies.

Dept. of PG Studies, VTU, Belgaum 47


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 4

CIRCUIT DESIGN

This chapter mainly deals with the circuit and the requirements of the project. The XBee
and XBee-PRO OEM RF Modules were engineered to meet IEEE 802.15.4 standards and
support the unique needs of low-cost, low-power wireless sensor networks. The modules
require minimal power and provide reliable delivery of data between devices. This
module transmit and receive the data from sensor networks and with help of the computer
display of the report is done.

4.1 Block Diagram

Patient Section

Control Room:

Fig 4.1: Block diagram of Health Monitoring System

Dept. of PG Studies, VTU, Belgaum 48


Reliable Data Transmission in ZigBee Based Health Monitoring System

4.2 Block Definition

 In Patient section , Amplified signals from the sensors are fed to MCU
 The heart beat sensor and temperature sensor values are continually monitored
 The signal conditioning unit converts sensor values which are analog in nature into
digital. But this unit is inbuilt in PIC16F877A microcontroller unit.
 Heart beat and temperature sensor values are transmitted to control section using
ZigBee module.
 In health care(Control) section get the information from patient section and
transferred to PC using RS232 protocol.

4.3 Circuit Diagram

Fig 4.2 Circuit Diagram of Health Monitoring System

PIC16F877A

Figure 4.2 Circuit Diagram


4.3.1 Power Supply
This circuit IC voltage regulator as the power source. IC voltage regulators are versatile
and inexpensive and are available with features such as a programmable output, current-
voltage boosting, internal short-circuit current limiting, thermal shutdown and floating
operation for high voltage application.

Dept. of PG Studies, VTU, Belgaum 49


Reliable Data Transmission in ZigBee Based Health Monitoring System

Regulator IC units contain the circuitry for reference source, comparator amplifier,
control devices and overload protection all in a single unit. In this circuit, three-terminal
IC voltage regulator 7805 is employed. 7805 is a fixed positive voltage regulator whose
nominal voltage output is +5v. This IC are designed with adequate heat sinking, can
deliver output currents in excess of 1A.

4.3.2 Controller Circuit


The controller used in this module is PIC16F877A.This micro-controller manipulated the
data accessed from the ADC converters and is linked to the conversion circuit which
contains analog sensors. The program for this is written using MPLAB IDE Software
which is then integrated by the module.

4.3.3 Sensors
The sensors used for the temperature sensing LM 35,and heart beat sensor is used. The
data form this is transmitted through the ADC conversion circuit where the analog data
from the sensors are converted to digital form by the circuit used.

4.3.4 Transmission Circuit


The transmission of data is done in the ZigBee module on the basis of IEEE 802.15.4/2.4
GHz standard. The transmission of data data is done in encapsulation methods like it
gathers the data and sends to the receivers end at a time like a single data packet. so that it
can send as many possible data packets in a minute and also the data is not lost in the
transmission .

4.3.5 Serial Communication


Serial communication is basically the transmission or reception of data one bit at a time.
In telecommunications, RS-232 is a standard for serial binary data interconnection
between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating
Equipment). It is commonly used in computer serial ports.

4.3.6 Level converter

MAX-232 is primary used for people building electronics with an RS-232 interface.
MAX 232 IC used as level logic converter.

Dept. of PG Studies, VTU, Belgaum 50


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 5

DESCRIPTION OF CIRCUIT COMPONENTS

This chapter describes various circuit components which are used in this project.

5.1 Microcontroller Circuit

PIC is Microchip product. PIC is a 8 bit Microcontroller which is something special


when compared to others. It includes features for entire analog as well as digital form of
operations. PIC microcontroller is a enhanced flash microcontroller .This microcontroller
mostly compatible with previous versions. It is available in all packages for customer’s
usage. It includes 28/40/44 pins. PIC is a high performance RISC CPU. The
PIC16F877A is useful as a reference device because it has a minimal instruction set but a
full range of peripheral features.

5.1.1 PIC16F877A Pinout Diagram

Fig
5.1 PIC16F874A/877A Pin out Diagram

Dept. of PG Studies, VTU, Belgaum 51


Reliable Data Transmission in ZigBee Based Health Monitoring System

5.1.2 Pin out Description


PDIP PLCC TQFP QFN I/O/P Buffer
Pin Name Description
Pin# Pin# Pin# Pin# Type Type
OSC1/CLKI 13 14 30 32 ST/CMOS(4) Oscillator Crystal
or external clock
OSCI I input. Oscillator
crystal input or
external clock
CLKI I source input. ST
buffer when
configured in RC
mode; otherwise
CMOS.
External clock
source input.
Always associated
with in function
OSC1 (see
OSC1/CLKI,
OSC2/CLKO
Pins)
OSC2/CLKO 14 15 31 33 - Oscillator crystals
OSC2 O or clock output.
Oscillator crystal
output. Connects
to crystal or
resonator in
Crystal Oscillator
mode.
In RC mode,
OSC2 pin outputs
CLKO, which has
¼ the frequency of
OSC1 and denotes
the instructions
cycle rate.
MCLR/VPP 1 2 18 18 ST Master Clear
MCLR I (input) or
programming
voltage (output).
Master Clear
(Reset) input.
This pin is an
active low Reset to
the device.
Programming
voltage input.

Dept. of PG Studies, VTU, Belgaum 52


Reliable Data Transmission in ZigBee Based Health Monitoring System

PDIP PLCC TQFP QFN I/O/P Buffer


Pin Name Description
Pin# Pin# Pin# Pin# Type Type
PORTA is a
RA0/AN0 2 3 19 19 TTL bidirectional I/O
RA0 I/O port.
AN0 I Digital I/O.
RA1/AN1 3 4 20 20 TTL Analog input 0.
RA1 I/O
AN1 I Digital I/O.
RA2/AN2/ 4 5 21 21 TTL Analog input 1.
VREF-
CVREF I/O
RA2 I
AN2 I Digital I/O.
VREF- O Analog input 2.
CVREF 5 6 22 22 TTL A/D reference
RA3/AN3/ I/O voltage (Low)
VREF+ input.
RA4 I Comparator VREF
O output.
T0CKI 7 8 24 24 TTL
C1OUT I/O Digital I/O –
RA5/AN4/ I Open-drain when
SS/C2OUT I onfigured as
RA5 O output.
AN4 Timer0 external
SS clock input.
C2OUT Comparator 1
output.

Digital I/O.
Analog input 4.
SPI slave select
input.
Comparator 2
output.
Legend : I = input O = output I/O= input / ouput
P=Power __ = Not used TTL= TTL input
ST = Schmitt Trigger input

Note: 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode
and a CMOS input otherwise.

Dept. of PG Studies, VTU, Belgaum 53


Reliable Data Transmission in ZigBee Based Health Monitoring System

PDIP PLCC TQFP QFN I/O/P Buffer


Pin name Description
Pin# Pin# Pin# Pin# Type Type
PORTB is a
bidirectional I/O port.
PORT B can be
software programmed
RB0/INT 33 36 8 9 TTL/ST(1) for interanal weak
RB0 I/O pull-up on all inputs.
INT I
RB1 34 37 9 10 I/O TTL Digital I/O.
RB2 35 38 10 11 I/O TTL External interrupt.
RB3/PGM 36 39 11 12 TTL Digital I/O.
RB3 I/O Digital I/O.
PGM I
Digital I/O.
RB4 37 41 14 14 I/O TTL Low-volt ICSP
RB5 38 42 15 15 I/O TTL programming enable
RB6/PGC 39 43 16 16 pin.
RB6 Digital I/O.
PGC Digital I/O.
RB7/PGD 40 44 17 17 TTL/ST(2)
RB7
PGD

Digital I/O.
In-circuit debugger
and ICSP
programming data.

Legend : I = input O = output I/O= input / ouput


P=Power __ = Not used TTL= TTL input
ST = Schmitt Trigger input

Note: 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode
and a CMOS input otherwise.

PDI PLC TQF QF I/ Buffe


Pin Name P C P N O/P r Description
Pin# Pin# Pin# Pin# Type Type
PORTC is a
RC0/T1OSO/ 15 16 32 34 ST bidirectional
T1CKI I/O I/O port.

Dept. of PG Studies, VTU, Belgaum 54


Reliable Data Transmission in ZigBee Based Health Monitoring System

PDI PLC TQF QF I/ Buffe


Pin Name P C P N O/P r Description
Pin# Pin# Pin# Pin# Type Type
RC0 O
T1OSO I Digital I/O.
T1CKI 16 18 35 35 ST Timer1
RC1/T1OSI/CCP2 I/O oscillator
RC1 I output.
T1OSI I/O Timer1
CCP2 external clock
17 19 36 36 ST input.
RC2/CCP1 I/O
RC2 I/O Digital I/O.
CCP1 Timer1
18 20 37 37 ST oscillator input.
RC3/SCK/SCL I/O Capture2 input,
RC3 I/O Compare2
SKL output, PWM2
I/O output.
SCL
23 25 42 42 ST Digital I/O.
RC4/SDI/SDA I/O Capture1 input.
RC4 I Compare1
SDI I/O output, PWM1
SDA 24 26 43 43 ST output.
RC5/SDO I/O
RC5 O Digital I/O.
SDO 25 27 44 44 ST Synchronous
RC6/TX/CK I/O serial clock
RC6 O input/output for
TX I/O SPI ode.
CK 26 29 1 1 ST Synchronous
RC7/RX/DT I/O serial clock
RC7 I input/output for
RX I/O I2C mode.
DT
Digital I/O.
SPI data in.
I2C data I/O.

Digital I/O.
SPI data out.

Digital I/O.
USART
ashynchoronou
s transmit.
USART1
synchronous
clock.

Dept. of PG Studies, VTU, Belgaum 55


Reliable Data Transmission in ZigBee Based Health Monitoring System

PDI PLC TQF QF I/ Buffe


Pin Name P C P N O/P r Description
Pin# Pin# Pin# Pin# Type Type
Digital I/O.
USART
ashynchronous
receive.
USART
synchronous
data.

Legend : I = input O = output I/O= input / ouput


P=Power __ = Not used TTL= TTL input
ST = Schmitt Trigger input

Note: 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode
and a CMOS input otherwise.

PDI PLC TQF I/


QFN Buffer
Pin Name P C P O/P Description
Pin# Type
Pin# Pin# Pin# Type
PORTD is a
bidirectional I/O
port or Parallel
RD0/PSP0 19 21 38 38 ST/ Slave Port when
RD0 I/O TTL(3) interfacing to a
PSP0 I/O microprocessor
RD1/PSP1 20 22 39 39 bus.
RD1 I/O ST/
PSP1 I/O TTL(3) Digital I/O.
RD2/PSP2 21 23 40 40 Parallel Slave
RD2 I/O Port Data.
PSP2 I/O ST/
RD3/PSP3 22 24 41 41 TTL(3) Digital I/O.
RD3 I/O Parallel Slave
PSP3 I/O Port data.
RD4/PSP4 27 30 2 2 ST/
RD4 I/O TTL(3) Digital I/O.
PSP4 I/O Parallel Slave
RD5/PSP5 28 31 3 3 Port data.
RD5 I/O ST/
PSP5 I/O TTL(3) Digital I/O.
RD6/PSP6 29 32 4 4 Parallel Slave
RD6 I/O Port data.
PSP6 I/O ST/

Dept. of PG Studies, VTU, Belgaum 56


Reliable Data Transmission in ZigBee Based Health Monitoring System

PDI PLC TQF I/


QFN Buffer
Pin Name P C P O/P Description
Pin# Type
Pin# Pin# Pin# Type
RD7/PSP7 30 33 5 5 TTL(3) Digital I/O.
RD7 I/O Parallel Slave
PSP7 I/O Port data.
ST/
TTL(3) Digital I/O.
Parallel Slave
Port data.
ST/
TTL(3) Digital I/O.
Parallel Slave
Port data.

Digital I/O.
Parallel Slave
Port data.
PORTE is a
RE0/RD/ 8 9 25 25 ST/ bidirectional I/O
ANS I/O TTL(3) port.
RE0 I
RD I Digital I/O.
ANS 9 10 26 26 Read control for
RE1/WE/ I/O ST/ Parallel Slave
AN6 I TTL(3) Port.
RE1 I Analog input 5.
WR 10 11 27 27
AN6 I/O Digital I/O.
RE2/CS/AN7 I ST/ Write control for
RE2 TTL(3) Parallel Slave
CS I Port.
Analog input 6
AN7
Digital I/O.
Chip select
control for
Parallel Slave
Port.
Analog input 7.

VSS 12,31 13,34 6,29 6,30, P - Ground reference


31 for logic and I/O
pins
VDD 11,32 12,35 7,28 7,8, P - Positive supply
28,2 for logic and I/O
9 pins.
NC - 1,17, 12,13 13 - - These pins are
28, 40 33,34 not internally
connected.
These pins

Dept. of PG Studies, VTU, Belgaum 57


Reliable Data Transmission in ZigBee Based Health Monitoring System

PDI PLC TQF I/


QFN Buffer
Pin Name P C P O/P Description
Pin# Type
Pin# Pin# Pin# Type
should be left
unconnected.
Table 5.1 PIC16F874A/877A Pin out Description

Dept. of PG Studies, VTU, Belgaum 58


Reliable Data Transmission in ZigBee Based Health Monitoring System

Legend : I = input O = output I/O= input / output


P=Power __ = Not used TTL= TTL input
ST = Schmitt Trigger input

Note: 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode
and a CMOS input otherwise.

5.1.3 Features

 Operating Speed Max 20 MHz, Voltage-(2-5.5)v


 Memory:

Flash Program 8K×14 Words,

RAM 368 Bytes,

EEPROM Data Memory 256 Bytes

Low power, High speed Flash/EEPROM Technology

 It has 5 Ports for Internal and External usage


 It has on chip Timers. 3 Timers are available
 It has in built Analog to Digital Converter
 In built Multiplexer availability for signal Selection
 It has serial as well as Parallel Communication facilities

In built Capture, Compare and Pulse width modulation

5.2 XBee / XBee‐PRO OEM RF Modules


The XBee and XBee-PRO OEM RF Modules were engineered to meet IEEE 802.15.4
standards and support the unique needs of low-cost, low-power wireless sensor networks.
The modules require minimal power and provide reliable delivery of data between
devices. The modules operate within the ISM 2.4 GHz frequency band and are pin-for-pin
compatible with each other.

Dept. of PG Studies, VTU, Belgaum 59


Reliable Data Transmission in ZigBee Based Health Monitoring System

Fig 5.2 XBee/ XBee-PRO Modules

5.2.1 Key Features

Long Range Data Integrity Low power

XBee XBee

Indoor/Urban : upto 100' (30m) TX Peak Current : 45 mA ( @3.3 V)


Outdoor line-of-sight : up to 300' (100m) RX Current : 50 mA ( @3.3 V)
Transmit Power : 1mW (0dBm) Power -down Current : < 10 µA
Receiver sensitivity : -92dBm

XBee-PRO XBee-PRO

Indoor/Urban : upto 300' (100m) TX Peak Current : 215 mA ( @3.3 V)


Outdoor line-of-sight : up to 1 mile (1500m) RX Current : 55 mA ( @3.3 V)
Transmit Power : 100mW (20 dBm) EIRP Power -down Current : < 10 µA
Receiver sensitivity : -100 dBm
RF Data Rate : 250,000 bps

Advanced Networking & Security ADC and I/O line support

Retries and Acknowledgements Analog-to-digital conversion, Digital I/O


DSSS(Direct Sequence Spread Spectrum) I/O Line Passing
Each direct sequence channels has over
65,000 unique network addresses available Easy-to-Use
Source/Destination Addressing
Unicast & Broadcast communications No configuration necessary for out-of box
Point-to-point,Point-to-multipoint RF Communications
And peer-to-peer topologies supported Free X-CTU Software

Dept. of PG Studies, VTU, Belgaum 60


Reliable Data Transmission in ZigBee Based Health Monitoring System

Coordinator/End Device operations (Testing and configuration software)


AT and API Command modes for
Configuring module parameters
Extensive command set
Small form factor

5.2.2 Mechanical Drawings

Figure 5.3 Mechanical drawings of the XBee/XBee-PRO RF Modules


(antenna options not shown.The XBee/XBee-PRO RF Modules are pin-
for-pin compatible.)
5.2.3 Pin Signals

Pin 1 Pin 20
Pin 1 Pin 20

Pin 10 Pin 11
Pin 11
Pin 10

Figure 5.4 XBee/XBee-PRO RF Module Pin Numbers (top sides shown-


shields on bottom)

5.2.4 Pin Description

Pin # Name Direction Description


1 VCC - Power supply
2 DOUT Output UART Data Out
3 DIN / CONFIG Input UART Data In
4 DO8* Output Digital Output 8
5 RESET Input Module Reset (reset pulse must be at
least 200 ns)

Dept. of PG Studies, VTU, Belgaum 61


Reliable Data Transmission in ZigBee Based Health Monitoring System

Pin # Name Direction Description


6 PWM0 / RSSI Output PWM Output 0 / RX Signal Strength
Indicator
7 PWM1 Output PWM Output 1
8 [reserved] - Do not connect
9 DTR / SLEEP_RQ / DI8 Input Pin Sleep Control Line or Digital
Input 8
10 GND - Ground
11 AD4 / DIO4 Either Analog Input 4 or Digital I/O 4
12 CTS / DIO7 Either Clear-to-Send Flow Control or Digital
I/O 7
13 ON / SLEEP Output Module Status Indicator
14 VREF Input Voltage Reference for A/D Inputs
15 Associate / AD5 / DIO5 Either Associated Indicator, Analog Input 5
or Digital I/O 5
16 RTS / AD6 / DIO6 Either Request-to-Send Flow Control,
Analog Input 6 or Digital I/O 6
17 AD3 / DIO3 Either Analog Input 3 or Digital I/O 3
18 AD2 / DIO2 Either Analog Input 2 or Digital I/O 2
19 AD1 / DIO1 Either Analog Input 1 or Digital I/O 1
20 AD0 / DIO0 Either Analog Input 0 or Digital I/O 0

Table 5.2 Pin Assignments for the XBee and XBee PRO Modules

Design Notes
 Minimum connections: VCC, GND, DOUT & DIN
 Minimum connections for updating firmware: VCC, GND, DIN, DOUT, RTS & 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

5.3 Sensors
The sensors which are used in this health monitoring system are described below.

Dept. of PG Studies, VTU, Belgaum 62


Reliable Data Transmission in ZigBee Based Health Monitoring System

5.3.1 LM 35
LM 35 is a precision centigrade Temperature sensor. The LM35 is an integrated circuit
sensor that can be used to measure temperature with an electrical output proportional to
the temperature (in °C)

General Description
The LM35 series are precision integrated-circuit temperature sensors, whose output
voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus
has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not
required to subtract a large constant voltage from its output to obtain convenient
Centigrade scaling. The LM35 does not require any external calibration or trimming to
provide typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C over a full −55 to
+150°C temperature range. Low cost is assured by trimming and calibration at the wafer
level. The LM35’s low output impedance, linear output, and precise inherent calibration
make interfacing to readout or control circuitry especially easy. It can be used with single
power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply,
it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over
a −55° to +150°C temperature range, while the LM35C is rated for a −40° to +110°C
range (−10°with improved accuracy). The LM35 series is available packaged in hermetic
TO-46 transistor packages, while the LM35C, LM35CA, and LM35D are also available
in the plastic TO-92 transistor package. The LM35D is also available in an 8-lead surface
mount small outline package and a plastic TO-220 package.

Features
 Calibrated directly in ° Celsius (Centigrade)
 Linear + 10.0 mV/°C scale factor
 0.5°C accuracy guaranteeable (at +25°C)
 Rated for full −55° to +150°C range
 Suitable for remote applications
 Low cost due to wafer-level trimming
 Operates from 4 to 30 volts
 Less than 60 µA current drain
 Low self-heating, 0.08°C in still air
 Nonlinearity only ±1⁄4°C typical
 Low impedance output, 0.1 W for 1 mA load

Dept. of PG Studies, VTU, Belgaum 63


Reliable Data Transmission in ZigBee Based Health Monitoring System

Typical Applications

Fig 5.5 Basic Centigrade Temperature Sensor +2 c to +150 c

Fig 5.6 Full-Range Centigrade Temperature Sensor

Choose R1 = −VS/50 µA
VOUT = +1,500 mV at +150°C
= +250 mV at +25°C
= −550 mV at −55°C

Maximum Ratings
 Supply Voltage : +35V to −0.2V
 Output Voltage : +6V to −1.0V
 Output Current : 10 mA
 Storage Temp :
TO-46 Package, −60°C to +180°C
TO-92 Package, −60°C to +150°C
SO-8 Package, −65°C to +150°C

Dept. of PG Studies, VTU, Belgaum 64


Reliable Data Transmission in ZigBee Based Health Monitoring System

TO-220 Package, −65°C to +150°C


 Lead Temp :
TO-46 Package : (Soldering, 10 seconds) 300°C
 TO-92 and TO-220 Package : (Soldering, 10 seconds) 260°C
 Vapor Phase : (60 seconds) 215°C
 Infrared : (15 seconds) 220°C
 ESD Susceptibility : (Note 11) 2500V
 Specified Operating Temperature Range: TMIN to T MAX
 LM35, LM35A : −55°C to +150°C
 LM35C, LM35CA : −40°C to +110°C
 LM35D : 0°C to +100°C

Typical Performance Characteristics:


Minimum Supply
Voltage vs Temperature

Fig 5.7 Voltage Vs Temperature

Thermal Resistance
Junction to Air

Fig 5.8 Thermal Resistance Vs Air Velocity

Dept. of PG Studies, VTU, Belgaum 65


Reliable Data Transmission in ZigBee Based Health Monitoring System

Accuracy Vs Temperature

Fig 5.9 Accuracy Vs Temperature

Application

The LM35 can be applied easily in the same way as other integrated-circuit temperature
sensors. It can be glued or cemented to a surface and its temperature will be within about
0.01§C of the surface temperature. This presumes that the ambient air temperature is
almost the same as the surface temperature; if the air temperature were much higher or
lower than the surface temperature, the actual temperature of the LM35 die would be at
an intermediate temperature between the surface temperature and the air temperature.
This is especially true for the TO-92 plastic package, where the copper leads are the
principal thermal path to carry heat into the device, so its temperature might be closer to
the air temperature than to the surface temperature. To minimize this problem, be sure
that the wiring to the LM35, as it leaves the device, is held at the same temperature as the
surface of interest. The easiest way to do this is to cover up these wires with a bead of
epoxy which will insure that the leads and wires are all at the same temperature as the
surface, and that the LM35 die's temperature will not be affected by the air temperature.

The TO-46 metal package can also be soldered to a metal surface or pipe without damage.
Of course, in that case the V b terminal of the circuit will be grounded to that metal.
Alternatively, the LM35 can be mounted inside a sealed-end metal tube, and can then be
dipped into a bath or screwed into a threaded hole in a tank. As with any IC, the LM35

Dept. of PG Studies, VTU, Belgaum 66


Reliable Data Transmission in ZigBee Based Health Monitoring System

and accompanying wiring and circuits must be kept insulated and dry, to avoid leakage
and corrosion. This is especially true if the circuit may operate at cold temperatures where
condensation can occur. Printed-circuit coatings and varnishes such as Humiseal and
epoxy paints or dips are often used to insure that moisture cannot corrode the LM35 or its
connections. These devices are sometimes soldered to a small lightweight heat fin, to
decrease the thermal time constant and speed up the response in slowly-moving air. On
the other hand, a small thermal mass may be added to the sensor, to give the steadiest
reading despite small deviations in the air temperature.

5.3.2 Heartbeat Sensor


The skin may be illuminated with visible (red) or infrared LEDs using transmitted or
reflected light for detection. The very small changes in reflectivity or in transmittance
caused by the varying blood content of human tissue are almost invisible. Various noise
sources may produce disturbance signals with amplitudes equal or even higher than the
amplitude of the pulse signal. Valid pulse measurement therefore requires extensive
preprocessing of the raw signal.

The setup described here uses a red LED for transmitted light illumination and a pin
Photodiode as detector. With only slight changes in the preamplifier circuit the same
hard- and software could be used with other illumination and detection concepts.

The detectors photo current (AC Part) is converted to voltage and amplified by an
inexpensive operational amplifier (LM358). A PIC16F877 microcontroller converts the
analog signal with 10 bits resolution to a digital signal. An average is calculated from 250
readings taken over a 20 milliseconds period (This equals one period of the european
power line frequency of 50 Hz).

The sensor consists of a light source and photo detector; light is shone through the tissues
and variation in blood volume alters the amount of light falling on the detector. The
source and detector can be mounted side by side to look at changes in reflected light or on
either side of a finger or earlobe to detect changes in transmitted light. The particular

Dept. of PG Studies, VTU, Belgaum 67


Reliable Data Transmission in ZigBee Based Health Monitoring System

arrangement here uses a wooden clothes peg to hold an infra red light emitting diode and
a matched phototransistor. The infra red filter of the phototransistor reduces interference
from fluorescent lights, which have a large AC component in their output.

Fig.5.10 Sensor Construction

5.4 Introduction to RS232 Serial Communication


Serial communication is basically the transmission or reception of data one bit at a time.
Today's computers generally address data in bytes or some multiple thereof. A byte
contains 8 bits. A bit is basically either a logical 1 or zero. Every character on this page is
actually expressed internally as one byte. The serial port is used to convert each byte to a
stream of ones and zeroes as well as to convert streams of ones and zeroes to bytes. The
serial port contains a electronic chip called a Universal Asynchronous
Receiver/Transmitter (UART) that actually does the conversion.

The serial port has many pins. We will discuss the transmit and receive pin first.
Electrically speaking, whenever the serial port sends a logical one (1) a negative voltage

Dept. of PG Studies, VTU, Belgaum 68


Reliable Data Transmission in ZigBee Based Health Monitoring System

is effected on the transmit pin. Whenever the serial port sends a logical zero (0) a positive
voltage is effected. When no data is being sent, the serial port's transmit pin's voltage is
negative (1) and is said to be in a MARK state. Note that the serial port can also be forced
to keep the transmit pin at a positive voltage (0) and is said to be the SPACE or BREAK
state. (The terms MARK and SPACE are also used to simply denote a negative voltage
(1) or a positive voltage(0) at the transmit pin respectively).

When transmitting a byte, the UART (serial port) first sends a START BIT which is a
positive voltage (0), followed by the data (general 8 bits, but could be 5, 6, 7, or 8 bits)
followed by one or two STOP BITs which is a negative(1) voltage. The sequence is
repeated for each byte sent.Figure 4.14 shows a diagram of a what a byte transmission
would look like.

Figure 5.11 Byte Transmission

At this point you may want to know what is the duration of a bit. In other words, how
long does the signal stay in a particular state to define a bit. The answer is simple. It is
dependent on the baud rate. The baud rate is the number of times the signal can switch
states in one second. Therefore, if the line is operating at 9600 baud, the line can switch
states 9,600 times per second. This means each bit has the duration of 1/9600 of a second
or about 100 µsec.

When transmitting a character there are other characteristics other than the baud rate that
must be known or that must be setup. These characteristics define the entire interpretation
of the data stream.

The first characteristic is the length of the byte that will be transmitted. This length in
general can be anywhere from 5 to 8 bits.

Dept. of PG Studies, VTU, Belgaum 69


Reliable Data Transmission in ZigBee Based Health Monitoring System

The second characteristic is parity. The parity characteristic can be even, odd, mark,
space, or none. If even parity, then the last data bit transmitted will be a logical 1 if the
data transmitted had an even amount of 0 bits. If odd parity, then the last data bit
transmitted will be a logical 1 if the data transmitted had an odd amount of 0 bits. If
MARK parity, then the last transmitted data bit will always be a logical 1. If SPACE
parity, then the last transmitted data bit will always be a logical 0. If no parity then there
is no parity bit transmitted.

The third characteristic is the amount of stop bits. This value in general is 1 or 2. Assume
we want to send the letter 'A' over the serial port. The binary representation of the letter
'A' is 01000001. Remembering that bits are transmitted from least significant bit (LSB) to
most significant bit (MSB), the bit stream transmitted would be as follows for the line
characteristics 8 bits, no parity, 1 stop bit, 9600 baud.

LSB (0 1 0 0 0 0 0 1 0 1) MSB

The above represents (Start Bit) (Data Bits) (Stop Bit)

To calculate the actual byte transfer rate simply divide the baud rate by the number of bits
that must be transferred for each byte of data. In the case of the above example, each
character requires 10 bits to be transmitted for each character. As such, at 9600 baud, up
to 960 bytes can be transferred in one second.

5.4.1 Null Modem, an Introduction


Serial communications with RS232. One of the oldest and most widely spread
communication methods in computer world. The way this type of communication can be
performed is pretty well defined in standards. i.e., with one exception. The standards
show the use of DTE/DCE communication, the way a computer should communicate
with a peripheral device like a modem. For your information, DTE means data terminal
equipment (computers etc.) where DCE is the abbreviation of data communication
equipment (modems). One of the main uses of serial communication today where no
modem is involved—a serial null modem configuration with DTE/DTE communication
—is not so well defined, especially when it comes to flow control. The terminology null
modem for the situation where two computers communicate directly is so often used
nowadays, that most people don't realize anymore the origin of the phrase and that a null
modem connection is an exception, not the rule.

Dept. of PG Studies, VTU, Belgaum 70


Reliable Data Transmission in ZigBee Based Health Monitoring System

In history, practical solutions were developed to let two computers talk with each other
using a null modem serial communication line. In most situations, the original modem
signal lines are reused to perform some sort of handshaking. Handshaking can increase
the maximum allowed communication speed because it gives the computers the ability to
control the flow of information. High amounts of incoming data is allowed if the
computer is capable to handle it, but not if it is busy performing other tasks. If no flow
control is implemented in the null modem connection, communication is only possible at
speeds at which it is sure the receiving side can handle the amount information even
under worst case conditions.

5.4.2 Null Modem without Handshaking

How to use the handshaking lines in a null modem configuration? The simplest way is to
don't use them at all. In that situation, only the data lines and signal ground are cross
connected in the null modem communication cable. All other pins have no connection.
An example of such a null modem cable without handshaking can be seen in the figure
below.

Fig 5.12 Null Modem without Handshaking

Connector 1 Connector 2 Function

2 3 Rx Tx

3 2 Tx Rx

5 5 Signal ground

Table 5.3 Null Modem without Handshaking

Dept. of PG Studies, VTU, Belgaum 71


Reliable Data Transmission in ZigBee Based Health Monitoring System

5.4.3 Pins in RS-232 connector

Figure 5.13 Pins used on the female RS-232 (DB 9) Serial Connector

5.4.4 RS-232 (DB 9) Serial Connector Pin Description

DB-9 Pin RS-232 Name Description Implementation*


1 DCD Data-Carrier-Detect Connected to DSR (pin6)
2 RXD Received Data Serial data exiting the
RF modem (to host)
3 TXD Transmitted Data Serial data entering into the
RF modem (from host)
4 DTR Data-Terminal- Can enable Power-down on
Ready the RF modem
5 GND Ground Signal Ground
6 DSR Data-Set-Ready Connected to DCD (pin1)
7 RTS / CMD Request-to-Send / Provides RTS flow control or
Command Mode enables "Command Mode" on
the RF modem (Refer to the
Flow Control section [p11]
and the D6 (DIO6
Configuration) command
description.
8 CTS Clear-to-Send Provides CTS flow control

Dept. of PG Studies, VTU, Belgaum 72


Reliable Data Transmission in ZigBee Based Health Monitoring System

DB-9 Pin RS-232 Name Description Implementation*


9 RI Ring Indicator Optional power input that is
connected internally to the
positive lead of the front
power connector
* Functions listed in the implementation column may not be available at the time of
release.

Table 5.4 RS-232 (DB 9) Serial Connector Pin Description


Note: +3V to +25 V : binary 0
3V to -25 V : binary 1

25 Pin
9 Pin Connector & Connector &
Cable assembly Cable assembly

Fig 5.14 RS-232 Cable

Dept. of PG Studies, VTU, Belgaum 73


Reliable Data Transmission in ZigBee Based Health Monitoring System

5.4.5 MAX-232(Level Converter)


Introduction

MAX-232 is primary used for people building electronics with an RS-232 interface.
Serial RS-232 communication works with voltages (-15V ... -3V for high) and +3V ...
+15V for low) which are not compatible with normal computer logic voltages. 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.

Fig 5.15 Pin Diagram of Max-232

5.4.6 RS-232 COMMUNICATION

Fig 5.16 Circuit Diagram of Serial Communication

Dept. of PG Studies, VTU, Belgaum 74


Reliable Data Transmission in ZigBee Based Health Monitoring System

In telecommunications, RS-232 is a standard for serial binary data interconnection


between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating
Equipment). It is commonly used in computer serial ports.

Scope of the Standard

The Electronic Industries Alliance (EIA) standard RS-232-C as of 1969 defines:

 Electrical signal characteristics such as voltage levels, signaling rate, timing and
slew-rate of signals, voltage withstand level, short-circuit behavior, maximum stray
capacitance and cable length
 Interface mechanical characteristics, pluggable connectors and pin identification
 Functions of each circuit in the interface connector
 Standard subsets of interface circuits for selected telecom applications

The standard does not define such elements as character encoding (for example, ASCII,
Baudot or EBCDIC), or the framing of characters in the data stream (bits per character,
start/stop bits, parity). The standard does not define protocols for error detection or
algorithms for data compression.

The standard does not define bit rates for transmission, although the standard says it is
intended for bit rates lower than 20,000 bits per second. Many modern devices can exceed
this speed (38,400 and 57,600 bit/s being common, and 115,200 and 230,400 bit/s making
occasional appearances) while still using RS-232 compatible signal levels.

Details of character format and transmission bit rate are controlled by the serial port
hardware, often a single integrated circuit called a UART that converts data from parallel
to serial form. A typical serial port includes specialized driver and receiver integrated
circuits to convert between internal logic levels and RS-232 compatible signal levels.

5.4.7 Circuit Working Description

In this circuit the MAX-232 IC used as level logic converter. The MAX-232 is a dual
driver/receiver that includes a capacive voltage generator to supply EIA 232 voltage
levels from a single 5V supply. Each receiver converts EIA-232 to 5V TTL/CMOS
levels. Each driver converts TLL/CMOS input levels into EIA-232 levels.

Dept. of PG Studies, VTU, Belgaum 75


Reliable Data Transmission in ZigBee Based Health Monitoring System

Fig 5.17 Function Tables

Fig 5.18 Logic Diagram

In this circuit the microcontroller transmitter pin is connected in the MAX-232 T2IN pin
which converts input 5V TTL/CMOS level to RS-232 level. Then T 2 OUT pin is
connected to reviver pin of 9 pin D type serial connector which is directly connected to
PC.

In PC the transmitting data is given to R 2 IN of MAX-232 through transmitting pin of 9


pin D type connector which converts the RS-232 level to 5V TTL/CMOS level. The R 2
OUT pin is connected to receiver pin of the microcontroller. Likewise the data is
transmitted and received between the microcontroller and PC or other device vice versa.

Dept. of PG Studies, VTU, Belgaum 76


Reliable Data Transmission in ZigBee Based Health Monitoring System

5.5 RF Module Operation


5.5.1 Serial Communications
The XBee/XBee-PRO OEM 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.
(For example, through a digipropritery RS-232 or USB interface board).

5.5.2 UART Data Flow

Devices that have a UART interface can connect directly to the pins of the RF module as
shown in the figure below.

Figure 5.19 System Data Flow Diagram in a UART-interfaced environment


(Low-asserted signals distinguished with horizontal line over signal name)

5.5.3 Serial Data

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.

Dept. of PG Studies, VTU, Belgaum 77


Reliable Data Transmission in ZigBee Based Health Monitoring System

Figure 5.20 UART data packet 0x1F (decimal number “31”) as


transmitted through the RF module. Example Data form at is 8-N-
1(bits-parity- # of stop bits)

The module UART performs tasks, such a 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).

5.5.4 Transparent Operation

By default, XBee/XBee-PRO 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.

5.5.5 Serial-to-RF Packetization

Data is buffered in the DI buffer until one of the following causes the data to be
packetized and transmitted:

i. 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.
ii. The maximum number of characters that will fit in an RF packet (100) is received.
iii. The Command Mode Sequence (GT + CC + GT) is received. Any character buffered
in the DI buffer before the sequence is transmitted.

If the module can not 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 over
flow (loss of data between the host and module).

5.5.6 API Operation

Dept. of PG Studies, VTU, Belgaum 78


Reliable Data Transmission in ZigBee Based Health Monitoring System

API (Application Programming Interface) operation is an alternative to the default


Transparent Operation. The frame based API extends the level to which a host application
can interact with the networking capabilities of the module. When in API mode, all data
entering and leaving the module is contained in frames that define operations or events
within the module.

Transmit Data Frames (received through the DI pin (pin 3)) include :

 RF Transmit Data Frame


 Command Frame (equivalent to AT commands)

Receive Data Frames (sent out the DO pin (pin 2)) include :

 RF received data frame


 Command response
 Event notifications such as reset, associate, disassociate, etc..

The API provides alternative means of configuring modules and routing data at the host
application layer. A host application can send data frames to the module that contain
address and payload information instead of using command mode to modify addresses.
The module will send data frames to the application containing status packets; as well as
source, RSSI and payload information from received data packets.

The API operation option facilities many operations such as the examples cited below :
 Transmitting data to multiple destinations without entering Command Mode.
 Receive success/failure status of each transmitted RF packet.
 Identify the source address of each received packet

5.5.7 Flow Control

Fig 5.21
Internal Data Flow Diagram

DI (Data In) Buffer

Dept. of PG Studies, VTU, Belgaum 79


Reliable Data Transmission in ZigBee Based Health Monitoring System

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(DI07
configuration) parameter].CTS is re-asserted after the DI buffer has 34 bytes of memory
available.

How to Eliminate the need for Flow Control

i. Send messages that are smaller than the DI buffer size (202 bytes).
ii. Interface at a lower baud rate 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 (DI06 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 :
i. 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.
ii. 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.

Dept. of PG Studies, VTU, Belgaum 80


Reliable Data Transmission in ZigBee Based Health Monitoring System

Dept. of PG Studies, VTU, Belgaum 81


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 6

PROGRAMMING

In this chapter the code program written in embedded c is described below. This code is
used to accept the digital bit available at the 9 pin RS 232 port. so that the input signal is
converted and displayed in the PC’s screen.

#include<pic.h> // Headrer file for PIC Microcontroller


#include<stdio.h> // C Header file
#include "delay.c" // Delay file for entire process
__CONFIG(0x3f72); // Defined configuration setting for pic microcontroller
unsigned char Temp; // Variable declaration
unsigned char RecDat=0;
unsigned char Set=0;
unsigned char temp(void); // Function prototype declaration
void Serial_init(void);
void GetLM35(void);
void GetADC1(void);
void GetADC2(void);
void ADC_init(void);
void interrupt serial_int(void) // Interrupt service routing for data processing
{
if(RCIF)
{
RecDat=RCREG;
if(RecDat=='P')
{
Set=1;
}
RCIF=0;
}

Dept. of PG Studies, VTU, Belgaum 82


Reliable Data Transmission in ZigBee Based Health Monitoring System

void main() // Main application file


{
unsigned int data;
TRISA=0xff; // Analog port initialization
OPTION=0x28; // prescalar to WDT 1:2
ADCON1=0x02; // Configuring Ports
INTCON=0xc0; // Interrupt function control register defined here
TMR0=0; // Initialized timer here

Serial_init(); // Serial communication function call


RCIE=1; // Initialize Serial receive interrupt and flags
RCIF=0;
DelayMs(10); // Wait for spcific time period

while(1) // Specific application written


{
Temp=temp(); // Getting temp sensor values from a2d
data=TMR0;

while(TXIF==0); // Check data transmitted/not


TXREG = 0xAB; // Transmit reference data for human Temperature
DelayMs(1000); // Data transferring time
TXREG = 0xD1; // Transmit reference data 2 for human Temperature
DelayMs(1000);
TXREG = Temp; // Transfer human temperature to zigbee module
DelayMs(1000);
TXREG = 0xAB; // Transfer reference value for heart beat data
DelayMs(1000);
TXREG = 0xD2;
DelayMs(1000);
TXREG = bpValue;
DelayMs(1000);

Dept. of PG Studies, VTU, Belgaum 83


Reliable Data Transmission in ZigBee Based Health Monitoring System

if(Set==1) // Check data received from remote server


{
Set=0;
TXREG = 0xAB; // Trasmits reference and heart beat of the
person per second
DelayMs(1000);
TXREG = 0xD2;
DelayMs(1000);
TXREG = data;
DelayMs(1000);
TMR0=0; // Reset timer 0
}
}
}

unsigned char temp() // Convert human temperature analog to digital form


{
ADCON0=0x41; // Initialize a2D operations
DelayMs(1);
ADGO=1;
while(ADGO==1); // Check conversion ended/not
return ADRESH; // Transfer retrived data
}

void GetLM35(void)
{
ADCON0=0x41;
DelayMs_LCD_USART(1);
ADGO=1;
while(ADGO==1);
temp=ADRESH;
ADRESL=ADRESL>>6;
temp=temp<<2;
temp=temp+ADRESL;

Dept. of PG Studies, VTU, Belgaum 84


Reliable Data Transmission in ZigBee Based Health Monitoring System

LM35=temp*100/204.9;
}
void GetADC1(void)
{
ADCON0=0x49;
DelayMs_LCD_USART(1);
ADGO=1;
while(ADGO==1);
temp=ADRESH;
ADRESL=ADRESL>>6;
temp=temp<<2;
POT1=(temp+ADRESL)/204.8;
}
void GetADC2(void)
{
ADCON0=0x51;
DelayMs_LCD_USART(1);
ADGO=1;
while(ADGO==1);
temp=ADRESH;
ADRESL=ADRESL>>6;
temp=temp<<2;
POT2=(temp+ADRESL)/204.8;
}

unsigned char bpFunction()


{
unsigned char a2dBp;

ADCON0=0x51;
DelayMs(1);
ADGO=1;
while(ADGO==1);
a2dBp=ADRESH;

Dept. of PG Studies, VTU, Belgaum 85


Reliable Data Transmission in ZigBee Based Health Monitoring System

//a2dBp=200-a2dBp;

return a2dBp;
}

void ADC_init(void)
{
TRISA = 0xff;
ADCON1 = 0x04;
}

void Serial_init() // Serial communication definition


{
TRISC=0xc0;
TXSTA=0x24; // Transmit status initialized here
SPBRG=64; // Baudrate defined
RCSTA=0x90; // Receive status control here
TXIF=1; // Transmit flag initialized
}

Dept. of PG Studies, VTU, Belgaum 86


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 7

RESULTS

The fundamental aim of this project is to design a prototype wireless health monitoring
system which enables to monitor the temperature and heartbeat of the patient by using
ZigBee technology and display the parameter on the PC’s screen using java. LM 35 is
used as temperature sensor and the heart beat sensor which was locally manufactured has
been purchased(The photograph of the heart beat sensor has displayed in chapter 5). The
components used in the circuit are readily available. The individual sub-circuits have
been designed on PCB and tested for functioning in the laboratory. ZigBee targets
applications not addressable by Bluetooth or any other wireless standard. The screen shot
of the patients physiological details i.e. patients name, heartbeat and temperature which
are displaying in the control room PC are shown below.

Dept. of PG Studies, VTU, Belgaum 87


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 8

DISCUSSIONS

The market for wireless sensor networks is expected to grow rapidly in the near future.
ZigBee technology may contribute to this development, since they can easily be
connected to various type of sensors and to build up wireless networks. Our modules are
small, but the size can be reduced even more. The availability of the interoperability
between different brands of ZigBee devices, the ZigBee standard may be the dominating
standard for wireless sensor networks in the future. One important advantage of ZigBee
over other wireless standards is the low price. One should also notice that the IEEE
802.15.4 transceiver can be used to build custom networks, without using the ZigBee
network structure.

Dept. of PG Studies, VTU, Belgaum 88


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 9

CONCLUSIONS

9.1 Conclusion

This thesis work has shown that ZigBee can be seen as a complement to other
standards,i.e., Bluetooth and IEEE 802.11 WLAN. ZigBee is not competing in the same
market segment as either Bluetooth or WLAN. One very important factor for the success
of ZigBee is the interoperability. A remote controller from, i.e., Philips must be able to
operate a Samsung TV. The three major advantages of ZigBee are low price, long
covering range and low energy consumption.

The ZigBee based wireless health monitoring system is essentially a design and
implementation project of wireless technology. To approach a project like this a parallel
path has to be taken in regards to the theory and the practical circuitry. For a successful
conclusion in any project the paths must meet and this only happens when they are fully
understood. This is what made the overall project challenging and rewarding. The
prototype health monitoring system which has been developed with temperature and heart
beat sensors is essentially quite a simple one, and it is this simplicity which partly brings
it down when it comes to the real time applications.

9.2 Future Scope


The zigbee technology can be wide used for home and industrial automation. Its lead to
the cheap wireless technology, so that it can be widely used for low rate data transfer. It
can also be used for the remote control unit like toys,etc. Zigbee is the best for where the
battery is replaced very rarely.

Recent technological advances in wireless networking, microelectronics integration and


miniaturization, sensors, and the Internet allow us to fundamentally modernize and
change the way health care services are deployed and delivered. A number of tiny
wireless sensors, strategically placed on the human body, create a wireless body area
network that can monitor various vital signs, providing real-time feedback to the user and
medical personnel. The wireless body area networks promise to revolutionize health
monitoring. However, designers of such systems face a number of challenging tasks, as

Dept. of PG Studies, VTU, Belgaum 89


Reliable Data Transmission in ZigBee Based Health Monitoring System

they need to address often quite conflicting requirements for size, operating time,
precision, and reliability.

One of the most promising approaches in building wearable health monitoring systems
utilizes emerging wireless body area networks (WBANs). A WBAN consists of multiple
sensor nodes,each capable of sampling, processing, and communicating one or more vital
signs (heart rate, blood pressure, oxygen saturation, activity) or environmental parameters
(location, temperature, humidity,light). Typically, these sensors are placed strategically
on the human body as tiny patches or hidden in users’ clothes allowing ubiquitous health
monitoring in their native environment for extended periods of time.

Dept. of PG Studies, VTU, Belgaum 90


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 10

BIBLIOGRAPHY

[ 1] Behrouz A. Frouzan, “Data Communication”, Third Edition, Tata McGraw-Hill


Publishing company Limitted, 2004
[ 2] Andrew S. Tenenbaum, “Computer Networks”, Fourth Edition Pearson
Publication Limited, 2003
[ 3] William Stalling, “Wireless Communication and Networks”, Fourth Edition,
Pearson Publication Limited, 2004
[ 4] James Kurose & Keith W. Ross, “Computer Networks”, Fourth Edition,
Pearson Publication Limited.
[ 5] William Stallings, “Wireless Communication and Networking”, Prenctice Hall
2002.
[ 6] B. Razavi, “RF Microelectronics”, Prentice Hall 1998
[ 7] William C. Craig, “Wireless Control That Simply Works”
[ 8] Ed Callaway, P. Gorday, L. Hester, J.A. Gutierrez, M. Neave, B. Heile, V. Bahl,
“Home networking with IEEE 802.15.4: A developing standard for low-rate
wireless personal area networks”
[ 9] Martin P. Bates, “Programming 8-bit PIC micro controllers in C”
[10] Johan Lonn, Jonas Olsson, Shaofang Gong,“ ZigBee-ready modules for sensor
networking”
[11] Prevailing over Wires in Healthcare Environments: Benefits and Challenges,
David Cypher, Nicolas Chevrollier, Nicolas Montavont, and Nada Golmie,
National Institute of Standards and Technology.
[12] E. Jovanov, A. Milenkovic, C. Otto, P. De Groen, B. Johnson, S. Warren, and G.
Taibi,“A WBAN System for Ambulatory Monitoring of Physical Activity and
Health Status: Applications and Challenges”
[13] Clyde Saldanha, “The Journal on Information Technology in Healthcare”
[14] ZigBee Alliance, http://www.zigbee.org/
[15] IEEE 802.15.4 standarad 2003, http://www.cmi.ac.in/~sdatta/networks/standards/802.15.4-
2003.pdf.
[16] ZigBee wireless center, http://www.palowireless.com/zigbee/

Dept. of PG Studies, VTU, Belgaum 91


Reliable Data Transmission in ZigBee Based Health Monitoring System

[17] Homepage of IEEE 802.15 WPAN Task Group 4 (TG4),


http://grouper.ieee.org/groups/802/15/pub/TG4.html
[18] PIC Microcontroller, “ www.embedded.com “
[19] ZigBee tutorial, http://www.tutorial-reports.com/wireless/zigbee
[20] Need for ZigBee, http://rfdesign.com/next_generation_wireless/who-needs-
zigbee/
[21] ZigBee Alliance,Frequently Asked Questions,www.Zigbee.org/
[22] Data sheet of PIC microcontroller,
http://www.datasheetcatalog.com/datasheets_pdf/1/6/F/8/16F877.shtml
[23] MPLAB IDE user’s guide,
http://ww1.microchip.com/downloads/en/devicedoc/51519a.pdf
[24] Data sheet of MAX 232, http://focus.ti.com/docs/prod/folders/print/max232.html
[25] ZigBee Alliance tutorial, http://www.zigbee.org/en/resources/presentations.asp

Dept. of PG Studies, VTU, Belgaum 92


Reliable Data Transmission in ZigBee Based Health Monitoring System

CHAPTER 11

APPENDICES

A. PIC Evaluation Board

Power Connector Heart Beat Sensor PIC16F877A

Power
Supply

Serial Port
Connector

Level Convertor Temp. Push Button


Sensor Switch

Dept. of PG Studies, VTU, Belgaum 93


Reliable Data Transmission in ZigBee Based Health Monitoring System

B. Bill of Material

Description Designator Quantity Value


Connector JP1 1
Semiconductor Diode DB106 4
Electrolyte Capacitor C5 1 470 MF/25v
Regulator 7805 U2 1
Electrolyte Capacitor C6 1 100 MF/16v
LED D3 1
Resistor R3 1 330 ohms
Max232 IC U1 1
Electrolyte Capacitor C1,C2,C3,C4 4 10 MF
Serial Port Connector P1 1
PIC Micro Controller U3 1
Crystal X1 1 10 MHz
Capacitor C9,C10 2 22 PF
Temperature Sensor LM 35 1
Heart Beat Sensor - 1
Push Button Switch SW3 1
XBee Pro 2

Dept. of PG Studies, VTU, Belgaum 94


Reliable Data Transmission in ZigBee Based Health Monitoring System

C Data sheets of Xbee Pro and PIC 16F877A

Table C.1 Data Sheet for the XBee-PRO OEM RF Modules

Dept. of PG Studies, VTU, Belgaum 95


Reliable Data Transmission in ZigBee Based Health Monitoring System

Figure C.1 Data Sheet for the PIC16F877A

Dept. of PG Studies, VTU, Belgaum 96


Reliable Data Transmission in ZigBee Based Health Monitoring System

D Comparison of Wireless Technologies

UWB
802.11 (Ultra Wireles IR
ZigBee Bluetooth
(Wi-Fi) Wide s USB Wireless
Band)
20-40
Kbits/s
115
20, 40, and 11 & 54 100-500 62.5
Data Rate 1 Mbits/s Kbits/s
250 Kbits/s Mbits/sec Mbits/s Kbits/s
4 & 16
Mbits/s

<10
10-100 50-100 <10 10 meters
Range 10 meters
meters meters meters meters (line of
sight
Ad-hoc,
Ad-hoc,
peer to
Networking Point to very Point to Point to Point to
peer, star,
Topology hub small point point point
or mesh
networks
868 MHz
(Europe)
900-928
Operating MHz (NA), 2.4 and 5 3.1-10.6 800-900
2.4 GHz 2.4 GHz
Frequency 2.4 GHz GHz GHz nm
(worldwide
)

Complexity
(Device and
Low High High Medium Low Low
application
impact)
UWB
802.11 (Ultra Wireles IR
ZigBee Bluetooth
(Wi-Fi) Wide s USB Wireless
Band)
Power
Very low
Consumptio
(low power
n (Battery High Medium Low Low Low
is a design
option and
goal)
life)
128 AES
plus 64 and
Security application 128 bit
layer encyption
security
Other Devices Device Device

Dept. of PG Studies, VTU, Belgaum 97


Reliable Data Transmission in ZigBee Based Health Monitoring System

UWB
802.11 (Ultra Wireles IR
ZigBee Bluetooth
(Wi-Fi) Wide s USB Wireless
Band)
can join an
connectio connectio
existing
n requires n requires
Information network in
3-5 up to 10
under 30ms
seconds seconds
Industrial
Wireless
control and
connectivi Streami
monitoring, Wireless
ty ng Remote
sensor LAN PC
between video, controls,
networks, connectiv peripher
Typical devices home PC, PDA,
building ity, al
Applications such as entertai phone,
automation, broadban connecti
phones, nment laptop
home d Internet ons
PDA, applicati links
control and access
laptops, ons
automation,
headsets
toys, games

Dept. of PG Studies, VTU, Belgaum 98


Reliable Data Transmission in ZigBee Based Health Monitoring System

E ZigBee and Bluetooth are competitors or complements?


The “Why ZigBee” question has always had an implied, but never quite worded follower
phrase “…when there is Bluetooth”.

Figure E.1 THE BASIC RADIO CHARACTERSTIC

Bluetooth seems best suited for :

 Synchronizing cell phone to PDA


 Hands-free audio
 PDA to printer

While ZigBee is better suited for :


 Controls
 Sensors
 Lots of devices

Dept. of PG Studies, VTU, Belgaum 99


Reliable Data Transmission in ZigBee Based Health Monitoring System

 Low duty cycle


 Small data packets
 Long battery life is critical

Air Interface Comparison:


ZigBee Bluetooth
DSSS FHSS
11 chips/ symbol 1600 hops / second
62.5 K symbols/s 1 M symbol / second
4 Bits/ symbol 1 bit / symbol
Peak Information Rate : Peak Information Rate :
~128 Kbit/second ~108 - 723 Kbit/second

Timing Considerations:

ZigBee

 New slave enumeration = 30ms typically


 Sleeping slave changing to active = 15ms typically
 Active slave channel access time = 15ms typically

Bluetooth
 New slave enumeration = >3s, typically 20s
 Sleeping slave changing to active = 3s typically
 Active slave channel access time = 2ms typically

Hence, ZigBee devices can quickly attach, exchange information, detach, and then go to
deep sleep to achieve a very long battery life. Bluetooth devices require about ~100X the
energy for this operation.

Dept. of PG Studies, VTU, Belgaum 100


Reliable Data Transmission in ZigBee Based Health Monitoring System

Power Considerations :

ZigBee

 2+ years from normal batteries


 Designed to optimize slave power requirements
Bluetooth

 Power model as a mobile phone (regular daily charging)


 Designed to maximize ad-hoc functionality

ZigBee has an inherent advantage due to its short attach time and/or its ability to remain
in the sleep mode for long periods.
In terms of protocol stack size, ZigBee‟s 32 KB is about one-third of the stack size
necessary in other wireless technologies (for limited capability end devices, the stack size
is as low as 4 KB).

Comparison Summary
 In a gist, ZigBee and Bluetooth are two solutions for two different application areas.
 The differences are from their approach to their desired application. Bluetooth has
addressed a voice application by embodying a fast frequency hopping system with a
master slave protocol. ZigBee has addressed sensors, controls, and other short
message applications by embodying a direct sequence system with a star or peer to
peer protocols.
 Minor changes to Bluetooth or ZigBee won‟t change their inherent behavior or
characteristics. The different behaviors come from architectural differences.

Dept. of PG Studies, VTU, Belgaum 101


Reliable Data Transmission in ZigBee Based Health Monitoring System

F. ZigBee Health Care FAQ


1. Do ZigBee devices affect the human body?

ZigBee operates at power levels similar to Bluetooth devices and at significantly


lower levels of average cell phones. Also, ZigBee's duty cycles (the amount of time
the radios are actually on versus off) are thousands of times less than Bluetooth
devices. There are hundreds of millions of wearable Bluetooth headsets sold every
year, and a billion cell phones used everyday.

2. Other devices operate in the ISM bands, will they cause any problems for
medical devices using ZigBee?

ZigBee is very robust and has demonstrated superb tolerance to extreme interference.
The Las Vegas Convention Center is one of worst places for wireless devices,
especially during the annual Consumer Electronics Show. Interference at that show
often impedes many cell phones and Bluetooth headsets from operating correctly.
ZigBee has always performed flawlessly in these extreme environments. For more
details, please see the results of extensive coexistence research in the white
papers section of the ZigBee website.

3. ZigBee uses Mesh-Networking, what are the advantages compared to other


approaches?

Radios in a mesh network can talk to many other radios (devices) in the network, not
just one. The result is that each data packet communicated across a wireless mesh
network can have multiple possible paths to its destination. This flexibility makes the
mesh network very flexible for accommodating interference in the radio spectrum or
something blocking the radio path. Wireless mesh networks also enable networks to
grow in size and cover greater physical distances. Point-to-point and point-to-
multipoint topologies mean the data packet only has a single path to follow and is
therefore more vulnerable to interference or blockage. Their ability to cover greater
physical distances is limited and the access point in star networks can only talk to a
small number of radios on the network.

Dept. of PG Studies, VTU, Belgaum 102


Reliable Data Transmission in ZigBee Based Health Monitoring System

4. How easy is it to add devices to a ZigBee network?

Very easy. ZigBee's pairing process allows for fast and easy association between
devices. Additionally, ZigBee offers a variety of routing algorithms for data packets
to find the correct destination, including hierarchical tree, neighbor, and table-based
routing. These approaches result in a high degree of flexibility and stability ensuring
that devices in the network stay connected and that network performance remains
constant even as it is dynamically changing.

5. Is Z-Wave really a standard?

Unlike ZigBee, Z-Wave is based on technology owned by a single company. This


proprietary technology is not available on equal competitive terms to multiple
semiconductor manufacturers and limits competition and constricts the supply chain.
ZigBee is an open, publicly available standard equally available to all. As a result
there are multiple competitive sources of supply for ZigBee semiconductors creating
more choice for product manufacturers. ZigBee also offers more performance at a
lower cost, and provides more standards for use in other markets including health
care, energy management and home automation.

6. How does ZigBee address security for confidential medical data given that
information is literally flying through the air?

ZigBee was developed with many layers of security. At the strongest level, ZigBee
uses AES 128 encryption (government, commercial and military grade encryption
used across the Internet). In addition, ZigBee defines a security toolbox for key
generation and distribution that can support multiple modes for residential,
commercial, and even industrial applications. The ZigBee Health Care public
application profile has specific security features for rapid key generation and
distribution suitable in the medical environments insuring privacy and integrity. No
other solution offers a comparable security system.

Dept. of PG Studies, VTU, Belgaum 103


Reliable Data Transmission in ZigBee Based Health Monitoring System

7. If I purchase certified ZigBee Health Care devices from different vendors


will they communicate and interoperate with each other?

Yes. ZigBee has developed a rigorous certification procedure for each of the available
public application profiles. The certification procedure is performed by independent
third parties on an anonymous basis. This testing ensures full interoperability between
ZigBee devices using the same public application profile.

Dept. of PG Studies, VTU, Belgaum 104


Reliable Data Transmission in ZigBee Based Health Monitoring System

G. Expert View
ZigBee well suited for Rural India

Convergence Plus met Andy Wheeler, chief technology officer,

Ember, to discuss the developments taking place in the ZigBee

space globally. Excerpts from the interview.

Convergence Plus: What is ZigBee technology?

Andy Wheeler: ZigBee is an embedded wireless network standard that solves the unique
needs of remote monitoring and control, and sensor network applications. It is the set of
specs built around the IEEE 802.15.4 wireless protocol. The name "ZigBee" is derived
from the erratic zigging patterns that bees make between flowers when collecting pollen.
This is evocative of the invisible Webs of connections existing in a fully wireless
environment. A group known as the ZigBee Alliance, with over 150 members worldwide,
regulates the standard itself.

The technology is designed to provide highly efficient connectivity between small packet
devices. As a result of its simplified operations, which are one to two full orders of
magnitude less complex than a comparable Bluetooth device, pricing for ZigBee devices
is extremely competitive, with full nodes available for a fraction of the cost of a Bluetooth
node.

CP: What are the general characteristics of this technology?

AW: ZigBee enables very low-power networking devices, which can typically operate for
five years powered by a single household battery, eliminating the need for end devices to
be plugged into electrical power. While battery life is ultimately a function of battery
type, capacity and end-use application, the ZigBee protocol was designed from the
ground up to support very long life battery applications. ZigBee is highly reliable and
scalable due to its ability to automatically form self-organising, self-healing networks.
Also, ZigBee networks are simple and inexpensive to deploy.
Dept. of PG Studies, VTU, Belgaum 105
Reliable Data Transmission in ZigBee Based Health Monitoring System

CP: What sort of applications can be offered using this technology?

AW: ZigBee is suited to a wide range of building automation, industrial, medical and
residential control and monitoring applications. Essentially, applications that require
interoperability and/or the RF performance characteristics of the IEEE 802.15.4 standard
would benefit from a ZigBee solution. Some of its applications include, lighting controls,
automatic meter reading, wireless smoke and CO detectors, HVAC control, heating
control, home security, environmental controls, blind, drapery and shade controls,
medical sensing and monitoring, universal remote control to a set-top box, etc.

CP: What would be the target market for ZigBee devices in India and globally?

AW: ZigBee would be ideal for any low-power, low-data-rate sensor or control network
in India and elsewhere where the cost and complexity of installing wired networks is cost-
prohibitive. For example, ZigBee is proving to be a great solution for automatically
monitoring electric, gas and water meters in Chinese households and apartments to
accommodate the country’s enormous housing boom. India is experiencing a similar
building boom due largely to the growth of its economy and of the middle class. ZigBee
is well-suited in rural areas of India for monitoring the condition of bridges, roads, dams,
environmental controls, etc.

CP: What is the role of ZigBee Alliance in pushing the technology?

AW: The ZigBee Alliance is an association of companies working together to enable


reliable, cost-effective, low-power, wirelessly networked, monitoring and control
products based on an open global standard.

Its goal is to provide the consumer with ultimate flexibility, mobility, and ease-of-use by
building wireless intelligence and capabilities into everyday devices. ZigBee will be
embedded in a wide range of products and applications across consumer, commercial,
industrial and government markets worldwide. For the first time, companies will have a
standards-based wireless platform optimised for the unique needs of remote monitoring
and control applications, including simplicity, reliability, low-cost and low-power.

It focuses on defining the network, security and application software layers; providing
interoperability and conformance testing specifications; promoting the ZigBee brand
globally to build market awareness and managing the evolution of technology.

Dept. of PG Studies, VTU, Belgaum 106


Reliable Data Transmission in ZigBee Based Health Monitoring System

CP: ZigBee is still in a nascent stage. How do you see this technology taking off in
India and globally?

AW: We believe 2006 will be a breakout year for ZigBee. Ember already has many OEM
customers shipping products today, and we’re not alone. More than 200 companies have
joined the ZigBee Alliance. The first market to take off will probably be in building and
home automation and control. There are a number of global companies like Siemens and
Hitachi developing such products for worldwide distribution. We are also seeing more of
the big semiconductor companies getting into the ZigBee market, including Motorola,
Texas Instruments and STMicroelectronics.

CP: What unique features is it capable of offering?

AW: ZigBee was created to address the market need for a cost-effective, standards-based
wireless networking solution that supports low data-rates, low-power consumption,
security, and reliability. ZigBee is the only standards-based technology that addresses the
unique needs of most remote monitoring and control and sensory network applications.

CP: India being a cost-sensitive market, how is ZigBee suited for this marketplace?

AW: ZigBee is a low-cost solution for low-power applications. Implementation of this


wireless solution in applications that currently need wires will significantly reduce costs.
Also, the efficiencies obtained by deploying these self organising, and self healing
networks will mean lower total cost of ownership (TCO).

CP: Will ZigBee compete or complement Bluetooth?

AW: Not really compete. ZigBee is a complement to Bluetooth where both are used for
different applications. ZigBee is designed for low-power, low-data-rate sensing and
control applications that can span long distances and many devices. Bluetooth is designed
as a cable-replacement technology for peripherals. Bluetooth networks support higher
bandwidths between just a few devices over shorter distances.

CP: What initiatives are being taken to push applications based on ZigBee?

AW: OEMs have already started shipping products in a variety of applications, including
home control, home automation, building automation, and automatic meter reading.
ZigBee has established a process for compliance testing and certification, and ZigBee
member companies are assisting its customers in designing a variety of innovative
applications.

Dept. of PG Studies, VTU, Belgaum 107

You might also like