Nothing Special   »   [go: up one dir, main page]

Ganesan 2018

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

2018 3rd IEEE International Conference on Recent Trends in Electronics, Information & Communication Technology (RTEICT-2018), MAY 18th

& 19th 2018

REAL TIME ECG MONITORING SYSTEM


USING RASPBERRY PI
Ganesan. M Sudheeshna. S
Department of Electronics and Communication Engineering, Department of Electronics and Communication Engineering,
Amrita School of Engineering, Coimbatore, Amrita School of Engineering, Coimbatore,
Amrita Vishwa Vidyapeetham, India Amrita Vishwa Vidyapeetham, India
Adithya Krishnan Lavanya Sai Narayanan
Department of Electronics and Communication Engineering, Department of Electronics and Communication Engineering,
Amrita School of Engineering, Coimbatore, Amrita School of Engineering, Coimbatore,
Amrita Vishwa Vidyapeetham, India Amrita Vishwa Vidyapeetham, India

Abstract— In this paper, we aim to develop a real-time ECG complex can provide substantial information on the working
monitoring system that records a noise free signal. This is of the heart. The height of the R peak and the R-R interval is
accomplished by amplifying the acquired signal, filtering out the imperative to the diagnoses of the condition of the patient’s
noises by employing higher order filters. This system is a perfect heart. Basic abnormalities of any sort can be found by
blend of electronics, embedded hardware and bio-potential signal
analyzing the width and height of the QRS waves in the ECG.
by making use of open source software, Raspberry pi, to display the
filtered ECG signal that has been acquired directly from the For diagnoses of more complex diseases other smaller waves
subject’s body. Thereby, we propose a device that can acquire and in the ECG, like P, T and U wave needs to be observed.
monitor real time ECG signal and display the signal in a display The processed noise free signal is then converted from Analog
screen using Raspberry Pi. to Digital Signal by employing MCP3008. The digital signal is
plotted in the display using Raspberry Pi. This makes the ECG
Keywords— LPF, HPF, Notch filter, power line interference, system compact, portable and easily accessible unlike the ECG
Baseline wander, ADC, MCP3008, DSO circuit that uses a DSO/CRO for displaying its signals. The
signal is displayed in a compact display screen, like LCD,
I. INTRODUCTION after processing using raspberry pi [5].
The Electrocardiogram signal is generated due to the Our aim in this project is twofold: To design and implement a
contractions of the heart. It represents the electrical activities low cost ECG device in comparison to those available in the
occurring in the muscles of the heart. The potentials from market and to design an easily accessible, compact device that
various nodes of the heart combine to create the ECG signal. can be used in today’s clinics and hospitals.
ECG devices use electrodes to convert ionic signals to
electrical signals that can be displayed in a way that is visible
to the naked eye, which can further be used for monitoring and
diagnosing of underlying heart diseases [1].
An ECG device performs certain activities like removal of
external and internal noise. The signal is amplified by making
use of an instrumentation amplifier while the filtering is
accomplished by a low pass filter [LPF] and high pass filter
Fig 1. The Proposed ECG system
[HPF] and a notch filter. The amplifying and filtering of ECG
signal is extremely essential as the signal acquired from the
subject’s body is contaminated with noise that arises due to II. LITERATURE SURVEY
many factors such as power line interference, baseline wander, In real time ECG signals obtained from the human body are
high frequency noise and electromyography noise that is contaminated with noise. The signal needs to be filtered in
caused due activities in the muscle. These noises must be order to record and analyze the signal. In the papers [2], [7],
eliminated to distinctively see and analyze the QRS waves [2]. the various noises that contaminate the ECG signal have been
In this paper, the real time ECG signal acquired from the discussed. The three major noises that seem to make its way
subject’s body is sent through a pre amplifier, a 9 th order low into all ECG signals are as follows:
pass filter and high pass filter that will eliminate internal and  Power-line interference Noise (PLI): PLI is one of the
external noise interferences and a 50-60 Hz notch filter that major elements when it comes to disturbances in the
will effectively remove the 50Hz power line noise that is ECG signal. The electromagnetic interferences
prominent in most ECG signals [3]. corrupt the quality of the signal and perturb the small
Analyses for the ECG signal are one of the most prominent yet essential parts of the signal that may be critical for
methods of diagnosing heart diseases. The underlying QRS examining and diagnosis.

978-1-5386-2440-1/18/$31.00 ©2018 IEEE


