You are on page 1of 85

BIOMEDICAL SIGNALS MONITORING BASED IN

MOBILE COMPUTING

ABSTRACT:

The main objective of this project consists in the development of a biomedical


instrumentation prototype for acquisition, processing and transmission of biomedical
signals. These biomedical signals are acquired and then processed with a microcontroller.
After processing, all data are sent to a communication interface that can send this
information to a personal computer or a cell phone.

The prototype developed, which is a digital blood pressure meter, is intended to


allow remote monitoring of patients living in areas with limited access to medical
assistance or scarce clinical resources. We believe that this development could be helpful
to improve peoples quality of life, as well as to allow an improvement in the government
attendance indices.

This project uses regulated 5V, 750mA power supply. 7805 three terminal voltage
regulator is used for voltage regulation. Bridge type full wave rectifier is used to rectify
the ac output of secondary of 230/18V step down transformer

Microcontroller

BLOCK DIAGRAM:
TRANSMITTER

Heart beet
sensor
LCD

Temperature
sensor

MAX
232

Vibration
sensor

POWER SUPPLY:

Step
down
T/F

Bridge
rectifier

Filter

Voltage
regulator

ZIGBEE

RECEIVER SECTION:

ZIGBEE

PC
Max
232

SOFTWARE TOOLS:
Embedded c
Keil compiler.

HARDWARE TOOLS:
Atmel based our own developed board
Power supply
Zigbee tx module
Zigbee rx module
Lcd display
Buzzer
Max 232
Serial communication
Heart beet sensor

temperature sensor

vibration sensor
pc

INTRODUCTION:
Over the recent years remote health care monitoring systems for the elderly people
have drawn considerable attentions. According to UNFPA, the global population is no
longer young for the first time in the history [1]. Population ageing is affecting the entire
world and is happening in all regions. But, it is progressing at a faster rate in the
developing countries. Seven out of the fifteen countries in the developing world have
more than 10 million old people. By the year 2050 another fifteen developing countries
are expected to have 10 million old people.
It is worthwhile to mention here that the average life expectancy in the United
States was 47.3 years in 1900. But, it has increased to 68.2 years and 77.3 years in 1950
and 2002 respectively [2,3]. People are living longer because of better nutrition,
sanitation, medical advances, education, economic well-being, and health care.
Population ageing poses challenges to individuals, families, and societies. By adopting
proper policies societies should be prepared for an ageing world. Overall, the older people
should not be considered as a burden for the society. Their wisdom, energy, and
experience are added advantages for us to take care of the challenges of the 21st century.
In order to keep the ageing population healthy we have to deal with some challenges. The
major challenge for us is to keep them healthy with our limited resources. Although
numerous groundbreaking achievements have been noticed in the health care sector for
the recent years, the health care expense is still sky high and it has become an issue that
even the developed countries are worry about. According to the data provided by the
Kaiser Family Foundation [4] the per capita expenditure of the health care is increasing at
an exponential rate in some countries as shown in Figure 1. With such a high and
continuously increasing healthcare expenses, medical care for the ageing people is
becoming progressively challenging. One of the reasons for this high medical expense is
hospitalization cost.
The senior citizens are the most frequent visitors to the hospitals. They visit the
hospitals for their medical treatment. Sometimes they have to stay there for a certain
period of time for follow up of their medical treatment. Their staying in a hospital not

only incurs expenses, but also incurs loss of patients mobility. Remote Health Care
Monitoring System (RHCMS) has been proposed as a solution to this problem. The main
concept is to monitor a patient from a remote location and to provide her/him with
necessary medical advices. The RHCMS has numerous advantages compared to
conventional healthcare systems. Some of the advantages include (a) monitoring a
patient, (b) responding to an emergency, (c) assisting patient mobility, (d) shortening
hospital stay, and (e) reducing medical expenses. By using RHCMS the physical
conditions of the patients can be monitored for twenty hours a day and seven days a
week. The emergency services can be provided to the patients with a minimum delay. The
patients can be served without going to a health care facility and admitting there. The
healthcare professional can perform the follow up from a remote location and hence a
patient needs to stay in a hospital for a short period of time. In a nutshell RHCMS reduces
expenses related to the medical services.
Most of the proposed RHCMSs are based on wireless technology. The evolution
of the wireless network has experienced a very fast-paced. Since the introduction of the
IEEE 802.11 protocol wireless networks have experienced a huge market demand. Within
the four years of the introduction wireless networks became very popular because of its
portability, convenience, ease of installation, and low cost [5]. In that time period about
7.5 million households in the United States deployed wireless network. Wireless networks
and medical sensors have been combined in RHCMS.
There have been many medical sensors available in the market. Most of the sensors can
measure and display critical health monitoring data such as the pulse rate, blood pressure,
temperature, and blood sugar of a patient. One of the limitations of the proposed RHCMS
is its limited coverage area. The measured data cannot be transmitted beyond a certain
distance. Thus, it is not possible for the healthcare professionals to monitor the medical
conditions of a patient from a distant location. In a hospital either the nurse or the
physician has to move from one patient to another patient for monitoring them. Hence, it
may not be possible for them to monitor a patients health conditions all the time. This
situation can be even worse when they have to take care of a large number of patients in a
hospital at a given time. In order to overcome the above mentioned limitations an on-line
health monitoring system has been proposed in this work. The proposed system can
monitor the temperature, pulse, muscle, and ECG data of a patient. The proposed system
has been designed by using the ZigBee technology.

A major portion of this system has been implemented in LabView. Hence, the
proposed system is reconfigurable as per users need. The proposed system has been
tested and verified in order to ensure its accuracy and reliability. The system consumes a
very low power. The system consumes a very low power because it transmits signal only
if the monitored parameters (i.e., temperature, heart beat rate etc.) go outside their normal
ranges. Otherwise, the system puts the transmitter into a sleep mode to save energy.
RELATED WORKS
Numerous prototypes for remote health care system can be found in the
literatures. Since this work is based on the ZigBee technology, we focus only on the
remote health care systems that have been designed based on the ZigBee technology. One
of the early works on health care monitoring system has been proposed in [6]. The
proposed system is suitable for patients, senior citizens, and others who need continuous
monitoring of their health.
The proposed system can monitor the ECG signals of a patient based on Session
Initiation Protocol (SIP) and a ZigBee network. The system consists of a wireless ECG
sensor, ECG console, ZigBee module, SIP register, a proxy server, a database server, and
wireless devices. Simultaneous monitoring of the biomedical signals from multiple
patients has been addressed in [7]. The proposed network is based on IEEE 802.15.4
standard and the ZigBee technology. The authors have proposed an optimized source
routing protocol to control the network load. Some other issues including energy
consumption, network lifetime, and delivery ratio have also been addressed in the same
work. An intelligent remote healthcare system based on power line communication and
the ZigBee network has been proposed in [8]. The system consists of physiological
sensors, a ZigBee/PLC gateway, and some special software. The physiological data are
collected by the physiological sensor and are sent to a controlling center through a
ZigBee/PLC gateway. The data are stored and analysed at the controlling center. A low
power microcontroller based patient bed monitoring system has been presented in [9].
Resistive bend sensor has been used for minimizing the harmful effects of bedsores,
which is a common problem in hospitals intensive care units and assistive living
environments during rehabilitations. The proposed system is able to replace the current
wired system and it supports continuous patient monitoring by enabling the patient bed
mobility. A Wireless Body Area Sensor network (WBASN) based on the ZigBee
technology has been presented in [10]. All nodes in the WBASN are connected as star
topology and central node (i.e., access point) is used to control the network. The data

collected by the access point is transferred to a hospital network over mobile


communication network. The authors have proposed a novel wake-up on-demand mode
of network operation. According to this mode the network sleeps when the most of the
circuits are turned off to reduce power consumption. Once the WBASN is waked up all
modules begin to work and all biomedical signals are obtained, stored, and transmitted.
Reliability of data transmission for healthcare monitoring system has been investigated in
[11].
The authors have suggested that there is always a chance for loosing physiological
data when a International Journal of Wireless & Mobile Networks (IJWMN) Vol. 6, No.
3, June 2014 56 number of ZigBee devices operate in a hospital at a given time. Although
the medium access control is taken care of by the MAC layer, the authors have designed
and implemented a new medium access control algorithm to ensure reliable data
transmission of the physiological data. A telemedicine information monitoring system
consists of vital sign monitoring devices, a healthcare gateway, and a health service
information platform has been proposed in [12]. Among these components the healthcare
gateway is the most critical component. The ZigBee module is used to transmit
information between the vital sign monitoring devices and the healthcare gateway. The
vital sign monitoring devices include ECG, SPO2, blood pressure, glucose, and body
temperature. The data is then relayed to a healthcare service information platform. The
system is based on Service Oriented Architecture (SOA) concept to provide the healthcare
management for people who are suffering from chronic illness. A remote patient
monitoring system based on the ZigBee wireless sensor network and the Internet Things
has been introduced in [13]. The system generates electronic medical records that are
saved in a database. After analysing the data the proposed system can send feedback
about the diagnosis, medical programs, and proposals to a remote location. The system
uses the ZigBee network for real time transmission of the physical data. The data
processing and information releasing have been implemented by a database program. A
wearable remote healthcare system for assessing hydration status and visceral fat
accumulation by using Bioelectrical Impedance (BI) analysis has been proposed in [14].
The authors have designed a ZigBee based BI to replace the conventional wired BI. The
proposed system consists of BI measurement circuit integrated with 0.35 m CMOS
technology and a transducer circuit of the ZigBee module.
Two alternative systems have been proposed for the deployment of the ZigBee
based wireless personal area network (WPANS) for remote patient monitoring in the

general wards of a hospital in [15]. In the first approach a single WPAN is considered for
gathering and transmitting physiological data from the patients in a ward. In the second
approach multiple WPANS are considered. The simulation results show that the multiple
WPANS out-perform the single one in respect of efficiency and reliability for data
transmission. An expandable wireless health monitoring system based on ZigBee has
been proposed in [16]. The proposed system can monitor the temperature and pulses of a
patient wirelessly. The test result presented therein shows that the proposed system can
monitor the temperature and pulse of a patient with a high accuracy. An ambient care
system (ACS) framework to provide remote monitoring, emergency detection, activity
logging, and personal notification services has been proposed in [17].
The proposed system consists of Crossbow MICAZ devices, sensors, and PDA
enabled with ZigBee technology. The authors concluded that the combination of the
ZigBee technology together with a service oriented architecture is the best option for ACS
services. A wireless sensor gateway (WSG) has been proposed in [18] to monitor patients
health. The main objective of this project is to monitor the cardiovascular status of a
patient. Biological signals like ECG, pulse wave, and body weight are the important
parameters for the cardiovascular monitoring of a patient. The proposed gateway is
deigned to receive data from wireless sensors through a ZigBee interface and to forward
the same to a personal computer via Bluetooth interface. A ZigBee based system for
remote monitoring of SPO2 has been proposed in [19]. The system consists of SPO2
sensor devices, a router, and Personal Area Network (PAN) co-ordinators. All
International Journal of Wireless & Mobile Networks (IJWMN) Vol. 6, No. 3, June 2014
57 the devices are based on MCU and ZigBee chip. The sensor devices measure SPO2
data from patients and transmit the data to the router. The router sets schedule for data
transmission to each device by using a hierarchical routing. The proposed system also
contains a web-based management system so that the patient data can be published in the
web. A real-time rehabilitation platform for patients and aged people has been proposed in
[20]. The proposed system can collect data about the real-time walking acceleration of the
patients. By analysing the gait sequences the computer based rehabilitation system can
figure out the normal gait and abrupt falling of the people. The system also includes an
ECG detector to monitor the health condition of the patients and the aged people. A
prototype of smart sniffing shoes has been designed for monitoring the foot health of a
patient in [21].

