+ All Categories
Home > Documents > 14 Heart Rate Measurement

14 Heart Rate Measurement

Date post: 22-Oct-2014
Category:
Upload: venky999444
View: 1,210 times
Download: 5 times
Share this document with a friend
Popular Tags:
53
HEART RATE MEASUREMENT FROMFINGER TIP CHAPTER-1 INTRODUCTION BVCITS Page 1
Transcript
Page 1: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

CHAPTER-1

INTRODUCTION

It deals with the technique in which to measure the heart rate by sensing

the change in the blood volume in a finger artery, while the heart is pumping the

BVCITS Page 1

Page 2: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

blood. It consists of infrared LED which transmits the IR signal through the

finger tip of the object. The reflected signal is detected by the photo diode.

In this a two stage high gain active low pass filter is designed using

two operational amplifiers to filter and amplify the signal to the appropriate

voltage level. It deals with the technique in which to measure the heart rate by

sensing the change in the blood volume in a finger artery, while the heart is

pumping the blood.

It consists of infrared LED which transmits the IR signal through

the finger tip of the object. The reflected signal is detected by the photo diode

sensor. In this a two stage high gain active low pass filter is designed using two

operational amplifiers to filter and amplify the signal to the appropriate voltage

level.

While coming to the circuit diagram there will be two operational

amplifiers and an IC AT89C2051,ICULN2003 are essential for the circuit and

there will be an LED display at the last where the output will be appear.

1.1 AIM

The present invention relates to Heart Rate Measurement from finger tip

of a simple low cost heart measuring device with LCD output. Heart rate of the

subjects measured from finger using optical sensors and the rate is then averaged

and displayed on the LCD screen.

1.2 AREA OF THE PROJECT

It deals with the technique in which to measure the heart rate by sensing

the change in the blood volume in a finger artery, while the heart is pumping the

blood.

It consists of infrared LED which transmits the IR signal through the

finger tip of the object. The reflected signal is detected by the photo diode sensor.

In this a two stage high gain active low pass filter is designed using two

BVCITS Page 2

Page 3: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

operational amplifiers to filter and amplify the signal to the appropriate voltage

level.

1.3 MOTIVATION

The aim of our experiment is to create an low cost heart rate measuring

system. The resting heart rate is directly related to the health and fitness of the

person and hence it is important to know.

You can measure the heart rate at any spot on the body where you feel a

pulse with your fingers. The most common places are wrist and neck. You can

count the number of pulses within a certain interval, and easily measure the heart

rate in bpm.

1.4 APPILICATIONS AND ADVANTAGES

You can simply measure heart rate using the manual palpation method, that is taking your pulse.

The advantages of this method are that you can do it yourself, but it is not easily done during exercise and is generally less accurate than other methods.

The Heart rate is the Monitor most common device for measuring heart rate during fitness testing, as it is accurate, simple to use and relatively cheap.

BVCITS Page 3

Page 4: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

CHAPTER-2

THEORY RELEVANT

2.1 SCHEMATIC DIAGRAM

BVCITS Page 4

Page 5: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

2.2 SCHEMATIC DIAGRAM EXPLANATION

Fig 1 shows that the circuit of microcontroller- based heart rate

meter. The setup uses a 6V electric bulb for light 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 IC LM358 of change in the light intensity due to the flow of

blood.

The detected signal is given to the non-inverting input (pin 3) and its

output is fed to another non-inverting input (pin 5) for squaring and amplification

Output pin 7 provides detected heartbeats to pin12 of the microcontroller.

Preset VR1 is used for sensitivity and preset VR2 for trigger level

settings. Microcontroller IC AT89C2051 (IC2) is at the heart of the circuit.

BVCITS Page 5

Page 6: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

It is a20-pin, 8-bit microcontroller with 2kB of Flash

programmable and erasable read-only memory (PEROM), 128 bytes respectively.

Pin 6 of IC2 goes low to drive transistor T1 into saturation and

provide supply to the common-anode pin (either pin 3 or pin 8) of DIS1.

Similarly, transistors T2 and T3 drive common-anode pin 3 or 8 of 7-segment

displays DIS2 and DIS3, respectively.

