Sie sind auf Seite 1von 46

3

TABLE OF CONTENTS

ABSTRACT V

LIST OF TABLES VI

LIST OF FIGURE VII

CHAPTER 1. INTRODUCTION: 1

1.1 OVERVIEW 1
1.2 BACKGROUND 2
1.3 LITERATURE SURVEY 3
1.4 THESIS ORGANIZATION 4

CHAPTER 2. BASICS OF ECG AND HRV MEASUREMENTS 5

2.1 ELECTROCARDIOGRAM 5
2.1.1 STRUCTURE AND PHYSIOLOGY OF HEART 5
2.1.2GENERATION OF HEART BEAT 7
2.2 ECG MORPHOLOGY 8
2.3. HRV MEASUREMENT METHODS 9

CHAPTER 3. HRV MEASUREMENTS AND WIRELESS TRANSMISSIONS:


11

3.1 PAN TOMPKINS ALGORITHM 11


3.2 IMPLEMENTATION OF PAN TOMPKINS ALGORITHM: 14
3.2.1. BLOCKS USED IN LABVIEW: 14
3.2 PAN TOMPKINS ALGORITHM IN LABVIEW: 16
3.3 HARDWARE DESIGN: 18
3.3.1 DATA ACQUISTION:-AD8232 18
3.3.2 PROCESSING HARDWARE-ARDUINO UNO 20
3.3.3 RF TRANSCEIVER:-NRF24L01+ 22
3.4 HARDWARE WORKS DONE: 23
4

CHAPTER 4. RESULT AND DISCUSSIONS: 24

4.1 SIMULATION RESULT: 24


4.2 AD8232 WIRED CONNECTION: 25

CHAPTER 5. CONCLUSION AND FUTURE WORK: 28

5.1 CONCLUSION 28
5.3 FUTURE WORK: 28

APPENDIX: 29

I. LABVIEW COMPONENTS AND DESCRIPTION: 29


II.ARDUINO CODING: 37
REFERENCES
5

ABSTRACT
Heart rate variability is an important measurement that can predict the
survival after a heart attack. Studies have shown that reduced HRV predicts sudden
death in patients with Myocardial Infarction (MI). The existing methodology for HRV
measurement uses 12 or 3 or single lead electrode which is connected to the diagnosis
device via the wires. This method has the problem of restricting the mobility of patient
and the patient need to be in the hospital. Wireless HRV measurement allows the
activity monitoring without affecting the mobility of patients. For heart patient, the
heart rate variability has to be continuously monitored. Wireless ECG transmission
have the potential to provide near real-time health information and may also facilitate
a means to observe important cardiopulmonary information in patients and aging
adults in comfort of their homes. Development of Wireless ECG patches for the
measurement of Heart Rate Variability (HRV) is the main objective of this project.
This project focuses on the design, development and calibration of Wireless ECG
sensor. It also involves the design of Wireless communication system and protocols
for ECG transmission. For this purpose, the suitable transceiver modules have to be
designed and tested. ECG data will be collected using suitable ECG electrodes and
transmitted by using RF transmitter and microcontroller. The proper sampling rate (>
1 KHz) will be chosen for the low heart rate variability because the improper selection
will lead to the aliasing error. On receiving side, after the RF receiver and the
microcontroller, suitable software such as LabView 2015 is used in order to measure
the HRV from ECG data. The suitable no. of leads has to be identified and the proper
position of leads has to be determined such that it doesnt affect the measurement of
HRV and also provides a least hardware requirement. The suitable algorithm can also
be determined for sleep scheduling the patches so that the battery efficiency can be
improved.

Keywords: Wireless transmission, HRV measurement, Pan-Tompkins Algorithm.


6

LIST OF TABLES

TABLE TABLE NAME PAGE NO


NO.
3.1 FILTER EXPRESS VI PARAMETERS 14
3.2 ARDUINO SPECIFICATIONS 20
4.1 COMPARISION OF CALCULATED AND ACTUAL 24

VALUE.

I.1 FILTER VI PARAMETERS 28

I.2 TIME DOMAIN MATH VI PARAMETERS 33

LIST OF FIGURE

FIGURE FIGURE NAME PAGE


NO NO
7

2.1 STRUCTURE OF HEART 6

2.2 ECG WAVEFORM 8

3.1 BLOCK DIAGRAM OF THE 11

PAN-TOMPKINS ALGORITHM FOR QRS DETECTION.


3.2 BLOCK DIAGRAM OF PAN TOMPKINS ALGORITHM 16

3.3 BLOCK DIAGRAM OF WIRELESS HRV ANALYSIS 17

3.4 AD8232 18

3.5 ARDUINO UNO BOARD 21

3.6 ARDUINO CONNECTIONS TO NRF TRANSCEIVER 22

4.1 SIMULATION RESULT FROM PHYSIONET DATA 23

4.2 RECEIVED DATA ANALYSIS 25

4.3 WIRLESS HRV DATA FROM RECEIVED DATA 26


1

CHAPTER 1. INTRODUCTION:

1.1 OVERVIEW
Electrocardiogram (ECG) is the record of the electrical potentials produced by
the heart. The electrical wave is generated by depolarization and repolarization of
certain cells due to movement of Na+ and k+ ions in the blood. The ECG signal is
typically in the range of 2 mV and requires a recording bandwidth of 0.1 to 120 Hz .
The ECG is acquired by a non-invasive technique, i.e. placing electrodes at
standardised locations on the skin of the patient . The ECG signal and heart rate
reflects the cardiac health of human heart. Any disorder in heart rate or rhythm or
change in the morphological pattern of ECG signal is an indication of cardiac
arrhythmia. It is detected and diagnosed by analysis of the recorded ECG waveform.
The amplitude and duration of the P-QRS-T-U wave contains useful information about
the nature of disease related to heart.

