You are on page 1of 53

SMART DOCTORS ANDROID

An Industry Oriented Mini Project Report On


SMART DOCTORS ANDROID
Submitted to

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

MAHAVEER INSTITUTE OF SCIENCE AND TECHNOLOGY


(Approved by AICTE & Affiliated to JNTUH)
In the partial fulfillment of the requirements for the award of Degree of
BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING
By

M.Chenya
Asst.Professsor
Guide

B.VISHNU TEJA

13E31A0408

B.PRANEETH KUMAR

13E31A0409

C.BHARATH

13E31A0410

CH.PRUDHVI RAJ

13E31A0411

CH.RAJESH KUMAR

13E31A0412

Dr.V.Gunashekar Reddy

Dr.B.Visvesvara Rao.

Professor

Professor & HOD

Co-ordinator

Head Of Dept.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


MAHAVEER INSTITUTE OF SCIENCE AND TECHNOLOGY
Vyasapuri, Bandlaguda, post: keshavagiri , Hyderabad -500005
2016-2017

SMART DOCTORS ANDROID

Vysapuri, Bandlaguda Post:Keshavgiri,


Hyderabad-500 005, TS, INDIA
Tel: 040-20020772,20020773,,Fax: 040-24455003
E-mail: e3hod.ece@gmail.com,
Website: www.mist.ac.in

CERTIFICATE
This is to certify that the project work entitled "SMART DOCTOR ANDROID " is
submitted by
B.VISHNU TEJA

13E31A0408

B.PRANEETH KUMAR

13E31A0409

C.BHARATH

13E31A0410

CH.PRUDHVI RAJ

13E31A0411

CH.RAJESH KUMAR

13E31A0412

in partial fulfillment of the requirements for the Degree of Bachelor of Technology in


Electronics and Communication Engineering of Mahaveer Institute Of Science and
Technology, Hyderabad, during the academic year 2016-17, is a bonafide record of work
carried out under our guidance and supervision.
The results embodied in this report have not been submitted to any other university or
Institution for the award of any degree or diploma.

M.chenya
Asst.Professsor

Guide

Dr.V.Gunashekar Reddy
Professor

Co-ordinator

Dr.B.Visvesvara Rao.
Professor & HOD

Head Of Dept.

SMART DOCTORS ANDROID

ACKNOWLEDGEMENT

It is indeed a great pleasure and immense satisfaction for us to express our deep sense of
gratitude, to our project Guide Mr.M.chenya, Asst. Professor in Electronics and Communication
Engineering department, for his guidance in the completion of the project.
Our sincere thanks to our Professor and project coordinator Dr.V.Gunashekar Reddy in the
department of Electronics and Communication Engineering, for his valuable suggestions
encouragement for the completion of the project.
We convey our sincere gratitude to Dr.B.Visvesvara Rao , Professor &

and

Head of the

department of Electronics and Communication Engineering for his encouragement in completion of


the project.
Its our privilege to express our sincere thanks to Dr.K.S.S.S.N.Reddy Principal, MIST for
extending support and for providing necessary infrastructure and for permitting us to do the project
work in our college
We also express our sincere thanks to the Management of Mahaveer Institute of Science and
Technology for their support in completing this project in the Institution.

B.VISHNU TEJA

13E31A0408

B.PRANEETH KUMAR

13E31A0409

C.BHARATH

13E31A0410

CH.PRUDHVI RAJ

13E31A0411

CH.RAJESH KUMAR

13E31A0412

SMART DOCTORS ANDROID

CONTENTS
Page-no
Abstract
List of figures
List of Tables
Abbreviations

CHAPTER1: INTRODUCTION
1.1 Introduction to the project.
1.2 Introduction to the embedded systems..
CHAPTER2: PROJECT BLOCK DIAGRAM
CHAPTER3: HARDWARE
3.1 Microcontroller..
CHAPTER4: SOFTWARE
CHAPTER5: PROJECT DESCRIPTION
CHAPTER6: RESULTS
CHAPTER7: APPLICATIONS
CHAPTER8: CONCLUSIONS AND FUTURE SCOPE
BIBLIOGRAPHY
Appendix

SMART DOCTORS ANDROID

ABSTRACT
This project describes the development of a heart rate based on a microcontroller through
Bluetooth module .It offers the advantage of monitoring status of heart rate through
smartphone using Bluetooth .The paper explains how a single-chip microcontroller can be
used to analyse pulse rate signals in real-time .In addition, it allows doctors to get the status
of heart rate of the patient by Bluetooth terminal Application in their android smartphone
every minute. The system reads, stores and analyses the pulse rate repetitively in real time.
The hardware and software design are oriented towards a single-chip microcontroller-based
system, hence minimizing the size. The important feature of this project is the use of pulsetime conversion process to compute heart rate. It then processes on the real-time data, that is
the information to determine whether the heart rate is normal or abnormal.