IC2 provides segment-data and display-enable signals

simultaneously in time-division-multiplexed mode for displaying a particular

number on the 7-segment display unit Segment- data and display-enable pulses

for the display are refreshed every 5ms.

Thus the display appears to be continuous, even though it lights up

one by one Switch S2 is used to manually reset the microcontroller, while the

power on reset signal for the microcontroller is derived from the combination of

capacitor C4 and resistor R8.

An 11.0592MHz crystal is used to generate the basic clock

frequency for the microcontroller. The circuit is powered by a 6V battery. Port

pin P3.6 of the microcontroller is internally available for software checking. This

pin is actually the output of the internal analogue comp at pins 12 and 13 which is

available internally for comparing the two analogue levels these are used for

sensing the rise and fall of the pulse waveform and there by evaluate the time

between the output of the pulse pick-up pre-amplifier is fed to pin 12 of the

microcontroller.

Pin 13 of the microcontroller is connected to the pre reference-

level setting of the comparator. Thus voltages at pin 12 and13 are always

compared. The signal rise and the fall at pin 12 are sensed.

BVCITS Page 6

Page 7: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

2.3 BLOCK DIAGRAM

BLOCK DIAGRAM EXPLANATION

IR Transmitter transmits the light, here ir receiver acts as the photo diode.

photo diode mainly depends up on light intensity. If light intensity increases, the

resistance of the photo diode also increases.

When a finger is placed in between IR transmitter and IR receiver,

depending upon the blood pressure the pulses are produced. Microcontroller

fetches the instructions and compares the pulses.

Driven ckt is used to drive the display. The output is displayed at CAD

(Common Anode Display).

BVCITS Page 7

Page 8: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

CHAPTER-3

MAIN DEVICES

BVCITS Page 8

Page 9: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

3.1 Construction and testing

The arrangement for heart beat rate detection is shown in Fig (2).

Purchase a plastic ‘T’ tube from an electrical parts shop. The tube should be

about 5cm s. Hold the electric bulb into the left tube and the LDR (soldered on a

small PCB) into the right tube.

Fit shields on both sides of the tube to maintain darkness for better

tube to maintain darkness for better supply to the bulb and the LDR to the circuit

board via a shielded cable.

Fig (2) ‘“T” tube with finger inserted

For heart beat detection, which can be seen on a cathode ray

oscilloscope (CRO), insert your thumb with the nail facing the LDR inside the T

tube Shaking the thumb will change the level of signal from the previous the

levels of sensitivity, trigger and voltage reference for the comparator by using

presets VR1, VR2 and VR3 respectively.

Hold the thumb steady and observe the heart beat rate on the

display. The rate may vary and may not be exactly steady. For instance

BVCITS Page 9

Page 10: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

normally, the rate can vary between 60 and 100. Since this is a beat-to-beat

measurement and not an average over a time period of one minute, variation is

expected.

However when the reading shows high value at times, say 140, it

may be due to unusual mains hum picked up by the transducer to suppress it.

Place a separate capacitor of 100 μF across the 5Vsupply. An actual - size, single-

side PCB for the micro control le r based heart-rate meter is shown.

3.2 PARTS LIST

IC1(A1-A2) - LM358

IC2 - AT89C2051

IC3 - ULN2003

OPREATIONAL – AMPILIFERS - A1,A2

T1,T2,T3 - BC557

LED1,LED2

DIODE D1 - IN4007

RESISTORS

R1, R8, VR3 - 10K

R2 - 47K

R3, VR1, VR2 - 100K

R4, R5 -1K

BVCITS Page 10

Page 11: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

R6, R7 - 330OHMS

R9-R11 - 1.2K

CAPACITORS

C1 - 470n

C2, C5, C8 - 0.1 MICRO FARAD

C3, C9 - 470 MICRO FARAD (16V)

C4 - 10 MICRO

C6, C7 - 22PF

LDR

COMMON ANODE 7-SEGMENT DISPLAY DIS1-DIS3= LT542

S1,S2 - ‘ON’ AND ‘OFF’ SWITCH

PHOTO DIODE

BVCITS Page 11

Page 12: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

