You are on page 1of 41

MICROCONTROLLER BASED HEART RATE METER

BACHELOR OF TECHNOLOGY IN ELECTRONICS AND COMMUNICATION ENGINEERING

M.KRUPAL KUMAR P.HARSHAVARDHAN N.SHASHIKANTH

(08AG1A0437) (08AG1A0451) (08AG1A0439)

DEPARTMENT OF ELECTRONICS AND COMMUNICATIONS

ACE ENGINEERING COLLEGE


Ankushapur(V), Ghatkesar(M), R.R.Dist - 501 301

2011-12
1

MICROCONTROLLER BASED HEART RATE METER


A Mini Project Report Submitted in the partial Fulfillment of the Requirements For the Award of the Degree of

BACHELOR OF TECHNOLOGY IN ELECTRONICS AND COMMUNICATION ENGINEERING


SUBMITTED BY

M.KRUPAL KUMAR P.HARSHAVARDHAN N.SHASHIKANTH

(08AG1A0437) (08AG1A0451) (08AG1A0439)

DEPARTMENT OF ELECRTRONICS AND COMMUNICATIONS

ACE ENGINEERING COLLEGE


Ankushapur(V), Ghatkesar(M), R.R.Dist - 501 301
2

ACE ENGINEERING COLLEGE


Ankushapur[v], Ghatkesar [M], R.R dist-501301
(Approved by AICTE, Newdelhi and affiliated to JNTUH)

CERTIFICATE

This is to certify that the mini project entitled MICROCONTROLLER BASED HEART RATE METER done by M.Krupalkumar (08AG1A0437), P.Harshavardhan (08AG1A0451), N.Shashikanth (08AG1A0439) of Department of Electronics and DeCommunications Engineering, is a record of bonafide work carried out by them. This mini project is done as a partial fulfillment of obtaining Bachelor of Technology the academic year 2011-12 gree to be awarded by Jawaharlal Nehru Technological University, Hyderabad, during

C.Satyanarayana Associate Professor, Department of ECE

S.Surya Narayana Professor and Head, Department of ECE

ACKNOWLEDGEMENT

It is a pleasure to thank the many people who made this project possible. We would like to express the deepest appreciation to our internal guide , C.Satyanarayana, Department of Electronics & Communications, Who has the attitude and the substance of genius . He continually and convincingly conveyed a spirit of adventure in regard to the project and an excitement in regard to teaching. Without his guidance and persistent help this project would not have been possible. We are indebted to the Head of the Department of Electronics and Com munications Engineering, S.Suryanarayana for giving us an opportunity to work on this project. Being the Socratic force that he has always been brought us closer to the reality we had initially perceived, eventually enabling us to grasp the rich complexity of the engineering world. We would like to thank the principal, Dr.V.Buchaiah of ACE engineering college for the steadfast support throughout of our course of Engineering and for providing a stimulating and fun environment in which to learn and grow. We are especially grateful to the faculty members of department of Electronics and Communications for their kind assistance. We are forever grateful to our parents whose foresight and values paved the way for a privileged education .

ABSTRACT

Heart rate can be measured either by the ECG waveform or by the blood flow into the finger (pulse method). The pulse method is simple and convenient. When blood flows during the systolic stroke of the heart into the body parts, the finger gets its blood via the radial artery on the arm. The blood flow into the finger can be sensed photo-electrically. To count the heart beats, here we use a small light source on one side of the finger (thumb) and observe the change in light intensity on the other side. The setup uses a IR transmitter for light illumination of flesh on the thumb behind the nail and the IR receiver as detector of change in the intensity due to the flow of blood .The photo-current is converted into voltage and amplified by operational amplifier IC LM358

INDEX
CERTIFICATE AKNOWLEDGMENT ABSTRACT 1. INTRODUCTION 2. GENERAL HEART MONITERING SYSTEM 3. DESIGN OF MICROCONTROLLER BASED HEART RATE METER 4. HARDWARE DEVELOPMENT 5. HARDWARE REQUIREMENTS 6. COMPONENTS DESCRIPTION 6.1 LM358 QUAD OPERATIONAL AMPLIFIER 6.2 7805, 5V REGULATOR 6.3 2 X 16 LIQUID CRYSTAL DISPLAY 6.4 CRYSTAL OSCILLATOR 6.5 BC548 NPN TRANSISTOR 6.6 DIODES 6.6.1 1N4007 RECTIFIER DIODE, 6.6.2 LED 6.7 RESISTORS AND CAPACITORS 6.8 AT89S52 MICROCONTROLLER
6

