Вы находитесь на странице: 1из 63

PATIENT MONITORING SYSTEM

USING ZIGBEE AND GSM

A PROJECT REPORT

Submitted by

A.BAVITHRA (84710133007)
S.SASIKALA (84710133033)
S.SATHIYA (84710133034)

In partial fulfillment for the award of the degree


of
BACHELOR OF ENGINEERING
in
ELECTRONICS AND COMMUNICATION ENGINEERING

ROEVER COLLEGE OF ENGINEERING AND TECHNOLOGY


PERAMBALUR-621212
ANNA UNIVERSITY: CHENNAI 600 025
MAY 2014

ANNA UNIVERSITY: CHENNAI 600 025


BONAFIED CERTIFICATE
Certified that this project report “PATIENT MONITORING
SYSTEM USING ZIGBEE AND GSM” is the bonafide work of
“A.BAVITHRA, S.SASIKALA, and S.SATHIYA” who carried out
the project work under my supervision.

SIGNATURE SIGNATURE
Mr.G.THIRAVIYA SUYAMBU, M.E. Mr.T.AZHAGESVARAN.M.E.

HEAD OF DEPARTMENT SUPERVISOR,

Department of ECE, Department of ECE,


Roever College of Engg &Tech, Roever College of Engg & Tech,
Perambalur-621212. Perambalur-621212.

Submitted for the university practical vive-voce held on ------------------------

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT
We Wish to Express Our Deep sense of gratitude to our honorable
chairman, Dr. K. VARADHARAAJEN B.A., B.L., for providing necessary
wisdom and grace for accomplishing this project work.
We whole-heartedly extent our warm gratitude to our respected
vice-chairman Mr. JOHN ASHOK VARADHRAAJEN M.A., B.L., for his
kind encouragement and providing opportunity to uplift our world-class
education.
We thank our beloved principal Dr. B.GANESH BABU M.E., PhD
for his unflinching devotion and continuous encouragement motivated us to
complete this project work.
We express sincere thanks with profound gratitude and respect to our
vice-principal, Dr .S. BALAMURUGAN M.Sc., M.Phill.Ph.D for his
encouragement.
We take great pleasure to thank our head of the department
Mr.G.THIRAVIYA SUYAMBU, M.E., Electronics and communication
engineering that is the source of encouragement of our learning process.
We extent our gratitude to our project guide
Mr.T.AZHAGESVARAN.M.E, Department of electronics and
communication engineering for his inspiring guidance and remarkable
encouragement during the tenure of this work.
We express our sincere gratitude to our department faculty and
non-teaching staff for their continuous support and guidelines.
We give glory and thanks to our god almighty for showering upon us
the necessary wisdom and grace for accomplishing this project. We express
our gratitude and thanks to our parents for giving health as well as a sound
mind for completing this project.
TABLE OF CONTENTS
CHAPTER TITLE PAGE NO
NO

ABSTRACT i

LIST OF FIGURE ii

LIST OF TABLE iii

LIST OF SYMBOLS iv

LIST OF ABBREVATION v

1. INTRODUCTION

1.1 NEED FOR PATIENT MONITORING SYSTEM 1

1.2 ECG 1

1.3 ZIGBEE 3

1.4 GSM 4

1.5 UART 5

2. LITERATURE REVIEW 6

3. EXISTING SYSTEM

4. PROPOSED SYSTEM

4.1 INTRODUCTION 11

4.2 BLOCK DIAGRAM 11

4.2.1 HARDWARE REQUIREMENT 12

4.2.2 SOFTWARE REQUIREMENT 12

4.2.3 COMPONENT DESCRIPTION 13

4.3 PIN DIAGRAM 15

4.4 MEMORY ORGANIZATION 19


CHAPTER TITLE PAGE NO

NO

4 4.4.1 PROGRAM MEMORY 19

. 4.4.2 DATA MEMORY 20

4.5 OSCILLATOR CHARECTERISTICS 20

4.5.1 OSCILLATOR CONECTIONS 20

4.6 IDLE MODE 21

4.6.1EXTERNAL CLOCK DRIVE CONFIGURATION 21

4.7 POWER DOWN MODE 22

4.8 PROGRAM MEMORY LOCK BIT 22

4.9 PROGRAMING THE FLASH 23

4,10 TEMPERATURE SENSOR 31

4.11 HEART BEAT SENSOR 31

4.12 ADC 33

4.13 BLOCK DIAGRAM OF ADC 34

4.14 LCD DISPLAY 35

4.15 SOFTWARE 36

5. EXPERIMENTAL RESULT 38

6 CONCLUSION 39

APPENDIX 40

A.1 CODING 40

REFERENCE
ABSTRACT
ABSTRACT
Statistics reveal that every minute a human is losing his/her life
across the globe. More close in India , everyday many lives are affected
by heart attacks and more importantly because the patients did not get
timely and proper help . There are many emergency response services
striving hard to save the lives of people during emergencies, though they
are successful at few times. But sometimes they fail to race against time
to reach the victim. All over the globe, emergency response service is
the need of the hour. India has the highest incidence of heart related
diseases in the world and the number of those affected is likely to double
in the coming years. In the future what if due to lack of urgent service
we are not able to save the patient. So the problem is that the patient
needs to be “monitored constantly”. Due to which we would be able
attend the patient immediately. Therefore by developing a system that
can constantly measure the important parameters of patient’s body and
which can alert the closed ones and the doctor on any time when the
patient’s condition gets bad when he is not along with them.
LIST OF FIGURE
FIGURE. NO TITLE PAGE NO

FIGURE1.1 GSM NETWORK 4

FIGURE 1.2 UART TRANSMITTERS 5

FIGURE 3.1 CONSTANT MONITORING SYSTEM 10

FIGURE4.1 BLOCK DIAGRAM OF TRANSMITTER 11

FIGURE4.2 RECEIVER BLOCK DIAGRAM 12

FIGURE 4.3 POWER SUPPLY 13

FIGURE 4.4 VOLTAGE REGULATOR 7805 14