CHAPTER-4

HARDWARE DESIGN CONSIDERATION

4.1 INTEGRATED CIRCUIT (IC):

BVCITS Page 12

Page 13: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

1) IC LM358

Features:-

Available in 8-Bump micro SMD chip sized package.

Internally frequency compensated for unity gain.

Large DC voltage gain: 100 dB.

Wide bandwidth (unity gain): 1 MHz (temperature compensated).

Wide power supply range:

Single supply: 3V to 32Vor dual supplies: ±1.5V to ±16V.

Very low supply current drains (500 μA for microcontroller-based heart rate

meter).

Essentially independent of supply voltage.

Low input offset voltage: 2 mV.

Input common-mode voltage range includes ground.

Differential input voltage range equal to the power supply voltage.

Large output voltage swing.

The LM2904, LM358/LM358A, LM258/LM258A consists of two

independent, high gain; internally frequency compensated operational

amplifiers which were designed specifically to operate from a single power

supply over a wide range of voltage. Operation from split power supplies is

also possible and the low power supply current drain is independent of the

magnitude of the power supply voltage. Application areas include transducer

amplifier, DC gain blocks and all the conventional OP-AMP circuits which

now can be easily implemented in single power supply systems.

BVCITS Page 13

Page 14: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

PIN NUMBER DESCRIPTION1 OUTPUT AT A

2 INVERTING INPUT A

3 NON-INVERTING INPUTA

4 GROUND

5 NON-INVERTING INPUT B

6 INVERTING INPUTB

7 OUTPUT B

8 V+

BVCITS Page 14

Page 15: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

2) IC AT89C2051

Pin Number Description

1 RESET – Reset

2 P3.0 - Port 3 – RXD

3 P3.1 - Port 3 – TXD

4 XTAL2 – Crystal

5 XTAL1 – Crystal

6 P3.2 - Port 3 - INT0

7 P3.3 - Port 3 - INT1

8 P3.4 - Port 3 – TO

9 P3.5 - Port 3 - T1

10 GND – Ground

11 P3.7 - Port 3

12 P1.0 - Port 1 - AIN0

13 P1.1 - Port 1 - A1N1

14 P1.2 - Port 1

15 P1.3 - Port 1

BVCITS Page 15

Page 16: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

16 P1.4 - Port 1

17 P1.5 - Port 1

18 P1.6 - Port 1

19 P1.7 - Port 1

20 Vcc - Positive Power Supply

The AT89C2051 is a low-voltage, high-performance CMOS 8-bit

microcomputer with 2K bytes 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. By combining versatile 8-bit CPU with Flash on a

monolithic chip, the ATMEL AT89C2051 is a powerful microcomputer which

provides a highly-flexible and cost-effective solution to many embedded control

applications.

The AT89C2051 provides the following standard features: 2K bytes

of Flash, 128bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector

two-level interrupt architecture, a full duplex serial port, a precision analog

comparator, on-chip oscillator and clock circuitry. In addition, the AT89C2051 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 hardware reset.

Pin Description

VCC: Supply voltage.

GND: Ground.

Port 1:

The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide

internal pull-ups. P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also

BVCITS Page 16

Page 17: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

serve as the positive input (AIN0) and the negative input (AIN1) respectively of

the on-chip precision analog comparator

. The Port 1 output buffers can sink 20 mA and can drive LED displays

directly. When 1s are written to Port 1pins, they can be used as inputs. When pins

P1.2 to P1.7 are used as inputs and are externally pulled low, they will source

current (IIL) because of the accessible as a general-purpose I/O pin. The Port 3

output buffers can sink 20 mA. 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 3pins that

are externally being pulled low will source current (IIL).

3) IC ULN2003

The ULN2003 is very cost effective chip that act like a switch. The

easiest way to explain its operation is it simply switches on the earth to form an

external circuit and can with stand a continual 500mA current gain and maxi.

Pin1to 7 are inputs while 10 to 16 are high current sink drivers ,between the

inputs is an Darlington pair (it acts as a single transistor with high current gain)

when the input is driven high then it is automatically it is to be earth. alternately

when the input is low it is having high impedance This allows high current