1092
 Baseline Wander (BW): Minor activities performed transducer consists of a pair of electrodes. The signal is
by the subject like breathing, moving can cause acquired from the subject’s body using a 3-lead electrode pads.
changes in the electrode-skin impedance leading to This method is used regularly in health care monitoring of
baseline wander. The frequency range for BW is
generally less than 0.1 Hz. Baseline wander is created
by altercations in electrode-to-skin polarization
voltages, or by respiration, or by movement in the
electrode, or by muscle movement.
 Electromyography noise (EMG): EMG is caused due
to the contractions of the heart muscles.
Depolarization and repolarization waves are created
when muscles surrounding the electrodes contract. Fig 2. Electrode pads
These waves are then selected and taken up by the
ECG. people who are subjected to some form of cardiac problems.
Other noises like contact noise and instrumentation noise are It is much simpler to use and helps pick up aberrant electrical
also a common occurrence. Although these noises are activities in the heart, wherein a 12 lead ECG picks up
impossible to remove, it can be reduced by proper circuiting interferences surplus to requirements.
and use of better equipment. The electrodes then convert the ECG into electrical voltages
Possible ways to remove, or at least minimize, such noises which can be later passed through the instrumentation
have been discussed in papers [3], [6], [10]. The papers amplifier [8].
propose different high order filters in order to remove the
noise present in the ECG. We employ a low pass Butterworth
filter. The Butterworth filter has a completely flat frequency B. Instrumentation Amplifier
response, this is because the pass band is designed in such a The peak voltages that corresponds to the ECG waveform is
way so as to produce a flat response from 0 Hz till -3dB which characteristically 1mV.Therefore the acquired ECG signal has
is at the cut- off point followed by zero ripples. Frequencies to amplified before it can be fed to the filter circuits and
above the cut-off point drizzle down to zero in the stop band at displayed. For this we make use of the instrumentation
20dB/decade. amplifier [3].
The Raspberry Pi board was used for processing and Instrumentation Amplifier is a differential op-amp that
displaying the acquired ECG signal after studying the papers provides high input impedance by adjusting a single resistor.
[5], [14]. The Pi was chosen over a Microcontroller, because a The designed instrumentation amplifier has a gain of 20. A
microcontroller can run one program at a time, while standard instrumentation amplifier circuit requires a CMRR of
Raspberry Pi works with Linux operating system and can run at least 60dB. A potentiometer has been added to the circuit to
multiple programs simultaneously. Internet connectivity is adjust the amplifier to maximize the CMRR value. The CMRR
much easier in Pi in comparison to other microcontrollers. value after improvisation using potentiometer is 80 dB [4].
Various programming languages like C, C++, Java and Python
can be used for programming in Pi. The Pi allows you to work
in GUI mode easily as it have HDMI port and has server based
applications. All these features of the Raspberry Pi make it the
most suitable option for displaying the acquired ECG signal.

III. CIRCUIT DESIGN


The ECG device consists majorly of three portions: acquiring,
processing and displaying the ECG signal. The signal is
obtained from the body using 3 Lead ECG pads and is send to
the circuit board that consists of an instrumentation amplifier,
LPF, HPF and a notch filter. The output of the notch filter can
be connected to a DSO to view the ECG. The output can also
be passed to the MCP3008 that is connected to the raspberry pi
board. The Pi is programmed, using Python programming
language, to display the acquired signal in a display screen, in Fig 3. Instrumentation Amplifier Circuit Design
this case a LED screen. The methodology is explained in detail
below. Gain A = (1+ 2R3/Rg) * (R2/R1)
R1=R2=RG=10KΩ; R3= 100kΩ;
A. 3 Lead ECG A = 21
The ECG signal is recorded with the help of a transducer that
can convert bio potential signals into electrical potentials. This C. Low Pass Filter

1093
The LPF is used to remove the high frequency components in Gain = 8.72; cut off frequency = 0.5Hz
the ECG. By implementing the low pass filter we can remove To accomplish this we make use of a 9th order Butterworth
the noise caused due to factors like power line interference and high pass filter with a cut off frequency of 0.1Hz. We design a
electromyography noise. This filter has a considerable affect 9th order filter because by increasing the degree of freedom
on the QRS complex [4]. there is sharpness in the transition between attenuated and
A 9th order LPF with cut off frequency of 100 Hz is designed. preserved frequencies. The frequency response in the stop-
Therefore on passing through it, any signal that has frequency band, band-pass is flatter when the degree increases which
above 100 Hz will be eliminated. The cut off frequencies that causes improved amplitude conservation [2].
are used for the filters have been chosen because it has been
noted that the clinical ECG frequencies lie in the range 0.1- E. Notch Filter
100 Hz [2]. The notch filter is used to attenuate the power over a narrow
range. In this case, the notch filter is designed at 50 Hz and is
used to remove the power line noise causing the least amount
of disturbance to the remaining signal.
The notch filter is designed at 50-60 Hz because the AC
frequency in India is 50 Hz. Thus this can remove the noise
due to power supply interferences [5].