The last two decades have witnessed the recognition of a significant


relationship between the autonomic nervous system and cardiovascular mortality,
including sudden cardiac death. Experimental evidence for an association between a
propensity for lethal arrhythmias and signs of either increased sympathetic or reduced
vagal activity has encouraged the development of quantitative markers of autonomic
activity. Heart rate variability (HRV) represents one of the most promising such
markers. The apparently easy derivation of this measure has popularized its use. As
many commercial devices now provide automated measurement of HRV, the
cardiologist has been provided with a seemingly simple tool for both research and
clinical studies. However, the significance and meaning of the many different
measures of HRV are more complex than generally appreciated and there is a potential
for incorrect conclusions and for excessive or unfounded extrapolations. With the
rising cost of healthcare and an aging worldwide population, there is an increasing
need for effective methods of reducing hospital readmissions, home-based screening
tests, and technologies that allow for aging-in-place. Remote monitoring technologies
have the potential to provide near real-time health information and may also facilitate
2

a means to observe important cardiopulmonary and activity information in patients


and aging adults in the comfort of their own homes. The reduction in size of digital
processors, accelerometers and components for electrocardiographic (ECG)
monitoring has allowed such technologies to become increasingly unobtrusive.
Furthermore, the widespread use of smartphones and wireless connectivity make real-
time monitoring in ambulatory conditions possible.

1.2 BACKGROUND
The clinical relevance of heart rate variability was first appreciated in 1965
when Hon and Lee noted that foetal distress was preceded by alterations in interbeat
intervals before any appreciable change occurred in the heart rate itself. Twenty years
ago, Sayers and others focused attention on the existence of physiological rhythms
imbedded in the beat-to-beat heart rate signal. During the 1970s, Ewing devised a
number of simple bedside tests of short-term RR differences to detect autonomic
neuropathy in diabetic patients. The association of higher risk of post-infarction
mortality with reduced HRV was first shown by Wolf et al. in 1977. In 1981, Akselrod
et al. introduced power spectral analysis of heart rate fluctuations to quantitatively
evaluate beat-to-beat cardiovascular control. These frequencydomain analyses
contributed to the understanding of the autonomic background of RR interval
fluctuations in the heart rate record. The clinical importance of HRV became apparent
in the late 1980s when it was confirmed that HRV was a strong and independent
predictor of mortality following an acute myocardial infarction. With the availability
of new, digital, high frequency, 24-h multi-channel electrocardiographic recorders,
HRV has the potential to provide additional valuable insight into physiological and
pathological conditions and to enhance risk stratification.
3

1.3 LITERATURE SURVEY


This section describes about the existing wearable ECG recording and HRV
analysis systems found in the literature. The ECG signals are nowadays recorded by
very small-size, lightweight, wearable devices (WD), which can continuously record
A-ECG for many hours and even for many days. One such WD has been developed by
V. Vaid and Lai at the department of Electrical Engineering of IIT Bombay. Okada
have developed a wearable ECG recorder for daily stress measurement. The body is
collapsible and made of plastic. The size is W44 x D17 x H58 mm and the weight is
45g including a battery and a memory card (1 GB). There are two switches
(ON/OFF,START/STOP) and two light emitting diodes (LEDs). Park, Bai have
developed an ultra-wearable, low power ECG monitoring system. Wearability is the
most crucial issue in designing a wireless ECG monitoring system. Probably, none of
the existing miniature sensing systems can be considered truly wearable in the strict
sense, not just because they are still bulky but also because conventional ECG sensors
can cause skin irritation. Therefore, authors have used QUASARs innovative ECG
sensor and an ultracompact wireless sensor node (Eco) specially designed for
wearable applications. A new wireless technology for tele-homecare purposes
proposed by Fensli et al gives better possibilities for monitoring of vital parameters
with wearable biomedical sensors, and gives the patient the freedom to be mobile and
still be under continuously monitoring and thereby to render better quality of patient
care. They describe a new concept tor wireless and wearable electrocardiogram (ECG)
sensor transmitting signals to a diagnostic station at the hospital, and this concept is
intended for detecting rarely occurrences of cardiac arrhythmias and to follow up
critical patients from their home while they are carrying out daily activities. Placing
wearable sensors in multiple body locations can be quite cumbersome when the user
has to collect data on a daily basis or for longer periods of continuous monitoring.
Thus, many approaches based on multiple integrated sensor modalities have been
proposed ,since it is much more comfortable for the user to wear a single device.
Moreover, incorporating multimodal information can yield additional physiological
and environmental cues, such as heart rate, light, skin resistance, temperature, audio,
global positioning system (GPS) location etc.
4

1.4 THESIS ORGANIZATION