The proposed system consists of chemical sensor array installed inside the shoe.
The ZigBee technology has been used for the data communication. A technique called
principal component analysis (PCA) has been used to monitor the foot health of a patient.
Another ZigBee based health monitoring system has been proposed to monitor
temperature, heart rate, blood pressure, and movements of patients in [22]. The main
component of the system is an electronic device worn on the wrist or finger of a high risk
patient. The system uses a number of sensors including an impact sensor to detect the fall
of a person. The system can monitor a medically distressed person and send an alarm to a
caretaker system connected to a remote computer. A similar work for monitoring the
patients pulse has been presented in [23]. The proposed system can monitor the pulses of
a patient from a remote location and it can also administer necessary medical treatment.
The proposed system consists of a pulse sensor, ZigBee module, and ATmega218P
microcontroller. The pulse measured by the sensor is sent to a coordinator through a
ZigBee interface. The test results show that the proposed system can cover up to 30 meter
distance. A prototype model for cardiovascular activity and fitness monitoring system
based on IEEE 11073 family has been proposed in [24]. The IEEE 11073-10441 defines
the set of protocols for tele-health environment at application layer and the rest of the
communication is taken care of by the medical grade ZigBee network. The test results
show that the proposed system can report severe cardiovascular malfunctioning without
compromising the mobility. A remote heart sound and lung sound monitoring system has
been proposed in [25]. The authors have solved the problem related to simultaneous
transmission of heart and lung sounds. Sensors have been used to collect the heart and
lung sounds and then FastICA is used to separate these two signals. The sound signals are
then sent to a remote location via internet for diagnosis. A low cost sleep monitoring
system based on polysomnography has been proposed in [26]. The authors have
introduced some innovative sensor pillow and bed sheet system that employ the ZigBee
wireless network. To monitor the respiration of the patient a sensor array of force
sensitive resistors (FSR) based on polymer thick film device has been used. The sensor
array is able to classify and verify the respiratory rate during sleep. A portable ECG
monitoring system has been proposed in [27].
The proposed system is controlled by MSP430 single chip computer, which
amplifies and filters the patients ECG signals and sends data to a central controller using
a ZigBee wireless transmission module. Another similar prototype of a ZigBee based
ECG signal monitoring system has been proposed in [28]. A PC International Journal of

Wireless & Mobile Networks (IJWMN) Vol. 6, No. 3, June 2014 58 based GUI interface
has been developed to provide ECG signal processing task and health care video tracking
and management functions. In this work we have proposed a remote health monitoring
system based on the ZigBee technology and LabView software. The proposed system can
monitor ECG signals, muscle power, temperature, and heartbeat of a patient from a
remote location. In contrast to other related works we used National Instruments
LabView software for implementing the project. The LabView constitutes a graphical
programming environment that can acquire data (i.e., biomedical signals). The LabView
relies on graphical symbols rather than textual language to describe programming actions.
The principle of dataflow governs program execution in a straightforward manner. We
chose LabView software because it is easy to program and it has powerful data
acquisition system. In addition the output data generated by the LabView program can be
easily acquired into hardware. The data acquisition is performed by using Data
Acquisition System (DAQ) provided by the National Instrument. The use of DAQ
reduces the complexities of the circuits. Since the major portion of this work is
implemented in LabView, the proposed system can be easily reconfigured and adapted to
accommodate more options in future. The system can send data to a remote location for
diagnosis. The system can also publish data in the internet so that the concerned
healthcare professionals can monitor their patients from anywhere around the World at
any time.
OVERVIEW OF EMBEDDED SYSTEM ARCHITECTURE
Every embedded system consists of custom-built hardware built around a Central
Processing Unit (CPU). This hardware also contains memory chips onto which the software is
loaded. The software residing on the memory chip is also called the firmware. The embedded
system architecture can be represented as a layered architecture as shown in Fig.
The operating system runs above the hardware, and the application software runs above
the operating system. The same architecture is applicable to any computer including a desktop
computer. However, there are significant differences. It is not compulsory to have an operating
system in every embedded system. For small appliances such as remote control units, air
conditioners, toys etc., there is no need for an operating system and you can write only the
software specific to that application. For applications involving complex processing, it is
advisable to have an operating system. In such a case, you need to integrate the application
software with the operating system and then transfer the entire software on to the memory chip.
Once the software is transferred to the memory chip, the software will continue to run for a long
time you dont need to reload new software.

Now, let us see the details of the various building blocks of the hardware of an embedded
system. As shown in Fig. the building blocks are;
Central Processing Unit (CPU)
Memory (Read-only Memory and Random Access Memory)
Input Devices
Output devices
Communication interfaces
Application-specific circuitry

Central Processing Unit (CPU):


The Central Processing Unit (processor, in short) can be any of the following:
microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-controller is a lowcost processor. Its main attraction is that on the chip itself, there will be many other components
such as memory, serial communication interface, analog-to digital converter etc. So, for small
applications, a micro-controller is the best choice as the number of external components required
will be very less. On the other hand, microprocessors are more powerful, but you need to use

many external components with them. D5P is used mainly for applications in which signal
processing is involved such as audio and video processing.
Memory:
The memory is categorized as Random Access 11emory (RAM) and Read Only Memory
(ROM). The contents of the RAM will be erased if power is switched off to the chip, whereas
ROM retains the contents even if the power is switched off. So, the firmware is stored in the
ROM. When power is switched on, the processor reads the ROM; the program is program is
executed.
Input devices:
Unlike the desktops, the input devices to an embedded system have very limited
capability. There will be no keyboard or a mouse, and hence interacting with the embedded
system is no easy task. Many embedded systems will have a small keypad-you press one key to
give a specific command. A keypad may be used to input only the digits. Many embedded
systems used in process control do not have any input device for user interaction; they take inputs
from sensors or transducers 1fnd produce electrical signals that are in turn fed to other systems.
Output devices:
The output devices of the embedded systems also have very limited capability. Some
embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the health status of
the system modules, or for visual indication of alarms. A small Liquid Crystal Display (LCD) may
also be used to display some important parameters.
Communication interfaces:
The embedded systems may need to, interact with other embedded systems at they may
have to transmit data to a desktop. To facilitate this, the embedded systems are provided with one
or a few communication interfaces such as RS232, RS422, RS485, Universal Serial Bus (USB),
IEEE 1394, Ethernet etc.
Application-specific circuitry:
Sensors, transducers, special processing and control circuitry may be required fat an
embedded system, depending on its application. This circuitry interacts with the processor to
carry out the necessary work. The entire hardware has to be given power supply either through the
230 volts main supply or through a battery. The hardware has to design in such a way that the
power consumption is minimized.

APPLICATION AREAS
Nearly 99 per cent of the processors manufactured end up in embedded systems. The
embedded system market is one of the highest growth areas as these systems are used in very
market segment- consumer electronics, office automation, industrial automation, biomedical
engineering, wireless communication, data communication, telecommunications, transportation,
military and so on.
Consumer appliances:
At home we use a number of embedded systems which include digital camera, digital
diary, DVD player, electronic toys, microwave oven, remote controls for TV and air-conditioner,
VCO player, video game consoles, video recorders etc. Todays high-tech car has about 20
embedded systems for transmission control, engine spark control, air-conditioning, navigation etc.
Even wristwatches are now becoming embedded systems. The palmtops are powerful embedded
systems using which we can carry out many general-purpose tasks such as playing games and
word processing.
Office automation:
The office automation products using em embedded systems are copying machine, fax
machine, key telephone, modem, printer, scanner etc.
Industrial automation:
Today a lot of industries use embedded systems for process control. These include
pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and
transmission. The embedded systems for industrial use are designed to carry out specific tasks
such as monitoring the temperature, pressure, humidity, voltage, current etc., and then take
appropriate action based on the monitored levels to control other devices or to send information to
a centralized monitoring station. In hazardous industrial environment, where human presence has
to be avoided, robots are used, which are programmed to do specific jobs. The robots are now
becoming very powerful and carry out many interesting and complicated tasks such as hardware
assembly.
Medical electronics:
Almost every medical equipment in the hospital is an embedded system. These
equipments include diagnostic aids such as ECG, EEG, blood pressure measuring devices, X-ray
scanners; equipment used in blood analysis, radiation, colonscopy, endoscopy etc. Developments
in medical electronics have paved way for more accurate diagnosis of diseases.
Computer networking:

Computer networking products such as bridges, routers, Integrated Services Digital


Networks (ISDN), Asynchronous Transfer Mode (ATM), X.25 and frame relay switches are
embedded systems which implement the necessary data communication protocols. For example, a
router interconnects two networks. The two networks may be running different protocol stacks.
The routers function is to obtain the data packets from incoming pores, analyze the packets and
send them towards the destination after doing necessary protocol conversion. Most networking
equipments, other than the end systems (desktop computers) we use to access the networks, are
embedded systems
Telecommunications:
In the field of telecommunications, the embedded systems can be categorized as
subscriber terminals and network equipment. The subscriber terminals such as key telephones,
ISDN phones, terminal adapters, web cameras are embedded systems. The network equipment
includes multiplexers, multiple access systems, Packet Assemblers Dissemblers (PADs), sate11ite
modems etc. IP phone, IP gateway, IP gatekeeper etc. are the latest embedded systems that
provide very low-cost voice communication over the Internet.
Wireless technologies:
Advances in mobile communications are paving way for many interesting applications
using embedded systems. The mobile phone is one of the marvels of the last decade of the 20h
century. It is a very powerful embedded system that provides voice communication while we are
on the move. The Personal Digital Assistants and the palmtops can now be used to access
multimedia services over the Internet. Mobile communication infrastructure such as base station
controllers, mobile switching centers are also powerful embedded systems.
Insemination:
Testing and measurement are the fundamental requirements in all scientific and
engineering activities. The measuring equipment we use in laboratories to measure parameters
such as weight, temperature, pressure, humidity, voltage, current etc. are all embedded systems.
Test equipment such as oscilloscope, spectrum analyzer, logic analyzer, protocol analyzer, radio
communication test set etc. are embedded systems built around powerful processors. Thank to
miniaturization, the test and measuring equipment are now becoming portable facilitating easy
testing and measurement in the field by field-personnel.
Security:
Security of persons and information has always been a major issue. We need to protect
our homes and offices; and also the information we transmit and store. Developing embedded
systems for security applications is one of the most lucrative businesses nowadays. Security

devices at homes, offices, airports etc. for authentication and verification are embedded systems.
Encryption devices are nearly 99 per cent of the processors that are manufactured end up in~
embedded systems.
Finance:
Financial dealing through cash and cheques are now slowly paving way for transactions
using smart cards and ATM (Automatic Teller Machine, also expanded as Any Time Money)
machines. Smart card, of the size of a credit card, has a small micro-controller and memory; and it
interacts with the smart card reader! ATM machine and acts as an electronic wallet. Smart card
technology has the capability of ushering in a cashless society. Well, the list goes on. It is no
exaggeration to say that eyes wherever you go, you can see, or at least feel, the work of an
embedded system.
Embedded systems find applications in every industrial segment- consumer electronics,
transportation, avionics, biomedical engineering, manufacturing, process control and industrial
automation, data communication, telecommunication, defense, security etc. Used to encrypt the
data/voice being transmitted on communication links such as telephone lines. Biometric systems
using fingerprint and face recognition are now being extensively used for user authentication in
banking applications as well as for access control in high security buildings.

MICROCONTROLLERS
A microcontroller (sometimes abbreviated C, uC or MCU) is a small computer
on a single integrated circuit containing a processor core, memory, and programmable
input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also
often included on chip, as well as a typically small amount of RAM. Microcontrollers are
designed for embedded applications, in contrast to the microprocessors used in personal
computers or other general purpose applications.
Microcontrollers are used in automatically controlled products and devices, such
as automobile engine control systems, implantable medical devices, remote controls,
office machines, appliances, power tools, toys and other embedded systems. By reducing
the size and cost compared to a design that uses a separate microprocessor, memory, and
input/output devices, microcontrollers make it economical to digitally control even more
devices and processes. Mixed signal microcontrollers are common, integrating analog
components needed to control non-digital electronic systems.
Some microcontrollers may use four-bit words and operate at clock rate
frequencies as low as 4 kHz, for low power consumption (milli watts or micro watts).