PAGE NO.
3 4 5 8 9

10 12 14 16 16 17 18 19 21 22 23 24 36

6.9 PROGRAM 7. CONCLUSION 8. FUTURE SCOPE

30 37 38

INDEX
LIST OF FIGURES
1. FIG.2 2. FIG.3 3. FIG.3.1 4. FIG.4 5. FIG.4.1 6. FIG.6.1.1 7. FIG. 6.1.2 8. FIG. 6.2.1 9. FIG.6.3.1 GENERAL HEART MONITRING SYSTEM

PAGE NO.

9 10 11 12 13 16 17 17 19 20 21 23 23 24 25 27 28 38

DESIGN OF MC BASED HEART RATE METER BLOCK DIAGRAM CIRCUIT DIAGRAM FINGER CLIP MODELS LM385 QUAD OPAMP PIN CONFIGURATION OF 7805 7805,5V VOLTAGE REGULATOR LCD

10. FIG.6.4.1,6.4.2 CRYSTAL OSCILLATOR 11. FIG.6.5.1,6.5.2 BC 547 NPN TRANSISTOR 12. FIG.6.6.1 13. FIG.6.6.2 14. FIG.6.7.1 15. FIG.6.7.2 16. FIG.6.8.1 17. FIG.6.8.2 RECTIFIER DIODE LED RESISTORS CAPACITOR PIN DIAGRAM OF AT89S52 BLOCK DIAGRAM OF AT89S52

18. LCD DISPLAY

LIST OF TABLES
1. TABLE1 HARDWARE REQUIREMENTS 14-15

CHAPTER 1
INTRODUCTION
Many a time we measure the heart rate by using the ECG waveform. This leads to considerable wastage of money Though some circuits are already available for the purpose, most of them are 1. Expensive,
2. Require a thorough knowledge of microcontroller programming,

3. Too complicated to assemble by amateurs and hobbyists. Some others are too basic in their operation and prone to malfunction. This Project MICROCONTROLLER BASED HEART RATE METER is a reliable circuit that takes over the task of controlling the appliances. Microcontroller based heart rate meter is presented here the pulse method is simple and convenient. When blood flows during the systolic stroke of the heart into the body parts, the finger gets its blood via the radial artery on the arm. The blood flow into the finger can be sensed photo-electrically. Microcontroller IC AT89S52 is at the heart of the circuit. It is a 40-pin, 8-bit microcontroller with 8 KB of Flash programmable and erasable read-only memory (EPROM). The design of a low-cost microcontroller based device for measuring the heart pulse rate has been described. The device has the advantage that it can be used by non-professional people at home to measure the heart rate easily and safely. The circuit presented here is relatively simple, inexpensive and can be assembled by anyone having some knowledge of Electronics.

CHAPTER 2
GENERAL HEART MONITERING SYSTEM
A heart rate monitor is a personal monitoring device which allows a subject to measure his or her heart rate in real time or record his or her heart rate for later study. Early models consisted of a monitoring box with a set of electrode leads which attached to the chest.

ELECTROCARDIOGRAM: An electrocardiogram ECG or EKG, abbreviated from the German word (Elektrokardiogramm) .It is a graphic produced by an electrocardiograph, which records the electrical voltage in the heart in the form of a continuous strip graph. It is the prime tool in cardiac electrophysiology, and has a prime function in screening and diagnosis of cardiovascular diseases. The electrocardiogram does not assess the contractility of the heart. The ECG has a wide array of uses:
Determine whether the heart is performing normally or arrhyth-

mically.
It can indicate acute or previous damage to heart muscle (heart

attacks) or ischaemia of heart muscle (angina).


It can be used for detecting potassium, calcium, magnesium

and other

electrolyte disturbances.

It is useful for the detection of conduction abnormalities.

Fig.2

CHAPTER 3
DESIGN OF MICROCONTROLLER BASED HEART RATE METER

INTRODUCTION:
The design of microcontroller based heart rate meter comprises of IR sors, Microcontroller, Op-amp, voltage regulator, power-supply, finger module senPulse