FIGURE4.5 PIN DIAGRAM-MICRO CONTROLLER

FIGURE4.6 OSCILLATOR CONECTIONS 20

FIGURE4.7 IDLE MODE FOR EXTERNAL CLOCK 21

FIGURE4.8 TIMER IN CAPTURE MODE 29

FIGURE4.8 BLOCK DIAGRAM OF ADC 34

FIGURE4.10 FUNCTIONAL DIAGRAM OF ADC 35


LIST OF TABLE
CHAPTER. NO TITLE PAGE.NO

TABLE4.3.1 MICRO CONTROLLER FOR PORT 3 18

FUNCTIONS

TABLE4.8.1 PROGRAM MEMORY LOCK BITS 22

TABLE4.11.1 PIN DETAILS FOR HEART BEAT 32

SENSOR
LIST OF SYMBOLS

SYMBOLS DESCRIPTION

BPM - BIT PER MINUTE

mA - Milli Amperes
LIST OF ABBREVATION
GSM - GLOBAL SYSTEM FOR MOBILING

ECG - ELECTRO CARDIO GRAM

UART - UNIVERSAL ASYNCHRONOUES RECEIVER AND

TRANSMITTER
CHAPTER-1
INTRODUCTION
CHAPTER-1

INTRODUCTION

1.1 NEED FOR PATIENT MONITORING SYSTEM

Now a day’s many people are looking forward to have a healthy life. These
days due to pollutions and highly competitive aspects in field of living, number of
people falling pray for heart related diseases are seen often arises due to increase of
stress level. These days maintaining a healthy life is tough. It is vital to keep track
on body by regular check-up. Patient monitoring refers to the continuous
observation of repeating events of physiologic function to guide therapy or to
monitor the effectiveness of interventions and is used primarily in the intensive
care unit and operating room.
At least in India there is no system which continuously monitors the patient
when patient is on move and this motivated us to work in this area. At present,
heart disease is one of serious diseases that may threaten human life. The
electrocardiogram (ECG) is important role in the prevention, diagnosis the
abnormality of patients and rescue of heart disease.

1.2 ELECTROCARDIOGRAM

In progress has been made in the development of a remote monitoring


system for ECG signals, the deployment of packet data services over
telecommunication network with new applications. The tele-transmitting and
receiving of ECG signal is the key-problem to realize the diagnosis and monitoring
of ECG signals. In approach, the fast and effective compression scheme, designed
for the telemonitoring system, the mobile phone based intelligent telemonitoring
platform Supports background bio signal abnormality surveillances using data
mining agent. A dynamic ECG system with tele transmitting and receiving
function it consists of the ECG recorder carried by patients. The ECG receiver
used in hospital and the PC computer used to analyze ECG signals it is possible for
hospital to offer the service of heart health with long distance.
The proposed system automatically alerts physician service provider with
ECG intelligent analysis, when physician assistance is crucial for the user, can
detect some anomalies and send alarms to a control center and a physician. A
wireless portable is small hardware and supports the unique needs of low-cost,
low-power wireless sensor networks, send and receive connective ECG signal to
database server. A description of a full-custom design with a similar functionality
than the application described in this paper can be found.
In view of the ever-growing age median among travelers, a health
monitoring application is becoming more of a necessity in large capacity aircraft
environments, providing safety to passengers with actual or chronic risks, and
reducing risk and cost for long-range aircraft operations. Considering the
technological advancements in embedded sensor devices a portable medical
monitoring enclosure has been developed to provide with the flexibility of low-cost
and high accuracy measurement equipment in avionic environments. Several types
of health monitoring sensor modules can be integrated in a compact portable
enclosure such as Electrocardiogram, pulse rate, blood pressure, oximetry,
temperature. In addition, a control board was designed and implemented with the
purpose of interfacing and processing the data arriving from the sensor modules,
and their transfer to a standard RS232 interface.
The board was designed for low power operation at the minimum output
data rate. To this end, maximum measurement time and also low sampling rate
regarding the continuous health monitoring measurements (ECG, Oximetry) were
considered. A two layered (Master-Slave) microcontroller architecture was
configured to process the sensor output frame and embed relevant information,
such as seat number, in order to make storage and data retrieval possible over a
large network. A graphic display was also integrated with the aim of projecting
passenger health state and triggering alarms when necessary. The medical box is
connected to a wireless optical data network inside the aircraft cabin providing
maximum flexibility. Although the primary purpose of the system realized was the
alerting of trained onboard staff about a broad spectrum of possible health failures,
remote health monitoring at ground presents itself as a possibility under the
network infrastructure already in place.
1.3 ZIGBEE

ZigBee is an emerging wireless network which possesses the traits of short


distance, low speed, low power, less complexity and the function of
geo- Location. ZigBee is adequate for the establishment of medical surveillance
network in LAN which can link with existing PLMN, WEB and other
communication network, interconnecting LAN of ZigBee as an entirety to
overcome the defect of existing medical surveillance network. This system is
convenient and efficient in nature and has no influence on patients' daily life, so it
increases interaction between patient and doctor which made surveillance has real
instantaneity and it ultimately prevents heart disease and avoids unexpected
tragedy practically. The patients wear low-cost sensor node, when they move in
the coverage area of network, sensor nodes will collect their patient data timely
and sent the data to router node of ZigBee. Router nodes join up Internet, satellite
and other network by way of sink node of ZigBee inside the network and transfer
Patient data to management center of hospital. Doctor can check patients' ECG
message via management center at all times, and make diagnosis analysis to
patients' condition.
1.4 GSM

Global system for mobile Communication (GSM) is a globally accepted


standard for digital cellular communication. GSM is the name of a standardization
group established in 1982 to create a common European mobile telephone standard
that would formulate specifications for a pan-European mobile cellular radio
system operating at 900 MHz it is estimated that many countries outside of Europe
will join the GSM partnership.

Fig 1.1 GSM Network