They will generally have the ability to retain functionality while waiting for an event such
as a button press or other interrupt; power consumption while sleeping (CPU clock and
most peripherals off) may be just nano watts, making many of them well suited for long
lasting battery applications. Other microcontrollers may serve performance-critical roles,
where they may need to act more like a digital signal processor (DSP), with higher clock
speeds and power consumption.
Many embedded systems need to read sensors that produce analog signals. This is
the purpose of the analog-to-digital converter (ADC). Since processors are built to
interpret and process digital data, i.e. 1s and 0s, they are not able to do anything with the
analog signals that may be sent to it by a device. So the analog to digital converter is used
to convert the incoming data into a form that the processor can recognize. A less common
feature on some microcontrollers is a digital-to-analog converter (DAC) that allows the
processor to output analog signals or voltage levels.

Fig: Architecture of Microcontroller

AT89C52

The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with


8kbytes of Flash programmable and erasable read only memory (PEROM). The device is
manufactured using Atmels high-density nonvolatile memory technology and is
compatible with the industry-standard 80C51 and 80C52 instruction set and Pin out. The
on-chip Flash allows the program memory to be reprogrammed in-system or by a

conventional nonvolatile memory programmer by combining a versatile 8-bit CPU with


Flash on a monolithic chip. The Atmel AT89C52 is a powerful microcomputer which
provides a highly-flexible and cost-effective solution to many embedded control
applications. The AT89C52

is

low-power, high-performance

CMOS

8-bit

microcomputer with 8k bytes of Flash programmable and erasable read only memory
(PEROM).
Features
Compatible with MCS-51 Products
8K Bytes of In-System Reprogrammable Flash Memory
Endurance: 1,000 Write/Erase Cycles
Fully Static Operation: 0 Hz to 24 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources
Programmable Serial Channel
Low-power Idle and Power-down Modes
Five vector two-level interrupt architecture
A full duplex serial port
Six Interrupt Sources
On-chip oscillator and clock circuitry
BLOCK DIAGRAM:

PIN DIAGRAM

Fig: PIN Diagram


PIN DESCRIPTION
PINS 1-8 PORT 1:
Each of these pins can be configured as input or output.

PIN 9 RST
Logical one on this pin stops microcontrollers operating and erases the contents of most
registers. By applying logical zero to this pin, the program starts execution from the
beginning. In other words, a positive voltage pulse on this pin resets the microcontroller.
PINS 10-17 PORT 3:Similar to port 1, each of these pins can serve as universal input or
output. Besides, all of them have alternative functions:
Pin 10: RXD
Serial asynchronous communication input or Serial synchronous communication output.
Pin 11: TXD
Serial asynchronous communication output or Serial synchronous communication clock
output.
Pin 12: INT0

Interrupt 0 inputs
Pin 13: INT1
Interrupt 1 input
Pin 14: T0
Counter 0 clock input
Pin 15: T1
Counter 1 clock input
Pin 16: WR
Signal for writing to external (additional) RAM
Pin 17: RD
Signal for reading from external RAM
Pin 18, 19: X2, X1
Internal oscillator input and output. A quartz crystal which determines operating
frequency is usually connected to these pins. Instead of quartz crystal, the miniature ceramics
resonators can be also used for frequency stabilization. Later versions of the microcontrollers
operate at a frequency of 0 Hz up to over 50 Hz.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz
crystal or ceramic resonator may be used.

To drive the device from an external clock source, XTAL2 should be left unconnected while
XTAL1 is driven as shown in Figure 2. There are no requirements on the duty cycle of the
external clock signal, since the input to the internal clocking circuitry is through a divide-by-two
flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

OSCILLATOR CONNECTIONS

Pin 20: GND


Signal Ground
PINS 21-28 PORT 2:
If there is no intention to use external memory then these port pins are configured
as universal inputs/outputs. In case external memory is used then the higher address byte,

i.e. addresses A8-A15 will appear on this port. It is important to know that even memory
with capacity of 64Kb is not used ( i.e. note all bits on port are used for memory
addressing) the rest of bits are not available as inputs or outputs.
Pin 29: PSEN
Program Store Enable is the read strobe to external program memory. When the
AT89C51 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to
external data memory. If external ROM is used for storing program then it has a logic-0
value every time the microcontroller reads a byte from memory.
Pin 30: ALE
Prior to each reading from external memory, the microcontroller will set the lower
address byte (A0-A7) on P0 and immediately after that activates the output ALE. Upon receiving
signal from the ALE pin, the external register (74HCT373 or 74HCT375 circuit is usually
embedded) memorizes the state of P0 and uses it as an address for memory chip. In the second
part of the microcontrollers machine cycle, a signal on this pin stops being emitted and P0 is used
now for data transmission (Data Bus). In this way, by means of only one additional (and cheap)
integrated circuit, data multiplexing from the port is performed. This port at the same time used
for data and address transmission.
Address Latch Enable output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can
be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a
MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable
bit has no effect if the microcontroller is in external execution mode.
PIN 31 EA/VPP:

External Access Enable must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.
Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions.

By applying logic zero to this pin, P2 and P3 are used for data and address
transmission with no regard to whether there is internal memory or not. That means that
even there is a program written to the microcontroller, it will not be executed, the
program written to external ROM will be used instead. Otherwise, by applying logic one
to the EA pin, the microcontroller will use both memories, first internal and afterwards
external (if it exists), up to end of address space.
PINS 32-39 PORT 0:
Similar to port 2, if external memory is not used, these pins can be used as
universal inputs or outputs. Otherwise, P0 is configured as address output (A0-A7) when
the ALE pin is at high level (1) and as data output (Data Bus), when logic zero (0) is
applied to the ALE pin.
Pin 40: VCC
Power supply (5V) to the microcontroller.
REGISTER BANKS:
The 89c51 uses 8 "R" registers which are used in many of its instructions.
These "R" registers are numbered from 0 through 7 (R0, R1, R2, R3, R4, R5, R6, and
R7). These registers are generally used to assist in manipulating values and moving data
from one memory location to another the Accumulator. Thus if the Accumulator (A)
contained the value 6 and R4 contained the value 3, the Accumulator would contain the
value 9 after this instruction was executed. However, as the memory map shows, the "R"
Register R4 is really part of Internal RAM. Specifically, R4 is address 04h. This can be
see in the bright green section of the memory map. But, the 89c51 has four distinct
register banks. When the 89c51 is first booted up, register bank 0 (addresses 00h through
07h) is used by default. However, your program may instruct the 89c51 to use one of the
alternate register banks; i.e., register banks 1, 2, or 3. In this case, R4 will no longer be
the same as Internal RAM address 04h. For example, if your program instructs the 89c51
to use register bank 3, "R" register R4 will now be synonomous with Internal RAM
address 1Ch.
The concept of register banks adds a great level of flexibility to the 89c51,
especially when dealing with interrupts (we'll talk about interrupts later). However,

always remember that the register banks really reside in the first 32 bytes of Internal
RAM.

Basic Registers
The Accumulator:
The Accumulator, as its name suggests, is used as a general register to
accumulate the results of a large number of instructions. It can hold an 8-bit (1-byte)
value and is the most versatile register the 89c51 has due to the shear number of
instructions that make use of the accumulator. More than half of the 89c51s 255
instructions manipulate or use the accumulator in some way.
The "R" registers:
The "R" registers are a set of eight registers that are named R0, R1, etc. up to and including
R7.These registers are used as auxillary registers in many operations. To continue with the above example,
perhaps you are adding 10 and 20. The original number 10 may be stored in the Accumulator whereas the
value 20 may be stored in, say, register R4. To process the addition you would execute the command

The "B" Register:


The "B" register is very similar to the Accumulator in the sense that it may
hold an 8-bit (1-byte) value. The "B" register is only used by two 89c51 instructions:
MUL AB and DIV AB. Thus, if you want to quickly and easily multiply or divide A by
another number, you may store the other number in "B" and make use of these two
instructions. Aside from the MUL and DIV instructions, the "B" register is often used as
yet another temporary storage register much like a ninth "R" register.
Special Function Registers
A map of the on-chip memory area called the Special Function Register (SFR) space is shown in
Table 1.Note that not all of the addresses are occupied, and unoccupied addresses may not be
implemented on the chip. Read accesses to these addresses will in general return random data, and
write accesses will have an indeterminate effect. User software should not write 1s to these
unlisted locations, since they may be used in future products to invoke new features. In that case,
the reset or inactive values of the new bits will always be 0.

TIMERS:
The 8052 has two timers: Timer 0, Timer 1and Timer 2. They can be used either as timers
to generate a time delay or as counters to count events happening outside the
microcontroller. Three timers are 16-bit wide. Since the 8052 has an 8-bit architecture,
each 16-bit timer is accessed as two separate registers of low byte and high byte. The
timers 1 and 2 functions are same as in 8051. Lower byte register of Timer 0 is TL0 and

higher byte is TH0. Similarly lower byte register of Timer1 is TL1 and higher byte
register is TH1.
TMOD (timer mode) register:
Both timers 0 and 1 use the same register TMOD to set the various operation
modes. TMOD is an 8-bit register in which the lower 4 bits are set aside for Timer 0 and
the upper 4 bits for Timer 1. In each case, the lower 2 bits are used to set the timer mode
and the upper 2 bits to specify the operation.
(MSB)

(LSB)

GATE
M0

C/T

M1

M0

GATE

C/T

M1

GATE
Every timer has a means of starting and stopping. Some timers do this by software, some
by hardware and some have both software and hardware controls. The timers in the 8051
have both. The start and stop of the timer are controlled by the way of software by the TR
(timer start) bits TR0 and TR1. These instructions start and stop the timers as long as
GATE=0 in the TMOD register. The hardware way of starting and stopping the timer by
an external source is achieved by making GATE=1 in the TMOD register.
C/T:
Timer or counter selected. Cleared for timer operation and set for counter operation.
M1
Mode bit 1
M0
Mode bit 0
M1

M0

Mode

Operating Mode

13-bit timer mode


8-bit timer/counter THx with TLx as 5-bit prescaler

16-bit timer mode


16-bit timer/counters THx and TLx are cascaded

8-bit auto reload timer/counter


THx holds a value that is to be reloaded into TLx each time
it overflows

Split timer mode

The mode used here to generate a time delay is MODE 2.


This mode 2 is an 8-bit timer and therefore it allows only values of 00H to FFH to
be loaded into the timers register TH. After TH is loaded with the 8-bit value, the 8051
give a copy of it to TL. When the timer starts, it starts to count up by incrementing the TL
register. It counts up until it reaches its limit of FFH. When it rolls over from FFH to 00H,
it sets high the TF (timer flag). If Timer 0 is used, TF0 goes high and if Timer 1 is used,
TF1 goes high. When the TL register rolls from FFH to 0 and TF is set to 1, TL is
reloaded automatically with the original value kept by the TH register.
Timer 2
Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter.
The type of operation is selected by bit C/T2 in the SFR T2CON (shown in Table 2). Timer 2 has
three operating modes: capture, auto-reload (up or down counting), and baud rate generator. The
modes are selected by bits in T2CON, as shown in Table 3. Timer 2 consists of two 8-bit registers,
TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since
a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.

In the Counter function, the register is incremented in response to a 1-to-0 transition at its
corresponding external input pin, T2. In this function, the external input is sampled during S5P2
of every machine cycle. When the samples show a high in one cycle and a low in the next cycle,
the count is incremented. The new count value appears in the register during S3P1 of the cycle
following the one in which the transition was detected. Since two machine cycles (24 oscillator
periods) are required to recognize a 1-to-0 transition, the maximum count rate is 1/24 of the
oscillator frequency. To ensure that a given level is sampled at least once before it changes, the
level should be held for at least one full machine cycle.
Timer 2 Registers Control and status bits are contained in registers T2CON (shown in
Table 2) and T2MOD (shown in Table 4) for Timer 2. The register pair (RCAP2H, RCAP2L) are
the Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode.

TF2:
Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software. TF2 will not be
set when either RCLK = 1 or TCLK = 1.
EXF2:
Timer 2 external flag set when either a capture or reload is caused by a negative transition on
T2EX and EXEN2 = 1. When Timer 2 interrupt is enabled, EXF2 = 1 will cause the CPU to
vector to the Timer 2 interrupt routine. EXF2 must be cleared by software. EXF2 does not cause
an interrupt in up/down counter mode (DCEN = 1).

RCLK: Receive clock enable. When set, causes the serial port to use Timer 2 overflow pulses for
its receive clock in serial port Modes 1 and 3. RCLK = 0 causes Timer 1 overflow to be used for
the receive clock.
TCLK:
Transmit clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its
transmit clock in serial port Modes 1 and 3. TCLK = 0 causes Timer 1 overflows to be used for
the transmit clock.
EXEN2:
Timer 2 external enable. When set, allows a capture or reload to occur as a result of a
negative transition on T2EX if Timer 2 is not being used to clock the serial port. EXEN2 = 0
causes Timer 2 to ignore events at T2EX.
TR2:
Start/Stop control for Timer 2. TR2 = 1 starts the timer.
C/T2: Timer or counter select for Timer 2. C/T2 = 0 for timer function. C/T2 = 1 for external
event counter (falling edge triggered).
CP/RL2:
Capture/Reload select. CP/RL2 = 1 causes captures to occur on negative transitions at
T2EX if EXEN2 = 1. CP/RL2= 0 causes automatic reloads to occur when Timer 2 overflows or
negative transitions occur at T2EX when EXEN2= 1. When either RCLK or TCLK = 1, this bit is
ignored and the timer is forced to auto-reload on Timer 2 overflow.
Interrupt Registers : The individual interrupt enable bits are in the IE register. Two priorities can
be set for each of the six interrupt sources in the IP register.

The Data Pointer (DPTR):


The Data Pointer (DPTR) is the 89c51s only user-accessible 16-bit (2-byte)
register. The Accumulator, "R" registers, and "B" register are all 1-byte values. DPTR, as
the name suggests, is used to point to data. It is used by a number of commands which
allow the 89c51 to access external memory. When the 89c51 accesses external memory it
will access external memory at the address indicated by DPTR. While DPTR is most
often used to point to data in external memory, many programmers often take an
advantage of the fact that its the only true 16-register available. It is often used to store 2byte values which have nothing to do with memory locations.

The Program Counter (PC):


The Program Counter (PC) is a 2-byte address which tells the 89c51 where the next
instruction to execute is found in memory. When the 89c51 is initialized PC always starts at 0000h and is
incremented each time an instruction is executed. It is important to note that PC isnt always incremented
by one. Since some instructions require 2 or 3 bytes the PC will be incremented by 2 or 3 in these cases

The Stack Pointer (SP):


The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1byte) value. The Stack Pointer is used to indicate where the next value to be removed from the
stack should be taken from. When you push a value onto the stack, the 89c51 first increments the
value of SP and then stores the value at the resulting memory location. When you pop a value off
the stack, the 89c51 returns the value from the memory location indicated by SP, and then
decrements the value of SP.