The thesis constitutes five chapters including this chapter. The rest of the thesis is
organized as follows:
CHAPTER 2: BASICS OF ECG AND HRV MEASUREMENTS
This Chapter explains the generation of heart beat, basics of electrocardiogram and
ECG morphology. It also explains the various methods available to measure the HRV
(Mainly focused on the methods used in this project).
CHAPTER 3: HRV MEASUREMENTS AND WIRELESS TRANSMISSIONS
This chapter discusses different approaches which are implemented in this thesis to
measure the ECG signal and HRV detections. Different approaches to transfer the
ECG data through the Wireless ECG patches are also discussed.
CHAPTER 4: RESULTS AND DISCUSSION
In this chapter, the ECG signals taken from PHYSIONET and the noisy ECG signal
(ECG + noise generated) are passed through the designed GUI in LABVIEW. Then
the Hardware Arrangement and Programs are discussed.
CHAPTER 5: CONCLUSIONS AND FUTURE WORK
This chapter presents analytical remarks to overall achievements and limitations of all
the proposed works and scope for further research work in this domain.
5

CHAPTER 2. BASICS OF ECG AND HRV MEASUREMENTS


In this section, the basics of electrocardiogram and its formations are explained
in detail. The various ways to measure the ECG and HRV are explained in brief.

2.1 ELECTROCARDIOGRAM
The ECG is a bioelectric signal, which records the electrical activity of heart
versus time. Therefore, it is an important diagnostic tool for assessing heart function.
The ECG is acquired by placing electrodes on the skin of the patient. The ECG signal
provides the following information of a human heart:

Disturbances in heart rhythm and conduction

Abnormalities in the spread of electrical impulse across the heart

Information about a prior heart attack

Sign of coronary artery disease

Abnormal thickening of heart muscle

Indication of decreased oxygen delivery to the heart

Extent and location of myocardial ischemia

Changes in electrolyte concentrations

Effects of drugs on the heart


6

2.1.1 STRUCTURE AND PHYSIOLOGY OF HEART


The human heart weighs 250- 350 grams and is approximately equal to the size
of the fist. It is located anterior to the vertebral column and posterior to the sternum. It
is covered by a double-walled sac called the pericardium. The exterior part of this sac
is called the fibrous pericardium. This sac protects the heart, anchors its surrounding
structures and prevents overfilling of the heart with blood. The outer wall of the
human heart is composed of three layers. The outer layer is called the epicardium or
visceral pericardium since it is also the inner wall of the pericardium. The middle
layer is called the myocardium and is composed of cardiac muscle which contracts.
The inner layer is called the endocardium and is in contact with the blood. It also
merges with the inner lining (endothelium) of blood vessels and covers heart valves.
The Heart is divided into separate right and left sections by the interventricular
septum. Each of these (right and left) sections are again divided into upper and lower
compartments known as atria and ventricles respectively. Thus, human heart has four
chambers i.e. two superior atria and two inferior ventricles. The atria are the receiving
chambers and the ventricles are the discharging chambers as shown in the Fig. 2.1.
The atria are attached to the ventricles by fibrous, non-conductive tissue that keeps the
ventricles electrically isolated from the atria. The Tricuspid valve separates the right
atrium from the right ventricle. The Mitral (also known as the Bicuspid) valve
separates the left atrium from the left ventricle.
Oxygen-poor blood from the whole body is received into the right atrium
through large veins called the superior and inferior vena cava and flows. The right
atrium and the right ventricle together form a pump to the circulate blood to the
lungs. The right ventricle then pumps the blood to the lungs where the blood is
oxygenated. Similarly, the left atrium and the left ventricle together form a pump to
circulate oxygen-enriched blood received from the lungs (via the pulmonary veins)
of the rest of the body
7

FIGURE 2.1 STRUCTURE OF HEART

2.1.2 GENERATION OF HEART BEAT

Some cardiac cells are self-excitable, contracting without any signal from the
nervous system. Even if removed from the heart and placed in culture, the cells have
the self-excitation property. The electrical potentials for contraction are caused by a
group of specialized cells in the heart which control the heartbeat. These cells
produce electrical impulses which spread across the heart causing it to contract. The
main pacemaker of heart, the Sinoatrial node (SA node), initiates the heart beat by
generating an electrical impulse which travels to the left and right atria, causing
them to contract (atrial depolarization). Following the start of atrial depolarization,
the impulse quickly arrives at the Atrioventricular node (AV node) which is
responsible for the contraction of ventricle. The electrical signal next passes through
the Bundle of His, diverges into the Right and Left Bundle branches, and spreads
through the Purkinje Fibres to the muscles of the left and right ventricle. This causes
ventricular depolarization (contraction). The time required for the signal to travel
from the AV node to the Purkinje Fibres provides a natural delay of about 0.1
second. This delay ensures that the atria have become completely empty before the
8

ventricles contract. The contraction is followed by ventricular repolarization


(recovery) of the cells which were excited during the previous depolarization wave.

The SA node creates the electrical impulse which causes the heart to beat, but
the Autonomic Nervous System (ANS) controls the heart rate and the strength of
heart contractions. The ANS consists of two parts, the Sympathetic Nervous System
(SNS) and the Parasympathetic Nervous System (PNS). The Sympathetic nerves
increase the heart rate and the contraction force, while the Parasympathetic nerves
act in the reverse manner. A small portion of this electrical potential flows to the
body surface. By applying electrodes on the skin at the selected points, the electrical
potential generated by this current can be recorded as an ECG signal.

2.2 ECG MORPHOLOGY


