Professional Documents
Culture Documents
UNIVERSITY OF TECHNOLOGY
FACULTY OF ELECTRICAL & ELECTRONICS ENGINEERING
---------------o0o---------------
THESIS
HEART RATE MEASUREMENT
Supervisor
Assoc. Professor DANG Thanh Tin
Students
VO Phi Long 31201993
LE Huu Nhan 41202514
ii
ABSTRACT
In this thesis, we presented the design and development of a new integrated device for
measuring heart rate using fingertip to improve estimating the heart rate. As heart related
diseases are increasing day by day, the need for an accurate and affordable heart rate
measuring device or heart monitor is essential to ensure quality of health. However, most
heart rate measuring tools and environments are expensive and do not follow
ergonomics. Our proposed Heart Rate Measuring (HRM) device is economical and user
friendly and uses optical technology to detect the flow of blood through index finger.
We describe a microcontroller based heart rate measurement system that uses optical
sensors to measure the alteration in blood volume at fingertip with each heartbeat. The
sensor unit consists of an infrared light-emitting-diode (IR LED) and a photodiode, placed
side by side.
The problem of measuring heart rate using optical sensor unit is approached by three
steps in this thesis. First, optical sensor unit is designed to receive the raw light signal.
Second, these signals were counted by a microcontroller module. Finally, display on
computer screen.
Qualitative and quantitative performance evaluation of the device on real signals shows
accuracy in heart rate estimation, even under intense of physical activity. We compared
the performance of HRM device with Electrocardiogram reports and manual pulse
measurement of heartbeat of 90 human subjects of different ages. The results showed
that the error rate of the device is negligible.
The proposed system is applicable for family, hospital, clinic, community medical
treatment, sports healthcare and other medical purposes. Also, fit for the adults and the
pediatrics. However, presented method in the developed system needs further
investigation and need more functionality, which may be useful to consider advance in
future research.
Thesis Supervisor: Assoc. Professor DANG Thanh Tin
Faculty of Electrical and Electronics Engineering
Ho Chi Minh City University of Technology
iii
PREFACE
This thesis is submitted in partial fulfilment of the requirements for a subject in the
Bachelor of Engineering for both authors. It contains work done from August to November
2015. Our supervisor on the project has been Assoc. Professor Dang Thanh Tin, Ho Chi
Minh City University of Technology. The thesis has been made solely by the authors;
most of the text, however, is based on the research of others, and we have done our best
to provide references to these sources.
In August 2015, our teacher in “Computer system architecture, networking and
microprocessor” at that time, Assoc. Professor Dang Thanh Tin, introduced us to one of
his latest topics: a card intended to measure heart rate automatically. We were both
impressed and intrigued by this means of card, so when he presented a list of projects to
us, including the present one, the choice of the heart rate measurement project was
obvious.
Writing this thesis has been hard but in the process of writing we feel we have
learned a lot and our initial conceptions of heart rate measurement have certainly
changed! We have dealt with a lot of subjects, in an attempt to give this thesis a broad
perspective on heart rate measurement.
iv
Contents
Chapter One INTRODUCTION ...................................................................................... 1
1.1 All about Heart Rate (Pulse) .................................................................................. 1
1.1.1 What should you know about you heart rate? ................................................. 1
1.1.2 Where is it and what is a normal heart rate? ................................................... 1
1.1.3 How other factors affect heart rate .................................................................. 2
1.2 Problem considered ............................................................................................... 2
1.3 Outline of the thesis ............................................................................................... 4
Chapter Two FUNDAMENTAL THEORIES ................................................................... 5
2.1 Overview of Infrared (IR) radiation ......................................................................... 5
2.1.1 Definition ......................................................................................................... 5
2.1.2 Types of IR sensors [8] ................................................................................... 5
2.2 Photoplethysmography (PPG) theory .................................................................... 6
2.3 The advantages of using finger-tip PPG for measuring heart rate ......................... 7
Chapter Three HARDWARE AND SOFTWARE SYSTEM ............................................ 8
3.1 Hardware ............................................................................................................... 8
3.1.1 Circuit diagram ................................................................................................ 8
3.1.2 Electronic elements ....................................................................................... 11
3.2 Software .............................................................................................................. 13
3.2.1 Design Interface with C # .............................................................................. 13
3.2.2 Connect to device ......................................................................................... 14
3.2.3 Algorithm ....................................................................................................... 15
3.2.4 Interface ........................................................................................................ 16
Chapter Four RESULT AND DISCUSSION ................................................................ 20
4.1 Result .................................................................................................................. 20
4.2 Discussion ........................................................................................................... 20
Chapter Five CONCLUSION ....................................................................................... 22
5.1 Conclusion ........................................................................................................... 22
5.2 Further work......................................................................................................... 22
REFERENCES .............................................................................................................. 23
APPENDIX .................................................................................................................... 25
Appendix A. User guide for the Heart Rate Measuring device. .................................. 25
Appendix B. Code for the program ............................................................................ 26
VITAE............................................................................................................................ 28
v
vi
LIST OF FIGURES
Figure 1.1 Human Heart [3] ............................................................................................. 1
Figure 1.2 An ECG normal wave form [5]........................................................................ 3
Figure 2.1 Infrared Region [7] ......................................................................................... 5
Figure 2.2 Active infrared sensor [9]................................................................................ 5
Figure 2.3 Finger PPG (reflectance approach)[11] .......................................................... 6
Figure 2.4 Artery and Vein .............................................................................................. 7
Figure 3.1 Circuit diagram ............................................................................................... 8
Figure 3.2 Computer signal input circuit .......................................................................... 8
Figure 3.3 Pulse sensor circuit [12] ................................................................................. 9
Figure 3.4 Stage I filtering and amplification [12] ............................................................ 9
Figure 3.5 Stage II instrumentation circuit [12] .............................................................. 10
Figure 3.6 Digital pulse output circuit [12] ..................................................................... 10
Figure 3.7 LM324 [13] ................................................................................................... 11
Figure 3.8 18F2550 [15] ................................................................................................ 12
Figure 3.9 C# interface .................................................................................................. 13
Figure 3.10 VID and PID ............................................................................................... 14
Figure 3.11 Flowchart of algorithm ................................................................................ 15
Figure 3.12 Heart Rate Measurement interface ............................................................ 16
Figure 3.13 Flow Chart of the interface ......................................................................... 17
Figure 3.14 Flowchart of “Reset” button ........................................................................ 18
Figure 3.15 Heart Rate pulse chart ............................................................................... 18
Figure 3.16 Heart Rate .................................................................................................. 19
Figure 3.17 Heart Rate each 15s .................................................................................. 19
vii
LIST OF TABLES
Table 1.1 Estimated target heart rates for different ages [4] ........................................... 2
Table 4.1 Comparison between HRM device and AHRM.............................................. 20
Table 4.2 Accuracy comparison with different finger size .............................................. 20
viii
LIST OF ABBREVIATIONS
ECG Electrocardiogram
HRM Heart Rate Measuring
IR Infrared
PPG Photoplethysmography
IR led Infrared light emitting diode
Bpm Beat per minute
HPF High-Pass Filter
LPF Low-Pass Filter
USB Universal Serial Bus
HID Human Interface Device
VID Vector Identification
PID Product Identification
AHRM Automatic Heart Rate Monitor
ix
Chapter One
INTRODUCTION
1.1 All about Heart Rate (Pulse)
1.1.1 What should you know about you heart rate?
The heart [1],[2] is one of the most vital organs within the human body. It acts as a pump
that circulates oxygen and nutrient carrying blood around the body in order to keep it
functioning. The circulated blood also removes waste products generated from the body
to the kidneys. When the body is exerted the rate at which the heart beats will vary
proportional to the amount of effort being exerted.
Even if you’re not an athlete, knowledge about your heart rate can help you monitor your
fitness level — and it might even help you spot developing health problems.
Heart rate, or heart pulse, is the speed of the heartbeat measured by the number of
contractions of the heart per unit of time — typically beats per minute (bpm). The heart
rate can vary according to the body's physical needs, including the need to absorb oxygen
and excrete carbon dioxide. Activities that can provoke change include physical exercise,
sleep, anxiety, stress, illness, ingesting, and drugs.
1
pulse returns to normal is an indication of the fitness of the person. Lower than normal
heart rates are usually an indication of a condition known as bradycardia, while higher
than normal heart rates are known as tachycardia.
Table 1.1 Estimated target heart rates for different ages [4]
2
Figure 1.2 An ECG normal wave form [5]
However, there is a great need that patients are able to measure the heart rate in the
home environment as well. As aforementioned things, the rate of bpm varied on subject-
to-subject, like age, physical condition and activities. Therefore, to understand and count
the exact bpm from different subjects, it is necessary to develop an easy to use, portable
and low cost heart rate measuring device.
A heart rate measuring device (HRM) is a simple device that takes a sample of the
heartbeat signal and computes the bpm so that the information can easily be used to
track heart conditions.
The measurement of heart rate is used by medical professionals to assist in the diagnosis
and tracking of medical conditions. It is also used by individuals, such as athletes (during
prolonged exercise), who are interested to view their heart rate to acquire maximum
efficiency. There are many ways to count or measure the heart rate from the human body
where the rhythmical throbbing of arteries produced by the accepted contractions of the
heart (pulse-felt). For example, palpated at the wrist or in the neck, from the finger trip
and some other body part. After that an embedded system is needed to interface with
these body parts which will show the machine-readable digital data from the heart. Among
different heart rate monitoring systems, a microcontroller based heart rate monitoring
system from finger-trip (with blood volume) is one of the major concerns in biomedical
technology. In such type of system, the blood volume within a fingertip changes a little
with heart beat as the blood is being pumped. This transform in blood level within the
finger artery can be sensed with an uncomplicated optical sensor system and can be
further amplified using suitable signal conditioning circuit to produce a pulse of magnitude.
These pulses are able to count by a microcontroller chip to exhibit the measured heart
rate. This type of system having the ability to clearly present real heart rate using sensors
and instantly can display the results via computer.
3
1.3 Outline of the thesis
To help follow the thesis easily, we present with the following outline:
Chapter 2 introduces the basic theories needed for the thesis. The theories include the
overview of IR radiation and the photoplethysmography (PPG) theory.
In Chapter 3, hardware and software we have used are briefly introduced to make the
thesis easier to understand. In this chapter, we show the circuit diagrams and then we
explain the working principle of the diagrams. Finally, we introduce the electronic
elements that we use to create the circuit.
Chapter 4 show the results we got and make some discussions.
Finally, in Chapter 5, we come to a conclusion and scope to develop the project in the
future.
4
Chapter Two
FUNDAMENTAL THEORIES
2.1 Overview of Infrared (IR) radiation
2.1.1 Definition
Infrared waves are not visible to the human eye. In the electromagnetic spectrum, infrared
radiation can be found between the visible and microwave regions. The infrared waves
typically have wavelengths between 0.75 and 1000µm. [6]
The wavelength region which ranges from 0.75 to 3µm is known as the near infrared
regions. The region between 3 and 6µm is known as the mid-infrared and infrared
radiation which has a wavelength greater higher than 6µm is known as far infrared.
5
Active infrared sensors consist of two elements: infrared source and infrared detector.
Infrared sources include an LED or infrared laser diode. Infrared detectors include
photodiodes or phototransistors. The energy emitted by the infrared source is reflected
by an object and falls on the infrared detector.
The following picture shows a basic reflectance PPG probe to extract the pulse signal
from the fingertip. A subject’s finger is illuminated by an infrared light-emitting diode. More
or less light is absorbed, depending on the tissue blood volume. Consequently, the
reflected light intensity varies with the pulsing of the blood with heart beat. A plot for this
variation against time is referred to be a photoplethysmographic or PPG signal.
6
Figure 2.4 Artery and Vein
The PPG signal has two components, frequently referred to as AC and DC. The AC
component is mainly caused by pulsatile changes in arterial blood volume, which is
synchronous with the heartbeat. So, the AC component can be used as a source of heart
rate information. This AC component is superimposed onto a large DC component that
relates to the tissues and to the average blood volume. The DC component must be
removed to measure the AC waveform with a high signal-to-noise ratio. Since the useful
AC signal is only a very small portion of the whole signal, an effective amplification circuit
is also required to extract desired information from it.
2.3 The advantages of using finger-tip PPG for measuring heart rate
In the aforementioned “Photoplethysmography (PPG) theory”, Because of the limited
penetration depth of the light through organ tissue, the transmittance PPG is applicable
to a restricted body part, such as the finger or the ear lobe. However, in the reflectance
PPG, the light source and the light detector are both placed on the same side of a body
part. The light is emitted into the tissue and the reflected light is measured by the detector.
As the light doesn’t have to penetrate the body, the reflectance PPG can be applied to
any parts of human body.
The reflective photoplethysmograph is more convenient to apply when only the heart rate
measurement is interested. The measurement can be taken at any site of skin surface
like: arms, hands other than earlobe and fingertips. However, because of using infrared
light as the main mechanism of action, it leads to a trouble. People who have tattoo on
their skin can’t not using the device. The drawings on their body with dark, bold colors
interfere the light waves then make the device not recognized any more the blood flow.
The user don’t want to remove the tattoos and up to now there is no method to measure
through the tattoos. So the best solution is choosing a place that doesn’t have tattoos and
the choice of using fingertip is reasonable.
7
Chapter Three
HARDWARE AND SOFTWARE SYSTEM
3.1 Hardware
3.1.1 Circuit diagram
8
The following circuit shows the ON/OFF control scheme for the infra-red light source.
Note that the Enable signal must be pulled high in order to turn on the IR LED. The
photodetector output (VSENSOR) contains the PPG signal that goes to a two-stage filter
and amplifier circuit for further processing.
9
The second stage also consists similar HPF and LPF circuits. The two-step amplified and
filtered signal is now fed to a third Opamp, which is configured as a non-inverting buffer
with unity gain. The output of the buffer provides the required analog PPG signal. The
potentiometer P1 can be used to control the amplitude of the PPG signal appearing at the
output of the buffer stage.
10
Output :
The use of this device is very simple. Turn the power on, and you will see all zeros on
display for few seconds. Wait till the display goes off. Now place your forefinger tip on the
sensor assembly, and press the start button. Just relaxed and don’t move your finger.
You will see the LED blinking with heart beats, and after 15 sec, the result will be
displayed.
11
Compatible with all forms of logic
Power drain suitable for battery operation
Features
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 (700 µA) — essentially independent of supply voltage
Low input biasing current 45 nA (temperature compensated)
Low input offset voltage 2 mV and offset current: 5 nA
Input common-mode voltage range includes ground
Differential input voltage range equal to the power supply voltage
Large output voltage swing 0V to V +− 1.5V
3.1.2.2 18F2550
12
3.2 Software
3.2.1 Design Interface with C #
C# (pronounced "C sharp") is a programming language that is designed for building a
variety of applications that run on the .NET Framework. C# is simple, powerful, type-safe,
and object-oriented. The many innovations in C# enable rapid application development
while retaining the expressiveness and elegance of C-style languages.
Visual C# is an implementation of the C# language by Microsoft. Visual Studio supports
Visual C# with a full-featured code editor, compiler, project templates, designers, code
wizards, a powerful and easy-to-use debugger, and other tools. The .NET Framework
class library provides access to many operating system services and other useful, well-
designed classes that speed up the development cycle significantly.
An interface contains only the signatures of methods, properties, events or indexers. A
class or struct that implements the interface must implement the members of the interface
that are specified in the interface definition.
C # interface includes 3 basic areas:
13
An interface can inherit from one or more base interfaces.
When a base type list contains a base class and interfaces, the base class must come
first in the list.
A class that implements an interface can explicitly implement members of that interface.
An explicitly implemented member cannot be accessed through a class instance, but only
through an instance of the interface.
14
3.2.3 Algorithm
Begin
Flag = false
Count = 0
timeStart = Environment.TickCount
True
Flag = true
True
Flag = true
Count = Count +1
t = Environment.TickCount - timeStart
False
t >= 15s
True
15
Signal that we received via USB port from the heart rate circuit is a pulse that has
amplitude of 0 to 700. And this is a periodic pulse, every cycle is a heartbeat. Therefore,
to measure heart rate, we shall count the cycles that we receive from pulse.
To facilitate the heartbeat count, we use a “Flag” to mark up and down in value a pulse.
When the value of received pulses is greater than 350, we will give “Flag” = True, and
when the value of received pulses is less than 350, we will give “Flag” = False. To count
the heart rate, when “Flag” is ‘false’, we will add a cycle. And we will count the number of
beats for 15 seconds, then the number of beats divide by the total counted time and
multiply by 60s. This will give the heart rate for a minute (bpm).
And every 15 seconds, we will take the heart rate to the screen. While we reset the
variable to the initial value.
3.2.4 Interface
16
BEGIN
True
‘Start’ button: Disable
‘Stop’ button: Enable
Calculate the heart rate
17
Flowchart of ‘Reset’ button:
Current State
False Click
‘Reset’?
True
18
Calculate and display the heart rate
' Count(beat)
'Heart Rate (bpm)= ×60000(ms) (1)
Time(ms)
19
Chapter Four
RESULT AND DISCUSSION
4.1 Result
The performance of HRM device is tested with the output of an automatic heart rate
monitor –AHRM (National) for 10 patients. The error rate is calculated using (2)
4.2 Discussion
Overall evaluation
As we can notice, the board works very well in normal condition. The errors are small and
acceptable. However, we can find out the reasons that make the errors and minimize
them to have much accurate results.
Causes of the errors
Firstly, the errors are existed due to the limitation of the sensor. It is affected by the
environment light and the movement of the finger-tip. If the movement is considerable,
the error will be high.
Secondly, the accuracy may defer depending on the circumference size of the finger of
the user. We also measured the error rate depending on the finger size and found that
HRM device works well with medium-sized fingers. The result is shown in Table 4.2.
20
Finally, the accuracy of the board is depend on the accuracy of the printed circuit board.
We have made two different printed circuit boards and the much precision works with
lower error.
Solutions to improve the accuracy
To solve the problems above, we would like to put forward some solutions below:
- Reduce all the movements of the finger-tip when measuring the heart rate. We can
do that by notice the users not to move theirs finger-tip while using the HRM device.
- Make the printed circuit board with higher accuracy so that we can have a HRM
device with higher performance.
21
Chapter Five
CONCLUSION
The aim of this work was to determine to the efficient of the heart rate measurement
device. Here follows a brief discussion as well as conclusions.
5.1 Conclusion
The design and development of a Heart Rate Measuring device is presented that
measures the heart rate efficiently in a short time and with less expense without using
time consuming and expensive clinical pulse detection systems.
The device is ergonomic, portable, durable and cost effectively. The Heart Rate
Measurement device is efficient and easy to use.
Tests have shown excellent agreement with actual heartbeat rates. The device could also
be used in clinical and nonclinical environments.
22
REFERENCES
[1] “Human Heart”, available at : http://www.livescience.com/34655-human-heart.html,
accessed on Nov 4th 2015.
[8] The Working Principle and Key Applications of Infrared Sensors, available at:
http://www.azosensors.com/Article.aspx?ArticleID=339, accessed on Nov 15th 2015.
23
[13] LM324, available at: http://www.alldatasheet.com/view.jsp?Searchword=Lm324,
accessed on Dec 8th 2015.
[16] M.M.A.Hashem, Rushdi Shams, Md. Abdul Kader, and Md. Abu Sayed, “Design and
Development of a Heart Rate Measuring Device using Fingertip”,
[17] Sharif Babiker, “Microcontroller based Heart Rate Monitor using Fingertip Sensors”
[18] Kimmo Lasanen, “Integrated Analogue CMOS and Structure for Heart Rate
detectors”
[20] Daniel Torres, “Build A Wrist Heart-Rate Monitor Using An Ultra-Low-Power MC”,
available at : http://electronicdesign.com/, accessed on Nov 8th 2015.
24
APPENDIX
Appendix A. User guide for the Heart Rate Measuring device.
Step 1: Connect the circuit board to the computer using the USB cable.
Step 2: Run the application Heart Rate Measurement as show in the figure below.
Step 3: Put the finger-tip on the sensor likes the figure below. Fix your finger-tip and avoid
making movements so as to minimize the error.
Step 4: Press “Start” button. The device is now measuring your heart rate and show the
result on screen. You will see 3 parameters:
- The pulse graph of your heart rate.
- The average Heart Rate.
- The average Heart Rate after each 15s.
25
Appendix B. Code for the program
Usb connect
private void Heart_Rate_Load(object sender, EventArgs e)
{
Device = new UsbHidDevice(0x1234, 0x0001);
Device.OnConnected += DeviceOnConnected;
Device.OnDisConnected += DeviceOnDisConnected;
Device.DataReceived += DeviceDataReceived;
myPane.XAxis.Scale.Min = 0;
myPane.XAxis.Scale.Max = 1;
myPane.XAxis.Scale.MinorStep = 1;
myPane.XAxis.Scale.MajorStep = 5;
zedGraphControl1.AxisChange();
tickStart = Environment.TickCount;
26
Calculate the Heart Rate
if (t >= 15000)
{
avr = (int)(count / t * 60000);
AppendText1(avr.ToString());
count = 0;
timeStart = Environment.TickCount;
}
draw(signal);
t1 = Environment.TickCount - timeStart1;
avr1 = (int)(count1 / t1 * 60000);
AppendText(avr1.ToString());
27
VITAE
PERSONAL INFORMATION
Name : VO Phi Long
Date of Birth : 3rd April 1994
Gender : Male
Address : 09, street 442, Ben Co ward,
Phu Hoa Dong village, Cu Chi
district, Ho Chi Minh City.
Telephone No. : (+84)1692476086
Email : philong.hcmut@gmail.com
EDUCATION
2012 – 2015 Ho Chi Minh University of Technology
Major : Energy system
Academic year :4
Current GPA : 7.12/10
ACADEMIC ACHIEVEMENTS
Engineering design project:
Design IR Transmitter and Receiver Circuit using PT2248 and PT2249 (3rd
academic year).
Informatics project:
Image compression and decompression using Fourier transform (3rd academic
year).
Project of Analog and Digital Modulation:
AM- Amplitude Modulation using TMS320 c5515 (4th academic year).
28
PERSONAL INFORMATION
Name : LE Huu Nhan
Date of Birth : 17th April 1994
Gender : Male
Address : 20/24/18A Pham Ngoc Street,
Tan Phu District, Ho Chi Minh
City.
Telephone No. : (+84)1234433522
Email : nhanlehuu174@gmail.com
EDUCATION
2012 – 2015 Ho Chi Minh University of Technology
Major : Energy system
Academic year :4
Current GPA : 6.92/10
ACADEMIC ACHIEVEMENTS
Engineering design project:
Design IR Transmitter and Receiver Circuit using PT2248 and PT2249 (3rd
academic year).
Informatics project:
Image compression and decompression using Fourier transform (3rd academic
year).
Project of Analog and Digital Modulation:
SSB modulation with IC MC1496 (4th academic year).
29