Input/Output Ports (I/O Ports)


All 8051 microcontrollers have 4 I/O ports, each consisting of 8 bits which can be
configured as inputs or outputs. This means that the user has on disposal in total of 32
input/output lines connecting the microcontroller to peripheral devices.
A logic state on a pin determines whether it is configured as input or output:
0=output, 1=input. If a pin on the microcontroller needs to be configured as output, then a
logic zero (0) should be applied to the appropriate bit on I/O port. In this way, a voltage
level on the appropriate pin will be 0.
Similar to that, if a pin needs to be configured as input, then a logic one (1) should
be applied to the appropriate port. In this way, as a side effect a voltage level on the
appropriate pin will be 5V (as it is case with any TTL input). This may sound a bit
confusing but everything becomes clear after studying a simplified electronic circuit
connected to one I/O pin.
Fig: Input and output process inside micro controller

Input/Output:

This is a simplified overview of what is connected to a pin inside the microcontroller. It


concerns
all pins except those included in P0 which do not have embedded pull-up resistor.

Output pin:

A logic zero (0) is applied to a bit in the P register. By turning output FE transistor on, the
appropriate pin is directly connected to ground.
Input Pin:
Logic one (1) is applied to a bit in the P register. Output FE transistor is turned off. The
appropriate pin remains connected to voltage power supply through a pull-up resistor of
high resistance .

A logic state (voltage) on any pin can be changed or read at any moment. A logic zero (0)
and logic one (1) are not equal. A logic one (0) represents almost short circuit to ground.
Such a pin is configured as output.
A logic one (1) is loosely connected to voltage power supply through resistors of high
resistance. Since this voltage can be easily pulled down by an external signal, such a pin is
configured as input.
Port 0
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance
inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during
accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also
receives the code bytes during Flash programming, and outputs the code bytes during program
verification. External pull-ups are required during program verification.

It is specific to this port to have a double purpose. If external memory is used then
the lower address byte (addresses A0-A7) is applied on it. Otherwise, all bits on this port
are configured as inputs or outputs.
Another characteristic is expressed when it is configured as output. Namely,
unlike other ports consisting of pins with embedded pull-up resistor ( connected by its end
to 5 V power supply ), this resistor is left out here. This, apparently little change has its
consequences:

If any pin on this port is configured as input then it performs as if it floats. Such input
has unlimited input resistance and has no voltage coming from inside.

When the pin is configured as output, it performs as open drain, meaning that by
writing 0 to some ports bit, the appropriate pin will be connected to ground (0V). By
writing 1, the external output will keep on floating. In order to apply 1 (5V) on this
output, an external pull-up resistor must be embedded.

Only in case P0 is used for addressing external memory ( only in that case), the
microcontroller will provide internal power supply source in order to establish logical ones on
pins. There is no need to add external pullup resistors.

Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled
low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order
address bytes during Flash programming and verification.

This is a true I/O port, because there are no role assigning as it is the case with P0.
Since it has embedded pull-up resistors it is completely compatible with TTL circuits.
Port 2
Similar to P0, when using external memory, lines on this port occupy addresses intended
for external memory chip. This time it is the higher address byte with addresses A8-A15. When
there is no additional memory, this port can be used as universal input-output port similar by its
features to the port 1. Port 2 is an 8-bit bi-directional I/O port with internal pull-ups.
The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally
being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external data 16-bit
addresses (MOVX@DPTR). In this application, it uses strong memory uses internal pull-ups when
emitting1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI); Port 2 emits
the contents of the P2 Special Function Register. Port2also receives the high-order address bits and some
control signals during Flash programming and verification.

Port 3
Even though all pins on this port can be used as universal I/O port, they also have an
alternative function. Since each of these functions use inputs, then the appropriate pins have to be
configured like that. In other words, prior to using some of reserve port functions, a logical one
(1) must be written to the appropriate bit in the P3 register. From hardwares perspective, this port
is also similar to P0, with the difference that its outputs have a pull-up resistor embedded. Port 3
is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can sink/source
four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups
and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source

current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of
the AT89C52 as listed below:

Port Pin

Alternate Functions

P3.0

RXD (serial input port)

P3.1

TXD (serial output port)

P3.2

INT0 (external interrupt 0)

P3.3

INT1 (external interrupt 1)

P3.4

T0 (timer 0 external input)

P3.5

T1 (timer 1 external input)

P3.6
P3.7

WR (external data memory Write


strobe)
RD (external data memory read strobe)

Port 3 also receives some control signals for Flash programming and verification.

Current limitations on pins

When configured as outputs (logic zero (0)), single port pins can "receive" current
of 10mA. If all 8 bits on a port are active, total current must be limited to 15mA (port P0:
26mA). If all ports (32 bits) are active, total maximal current must be limited to 71mA.
When configured as inputs (logic 1), embedded pull-up resistor provides very weak
current, but strong enough to activate up to 4 TTL inputs from LS series.
It may be seen from description of some ports, that even though all pins have
more or less similar internal structure, it is necessary to pay attention to which of them
will be used for what and how.
For example: If they are used as outputs with high voltage level (5V), then port 0
should be avoided because its pins do not have added resistor for connection to +5V. Only
low logic level can be obtained therefore, if another port is used for the same purpose, one

should have in mind that pull-up resistors have a relatively high resistance. Consequently
it can be counted on only several hundred microamperes of current coming out of a pin.
MICROCONTROLLER MEMORY ORGANIZATION
The microcontroller memory is divided into Program Memory and Data Memory.
Program Memory (ROM) is used for permanent saving program being executed, while
Data Memory (RAM) is used for temporarily storing and keeping intermediate results and
variables. Depending on the model in use at most a few Kb of ROM and 128 or 256 bytes
of RAM can be used however
All 8051 microcontrollers have 16-bit addressing bus and can address 64 kb
memory. It is neither a mistake nor a big ambition of engineers who were working on
basic core development. It is a matter of very clever memory organization which makes
these controllers a real programmers tidbit.
Program Memory

The oldest models of the 8051 microcontroller family did not have internal
program memory. It was added from outside as a separate chip. These models are
recognizable by their label beginning with 803 (for ex. 8031 or 8032). All later models
have a few Kbytes ROM embedded, Even though it is enough for writing most of the
programs, there are situations when additional memory is necessary. A typical example of
it is the use of so called lookup tables.

They are used in cases when something is

too complicated or when there is no time for solving equations describing some process.
The example of it can be totally exotic (an estimate of self-guided rockets meeting point)
or totally common (measuring of temperature using non-linear thermo element or
asynchronous motor speed control). In those cases all needed estimates and approximates
are executed in advance and the final results are put in the tables (similar to logarithmic
tables).
How does the microcontroller handle external memory depend on the pin EA logic state?

EA=0 In this case, internal program memory is completely ignored, only a program
stored in external memory is to be executed.
EA=1 In this case, a program from built-in ROM is to be executed first ( to the last
location). Afterwards, the execution is continued by reading additional memory.
in both cases, P0 and P2 are not available to the user because they are used for data and
address transmission. Besides, the pins ALE and PSEN are used too.

Data Memory

As already mentioned, Data Memory is used for temporarily storing and keeping
data and intermediate results created and used during microcontrollers operating.
Besides, this microcontroller family includes many other registers such as: hardware

counters and timers, input/output ports, serial data buffers etc. The previous versions have
the total memory size of 256 locations, while for later models this number is incremented
by additional 128 available registers. In both cases, these first 256 memory locations
(addresses 0-FFh) are the base of the memory. Common to all types of the 8051
microcontrollers. Locations available to the user occupy memory space with addresses
from 0 to 7Fh. First 128 registers and this part of RAM is divided in several blocks.
The AT89C52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a
parallel address space to the Special Function Registers. That means the upper 128 bytes have the
same addresses as the SFR space but are physically separate from SFR space. When an instruction
accesses an internal location above address 7FH, the address mode used in the instruction
specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Instructions
that use direct addressing access SFR space. For example, the following direct addressing
instruction accesses the SFR at location 0A0H (which is P2).

MOV 0A0H, #data