SMART DOCTORS ANDROID

List of figures
Chapter 2:
Project Block Diagram Fig 2.1
Chapter 3:
Pin Diagram of Micro controller AT89S52..Fig 3.1.
Circuit Diagram of AT89S52..Fig 3.1.1
Oscillator ConnectionsFig 3.2
External Clock Drive Configuration...Fig 3.2.1
Block Diagram of power supply.Fig 3.3
Bridge Rectifier...Fig 3.4
Voltage Regulator (LM 7805).Fig 3.5
Bluetooth Module (HC-05).Fig 3.6
Pulse rate sensor..Fig 3.7
Heart beat & sensor signal output graph.Fig 3.8
Liquid Crystal DisplayFig 3.9
Pin Diagram of LCD...Fig 3.10
Light Emitting Diode..Fig 3.11
Resistor...Fig 3.12
Capacitor.Fig 3.13
Crystal OscillatorFig 3.14
Chapter 4:
Schematic of projectFig 4.1
Chapter 6:
Result after placing an LCDFig 6.1
Result obtained in smartphone.Fig 6.2

SMART DOCTORS ANDROID

List of tables:
Chapter 3:
Various Special Features of Port3 in AT89S52..table 3.1
Pin Description of LCD..table 3.2
Instruction set of LCDtable 3.3

SMART DOCTORS ANDROID

ABBREVIATIONS:
ECG: Electrocardiogram
SQL: Structured Queuing Language
PHP: Programmable Hypertext Preprocessor
APACHE: Acute Physiology Age Chronic Health Evaluation
DVD: Digital Versatile Disc
AT89S52=AT-Atmel+89=Manufacture Series +S=SiliconCMOS+52 is the family
LCD: Liquid Crystal Display
IDE: Integrated Development Environment
OR-CAD: OR(Oregon, UNITED STATES)+CAD(Computer-Aided Design)
RAM: Random Access Memory
ROM: Read Only Memory
CPU: Central Processing Unit
I/O PORTS: Input / Output ports
UV-RAM: Ultraviolet Radiation Random Access Memory
NV_RAM: Non-Volatile Random Access Memory
UART: Universal Asynchronous Receiver/Transmitter
ISP: In-System Programming
MCS: Micro Controller Series
CMOS: Complementary Metal Oxide Semiconductor
TTL: Transistor-Transistor Logic
MCU: Multipoint Control Unit
LED: Light Emitting Diode
TXD: Transmit Data
RXD: Receive Data
SMD: Surface Mounted Device
PCB: Printed Circuit Board
ANSI: American National Standard Institute

SMART DOCTORS ANDROID

CHAPTER -1
INTRODUCTION
1.1 Introduction to the project:
Patient monitoring system is a process where a surgeon can continuously monitor more than
one patient, for more than one parameter at a time in a remote place. With the development of
Smartphone, it has performed a Smartphone based body monitoring system with a
combination of the advantages of network technology and multiple sensor fusion technology.
Body monitoring system greatly improves the operational capability of health care, such as
remote operations, wireless health care so on. There has been a growing concern with
technology of medical care which has developed rapidly and plays an increasingly important
role in our life. The advances in information and communication technologies enable
technically, the continuous monitoring of health related parameters with wireless sensor,
wherever the user happens to be. They provide valuable real time information enabling the
physicians to monitor and analyze a patients current and previous state of health. Now days
there are several efforts towards the development of system that carry out remote monitoring
of patients. Traditional healthcare technologies mostly are confined to hospitals and other
specific place, which is not convenient for the users movement. It may also take lots of
money. At present, several proposals, have been used to concentrate to this issue. But they
also suffer from some limitations mainly. Concerning single function of equipment and the
potential radiation hazards by mobile phone direct contacting with the body. In order to solve
the purpose of mobile medical care, we can use android Smartphone as a component of this
system. Android mobile phone can not only receive the data collected by our hardware device
but also can transmit these data to remote server in time. This method not only simplifies and
speeds up the process of information acquisition, processing and analysis, but also declines
costs of equipment; therefore, researchers have become more interested in wireless health
care. Although many wireless standards can be used, there are important considerations such
as range, throughput, security, ease of implementation and cost. The patient monitoring
involves handling of sensitive data. These data should be transmitted securely without any
intrusion. The web-database is a system where the web server will store the data in table
format where the digital data are filled in column and then it is plotted against the time to get
ECG graph and other parameters.

SMART DOCTORS ANDROID

1.2 INTRODUCTION TO EMBEDDED SYSTEMS