GSM provides recommendations, not requirements. The GSM specifications
define the functions and interface requirements in detail but do not address the
hardware. The reason for this is to limit the designers as little as possible but still to
make it possible for the operators to buy equipment from different suppliers. The
GSM network is divided into three major systems: the switching system (SS), the
base station system (BSS), and the operation and support system (OSS).
1.5 UART

A universal asynchronous receiver/transmitter is a type of "asynchronous


receiver/transmitter", a piece of computer hardware that translates data between
parallel and serial forms. UARTs are commonly used in conjunction with other
communication standards such as EIA RS-232.
A UART is usually an individual (or part of an) integrated circuit used for
serial communications over a computer or peripheral device serial port. UARTs are
now commonly included in microcontrollers. A dual UART or DUART combines
two UARTs into a single chip. Many modern ICs now come with a UART that can
also communicate synchronously these devices are called USARTs.

The universal Asynchronous Receiver/Transmitter (UART) controller is the


key component of the serial communications subsystem of a computer. The UART
takes bytes of data and transmits the individual bits in a sequential fashion. At the
destination, a second UART re-assembles the bits into complete bytes. Serial
transmission of digital information (bits) through a single wire or other medium is
much more cost effective than parallel transmission through multiple wires. A
UART is used to convert the transmitted information between its sequential and
parallel form at each end of the link.

Send
To Busy UART D out
Host system
Din7 TRANSMITTER

Parity Select To Serial cable

Fig 1.2 UART Transmitters


CHAPTER-2
LITRATURE REVIEW
CHAPTER 2

LITERATURE REVIEW

Recently, the home healthcare has been entering a new stage in the digital
age. Previous care delivery models included paid nurse visits, traditional phone-
based tele health applications, and assisted living/nursing homecare, each with its
own problems. But technological advances are making over the healthcare
industry. Networking technologies and expanded capabilities in telecom
infrastructure support faster, more reliable, and more connected care delivery to the
home. The internet opens a new and more efficient communication channel
between patients and clinicians. Digital technology has produced new medical
devices such as networked glucose readers, digital thermometers, and stethoscopes,
as well as innovative applications such as motion sensors and video-conferencing
tools. Many tele health systems have been proposed for diabetes management.
Examples include the IDEA-Tel (Informatics for Diabetes Education and Tele
health) project, which was established as a disease management program in rural
and urban underserved areas. Patients received a home telehealth unit (Palmtop
computer) facilitating blood glucose downloading and video conferencing.
Likewise, the DIACRONO system combined a portable device (palmtop
computer) for home monitoring, with data collection through PC based software
located in the clinic. More recently, the M2DM (European Multi-Access Services
for Managing Diabetes) project goal is to develop 24-hour telehealth support via
multi-access services (MAS). The concept is to collect data on central database
server which can be accessed through internet, telephone or dedicated software for
downloading data directly.
At the core of digital home health care telehealth applications offered by
companies that have pioneered in this area, Med, AMD telemedicine, and
American Tele care, and emerging players such as Health Hero, Cardiocom, and
Viterion Healthcare. These vendors provide both hardware and software for
consumers and clinicians. Consumers usually receive a medical device kit that
includes a hub-like appliance and peripheral devices. These peripherals can be
connected to the hub appliance through a USB port. Vital signs readings are
transmitted either through a normal phone line or a broadband connection to
vendor's server.

The vendor re-routes the data to caregiver's desktop. Other telephony


solutions have been proposed including GLUCONET, which permits diabetes
patients to send blood glucose monitoring data to physician via text messages on
their cell phones. France Telecom uses the Orange GSM cellular network to send
glucose data to a secure server containing patient files. Black in his article Talking
Telemedicine, points out a limitation in using Telemedicine for sending Glucose
data using GSM network by quoting" However, there seems to be a lack of
pervasive, inexpensive and user-friendly technologies in medical practice that
extend to the majority of diabetes population and serve as a platform to enable
better care delivery". In a citizen-centred health system, it is very important to
have simultaneous access to different kind of health related data such as patient's
health record and accounting data. Also, remote monitoring of personal health
status, through vital signs and video/audio signals, with communication link to the
health provider and interoperability with existing patient data could significantly
improve disease prevention, diagnosis, treatment and rehabilitation. Lymberis has
pointed out in a recent article the following listed challenges that have to be
addressed in a future telehealth home system:
 Data storage: A backup data solution is usually necessary. The length of
recording and the type of data to record depend on the medical protocol.
 Telecommunication: Link between sensors and link between smart
wearable and health provider (e.g. mobile phone), like sending ECG
(Electrocardiogram) data through SMS. Short and long range wireless and
mobile communications are involved, e.g. Bluetooth, GPRS and UMTS.
 Embedded medical decision: Special medical algorithms should be
developed to integrate and analyze medical data arriving from different
sensors. No such algorithms are in clinical use today at homecare or
ambulatory devices. Medical decision algorithm is a great challenge to
allow medical staff to provide timely and most appropriate medical
intervention.
 Telehealth service: The data collected from wearable could be used for
research purpose. The on-line health centre has to develop secure
telemonitoring facilities that enable health providers and patients to
communicate over telecommunication networks without compromising
privacy and confidentiality.
There is no doubt that in the context of wearable medical devices, the pulse
oximetry represents the greatest advance in wearable patient monitoring in many
years, especially for elderly care. It has the unique advantage of continuously
monitoring the saturation of haemoglobin with oxygen, easily and no invasively,
providing a measure of cardio-respiratory function and extracting breathing rate.
By virtue of its ability to quickly detect hypoxemia, it has become the standard of
care during anaesthesia as well as in the recovery room and intensive care unit.
Pulse oximetry should be used to monitor any patient who is heavily sedated or is
likely to become hypoxic. A number of researchers have focused on the pulse
oximetry utilizing data acquisition tools like Lab VIEW, to analyze, calculate and
display vital signs data like the heart rate, blood oxygen saturation, and other
parameters for home use. Other researchers used the LabVIEW environment to
analyze and calculate offline, the heart rate variability for clinical research. Some
other researchers have come up with wireless monitoring pulse oximetry systems,
which transmit data using WLAN and GPRS. Others have come with wireless
context aware ECG and accelerometer system to support healthcare delivery for
elderly and chronically ill. Intelligent agent models have been also developed to
support telemedicine for elderly at home.
CHAPTER-3
EXISTING SYSTEM
CHAPTER-3