Instructions that use indirect addressing access the upper 128 bytes of RAM. For example, the
following indirect addressing instruction, where R0 contains 0A0H, accesses the data byte at
address 0A0H, rather than P2 (whose address is 0A0H).
MOV @R0, #data
Note that stack operations are examples of indirect addressing, so the upper 128 bytes of data
RAM are available as stack space.
Additional Memory Block of Data Memory

In order to satisfy the programmers permanent hunger for Data Memory,


producers have embedded an additional memory block of 128 locations into the latest
versions of the 8051 microcontrollers. Naturally, its not so simpleThe problem is that
electronics performing addressing has 1 byte (8 bits) on disposal and due to that it can
reach only the first 256 locations. In order to keep already existing 8-bit architecture and
compatibility with other existing models a little trick has been used.
Using trick in this case means that additional memory block shares the same
addresses with existing locations intended for the SFRs (80h- FFh). In order to
differentiate between these two physically separated memory spaces, different ways of
addressing are used. A direct addressing is used for all locations in the SFRs, while the
locations from additional RAM are accessible using indirect addressing.

POWER SUPPLY:
The input to the circuit is applied from the regulated power supply. The a.c. input
i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a
rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to
get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any
a.c components present even after rectification. Now, this voltage is given to a voltage
regulator to obtain a pure constant dc voltage.

D.C
Output

230V AC
50Hz

Step down
transformer

Bridge
Rectifier

Regulator

Filter

Fig: Power supply

Transformer:
Usually, DC voltages are required to operate various electronic equipment and these
voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c
input available at the mains supply i.e., 230V is to be brought down to the required
voltage level. This is done by a transformer. Thus, a step down transformer is employed
to decrease the voltage to a required level.

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.

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.
VOLTAGE REGULATOR 7805:

Features:
Output Current up to 1A.
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.
Thermal Overload Protection.
Short Circuit Protection.
Output Transistor Safe Operating Area Protection.

CAPACITORS:
A capacitor or condenser is a passive electronic component consisting of a pair of
conductors separated by a dielectric. When a voltage potential difference exists between the
conductors, an electric field is present in the dielectric. This field stores energy and produces a
mechanical force between the plates. The effect is greatest between wide, flat, parallel, narrowly
separated conductors.

An ideal capacitor is characterized by a single constant value, capacitance, which is


measured in farads. This is the ratio of the electric charge on each conductor to the potential
difference between them. In practice, the dielectric between the plates passes a small amount of
leakage current. The conductors and leads introduce an equivalent series resistance and the
dielectric has an electric field strength limit resulting in a breakdown voltage.
The properties of capacitors in a circuit may determine the resonant frequency and
quality factor of a resonant circuit, power dissipation and operating frequency in a digital logic
circuit, energy capacity in a high-power system, and many other important aspects.

A capacitor (formerly known as condenser) is a device for storing electric charge. The
forms of practical capacitors vary widely, but all contain at least two conductors separated
by a non-conductor. Capacitors used as parts of electrical systems, for example, consist of
metal foils separated by a layer of insulating film.

Theory of operation:
Main article:

Charge separation in a parallel-plate capacitor causes an internal electric field. A dielectric


(orange) reduces the field and increases the capacitance.

A simple demonstration of a parallel-plate capacitor

A capacitor consists of two conductors separated by a non-conductive region The nonconductive region is called the dielectric or sometimes the dielectric medium. In simpler
terms, the dielectric is just an electrical insulator. Examples of dielectric mediums are
glass, air, paper, vacuum, and even a semiconductor depletion region chemically identical
to the conductors. A capacitor is assumed to be self-contained and isolated, with no net
electric charge and no influence from any external electric field. The conductors thus hold
equal and opposite charges on their facing surfaces, and the dielectric develops an electric
field. In SI units, a capacitance of one farad means that one coulomb of charge on each
conductor causes a voltage of one volt across the device. The capacitor is a reasonably
general model for electric fields within electric circuits. An ideal capacitor is wholly
characterized by a constant capacitance C, defined as the ratio of charge Q on each
conductor to the voltage V between them:

Sometimes charge build-up affects the capacitor mechanically, causing its capacitance to
vary. In this case, capacitance is defined in terms of incremental changes:

Energy storage:

Current-voltage relation
The current i(t) through any component in an electric circuit is defined as the rate of flow
of a charge q(t) passing through it, but actual charges, electrons, cannot pass through the
dielectric layer of a capacitor, rather an electron accumulates on the negative plate for
each one that leaves the positive plate, resulting in an electron depletion and consequent
positive charge on one electrode that is equal and opposite to the accumulated negative
charge on the other. Thus the charge on the electrodes is equal to the integral of the
current as well as proportional to the voltage as discussed above. As with any
antiderivative, a constant of integration is added to represent the initial voltage v (t0). This
is the integral form of the capacitor equation,

Taking the derivative of this, and multiplying by C, yields the derivative form,

The dual of the capacitor is the inductor, which stores energy in the magnetic field rather
than the electric field. Its current-voltage relation is obtained by exchanging current and
voltage in the capacitor equations and replacing C with the inductance L.

DC circuits
See also: RC circuit

A simple resistor-capacitor circuit demonstrates charging of a capacitor.

A series circuit containing only a resistor, a capacitor, a switch and a constant DC source
of voltage V0 is known as a charging circuit. If the capacitor is initially uncharged while
the switch is open, and the switch is closed at t = 0, it follows from Kirchhoff's voltage
law that

Taking the derivative and multiplying by C, gives a first-order differential equation,

At t = 0, the voltage across the capacitor is zero and the voltage across the resistor is V0.
The initial current is then i (0) =V0 /R. With this assumption, the differential equation
yields

where 0 = RC is the time constant of the system.


As the capacitor reaches equilibrium with the source voltage, the voltage across the
resistor and the current through the entire circuit decay exponentially. The case of
discharging a charged capacitor likewise demonstrates exponential decay, but with the
initial capacitor voltage replacing V0 and the final voltage being zero.

AC circuits:
Impedance, the vector sum of reactance and resistance, describes the phase difference and
the ratio of amplitudes between sinusoidally varying voltage and sinusoidally varying
current at a given frequency. Fourier analysis allows any signal to be constructed from a
spectrum of frequencies, whence the circuit's reaction to the various frequencies may be
found. The reactance and impedance of a capacitor are respectively

Parallel plate model:

Solving this for C = Q/V reveals that capacitance increases with area and decreases with
separation

The capacitance is therefore greatest in devices made from materials with a high
permittivity.

For capacitors in parallel


Capacitors in a parallel configuration each have the same applied voltage. Their capacitances add
up. Charge is apportioned among them by size. Using the schematic diagram to visualize parallel
plates, it is apparent that each capacitor contributes to the total surface area.

For capacitors in series

Several capacitors in series.


Connected in series, the schematic diagram reveals that the separation distance, not the plate area,
adds up. The capacitors each store instantaneous charge build-up equal to that of every other
capacitor in the series. The total voltage difference from end to end is apportioned to each
capacitor according to the inverse of its capacitance. The entire series acts as a capacitor smaller
than any of its components.

Capacitors are combined in series to achieve a higher working voltage, for example for smoothing
a high voltage power supply. The voltage ratings, which are based on plate separation, add up. In
such an application, several series connections may in turn be connected in parallel, forming a
matrix. The goal is to maximize the energy storage utility of each capacitor without overloading
it.
Series connection is also used to adapt electrolytic capacitors for AC use.

Equivalent circuit

As frequency approaches infinity, the capacitive impedance (or reactance) approaches


zero and the ESR becomes significant. As the reactance becomes negligible, power
dissipation approaches PRMS = VRMS /RESR.
Similarly to ESR, the capacitor's leads add equivalent series inductance or ESL to the
component. This is usually significant only at relatively high frequencies. As inductive
reactance is positive and increases with frequency, above a certain frequency capacitance
will be canceled by inductance. High-frequency engineering involves accounting for the
inductance of all connections and components.
If the conductors are separated by a material with a small conductivity rather than a
perfect dielectric, then a small leakage current flows directly between them. The capacitor
therefore has a finite parallel resistance, and slowly discharges over time (time may vary
greatly depending on the capacitor material and quality).

RESISTORS

A resistor is a two-terminal electronic component designed to oppose an electric current by


producing a voltage drop between its terminals in proportion to the current, that is, in accordance
with Ohm's law:
V = IR
Resistors are used as part of electrical networks and electronic circuits. They are extremely
commonplace in most electronic equipment. Practical resistors can be made of various
compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as
nickel/chrome).

The primary characteristics of resistors are their resistance and the power they can
dissipate. Other characteristics include temperature coefficient, noise, and inductance. Less wellknown is critical resistance, the value below which power dissipation limits the maximum
permitted current flow, and above which the limit is applied voltage. Critical resistance depends
upon the materials constituting the resistor as well as its physical dimensions; it's determined by
design.
Resistors can be integrated into hybrid and printed circuits, as well as integrated
circuits. Size, and position of leads (or terminals) are relevant to equipment designers; resistors
must be physically large enough not to overheat when dissipating their power.

Units
The ohm (symbol: ) is the SI unit of electrical resistance, named after Georg Simon
Ohm. An ohm is equivalent to a volt per ampere. Since resistors are specified and
manufactured over a very large range of values, the derived units of milliohm (1 m =

103 ), kilo ohms (1 k = 10 3 ), and mega ohm (1 M = 10 6 ) are also in common


usage.
The reciprocal of resistance R is called conductance G = 1/R and is measured in Siemens
(SI unit), sometimes referred to as a mho. Thus a Siemens is the reciprocal of an ohm: S =

. Although the concept of conductance is often used in circuit analysis, practical

resistors are always specified in terms of their resistance (ohms) rather than conductance.

SYSTEM MODEL
The proposed system consists of a set of biomedical sensors attached with the
body of a patient. A wireless transmitter is used to send the data to a wireless receiver
connected to a local monitoring unit. In this work we used six biomedical sensors to
monitor heart beat rate, temperature, changes in muscles power, and ECG signals of a
patient. These sensors convert the physiological changes of the patients body into
biomedical signals. The conditioning circuit (i.e., Arduino microcontroller) reads the data
from the sensors and controls the transmission of data to a monitoring unit. The
monitoring unit displays the data that is used by the physicians for necessary medical
advices. The wireless receiver consists of Xbee that receives data and sends it to the local
monitoring unit. The monitoring unit can display, record, and analyze the data. It can send

reports as well as alarming messages to the healthcare professionals. The system block
diagram of the proposed system is shown in Figure 2.
Based on the customer requirements the system hardware can be easily modified
to accommodate more sensors. The data transmission can also take place via wired or
wireless channels. The proposed system can be connected to the Internet for global
communication. In addition, the proposed system is carefully implemented in hardware
and software system so that it can be adapted to fulfill the users requirements. Since
accuracy is one of the most important issues in biomedical signal processing, the
proposed system has been field tested extensively to ensure its accuracy. The system can
continuously monitor the health of a patient twenty four hours a day. The proposed
system is also able to inform the healthcare professionals about any unusual health
conditions of a patient. The doctors can also use the publishing system incorporated with
the system. When the measured data exceeds the allowable normal range, the system can
send an alarm message to the concerned healthcare professionals. The system can
facilitate healthcare professionals to perform immediate medical diagnosis and to
administer the medical treatment if needed. The system measures different physical
parameters of a patient by using four different sensors as shown in Figure 3. The
microcontroller receives the signals from the sensors and processes them before sending
them to a ZigBee transmitter module. The transmitter module transmits the signal that is
received by the receiving antenna of the ZigBee receiver.

Microcontroller

BLOCK DIAGRAM:
TRANSMITTER

Heart beet
sensor
LCD

Temperature
sensor

MAX
232

Vibration
sensor

POWER SUPPLY:

Step
down
T/F

Bridge
rectifier

ZIGBEE

Filter

Max
232

Voltage
regulator

PC

ZIGBEE

RECEIVER SECTION:

The system block diagram for the receiver is shown in Figure 4. The receiver
antenna receives the data sent by the transmitting antenna and then the data are sent to a
PC (i.e., Monitoring Unit) for display. The Monitoring Unit sends report using the internet
to the concerned healthcare professionals.
The temperature sensor used in our system is shown in Figure 5(a) and the
associated program flowchart in shown in Figure 5(b). We used LM35 sensor for our
project. The LM35 is a high precision integrated temperature sensor. It generates an
analog voltage depending on the temperature of the patients body. The sensor output
voltage is linearly proportional to the body temperature. The sensor circuitry is sealed and
is not subject to oxidation. The LM35 generates a higher output voltage than
thermocouples. The sensor can measure temperature and generate signal that is sent to a
microcontroller. The data are then transmitted by the ZigBee to the PC. The sensors are
connected to the I/O port of the PIC microcontroller (i.e., Arduino). The output voltage is
converted into temperature by a simple conversion factor. As shown in Figure 6 the
temperature sensor measures the temperature and converts it into electrical signal. The
electrical signal is then processed by a microcontroller and the LabView software.
Finally, it is displayed in the monitoring unit. We set the normal body temperature
of a patient in the range of 36C - 40C. If the temperature reading is less than 36C or
more than 40C degree the alarm will be ON and it will send an alert message to the
concerned healthcare professional. The heart beat sensor used to measure the heartbeat of
the patient is shown in Figure 6(a). This sensor monitors the flow of blood through a clip
that is attached with a fingertip. The sensor has a laser that emits light through the skin
and measures the reflection of the laser due to the flow of the blood. The heart beat rate of
an individual may vary. At rest, an adult man has an average pulse rate of 72 beats per
minute. Athletes normally have a lower pulse rate compared to that of a less active
people. On the other hand children have a higher pulse rate (approx. 90 beats per minute).
We set the critical pulse rate at 120 beats per minute. The flowchart for the heart pulse
International Journal of Wireless & Mobile Networks (IJWMN) Vol. 6, No. 3, June 2014
61 sensor is shown in Figure 6(b). The sensor measures the heart beats and converts them
into electrical signals. Then the receiver antenna sends the data to the Monitoring Unit for
displaying the data. If the pulse rate is less than 120 beats per minute, the alarm will be
ON and it will alert the concerned authority.

FLOW CHART:

Fig: The measurement of heart beat rates

The muscles sensor used in this project is shown in Figure 7(a). The sensor detects the
changes in the muscle force and converts it into variable resistive readable values. The
local monitoring unit coverts the resistive date from the muscle sensor to a power signal.
The main purpose of the muscle sensor is to measure the power from the muscles. In
some cases elderly people who are unable to move or disabled and their muscles power
decreases over a time period, the sensor sends an alert message to health care service
provider. If the patient is moving or standing still or sleeping, the status of the patients
movement can also be monitored by our proposed system. The flowchart of the muscle
sensor is shown in Figure 7(b). The transmitter sends the signal which is received by the
receiver. The receiver sends the data to the Monitoring Unit for graphical display. If the
reading is less than 150 or more than 500 the alarm will be ON and it will alert the health
care service provider.
ECG is an important biomedical parameter and is used clinically in diagnosing
various diseases and conditions of a patients heart. The acquisition of a real time ECG
signal requires an expensive CARDIART machine and only experienced cardiologist can
interpret the ECG signal. However, in developing and under developed countries people
cannot make use of this facility because they live in remote areas. In this proposed system
we developed an accurate, low cost, and user friendly real time ECG acquisition system
for monitoring general cardiac abnormalities. By using the proposed system the ECG data
can be monitored and analysed from a remote location via Web browser. Hence, the
system supports long distance diagnosis. The system can generate a report of the patient's
condition by using the ECG data. The hardware ECG is mainly consisting of an electronic
circuit, which uses amplifiers and switches to amplify the readings from the sensor so that
it can be read and displayed. The software ECG monitors the readings from the sensors
and then converts them into the readings based on a defined formula. The reading of the
software ECG has been verified with that of a CARDIART machine in order to ensure
reliability and accuracy. The proposed system measures ECG data from four sensors

placed at four different places of the patients body as shown in Figure 8 and provides an
output as shown in Figure 9. The detail operation of the ECG is illustrated in Figure 10.
First, the microcontroller (i.e., Arduino) takes the signals from the sensors and converts
them into readable values using some defined formula. Then the data are transferred from
the transmitter to the receiver (i.e.,Xbee). Then the LabView program combines these
readings from the four sensors and provides one variable output. The ECG signal flow
diagram is shown in Figure 10.

ZIGBEE :
ZigBee is an IEEE 802.15.4-based specification for a suite of high-level
communication protocols used to create personal area networks with small, lowpower digital radios.
The technology defined by the ZigBee specification is intended to be simpler and less
expensive than other wireless personal area networks (WPANs), such as Bluetooth or WiFi. Applications include wireless light switches, electrical meters with in-home-displays,
traffic management systems, and other consumer and industrial equipment that requires
short-range low-rate wireless data transfer.
Its low power consumption limits transmission distances to 10100 meters line-of-sight,
depending on power output and environmental characteristics. [1] ZigBee devices can
transmit data over long distances by passing data through a mesh network of intermediate
devices to reach more distant ones. ZigBee is typically used in low data rate applications
that require long battery life and secure networking (ZigBee networks are secured by 128
bit symmetric encryption keys.) ZigBee has a defined rate of 250 kbit/s, best suited for
intermittent data transmissions from a sensor or input device.
ZigBee was conceived in 1998, standardized in 2003, and revised in 2006. The name
refers to the waggle dance of honey bees after their return to the beehive.
Overview
ZigBee is a low-cost, low-power, wireless mesh network standard targeted at the wide
development of long battery life devices in wireless control and monitoring applications.
Zigbee devices have low latency, which further reduces average current. ZigBee chips are

typically integrated with radios and with microcontrollers that have between 60-256 KB
flashes memory. ZigBee operates in the industrial, scientific and medical (ISM) radio
bands: 2.4 GHz in most jurisdictions worldwide; 784 MHz in China, 868 MHz in Europe
and 915 MHz in the USA and Australia. Data rates vary from 20 kbit/s (868 MHz band)
to 250 kbit/s (2.4 GHz band).
The ZigBee network layer natively supports both star and tree networks, and
generic mesh networking. Every network must have one coordinator device, tasked with
its creation, the control of its parameters and basic maintenance. Within star networks, the
coordinator must be the central node. Both trees and meshes allow the use of
ZigBee routers to extend communication at the network level.
ZigBee builds on the physical layer and media access control defined in IEEE standard
802.15.4 for low-rate WPANs. The specification includes four additional key
components: network layer, application layer, ZigBee device objects (ZDOs) and
manufacturer-defined application objects which allow for customization and favor total
integration. ZDOs are responsible for some tasks, including keeping track of device roles,
managing requests to join a network, as well as device discovery and security.
ZigBee is one of the global standards of communication protocol formulated by the
significant task force under the IEEE 802.15 working group. The fourth in the series,
WPAN Low Rate/ZigBee is the newest and provides specifications for devices that have
low data rates, consume very low power and are thus characterized by long battery life.
Other standards like Bluetooth and IrDA address high data rate applications such as voice,
video and LAN communications.
History
ZigBee-style self-organizing ad-hoc digital radio networks were conceived in the
1990s. The IEEE 802.15.4-2003 ZigBee specification was ratified on December 14, 2004.
[3]
The ZigBee Alliance announced availability of Specification 1.0 on June 13, 2005,
known as the ZigBee 2004 Specification.
Cluster Library
In September 2006, the ZigBee 2006 Specification was announced, obsoleting the 2004
stack[4] (2006 mainly replaces the Message/Key Value Pair structure used in 2004 with a
"cluster library").
The library is a set of standardised commands, organised under groups known as clusters
with names such as Smart Energy, Home Automation, ZigBee Light Link.[5]

ZigBee PRO
ZigBee PRO, also known as Zigbee 2007, the enhanced ZigBee Pro Specification, was
posted on 31 October 2007, and was finalized that same year [citation needed]. ZigBee PRO is
fully backward-compatible with ZigBee 2006 devices. A ZigBee 2007 device may join
and operate on a ZigBee 2006 network and vice versa. Due to differences in routing
options, ZigBee PRO devices must become non-routing ZigBee End-Devices (ZEDs) on
a ZigBee 2006 network, and ZigBee 2006 devices must become ZEDs on a ZigBee PRO
network. The applications running on those devices work the same, regardless of the stack
profile beneath them. The first ZigBee Application Profile, Home Automation, was
announced November 2, 2007.
Use cases
ZigBee protocols are intended for embedded applications requiring low power
consumption and tolerating low data rates. The resulting network will use very small
amounts of power individual devices must have a battery life of at least two years to
pass ZigBee certification.[6]
Typical application areas include:[7]

Home Entertainment and Control Home automation such as in QIVICON,


[8]
smart lighting,[9] advanced temperature control, safety and security, movies and
music

Wireless sensor networks Starting with individual sensors like Telosb/Tmote


and Iris from Memsic

Industrial control

Embedded sensing

Medical data collection

Smoke and intruder warning

Building automation

Standard and profiles:


The ZigBee Alliance is a group of companies that maintain and publish the ZigBee
standard.[10] The term ZigBee is a registered trademark of this group, not a single
technical standard. The Alliance publishes application profiles that allow
multiple OEM vendors to create interoperable products. The relationship between IEEE
802.15.4 and ZigBee[11] is similar to that between IEEE 802.11 and the Wi-Fi Alliance.

License
For non-commercial purposes, the ZigBee specification is available free to the general
public.[12] An entry level membership in the ZigBee Alliance, called Adopter, provides
access to the as-yet unpublished specifications and permission to create products for
market using the specifications.
The requirements for membership in the ZigBee Alliance cause problems for Free
Software developers because the annual fee conflicts with the GNU General Public
Licence.[13]The requirement for the developer to join the ZigBee Alliance similarly
conflicts with most other free software licenses.[14]
The ZigBee Alliance board has been asked to make their license compatible with GPL,
but refused. The refusal came, even though Bluetooth had already changed their license to
make it consistent with GPL.
Application profiles
The current list of application profiles either published, or in development are:
Released specifications

ZigBee Home Automation 1.2

Smart Energies 1.1b

Telecommunication Services 1.0

Health Care 1.0

RF4CE Remote Control 1.0

RF4CE Input Device 1.0

Remote Control 2.0

Light Link 1.0

IP 1.0

Building Automation 1.0

Gateway 1.0

Green Power 1.0 (Optional battery-less remote control feature of ZigBee 2012)

Retail Services

Specifications under development

ZigBee Smart Energy 2.0

Smart Energy 1.2/1.3

Light Link 1.1

Home Automation 1.3

The ZigBee Smart Energy V2.0 specifications define an Internet protocol to monitor,
control, inform and automate the delivery and use of energy and water. It is an
enhancement of the ZigBee Smart Energy version 1 specifications. [15] It adds services
for plug-in electric vehicle charging, installation, configuration and firmware download,
prepay services, user information and messaging, load control, demand response and
common information and application profile interfaces for wired and wireless networks. It
is being developed by partners including:

HomeGrid Forum responsible


T G.hn technology and products

HomePlug Powerline Alliance

International Society of Automotive Engineers SAE International

IPSO Alliance

SunSpec Alliance

Wi-Fi Alliance.

for

marketing

and

certifying

ITU-