An embedded system is a special-purpose system in which the computer is completely
encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose
computer, such as a personal computer, an embedded system performs one or a few predefined tasks, usually with very specific requirements. Since the system is dedicated to
specific tasks, design engineers can optimize it, reducing the size and cost of the product.
Embedded systems are often mass-produced, benefiting from economies of scale.
Personal digital assistants (PDAs) or handheld computers are generally considered embedded
devices because of the nature of their hardware design, even though they are more
expandable in software terms. This line of definition continues to blur as devices expand.
Physically embedded systems range from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants.
In terms of complexity embedded systems can range from very simple with a single
microcontroller chip, to very complex with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.

1.4 Examples of embedded systems

Automatic teller machines (ATMs)

Avionics, such as inertial guidance systems, flight control hardware/software and other
integrated systems in aircraft and missiles

Cellular telephones and telephone switches

engine controllers and antilock brake controllers for automobiles

Home automation products, such as thermostats, air conditioners, sprinklers, and security
monitoring systems

Handheld calculators

Handheld computers

Household appliances, including microwave ovens, washing machines, television sets, DVD

10

SMART DOCTORS ANDROID


players and recorders

Medical equipment

Personal digital assistant

Videogame consoles

Computer peripherals such as routers and printers.

Characteristics
Embedded systems are designed to do some specific task, rather than be a generalpurpose computer for multiple tasks. Some also have real-time performance constraints that
must be met, for reason such as safety and usability; others may have low or no performance
requirements, allowing the system hardware to be simplified to reduce costs. An embedded
system is not always a separate block - very often it is physically built-in to the device it is
controlling. The software written for embedded systems is often called firmware, and is
stored in read-only memory or Flash memory chips rather than a disk drive. It often runs with
limited computer hardware resources: small or no keyboard, screen, and little memory.
Reliability
Embedded systems often reside in machines that are expected to run continuously for
years without errors and in some cases recover by them if an error occurs. Therefore the
software is usually developed and tested more carefully than that for personal computers, and
unreliable mechanical moving parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
1. The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Solutions may involve subsystems with redundant spares that can be switched over to,
or software "limp modes" that provide partial function. Examples include space
systems, undersea cables, navigational beacons, bore-hole systems, and automobiles.
2. The system must be kept running for safety reasons. "Limp modes" are less tolerable.
Often backups are selected by an operator. Examples include aircraft navigation,
reactor control systems, safety-critical chemical factory controls, train signals, engines
on single-engine aircraft.
3. The system will lose large amounts of money when shut down: Telephone switches,
factory controls, bridge and elevator controls, funds transfer and market making,
automated sales and service.
11

SMART DOCTORS ANDROID

12

SMART DOCTORS ANDROID

CHAPTER-2
PROJECT BLOCK DIAGRAM
BLOCK DIAGRAM:

POWER SUPPLY
MICRO

LCD DISPLAY
CONTROLLER AT89S52
(16 X 2 LINES)

SENSORS
( PULSE)

BLUETOOTH MODULE

FIG-2.1: BLOCK DIAGRAM OF THE PROJECT

13

SMART DOCTORS ANDROID

CHAPTER-3
HARDWARE
3.1 MICROCONTROLLER
Microprocessors and microcontrollers are widely used in embedded systems products.
Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed
amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed
amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them
ideal for many applications in which cost and space are critical.
The Intel 8051 is Harvard architecture, single chip microcontroller (C) which was
developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and
early 1990s, but today it has largely been superseded by a vast range of enhanced devices
with 8051-compatible processor cores that are manufactured by more than 20 independent
manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products.
8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a
time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU.
8051 is available in different memory types such as UV-EPROM, Flash and NV-RAM.
The present project is implemented on Keil Uvision. In order to program the device,
Proload tool has been used to burn the program onto the microcontroller.
The features, pin description of the microcontroller and the software tools used are
discussed in the following sections.
3.1 .1FEATURES OF AT89s52:

8K Bytes of Re-programmable Flash Memory.

RAM is 256 bytes.

4.0V to 5.5V Operating Range.

Fully Static Operation: 0 Hz to 33 MHzs

Three-level Program Memory Lock.


14

SMART DOCTORS ANDROID

256 x 8-bit Internal RAM.

32 Programmable I/O Lines.

Three 16-bit Timer/Counters.

Eight Interrupt Sources.

Full Duplex UART Serial Channel.

Low-power Idle and Power-down Modes.

Interrupt recovery from power down mode.

Watchdog timer.

Dual data pointer.

Power-off flag.

Fast programming time.

Flexible ISP programming (byte and page mode).