BVCITS Page 17

Page 18: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

circuits are driven by the micro controllers, there will be seven channels to be

used which can be sink up to 500mA.

4.2 DIODE IN4007

A diode is a two-terminal electronic component that conducts

electric current in only one direction. The term usually refers to semiconductor

diode, the most common type today. This is a crystalline piece of semi conductor

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.

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 value. 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.

4.3 TRANSISTOR( BC557)

BVCITS Page 18

Page 19: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

FEATURES:-

· Low current (max of 100 mA)

· Low voltage (max of 65 V)

APPLICATIONS:-

· General purpose switching and amplification

4.4 LED (light emitting diode)

Light-Emitting Diode (LED) is a semiconductor light source. LED’s are

used as indicator lamps in many devices and are increasingly used for other

lighting. Introduced as a practical electronic component in 1962, early LEDs

emitted low-intensity red light, but modern versions are available across the

visible, ultraviolet and infrared wavelengths, with very high brightness.

BVCITS Page 19

Page 20: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

Light-emitting diodes are used in applications as diverse as

replacements for aviation lighting, automatic lighting s(particularly brake lamps,

turn signals and indicators) as well as in traffic signals. The compact size, the

possibility of narrow bandwidth, switching speed, and extreme reliability of

LEDs has allowed new text and video displays and sensors to be developed,

while their high switching rates are also useful in advanced communications

technology.

4.5 RESISTOR

A resistor is a two-terminal electronic component that implements

electrical resistance as a circuit element. When a voltage V is applied across the

terminals of a resistor, a current I will flow through the resistor in direct

proportional to that voltage.

This constant of proportionality is called conductance G. The reciprocal

of the conductance is known as the resistance R, since, with a given voltage V, a

larger value of R further "resists" the flow of current I as given by ohm’s law

BVCITS Page 20

Page 21: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

Resistors are carefully manufactured to provide a predefined value of

the resistance which may be range from 0.1ohm to 100,000,000 ohms depending

on the application the physical range of the resistance depending up on the power

passing through the resistor given by the

Power=voltage multiplied by current

There are also many types of the resistors as

1) Variable resistor

2) Thermistor

3) Light dependent resistor

Resistor example:

A led is the small led light and require 2.0 volts and.0.02 amps to

operate correctly, if we connect the led up to 12 volt battery the voltage would be

too high and too much current would flow the led would be blow up we need a

resistor to limit voltage and current But which value the resistor would have

Using ohm’s law

R=V/I

(12.0-2.0/0.02)=500OHMS

4.6 CAPACITOR

Capacitors store energy as well as charge. These charges are

generally stored in the conductive plates, the positive charge plate called anode

and negative charge plate called cathode in order to keep the charges separate

BVCITS Page 21

Page 22: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

there will be a dielectric material must be an non conductive electric insulator the

ratio between charge magnitude between each plates to the electrical potential

called as “capacitance”.

There are two types of capacitors as’ electrolytic capacitors’ and’ ceramic capacitors’.

ELECTROLYTIC CAPACITOR

An electrolytic capacitor is a type of capacitor that uses an electrolyte,

an ionic conducting liquid, as one of its plates, to achieve a larger capacitance per

unit volume than other types. They are often referred to in electronics usage

simply as "electrolytic".

They are used in relatively high-current and low-frequency electrical

circuits, particularly in power supply filters, where they store charge needed to

moderate output voltage and current fluctuations in rectifier output. They are also

widely used as coupling capacitors in circuits where AC should be conducted but

DC should not. There are two types of electrolytic aluminum tantalium.

CERAMIC CAPACITOR

A ceramic capacitor is a two-terminal, non-polar device. The

classical ceramic capacitor is the "disc capacitor". This device pre-dates the

transistor and was used extensively in vacuum-tube equipment (E.g., radio

receivers) from about 1930 through the 1950s, and in discrete transistor

equipment from the 1950s through the 1980s. As of 2007, ceramic disc capacitors

are in widespread use in electronic equipment, providing high capacity and small

size at low price compared to other low value capacitor types.

BVCITS Page 22

Page 23: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