ECG waveform of a normal individual consists of P wave, QRS complex, ST
segment, T wave and U wave. The labels of Fig. 2.2 are commonly used in
medical ECG terminology.
P wave: When the electrical impulse is conducted from the SA node towards the
AV node and spreads from right to left atrium, the depolarization (contraction) of
the atria occurs. The depolarization of atria results the P Wave in the ECG.
QRS complex: The QRS complex consists of three waves, sequentially known
as Q, R and S. The rapid depolarization of both the ventricles results this
complex. The muscles of the ventricles have large muscle mass than that of atria,
hence its amplitude is much larger than that of P wave
9

FIGURE 2.2 ECG WAVEFORM

T wave: Ventricular repolarisation results the preceding of ST segment and the T


wave.
U wave: The origin of U wave is not clear and it is rarely seen. It is probably
produced due to the repolarisation of the papillary muscles

2.3. HRV MEASUREMENT METHODS


TIME DOMAIN METHODS:

Variations in heart rate may be evaluated by a number of methods. Perhaps


the simplest to perform are the time domain measures. With these methods either
the heart rate at any point in time or the intervals between successive normal
complexes are determined. In a continuous electrocardiographic (ECG) record, each
QRS complex is detected, and the so-called normal-to-normal (NN) intervals (that is
all intervals between adjacent QRS complexes resulting from sinus node
depolarization), or the instantaneous heart rate is determined.
10

Simple timedomain variables that can be calculated include the mean NN


interval, the mean heart rate, the difference between the longest and shortest NN
interval, the difference between night and day heart rate, etc.

Other timedomain measurements that can be used are variations in


instantaneous heart rate secondary to respiration, tilt, Valsalva manoeuvre, or
secondary to phenylephrine infusion. These differences can be described as either
differences in heart rate or cycle length.

Statistical methods:

From a series of instantaneous heart rates or cycle intervals, particularly


those recorded over longer periods, traditionally 24 h, more complex statistical
time-domain measures can be calculated. These may be divided into two classes, (a)
those derived from direct measurements of the NN intervals or instantaneous heart
rate, and (b) those derived from the differences between NN intervals. These
variables may be derived from analysis of the total electrocardiographic recording
or may be calculated using smaller segments of the recording period. The latter
method allows comparison of HRV to be made during varying activities, e.g. rest,
sleep, etc

The simplest variable to calculate is the standard deviation of the NN interval


(SDNN), i.e. the square root of variance. Since variance is mathematically equal to
total power of spectral analysis, SDNN reflects all the cyclic components
responsible for variability in the period of recording. In many studies, SDNN is
calculated over a 24-h period and thus encompasses both short-term high frequency
variations, as well as the lowest frequency components seen in a 24-h period. As the
period of monitoring decreases, SDNN estimates shorter and shorter cycle lengths.
It should also be noted that the total variance of HRV increases with the length of
analysed recording. Thus, on arbitrarily selected ECGs, SDNN is not a well-defined
statistical quantity because of its dependence on the length of recording period.
Thus, in practice, it is inappropriate to compare SDNN measures obtained from
recordings of different durations. However, durations of the recordings used to
11

determine SDNN values (and similarly other HRV measures) should be


standardized. As discussed further in this document, short-term 5-min recordings
and nominal 24 h long-term recordings seem to be appropriate options. Other
commonly used statistical variables calculated from segments of the total
monitoring period include SDANN, the standard deviation of the average NN
interval calculated over short periods, usually 5 min, which is an estimate of the
changes in heart rate due to cycles longer than 5 min, and the SDNN index, the
mean of the 5-min standard deviation of the NN interval calculated over 24 h, which
measures the variability due to cycles shorter than 5 min. The most commonly used
measures derived from interval differences include RMSSD, the square root of the
mean squared differences of successive NN intervals, NN50, the number of interval
differences of successive NN intervals greater than 50 ms, and pNN50 the
proportion derived by dividing NN50 by the total number of NN intervals. All these
measurements of short-term variation estimate high frequency variations in heart
rate and thus are highly correlated.

CHAPTER 3. HRV MEASUREMENTS AND WIRELESS


TRANSMISSIONS:
In this section, the algorithm used to measure the HRV analysis is explained.
Wireless Transmission techniques used to send and receive ECG data are also
explained.

3.1 PAN TOMPKINS ALGORITHM


Pan and Tompkins proposed a real-time QRS detection algorithm based on
analysis of the slope, amplitude and width of QRS complexes. The algorithm
includes a series of filters and methods that perform lowpass, highpass, derivative,
squaring, integration, adaptive thresholding and search procedures Fig.3.1 In this
12

paper we implemented the Pan-Tompkins algorithm for QRS detection in


LabVIEW.

FIG.3.1 BLOCK DIAGRAM OF THE PAN-TOMPKINS ALGORITHM FOR


QRS DETECTION.
1 2 3 4
1: Band pass filter 2: Differentiator

3: Squaring operation 4 Moving-window integrator

The signal passes through filtering; derivation, squaring, and integration


phases before thresholds are set and QRS complexes are detected. In the first step
the algorithm passes the signal through a low pass an d a high pass filter in order to
reduce the influence of the muscle noise, the power line interference, the baseline
wander and the T-wave interference.

BAND PASS FILTER:

The band pass filter for the QRS detection algorithm reduces noise in the
ECG signal by matching the spectrum of the average QRS complex. This attenuates
noise due to muscle noise, power line interference, baseline wander, T wave
interference. The pass band that maximizes the QRS energy is in the 5Hz-35Hz
range. The filter implemented in this algorithm is composed of cascaded high pass
and low pass Butterworth IIR filters

LOW PASS FILTER:


13

The recursive lowpass filter used in the Pan-Tompkins algorithm has integer
coefficients for reducing computational complexity The output y(n) is related to the
input x(n) as:

1
y(n)=2y(n-1) y(n-2) + [x(n)-2x(n-6)+x(n-1)]
32

With the sampling rate being 200 Hz, the filter has a rather low cutoff
frequency of fc=11Hz, and introduces a delay of 5 samples or 24ms. The filter
provides attenuation greater than 35dB at 60Hz, and effectively supress power-line
interference, if present.

HIGH PASS FILTER:

The highpass filter used in the algorithm is implemented as an all pass filter
minus a lowpass filter. The output y(n) of the high pass filter is given by the
difference equation

y(n) =y(n-1) 1/32x(n)-x(n-16)-x(n-17)+1/32x(n-32)

Where x(n) and y(n) are input and output respectively. The high pass filter
has a cut-off frequency of 5Hz and introduces a delay of 80ms.

DERIVATIVE OPERATOR:

The derivative operation used by Pan and Tompkins is specified as:

1
y ( n )= [2x(n)+x(n-1) x(n-2) 2x(n-3)]
8

d
and approximates the ideal operator up to 30 Hz. The derivative
dx
procedure suppresses the low frequency components of the P and T waves, and
provides a large gain to the high-frequency components arising from the high slopes
of the QRS complex.
14

SQUARING:

The squaring operation makes the result positive and emphasizes large
differences resulting from QRS complexes; the small differences arising from P and
T waves are suppressed. The high frequency components in the signal related to the
QRS complex are further enhanced.

THRESHOLD:

Here the Threshold Peak detection is done to find the peaks and valleys of
ECG Signal. Since the Signal is passed through the High Pass Filter, the baseline
drift is eliminated.. Hence the Threshold Detection of Peak is enough.

3.2 IMPLEMENTATION OF PAN TOMPKINS ALGORITHM:

3.2.1. BLOCKS USED IN LABVIEW:


1. FILTER EXPRESS VI:

Owning Palette: Signal Analysis Express VIs

Requires: Full Development System


15

Processes signals through filters and windows.

This Express VI is configured as

TABLE 3.1 FILTER EXPRESS VI PARAMETERS

PARAMETERS VALUE

Filter type Bandpass

Upper cut-off 27Hz

Lower cut-off 5Hz

IIR/FIR Infinite Impulse Response(IIR) filter.

Topology Butterworth

Order 4
(Refer:Appendix for further detail)

2. TIME DOMAIN MATH EXPRESS VI:

Owning Palette: Arithmetic & Comparison Express VIs

Requires: Base Development System

Performs One of several math functions on time domain signals.

This VI is configured as

Math Operation: Differential

Calculation Mode: Continuous Calculation.


16

3. WA MULTISCALE PEAK DETECTION (WAVEFORM)

Owning Palette: Feature Extraction VIs

Requires: Advanced Signal Processing Toolkit

Uses multiresolution wavelet analysis to detect peaks or valleys in a signal.


Wire data to the signal input to determine the polymorphic instance to use or
manually select the instance.

4. MEAN VI

Owning Palette: Probability & Statistics VIs

Requires: Base Development System

Computes the mean of the values in the input sequence X.

3.2 PAN TOMPKINS ALGORITHM IN LABVIEW:


Pan Tompkins implementation is shown in the fig.3.2. Here the data is
taken from already prestored location. Then it is filtered and initial transient
response region is truncated. The filter used is band pass filtered with cut off
frequency between 5Hz and 27Hz. Then the derivative of the signal is found and
then the Waveform Peak detection is done .The peak value detection is done by
threshold method. The peak of first five peaks is calculated and average is taken.
Then the half of the peak value is taken as the threshold value. Thus the peak values
are estimated and stored in the array. Then the alternate Peak locations are
subtracted to get the HRV value. From HRV analysis, various parameters such as
NN50, SDNN can be estimated. The Labview diagram of this algorithm is shown in
fig.3.2
17

FIGURE 3.2 BLOCK DIAGRAM OF PAN TOMPKINS ALGORITHM


18

3.3 HARDWARE DESIGN:

FIGURE 3.3 BLOCK DIAGRAM OF WIRELESS HRV ANALYSIS

3.3.1 DATA ACQUISTION:-AD8232


The ECG data is acquired using AD8232 which is a single lead electrode.
The ECG data is acquired using AD8232 which is a single lead electrode. The
AD8232 is an integrated signal conditioning block for ECG and other bio potential
measurement applications. It is designed to extract, amplify, and filter small
biopotential signals in the presence of noisy conditions, such as those created by
motion or remote electrode placement. This design allows for an ultralow power
analog-to-digital converter (ADC) or an embedded microcontroller to acquire the
output signal easily. The AD8232 can implement a two-pole high-pass filter for
eliminating motion artifacts and the electrode half-cell potential. This filter is tightly
coupled with the instrumentation architecture of the amplifier to allow both large
gain and high-pass filtering in a single stage, thereby saving space and cost. An
uncommitted operational amplifier enables the AD8232 to create a three-pole low-
pass filter to remove additional noise. The user can select the frequency cut off of all
filters to suit different types of applications.
19

To improve common-mode rejection of the line frequencies in the system and