EXISTING SYSTEM

Currently the system used for patient monitoring is the fixed


monitoring system which can be used only when the patient is on bed. The
available systems are huge in size and only available in the hospitals in ICU. Heart
disease has become common disease in today’s world and still remains as a threat
to human health. Measuring of the bio signals from patients is a very important
factor when it comes to diagnosis of heart disease.ECG is preferred due to its
precision, convenience, and low cost even-though there are various ways of
diagnosing the condition of the heart, such as (Electrocardiograph (ECG),
Magnetic Resonance Imaging (MRI)).
Drawbacks
In existing system patient need to hospitalize shown in fig.3.1 regular
monitoring of patient is not possible once he/she is discharged from hospitals.
These systems cannot be used at individual level.

Fig 3.1 Constant Monitoring System


CHAPTER-4
PROPOSED SYSTEM
CHAPTER-4

PROPOSED SYSTEM

4.1 INTRODUCTION

The system which we propose to develop would not only help in


monitoring the patient when he is in the bed but also when he is out of his bed.
When he is mobile, such a system would constantly monitor important body
parameters like temperature, heartbeat and would compare it against a
predetermined value set and if these values cross a particular limit it would
automatically alert the doctor and relatives of the patient via a SMS. In such case
the patient will get a very quick medical help and also would save time and energy
of the relatives who neither would have to be with them all the time.

4.2 BLOCK DIAGRAM


Power supply

Mobile
UART
Temperature
sensor and
8051
heart beat XBEE
Microcontroller
sensor ADC TXR

ADC
Fig 4.1 Transmitter
 In this paper, we are going to implement ECG Monitoring using Android
application. This proposed ECG system has the advantage of interfacing the
ECG signals not only with a PC but also on Mobile Phone through
Bluetooth connectivity.

Power supply

XBEE 8051 RS 232


RXR UART
Microcontroller

PC
ADC
Fig 4.2 Receiver

4.2.1 Hardware requirements

 MICROCONTROLLER 8051
 ECG SENSOR
 TEMP SENSOR
 ADC
 POWER SUPPLY
 BLUETOOTH
 GSM MODEM
 UART
 PC
4.2.2 Software requirements

 EMBEDDED C
 KEIL MICROVISON
4.2.3 Components Description

Power Supply:

Power supply is a reference to a source of electrical power. A device or system


that supplies electrical or other types of energy to an output load or group of loads
is called a power supply unit or PSU. The term is most commonly applied to
electrical energy supplies, less often to mechanical ones, and rarely to others. A
230v, 50Hz Single phase AC power supply is given to a step down transformer to
get 12v supply. This voltage is converted to DC voltage using a Bridge Rectifier.
The converted pulsating DC voltage is filtered by a 2200uf capacitor and then
given to 7805 voltage regulator to obtain constant 5v supply. This 5v supply is
given to all the components in the circuit. A RC time constant circuit is added to
discharge all the capacitors quickly. To ensure the power supply a LED is
connected for indication purpose.

Fig 4.3 Block Diagram of Power Supply


Voltage Regulator:

Fig 4.4 Voltage Regulator

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.

Microcontroller:

A microcontroller is a small computer on a single integrated circuit


consisting of a relatively simple CPU combined with support functions such as a
crystal oscillator, timers, serial and analog I/O etc. Microcontrollers are designed
for small or dedicated applications.

Features

 Compatible with MCS-51Ô Products


 Three-Level Program Memory Lock
 128 x 8-Bit Internal RAM
 32 Programmable I/O Lines
 Two 16-Bit Timer/Counters
 Six Interrupt Sources
 Fully Static Operation: 0 Hz to 24 MHz
4.3. PIN DIAGRAM:

Fig 4.5 Pin diagram


Description:

The AT89C51 is a low-power, high-performance CMOS 8-bit


microcomputer with 4Kbytes of Flash Programmable and Erasable Read Only
Memory (PEROM). The device is manufactured using Atmel’s high density
nonvolatile memory technology and is compatible with the industry standard
MCS-51Ô 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 AT89C51 is a powerful microcomputer which provides a highly flexible
and cost effective solution to many embedded control applications.
Port 0

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be
used as high-impedance inputs. Port 0 can also be configured to be the multiplexed
low-order address/data bus during accesses to external program and data memory.
In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during
Flash programming and outputs the code bytes during program verification.
External pull-ups are required during program verification.

Port 1

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

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 2 pins that are externally being pulled low will source current (IIL) because of
the internal pull-ups. Port 2 emits the high-order address byte during fetches from
external program memory and during accesses to external data memory that uses
16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal
pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit
addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification. Port Pin Alternate Functions P1.0 T2
(external count input to Timer/Counter 2), clock-out P1.1 T2EX (Timer/Counter 2
capture/reload trigger and direction control) P1.5 MOSI (used for In-System
Programming) P1.6 MISO (used for In-System Programming) P1.7 SCK (used for
In-System Programming).

Port 3

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins,
they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 3 pins that are externally being pulled low will source current (IIL) because of
the pull-ups. Port 3 receives some control signals for Flash programming and
verification. Port 3 also serves the functions of various special features of the
AT89C51, as shown in the following table.
PORT PIN ALTERNATE FUNCTION
Port 3.0 RXD Serial input port
Port 3.1 TXD serial output port
Port 3.2 External interrupt 0
Port 3.3 External interrupt 1
Port 3.4 Timer 0 external input
Port 3.5 Timer 1 external input
Port 3.6 External data memory write
strobe
Port 3.7 External data memory read
strobe

Table 4.3.1 Micro controller port3 functions

RST

Reset input. A high on this pin for two machine cycles while the oscillator
is running resets the device.

ALE/PROG