Ceramic capacitors come in various shapes and styles, including:

Disc, resin coated, with through-hole leads.

Multi layer rectangular block, surface mount.

Bare leadless disc, sits in a slot in the PCB and is soldered in place, used

for UHF applications.

Tube shape, not popular now

4.7 LDR (LIGHT DEPENDENT RESISTOR)

LDRs or Light Dependent Resistors are very useful especially in

light/dark sensor circuits. Normally the resistance of an LDR is very high,

sometimes as high as 1000 000 ohms, but when they are illuminated with light

resistance drops dramatically.

An LDR (Light dependent resistor), as its name suggests, offers

resistance in response to the ambient light. The resistance decreases as the

intensity of incident light increases, and vice versa. In the absence of light, LDR

exhibits a resistance of the order of mega-ohms which decreases to few hundred

ohms in the presence of light. It can act as a sensor, since a varying voltage drop

can be obtained in accordance with the varying light. It is made up of cadmium

sulphide (CdS). 

BVCITS Page 23

Page 24: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

An LDR has a zigzag cadmium sulphide track. It is a bilateral device,

i.e., conducts in both directions in same fashion.

4.8 CRYSTAL OSCILLATOR

Crystal Oscillator is an electronic resonator circuit that uses the

mechanical resonance of a vibrating crystal of piezo electric material to create an

electrical signal with a very precise frequency This frequency is commonly used

to keep track of time (as in quartz wrist watches), to provide a stable clock signal

for digital integrated circuits, and to stabilize frequencies for radio transmitters

and receivers.

The most piezoelectric resonator used is the quartz crystal, so

oscillator circuits designed around them became known as "crystal oscillators."

4.9 PHOTO DIODE

BVCITS Page 24

Page 25: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

A photodiode is a type of photo detector capable of converting light

into either current or voltage, depending upon the mode of operation. Photo

diodes are similar to regular semiconductor diodes except that they may be either

exposed or packaged with a window or optical fiber connection to allow light to

reach the sensitive part of the device.

Many of them are designed for use specifically as a photo diode

will also use a PN junction rather than the typical PN junction.

4.9 IR DIODE

Common infrared LED that emits infrared rays has the same

appearance with visible light LED. Its appropriate operating voltage is around

1.4v and the current is generally smaller than 20mA. Current limiting resistances

are usually connected in series in the infrared LED circuits to adjust the voltages,

helping the LEDs to be adapted to different operating voltages.

BVCITS Page 25

Page 26: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

CHAPTER-5

RESULT AND CONCULUSION

BVCITS Page 26

Page 27: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

5.1GRAPHICAL REPRESENTATION

CONCULUSION:

5.2 SOFTWARE IMPLEMENTATION

BVCITS Page 27

Page 28: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

$mod51ORG 0HAJMP 30HORG 0BH ;TIMER 0 INTERRUPT VECTORAJMP TIM0ISR ;Timer 0 Interrupt service routine addressORG 30H MOV SP,#60H ;set stack pointer MOV P3,#0FFH ;set all port 3 bits high to enable inputs also MOV P1,#03 ;set port 1 to all zeros expect bits 0,1 MOV TMOD,#01100001B ;TIMER 1 - MODE 2 COUNTER,TIMR-0 TO MODE 1 BEG: MOV TH0,#0f0H ;TIMER REG.0 IS SET TO foo0, GIVES 4ms MOV TL0,#0 ; timer low reg. is also so mov r6,#255 clr 20h ; flag to know time between beats exceeded mov r2,#0 setb et0 setb eaPULSECHK:

jb p3.6,$ ; look for pulse at lowlevel call delay2 jnb p3.6,$ ;look for pulse high setb tr0 ;yes, pulse gone up, start timer

call delay2back1: jb p3.6,$ ; let waveform go low call delay2 jnb p3.6,$ ; look for next pulse high clr tr0 ; stop timer mov a,r2 cjne r2,#0,brady ; too low rate! brady-cardiaread_time: mov a,r6 cpl a mov dptr,#table ; table for rate calculated and kept ; read value in R6 which gives in steps of 4ms clr c subb a,#80 jc tachy ;rate too fast so tachy-cardialookup: mov a,r6