other undesired interferences, the AD8232 includes an amplifier for driven lead
applications; such as right leg drive (RLD).The AD8232 includes a fast restore
function that reduces the duration of otherwise long settling tails of the high-pass
filters. After an abrupt signal change that rails the amplifier (such as a leads off
condition), the AD8232 automatically adjusts to a higher filter cutoff. This feature
allows the AD8232 to recover quickly, and therefore, to take valid measurements
soon after connecting the electrodes to the subject.The AD8232 is available in a 4
mm 4 mm, 20-lead LFCSP package. Performance is specified from 0C to 70C
and is operational from 40C to +85C.

FIGURE 3.4 AD8232


This sensor is connected by means of jumper wires to the analog inputs of Arduino
UNO.
20

3.3.2 PROCESSING HARDWARE-ARDUINO UNO


The arduino microcontroller is an easy to use yet powerful single board
computer that hasgained considerable traction in market. The arduino is aopen source,
which means hardware is reasonably priced and development software is free.

The Arduino Uno is a microcontroller board based on the ATmega328 . It has


14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog
inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header,
and a reset button. It contains everything needed to support the microcontroller;
simply connect it to a computer with a USB cable or power it with a AC-to-DC
adapter or battery to get started. The Uno differs from all preceding boards in that it
does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega16U2
(Atmega8U2 up to version R2) programmed as a USB-to-serial converter.

An important feature of Arduino is that you can create a program on the host
pc, download it to arduino. Remove the USB cable connection to the pc and the
program still runs

Each of the 14 digital pins on the Uno can be used as an input or output, using
pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each
pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 kOhms. In addition, some pins have specialized
functions.

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-
TTL Serial chip. External Interrupts: 2 and 3. These pins can be configured to trigger
an interrupt on a low value, a rising or falling edge, or a change in value. See the
attachInterrupt() function for details.

.
21

TABLE.3.2. ARDUINO SPECIFICATIONS

PARAMETER ATMEGA328

Operating Voltage 5V

Input Voltage 7-12v

Input Voltage (limits) 6-20V

Digital I/O Pins 14 (of which 6 provide


PWM output)

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V 50 Ma


Pin

Flash Memory 32 KB (ATmega328) of


which 0.5 KB used by
bootloader

SRAM 2 KB (ATmega328)

EEPROM 1 KB (ATmega328)

Clock Speed 16 MHz


22

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function. SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library. LED: 13. There is a built-in LED connected to
digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's
off. The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10
bits of resolution (i.e. 1024 different values). By default they measure from ground to
5 volts, though is it possible to change the upper end of their range using
the AREF pin and the analog Reference() function.

FIGURE 3.5 ARDUINO UNO BOARD

3.3.3 RF TRANSCEIVER:-NRF24L01+
The Nordic nRF24L01+ is a highly integrated, ultra low power (ULP) 2Mbps
RF transceiver IC for the 2.4GHz ISM (Industrial, Scientific and Medical) band.
With peak RX/TX currents lower than 14mA, a sub A power down mode,
advanced power management, and a 1.9 to 3.6V supply range, the nRF24L01+
provides a true ULP solution enabling months to years of battery life from coin cell
or AA/AAA batteries. The Enhanced ShockBurst hardware protocol accelerator
offloads time critical protocol functions from the application microcontroller
enabling the implementation of advanced and robust wireless connectivity with low
cost 3rd-party microcontrollers.
23

The Nordic nRF24L01+ integrates a complete 2.4GHz RF transceiver, RF


synthesizer, and baseband logic including the Enhanced ShockBurst hardware
protocol accelerator supporting a high-speed SPI interface for the application
controller. No external loop filter, resonators, or VCO varactor diodes are required,
only a low cost 60ppm crystal, matching circuitry, and antenna.

The nRF24L01+ is available in a compact 20-pin 4 x 4mm QFN package.

3.4 HARDWARE WORKS DONE:


The ECG data collected from AD8232 is connected to the arduino UNO
The protocol is written in Transmitter and Receiver Side of NRF24L01+ by
connecting it with the arduino which is connected to AD8232
In the receiver side , the data are collected and stored as a separate text file
This file is processed using LABVIEW 2015.

FIGURE 3.6 ARDUINO CONNECTIONS TO NRF TRANSCEIVER


24

CHAPTER 4. RESULT AND DISCUSSIONS:

4.1 SIMULATION RESULT:


The data is taken from the physionet and the algorithm developed in the LABVIEW
is tested .The test results are given below:
25

FIG.4.1 A.SIMULATION RESULT FROM PHYSIONET DATA

Fig4.1.B. SIMULATION RESULT FROM PHYSIONET DATA

TABLE 4.1: COMPARISION OF CALCULATED AND ACTUAL VALUE.

Parameters Calculated value Actual Value (from


Physionet)

RR Mean 0.62 0.68

SDNN 0.07 0.09


26

Heart Rate (Average) 98.71 96.53

RMSSD 0.035295 0.043

NN50 161 168

From the above value , the proposed algorithm in the labview works well
with less errors.

4.2 AD8232 WIRED CONNECTION:


In order to test the AD8232 , it is directly connected with the help of DAQ
card or Arduino. If Arduino is used , then the MakerHub Linx firmware can be used
to directly interface the arduino with Labview .Otherwise the already available data
can be used.
27

FIG4.2 A.RECEIVED DATA ANALYSIS

FIG4.2 B.RECEIVED HRV DATA


Due to Artifact presence, the HRV is found to be 62.07 which is below the
range .Using Artifact removal , the HRV value can be increased.
28