In 2009, the RF4CE (Radio Frequency for Consumer Electronics) Consortium and
ZigBee Alliance agreed to deliver jointly a standard for radio frequency remote controls.
ZigBee RF4CE is designed for a broad range of consumer electronics products, such as
TVs and set-top boxes. It promised many advantages over existing remote control
solutions, including richer communication and increased reliability, enhanced features
and flexibility, interoperability, and no line-of-sight barrier.[16] The ZigBee RF4CE
specification lifts off some networking weight and does not support all the mesh features,
which is traded for smaller memory configurations for lower cost devices, such as remote
control of consumer electronics.
With the introduction of the second ZigBee RF4CE application profile in 2012 and
increased momentum in MSO market, the ZigBee RF4CE team provides an overview on
current status of the standard, applications, and future of the technology.
Radio hardware

The radio design used by ZigBee has been carefully optimized for low cost in large scale
production. It has few analog stages and uses digital circuits wherever possible.
Though the radios themselves are inexpensive, the ZigBee Qualification Process involves
a full validation of the requirements of the physical layer. All radios derived from the
same validated semiconductor mask set would enjoy the same RF characteristics. An
uncertified physical layer that malfunctions could cripple the battery lifespan of other
devices on a ZigBee network. ZigBee radios have very tight constraints on power and
bandwidth. Thus, radios are tested with guidance given by Clause 6 of the 802.15.4-2006
Standard. Most vendors plan to integrate the radio and microcontroller onto a single
chip[19] getting smaller devices.[20]
This standard specifies operation in the unlicensed 2.4 GHz (worldwide),
915 MHz (Americas and Australia) and 868 MHz (Europe) ISM bands. Sixteen channels
are allocated in the 2.4 GHz band, with each channel spaced 5 MHz apart, though using
only 2 MHz of bandwidth. The radios use direct-sequence spread spectrum coding, which
is managed by the digital stream into the modulator. Binary phase-shift keying (BPSK) is
used in the 868 and 915 MHz bands, and offset quadrature phase-shift keying (OQPSK)
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. The actual data
throughput will be less than the maximum specified bit rate due to the packet overhead
and processing delays. For indoor applications at 2.4 GHz transmission distance may be
1020 m, depending on the construction materials, the number of walls to be penetrated
and the output power permitted in that geographical location.[21] Outdoors with line-ofsight, range may be up to 1500 m depending on power output and environmental
characteristics[1][citation needed]. The output power of the radios is generally 0-20 dBm (1100 mW).
Example commercial SOCs

Ban
d

Activ
e Rx
Curr
ent

Activ
PM1
e Tx
Curr
Curre
ent
nt

Microc MRF24 40- 2.4


hip
J40[22]
pin GH
lead z
less
QF

19 m
A (94 d
Bm
to

23 m
A
(+0 d
Bm),

Part
Pac
Vendor Numbe kag
r
e

RA
M

2 A 912
(s
B
wake
)

Flas Process
h
or

Interface
s

Transcei SPI
ver only

N
6x6
mm

pac
kag
e

Texas
Instru
ments

CC265
0[23]

4x4
and
5x5
32pin
QF
N,
7x7
48pin
QF
N

7x7
48Silicon EM358
pin
Labs
x[24]
QF
N

+5 d
Bm)

2.4
GH
z

5.9
mA
(-97
dBm
)

6.1 m
A
(+0 d
Bm),
9.1 m
A
(+5 d
Bm)

0.55
mA
(14
s
wake
) or
0.02
7m
A
(151
s
wake
)

2.4
GH
z

27 m
A (100
dBm
)

31 m
A
(+3 d
Bm)

321 A 64
kB

20
kB
SR
AM
+
128
8k
kB
B
SR
AM
cac
he

256
512
kB

UART,
I2C,
I2S,
2xSPI,
12-bit
ADC,
10/15/31
GPIO,
Sensor
Controll
48 MHz er
ARM
Engine,
Cortex- Tempera
M3
ture &
Battery
monitor,
also
supports
Bluetoot
h Smart
(BLE)
and
6LoWP
AN

6/12/24
MHz
CortexM3

USB2.0,
UART,
2xSPI,
24 GPIO

5.3x
5.3
2.4
Marvel 88MZ1 48GH
l
00[25]
pin
z
QF
N

14 m
A (104
dBm
)

26 m
A
(+9 d
Bm)

2.4
GH
z

34 m
A (94 d
Bm)

27 m
A
(0 dB
m)

JN516x[27]

16x
30
2.4
27GH
pin
z
mod
ule

17 m
A (95 d
Bm)

15 m
A
(+2.5
dBm)

Atmel

ATZB24B0[28]

18x
13.5
2.4
48GH
pin
z
mod
ule

21.8
mA
(-101
dBm
)

Telink

7x7
48pin
TQ
TLSR8 FN,
636[29] 5x5
32pin
TQ
FN

Freesc
ale

NXP

7x7
48MC132
pin
3x[26]
LG
A

2.4
GH
z

12 m
A (99 d
Bm)

20.8
mA
(0 dB
m)

12 m
A
(0 dB
m)

160 512
kB kB

2xUAR
32/64 M
T,
Hz
2xSPI,
Cortex2xI2C,
M3
31 GPIO

0.45
uA

8k
B

128
kB

UART,
32 MHz
SPI,
HCS08
I2C,
QE
32 GPIO

0.12
uA

832
kB

64256
kB

2xUAR
T, SPI,
32 MHz
2xI2C,
20 GPIO

128
kB

USB2.0,
UART,
4 MHz
USART,
ATmega
I2C,
1281V
SPI,
30 GPIO

512
kB

USB2.0,
UART,
I2C,
48 MHz SPI,
32bit
35/20 G
MCU
PIO
dependi
ng
on
package

6 A

1 A

8k
B

16
kB

5x5
Green
32Peak
GP691[
pin
Techno 30]
QF
logies
N

2.4
GH
z

18 m
A
12 m (+0 d
A (- Bm),
96 d 29 m
Bm) A
(+7 d
Bm)

1 A
(2 m
s
wake
) or
0.72
mA
(1 s
wake
)

16
KB
RA
M

248
KB

XAP5
16/32bit

SPI,
I2C,
UART,
16 GPI
O,
2 ANIO,
10-bit A
DC,
keyboar
d
scanner,
IR
generato
r,
4channel
16-bit P
WM,
4 LED
driver,
temperat
ure
sensor,
battery
monitor,
antenna
diversity

Device types and operating modes[edit]


ZigBee devices are of three kinds:

ZigBee Coordinator (ZC): The most capable device, the Coordinator forms the
root of the network tree and might bridge to other networks. There is precisely one
ZigBee Coordinator in each network since it is the device that started the network
originally (the ZigBee LightLink specification also allows operation without a ZigBee
Coordinator, making it more usable for over-the-shelf home products). It stores
information about the network, including acting as the Trust Center & repository for
security keys.[31][32]

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

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.

The current ZigBee protocols support beacon and non-beacon enabled networks. In nonbeacon-enabled networks, an unspotted 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 constantly receive, 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 depend on data rate; they may range from 15.36 milliseconds to 251.65824
seconds at 250 kbit/s, from 24 milliseconds to 393.216 seconds at 40 kbit/s and from 48
milliseconds to 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.
Except for the Smart Energy Profile 2.0, ZigBee devices are required to conform to the
IEEE 802.15.4-2003 Low-Rate Wireless Personal Area Network (LR-WPAN) standard.
The standard specifies the lower protocol layersthe physical layer (PHY), and
the Media Access Control portion of the data link layer (DLL). The basic channel access
mode is "carrier sense, multiple access/collision avoidance" (CSMA/CA). That is, the
nodes talk in the same way that humans converse; they briefly check to see that no one is
talking before he or she start, with three notable exceptions. Beacons are sent on a fixed
timing schedule and do not use CSMA. Message acknowledgments also do not use
CSMA. Finally, devices in beacon-enabled networks that have low latency real-time

requirements may also use Guaranteed Time Slots (GTS), which by definition do not use
CSMA.
Software
The software is designed to be easy to develop on small, inexpensive microprocessors.
For more detail, please use one or more of the sources listed in the References section
below, or go directly to the ZigBee Alliance web site using the External links provided
below.
Network layer
The main functions of the network layer are to enable the correct use of
the MAC sublayer 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. 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 and onward 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 of the next hop in the path and the path cost.
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
procedures, together with application objects defined by the manufacturer, are considered
part of this layer.
Main components
The ZDO (ZigBee Device Object), a protocol in the ZigBee protocol stack, is responsible
for overall device management, security keys, and policies. It 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 elements 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.
Communication models

ZigBee, high-level communication model


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 household
appliance).
The collection of objects that form the network communicates 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.
Two services are available for application objects to use (in ZigBee 1.0):

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

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 KVP. It allows arbitrary payloads to be transmitted over APS
frames.

Addressing is also part of the application layer. A network node consists of an 802.15.4conformant 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.
Communication and device discovery
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 or outgoing data flow in a device. Binding tables contain source and destination
pairs.
Depending on the available information, device discovery may follow different methods.
When the network address is known, the IEEE address can be requested
using unicastcommunication. 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 using the
binding tables, which are maintained by ZigBee coordinators, as the table must always be

available within a network and coordinators are most likely to have a permanent power
supply. Backups, managed by higher-level layers, may be needed by some applications.
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 uses every relevant field
(address, endpoint, cluster, and attribute) and requires that they are sent to the network
coordinator, which maintains 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.
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.
Basic security model
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. For an implementation to globally work, its general
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. A momentary exception to this rule 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. Also the state of the working environment cannot be
predicted.
Within the protocol stack, different network layers are not cryptographically separated, so
access policies are needed, and conventional 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 ciphered, 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 grid, to a new connecting device.

Security architecture
ZigBee uses 128-bit keys to implementing 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 pre-installation, 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 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 center trust 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 supplied 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.

The security levels infrastructure is based on CCM*, which adds encryption- and
integrity-only features to CCM.
According to a German computer magazine website, Zigbee Home Automation 1.2 is
using fallback keys for encryption negotiation which are known and cannot be changed.
This makes the encryption highly vulnerable.

Heart beet sensor:

A heart rate monitor is a personal monitoring device that allows one to measure
one's heart rate in real time or record the heart rate for later study. It is largely used by
performers of various types of physical exercise.
History
Early models consisted of a monitoring box with a set of electrode leads which attached
to the chest. The first wireless EKG heart rate monitor was invented in 1977 by Seppo
Synjkangas, founder of Polar Electro, as a training aid for the Finnish National Cross
Country Ski team. As 'intensity training' became a popular concept in athletic circles in
the mid-80s, retail sales of wireless personal heart monitors started from 1983.[1]
Composition
Modern heart rate monitors usually comprise two elements: a chest strap transmitter and a
wrist receiver (which usually doubles as awatch) or mobile phone. In early plastic straps,
water or liquid was required to get good performance. Later units have used conductive
smart fabric with built-in microprocessors that analyze the EKG signal to determine heart
rate. More recent devices utilise optics to measure heart rate using Infrared light.[2] This is
achieved by production of infrared light by an internal bulb, as Infrared light is absorbed
by the blood, a sensor measures the amount that the infrared light is darkened by. If it is
significantly darker, due the pulse causing a temporary increase in the amount of blood
that is travelling through the measured area, that is counted as a pulse.[3]
Strapless heart rate monitors (often referred to as "wearables") now allow the user to just
touch two sensors on a wristwatch display for a few seconds to view heart rate data.
These are popular for comfort and ease of use, though they don't give as much detail as
monitors that use a chest strap. Some models of these variations of heart rate monitors
utilise an infrared sensor to measure the heart rate, as opposed to two electrodes.
More advanced models offer measurements of heart rate variability, activity, and
breathing rate to assess parameters relating to a subject's fitness. Sensor fusion algorithms
allow these monitors to detect core temperature and dehydration.
Another style of heart rate monitor replaces the plastic around-the-chest strap with fabric
sensors - the most common of these is asports bra for women that includes sensors in the
fabric.
In old versions, when a heart beat is detected a radio signal is transmitted, which the
receiver uses to determine the current heart rate. This signal can be a simple radio pulse or
a unique coded signal from the chest strap (such as Bluetooth, ANT, or other low-power
radio link); the latter prevents one user's receiver from using signals from other nearby
transmitters (known as cross-talk interference).