3.1.2 Description:
The AT89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer with
8K bytes of Flash programmable memory. The device is manufactured using Atmels high
density nonvolatile memory technology and is compatible with the industry-standard MCS51 instruction set. The on chip flash allows the program memory to be reprogrammed in
system or by a conventional non volatile memory programmer. By combining a versatile 8-bit
CPU with Flash on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer,
which provides a highly flexible and cost-effective solution to many embedded control
applications.
In addition, the AT89s52 is designed with static logic for operation down to zero frequency
and supports two software selectable power saving modes. The Idle Mode stops the CPU
while allowing the RAM, timer/counters, serial port and interrupt system to continue

15

SMART DOCTORS ANDROID

functioning. The power-down mode saves the RAM contents but freezes the oscillator
disabling all other chip functions until the next hardware reset.

Fig-3.1: Pin Diagram of Microcontroller AT89S52

16

SMART DOCTORS ANDROID

Fig-3.1.1: Circuit diagram of AT89S52

17

SMART DOCTORS ANDROID

3.1.2 PIN DESCRIPTION:

VCC

Pin 40 provides supply voltage to the chip. The voltage source is +5V.

GND Pin 20 is the ground.


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 pullups.
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 pull-ups. In
addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input
(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the
following table.
Port 1 also receives the low-order address bytes during Flash programming and 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.

18

SMART DOCTORS ANDROID

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. The port also receives the high-order address
bits and some control signals during Flash programming and verification.
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 AT89S52, as shown
in the following table.

Table 3.1 Special features of Port 3 in AT89S52.

RST

19

SMART DOCTORS ANDROID

Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out.
The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the
default state of bit DISRTO, the RESET HIGH out feature is enabled.
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 AT89S52 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 12volt programming enable voltage (VPP) during Flash programming.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
20

SMART DOCTORS ANDROID

XTAL2
Output from the inverting oscillator amplifier.
Oscillator Connections

Fig-3.2 Oscillator Connections.


C1, C2 = 30 pF 10 pF for Crystals
= 40 pF 10 pF for Ceramic Resonators
External Clock Drive Configuration

Fig-3.2.1: External Clock drive Configuration of Oscillator.

HARDWARE COMPONENTS

21

SMART DOCTORS ANDROID

Power Supply

Fig-3.3: Block Diagram Of Power Supply.


Each of the blocks is described in more detail below:

Transformer - steps down high voltage AC mains to low voltage AC.

Rectifier - converts AC to DC, but the DC output is varying.

Smoothing - smooths the DC from varying greatly to a small ripple.

Regulator - eliminates ripple by setting DC output to a fixed voltage.


Transformer
Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase voltage, step down transformers reduce voltage. Most power
supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in
UK) to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There is no
electrical connection between the two coils; instead they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down current is stepped up.

Bridge rectifier
A bridge rectifier can be made using four individual diodes, but it is also available in
special packages containing the four diodes required. It is called a full-wave rectifier because
it uses the entire AC wave (both positive and negative sections). 1.4V is used up in the bridge
rectifier because each diode uses 0.7V when conducting and there are always two diodes
conducting, as shown in the diagram below. Bridge rectifiers are rated by the maximum
current they can pass and the maximum reverse voltage they can withstand (this must be at
22

SMART DOCTORS ANDROID

least three times the supply RMS voltage so the rectifier can withstand the peak voltages).
Alternate pairs of diodes conduct, changing over the connections so the alternating directions
of AC are converted to the one direction of DC.

Fig-3.4: Bridge Rectifier

