final minor report3
TRANSCRIPT
1. INTRODUCTION:
Cardiovascular Disease (CVD) includes dysfunctional conditions of the heart, arteries, and veins
that supply oxygen to vital life-sustaining areas of the body like the brain, the heart itself, and
other vital organs. If oxygen doesn't arrive the tissue or organ will die.
The heart rate is one of the most important parameters that detect the cardiac disorders. Several
prospective studies have shown that the heart rate variability can independently provide the
information about the impending heart diseases.
The objective of work is to design a portable system that accurately measures the heart rate at the
skin periphery (fingertip) using the optical sensing technique eliminating the use of cumbersome
electrodes. The optical method involves to measure pulsatile blood volume changes by
photoelectric method.
1
2. PHYSIOLOGY OF HEART
The heart is the muscular organ of the circulatory system that constantly pumps blood throughout
the body. The heart has four separate compartments or chambers as shown in Fig1 . The upper
chamber on each side of the heart, which is called an atrium, receives and collects the blood
coming to the heart. The chamber then delivers blood to the powerful lower chamber, called a
ventricle, which pumps blood away from the heart through powerful, rhythmic contractions.
The human heart is actually two pumps in one. The right side receives oxygen-poor blood from
the various regions of the body and delivers it to the lungs. In the lungs, oxygen is absorbed in
the blood. The left side of the heart receives the oxygen-rich blood from the lungs and delivers it
to the rest of the body. the pumping action is explained in two stages:
2.1 Systole:
The contraction of the cardiac muscle tissue in the ventricles is called systole. When the
ventricles contract, they force the blood from their chambers into the arteries leaving the heart.
The left ventricle empties into the aorta and the right ventricle into the pulmonary artery. The
increased pressure due to the contraction of the ventricles is called systolic pressure.
2
Fig 1. Structure Of Heart
2.2 Diastole:
The relaxation of the cardiac muscle tissue in the ventricles is called diastole. When the
ventricles relax, they make room to accept the blood from the atria. The decreased pressure due
to the relaxation of the ventricles is called diastolic pressure. This is when the blood volume in
the arteries is decreased.
The normal human heart rate is 60 to 80 bpm (beats per minute) i.e 1to . At rest an adult has an
average of 72 bpm.
3
4
3. PRINCIPLE OF WORKING Two most commonly used methods are:
1. Reflectance Method
2. Transmittance Method
The output of the photo detector varies in proportion to the volume changes of the blood vessels.
Fig. 2 explains the set up required for reflectance method. The Led needs to be super bright red
as the light must pass through the finger and detected at the other end. 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 (light dependent resistor). So the detector signal varies with each heart
pulse. The variation is converted into electrical pulse.
The signal is amplified and triggered through an amplifier which outputs +5 logic level signal.
Here the red LED and the LDR can be replaced by an IR LED and an IR phototransistor respectively.
5
Fig. 2 LDR Sensor Reflectance Method
4. DESCRIPTION OF CIRCUIT COMPONENTS:
4.1 LDR :
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.
The snake like track on the face of the LDR is a cadmium
sulphide (CdS) film. On each side is a metal film which
is connected to the terminal leads as shown in fig. 3.
4.2 LM358
LM 358 is a low power dual operational amplifier
The pin configuration of the IC has been shown in
Fig.4.
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 32V
— or dual supplies: ±1.5V to ±16V
- Very low supply current drain (500 μA)—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
6
Fig. 4 Pin configuration of LM358
Fig 3. Structure of LDR
AdvantagesI. Two internally compensated op amp.
II. Eliminates need for dual suppliesIII. Allows direct sensing near GND and VOUT also goes to GND.IV. Compatible with all forms of logic.V. Power drain suitable for battery operation
4.3 AT89C52 MicrocontrollerThe main features of AT89S52 are given below:
I. Compatible with MCS-51® Products
II. 8K Bytes of In-System Programmable (ISP) Flash Memory
III. Endurance: 1000 Write/Erase Cycles
IV. 4.0V to 5.5V Operating Range
V. Fully Static Operation: 0 Hz to 33 MHz
VI. Three-level Program Memory Lock
VII. 256 x 8-bit Internal RAM
VIII. 32 Programmable I/O Lines
IX. Three 16-bit Timer/Counters
X. Eight Interrupt Sources
XI. Full Duplex UART Serial Channel
XII. Low-power Idle and Power-down Modes
XIII. Interrupt Recovery from Power-down Mode
XIV. Watchdog Timer
7
Fig 5 shows the functions of different pins of AT89S52. The functions of different pins have
been described below:
VCC
Supply voltage.
GND
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 pull ups.
Port 0 also receives the code bytes during Flash programming and outputs the code bytes during
program verification. External pull ups are required during program verification.
8
Fig. 5 Pin Configuration AT89S52
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.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the
internal pull ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled
low will source current (IIL) because of the internal pull ups.
Port 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 also serves the functions of various
special features of the AT89S52, as shown in the table 1 (taken from Atmel 89S52 datsheet).
9
Table 1 Alternate functions of port 3 pins in AT89S52
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running resets the
device.
ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator
frequency and may be used for external
timing or clocking purposes.
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.
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
10
External Access Enable. EA must be strapped to GND in Note, however, that if lock bit 1 is
programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal
program executions.
This pin also receives the 12-volt programming enable voltage (VPP) during Flash
programming.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
4.3 LCD
Vcc, Vss, VEE
11
Fig 6. Pin Configuration of 16*2 LCD
The voltage Vcc and Vss provided by +5 volt and ground respectively while VEE is used for
controlling the LCD contrast. Variable configurationbetween the ground and Vcc is used to
specify the contrast.of the characters on the LCD screen.
RS (Register Select)
There are two important register inside LCD . If RS=0, the instruction command code register is
selected then allowing the user to send commands such as clear display or cursor at home.
If RS=1 , the data register is selected, allowing the user to send data to be displayed on LCD.
R/ W ¯
R/W=1 when it read and R/W=0 , when it is writing. It allows the user to write information from
it.
EN
The 8-bit data pins D0-D7 are used to send information to the LCD or read the contents of the
LCD’s internal registers.
Interfacing of microcontroller with LCD display:
In most of the applications the ‘R/W’ line is grounded . this simplifies the application because
when the data is read back, the microcontroller I/O pins have to be alternated between input-
output modes. In our project we have simply declared R/W =0 to simplify the circuit.
5. Working:
12
The heart beat counter can be explained in two stages. 5.1 Sensor stage5.2 Pulse rate measurement or Counter stage
5.1 Sensor Stage
Bioelectric signals are low level signals and require amplification of the signals.The primary requirements of the amplifier in the circuit:
1. High input impedance2. Low output impedance
Other essential requirements are as follows:1. High gain 2. Low noiseWhich are fulfilled by LM358.
The amplification stage can further be devided into two stages:1. The first opamp forms a feedback amplifier.2. The second opamp forms a comparator.
13
Fig7. Sensor Stage
These stages are explained in detail below:
V.1.1 Amplification of the weak biolelectric signal
http://webpages.ursinus.edu/lriley/ref/circuits
5.1.2 Comparator
Fig 9 shows a comparator circuit using opamp.A fixed reference voltage Vref is applied to the –ve input and the other time varying signal is applied to the +ve input. Because of this arrangement the circuit is called the non- inverting comparator. When
Vin < Vref, the output obtained is –Vsaturation i.e. zero in the circuit. Vin > Vref , the output obtained is +Vsaturation i.e. +5 volts.
14
Fig 8 Non –Inverting amplifier using opamp
Fig 9 General Comparator Circuit
The value of the reference voltage can be varied by using a variable resistance pot between the supply and the input port 6. As we have used a variable resistor of value 100 k.
As the current through the LDR increases the i/p signal > ref signal and thus we attain logic 1.The output signals for the two stages have been shown below.
In the figure 10 the first waveform shows the output of the amplification stage and the second
waveform shows the output of the comparator stage .
5.2 Pulse rate measurement
15
Fig 10 Expected output waveforms in the sensor circuit
The pulse rate measurement circuit works on the principle of a simple frequency counter circuit
and gives the result in beats per second. Fig 11 given above shows the circuit of the frequency
counter that we have used to measure the pulse rate.
16
Fig 11 Pulse rate measurement circuit
6. SOFTWARE SIMULATION
6.1 Amplification Stage ( Orcad Simulation)
The amplification stage was simulated on Orcad 9.2 and the outputs for the amplification stage
and the comparator stage were obtained. The simaltion circuit and the output waveforms have
been shown below:
Simulation Circuit:
Waveforms:
In the figure 12 shown above instead of using an LDR and an LED at the input we simply gave a
sinusoidal wave of magnitude 1 at the input and the output eave forms were studied. Fig 13 a,b,c
show the waveforms for input signal, amplified output of non inverting amplifier and output of
the comparator stage.
17
Fig 12 Simulated circuit of sensor stage
a) Input Waveform Input Waveform
b) Amplification stage
c) Comparator stage
18
Fig 13 Outputs waveforms of the simulated circuit
6.2 Pulse Rate Measurement Stage
The simulation for the pulse rate measurement stage was done on ‘Proteus’. Fig 14 shows the
simulation results.
19
Fig 14 Proteus simulation results for pulse rate counter
6. RESULTS AND DISCUSSIONThe system can be further extended by connecting it to computer or mobile phone using proper
interfacing devices like Max232 thus providing the facility of sending an SMS to the doctor
whenever the pulse rate exceeds critical values through proper modifications in the program.
We can also add a temperature sensing circuit to the present system , that employs a thermistor
i.e. a thermally sensitive resistor or some other temperature sensor.
20
REFERENCES1. Murugavel Raju, Texas Instruments, ‘Heart Rate and EKG monitoring Using the
MSP430FG439’ October 2005–Revised September 2007
2. Pallas-Areny, R. ; Colominas, J. Rosell, J. ; “An Improved Buffer for Bioelectric signals”
Div. of Instrum. & Biol., Univ. Politecnica de Cataluna, Barcelona, Spain Biomedical
Engineering, IEEE Transaction, Issue Date : April, Volume : 36 , Issue:4 , On
page(s): 490 - 493 , Date of Current Version : 06 August 2002
3. University of Massachusetts, ‘Design and test a heart rate monitor’ (April, 2006),
4. Atmel AT89S52 datasheet ( Source- Internet).
5. LM158/LM258/LM358/LM2904 Low Power Dual Operational Amplifiers datasheet,
National Semiconductors (Source-Internet).
6. The 8051 Microcontroller and Embedded Systems: Muhammad Ali Mazidi and Janice Gillispie
7. Op-Amps and Linear Integrated Integated Circuits: Ramakant A. Gayakwad
8. www.wisegeek.com
9. www.mikroe.com
******************************************************************
21