Fig 4. 9th Order Butterworth LPF Design.

Gain= 8.72; Cut off frequency = 100 Hz

D. High Pass Filter


The high pass filter [HPF] is used to remove low frequency
components in the ECG. Through high pass filters we can Fig 6. Notch Filter Design
eliminate noise created by baseline wander that mainly arise
Gain= 1.9; cut off frequency = 50Hz
from muscle movement, respiration, etc [7].
To accomplish this we make use of a 9th order Butterworth
F. MCP3008
high pass filter with a cut off frequency of 0.1Hz. We design a
The MCP3008 is a 10 bit analogue to Digital Converter
9th order filter because by increasing the degree of freedom
(ADC). It is capable of converting 8 channel inputs into a 10
there is sharpness in the transition between attenuated and
bit digital value, the maximum value that can be represented
preserved frequencies. The frequency response in the stop-
by this 10-bit ADC. MCP3008 takes just 3.3V (which can be
band, band-pass is flatter when the degree increases which
provided by the Raspberry Pi itself) for functioning; it uses
causes improved amplitude conservation [2].
Serial Peripheral Interface (SPI) bus for establishing a
synchronous serial communication between master and slave.
It can convert 75 kilo samples to 200 kilo samples per second.
Their conversion rate of the signal decides its sampling rate,
conversion rate can be software programmed to provide
samples at every sampling interval. The MCP3008 is designed
with 28 PDIP and SOIC packages [11].

G. Raspberry Pi
The Raspberry Pi 3 Model B is the latest version of the
Raspberry Pi computer. The Pi isn't like the typical machine,
in its cheapest form it doesn't have a case, and is simply a
credit-card sized electronic board [5].
The 3.5mm audio jack output of the electrode probe is
Fig 5. 9th Order Butterworth HPF Design connected to the instrumentation amplifier through an adapter.
This probe will yield an optimum output and less complicated

1094
than a 12 lead electrode system. The Analog output of the
Amplifier is given to the filters and from the MCP3008 to the
Raspberry Pi. The connections between the Raspberry Pi and
the other parts can be made via Male-to Female jumper wires
or via one of Adafruit’s Pi cobbler kits.
The signal obtained, on further coding using Python, is
displayed in an LED screen. Upon additional developments, the
ECG signal can be displayed on more updated and advanced
display systems [15].
Fig 9. Frequency Response of Notch Filter (Screenshots taken from DSO)

The sine wave used to plot the frequency response was later
changed to the ECG acquired from the body through electrode
pads. The electrode pads connected to the wrists of the subject
was given to the inputs of the instrumentation amplifier. The
third electrode pad connected to the ankle was given to the
ground of the circuit.
Once appropriate connections were made, the signal from the
subject was recorded. The following was the recorded ECG
signal. It can be seen from the results that the QRS complex is
visible while the P, T and U wave are not.
Fig 7. Connections between the MCP3008 and Raspberry Pi 3

IV. RESULT
The ECG signal is acquired from the body through 3 lead pads
is sent through an instrumentation amplifier. The amplifier is
designed to have a gain of 20. The CMRR value when
designed had a value of 60 dB, after adding potentiometer the
CMRR value is increased to a value of 80 dB.
The signal is later passed onto a low pass filter with cut off
frequency 100Hz. The frequency response, when recorded in
the digital signal oscilloscope (DSO), was as follows: Fig 10. ECG signal recorded from the Subject 1

The signals recorded have noted to have amplitude around 1


Vp-p, and a time period of 800ms between each R peak.
The R peaks , from a subject, as recorded using raspberry pi 3
is:

Fig 8. Frequency Response of LPF (Screenshots taken from DSO)

The output of the low pass filter is send as the input of the
high pass filter. The high pass filter is designed with cut off
frequency of 0.1Hz and the frequency response for this filter Fig 11. R peaks displayed using Raspberry Pi 3
was too low to record.
The output of the high pass filter is then passed through the
Where, sampling rate is set as 300Hz.
notch filter designed to remove 50Hz noise. The frequency
response of the notch filter was recorded as follows:

1095
Hardware implementations: The system has tremendous amount of future scope in the field
of biomedical instrumentation. On further improvements in the
coding, we can not only display the signal, but also detect the
peaks of the signal, calculate the heart rate and monitor for any
anomalies in the heart beat.

ACKNOWLEDGMENT
The authors of this paper are very grateful for the support
and guidance from Amrita School of Engineering, Vishwa
Vidyapeetham, Coimbatore for providing us with the
necessary guidance, equipment and lab.
REFERENCES
Fig 12. Hardware implementation of Filter circuit
[1] Rangaraj M. Rangayyan, “Bio-Medical Signal Analysis, Wiley-
Interscience”, IEEE press, 2002.

[2] Haritha .C Ganesan, “.M A Survey on Modern Trends in ECG Noise


Removal Techniques”, International Conference on Circuit, Power and
Computing Technologies [ICCPCT], 2016.

[3] Sergio Franko, “Design with operational amplifiers and analog integrated
circuits”, Tata McGraw-Hill, Third Edition, 2010.

[4] J.G.Webster, “Medical Instrumentation: Application and Design”, Wiley


India, 2008.

[5] International Journal of Science and Engineering, Vol. No.6, Issue no.04,
April 2017, “RASPBERRY Pi based ECG Data Acquisition System”,
Fig 13. Hardware implementation of MCP3008 and Raspberry Pi 3 Ms.Gauravi.A.Yadav, Prof. Shailaja.S.Patil.

[6] Rashmi Panda, Umesh C. Pati, IEEE Students’ Conference on Electrical,


V. CONCLUSION “Removal of Artifacts from Electrocardiogram Using Digital Filter”, 2012.
The acquisition of ECG was executed using 3 Lead electrode
[7] Mr. Hrishikesh Limaye, Mrs.V.V. Deshmukh, “ECG Noise Sources and
pads. Acquisition of ECG signal is performed in real time so Various Noise Removal Techniques: A Survey”, IJAIEM, Volume 5, Issue 2,
that the system can be later used in the field of medicine. February, 2016.
In this paper, we have employed a bread board to implement
the circuit. When using the system in real life it can be [8]http://www.ems12lead.com/2014/03/10/understanding-ecg-filtering/
developed by printing the circuits in a PCB for compactness [9] http://www.medteq.info/med/ECGFilters
and accuracy. By implementing the circuit in PCB, noises that
are present in the ECG recorded can be reduced. This may [10] Dr. A. K. Wadhwani, Manish Yadav, “Filteration of ECG using various
increase the cost of the system, but it still remains cheaper Filter”, IJMER, Vol.1, Issue2.
than the ECG systems that currently available. [11] Simon Monk, “Programming The Raspberry Pi, Second Edition: Getting
The MCP3008 used is for converting the analog signal Started With Python”.
obtained from the circuit to digital so that it can be sent to the
Raspberry Pi for plotting. The display connected to the Pi [12] Adel S.Sedra , "Microelectronic circuits" sixth edition.
varies is a LED screen, but can on further development the [13] Dongsuk Jeon, Yen-Po Chen,University of Michigan, “An Implantable
ECG signal can be displayed in any advanced display screen 64nW ECG-Monitoring Mixed-Signal SoC for Arrhythmia Diagnosis”,
varying from a LCD display to a HDMI touch screen display. University of Michigan Health System.
This can be changed according to the requirements and the
[14] Ajitha T, Danymol.R, Gandhiraj R, "Real-Time Communication System
budget allotted for the system. Design using RTL-SDR and Raspberry Pi", International conference on
The Raspberry Pi is programmed for diagnoses of basic heart Advance Computing and Communication Systems (ICACCS2013), Sri Eswar
diseases by measuring the R peak, the R-R interval. The College of Engineering, Coimbatore, India, 19-21, December 2013
displaying of R peak using raspberry pi comes in handy as the
[15] Mehak Chhabra, Manik Kalsi, “Real Time ECG Monitoring System
end display device can be updated according to the latest based on Internet of Things”, IJSRP, IJSRP, Volume 7, Issue 8, August 2017
technology. Edition
Future work can include measuring the width and height of the
QRS complex. Further diagnoses can be provided if the
system is developed to analyze the features of the minor waves
such as P, T and U waves.

1096

You might also like