Address Latch Enable (ALE) is an output pulse for latching the low byte of
the address during accesses to external memory. This pin is also the program pulse
input (PROG) during Flash programming. In normal operation, ALE is emitted at a
constant rate of 1/6 the oscillator frequency and may be used for external timing or
clocking purposes. Note, however, that one ALE pulse is skipped during each
access to external data memory. If desired, ALE operation can be disabled by
setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a
MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the
ALE-disable bit has no effect if the microcontroller is in external execution mode.
PSEN

Program Store Enable (PSEN) is the read strobe to external program


memory. When the AT89C51 is executing code from external program memory,
PSEN is activated twice each machine cycle, except that two PSEN activations are
skipped during each access to external data memory.

EA/VPP

External Access Enable EA must be strapped to GND in order to enable the


device to fetch code from external program memory locations starting at 0000H up
to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset. EA should be strapped to VCC for internal program executions.
This pin also receives the 12 volt programming enable voltage (VPP) during Flash
programming.

XTAL1 & XTAL2.

These are oscillator pins. The oscillator used for 8051 is 12 MHz to 16 MHz

4.4. MEMORY ORGANIZATION

MCS-51 devices have a separate address space for Program and Data
Memory. Up to 64K bytes each of external Program and Data Memory can be
addressed.
4.4.1. Program Memory

If the EA pin is connected to GND, all program fetches are directed to external
memory. On the AT89C51, if EA is connected to VCC, program fetches to
addresses 0000H through 1FFFH are directed to internal memory and fetches to
addresses 2000H through FFFFH are to external memory.
4.4.2. Data Memory

The AT89C51 implements 256 bytes of on-chip RAM. The upper 128 bytes
occupy a parallel address space to the Special Function Registers. This means that
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 which use
direct addressing access the SFR space. For example, the following direct
addressing instruction accesses the SFR at location 0A0H (which is P2).

4.5. 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. Either 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 . 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.

4.5.1. Oscillator Connections:

Fig 4.6 oscillator connections


4.6. IDLE MODE

In idle mode, the CPU puts itself to sleep while all the on chip peripherals
remain active. The mode is invoked by software. The content of the on-chip RAM
and the entire special functions registers remain unchanged during this mode. The
idle mode can be terminated by any enabled interrupt or by a hardware reset. It
should be noted that when idle is terminated by a hard ware reset, the device
normally resumes program execution, from where it left off, up to two machine
cycles before the internal reset algorithm takes control. On-chip hardware inhibits
access to internal RAM in this event, but access to the port pins is not inhibited. To
eliminate the possibility of an unexpected write to a port pin when Idle is
terminated by reset, the instruction following the one that invokes Idle should not
be one that writes to a port pin or to external memory.

4.6.1. External Clock Drive Configuration

Fig 4.7 Idle mode for external clock


4.7. POWER-DOWN MODE:

In the power-down mode, the oscillator is stopped, and the instruction that
invokes power-down is the last instruction executed. The on-chip RAM and
Special Function Registers retain their values until the power-down mode is
terminated. The only exit from power-down is a hardware reset. Reset redefines
the SFRs but does not change the on-chip RAM. The reset should not be activated
before VCC is restored to its normal operating level and must be held active long
enough to allow the oscillator to restart and stabilize.

4.8. PROGRAM MEMORY LOCK BITS:

On the chip are three lock bits which can be left unprogrammed (U) or can
be programmed (P) to obtain the additional features listed in the table below. When
lock bit 1 is programmed, the logic level at the EA pin is sampled and latched
during reset. If the device is powered up without a reset, the latch initializes to a
random value, and holds that value until reset is activated.

Table 4.8.1 Program Memory Lock Bits


4.9. PROGRAMMING THE FLASH:

The AT89C51 is normally shipped with the on-chip Flash memory array in
the erased state (that is, contents = FFH) and ready to be programmed. The
programming interface accepts either a high-voltage (12-volt) or a low-voltage
(VCC) program enable signal. The low voltage programming mode provides a
convenient way to program the AT89C51 inside the user’s system, while the high-
voltage programming mode is compatible with conventional third party Flash or
EPROM programmers. The AT89C51 is shipped with either the high-voltage or
low-voltage programming mode enabled. The respective top-side marking and
device signature codes are listed in the following table.

The AT89C51 code memory array is programmed byte-by byte in either


programming mode. To program any nonblank byte in the on-chip Flash Memory,
the entire memory must be erased using the Chip Erase Mode.
Programming Algorithm:

Before programming the AT89C51, the address, data and control signals
should be set up according to the Flash programming mode table. To program the
AT89C51, take the following steps.

 Input the desired memory location on the address lines.


 Input the appropriate data byte on the data lines.
 Activate the correct combination of control signals.
 Raise EA/VPP to 12V for the high-voltage programming mode.
 Pulse ALE/PROG once to program a byte in the Flash array or the
lock bits. The byte-write cycle is self-timed and typically takes no
more than 1.5ms. Repeat steps 1 through 5, changing the address and
data for the entire array or until the end of the object file is reached.
Data Polling:

The AT89C51 features Data Polling to indicate the end of a write cycle.
During a write cycle, an attempted read of the last byte written will result in the
complement of the written datum on PO.7. Once the write cycle has been
completed, true data are valid on all outputs, and the next cycle may begin. Data
Polling may begin any time after a write cycle has been initiated.

Ready/Busy:

The progress of byte programming can also be monitored by the RDY/BSY


output signal. P3.4 is pulled low after ALE goes high during programming to
indicate BUSY. P3.4 is pulled high again when programming is done to indicate
READY.
Program Verifies:

If lock bits LB1 and LB2 have not been programmed, the programmed code
data can be read back via the address and data lines for verification. The lock bits
cannot be verified directly. Verification of the lock bits is achieved by observing
that their features are enabled.

Chip Erase:

The entire Flash array is erased electrically by using the proper combination
of control signals and by holding ALE/PROG low for 10ms. The code array is
written with all “1”s. The chip erase operation must be executed before the code
memory can be re-programmed.