Regulator
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable
output voltages. They are also rated by the maximum current they can pass. Negative voltage
regulators are available, mainly for use in dual supplies. Most regulators include some
automatic protection from excessive current ('overload protection') and overheating ('thermal
protection').

Fig-3.5: Voltage Regulator.

Many of the fixed voltage regulators ICs have 3 leads and look like power transistors,
such as the 7805 +5V 1A regulator shown on the right. They include a hole for attaching a
heat sink if necessary.

23

SMART DOCTORS ANDROID

BLUETOOTH MODULE (HC 05)


HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent
wireless serial connection setup.
Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps
Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Blue core 04-External
single chip Bluetooth system with CMOS technology and with AFH (Adaptive Frequency Hopping
Feature). It has the footprint as small as 12.7mmx27mm. Hope it will simplify your overall
design/development cycle.

Fig-3.6: Bluetooth Module


These modules have two modes: master and slaver device. The device named after even
number is defined to be master or slaver when out of factory and cant be changed to the
other mode. But for the device named after odd number, users can set the work mode (master
or slaver) of the device by AT commands. The main function of Bluetooth serial module is
replacing the serial port line, such as: 1. There are two MCUs want to communicate with each
other. One connects to Bluetooth master device while the other one connects to slave device.
Their connection can be built once the pair is made. This Bluetooth connection is
equivalently liked to a serial port line connection including RXD, TXD signals. And they can
use the Bluetooth serial module to communicate with each other. 2. When MCU has
Bluetooth salve module, it can communicate with Bluetooth adapter of computers and smart
phones. Then there is a virtual communicable serial port line between MCU and computer or
smart phone. 3. The Bluetooth devices in the market mostly are salve devices, such as
24

SMART DOCTORS ANDROID

Bluetooth printer, Bluetooth GPS. So, we can use master module to make pair and
communicate with them.

Pulse rate Sensor

Fig-3.7: Pulse Rate Sensor

25

SMART DOCTORS ANDROID

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. A simple heart -beat transducer can be made from an infrared LED and an infrared
phototransistor. It works because skin acts as a reflective surface for infrared light. The IR
reflectivity of skin depends on the density of blood in it. Blood density rises and falls with the
pumping action of the heart. So the intensity of infrared reflected by the skin (and thus
transmitted to the phototransistor) rises and falls with each heartbeat.
Features
1.
2.
3.
4.
5.

Microcontroller based SMD design


Heat beat indication by LED
Instant output digital signal for directly connecting to microcontroller
Compact Size
Working Voltage +5V DC

Applications
1. Digital Heart Rate monitor
2. Patient Monitoring System
3. Bio-Feedback control of robotics and applications

Specification
1.
2.
3.
4.
5.
6.

Parameter Value
Operating Voltage +5V DC regulated
Operating Current 100 mA
Output Data Level 5V TTL level
Heart Beat detection Indicated by LED and Output High Pulse
Light source 660nm Super Red LED

Pin Details
Board has 3-pin connector for using the sensor. Details are marked on PCB as below.
Pin Name Details
1 +5V Power supply Positive input
2 OUT Active High output

SMART DOCTORS ANDROID

3 GND Power supply Ground

Using the Sensor


1. 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.
2. 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.
3. Put finger on the marked position, and you can view the beat LED blinking on each heart
beat.
4. The output is active high for each beat and can be given directly to microcontroller for
interfacing applications. Heart beat output signal
5V level
0V level

Working Principle:
The sensor consists of a super bright red LED and light detector. The LED needs to be super
bright as the maximum light must pass spread in finger and detected by detector. Now, when the
heart pumps a pulse of blood through the blood vessels, the finger becomes slightly more opaque
and so less light reached the detector. With each heart pulse the detector signal varies. This
variation is converted to electrical pulse. This signal is amplified and triggered through an
amplifier which outputs +5V logic level signal. The output signal is also indicated by a LED
which blinks on each heart beat. FIGURE 1 SENSOR PRINCIPLE following figure shows
signal of heart beat and sensor signal output graph.
Fig.2 shows actual heart beat received by detector (Yellow) and the trigger point of sensor (Red)
after which the sensor outputs digital signal (Blue) at 5V level.

SMART DOCTORS ANDROID

Fig-3.8: Heart beat &Sensor signal Output.

LIQUID CRYSTAL DISPLAY (LCD)


INTRODUCTION
LCD is a type of display used in digital watches and many portable computers. LCD
displays utilize to sheets of polarizing material with a liquid crystal solution between them. An
electric current passed through the liquid causes the crystals to align so that light cannot pass
through them

SMART DOCTORS ANDROID

Fig-3.9: Liquid Crystal Display


PIN DIAGRAM
Most of the LCD modules conform to a standard interface specification. A 14pin access is
provided having eight data lines, three control lines and three power lines. The connections are
laid out in one of the two common configurations, either two rows of seven pins, or a single row
of 14 pins.

FIG-3.10: 16 PIN DIAGRAM OF LCD DISPLAY


PIN DESCRIPTIONS
Vcc, Vss and Vee
While Vcc and Vss provide +5V and ground respectively, Vee is used for controlling LCD
contrast.
RS, register select

SMART DOCTORS ANDROID

There are two very important registers inside the LCD. The RS pin is used for their selection
as follows.
a) If RS=0, the instruction command code register is selected, allowing the user to send a
command such as clear display, cursor at home, etc.,
b) If RS=1 the data register is selected, allowing the user to send data to be displayed on the
LCD.
R/W, read/write
R/W input allows the user to write information to the LCD or read information from it. R/W=1
when reading; R/W=0 when writing.
EN, Enable
The enable pin is used by the LCD to latch information presented to its data pins. When
data is supplied to data pins, a high-to-low pulse must be applied to this pin in order for the LCD
to latch in the data present at the data pins. This pulse must be a minimum of 450ns wide.
D0-D7
The 8-bit data pins, D0-D7, are used to send information to the LCD or read the contents
of the LCDs internal registers. To display letters and numbers, we send ASCII codes for the
letters A-Z, a-z, and numbers 0-9 to these pins while making RS=1.
There are also instruction command codes that can be sent to the LCD to clear the display or
force the cursor to the home position or blink the instruction command codes.
We also use RS=0 to check the busy flag bit to see if the LCD is ready to receive information.
The busy flag is D7 and can be read when R/W=1 and RS=0, as follows: if R/W=1, RS=0. When
D7=1 (busy flag=1), the LCD is busy taking care of internal operations and will not accept any
information.

