CHAPTER 1
1.1 INTRODUCTION
One of the most widely used wireless technologies in WBANs is ZigBee because it is
targeted at applications that require a low data rate and long battery life. However,
ZigBeebased WBANs face severe interference problems in the presence of WiFi networks.
This problem is caused by the fact that most ZigBee channels overlap with WiFi channels,
severely affecting the ability of healthcare monitoring systems to guarantee reliable delivery
of physiological signals. To solve this problem, we have developed an algorithm that controls
the load in WiFi networks to guarantee the delay requirement for physiological signals,
especially for emergency messages, in environments with coexistence of ZigBee based
WBAN and WiFi. Since WiFi applications generate traffic with different delay requirements,
we focus only on WiFi traffic that does not have stringent timing requirements. Therefore an
adaptive load control algorithm for ZigBee-based WBAN/WiFi coexistence environments,
with the aim of guaranteeing that the delay experienced by ZigBee sensors does not exceed a
maximally tolerable period of time. Zigbee is subject to interference from coexisting from
wifi devices. This is because the transmit power of wifi is 5-20 dB stronger than that of
zigbee
CHAPTER 1
Chapter 1 includes the introduction of coexistence of zigbee based wban and wifi for health
telemonitoring systems.
Coexistence of zigbee-based Wban and
CHAPTER 2
Chapter 2 deals with the concept of aim, components, proposed method of the project.
CHAPTER 3
CHAPTER 4
Chapter 4 deals with the hardware implementation of project development and project
designLPC2148 microcontroller, ARM processor overview, history and development of
microcontroller and LPC2148 ADC features, operation and interrupts, LCD, pin functions
and LCD basic commands and ZIGBEE introduction, key features, characteristics, traffic
types and applications and ECG introduction and PR, QT intervals and wifi module
introduction, description. It also deals with the softwares used i.e., Keil (MDK474) and steps
to write an assembly language program in Keil and how to compile it.
CHAPTER 5
CHAPTER 6
CHAPTER 7
2
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
CHAPTER 2
2.1 AIM:
The main aim of this project is to send the patient information to the cloud.
2.2 COMPONENTS:
Here a WBAN system which consists of different sensors attached to a human body
need to update its data to remote place. Thus to send the information to the remote area we
are developing a WBAN consists of co-ordinator which accepts all the data and send that to
the cloud. And from the cloud it again can be viewed by any mobile device like mobile or
tablet. To demonstrate this, here we are developing a node consists of ECG and temperature
sensor which takes and sends the data to the co-ordinator, through which the data will be
updated to the cloud. As the internet is provided to this wifi from the Access point and push
to the IOT cloud, where the cloud will produce analytic based dashboard in real-time, which
can be accessed from any-where of the world by web. And each patient is recognized from
his ID and different channel in IOT cloud.
CHAPTER 3
3
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
The development of telemonitoring via wireless body area networks (WBANs) is an evolving
direction in personalized medicine and home-based mobile health. A WBAN consists of
small, intelligent medical sensors which collect physiological parameters such as EKG
(electrocardiogram), EEG (electroencephalography) and blood pressure. The recorded
physiological signals are sent to a coordinator via wireless technologies, and are then
transmitted to a healthcare monitoring center. One of the most widely used wireless
technologies in WBANs is ZigBee because it is targeted at applications that require a low
data rate and long battery life. However, ZigBee-based WBANs face severe interference
problems in the presence of WiFi networks. This problem is caused by the fact that most
ZigBee channels overlap with WiFi channels, severely affecting the ability of healthcare
monitoring systems to guarantee reliable delivery of physiological signals. To solve this
problem, we have developed an algorithm that controls the load in WiFi networks to
guarantee the delay requirement for physiological signals, especially for emergency
messages, in environments with coexistence of ZigBee based WBAN and WiFi. Since WiFi
applications generate traffic with different delay requirements, we focus only on WiFi traffic
that does not have stringent timing requirements. Therefore, an adaptive load control
algorithm for ZigBee-based WBAN/WiFi coexistence environments, with the aim of
guaranteeing that the delay experienced by ZigBee sensors does not exceed a maximally
tolerable period of time. Simulation results show that our proposed algorithm guarantees the
delay performance of ZigBee-based WBANs by mitigating the effects of WiFi interference in
various scenarios.
4
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
CHAPTER 4
DESIGN IMPLEMENTATION
(HARDWARE OR SOFTWARE)
4.1 BLOCK DIAGRAM
5
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
6
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
6
DEPT OF ECE, SBIT KMM
Wifi for health telemonitoring systems
Transformer:
Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a
bridge rectifier is used because of its merits like good stability and full wave rectification.
7
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
Filter:
Capacitive filter is used in this project. It removes the ripples from the output of
rectifier and smoothens the D.C. Output received from this filter is constant until the
mains voltage and load is maintained constant. However, if either of the two is varied,
D.C. voltage received at this point changes. Therefore a regulator is applied at the output
stage.
Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage regulator is
an electrical regulator designed to automatically maintain a constant voltage level. In this
project, power supply of 5V and 12V are required. In order to obtain these voltage levels,
7805 and 7812 voltage regulators are to be used. The first number 78 represents positive
supply and the numbers 05, 12 represent the required output voltage levels
7
DEPT OF ECE, SBIT KMM
4.4 Embedded systems:
8
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Monitor the environment; embedded systems read data from input sensors. This data is then
processed and the results displayed in some format to a user or users
Control the environment; embedded systems generate and transmit commands for actuators.
Transform the information; embedded systems transform the data collected in some
Although interaction with the external world via sensors and actuators is an important
aspect of embedded systems, these systems also provide functionality specific to their
applications. Embedded systems typically execute applications such as control laws,
finite state machines, and signal processing algorithms.
9
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
There are many categories of embedded systems, from communication devices to home
appliances to control systems. Examples include;
Communication devices
Home Appliances
o CD player, VCR, microwave oven
Control Systems
10
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
9
DEPT OF ECE, SBIT KMM
11
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
required to handle multiple time-critical tasks. Devices under control of embedded systems
may also be physically distributed.
12
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
non-survivable fire conditions. These constraints present a unique set of challenges to the
embedded system designer, including accurately modeling the thermal conditions of these
systems.
One of the main reasons for embedding a computer is to interact with the
environment. This is often done by monitoring and controlling external machinery.
Embedded computers transform the analog signals from sensors into digital form for
processing. Outputs must be transformed back to analog signal levels. When controlling
13
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
physical equipment, large current loads may need to be switched in order to operate motors
and other actuators. To meet these needs, embedded systems may need large computer circuit
boards with many non-digital components. Embedded system designers must carefully
balance system tradeoffs among analog components, power, mechanical, network, and digital
hardware with corresponding software.
Many embedded computers are physically located within some larger system.
The form factor for the embedded system may be dictated by aesthetics. For example, the
form factor for a missile may have to fit inside the nose of the missile. One of the challenges
for embedded systems designers is to develop non-rectangular geometries for certain
solutions. Weight can also be a critical constraint. Embedded automobile control systems, for
example, must be light weight for fuel economy. Portable CD players must be light weight
for portability purposes.
Cost is an issue in most systems, but the sensitivity to cost changes can vary
dramatically in embedded systems. This is mainly due to the effect of computer costs have on
profitability and is more a function of the proportion of cost changes compared to the total
system cost.
14
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Security; these requirements are often specified as shall not requirements that define
unacceptable system behavior rather than required system functionality.
4.6.1Project development:
This chapter briefly explains about Hardware Implementation of the project. It discusses the
design and working of the design with the help of block diagram and circuit diagram and
explanation of circuit diagram in detail. It explains the features, timer programming, serial
communication, interrupts of LPC2148 microcontroller. It also explains the various modules
used in this project.
Hardware implementation
Firmware implementation
15
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
Hardware implementation deals in drawing the schematic on the plane paper according to the
application, testing the schematic design over the breadboard using the various ICs to find if
the design meets the objective, carrying out the PCB layout of the schematic tested on
breadboard, finally preparing the board and testing the designed hardware.
The firmware part deals in programming the microcontroller so that it can control the
operation of the ICs used in the implementation. In the present work, theKeil software
development tool to write and compile the source code, which has been written in the C
language. The progisp programmer has been used to write this compile code into the
microcontroller. The firmware implementation is explained in the next chapter.
The project design and principle are explained in this chapter using the block diagram and
circuit diagram. The block diagram discusses about the required components of the design
and working condition is explained using circuit diagram and system wiring diagram.
Coexistence of zigbee
ARM stands for Advanced RISC Machines. It is a 32 bit processor core, used for high end
Application.
16
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
1985.
RISC concept was introduced in 1980 at Stanford and Berkley.
ARM ltd was found in 1990.
ARM cores are licensed to partners so as to develop and fabricate new microcontrollers
around same processor cores.
Key features:
2. 8kB to 40kB of on-chip static RAM and 32kB to 512kB of on-chip flash memory.
128-bit wide interface/accelerator enables high-speed 60 MHz operation.
4. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the
On-chip Real Monitor software and high-speed tracing of instruction execution.
5. USB 2.0 Full-speed compliant device controller with 2kB of endpoint RAM.
6. One or two (LPC2141/42 vs. LPC2144/46/48) 10-bit ADCs provide a total of 6/14
Analog inputs, with conversion times as low as 2.44s per channel.
17
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
8. Two 32-bit timers/external event counters (with four capture and four compare
Channels each), PWM unit (six outputs) and watchdog
9. Low power Real-Time Clock (RTC) with independent power and 32 kHz clock
input.
10. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400kbit/s),
SPI and SSP with buffering and variable data length capabilities.
11. Vectored Interrupt Controller (VIC) with configurable priorities and vector addresses.
12. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
14.60 MHz maximum CPU clock available from programmable on-chip PLL with settling
Time of 100s.
15. On-chip integrated oscillator operates with an external crystal from 1 MHz to 25MHz.
17. Individual enable/disable of peripheral functions as well as peripheral clock scaling for
18. Processor wake-up from Power-down mode via external interrupt or BOD.
19. Single power supply chip with POR and BOD circuits.
20. CPU operating voltage range of 3.0 V to 3.6 V (3.3 V 10 %) with 5 V tolerant I/O Pads.
18
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Power-down mode.
4.10 Operation:
If the BURST bit in the ADCR is 0 and the START field contains 010-111, the ADC will start
a conversion when a transition occurs on a selected pin or Timer Match signal. The choices
include conversion on a specified edge of any of 4 Match signals, or conversion on a
specified edge of either of 2 Capture/Match pins. The pin state from the selected pad or the
selected Match signal, XORed with ADCR bit 27, is used in the edge detection logic.
4.11 Interrupts:
19
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
An interrupt request is asserted to the Vectored Interrupt Controller (VIC) when the DONE
bit is 1. Software can use the Interrupt Enable bit for the A/D Converter in the VIC to control
whether this assertion results in an interrupt. DONE is negated when the ADDR is read.
The AD0.n function must be selected in corresponding Pin Select register in order to get
accurate voltage readings on the monitored pin. For pin hosting an ADC input, it is not
possible to have a have a digital function selected and yet get valid ADC readings. An inside
circuit disconnects ADC hardware from the associated pin whenever a digital function is
selected on that pin.
LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs
(seven segment LEDs or other multi segment LEDs) because of the following reasons:
2. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which
are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task
of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying
the data.
These components are specialized for being used with the microcontrollers, which means
that they cannot be activated by standard IC circuits. They are used for writing different
messages on a miniature LCD
20
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
18
DEPT OF ECE, SBIT KMM
A model is low price and great possibilities most frequently used in practice. It is based on
the HD44780 microcontroller and can display messages in two lines with 16 characters each.
It displays all the alphabets, Greek letters, punctuation marks, mathematical symbols etc. In
addition, it is possible to display symbols that user makes up on its own. Automatic shifting
message on display (shift left and right), appearance of the pointer, backlight etc. are
considered as useful characteristics.
19
DEPT OF ECE, SBIT KMM
Wifi for health telemonitoring systems
There are pins along one side of the small printed board used for connection to the
microcontroller. There are total of 14 pins marked with numbers (16 in case the background
light is built in). Their function is described in the table 1 below:
21
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
Pin Logic
D
Number State
Function escriptio
n
Name
Ground 1 Vss - 0V
D0 D7 are interpreted
0 as
4 RS commands
1
D0 D7 are interpreted
as data
LCD)
0
Control of 5 R/W
1 Read data (from LCD to
22
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
operating
controller)
1 Normal operating
6 E
From 1 to Data/commands are
transferred
0 to LCD
8 D1 0/1 Bit 1
Data /
commands
9 D2 0/1 Bit 2
10 D3 0/1 Bit 3
11 D4 0/1 Bit 4
12 D5 0/1 Bit 5
23
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
13 D6 0/1 Bit 6
LCD screen consists of two lines with 16 characters each. Each character consists of
5x7 dot matrix. Contrast on display depends on the power supply voltage and whether
messages are displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied
on pin marked as Vee. The connections are as shown in figure 6.4. Some versions of displays
have built in backlight (blue or green diodes). When used during operating, a resistor for
current limitation should be used (like with any LE diode).
All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as
data, which depends on logic state on pin RS:
24
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
hich determine display mode. List of
RS = 0 - Bits D0 - D7 are commands w
commands which LCD recognizes.
21
DEPT OF ECE, SBIT KMM
Table 4.2: LCD Command description (binaryupdates.com/interface-lcd-with-lpc2148-arm7/)
Execution
Command RS RW D7 D6 D5 D4 D3 D2 D1 D0
Time
25
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
Write to CGRAM or
1 0 D7 D6 D5 D4 D3 D2 D1 D0 40uS
DDRAM
1 1 D7 D6 D5 D4 D3 D2 D1 D0 40uS
DDRAM
4.16LCD connections:
Depending on how many lines are used for connection to the microcontroller, there are
8bit and 4-bit LCD modes. The appropriate mode is determined at the beginning of the process in
a phase called initialization. In the first case, the data are transferred through outputs D0-D7 as
it has been already explained. In case of 4-bit LED mode, for the sake of saving valuable I/O pins
of the microcontroller, there are only 4 higher bits (D4-D7) used for communication, while other
may be left unconnected. Consequently, each data is sent to LCD in two steps: four higher bits
are sent first (that normally would be sent through lines D4-D7), four lower bits are sent
afterwards. With the help of initialization, LCD will correctly connect and interpret each data
26
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
received. Besides, with regards to the fact that data are rarely read from LCD (data mainly are
transferred from microcontroller to LCD) one more I/O pin may be saved by simple connecting
R/W pin to the Ground. Even though message displaying will
22
DEPT OF ECE, SBIT KMM
Be normally performed, it will not be possible to read from busy flag since it is not possible
to read from display.
4.17 ZIGBEE
27
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
4.17.1 INTRODUCTION
Home Automation
Telecommunication Applications
Personal Home
3. Mesh Networking-The ability to cover large areas with routers is one of the key features of
ZigBee that helps differentiate itself from other technologies. Mesh networking can extend
the range of the network through routing.
28
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
The focus of network applications under the IEEE 802.15.4 / ZigBee standard include
the features of low power consumption.
2.4GHz and 868/915 MHz dual PHY modes. This represents three license-free bands:
2.42.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
110) 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.
24
DEPT OF ECE, SBIT KMM
-based Wban and
Maximum data rates allowed for each of these frequency bands are fixed as 250 kbps @2.4
29
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
Channel access using Carrier Sense Multiple Access with Collision Avoidance (CSMA -
CA).
1. Data is periodic. The application dictates the rate, and the sensor activates, checks for data
and deactivates.
2. 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.
3. 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.
TRAFFIC ARCHITECHTURE:
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.
30
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Application framework
Wifi for health telemonitoring systems
Application profiles
PHYSICAL LAYER:
31
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
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 MAC provides network association and disassociation, has an optional super
frame structure with beacons for time synchronization, and a guaranteed time-slot mechanism
for high-priority communications.
NETWORK LAYER
32
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Zigbee 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 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.
SECURITY LAYER:
Security and data integrity are key benefits of the ZigBee technology. ZigBee leverages the
security model of the IEEE 802.15.4 MAC sub-layer which specifies four security services:
access controlthe 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 replayedthe 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.
33
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
4.19APPLICATIONS
ZigBee is well suited for a wide range of control uses in just about any market. The
Alliance has focused its standards development efforts around the commercial, residential,
energy, consumer and industrial sectors. It has developed global standards for energy
management and efficiency, home and building automation, health care and fitness, telecom
and consumer electronics. Here are just a few examples of what our standards control:
Demand Response
34
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Heating control
Wireless smoke and CO detectors
Home security
Blind, drapery and shade controls
Medical sensing and monitoring
Remote control of home entertainment systems
Indoor location sensing
Advertising on mobile devices
Overview:
There are many wireless monitoring and control applications for industrial and home
markets which require longer battery life, lower data rates and less complexity than available
from existing wireless standards like Bluetooth and Wi-Fi. So, there was a need for a standard
based, interoperable wireless technology that addresses the unique needs of low data rate
wireless control and sensor based networks. In this regard, zigbee was poised to become the
global control/sensor network standard.
35
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
4.20 ECG
4.20.1 Introduction
The AD8232 is a neat little chip used to measure the electrical activity of the heart. This
electrical activity can be charted as an ECG or Electrocardiogram. Electrocardiography is
used to help diagnose various heart conditions. Now for the disclaimer:
Coexistence of zigbee-
36
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
In this tutorial, we will go over the basics for getting your AD8232 Heart Rate Monitor up
and running. First, an overview of the board and all its features will be presented. Then, well
show you how hook it up to your favorite microcontroller and how to create visual data using
Processing.
Suggested Reading
If you are not familiar with any of the following concepts, you may want to review them
before moving ahead.
What is an Arduino?
Serial Communication
In general terms, lets look at what an ECG is representing and how were able to sense it.
The ECG is separated into two basic Intervals, the PR Interval and the QT Interval,
described below.
Note: All information comes from the Waves and Intervals section of the ECG Wikipedia
page.
37
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
38
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
PR Interval
39
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
The PR interval is the initial wave generated by an electrical impulse traveling from the right
atrium to the left. The right atrium is the first chamber to see an electrical impulse. This
electrical impulse causes the chambers to depolarize. This forces it to contract and drain
deoxygenated blood from both the Superior and Inferior vena cava into the right ventricle. As
the electrical impulse travels across the top of the heart it then triggers the left atrium to
contract. The left atrium is responsible for receiving newly oxygenated blood from the lungs
into the left ventricle via the left and right pulmonary veins. The pulmonary veins are red in
the diagram because they are carrying oxygenated blood. They are still called veins because
veins carry blood towards the heart.
QT Interval
The QT Interval is where things get really interesting. The QRS is a complex process that
generates the signature beep in cardiac monitors. During QRS both ventricles begin to
pump. The right ventricle begins to pump deoxygenated blood into the lungs through the left
and right pulmonary arteries. The pulmonary arteries are blue in the diagram because they are
carrying deoxygenated blood. They are still called arteries because arteries carry blood away
the heart. Science, Again! The left ventricle is also begining to pump freshly oxygenated
blood through the aorta and into the rest of the body. After the initial contraction comes the
ST segment. The ST segment is fairly quiet electrically as it is the time where the ventricles
waiting to be re-polarized. Finally the T wave becomes present to actively re-ploarize, or
relax the ventricles. This relaxation phase resets the ventricles to be filled again by the
atriums.
40
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
In this guide, well connect the AD8232 Breakout to an Arduino microcontroller. We will
build a simple cardiac monitor that will allow you to measure the electrical activity of the
heart in real time!
Spark Fun Single Lead Heart Rate Monitor - AD8232SEN-12650The AD8232 Spark Fun
Single Lead Heart Rate Monitor is a cost-effective board used to measure the electrical
activity of the heart. This electrical act
Biomedical Sensor Pad (10 pack) SEN-12969This is a 10 pack of Biomedical Sensor Pads,
disposable electrodes that can be used to measure EEG, ECG and EMG levels.
Sensor Cable - Electrode Pads (3 connector) CAB-12970This is your simple three conductor
sensor cable with electrode pad leads. These cables are 24" long and feature a 3.5mm audio
jack connector.
Arduino Pro Mini 328 - 3.3V/8MHzDEV-11114It's blue! It's thin! It's the Arduino Pro Mini!
Spark Funs minimal design approach to Arduino. This is a 3.3V Arduino running the 8MHz
boot loader. Ar
33
DEPT OF ECE, SBIT KMM
Wifi for health telemonitoring systems
Breadboard - Self-Adhesive (White) PRT-12002This is your tried and true white solderless
breadboard. It has 2 power buses, 10 columns, and 30 rows - a total of 400 tie in points.
41
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
Break Away Headers - StraightPRT-00116A row of headers - break to fit. 40 pins that can be
cut to any size. Used with custom PCBs or general custom headers.
Jumper Wire KitPRT-00124This is a time saving kit of jumper wires - cut, stripped, and
prebent for your prototyping pleasure. Included with this kit are 14 various lengths.
SparkFun FTDI Basic Breakout - 3.3VDEV-09873This is the newest revision of our [FTDI
Basic](http://www.sparkfun.com/commerce/product_info.php?products_id=8772).
SparkFun USB Mini-B Cable - 6 FootCAB-11301This is a USB 2.0 type A to Mini-B 5pin
cable. You know, the mini-B connector that usually comes with USB Hubs, Cameras, MP3
players, etc.
The AD8232 Heart Rate Monitor breaks out nine connections from the IC. We traditionally
call these connections pins because they come from the pins on the IC, but they are actually
holes that you can solder wires or header pins.
Well connect five of the nine pins on the board to your Arduino. The five pins you need are
42
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
LO+
Leads-off Detect 10
+
You can use any method youd like to make your connections to the board. For this example,
well solder on a five-pin length of male-male header strip and use a breadboard and jumpers
to make our connections.
43
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
Follow the diagram below, to make necessary connections. The SDN pin is not used in this
demo. Connecting this pin to ground or LOW on a digital pin will power down the chip.
This is useful for low power applications.
44
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Now that the electronics are complete, lets look at sensor pad placement. It is recommended
to snap the sensor pads on the leads before application to the body. The closer to the heart the
pads are, the better the measurement. The cables are color coded to help identify proper
placement.
Cable Signal
Color
45
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
36
DEPT OF ECE, SBIT KMM
37
DEPT OF ECE, SBIT KMM
46
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
47
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
48
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
By this point, you should have the hardware connected and ready.
The example sketch can be found on github here. You can cut and paste the code straight
from github or clone the repository and open the file. For more on using the
SparkFunGithub repositories, read this handy tutorial. If youve never worked with the
Arduino IDE before, please see this tutorial.
49
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
50
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Now that you have a sketch running, lets get the processing sketch ready. The processing
sketch will give you a visual output of whats going on. The example processing sketch can
be found here.
51
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
If the processing sketch does not work, you may need to modify the following line:
COPY CODE
You may need to change the parameter inside Serial.list () [N]. A List of available COM ports
will appear in the lower portion of the sketch window. Remember that COM port selection
begins at 0. Typically your Arduino will appear as the highest COM number if it is the only
device connected to your computer.
The Arduino shows up as COM38. This is found in the Serial List at array element 2.
If everything is working correctly, you should see a nice box pop up and start displaying the
output signal.
52
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
If your subject decides to remove the sensors, the leads off detection will kick in and display
a flat blue line.
53
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
ECGs are notoriously noisy. This is because you are measuring muscle activation. The
further sensor pads are from the heart, the more muscle noise you will see. These are
commonly referred to as Motion Artifacts. So here are some simple tips to improve the
signal quality.
42
4.21 .Wi-Fi Module
54
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
4.21.1 Introduction
When power is applied to the module you should see the red power light turn on and the blue
serial Indicator light flicker briefly. If you have a 3.3V FTDI Serial to USB board you can get
started without fear of destroying your newESP8266 WiFi module. Do note that many FTDI
boards have a solder jumper to convert from 3.3V to5V operation so ensure it is set to enable
3.3V operation.
Here are the connections required to enable communication with the module over serial:
It's a wireless
55
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
4.21.2 Description:
The ESP8266 WiFi Module is a self-contained SOC with integrated TCP/IP protocol stack
that can give any microcontroller access to your WiFi network. The ESP8266 is capable of
either hosting an application or offloading all Wi-Fi networking functions from another
application processor. The ESP8266 module is an extremely cost effective board with a huge,
and ever growing, community.
This module has a powerful enough on-board processing and storage capability that allows it
to be integrated with the sensors and other application specific devices through its GPIOs
with minimal development up-front and minimal loading during runtime. Its high degree of
on-chip integration allows for minimal external circuitry, including the front-end module, is
designed to occupy minimal PCB area. The ESP8266 supports APSD for VoIP applications
and Bluetooth co-existence interfaces, it contains a self-calibrated RF allowing it to work
under all operating conditions, and requires no external RF parts.
There is an almost limitless fountain of information available for the ESP8266, all of which
has been provided by amazing community support. In the Documents section below you will
find many resources to aid you in using the ESP8266, even instructions on how to
transforming this module into an IoT (Internet of Things) solution!
Note: The ESP8266 Module is not capable of 5-3V logic shifting and will require an external
Logic Level Converter. Please do not power it directly from your 5V dev board.
Note: This new version of the ESP8266 WiFi Module has increased the flash disk size from
512k to 1MB.
56
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Features:
802.11 b/g/n
Wi-Fi Direct (P2P), soft-AP
Integrated TCP/IP protocol stack
57
DEPT OF ECE, SBIT KMM
Coexistence of zigbee-based Wban and
and the connection is simple, just by SPI / SDIO interface or central processor AHB
bridge interface. Processing and storage capacity on ESP8266 powerful piece, it can
be integrated via GPIO ports sensors and other applications specific equipment to
achieve the lowest early in the development and operation of at least occupy system
resources. The ESP8266 highly integrated chip, including antenna switch balun,
power management converter, so with minimal external circuitry, and includes
frontend module, including the entire solution designed to minimize the space
occupied by PCB. The system is equipped with ESP8266 manifested leading features
are: energy saving VoIP quickly switch between the sleep / wake patterns, with low-
power operation adaptive radio bias, front-end signal processing functions,
troubleshooting and radio systems coexist characteristics eliminate cellular /
Bluetooth / DDR / LVDS / LCD interference.
58
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Smart Power Plug
Home Automation
mesh network
industrial wireless control
Baby Monitor
Network Camera
sensor networks
wearable electronics
wireless location-aware devices
Security ID tag
wireless positioning system signals
46
Specifications
Power
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
The following data are based on a 3.3V power supply, ambient temperature 25C and use the
internal regulator measured. [1] All measurements are made in the absence of the SAW filter,
the antenna interface is completed. [2] All transmit data based on 90% duty cycle, continuous
transmission mode in the measured.
CPU Interface
The chip embedded in an ultra-low-power 32-bit micro-CPU, with 16 compact mode. Can be
connected to the CPU via the following interfaces:
connecting storage controllers can also be used to access external code memory RAM
/ ROM interface (iBus)
Also attached storage controller data RAM interface ( dBus )
Access Register of AHB interface
JTAG debug interface
Storage Controller
Storage controller contains ROM and SRAM. CPU can iBus, dBus and AHB interface to
access the storage controller. Any one of these interfaces can apply for access to ROM or
RAM cells, memory arbiter to determine the running order in the order of arrival.
47
DEPT OF ECE, SBIT KMM
A total of up to 16 GPIO pins. The firmware can assign them different functions. Each GPIO
can be configured internal pull up / pull down resistors available software registers sampled
input, triggering edge or level CPU interrupt input, trigger level wake-up interrupt input,
open-drain or complementary push-pull output drivers, software register output source or
sigma-delta PWM DAC. These pins are multiplexed with other functions, such as the main
interface, UART, SI, Bluetooth co-existence and so on.
Digital IO pad is two-way, three states. It includes a three-state control input and output
buffers. In addition, for low-power operation, IO can be set to hold state. For example, when
we reduce the chip's power consumption, all the output enable signal can be set to maintain a
low-power state. Hold function can be selectively implanted IO in need. When the IO help
internal and external circuit driving, hold function can be used to hold last state. Hold function
to pin introduce some positive feedback. Therefore, the external drive pin must be stronger
than the positive feedback. However, the required driving force size is still small, in the order
of 5uA
48
DEPT OF ECE, SBIT KMM
Current Imax - 12 mA
All digital I/O pins must add an overvoltage protection circuit (snap back circuit) between the pin
and ground. Usually bounce (snap back) voltage is about 6V, while maintaining the voltage is
5.8V. This prevents excessive voltage and generating ESD. Diodes also avoid reverse voltage
output devices.
The firmware running on the ROM and SRAM chip, when the device is awake, firmware via
SDIO sector Download the instructions from the host side. Firmware is fully compliant with
802.11 b / g / n / e / i WLAN MAC protocol and Wi-Fi Direct specification only supports basic
services unit distributed control function (DCF) under (BSS) operation, but also follow the latest
Wi-Fi P2P protocol to support P2P groups operating (P2P group operation). Low level protocol
functions automatically run by ESP8266, such as
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
RTS / CTS
Confirm
fragmentation and reassembly
polymerization
automatic beacon monitoring / scanning
P2P WiFi direct
With P2P discovery procedures, passive or active scanning once in the host command start, it will
be done automatically. Perform power management, interaction with the host at least, this way,
the task of effectively minimized.
Power Management
Off (OFF): C
HIP_PD pin is in a low power state. RTC failure. All registers are emptied.
Deep sleep (DEEP_SLEEP): RTC open, other parts of the chip are closed. RTC internal
recovery memory to save the basic WiFi connection information.
Sleep (SLEEP): Only RTC running. Crystal oscillator stops. Any part of the wake
( MAC, host, RTC timer, and external interrupt) will make the wake of the chip.
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Wake (WAKEUP): In this state, the system from a sleep state to start (PWR) status.
Crystal oscillator and PLL are converted enabled state.
* On state (ON): High-speed clock can run, and sent to each clock control register is enabled
Modules. Each module, including the CPU, including the implementation of relatively lowlevel
clock gating. When the system works, you can WAITI instructions to turn off the CPU's internal
clock.
50
DEPT OF ECE, SBIT KMM
Clock Management
ESP8266 on high frequency clock is used to drive two Tx and Rx mixer, which is generated by
the internal oscillator and an external oscillator. Crystal frequency between 26MHz to 52MHz
float. Although the internal crystal oscillator of the calibration range of the crystal so that the
clock generator to meet the conditions, but in general, the crystal quality is still obtained a proper
phase noise factors to be considered. When the crystal is used, or because of the frequency offset,
rather than the best choice for quality, the maximum capacity of the data processing system and
will reduce the sensitivity of the wifi. Please refer to the following instructions to measure the
frequency offset.
External
Reference
Requirements
Dynamic capacitance Cm pF
2 5
Serial resistance Rs
0 65
15
Radio receivers
2.4 GHz receiver
2.4 GHz transmitter
High-speed clock generator and crystal oscillator
Real-time clock
bias and regulators
Power Management
52
DEPT OF ECE, SBIT KMM
Channel Frequency
1 2412 8 244
7
2 9 245
2417 2
3 2422 10 245
7
4 2427 11 246
2
5 2432 12 246
7
6 2437 13 247
2
7 2442 14 248
4
4.22GHz receiver
2.4GHz RF signal receiver down into quadrature baseband signal, with two high-resolution, high-
speed ADC and the latter into a digital signal. In order to accommodate different signal channels,
a radio receiver integrated RF filters, automatic gain control (AGC), DC offset compensation
circuit and a baseband filter.
4.23GHz transmitter
2.4 GHz transmitter orthogonal frequency baseband signals up to 2.4GHz, using high-power
CMOS power amplifier to drive the antenna. Further use of the digital calibration improves the
linearity of the power amplifier to achieve the average power of + 19dBm in 802.11b
transmission, the transmission reaches + 16dBm 802.11n average power, features super. To offset
defects in the radio receiver is also calibrated by other measures such as:
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
carrier leakage
I / Q phase matching, and
bas
eband
nonline
ar
This will reduce the time and equipment required for testing.
Clock generator
The clock generator generates the receiver and transmitter 2.4GHz clock signal all of its
components are integrated on the chip, Include:
inductor
varactor
54
DEPT OF ECE, SBIT KMM
The following are the softwares and their procedures used for project are described below:
4.24.1Keil (MDK474):
Keil compiler is a software used where the machine language code is written and compiled. After
compilation, the machine source code is converted into hex code which is to be dumped into the
microcontroller for further processing. Keil compiler also supports C language code.
TO COMPILE IT:
2. After installation, an icon will be created with the name Keil microVision3. Just drag this icon
onto the desktop so that it becomes easy whenever you try to write programs in Keil..
4. A page opens with different options in it showing the project workspace at the leftmost corner
side, output window in the bottom and an ash colored space for the program to be written.
6. A small window opens showing the options like new project, import project, open project etc.
Click on New project.
7. A small window with the title bar Create new project opens. The window asks the user to give
the project name with which it should be created and the destination location. The project can be
created in any of the drives available. You can create a new folder and then a new file or can
create directly a new file.
8. After the file is saved in the given destination location, a window opens where a list of vendors
will be displayed and you have to select the device for the target you have
created.
9. The most widely used vendor is Atmel. So click on Atmel and now the family of microcontrollers
manufactured by Atmel opens. You can select any one of the microcontrollers according to the
requirement.
10. When you click on any one of the microcontrollers, the features of that particular microcontroller
will be displayed on the right side of the page. The most appropriate microcontroller with which
most of the projects can be implemented is the AT89C51.
Click on this microcontroller and have a look at its features. Now click on OK to select
this microcontroller.
11. A small window opens asking whether to copy the startup code into the file you have created just
now. Just click on No to proceed further.
12. Now you can see the TARGET and SOURCE GROUP created in the project
workspace.
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
13. Now click on File and in that New. A new page opens and you can start writing program in
it.
14. After the program is completed, save it with any name but with the asm extension.
Save the program in the file you have created earlier.
15. You can notice that after you save the program, the predefined keywords will be highlighted in
bold letters.
16. Now add this file to the target by giving a right click on the source group. A list of options open
and in that select Add files to the source group. Check for this file where you have saved and
add it.
17. Right click on the target and select the first option Options for target. A window opens with
different options like device, target, output etc. First click on target.
18. Since the set frequency of the microcontroller is 11.0592 MHz to interface with the PC, just enter
this frequency value in the Xtal (MHz) text area and put a tick on the Use on-chip ROM. This is
because the program what we write here in the keil will later be dumped into the microcontroller
and will be stored in the inbuilt ROM in the microcontroller.
19. Now click the option Output and give any name to the hex file to be created in the Name of
executable text area and put a tick to the Create HEX file option present in the same window.
The hex file can be created in any of the drives. You can change the folder by clicking on Select
folder for Objects.
20. Now to check whether the program you have written is errorless or not, click on the icon exactly
below the Open file icon which is nothing but Build Target icon. You can even use the shortcut
key F7 to compile the program written.
21. To check for the output, there are several windows like serial window, memory window, project
window etc. Depending on the program you have written, select the appropriate window to see
the output by entering into debug mode.
22. The icon with the letter d indicates the debug mode.
23. Click on this icon and now click on the option View and select the appropriate window to
check for the output.
24. After this is done, click the icon debug again to come out of the debug mode.
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
#include "lcd.h"
#define MAX_BUFF_SZ 10
Inthb=0, beats, i;
Char x;
Unsignedinti,j;
Void uart0_init ()
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Unsignedint Baud16;
Void uart1_init ()
66
DEPT OF ECE, SBIT KMM
U1DLL = 97; /* 9600 Baud Rate @ 12MHz VPB Clock */
U1LCR = 0x03; /* DLAB = 0 */
U1FCR = 0x07; /*Enables and Resets FIFO, 1 byte */
{
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
While (! (U1LSR & 0x20)); // Wait until UART1 ready to send character
U1THR = c; // Send character
While (*st)
{
uart1_putc (*st++);
While (Val)
STR[i] =Val%10;
Val=val/10
; i--;
j=10-field_length; if (Val<0)
uart1_putc ('-'); for (i=j; i<10; i+
+)
{ uart1_putc (48+STR[i]); }
}
Void uart0_putc (ucdt)
{
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
While (! (U0LSR & THRE)); // Wait until UART0 ready to send character
U0THR = DT; // Send character
While (*st)
{
uart0_putc (*st++);
While (Val)
STR[i] =Val%10;
Val=val/10
; i--;
uart0_putc (48+STR[i]);
}
}
voidSend_Wifi ()
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
{ uart0_putc ("AT\r\n");
Delay (1000);
uart0_putc ("AT+CWMODE=3\r\n");
Delay (5000);
uart0_putc ("AT+CIPMUX=1\r\n");
Delay (5000);
Delay (20000);
uart0_putc ("AT+CIPSTART=4, \"TCP\", \"184.106.153.149\", 80\r\n");
Delay (8000);
uart0_putc ("AT+CIPSEND=4, 46\r\n");
Delay (5000);
Delay (5000);
LCDCmd (0xc0);
Delay (10);
Delay (10);
Delay (20000);
LCDCmd (0xc0);
Delay (10);
Delay (10);
U0IER = 0x01;
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
voidadc_init (void)
based Wban and
{
PINSEL1 |= 0x15000000; // P0.28 - AD0.1
AD0CR &= ~0xffffffff;
}
unsignedintadc_read (unsigned char ch)
Initial, adc_val;
Val=AD0GDR;
IO1DIR = 0xffffffff;
IO1CLR = 0xffffffff;
uart0_init ();
uart1_init ();
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
Delay (100);
InitLCD ();
LCDCmd (0x80);
Delay (10);
LCDWriteString (" Welcome ");
Delay (10);
LCDCmd (0xc0);
Delay (10);
Delay (10000);
LCDCmd (0x80);
Delay (10);
LCDCmd (0xc0);
Delay (10);
While (1)
Beats=0;
LCDCmd (0x80);
Delay (10);
Delay (10);
LCDCmd (0xc0);
Delay (10);
Coexistence of zigbee-based Wban and
Wifi for health telemonitoring systems
For (i=0;i<100;i++)
Hb = adc_read (1);
Delay (400);
If (hb>=1000)
Beats++;
}
uart1_putc ("\n\rHeart Rate = ");
UART1WriteInt (beats,4);
LCDCmd(0x80);
Delay (10);
LCDWriteString ("ECG Beats: ");
Delay (10);
LCDWriteInt (beats, 3);
LCDCmd (0xc0);
Delay (10);
Send_Wifi ();
CHAPTER 6
CHAPTER 7
7.1 ADVANTAGES
Designed simply
Low cost
7.2 APPLICATION
7.3 CONCLUSION
Wireless communications, and digital electronics have enabled the development of low-cost,
low-power, multifunctional wireless sensor nodes that are small in size and communicate in
short distances. These tiny wireless sensor nodes, which consist of sensing, data processing,
and communicating components, leverage the idea of sensor networks based on the
collaborative effort of a large number of nodes. In the healthcare field, issues such as
longterm patient care in hospitals, support for elderly people at home and in an ambulatory
environment are being discussed in the realm of wireless sensor networks.
7.4 BIBLIOGRAPHY:
1. WWW. howstuffworks.com
2. EMBEDDED SYSTEM BY RAJ KAMAL
4. Electric India
5. WWW.google.com
6. WWW.Electronic projects.com