On Hardware part, the Arduino is transmitting the data wireless to master


server .Due to the transmitted delays , there is lot of artifacts associated with them.

FIG4.3 WIRLESS HRV DATA FROM RECEIVED DATA

CHAPTER 5. CONCLUSION AND FUTURE WORK:

5.1 CONCLUSION
ECG data is collected using the ECG sensors ( AD8232) and it is interfaced
with the PC using DAQ card. Then the sensor is connected with the help of arduino
to NRF module which transmit and receive the data. On analysis of data it is found
that the algorithm works well for artifact removed data. But if the data is corrupted
by artifact , it affects the heartbeat and HRV calculation heavily. Even though the
data is transmitted and received successfully, it is corrupted by missing of data and
29

artifacts. Therefore the artifact removal algorithm should be included in the program
to make the HRV analysis reliable.

5.3 FUTURE WORK:


1. Testing of sensor using Arduino and the compact wearable module using
microcontroller is to be done.

2. Using NRF24L01+ RF modules, compact wearable wireless module which can


transmit the ECG data to a receiver module connected to PC is to be designed.

3. From PC, the data can be uploaded in the website for IOT.

4. Bluetooth based wireless transmission to mobile phone and developing an Android


App for sending SMS about ECG data.

APPENDIX:

I. LABVIEW COMPONENTS AND DESCRIPTION:


1. FILTER EXPRESS VI:

Owning Palette: Signal Analysis Express VIs

Requires: Full Development System

Processes signals through filters and windows.


30

Contains the following options:

TABLE I.1 FILTER VI PARAMETERS

PARAMETERS DESCRIPTION

Cutoff Frequency (Hz) Specifies the cutoff frequency of the


filter. This option is available only
when you select Lowpass or Highpass
from the Filtering Type pull-down
menu. The default is 100.

Low Cutoff Frequency (Hz) Specifies the low cutoff frequency of


the filter. Low cutoff frequency (Hz)
must be less than High cutoff frequency
(Hz) and observe the Nyquist criterion.
The default is 100. This option is
available only when you select
Bandpass or Bandstop from the
Filtering Type pull-down menu.

Specifies the high cutoff frequency of


the filter. High cutoff frequency (Hz)
31

must be greater than Low cutoff


frequency (Hz) and observe the Nyquist
High Cutoff Frequency (Hz) criterion. The default is 400. This
option is available only when you select
Bandpass or Bandstop from the
Filtering Type pull-down menu.

Creates an FIR filter, which depends


only on the current and past inputs.
Because the filter does not depend on
past outputs, the impulse response
decays to zero in a finite amount of
time. Because FIR filters return a linear
phase response, use FIR filters for
applications that require linear phase

Finite Impulse Response (FIR) Filter responses.

Specifies the total number of FIR


coefficients, which must be greater than
zero. The default is 29. This option is
available only when you select the
Taps Finite impulse response (FIR) filter
32

option. Increasing the value of Taps


causes the transition between the
passband and the stopband to become
steeper. However, as the value of Taps
increases, the processing speed
becomes slower.

Infinite impulse response (IIR) filter Creates an IIR filter that is a digital
filter with impulse responses that can
theoretically be infinite in length or
duration.

Determines the design type of the filter.


You can create either a Butterworth,
Chebyshev, Inverse Chebyshev,
Elliptic, or Bessel filter design. This
option is available only when you select
the Infinite impulse response (IIR) filter

Topology option. The default is Butterworth.


33

Order of the IIR filter, which must be


greater than zero. This option is
available only when you select the
Infinite impulse response (IIR) filter
option. The default is 3. Increasing the
value of Order causes the transition

Order between the passband and the stopband


to become steeper. However, as the
value of Order increases, the processing
speed becomes slower, and the number
of distorted points at the start of the
signal increases

Moving average Yields forward-only (FIR) coefficients.


This option is available only when you
select Smoothing from the Filtering
Type pull-down menu.

Specifies that all samples in the


moving-average window are weighted
equally in computing each smoothed
output sample. This option is available
34

only when you select Smoothing from


the Filtering Type pull-down menu and
Rectangular the Moving average option.

Specifies that the moving weighting


window applied to the samples is
triangular with the peak centered in the
middle of the window, ramping down
symmetrically on both sides of the
center sample. This option is available
only when you select Smoothing from
the Filtering Type pull-down menu and

Triangular the Moving average option.

Exponential Yields first-order IIR coefficients. This


option is available only when you select
Smoothing.

.
35

Specifies the time constant of the


exponential-weighting filter in seconds.
The default is 0.001. This option is
available only when you select
Time Constant Of Exponential Average Smoothing from the Filtering Type
pull-down menu and the Exponential
option.

2.Time Domain Math Express VI:

Owning Palette: Arithmetic & Comparison Express VIs

Requires: Base Development System

Performs one of several math functions on time domain signals.

Mathematical Operation Contains the following options:

TABLE I.2 TIME DOMAIN MATH VI PARAMETERS

Parameters Description
36

Returns the numeric derivative


of the signal. LabVIEW
computes the output sample of
dX/dt at index i as

yi=(xi xi1)/dt.
Derivative (dX/dt)

Difference (dX) Returns the numeric difference


of the signal. LabVIEW
computes the output sample of
dX at index i as yi=xixi1.

Integral (Sum[Xdt]) Returns the numeric integral of


the signal. LabVIEW computes
the output sample of Sum[Xdt]
at index i as yi=yi1 + xidt.