SMART DOCTORS ANDROID

TABLE-3.2 : PIN DESCRIPTIONS OF LCD

SMART DOCTORS ANDROID

TABLE-3.3: INSTRUCTION SET OF LCD


Basic commands of LCD:
Set Cursor Move Direction:
04h Shift cursor to the left
06h Shift cursor to the right
80h force cursor to the beginning of the first line
C0h force cursor to the beginning of second line
02h return home
Enable Display/Cursor:
0Ch - Turn Display On, cursor off
0ah - Turn Cursor On, Display off
08h - Cursor off, Display off
0eh/0fh- display on, cursor blinking
Shift Display: 18h 1Ch - Display Shift to left, right respectively
Set Interface Length: 38h Initialize LCD as 2 lines, 5*7 matrixes
Reading Data back is used in this application, which requires data to be moved back and
forth on the LCD. The "Busy Flag" is polled to determine whether the last instruction that has
been sent has completed processing. Before we send commands or data to the LCD module, the
Module must be initialized. For eight bit mode, this is done using the following series of
operations:

Wait more than 15 msecs after power is applied.

Write 0x030 to LCD and wait 5 msecs for the instruction to complete

Write 0x030 to LCD and wait 160 usecs for instruction to complete

SMART DOCTORS ANDROID

Write 0x030 AGAIN to LCD and wait 160 usecs or Poll the Busy Flag

Set the Operating Characteristics of the LCD

Write "Set Interface Length"

Write 0x010 to turn off the Display

Write 0x001 to Clear the Display

Write "Set Cursor Move Direction" Setting Cursor Behaviour Bits

Write "Enable Display/Cursor" & enable Display and Optional Cursor

LIGHT-EMITTING DIODE:

A light-emitting diode (LED) is a two-lead semi conductor light source. It is a pn


junction diode, which emits light when activated. When a suitable voltage is applied to
the leads, electrons are able to recombine with electron holes within the device, releasing
energy in the form of photons. This effect is called electroluminescence, and the color of
the light (corresponding to the energy of the photon) is determined by the energy band
gap of the semicondoctor

SMART DOCTORS ANDROID

Fig 3.11-Light Emitting Diode.


RESISTOR:

A resistor is a passive two-terminal electrical component that implements electrical


resistance as a circuit element. Resistors may be used to reduce current flow, and, at the same
time, may act to lower voltage levels within circuits. In electronic circuits, resistors are used to
limit current flow, to adjust signal levels, bias active elements, and terminate transmission lines
among other uses. High-power resistors, that can dissipate many watts of electrical power as
heat, may be used as part of motor controls, in power distribution systems, or as test loads for
generators. Fixed resistors have resistances that only change slightly with temperature, time or
operating voltage. Variable resistors can be used to adjust circuit elements (such as a volume
control or a lamp dimmer), or as sensing devices for heat, light, humidity, force, or chemical
activity.

Fig 3.12-Resistor

SMART DOCTORS ANDROID

CAPACITOR:
A capacitor (originally known as a condenser) is a passive two-terminal electrical
component used to store electrical energy temporarily in an electric field. The non conducting
dielectric acts to increase the capacitor's charge capacity. Materials commonly used as dielectrics
include glass, ceramic, plastic film, air, vacuum, paper, mica, and oxide layers. Capacitors are
widely used as parts of electrical circuits in many common electrical devices. Unlike a resistor,
an ideal capacitor does not dissipate energy. Instead, a capacitor stores energy in the form of an
electrostatic field between its plates.

Fig 3.13-Capacitor.

CRYSTAL OSCILLATOR:
A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of
a vibrating crystal of piezoelectric material to create an electrical signal with a precise frequency.
This frequency is commonly used to keep track of time, as in quartz wristwatches, to provide a
stable clock signal for digital integrated circuits, and to stabilize frequencies for radio
transmitters and receivers.

SMART DOCTORS ANDROID

Fig:3.14-Crystal Oscillator.

Chapter-4
SOFTWARE

4.1 Overview of KEIL CROSS C COMPILER


It is possible to create the source files in a text editor such as Notepad, run the Compiler
on each C source file, specifying a list of controls, run the Assembler on each Assembler source
file, specifying another list of controls, run either the Library Manager or Linker (again
specifying a list of controls) and finally running the Object-HEX Converter to convert the Linker
output file to an Intel Hex File. Once that has been completed the Hex File can be downloaded to
the target hardware and debugged. Alternatively KEIL can be used to create source files;
automatically compile, link and covert using options set with an easy to use user interface and
finally simulate or perform debugging on the hardware with access to C variables and memory.
Unless you have to use the tolls on the command line, the choice is clear. KEIL Greatly
simplifies the process of creating and testing an embedded application.
4.2 Projects
The user of KEIL centers on projects. A project is a list of all the source files required
to build a single application, all the tool options which specify exactly how to build the