10

Fig.3

The block diagram of microcontroller based heart rate meter in fig.3.1 The working procedure of the Heart rate meter is very simple . When the finger is placed in between the IR transmitter and receiver the change in the blood flow is calculated by the change in the intensity of the light that falling on the IR receiver The fig.4 shows the block diagram of microcontroller-based heart-rate meter. The setup uses a IR transmitter for illumination of flesh on the thumb behind the nail and the LDR as detector of change in the light intensity due to the flow of blood. The photo-current is converted into voltage and amplified by operational amplifier LM358 Microcontroller IC AT89S52 is at the heart of the circuit. It is a 8-bit bytes The internal timer of the microcontroller is used to find the time taken for one wavelength. This time is converted into the heart beat rate in beats per minute by a pre-calculated look-up table. The program notes the time between the high-to low and low-to11

IC mi-

crocontroller with Flash programmable and erasable read-only memory (PEROM), 128

high transitions of the wave. This time in micro seconds is converted in steps of 4 ms for comparison with the values already stored in the look-up table. This number is used to find (from the look-up table) the heart rate in beats per minute. The number so obtained is converted into a 3-digit number in binary-coded decimal (BCD) form.

BLOCK DIAGRAM :

Fig.3.1

CHAPTER 4
HARDWARE DEVELOPMENT

12

CIRCUIT-DIAGRAM

fig.4 WORKING PRINCIPLE: Basically, the device consists of an infrared transmitter LED and an infrared sensor photo-transistor. The transmitter-sensor pair is clipped on one of the fingers The LED emits infrared light to the finger of the subject. The photo-transistor detects this light beam and measures the change of blood volume through the finger artery.
This signal, which is in the form of pulses is then amplified and filtered

suit-

ably and is fed to a low-cost microcontroller for analysis and display.

13

The microcontroller counts the number of pulses over a fixed time interval and thus obtains the heart rate of the subject.
These sensor clips consist of only a pair of IR photo transistor and receiver

LEDs enclosed in a specially designed plastic clip housing and cable with stereo jack plug. FINGER CLIP MODELS:

fig.4.1 The IR transmitter and receiver are encapsulated in this clipping device

fig.4.2

14

CHAPTER 5
HARDWARE REQUIREMENTS

15

S.NO 1 2 3 4 5 6 7 8

NAME OF THE COMPONENT LM358 QUAD OPERATIONAL AMPLIFIER 7805, VOLTAGE REGULATOR AT89S52 MICROCONTROLLER CRYSTAL OSCILLATOR BC548 NPN TRANSISTOR 2 X16 LCD IN4007 RECTIFIER DIODE ZENER DIODE

RANGE 5V 6.8V 3.3V

QUANTITY 1 1 1 1 1 1 3 1 1 1 1 2 1 1 1 1

9 10

LED RESISTORS(ohms)

0.1k 1k 10k 22k 100k

LIGHT DEPENDENT RESISTORS

11

CAPACITORS(micro farads)

1 f,63V 33pf 100f 470f,25V

1 2 1 1

12

230V AC PRIMARY TO 12V-0-12V,500mA SECONDARY TRANSFORMER

13 14

FINGER PULSE MODULE VARIABLE RESISORS


16

0-10k

1 1

Table.1

CHAPTER 6
COMPONENTS DESCRIPTION 6.1 LM358 QUAD OPERATIONAL AMPLIFIER Description:
The LM358 series consists of two independent high gain,internally frequency compensated Operational amplifiers which were designed Specially to operate from a single power supply over a wide range of voltages.

17

Fig.6.1.1 Applications include transducer amplifiers, dc amplification blocks, and all the conventional operational amplifier circuits that now can be implemented more easily in single-supply-voltage systems

Features:
Wide bandwidth(unity gain): 1 MHz Low input offset voltage : 2 mV Large dc voltage gain : 100 dB

Differential input voltage range equal to the power supply voltage.


Power drain suitable for battery operation. Large output voltage swing: 0VDC to VCC-1.5VDC.

PIN CONNECTIONS(TOP VIEW):

Fig .6.1.2
18

6.2 7805, 5V REGULATOR Description:


The 7800 series of three-terminal positive regulator are available in the TO-220/D-PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible.