Reading the Signature Bytes:

The signature bytes are read by the same procedure as a normal verification
of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a
logic low. The values returned are as follows.

(030H) = 1EH indicates manufactured by Atmel

(031H) = 51H indicates 89C51

(032H) = FFH indicates 12V programming

(032H) = 05H indicates 5V programming

Programming Interface:

Every code byte in the Flash array can be written and the entire array can be
erased by using the appropriate combination of control signals. The write operation
cycle is self timed and once initiated, will automatically time itself to completion.
All major programming vendors offer worldwide support for the Atmel
microcontroller series.

Special Function Registers

A map of the on-chip memory area called the Special Function Register
(SFR). 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.

Timer 2 Registers:

Control and status bits are contained in registers T2CON and T2MOD for Timer 2.
The register pair (RCAP2H, RCAP2L) is the Capture/Reload registers for Timer 2
in 16-bit capture mode or 16-bit auto-reload mode.

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.

Data Memory:

The AT89C51 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 128bytes 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.

Timer 0 And 1:

Timer 0 and Timer 1 in the AT89C52 operate the same way as Timer 0 and
Timer 1 in the AT89C51.

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.

Capture Mode:

In the capture mode, two options are selected by bit EXEN2 in T2CON. If
EXEN2 = 0, Timer 2 is a 16-bit timer or counter which upon overflow sets bit TF2
in T2CON. This bit can then be used to generate an interrupt. If EXEN2 = 1, Timer
2 performs the same operation, but a 1-to-0 transition at external input T2EX also
causes the current value in TH2 and TL2 to be captured into RCAP2H and
RCAP2L, respectively. In addition, the transition at T2EX causes bit EXF2 in
T2CON to be set. The EXF2 bit, like TF2, can generate an interrupt.

Auto-Reload (Up or Down Counter):

Timer 2 can be programmed to count up or down when configured in its 16-


bit auto-reload mode. This feature is invoked by the DCEN (Down Counter
Enable) bit located in the SFR T2MOD (see Table 4). Upon reset, the DCEN bit is
set to 0 so that timer 2 will default to count up. When DCEN is set, Timer 2 can
count up or down, depending on the value of the T2EX pin.
Time in Capture Mode:

Timer 2 automatically counting up when DCEN = 0. In this mode, two options are
selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 counts up to 0FFFFH
and then sets the TF2 bit upon overflow. The overflow also causes the timer
registers to be reloaded with the 16-bit value in RCAP2H and RCAP2L. The

values in Timer in Capture ModeRCAP2H and RCAP2L are preset by software.

Fig 4.8 Timer in capture mode

If EXEN2 = 1, a 16-bit reload can be triggered either by an overflow or by a


1-to-0 transition at external input T2EX. This transition also sets the EXF2 bit.
Both the TF2 and EXF2 bits can generate an interrupt if enabled. Setting the
DCEN bit enables Timer 2 to count up or down, as shown in Figure 3. In this
mode, the T2EX pin controls the direction of the count. Logic 1 at T2EX makes
Timer 2 count up. The timer will overflow at 0FFFFH and set the TF2 bit. This
overflow also causes the 16-bit value in RCAP2H and RCAP2L to be reloaded into
the timer registers, TH2 and TL2, respectively. Logic 0 at T2EX makes Timer 2
count down. The timer underflows when TH2 and TL2 equal the values stored in
RCAP2H and RCAP2L. The underflow sets the TF2 bit and causes 0FFFFH to be
reloaded into the timer registers. The EXF2 bit toggles whenever Timer 2
overflows or underflows and can be used as a 17th bit of resolution. In this
operating mode, EXF2 does not flag an interrupt.

Programmable Clock Out

A 50% duty cycle clock can be programmed to come out on P1.0, as


shown in Figure 5. This pin, besides being a regular I/O pin, has two alternate
functions. It can be programmed to input the external clock for Timer/Counter 2 or
to output a 50% duty cycle clock ranging from 61 Hz to 4MHz at a 16 MHz
operating frequency. To configure the Timer/Counter 2 as a clock generator, bit
C/T2 (T2CON.1) must be cleared and bit T2OE (T2MOD.1) must be set. Bit TR2
(T2CON.2) starts and stops the timer.

The clock-out frequency depends on the oscillator frequency and the reload value
of Timer 2 capture registers (RCAP2H, RCAP2L), as shown in the following
equation

In the clock-out mode, Timer 2 roll-overs will not generate an interrupt. This
behavior is similar to when Timer 2 is used as a baud-rate generator. It is possible
to use Timer 2 s a baud-rate generator and a clock generator simultaneously. Note,
however, that the baud-rate and clock-out frequencies cannot be determined
independently from one another since they both use RCAP2H and RCAP2L
4.10 TEMPERATURE SENSOR:

The LM35 series are precision integrated-circuit temperature Sensors, whose


output voltage is linearly proportional to the Celsius (Centigrade) temperature. The
LM35 thus has an Advantage over linear temperature sensors calibrated in °
Kelvin, as the user is not required to subtract a large Constant voltage from its
output is to obtain convenient from Centigrade Scaling.

Features

 Calibrated directly in ° Celsius (Centigrade)


 Linear + 10.0 mV/°C scale factor
 0.5°C accuracy guaranteable (at +25°C)
 Rated for full −55° to +150°C range
 Suitable for remote applications
 Low cost due to wafer-level trimming
 Operates from 4 to 30 volts
 Less than 60 μA current drain
 Low self-heating, 0.08°C in still air
 Nonlinearity only ±1⁄4°C typical
 Low impedance output, 0.1 W for 1 mA load
4.11. HEART BEAT SENSOR

Heart beat sensor is designed to give digital output of heat beat when a
finger is placed on it. When the heart beat detector is working, the beat LED
flashes in unison with each heart beat. This digital output can be connected to
microcontroller directly to measure the Beats Per Minute (BPM) rate. It works
on the principle of light modulation by blood flow through finger at each pulse.
Features
 Heat beat indication by LED
 Instant output digital signal for directly connecting to
