Академический Документы
Профессиональный Документы
Культура Документы
• Introduction
• Components
• Circuit Description
• Construction and Testing
• Hardware
• Software
21
• Bibliography
• Index
Objective:
Heart rate meter can be measured either by the ecg waveform or by the blood flow in to
the finger (pulsed method).the pulse method is simple & conventional.when blood flows during
the systolic stroke of the heart into the body parts,the finger gets its blood via the radial entry on
the atm.the blood flow into the finger can be sensed photoelectrically.
To count the heart beats,here we use a small light source on one side of the finger
(thumb) & observe the change in light intensity on the other side.the blood flow causes variation
in light intensity reaching the light depending dependent resistor(LDR),which results in change
21
in signal strength due to change in the resistance of the LDR.
The main objective of this project is to count the heart beats. This circuit will not give
accurate number but the number will vary between 50 and 120.
Methodology:
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 light intensity due to the flow of blood. The photo-current is
converted into voltage and amplified by operational amplifier IC LM 358.
The internal timer of the microcontroller is used to find the time taken for one wavelength. This
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 to high transitions of the wave.
The time in ms is converted in steps of 4ms for comparison with the values, already stored in the
look-up table. This number is used to find the heart rate in beats per minute.
The number so obtained is converted into a 3-digit number in BCD form. The same is output to
the 7-segment LED displays in a multiplexed manner.
Microcontroller IC AT89C2051
Buffer IC ULN2003
Transistors BC557(PNP)
21
Displays LTS542 common-anode,7-segment display
5mm LED
11.0592MHz crystal
6 volts batteries
Software
The software is written in assembly language and assembled using ASM51 cross-assembler.
The intel hex code is generated and burnt into the microcontroller chip by using a suitable
programmer.
Semiconductors:
Resistors:
R1, R8 - 10-kilo-ohm
R2 - 47-kilo-ohm
R4 -1-kilo-ohm
R6, R7 -330-kilo-ohm
R9-R11 -1.2-kilo-ohm
Capacitors:
21
C2, C5, C8 - 0.1µF ceramic disk
Miscellaneous:
S2 - Tactile switch
21
Figure shows the circuit of microcontroller based heart rate meter.the setup uses a 6V
electricbulb for light illumination of flesh on the thumb behind the nail and the LDR as detector
of change in the light intensiyty due to the flow of blood.The photo-current is converted into
voltage and amplified by operational amplifier IC LM358 (IC1). The detected signal is given to
the noinverting input (pin 3) and its output is fed to another non=inverting input (pin 5) for
squraing and amplification.output pin 7 provides detected heartbeats to pin 12 of the
microcontroller.preset VR1 is used for sensitivity and preset VR2 for triggeringlevel settings.
Port-1 pin P1.7 through P1.2,and port-3 pin 3.7 are connected to input pins 1 through 7 of IC
ULN2003 (IC 3) respectively .these pin are pulled up with 10 Kilo-ohm resistor network
rnw1.they drive all the segment of the 7-segment display with the help of inverting buffer IC3.
The displays are selected through port pins P3.0,P3.1 and P3.2 of the microcontroller (IC2).port
pins P3.0 down through P3.2 are connected to the base of transistor T3 through
T1,respectively.Pin 6 of IC2 goes low to drive transistor T1 into saturations and provide supply
IC2 provides segment data and display-enable signal simultaneously in the time division
multiplex mode for displaying a particular number on the 7-segment display unit. segment data
and and displays-enable pulses for the display are refreshed every 5 ms. thus the display appears
to be continuous, even through 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 derivated 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
21
circuit is powered by 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 levels at pin 12 and 13 of IC2 can work as an
analogue comparator, these are used for sensing the rise and fall of the pulse waveform and
thereby evaluate the time between two peaks and the beat rate.
The output of the pulse pick up preamplifier is fed to pin 12 of the microcontroller .Pin 13 of the
microcontroller is connected to the preset for reference-level setting of the comparator. thus
voltage at pins 12 and 13 are always compared. the signal rise and the fall at pin 12 are sensed by
the program.
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-to-high transitions of the wave.
This time in microseconds 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 Lookup 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. The same is output to the segment LED displays in a multiplexed manner.
The displays shows the rate for a while and proceeds to another measurement. Thus beat rates
obtained from time to time are visible on the display.
21
The arrangement for heart beat rate detection is shown in Fig. purchase a plastic ‘T’ tube from an
electrical parts shop. the tube should be about 5cm long and have a diameter of 1.5 cm. house the
electric bulb into the left tube and the LDR into the right tube. Fit shields on both sides of the
tube to maintain darkness for better performance. Connect the 6V battery supply to the bulb and
the LDR to the circuit board via a shielded cable.
21
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 value, and it will keep oscillating. Therefore you have to hold thumb
firmly between the light bulb and the LDR while the measurement is being made.
Place the circuit component and IC bases on the PCB board. Check the pulse pickup through the
CRO at output pin 7 of IC1.incert the programmed microcontroller and other ICs into the IC
bases. Set the level 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 normally, the rate can vary between 50 and 120.
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 supress it place a separate capacitor of
100 µF across the 6v supply.
An actual size, single-side PCB for the microcontroller based heart- rate meter and its
component lay out is shown in the above figure.
If we want to see the output waveforms of the heart beats , then using a CRO we can see the
heart beats. The above figure shows the heartbeat detection waveforms.
Microcontroller IC AT89C2051 (IC2) is at the heart of the circuit .it is a20 pin,8-bit
microcontroller with 2 kb of Flash Programmable and erasable read only memory ,128 bytes
of RAM.15 input/output lines,two 16-bit timer/counters,a five-vector two-level intterupt
architecture, a full-duplex serial port ,a precision analogue comparator and clock circuitary.
AT89C2051
21
Features
PIN DISCRIPTION
21
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 serve as the positive input (AIN0)
Port 1 also receives code data during Flash programming and verification.
Port 3
Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups. P3.6 is
hard-wired as an input to the output of the on-chip comparator and is not 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 3 pins that
21
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 AT89C2051 as listed below:
Port 3 also receives some control signals for Flash programming and verification.
RST
Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high for
two machine cycles while the oscillator is running resets the device. Each machine cycle takes 12
oscillator or clock cycles.
The XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which
can e configured for use as an on-chip oscillator. Either a quartz crystal orceramic resonator may
be used. To drive the device from an external clock source, XTAL2 hould be left unconnected
while XTAL1 is driven. There are no requirements on the duty cycle of the external clock signal,
since the input to the internal clocking ircuitry is through a divide-by-two flip-flop, but minimum
and maximum voltage high and low ime specifications must be observed.
21
21
The photo-current is converted into voltage and amplified by operational amplifier IC LM358
(IC1). The detected signal is given to the noinverting input (pin 3) and its output is fed to another
non=inverting input (pin 5) for squraing and amplification.
21
The LM158 series 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 voltages. 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 amplifiers, dc gain blocks and all the conventional op amp
circuits which now can be more easily implemented in single power supply systems. For
example, the LM158 series can be directly operated off of the standard +5V power supply
voltage which is used in digital systems and will easily provide the required interface electronics
without requiring the additional ±15V power
21
•
• Available in 8-Bump micro SMD chip sized package, (See AN-1112)
•
•
• 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
•
21
•
• 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
•
It is used to turn the turn the transistors on as the requirement of the microcontroller.
Description
The ULN2003 is a monolithic high voltage and high current Darlington transistor arrays.
It consists of seven NPN darlingtonpairs that features high-voltage outputs with common-
cathodeclamp diode for switching inductive loads. The collector-current rating of a single
darlington pair is 500mA. The darlington pairsmay be parrlleled for higher current capability.
Applications includerelay drivers,hammer drivers, lampdrivers,display drivers(LED
gasdischarge),line drivers, and logic buffers.The ULN2003 has a 2.7kW series base resistor for
eachdarlington pair for operation directly with TTL or 5V CMOS devices.
Features
Software:
$mod51
ORG 0h for
AJMP 30h
ORG 0Bh
AJMP TIM0ISR
21
ORG 30h
MOV sp, #60h
MOV p3, #0FFh
MOV p1, #03h
MOV TMOD, #01100001B
BEG: MOV TH0, #0F0h
MOV TL0 #0
MOV r6, #255
CLR 20h
MOV r2, #0
SETB et0
SETB ea
PULSCHK:
JB p3.6, $
CALL delay2
JBN p3.6, $
SETB tr0
21
CLR c
SUBB a, #80
JC tachy
lookup: MOV a, r6
CPL a
MOVC A, @a+dptr
MOV r2, A
MOV r1, #0
CALLhex2bcd
CALL disp1
MOV 50h, #100
REFR: CALL refresh1
DJNE 50, REFR
CLRINT: CLR et0
CLR ea
JMP beg
tachy:
21
MOV r7, #00d
MOV B, #10d
MOV A, r2
DIV AB
MOV r3, B
MOV B, #10
DIV AB
MOV r4, B
MOV r5, A
CJNE r1, #0h, high_byte
SJMP ENDD
high_byte: MOV a, #6
ADD A, r3
MOV B, #10
DIV AB
MOV r3, B
ADD A, #5
21
SJMP continue
add_it: ADD A, r6
continue: MOV r6, A
DJNZ r1, high_byte
MOV B, #10d
MOV A, r6
DIV AB
MOV r6, B
MOV r7, A
ENDD: ret
disp1:
refresh:
MOV 18h, r3
MOV 19h, r4
MOV 1Ah, r5
21
RRC a
MOV r4, a
JNC pq2
pv3:
RET
segdisp:
MOV dptr, #ledcode
MOV A, @r0
ANL A, #0Fh
MOVC A, @A+dptr
segcode:
MOV r5, A
ORLA, #03h
s3: MOV p1, A
s1: ; MOV A, r4
;RRC A
21
RRC a
MOV p3.1, c
RRC a
MOV p3.2, c
s5:
s4: ACALL delay1
; MOV A, #07h
; MOV p3, A
SETB p3.0
SETB p3.1
SETB p3.2
s6: RET
ledcode:
DB 7Eh, 0Ch, 0B6h, 9Eh, 0CCh, 0DAh, 0FAh
DB 0Eh, 0FEh, 0CEh, 0EEh, 0F8h, 72h, 0BCh, 0F6h, 0E2h
21
tim0isr: PUSH psw
PUSH acc
MOV TH0, #0F0h
MOV tl0, #0h
DJNZ r6, KIA
MOV r6, #255
MOV A, r2
ADD A, #1
DA A
MOV r2, A
SETB 20h
KIA:
POP acc
POP psw
RET
table:
DB 255,255,255,255,255,255,255,255,255,255,255,255,255;
21
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,41,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
Features
2. Signal Extraction: We will use a low pass filter to remove any interference caused by
ambient light and level detection distortions. The filter used will have a cutoff frequency of 4 Hz,
a roll off rate of 20 dB/decade, and pass-band frequencies amplified by a factor of 40dB.
21
3. Pulse Digitization: The conditioned signal will be analyzed by a comparator to provide a
digital pulse of amplitude 1Vpp to be fed into the micro-controller digital input. This stage of the
design will require that the amplified and filtered heart pulse signal have a SNR of 20 Db
4. Accuracy: Our design should give accurate readings with no more than +/- 20% error. The
accuracy of current optical heart monitoring devices is typically 10-15%
5. Power: The device will operate using a 6-volt battery source because of the small packaging
being utilized by our design. The battery should last one year under normal use.
7. Display:The heart rate will be displayed on a 3-digit LED display. A micro-controller will be
programmed to operate the LED display. Since improper finger placement could cause problems
with the user, a flashing segment on the LED display will be used to help the user identify when
a heart rate is being measured. A 3 digit LED display will be used because it will allow the full
range pulses detected by the device to be displayed.
8 Accuracy: Our design should give accurate readings with no more than +/- 20% error. This
accuracy is not quite as tight as the tolerance of ECG monitors (+/- 1%) but a significant cost
21
www.google.com
www.wikipedia.com
www.courses.cit.cornell.edu
www.hackaday.com
21
R. Bandler, “Cardiac problem at heart of SIDS?”, BBI Newsletter,American Health
Consultant, Inc., USA, April 1998.
Z. Kmietowicz, “Better coronary care reduces deaths from heart disease,” British Medical
Journal, p600, Tavistock Square, London March 2000.
J. Hastings, “You Call This Exercise?”, Health, Vol. 14, p106, USA, June 2000.
M. Bane, “Watch the Monitor,” Men’s Health, Vol. 11, p144, USA, November 1996.
Index
Heart Beat Meter
35
Details page no.
Introduction 2
Components 4
Circuit Description 6
Circuit Diagram 8
21
Different ICs used in the project 13
Software 22
Features 31
Bibliography 33