Fig 6.2.1 If adequate heat sinking is provided, they can deliver over 1A output rent. Although designed primarily as fixed voltage regulators, these devices used with external components to obtain adjustable voltages and currents. curcan be

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

6.3 2X16 LIQUID CRYSTAL DISPLAY Description:

19

Liquid Crystal Display also called as LCD is very helpful in providing user interface as well as for debugging purpose. The most common type of LCD controller is HITACHI 44780 which provides a simple interface between the controller & an LCD. These LCD's are very simple to interface with the controller as well as are cost effective

Pin 1 2 3 4 5 6 7-14 15 16

Symbol Vss Vdd Vo RS R/W En DB0-DB7 A/Vee K

Function Ground Supply Voltage Contrast Setting Register Select Read/Write Select Chip Enable Signal Data Lines Gnd for the backlight Vcc for backlight

Table.2

Fig 6.3.1
The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The

number on data lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required.
20

How do we decide which mode to use..? Its simple if you have sufficient data

lines you can go for 8 bit mode & if there is a time constrain i.e. display should be faster then we have to use 8-bit mode because basically 4-bit mode takes twice as more time as compared to 8-bit mode. The 10k Potentiometer controls the contrast of the LCD panel

6.4 CRYSTAL OSCILLATOR Description:

Fig 6.4.1 Figure 1. shows the crystal equivalent circuit. R is the effective series resistance, L and C are the motional inductance and capacitance of the crystal. CP is the shunt capacitance due to the crystal electrodes.

When the crystal is operating in parallel resonant mode it looks inductive. The frequency of operation in this mode is defined by the load on the crystal. The crystal manufacturer should specify the load capacitance CL for parallel resonant crystals. In this mode the frequency of oscillation is given by the equation

21

Crystal oscillator circuit:

Fig 6.4.2

Features:
Wide range of operating supply voltage: 1.50V to5.5V
Regulated voltage drive oscillator circuit for reduced power consumption and

crystal drive current


Optimized low crystal drive current oscillation for miniature crystal units

6.5 BC547 NPN TRANSISTOR Description:


The design of a transistor allows it to function as an amplifier or a switch. This is accomplished by using a small amount of electricity to control a gate on a much larger supply of electricity, much like turning a valve to control a supply of water .

22

Fig 6.5.1 Transistors are composed of three parts a base , a collector , and an emitter . The base is the gate controller device for the larger electrical supply . The collector is the larger electrical supply , and the emitter is the outlet for that supply . By sending varying levels of current from the base , the amount of current flowing through the gate from the collector may be regulated. In this way , a very small amount of current may be used to control a large amount of current , as in an amplifier . The same process is used to create the binary code for the digital processors but in this case a voltage threshold of five volts is needed to open the collector gate . In this way , the transistor is being used as a switch with a binary function: five volts ON , less than five volts OFF .

Features:
Low current (max. 100mA) Low voltage (max. 65 V).

23

Fig 6.5.2