Summation (Sum[X]) Returns the summation of the


signal. LabVIEW computes the
output sample of Sum[X] at
index i as yi=yi1 + xi.
Calculation Mode Contains the following options:

Continuous calculationUses data from previous segments of data in


performing the calculation.
Per segment calculationDoes not use data from previous segments
of data in performing the calculation.

Result Name Contains the following options:


37

Use mathematical operation nameDisplays the name of the


mathematical operation as the name of the Express VI on the block
diagram.
Express VI nameDisplays the name of the Express VI on the block
diagram. Remove the checkmark from the Use mathematical
operation name checkbox to edit the name of the Express VI.

Input Signal displays the input signal. If you wire data to the Express VI and
run it, Input Signal displays real data. If you close and reopen the Express VI, Input
Signal displays sample data until you run the Express VI again.

Result Preview displays a preview of the measurement. The Result Preview


plot indicates the value of the selected measurement with a dotted line. If you wire
data to the Express VI and run it, Result Preview displays real data. If you close and
reopen the Express VI, Result Preview displays sample data until you run the VI
again. If the cutoff frequency values are invalid, Result Preview does not display
valid data.

3.WA Multiscale Peak Detection (Waveform)

peaks/valleys specifies whether this VI looks for peaks or valleys in


the signal. The default is peaks.
signal specifies the input signal.
threshold specifies the threshold this VI uses to reject peaks or valleys
of a particular size. If this VI looks for peaks, this VI ignores peaks
with a peak amplitude less than threshold. If this VI looks for valleys,
this VI ignores valleys with a valley amplitude greater than threshold.
If detrend is TRUE, this VI rejects peaks or valleys below the
threshold in the detrended signal. If detrend? is FALSE, this VI rejects
peaks or valleys below the threshold in the signal.
width specifies the width, in number of samples, of the peaks or
valleys. This VI coerces the value to a power of 2. Refer to the Details
38

section for more information about how this VI uses width to control
the decomposition level.
error in describes error conditions that occur before this node runs.
This input provides standard error in functionality.
detrend settings specifies the settings this VI uses to remove the trend
from the signal. detrend specifies whether this VI removes the trend
from the signal. The default is FALSE, which means this VI does not
remove the trend.
threshold frequency specifies the upper frequency limit, in hertz, of
the trend that this VI removes from the signal. The threshold
frequency determines the wavelet transform level. The wavelet
transform level specifies the number of levels in the discrete wavelet
analysis. The wavelet transform level is floor(log2[sampling rate/
(2*threshold frequency)]). The floor function rounds a value to the
nearest integer towards negative infinity. The default is 1, which
means this VI sets the threshold frequency automatically.
number of peaks returns the number of peaks or valleys this VI
detects.
location returns the locations of the peaks or valleys this VI detects.
amplitude returns the amplitudes of the peaks or valleys this VI
detects.
peak plot returns the signal and the peaks or valleys this VI detects. If
detrend is TRUE, peak plot also returns the trend of the input signal.
You can plot this information on an XY graph.
error out contains error information. This output provides standard
error out functionality.

4.Mean (DBL)

X is the input sequence. If the input sequence X is empty, mean is


NaN.
mean is the mean, or average, of the values in the input sequence X.
39

error returns any error or warning from the VI. You can wire error to
the Error Cluster From Error Code VI to convert the error code or
warning into an error cluster.

II.ARDUINO CODING:
TRANSMITTER SIDE:

#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>

RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int msg = 1;

void setup(void){
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();
}
void loop(void){
if (radio.available()){

radio.read(&msg,1);
Serial.println(msg);

}
}

RECEIVER SIDE:

#include <SPI.h>

#include <nRF24L01.h>

#include <RF24.h>
40

#include <RF24_config.h>

int sensorPin = A0;

int sensorValue = 0;

RF24 radio(9,10);

const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(void){

Serial.begin(9600);

radio.begin();

radio.openWritingPipe(pipe);}

void loop(void){ sensorValue = analogRead(sensorPin);

radio.write(&sensorValue,sizeof(sensorValue));

radio.powerDown();

radio.powerUp();

REFERENCES:

1. Alexander M. Chan, Nandakumar Selvaraj, Nima Ferdosi, and Ravi


Narasimhan Wireless Patch Sensor for Remote Monitoring of Heart
41

Rate,Respiration, Activity, and Falls in Eng. in Med. and Biol. Society,


Conference of the IEEE EMBS,2013,pp.6115-6118.

2. Hyung Wook Noh, Yongwon Jang, I.B. Lee, Yoonseon Song, Ji-Wook Jeong,
Sooyeul Lee A Preliminary Study of the Effect of Electrode Placement in
Order to Define a Suitable Location for Two Electrodes and Obtain
Sufficiently Reliable ECG Signals When Monitoring with Wireless System
in Conf Proc IEEE Eng Med Biol Soc. ,2012.

3. C. Li, C. Zheng, and C. Tai, Detection Of Ecg Characteristic Points Using


Wavelet Transforms, Biomed. Eng., IEEE Trans. on, vol. 42, no. 1, pp.21
28, 1995.

4. S. Abboud, O. Barnea, Errors Due to Sampling Frequency of the


Electrocardiogram in Spectral Analysis of Heart Rate Signals with Low
Variability Computers in Cardiology ,Conference of the IEEE 1995,pp.no:461
- 463

Das könnte Ihnen auch gefallen