SMART DOCTORS ANDROID

application, and if required how the application should be simulated. A project contains
enough information to take a set of source files and generate exactly the binary code required for
the application. Because of the high degree of flexibility required from the tools, there are many
options that can be set to configure the tools to operate in a specific manner. It would be tedious
to have to set these options up every time the application is being built; therefore they are stored
in a project file. Loading the project file into KEIL informs KEIL which source files are required,
where they are, and how to configure the tools in the correct way. KEIL can then execute each
tool with the correct options. It is also possible to create new projects in KEIL. Source files are
added to the project and the tool options are set as required. The project can then be saved to
preserve the settings. The project also stores such things as which windows were left open in the
simulator/debugger, so when a project is reloaded and the simulator or debugger started, all the
desired windows are opened. KEIL project files have the extension
4.3 Simulator/Debugger
The simulator/ debugger in KEIL can perform a very detailed simulation of a micro
controller along with external signals. It is possible to view the precise execution time of a single
assembly instruction, or a single line of C code, all the way up to the entire application, simply
by entering the crystal frequency. A window can be opened for each peripheral on the device,
showing the state of the peripheral. This enables quick trouble shooting of miss-configured
peripherals. Breakpoints may be set on either assembly instructions or lines of C code, and
execution may be stepped through one instruction or C line at a time. The contents of all the
memory areas may be viewed along with ability to find specific variables. In addition the registers
may be viewed allowing a detailed view of what the microcontroller is doing at any point in time.

The Keil Software 8051 development tools listed below are the programs you use to compile
your C code, assemble your assembler source files, link your program together, create HEX files,
and debug your target program.

Vision2 for Windows Integrated Development

Environment: combines Project Management, Source Code Editing, and Program Debugging in
one powerful environment.
C51 ANSI Optimizing C Cross Compiler: creates re locatable object modules from your C source
code,
A51

Macro Assembler:

creates

re locatable

object

modules

from

your 8051 assembler

SMART DOCTORS ANDROID


source code,
BL51 Linker/Locator: combines re locatable object modules created by the compiler and assembler
into the final absolute object module,
LIB51 Library Manager: combines object modules into a library, which may be used by the linker,
OH51 Object-HEX Converter: creates Intel HEX files from absolute object modules.

Program Code:
#include <reg52.h>
#include <intrins.h>
#include <lcd.h>
sbit pulse=P1^1;

unsigned int counts=0,loop_count,q,a,b,c,d,x,y,z;