6.6 DIODES
In electronics , a diode is a two - terminal electronic component that conducts electric current in only one direction. The term usually refers to a semiconductor diode , the most common type today . This is a crystalline block of material connected to two electrical terminals . A vacuum tube diode ( now little used except in some high power technologies ) is a vacuum tube with two electrodes ; a plate and a cathode . The most common function of a diode is to allow an electric current to pass in one direction ( called the diode's forward direction ) while blocking current in the opposite direction ( the reverse direction ) . Thus , the diode can be thought of as an electronic version of a check valve . This unidirectional behavior is called rectification, and is used to convert alternating current to direct current , and to extract modulation from radio signals in radio receivers .

6.6.1 1N4007 RECTIFIER DIODE

24

Fig 6.6.1

Features:

Low forward voltage drop

Low leakage current High forward surge capability

6.6.2 LIGHT EMITTING DIODE (LED)


A light-emitting diode (LED), figure is a semiconductor diode that emits light when an electrical current is applied in the forward direction of the device, as in the simple LED circuit. The effect is a form of electroluminescence where incoherent and narrow-spectrum light is emitted from p-n junction.

Fig.6.6.2 LEDs are widely used as indicator lights on electronic devices and increasingly in higher power applications such as flashlights and area lighting. An LED is

25

usually a small area (less than 1 mm) light source, often with optics added to the chip to shape its radiation pattern and assist in reflection. The color of the emitted light depends on the composition and condition of the semi conducting material used; and can be infrared, visible, or ultraviolet. Besides lighting, interesting applications include using UV-LEDs for sterilization of water and disinfection of devices, and as a grow light to enhance photosynthesis in plants.

6.7 RESISTORS AND CAPACITORS


RESISTOR: A resistor is a two-terminal electronic component as shown in figure signed to oppose an electric current by producing a voltage drop between its sistance R is equal to the voltage drop V across the resistor divided by the through the resistor. determicurrent I

nals in proportion to the current, that is, in accordance with Ohms law: V=IR. The re-

Fig 6.7.1 The ohm (symbol: ) is the SI unit of electrical resistance, named after George Ohm. The most commonly used multiples and submultiples in electrical and electronic usage are the milliohm, ohm, kilo-ohm, and mega-ohm.

CAPACITOR:

26

A capacitor is an electrical/electronic device, as shown in figure that can store energy in the electric field between a pair of conductors (called plates). The process of storing energy in the capacitor is known as charging, and involves tric charges of equal magnitudes, but opposite polarity, building up on each plate. A capacitor consists of two conductive electrodes, or plates, separated by a dielectric, which prevents charge from moving directly between the plates. Charge may however be moved indirectly by external influences, such as a battery connecting the terminals. After removing the external influences, the charge on the plates The separated charges attract each other, and an electric field is present plates. persists. between the elec-

Fig 6.7.2 Capacitors are often used in electric and electronic circuits as gy-storage devices. They can also be used to differentiate between quency and low-frequency signals. This property makes them useful in polarized dielectric spacer (orange) reduces the electric field and tance. A property called the capacitance C, which is a measure of the charge stored on each plate for a given voltage such that q(t)=Cv(t) enerhigh-freelectronic fil-

ters. Charge separation in a parallel-plate capacitor causes an internal electric field. A increase the capaci-

For an ideal parallel plate capacitor.In SI unit, a capacitor has a capacitance of one farad when one coulomb of charge storage corresponds to one volt between its plates.
27

Since the farad is a very large unit, capacitance is usually expressed in microfarads (F), nanofarads (nF), or picofarads (pF).

6.8 MICROCONTROLLER AT89S52


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

with 8Kbytes of in-system programmable Flash memory.


The device is manufactured using Atmels high-density nonvolatile memory

technology and is compatible with the industry-standard 80C51 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 in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which pro-

vides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes
of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit

timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry.

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 functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.

PIN DIAGRAM OF AT89S52 :


28

29

Fig 6.8.1

BLOCK DIAGRAM OF AT89S52 :

30

Fig 6.8.2
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 1sare written to port 0 pins, the pins can be used as high impedance inputs.

Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pullups.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 pullups and can be used as inputs. As inputs,Port 1 pins that are externally being pulled low will sourcecurrent (IIL) because of the internal pullups.

Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pullups..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 pullups 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 pullups. Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pullups.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 pullups and can be used as inputs. As inputs,Port 3 pins that are externally being pulled low will sourcecurrent (IIL) because of the pullups.

Table.3

Timer 2 Interrupt :
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

31

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 It 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 lator periods , the count rate is 1/12 of the oscillator frequency. oscil-

6.9 PROGRAM :
;> TITLE ;> TARGET ;> STARTED : HEART RATE MONITERING SYSTEM : AT89S52 : 02-08-2011

-----------------------------------------------------------------------------------------------------;> ;> ;> ;-----------------------------------------------------------------------------------------------------------;> ;> HARD WARE DETAILS : ;> ;> ;> ;> ;> ;-----------------------------------------------------------------------------------------------------------;> ;> FLAGS: BUSY_CHEK PL_FLG MIN_FLG ;> ;-----------------------------------------------------------------------------------------------------------;> ;> VARIABLES: ADC_VAL TMPR_VAL DATA 30H DATA 31H BIT BIT BIT 00H 02H 01H DISPLAY ENEBLE DEN DRW DRS BIT P2.5 - P2.6 - P2.7 BIT P2.6 BIT P2.7 DISPLAY READ/WRITE DISPLAY REG SELECT - P2.5 INCLUDES $MOD51 :

32

TMPR_VAH PULSE TCNT1 TCNT2 TPLS PCNT PULSE1 ;>

DATA 32H DATA 33H DATA 34H DATA 35H

DATA 36H DATA 37H DATA 38H

;-----------------------------------------------------------------------------------------------------------;> ;> DEFINITIONS COM DAT EOL ;> ;-----------------------------------------------------------------------------------------------------------;> ;> VECTOR ADDRESESS: ORG 0000H ljmp RESET ORG reti ORG 000BH 0003H : EQU 0fch EQU 0fdh EQU 0feh ; command ; data ; end of line ;display headers

lcall EXT_I0

push ACC push PSW mov mov inc mov mov cpl inc mov mov cpl mov mov SKIP_SEC: pop pop RETI PSW ACC TH0, #0DBH TL0, #0FFH TCNT1 A, TCNT1 TCNT1, #00h P3.5 TCNT2 A, TCNT2 TCNT2, #00h P3.3 PULSE, TPLS TPLS, #00h

cjne A, #100D, SKIP_SEC

cjne A, #60D, SKIP_SEC

setb MIN_FLG

33

;> ;-----------------------------------------------------------------------------------------------------------;> RESET: mov mov mov mov mov mov mov P3, #0FFH P2, #0FFH P1, #0FFH P0, #0FFH sp, #065H ; init stack pointer ; move all ports HIGH

dptr, #INITIALISE dptr, #NAME

lcall MESSAGE lcall MESSAGE lcall DLY mov dptr, #COLLEGE lcall MESSAGE lcall DLY mov dptr, #NAME1 lcall MESSAGE lcall DLY mov dptr, #NAME2 lcall MESSAGE lcall DLY mov dptr, #GUIDE lcall MESSAGE lcall DLY mov dptr, #HOD lcall MESSAGE lcall DLY mov dptr, #CLRSCR lcall MESSAGE mov mov mov mov mov mov mov clr mov mov mov clr ;> ;-----------------------------------------------------------------------------------------------------------;> MAIN: TCON, #05H TMOD, #21H IE, #83H TH0, #0DBH TL0, #0FFH TPLS, #00h PULSE, TPLS MIN_FLG TCNT1, #00h TCNT2, #00h PCNT, #00h PL_FLG

setb TR0

34

jnb clr mov

MIN_FLG, DONT_RST_VAL MIN_FLG R7, #01H

lcall DISP_COM lcall DLY1 DONT_RST_VAL: jb mov mov P3.7, RESET_PULSE PULSE, #00H TPLS, #00H

RESET_PULSE: lcall DISP_PLS ljmp MAIN ;> ;-----------------------------------------------------------------------------------------------------------;> EXT_I0: push ACC push PSW cpl inc mov clr da mov C A TPLS, A P3.4 TPLS A, TPLS

DONT_CNT_PLS: pop pop ret ;> ;-----------------------------------------------------------------------------------------------------------;> MESSAGE: push acc MESSAGE1: lcall READY clr inc pop ret COMD: clr DRS a dptr acc ; if the data is end of line stop sending ; ; if the data is not command goto data movc a, @a+dptr ; ; If the data is not end of line goto comd cjne a, #EOL, COMD ; Check weather display is ready ; Clr accumulator ; Load accumulator with the contents of dptr ; sub for sending charactors to display PSW ACC ; return to message

cjne a, #COM, DDATA

35

clr

BUSY_CHEK ; goto message again ; ; if the data is not data to be send goto comd

sjmp MESSAGE1 DDATA: cjne a, #DAT, SENDIT setb DRS setb BUSY_CHEK sjmp MESSAGE1 SENDIT: mov clr nop setb DEN clr ;> DEN ; sjmp MESSAGE1 P0, a DRW ;

; goto message again

; place the data at port 1

; send enable strobe ; goto message again

;-----------------------------------------------------------------------------------------------------------;> READY: clr mov clr WAIT: clr jb clr jnb DEN P0.7, WAIT DEN setb DEN DEN P0, #0FFH DRS ; ; send enable strobe ; ; if display is not send ready signal be in loop ; disable display buffer ; sub to check display busy ; disable display buffer ; set port1 in read mode

setb DRW

BUSY_CHEK, NO_DRS_SET

setb DRS NO_DRS_SET: ret ;> ;-----------------------------------------------------------------------------------------------------------;> DISP_LET: lcall READY setb DRS setb BUSY_CHEK mov clr nop setb DEN clr ret ;> ;-----------------------------------------------------------------------------------------------------------DEN ; ; return to message ; send enable strobe P0, R7 DRW ; place the data at port 1 ; Check whether display is ready ; return to message

36

;> DISP_COM: lcall READY clr clr mov clr nop setb DEN clr ret ;> ;-----------------------------------------------------------------------------------------------------------DEN ; ; return to message ; send enable strobe DRS BUSY_CHEK P0, R7 DRW ; place the data at port 1 ; Check whether display is ready

;> DISP_PLS: mov DPTR, #PLSEH

lcall MESSAGE mov anl add mov A, PULSE A, #0F0h A, #30H R7, A

swap A

lcall DISP_LET mov anl add mov A, PULSE A, #0Fh A, #30H R7, A

lcall DISP_LET RET ;> ;-----------------------------------------------------------------------------------------------------------;> DLY: mov r4, #0fh r5, #00h r6, #00h GONE: mov OUT: mov IN: ; END SUB

djnz r6, IN djnz r5, OUT djnz r4, GONE ret

DLY1: mov r4, #01h r5, #02h r6, #00h GONE1: mov OUT1: mov

37

IN1: djnz r6, IN1 djnz r5, OUT1 djnz r4, GONE1 ret DLY2: mov r4, #03h r5, #00h r6, #00h GONE2: mov OUT2: mov

IN2: djnz r6, IN2 djnz r5, OUT2 djnz r4, GONE2 ret DLY3: mov r0, #25h r3, #00h OUT3: mov

IN3: djnz r3, IN3 djnz r0, OUT3 ret ;> ;-----------------------------------------------------------------------------------------------------------;> ;> ROM TABLE AREA ;> INITIALISE: db COM, 30h, 30h, 30h, 30h, 3ch, 06h, 0ch, 01h, EOL NAME: db COM, 80h, DAT, ' HEART RATE ', COM, 0C0H, DAT,'MONITRING SYSTEM', EOL COLLEGE: db COM, 80h, DAT, 'ACE ENGG.COLLEGE', COM, 0C0H, DAT,' HYDERABAD ', EOL NAME1: db COM, 80h, DAT, 'SUBMITTED BY.. ', COM, 0C0H, DAT,'N.SHASHI KANTH ', EOL NAME2: db COM, 80h, DAT, 'M.KRUPAL KUMAR ', COM, 0C0H, DAT,'P.HARSHA VARDHAN', EOL GUIDE: db COM, 80h, DAT, 'GUIDED BY.. Mr.', COM, 0C0H, DAT,'C.SATYANARAYANA ', EOL HOD: db COM, 80h, DAT, 'OUR HOD.. Mr.', COM, 0C0H, DAT,'SURYA NARAYANA ', EOL PLSEH: db COM, 80h, DAT, 'PULSE = ', EOL CLRSCR: db COM, 01h, EOL ;> ;-----------------------------------------------------------------------------------------------------------;> END

38

CHAPTER 7
CONCLUSION
Since it has more advantages in many aspects compared with the disadvantages

it can be used widely


Examining of heart beat is very easy as if doesnt require much knowledge re-

garding circuitary.

Advantages:
If the clip is not adjusted properly then the accuracy comes down..
LCD displays are costly

Dis-advantages:
If the clip is not adjusted properly then the accuracy comes down.. LCD displays are costly

Applications:
39

While this sounds so simple, it is an important aspect for any patient who is suffering from heart disease, or someone recovering from an illness. Now a days these digital heart rate meters have become very popular and used in hospitals also

CHAPTER 8
FUTURE SCOPE
A graphical LCD can be used to display a graph of the change of heart rate over time

Fig.8 By modifying this circuit and using two relays we can achieve a task of opening and closing the door. This circuit can be modified to sense the water level in a cistern and control the water supply accordingly.
Sound can be added to the device so that a sound is output each time a pulse is

received

40

REFERENCES
1. www.wikipedia.com 2. www.efymag.com 3. www.datasheetscatalog.com 4. www.heartratemoniter.co.uk

41

You might also like