microcontroller
 Compact Size
 Working Voltage +5V DC.

Pin Name Details


1 +5v Power supply positive input
2 OUT Active high output
3 GND Power supply ground

Table 4.11.1 Pin Details for Heart Beat Sensor

Connect regulated DC power supply of 5 Volts. Black wire is Ground, Next


middle wire is Brown which is output and Red wire is positive supply. These wires
are also marked on PCB. To test sensor you only need power the sensor by connect
two wires +5V and GND. You can leave the output wire as it is. When Beat LED
is off the output is at 0V.

Put finger on the marked position, and you can view the beat LED blinking
on each heart beat. The output is active high for each beat and can be given directly
to microcontroller for interfacing applications.
4.12 ADC:

ADC unit is used to convert the physical values from our sensors into digital
values. It has 8 channels so that, we can connect 8 sensors at the time. But in PIC
controller we have inbuilt ADC .If we are using AT8051 controller we have to
interface it externally.

General Description

The ADC0808, ADC0809 data acquisition component is a monolithic


CMOS device with an 8-bit analog-to-digital converter, 8-channel multiplexer and
microprocessor compatible control logic. The 8-bit A/D converter uses successive
approximation as the conversion technique. The converter features a high
impedance chopper stabilized comparator, a 256R voltage divider with analog
switch tree and a successive approximation register. The 8-channel multiplexer can
directly access any of 8-single-ended analog signals. The device eliminates the
need for external zero and full-scale adjustments. Easy interfacing to
microprocessors is provided by the latched and decoded multiplexer address inputs
and latched TTL TRI-STATE outputs. The design of the ADC0808, ADC0809 has
been optimized by incorporating the most desirable aspects of several A/D
conversion techniques. The ADC0808, ADC0809 offers high speed, high accuracy,
minimal temperature dependence, excellent long-term accuracy and repeatability,
and consumes minimal power. These features make this device ideally suited to
applications from process and machine control to consumer and automotive
applications. For 16-channel multiplexer with common output (sample/hold port)
see ADC0816 data sheet. (See AN-247 for more information.)
Features

 Easy interface to all microprocessors


 Operates ratio metrically or with 5 VDC or analog span
 Adjusted voltage reference
 No zero or full-scale adjust required
 8-channel multiplexer with address logic
 0V to 5V input range with single 5V power supply
 Outputs meet TTL voltage level specifications
 Standard hermetic or molded 28-pin DIP package
 28-pin molded chip carrier package
4.13 BLOCK DIAGRAM:

Fig 4.9 Block diagram of ADC


Functional description:

Fig 4.10 Functional description of ADC

4.14. LCD DISPLAY:

A liquid crystal display (LCD) is a thin, flat panel used for electronically
displaying information such as text, images, and moving pictures. Its uses include
monitors for computers, televisions, instrument panels, and other devices ranging
from aircraft cockpit displays, to every-day consumer devices such as video
players, gaming devices, clocks, watches, calculators, and telephones. Among its
major features are its lightweight construction, its portability, and its ability to be
produced in much larger screen sizes than are practical for the construction of
cathode ray tube (CRT) display technology. Its low electrical power consumption
enables it to be used in battery-powered electronic equipment.
We have to prepare an LCD properly before the character we need, has to be
displayed. For this a number of commands have to be provided to the LCD before
inputting the required data. The commands will be discussed in the later part of this
tutorial

LCD doesn’t know about the content (data or commands) supplied to its data bus.
It is the user who has to specify whether the content at its data pins are data or
commands. For this, if a command is inputted then a particular combination of 0s
and 1s has to be applied to the Control lines so as to specify it is a Command on
the other hand if a data is inputted at the data lines then an another combination of
0s and 1s has to be applied to the control lines to specify it is Data.

4.15. SOFTWARE:
Embedded C

 As it is the high level language it is shorter and easier to write. It is


independent of the Processor. It is used more frequently than assembly
language.

 C language has two important advantages, because of which it is much


easier for programmer to write quality programs that are easier to read,
revise, and port to a different system. Built-in structure. Checking and
Abstraction

KEIL CROSS SOFTWARE:

 TEXT EDITOR

o Used for typing the embedded c programs.

 SIMULATOR.

o Used for debugging.


 COMPILER.

o used for converting high-level language into machine level


language(hex code)

 ANSI C Compiler
 Generates fast compact code for the 8051 and it’s derivative

Advantages of C over Assembler

 Do not need to know the microcontroller instruction set.


 Register allocation and addressing modes are handled by the compiler.
 Programming time is reduced.
 Code may be ported easily to other microcontrollers
Advantages

 low power consumption

 signal display

 portable

 low cost
CHAPTER-5
EXPERIMENTAL RESULT
CHAPTER-5

EXPERIMENTAL RESULT

Fig 5.1 Temperature and heart beat

From this above figure the temperature and heart beat directly measured
from the human body and both parameter values displayed on LCD on the
transmitter side. This data is transmitted to the receiver wirelessly through ZigBee.
The received signal compared with normal heartbeat and body temperature signals
based on normal range in the receiver side. If an abnormality is detected, the SMS
is send to the doctor.
CONCLUSION
CHAPTER-6

CONCLUSION

Thus the microcontroller based wireless Heartbeat and body temperature


monitoring system is designed and implemented, in which both the signals directly
measured from the human body and both the parameter values displayed on LCD
on the transmitter side. The received signal compared with normal heartbeat and
body temperature signals based on normal range in the receiver side. If an
abnormality is detected, the SMS is send to the doctor.

FUTURE ENHANCEMENT
We are working towards an implementation of the same against ECG Blood
pressure measurement and Nearest hospital will be informed automatically with
the help of GPS and ambulance will sent to the patient as future work.
APPENDIX
APPENDIX

A.1 CODING