unsigned int m=0,n=0;
void serial_init();
void Trans_Char(unsigned char );
void Trans_Str(unsigned char *);
//unsigned
char k[]="abnormal heart beat",l[]="nrmal heart beat",j;
bit flagd=0;
timer0()interrupt 1
{
m++;
//inc for every 255 machine cycles, 255 * 1.085 = 276 u sec
if(m==3623)
// 3623*276 = 10,00,000 u secs // approx
{
// for one interval it takes 255 machine cycles, 1 machine cycle =
1.085 u sec
m=0;
n++;
//inc seconds value
if(n==60)
// 60 sec = 1 min
{
flagd=1;
}
}
}
/*void serial_init()
{
SCON=0X50;
TMOD=0X20;
TH1=0XFD;
//9600
TR1=1;

SMART DOCTORS ANDROID

//EA=1;
//ES=1;
}*/
void main()
{
init_lcd();
init_lcd();
init_lcd();
serial_init();
serial_init();
TMOD=TMOD|0x02;
TH0=0x00;
IE|=0x82;
TR0=1;
Trans_Str(" HeartBeat");
cmd_lcd(0x01);
cmd_lcd(0x80);
display_lcd("Pulse");
cmd_lcd(0xC0);
display_lcd("Time");
delay_ms(100);
while(1)
{
while(pulse==1);
counts++;
while(pulse==0);
delay_ms(1);
q=counts/2;
a=q/1000;//to get thousands num
y=q%1000;
b=y/100; //to get hundreds num
x=y%100;
c=x/10; //to get tens num
d=x%10;
cmd_lcd(0x8A);
write_lcd(a+0x30);
write_lcd(b+0x30);
write_lcd(c+0x30);
write_lcd(d+0x30);
delay_ms(20);
//////////display time////////////////
q=n;
a=q/1000;//to get thousands num

SMART DOCTORS ANDROID

y=q%1000;

b=y/100; //to get hundreds num

x=y%100;

c=x/10; //to get tens num

d=x%10;

cmd_lcd(0xCA);

write_lcd(a+0x30);

write_lcd(b+0x30);

write_lcd(c+0x30);

write_lcd(d+0x30);

delay_ms(50);

////////

if(flagd==1)

cmd_lcd(0x01);

IE=0x00;

display_lcd("Pulse Rate");

q=counts/2;

a=q/1000;

y=q%1000;

b=y/100;

x=y%100;

c=x/10;

d=x%10;

cmd_lcd(0xC0);

write_lcd(a+0x30);

write_lcd(b+0x30);

write_lcd(c+0x30);

write_lcd(d+0x30);

delay_ms(50);

cmd_lcd(0xc5);

display_lcd("Pulses/Min");

//delay_ms(20);

if((counts/1)>100||(counts/1)<40)
{

cmd_lcd(0x01);
cmd_lcd(0x80);
display_lcd("ABNORMAL HRTBT ");
Trans_Str("\r\nAbNormal HeartBeat");
delay_ms(100)
}
else

SMART DOCTORS ANDROID

if((counts/1)<100&&(counts/1)>40)
{
cmd_lcd(0x01);
cmd_lcd(0x80);
display_lcd("NORMAL HEARTBEAT ");

Trans_Str("\r\nNormal HeartBeat");
TI=1;
delay_ms(100);
/*for(j=0;j<16;j++)
{
SBUF=l[j];
while(TI==0);
TI=0;
}
delay_ms(20);
cmd_lcd(0x01);
}*/
counts=0;
flagd=0;
m=0;
n=0;
q=0;
cmd_lcd(0x01);
TMOD=TMOD|0x02;
TH0=0x00;
IE|=0x82;
TR0=1;
cmd_lcd(0x80);
display_lcd("Pulse");
cmd_lcd(0xc0);
display_lcd("Time");
delay_ms(20);
}
}
cmd_lcd(0x01);
}
}
void serial_init()
{
TMOD=0x20;
SCON=0x50;
TH1=0xFD;

SMART DOCTORS ANDROID

TR1=1;
//EA=1;ES=1;
}
void Trans_Char(unsigned char tx_data)
{
SBUF=tx_data;
while(TI==0);
TI=0;
}
void Trans_Str(unsigned char *_data)
{
while (*_data)
{
SBUF =*_data++;
While (TI ==0);
T1=0;
}
}

SMART DOCTORS ANDROID

SMART DOCTORS ANDROID

Software Design Snap Shot:

Fig-4.1 : Schematic of the Project

SMART DOCTORS ANDROID

CHAPTER-5
PROJECT DESCRIPTION
CHAPTER-6
RESULT

SMART DOCTORS ANDROID

SMART DOCTORS ANDROID

SMART DOCTORS ANDROID

CHAPTER-7
APPLICATIONS
1.
2.
3.
4.

Digital Heart Rate monitor


Patient Monitoring System
Bio-Feedback control of robotics and applications
Bio-Medical Application

SMART DOCTORS ANDROID

CHAPTER-8
CONCLUSION AND FUTURE SCOPE
CONCLUSION:
Thus by the implementation pulse rate monitoring system, we can detect whether the
status of heart rate of the patient is normal or abnormal. By the Implementation of these kind of
project the huge size of the equipment can be largely reduced. The Bluetooth module transmits
the status of heart rate of the patient to the Bluetooth Terminal Application in the Smartphone.
Thus the status of the heart rate can be obtained in android smartphone.

FUTURE SCOPE:

EEG, ECG and other health parameters can also be monitored.


Continuous monitoring and future diagnosis can be performed via the same system
(TELEMEDICINE).

More than a single patient at different places can be monitored using single system.

By the Implementation of GPS module, we can get the address of the patient

Implementing Wifi module or GSM module instead of Bluetooth module can increase the
coverage area distance.

SMART DOCTORS ANDROID

BIBLIOGRAPHY

REFERENCES:
[1]

THE

8051

MICROCONTROLLER

PROGRAMMING

AND

ARCHITECTURE,

APPLICATIONS.

KENNETH

.J.AYALA (Second Edition).


[2]

THE 8051 MICROCONTROLLER AND EMBEDDED

SYSTEMS

MUHAMMAD ALI MAZIDI, JANICE

GILLISPIE MAZIDI, (Fourth Edition).

WEBSITES
www.alldatasheets.com
www.atmel.com
www.electronicforu.com
www.8052.com

SMART DOCTORS ANDROID

APPENDIX
11.1 Pin Details of AT89S52Port3

Table 11.1: Pin details of AT89S52 Port3

Pin Description of Heartbeat Monitor Module


Board has 3-pin connector for using the sensor. Details are marked on PCB as below.

Table 11.3: Pin Description of HT12E

SMART DOCTORS ANDROID

SMART DOCTORS ANDROID

You might also like