BVCITS Page 28

Page 29: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

cpl a movc A, @a+dptr ; table looked up MOV R2,A ; rate is now in r2 MOV R1,#0 ; high byte is zero call hex2bcd ; make it in BCD format call disp1 ; show the value on LED mov 50h,#100 ; refresh a 100 times (.5 sec)REFR: CALL REFRESH1 djnz 50h,REFR ; so many timesclrint: clr et0 clr ea ;no more interrupts jmp begtachy: clr p3.4 ; to show on LED pin 8 that rate is too high jmp begbrady: clr p3.3 ; show too low beat at p3.3 LED JMP beg ;16 Bit Hex to BCD Conversion for 8051 Microcontroller ;This routine is for 16 bit Hex to BCD conversion;;;;;;;;;;;;;;;;;;;;; ;Accepts a 16 bit binary number in R1,R2 and returns 5 digit BCD in ;R7,R6,R5,R4,R3(upto 64K ) Hex2BCD: ;r1=high byte

;r7 most significant digit;R2 = LSByte

MOV R3,#00DMOV R4,#00D

MOV R5,#00D MOV R6,#00D

MOV R7,#00D MOV B,#10D

MOV A,R2 DIV AB MOV R3,B MOV B,#10 ; R7,R6,R5,R4,R3 DIV AB MOV R4,B MOV R5,A

BVCITS Page 29

Page 30: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

CJNE R1,#0H,HIGH_BYTE ; CHECK FOR HIGH BYTE SJMP ENDD

HIGH_BYTE: MOV A,#6 ADD A,R3 MOV B,#10 DIV AB MOV R3,B ADD A,#5 ADD A,R4 MOV B,#10 DIV AB MOV R4,B ADD A,#2 ADD A,R5 MOV B,#10 DIV AB MOV R5,B CJNE R6,#00D,ADD_IT SJMP CONTINUE

ADD_IT: ADD A,R6CONTINUE: MOV R6,A

DJNZ R1,HIGH_BYTE MOV B, #10D MOV A,R6 DIV AB MOV R6,B MOV R7,A

ENDD: retDISP1:REFRESH: ; content of 18 to 1B memory locations are output on LEDs ;only numbers 0 to 9 and A to F are valid data in these locations MOV 18H,r3 ; least significant digit MOV 19H,r4 ; next significant digit MOV 1AH,r5 MOV 1BH,R6 ; most ; significant digit (max:9999)

BVCITS Page 30

Page 31: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

refresh1: MOV R0,#18h ; 1b,1a,19,18, holds values for 4 digits MOV R4,#4 ; pin p3.2_ 0 made low one by one starts wth 18 ; mov r7,#2 ; decimal pt.on third digit from left (2 nd fromright)PQ2: CALL SEGDISP INC R0 clr c mov a,r4 rrc a mov r4,a jnc pq2 PV3: RET SEGDISP: mov dptr,#ledcode MOV A,@R0 ANL A,#0FH MOVC A,@A+dptr

; k: djnz r7,segcode;yesDP: ; orl a,#01 ; add a dec. pt. where it should be

segcode: MOV R5,A ORL A,#03H ; WE WANT TO USE PORT 1 BITS 0 AND 1 FOR INPUT ANLOG ; so retain them highS3: MOV P1,A ; SEGMENT_PORTS1: ; MOV A,R4 ; get digit code from r4 ; rrc a ; jc s6 mov a,r5 rrc a rrc a mov p3.7,c ; segment' a on p3.7 pin mov a,r4 ; mov r4,a cpl a

BVCITS Page 31

Page 32: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