Dim b As String
Dim val1 As Integer
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal
lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Dim returnval As Long
Dim soundfile As String
Private Sub Command2_Click()
b = "E"
End Sub
Private Sub Command3_Click()
b = "D"
End Sub
Private Sub Command4_Click()
b = "D"
End Sub
Private Sub Command5_Click()
'MSComm1.Output = "AT+IFC=0,0" + vbCrLf '+ Asc(10) + Asc(13)
'For i = 0 To 10000000
'Next i
'MSComm1.Output = "AT" + vbCrLf '+ Asc(10) + Asc(13)
'For i = 0 To 10000000
'Next i
'MSComm1.Output = "AT+CMGF=1" + vbCrLf
'For i = 0 To 10000000
'Next i
'MSComm1.Output = "AT+CMGS=" + Chr(34) + "+919790381184" + Chr(34) +
vbCrLf
'For i = 0 To 10000000
'Next i
'MSComm1.Output = "ALERT" + vbCrLf + Chr(26)
'For i = 0 To 10000000
'Next i
End Sub
Private Sub Form Load ()
'MSComm2.PortOpen = True
MSComm1.PortOpen = True
b = "D"
End Sub
Private Sub Form Unload (Cancel As Integer)
'MSComm2.PortOpen = False
MSComm1.PortOpen = False
End Sub
Private Sub Timer1_Timer ()
Dim a As String
a = MSComm1.Input
Text8.Text = a
For i = 1 To 24
If Mid$(a, i, 1) = "T" Then
Text1.Text = Str((Val(Mid$(a, i + 1, 3))))
End If
If Mid$(a, i, 1) = "P" Then
Text11.Text = Str(Val(Mid$(a, i + 1, 3)))
End If
If Mid$(a, i, 1) = "H" Then
Text10.Text = Str(Val(Mid$(a, i + 1, 3)))
End If
Next i
If Val(Text2.Text) > 120 Then
Text11.Text = Text2.Text
End If
If (Val(Text2.Text) < 100) And (Val(Text2.Text) > 80) Then
Text12.Text = Text2.Text
End If
End Sub
Private Sub Timer2_Timer()
Text4.Text = Time
End Sub
Private Sub Timer3_Timer()
If Val(Text3.Text) < Val(Text1.Text) Then
MSComm1.Output = "AT" + vbCrLf '+ Asc(10) + Asc(13)
For i = 0 To 10000000
Next i
MSComm1.Output = "AT+CMGF=1" + vbCrLf
For i = 0 To 10000000
Next i
MSComm1.Output = "AT+CMGS=" + Chr(34) + "+919750676587" + Chr(34) +
vbCrLf
soundfile = App.Path + "\temp1.wav"
returnval = PlaySound(soundfile, 0, &H0)
For i = 0 To 10000000
Next i
MSComm1.Output = "Temperature ALERT" + Text1.Text + vbCrLf + Chr(26)
For i = 0 To 10000000
Next i
Text9.Text = Text9.Text + Str(Date) + " " + Str(Time) + " " + "Temperature
Alert"
End If
If Val(Text6.Text) < Val(Text11.Text) Then
MSComm1.Output = "AT" + vbCrLf '+ Asc(10) + Asc(13)
For i = 0 To 10000000
Next i
MSComm1.Output = "AT+CMGF=1" + vbCrLf
For i = 0 To 10000000
Next i
MSComm1.Output = "AT+CMGS=" + Chr(34) + "+919750676587" + Chr(34) +
vbCrLf
soundfile = App.Path + "\pres1.wav"
returnval = PlaySound(soundfile, 0, &H0)
For i = 0 To 10000000
Next i
MSComm1.Output = "Pressure ALERT" + Text2.Text + vbCrLf + Chr(26)
For i = 0 To 10000000
Next i
Text9.Text = Text9.Text + Str(Date) + " " + Str(Time) + " " + "Pressure Alert"
End If
If Val(Text10.Text) > Val(Text5.Text) Then
MSComm1.Output = "AT" + vbCrLf '+ Asc(10) + Asc(13)
For i = 0 To 10000000
Next i
MSComm1.Output = "AT+CMGF=1" + vbCrLf
For i = 0 To 10000000
Next i
MSComm1.Output = "AT+CMGS=" + Chr(34) + "+919750676587" + Chr(34) +
vbCrLf
soundfile = App.Path + "\hb.wav"
returnval = PlaySound(soundfile, 0, &H0)
For i = 0 To 10000000
Next i
MSComm1.Output = "Heart Beat ALERT" + Text10.Text + vbCrLf + Chr(26)
For i = 0 To 10000000
Next i
Text9.Text = Text9.Text + Str(Date) + " " + Str(Time) + " " + "Heart Beat Alert"
End If
End Sub
Private Sub Timer5_Timer()
Dim a As String
a = MSComm1.Input
val1 = val1 + 1
Text7.Text = Text7.Text + a
End Sub
REFERENCES

[1] Ovidiu Apostu, Bogdan Hagiu, Sever Paşca, “Wireless ECG Monitoring
And Alarm System Using ZigBee”2011 the International Symposium on
ADVANCED TOPIC INELECTRICAL ENGINEERING2068-
7966/ATEE 2011.
[2] Arun Kumar, Fazlur Rahman, ”Wireless Health Alert and Monitoring
System”, 81-904262-1-4/06/ c_ 2006 Research Publishing Services.
[3] Muhammad Ali Mazidi, Janice Gillispie Mazidi, 8051 Microcontroller and
Embedded Systems, Prentice-Hall, Page:183-193, 236, 243.

[4] Dogan Ibrahim, Microcontroller Projects in C for the 8051, Newness, Page:
29-161.

[5] Kenneth J. Ayala, The 8051 Microcontroller ARCHITECTURE,


PROGRAMMING and APPLICATIONS, WEST PUBLISHING
COMPANY, Page: 131-197.

[6] Ramakant A. Gayakwad, Op-Amps and Linear Integrated Circuits, 4th


Edition, Prentice-Hall, Page: 342, 417, 455.

[7] R.P.Jain, Digital Electronics, Tata McGraw-Hill www.electronic-circuits-


diagrams.com

Вам также может понравиться