Newer versions include a microprocessor, which is continuously monitoring the EKG and
calculating the heart rate, and other parameters. These may include accelerometers that
can detect speed and distance, eliminating the need for foot worn devices.
There are a wide number of receiver designs, with various features. These include average
heart rate over exercise period, time in a specific heart rate zone, calories burned,
breathing rate, built-in speed and distance, and detailed logging that can be downloaded
to a computer. The receiver can be built into a smartwatch or smartphone. Wrist bands
with integrated sensor work optically, and have poor accuracy.

TEMPERETURE SENSOR:
The internal components of a photoelectric control for a typical American
streetlight. The photoresistor is facing rightwards, and controls whether current flows
through the heater which opens the main power contacts. At night, the heater cools,
closing the power contacts, energizing the street light. The heater/bimetal mechanism
provides a built-in light level transient filter.
A photoresistor or light dependent resistor (LDR) is a resistor whose resistance
decreases with increasing incident light intensity; in other words, it exhibits
photoconductivity. It can also be referred to as a photoconductor or CdS device, from
"cadmium sulfide," which is the material from which the device is made and that actually
exhibits the variation in resistance with light level. Note that CdS is not a semiconductor
in the usual sense of the word (not doped silicon).
A photoresistor is made of a high resistance semiconductor. If light falling on the device
is of high enough frequency, photons absorbed by the semiconductor give bound
electrons enough energy to jump into the conduction band. The resulting free electron
(and its hole partner) conduct electricity, thereby lowering resistance.
A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor has
its own charge carriers and is not an efficient semiconductor, e.g. silicon. In intrinsic
devices the only available electrons are in the valence band, and hence the photon must
have enough energy to excite the electron across the entire bandgap. Extrinsic devices
have impurities, also called dopants, added whose ground state energy is closer to the
conduction band; since the electrons do not have as far to jump, lower energy photons
(i.e., longer wavelengths and lower frequencies) are sufficient to trigger the device. If a
sample of silicon has some of its atoms replaced by phosphorus atoms (impurities), there
will be extra electrons available for conduction. This is an example of an extrinsic
semiconductor. Photoresistors are basically photocells

KEIL Software
7.1 Introduction
Many companies provide the 8051 assembler, some of them provide shareware
version of their product on the Web, Kiel is one of them. We can download them from
their Websites. However, the size of code for these shareware versions is limited and we
have to consider which assembler is suitable for our application.

7.2 KEIL uVision2


Kiel uVision2is an IDE (Integrated Development Environment) that helps you write,
compile, and debug embedded programs. It encapsulates the following components:
A project manager.
A make facility.
Tool configuration.
Editor.
A powerful debugger.
To help you get started, several example programs
Creating Your Own Application in uVision2
To create a new project in uVision2, you must:
Select Project - New Project.
Select a directory and enter the name of the project file.
Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from
the Device Database
Create source files to add to the project.
Select Project - Targets, Groups, and Files. Add/Files, select Source Group1, and
add the source files to the project.
Select Project - Options and set the tool options. Note when you select the target

device from the Device Database all-special options are set automatically. You
typically only need to configure the memory map of your target hardware. Default
memory model settings are optimal for most

66

7.3 KEIL Software Programing Procedure


How to write embedded C program in Keil Software?
Following steps are to be followed in order to develop, code and test the equipment
with software.
7.3.1 Procedure Steps
Step-1:
Install KEIL MicroVision-2 in your PC, Then after Click on that KEIL UVision-2
icon. After opening the window go to toolbar and select Project Tab then close previous
project.
Step-2:
Next select New Project from Project Tab.
Step-3:
Then it will open Create New Project window. Select the path where you want to
save project and edit project name.
Step-4:
Next it opens Select Device for Target window, It shows list of companies and
here you can select the device manufacturer company.
Step-5:
For an example, for your project purpose you can select the chip as 89c51/52 from
Atmel Group. Next Click OK Button, it appears empty window here you can observe left
side a small window i.e, Project Window. Next create a new file.
Step-6:
From the Main tool bar Menu select File Tab and go to New, then it will open a
window, there you can edit the program.
Step-7:
Here you can edit the program as which language will you prefer either Assembly
or C.
Step-8:
After editing the program save the file with extension as .c or .asm, if you write
a program in Assembly Language save as .asm or if you write a program in C Language
save as .c in the selected path. Take an example and save the file as test.c.
Step-9:

67

Then after saving the file, compile the program. For compilation go to project
window select source group and right click on that and go to Add files to Group.
Step-10:
Here it will ask which file has to Add. For an example here you can add test.c as
you saved before.
Step-11:
After adding the file, again go to Project Window and right click on your c file
then select Build target for compilation. If there is any Errors or Warnings in your
program you can check in Output Window that is shown bottom of the Keil window.
Step-12:
Here in this step you can observe the output window for errors and warnings.
Step-13:
If you make any mistake in your program you can check in this slide for which error
and where the error is by clicking on that error.
Step-14:
After compilation then next go to Debug Session. In Tool Bar menu go to Debug
tab and select Start/Stop Debug Session.
Step-15:
Here a simple program for LEDs Blinking. LEDS are connected to PORT-1. you
can observe the output in that port.
Step-16:
To see the Ports and other Peripheral Features go to main toolbar menu and select
peripherals.
Step-17:
In this slide see the selected port i.e, PORT-1.
Step-18:
Start to trace the program in sequence manner i.e., step by step execution and
observe the output in port window.
Step-19: After completion of Debug Session Create an Hex file for Burning the
Processor. Here to create an Hex file go to project window and right click on Target next
select Option for Target.
Step-20:

68

It appears one window; here in target tab modify the crystal frequency as you connected
to your microcontroller.
Step-21:
Next go to Output tab. In that Output tab click on Create HEX File and then click OK.
Step-22:
Finally Once again compile your program. The Created Hex File will appear in your path
folder.

7.4 Applications of KEIL Software


Select Project - Rebuild all target files or Build target.
i) Debugging an Application in uVision2:
To debug an application created using uVision2, You
must:
Select Debug - Start/Stop Debug Session.
Use the Step toolbar buttons to single-step through your program. You may enter G, main
in the Output Window to execute to the main C function.
Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.
ii)

Peripheral Simulation:
The uvision2 debugger provides complete simulation for the CPU and on chip peripherals of
most embedded devices. To discover which peripherals of a device are supported, in u vision2.
Select the Simulated Peripherals item from the Help menu. You may also use the web-based
device database. We are constantly adding new devices and simulation support for on-chip
peripherals so be sure to check Device Database often.

ADVANTAGES:
The development of a biomedical instrumentation prototype for acquisition, processing
and transmission of biomedical signals.
This development could be helpful to improve peoples quality of life, As well as to allow
an improvement in the government attendance indices.
APPLICATIONS:
Remote areas
Medical applications

CONCLUSIONS
A reliable wireless healthcare monitoring system has been designed and successfully
implemented in this work. The proposed system has been field tested. The test results show that
the proposed system is able to monitor the body temperature, heart pulse rate, ECG signal, and
muscle power with enough accuracy. Since the proposed system is based on ZigBee, we can
conclude that it is a low power and low cost system. Moreover, major part of the proposed
system has been implemented in using LabView software. Hence, the proposed system is easily
reconfigurable and it can be connected to the Internet easily. The system is also able to store
physiological data of patients for 24 hours a day and seven days a week. In future the proposed
system can be extended to include more sensors that can measure more parameters like diabetes
and blood pressure. The proposed system is flexible enough to include such kind of
modifications.

REFERENCES
[1] Linking Population, Poverty, and Development available at www.unfpa.org.
[2] Health United States, 2004 available at http://www.cdc.gov.
[3] Projected Population of the United States, by age and sex:2000 to 2050 available at
http://www.census.gov
[4] Medical Costs available at kff.org/health-costs
[5]

Home

Digital

Home:

Wi-Fi

Gets

Place

At

The

Table

available

at

http://www.wirelessfidelitymag.com/
[6] Bonam Kim, Youngjon Kim, InSung Lee, and Ilsum You, Design and Implementation of a
Ubiquitous ECG Monitoring System Using SIP and the ZigBee Networks, In the proceedings of the
Future Generation Communication and Networking (FGCN 2007), December 6-8, 2007, Jeju, Korea, pp.
599-604
[7] Fariborz H., Moghawemi, M., and Mehrkanoon, S, The design of an intelligent wireless sensor
network for ubiquitous healthcare, In the Proceedings of the International Conference on Intelligent and
Advanced System, November 25-28, 2007, Kualalumpur, Malaysia, pp. 414-417
[8] Xi Xueliang, Tao Cheng, and Fang Xingyuan, A health care System based on PLC and ZiGbee, In
proceedings of the International Conference on Wireless Communication, Networking and Mobile
Computing, September 21-25, 2007, Shanghai, China, pp. 3063-3066
[9] Manohar, A. and Bhatia, D., Pressure Detection and Wireless Interfaces for patient bed, In the
Proceedings of the IEEE Biomedical Circuits and Systems Conference, November 20-22, , 2007,
Baltimore, MD, pp. 389-392
[10] Xiao Hu, Jianging Wang, Qun Yu, and Waixi Liu, A Wireless Sensor Network Based on ZiGbee
for Telemedicine Monitoring System, In the Proceedings of the 2nd International Conference on
Bioinformatics and Biomedical Engineering, May 16-18, 2008, Shanghai, China, pp. 1367-1370.
[11] Juang J.Y., and Lee, J.W., ZigBee Device Access Control and Reliable Data Transmission in
ZigBee Based Health Monitoring System, In the Proceedings of the 10th International Conference on
Advanced Communication Technology, February , Guagwan-Do, 2008, pp. 795-797
[12] Hsu Chih-Jen, Telemedicine information monitoring system, In the Proceedings of the 10th
International Conference on E-health Networking, Application, and Service, Julu 7-9, 2008, Singapore,
pp. 48-50.

[13] Jingram Luo, Yulu Chen, Kai Tang, Juwen Luo, Remote monitoring information system and its
applications based on the Internet Things, In the proceedings of the International Conference on Future
Biomedical Information Engineering, December 13-14, 2009, Sanya, pp. 482-485 [14] Ramos, J., Austin,
J.L., Torelli, G., Duque-Carnillo, J.F., A wireless sensor network fort fat and hydration monitoring by
bioimpedance analysis, In the Proceedings of the 6th International Wearble Micro and Nano
Technologies for Personalized Helath, June 25-26 , 2009, Oslo, pp. 49- 52 [15] Yuanlong Liu, and
Sahandi, R., ZigBee network for remote patient monitoring on general hospital wards, In the
Proceedings of the XXII International Symposium on Information, Communication, and Automation
technologies, October 29-31, 2009, Bosnia, pp. 1-7 [16] Chengcheng Ding, Xiaopei Wu, Zhao Lu,
Design and Implementation of the ZigBee-based Body Sensor Network System, In the Proceedings of
the 5th International Wireless Communciations, Networking, and Mobile Computing, September 24-26,
2009, Beijing, pp. 1-4. [17] Martin, H., Bernades, A.M., Bergesio, L., and Tarrio, P., Analysis of key
aspects to manage wireless sensor networks in ambient assisted living Environments, In the proceedings
of the 2nd International Symposium on Applied Sciences in Biomedical and Communciation
Technologies, November 24-27, 2009, Brastislava, pp.1-8 [18] Becher, K., Fugueredo, C.P., Muhle, C.,
and Ruff, R., Design and realization of a wireless sensor gateway for health monitoring, In the
proceedings of the Annual IEEE Conference on Engineering in Medicine and Biology Society, August 31Sept 4, 2010, Buenes Aires, pp. 374-

You might also like