rrc a mov p3.0,c rrc a mov p3.1,c rrc a mov p3.2,cS5:S4: ACALL DELAY1 ; let it burn for some time ;MOV A,#07H ;MOV P3,A ; setb p3.0 ;extinguish the digit after that time setb p3.1 ;to prevent shadow setb p3.2s6: RETledcode:DB 7EH,0CH,0B6H,9EH,0CCH,0DAH,0FAHDB 0EH,0FEH,0CEH,0EEH,0F8H,72H,0BCH,0F6H,0E2H ;these are code for the numbers 0 to 9 and A to F DELAY2: mov 51h,#80 ;80msdelaywait: call till20ms djnz 51h,delaywait retdelay1:till20ms: MOV R1,#0ffH N: NOP nop nop DJNZ R1,N rettim0isr: push psw push acc MOV TH0,#0f0H ;AUTO RELOAD VALUE mov tl0,0 DJNZ R6,K1A ;r6 WAS FFH, SO 256 TIMES 4 ms GIVES 1 s MOV R6,#255 ; 11.059 MHz 226 for it; use 244 for 12 MHz crystal MOV A,R2 ADD A,#1 ;ADD 1 TO SECONDS

BVCITS Page 32

Page 33: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

DA A MOV R2,A setb 20h ; seconds over K1A: pop acc pop psw RETI ;INTERRUPT RETURN INSTRUCTIONtable:db 255,255,255,255,255,255,255,255,255,255,255,255,255 ;db 255,255,255,255,255,255,255,255,255,255,255,255,255;db 255,255,255,255,255,255,255,255,255,255,255,255,255;db 255,255,255,255,255,255,255,255,255,255,255,255,255,255;db 251,246,242,237,233,229,226,222,218,215,211,208,205,202;db 199,196,193,190,188,185,180,178,176,173,171;db 169,167,165,163,161,159,157,155,154,152,150,149;db 147 , 145 , 144 , 142 , 141 , 139 , 138 , 136 , 135 , 134 , 132 , 131;db 130 , 129 , 127 , 126 , 125 , 124 , 123 , 122 , 121 , 120 , 118 , 117;db 116 , 115 , 114 , 113 , 113 , 112 , 111 , 110 , 109 , 108 , 107 , 106;db 105 , 105 , 104 , 103 , 102 , 101 , 101 , 100 , 99 , 98 , 98 , 97;db 96 , 96 , 95 , 94 , 94 , 93 , 92 , 92 , 91 , 91 , 90 , 89;db 89 , 88 , 88 , 87 , 86 , 86 , 85 ,85 , 84 , 84 , 83 , 83;db 82 , 82 , 81 , 81 , 80 , 80 , 79 , 79 , 78 , 78 , 77 , 77;db 77 , 76 , 76 , 75 , 75 , 74 , 74 , 74 , 73 , 73 , 72 , 72;db 72 ,71 , 71 , 70 , 70 , 70 , 69 , 69 , 69 , 68 , 68 , 68;db 67 , 67 , 67 , 66 , 66 , 66 , 65 , 65 , 65 , 64 , 64 , 64;db 63 , 63 , 63 , 63 , 62 , 62 , 62 ,61 , 61 , 61 , 61 , 60;db 60 , 60 , 60 , 59 , 59 , 59 , 58 , 58 , 58 , 58 , 57 , 57;db 57 , 57 , 56 , 56 , 56 , 56 , 56 , 55 , 55 , 55 , 55 , 54;db 54 , 54 , 54 , 54 , 53 , 53 , 53 , 53; END

BVCITS Page 33

Page 34: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

5.3 FUTURE ENHANCEMENT

Still we can develop this project by transmitting the heart pulses of the

patient in the form of RF signals to observe by the doctor, even if the patient

is not nearby him.

5.4 RESULT

The mini project “HEART RATE MEASUREMENT FROM FINGER

TIP” has been successfully designed and tested.

5.5 CONCLUSION

BVCITS Page 34

Page 35: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

In the conclusion, heart measurement can be used to measure the heart

rate from the finger tip .by using AT89C2051 Microcontroller and IR

DIODE we can detect the signals depending upon the blood pressure. Finally

the output can be displayed on the CAD.

BVCITS Page 35

Page 36: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

CHAPTER-6

BIBLIOGRAPHY

BOOKS:

Electronics For You magazine (2008)

REFERNCES:

www.adfen.com

www.efymag.com

www.wikipedia.com

BVCITS Page 36

Page 37: 14 Heart Rate Measurement

HEART RATE MEASUREMENT FROMFINGER TIP

www.google.com

www.datasheet.com

BVCITS Page 37


Recommended