Ecg With Pic
Ecg With Pic
Ecg With Pic
A Thesis report
submitted towards the partial fulfillment of the
requirements of the degree of
Master of Engineering
in
Electronic Instrumentation and Control Engineering
submitted by
Ashish Kumar
Roll No-800851022
Acknowledgement
The real spirit of achieving a goal is through the way of excellence and austere discipline.
I would have never succeeded in completing my task without the cooperation,
encouragement and help provided to me by various personalities.
With deep sense of gratitude I express my sincere thanks to my esteemed and worthy
supervisor, Dr. Ravinder Agarwal, Associate Professor, Department of Electrical and
Instrumentation Engineering and Head USIC, Thapar University, Patiala and Mr. Sushil
Chandra Scientist E and Head Biomedical Engineering, INMAS DRDO, Delhi and for
their valuable guidance in carrying out this work under their effective supervision,
encouragement, enlightenment and cooperation. Most of the novel ideas and solutions
found in this thesis are the result of our numerous stimulating discussions. Their feedback
and editorial comments were also invaluable for writing of this thesis.
I shall be failing in my duties if I do not express my deep sense of gratitude towards Dr.
Smarajit Ghosh, Professor and Head of the Department of Electrical & Instrumentation
Engineering, Thapar University, Patiala who has been a constant source of inspiration for
me throughout this work.
I am also thankful to all the staff members of the Department for their full cooperation
and help.
This acknowledgement would be incomplete if I do not mention the emotional support
and blessings provided by my friends. I had a pleasant enjoyable and fruitful company
with them.
My greatest thanks are to all who wished me success especially my parents, my brother
and sisters whose support and care makes me stay on earth.
(Ashish Kumar)
Abstract
The Electrocardiogram (ECG) is an essential diagnostic tool that measure and record the
electrical activity of the heart. A wide range of heart conditions can be detected when
interpreting the recorded ECG signals. These qualities make the ECG a perfect instrument
for patient monitoring and supervision. The commonly used ECG machine used for
diagnosis and supervision at present is expensive and stationary. With the recent advance
in technology, there are possibilities to create a small sized wireless ECG system capable
of transmitting ECG signal via Bluetooth technology to a Laptop or PDA using
LABVIEW at low cost and at low power dissipation powered by a cellular phone battery.
In the present research work a small sized wireless ECG embedded system is developed
to make the patient more mobile without losing the reliability of the ECG sensor. It
consists of an amplifier, filtering, PIC microcontroller, Bluetooth Technology and
LABVIEW as a platform for wireless transmission. With the use of a PIC microcontroller
the analogue signal is digitally converted at a specific sample rate that based on the
resolution of the ECG-signals. The digital data will be transmitted to Laptop on Bluetooth
protocol where the digital signal can be processed in LABVIEW and graphically can be
displayed.
Table of Contents
Chapter
1.
Title
Page
Certificate
Acknowledgement
ii
Abstract
iii
Table of Contents
iv - vi
List of Tables
vii
List of Figures
viii - ix
List of Abbreviation
List of Appendix
xi
Introduction
1.1
Project Background
Literature Survey
2 -4
2.1
Related Projects
2.1.1
2.1.2
Micromedical
2.1.3
2.1.4
2.1.5
BlueNurse
Problem Statement
Theory
7 - 21
4.1
4.1.1
The Heart
4.1.2
4.1.3
History of Electrocardiogram
4.1.4
10
4.2
4.3
Electrode Theory
11
4.2.1
11
4.2.2
Electrodes
12
13
4.3.1
Bluetooth
13
13
14
ZigBee
16
16
Protocol Selection
17
4.3.2
4.3.3
4.4
5.
PIC Microcontroller
17
4.4.1
PIC16F877A
17
4.4.2
18
4.4.3
USART Module
19
20
20
Methodology
22 -36
5.1
Hardware Methodology
22
5.1.1
Electrode Placement
22
5.1.2
Instrumentation Amplifier
23
5.1.3
Power Supply
23
5.1.4
24
5.1.5
Notch Filter
25
5.1.6
Summing Amplifier
27
5.2
Software Methodology
28
5.2.1
28
6.
5.2.2
miKroC
29
5.2.3
30
5.2.4
31
5.2.5
USART Setting
32
5.2.6
LabVIEW2009
34
37 - 39
6.1
Results
37
6.2
Discussion
38
6.3
39
6.4
Summary
39
References
40
Appendix A
42
List of Tables
Table no.
Title
page
4.1
19
4.2
32
5.1
40
List of Figures
Figure no.
Title
page
2.1
2.2
FM Based ECG
3.1
4.1
4.2
4.3
4.4
4.5
10
4.6
10
4.7
12
4.8
12
4.9
Bluetooth Scatternet
14
4.10
15
4.11
16
4.12
18
5.1
22
5.2
23
5.3
23
5.4
24
5.5
25
5.6
26
5.7
27
5.8
27
5.9
29
5.10
miKroC IDE
30
5.11
30
5.12
31
5.13
32
5.14
32
5.15
33
5.16
35
5.17
36
6.1
37
6.2
38
List of Abbreviations
ECG
Electrocardiogram
PDA -
LabVIEW-
RISC -
CMRR -
IDFT -
ADC -
USART -
Universal Synchronous
Transceiver
UART -
and
Asynchronous
Receiver
and
List of Appendix
Appendix
A.
Title
Page
42
1
1.
Introduction
1.1
Project Background
2
2. Literature Survey
2.1 Related Projects
A project of interest includes PicoRadio [3] (developed at the Berkley Wireless Research
Centre) and is aimed at creating minimum energy networks of wireless nodes; however,
the bit rates here are too low for ECG applications. Another project named. Smart Dust
[4], being developed with similar aims, is running a very simple operating system named.
TinyOS, which uses a scheduler for multithreading between tasks. This idea is to be
incorporated into the design of the communications protocols.
There have been numerous attempts to develop a wireless ECG monitoring system where
the patient being examined is to be free of wires. Till now this has not been available in
the market. The first implementation encountered during research used a completely
different idea for a wireless ECG monitor. The following methods use a slightly different
implementation in that electrodes are physically connected together and then an ECG
signal is calculated. This processed data is transmitted wirelessly from the patient to a
mobile base station. The final implementation uses Bluetooth technology.
2.1.1 Heart Monitoring of clothed Person
The first implementation encountered uses a completely wireless system where a
heartbeat sensor was devised that works without electrical connections to the patient (see
Figure 2.1 for illustration).
The patient is fully clothed and the sensor device scans from about one meter away. The
device measures displacement current, which is a measure of the changing electric field
in the air, generated by the shifting voltages on the skins surface.
2.1.2 Micromedical
Micromedical [6] has also attempted to implement a wireless ECG monitor where a threenode system (as a single device) takes the ECG reading and is capable of connecting to a
mobile phone. The ECG wave is then transmitted to the treating Doctor. Although, the
implementation is not ideal for hospital situations, it can be used as general checkups for
patients in remote locations.
2.1.3 FM Based ECG system
Another ECG system [7] encountered where several nodes are connected as a system
(placed on the patients chest) to calculate the patients ECG and relays this through the
tissue of the body (using FM modulation) to a transmitter located on the patients wrist
and is transmitted to a base station as shown in Figure 2.2.
This system expands on a previously developed internet based database which collects
ECG data from patients. The Bluetooth communications protocol is used in the system to
send the digitized ECG data to a WEB server via GSM phone modem [8].
2.1.5 BlueNurse
The solution aimed in the previous year used the Bluetooth wireless communications
protocol to send an ECG signal from the patient to mobile station (laptop). The
architecture used for this implementation involved using conventional ECG signal
acquisition circuitry (ECG system which measures and filters an ECG signal with
analogue circuitry before A/D converting). The node meant for transmitting the ECG
signal consisted of three electrodes [9]. The system was unable to show an ECG reading
of a patient wirelessly. That is, the Bluetooth wireless link was functional; however the
ECG application was not interfaced to the communications link.
3
3. Problem Statement
There are evidence that the number of people in the world that facing with the heart
attack problem had increased. People suffering from this problem may have an attack at
any time especially at home without any supervision. Sensor that enables ECG home
monitoring to detect heartbeat can reduce this problem. By implementing wireless
communication ECG monitoring can be done and transferred remotely. There are work
previously on the sensor board specifically for ECG detecting, however the signal taken
from simulator input.
The objective of the present work is to design and implement a prototype ECG system
which replaces wired connections between sensor points and a central node with wireless
links. Design goal of this system is to have the electrodes obtaining the signal also
contain miniature circuitry required to process, digitize and wirelessly transmit the data
over Bluetooth Protocol. Figures3.1 [1] below illustrate this future goal and the benefits it
will offer
the ECG signals on its display. The system is able to connect continuously for supervision
abilities.
Successful implementation of the system would benefit to all involved in the use of
electrocardiography as access to and movement of the patient would not be impeded by
the physical constraints imposed by the cables. The work conducted, concentrates on
designing and implementing a system architecture that is functional and reduces wired
links to a minimum and attempts to prove the feasibility of completely wireless ECG.
The objectives of ECG wireless system are:
To develop an ECG wireless sensors board to send ECG wirelessly to the PC/PDA using
Bluetooth Technology during exercise or work or to physician for analysis through internet
The system designed is aimed to minimize the noise (in hardware).
Design of reliable and low power consumption system using Bluetooth Technology and
PIC microcontroller
4
4. Theory
4.1 ECG Background and Theory
4.1.1 The Heart
The heart is the organ responsible for pumping blood through the circulatory system. The
heart is made of a special kind of muscle, so that it can beat automatically without having
to be told to do so by the brain. The left side of the heart drives oxygen rich blood out of
the aortic semilunar outlet valve into circulation where it is delivered to all parts of the
body. Blood returns to the right side of the heart low in oxygen and high in carbondioxide and is then pumped through the pulmonary semilunar pulmonic valve to the lungs
to have its oxygen supply replenished before returning to the left side of the heart to begin
the cycle again. Figure 4.1[10] shows the basic cardiopulmonary system
The fidelity of ECG obtained using a capillary electrometer was poor and Einthoven
(1903) wanted to create a better system using Aders string telegraphic galvanometer.
Einthovens system proved to be a great success and soon string galvaonmeter based
ECG systems were in clinical practice worldwide. Einthoven also came up with his
theory regarding the Einthoven triangle and the lead positions based on this are still in use
today and is responsible for the labelling of the various waves forming an ECG signal.
Figure 4.5 [10] shows Einthovens string galvanometer and a patient having his ECG
recorded.
The electrical impulses within the heart act as a source of voltage, which generates a
current flow in the torso and corresponding potentials on the skin. The potential
distribution can be modeled as if the heart were a time-varying electric dipole. The dipole
is located approximately as shown in Figure 4.6 by the vector M [13].
4.2.2
Electrodes
Electrodes are used for sensing bio-electric potentials as caused by muscle and nerve
cells. ECG electrodes are generally of the direct-contact type. They work as transducers
converting ionic flow from the body through an electrolyte into electron current and
consequentially an electric potential able to be measured by the front end of the ecg
system. These transducers, known as bare-metal or recessed electrodes, generally consist
of a metal such as silver or stainless steel, with a jelly electrolyte that contains chloride
and other ions (Figure 4.7) [15].
The result is a voltage drop across the electrode-electrolyte interface that varies
depending on the electrical activity on the skin. The voltage between two electrodes is
then the difference in the two half-cell potentials. Figure 4.8 Dry Electrode Structure [10]
IEEE
802.11b
Hiperlan1
Hiperlan2
Bluetooth
Class 1
Frequency
band
5 GHz
2.4 GHz
5 GHz
5 GHz
2.4 GHz
Frequencies
5.47-5.725
GHz
2.4-2.483
GHz
5.15-5.30
GHz
5.15-5.30
GHz
2.4-2.483
GHz
Max
Capacity
20 Mbps
11 Mbps
20 Mbps
54 Mbps
732.2 Mbps
Typical
power
25mW
30mW
0.1-1 W
25mW
1mW
QoS
Low
Low
Medium
High
Medium
Interference
Satellite
Microwave,
cordless,
phones,
Bluetooth
Satellite
Satellite
Microwave,
cordless,
phones,
Bluetooth
Typical
Radius
20-100 m
30-200 m
20-100 m
20-100 m
20 m
Cost
Medium
High
Low
Low
Medium
Most of the above technologies can be ignored. When deciding upon the wireless
protocol, focus is put towards two protocol standards which not only provide a more than
convenient replacement for cables, but with their capacity for autonomous interaction and
rich functionality, will become increasingly popular in the search for hassle free wireless
communication. These are: Bluetooth and ZigBee
4.3.1 Bluetooth
4.3.1.1 Bluetooth Theory
The Bluetooth wireless system [17] has its origins in the late 1990s, when Ericsson
Mobile Communications launched an initiative to study wireless alternatives to the cables
which linked the mobile phones with accessories such as headsets. It was names after
Harald Bluetooth (Harald Gormsson) a 10th century Danish King who united Denmark
and Norway. This was appropriate as it symbolised the uniting of isolated devices and
systems. The scope for Bluetooth is such, that currently over 2000 companies are
participating in the special interest group (SIG) formed in 1998 by Ericsson, Nokia, IBM,
Intel and Toshiba, while many more are developing Bluetooth products. Several
Bluetooth consumer products are becoming available now, and soon it will be evident
whether this technology is accepted by the general public and is able to provide an
improved standard of life.
Bluetooth is a pure adhoc networking protocol used especially for short-range, low power
wireless communication radio link between two devices operating in the unlicensed 2.4
GHz industrial scientific and medical (ISM) band. Bluetooth.s design incorporates a
piconet network in which two or more Bluetooth devices form a communication channel
to exchange data. The first device to initiates the channel is the master while the other
devices on the piconet are the slave.
In addition, the Bluetooth technology is capable of engaging in several piconets present
in the same vicinity in a Time Division Multiplexing fashion. This phenomena, known as
scatternet (shown in Figure 4.9) gives Bluetooth a more versatile look [18].
Radio Layer is the lowest defined layer of the protocol and it defines the requirements of
the Bluetooth transceiver.
Baseband Layer is concerned with the link control at the bit and packet level as well as
the coding and encryption for the packet assembly and frequency hopping operations.
Link Manager Layer configures the link, in that it is responsible for encryption,
authentication, and state of stations in the piconet, power modes, and traffic scheduling
and packet format.
Host controller interface (HCI) accommodates the transferring of data between the upper
and lower layer (baseband controller) via a physical bus, allowing the user access
Bluetooth baseband capabilities.
Audio communication is relatively simple as it involves opening an audio link in a pulse
code modulated (PCM) format.
Logical link control and adaptation protocol (L2CAP) allows for protocol multiplexing
and segmentation of outgoing packets.
Service Discovery Protocol (SDP) provides the means for application to discover which
services are available and the characteristics of those services. RFCOMM Layer emulates
the RS-232 control and data signaling over the Bluetooth baseband
4.3.2 Zigbee
4.3.2.1 ZigBee Stack and Theory
One of the emerging standards in the move toward a wireless world is an approach called
ZigBee. [21] Pioneered by Phillips, it has since formed into an alliance of companies
working together to create a wireless communication protocol. The ZigBee stack unlike
Bluetooth is relatively straightforward, as can be seen in Figure 4.11 [22].
The higher protocol layers are being developed by the Zigbee Alliance group while
interests in the lower layers of the stack (MAC, PHY and LLC) are being developed by
the IEEE 802.11 working group 4 (802.11.4) which is aimed at achieving data throughput
of 220kbps in the 2.4GHz band. Protocol features include [23]:
Service discovery
Master / Slave topology
Automatic network configuration
Dynamic slave device addressing
The Zigbee protocol operates in the three different frequency bands (2.GHz, 915MHz.
USA ISM band and 868MHz Europe), which employs DSSS for transmission and
reception of data. As seen above, different data throughputs can use however influencing
the distance of transmission.
The main purpose of this standard is to provide its customers with three main features:
Low data rate
Low power consumption
Low cost
The design for ZigBee took into consideration the high power consumption of Bluetooth.
For most application, the Zigbee module is capable of a battery life of 6 months to 2 years
with AA batteries. This is achieved by using sleep mode functions to allow
communication only when the application deems necessary. The Zigbee chip here draws
a few milliamps in sleep mode against 100 micro amps or more for a comparable
Bluetooth state. Furthermore this prevents the device from interference problems as it
often wont be operating when other modules are using the 2.4 GHz band.
4.3.3
Protocol Selection
While both technologies have their advantages and disadvantages, they are in fact
different solution optimized for different applications. Bluetooth provides an ideal ad hoc
network between capable device for transferring audio, screen graphics, picture and file.
On the other hand, the Zigbee device is ideally for a static network, which comprises of a
multiple devices communicating with smaller packets. [24]. Here Bluetooth Protocol is
used for transferring ECG data and graphics.
The ADRESH: ADRESL registers contain the 10-bit result of the A/D conversion. When
the A/D conversion is complete, the result is loaded into this A/D Result register pair, the
GO/DONE bit (ADCON0<2>) is cleared and the A/D interrupt flag bit ADIF is set. For
an A/D Conversion, follow these steps are used:
1.
2.
3.
4.
5
6
7
Read A/D Result register pair (ADRESH:ADRESL), clear bit ADIF if required
For the next conversion, go to step 1 or step 2 as required. The A/D conversion
time per bit is defined as TAD
Bit SPEN (RCSTA<7>) and bits TRISC<7:6> have to be set in order to configure pins
RC6/TX/CK and RC7/RX/DT as the Universal Synchronous Asynchronous Receiver
Transmitter. The USART module also has a multi-processor communication capability
using 9-bit address detection.
4.4.3.1 USART Baud Rate Generator
The BRG supports both the Asynchronous and Synchronous modes of the USART. It is a
dedicated 8-bit baud rate generator. The SPBRG register controls the period of a free
running 8-bit timer. In Asynchronous mode, bit BRGH (TXSTA<2>) also controls the
baud rate. In Synchronous mode, bit BRGH is ignored.
Table 4.2 shows the formula for the computation of the baud rate for different USART
modes which only apply in Master mode (internal clock). Given the desired baud rate and
FOSC, the nearest integer value for the SPBRG register can be calculated using the
formula in Table 3.2. From this, the error in baud rate can be determined. It may be
advantageous to use the high baud rate (BRGH = 1), even for slower baud clocks. This is
because the FOSC/(16(X + 1)) equation can reduce the baud rate error in some cases.
Writing a new value to the SPBRG register causes the BRG timer to be reset (or cleared).
This ensures the BRG does not wait for a timer overflow before outputting the new baud
rate.
Table 4.2 Baud Rate Formula Table
Sync
N/A
5
5. Methodology
5.1 Hardware Methodology
This chapter deals with more than just how the final design was arrived at. It attempts to
convey some lessons learnt throughout the course of the project. Initially circuitry able to
obtain an ECG signal in a largely traditional manner was built and that is what is covered
in this chapter. The circuitry was later used to try and obtain an ECG signal in the manner
required for a completely wireless system. Appendix 2 shows actual hardware system.
5.1.1 Electrode Placement
The closer the electrodes are to the heart, the stronger the signal that will be obtained.
Placing electrodes on the torso of a patient provides a stronger signal then on the wrists
and legs. In keeping with the vector dipole model of the heart and the mathematical
equation giving the differential voltage obtained as the dot product of the heart dipole
vector and the vector between two electrodes, the closer these two vectors are to
perpendicular, the greater the voltage obtained. This corresponds to electrode placing for
Lead 3 of the Einthoven Triangle. Lead 2 obtains the weakest signal.
The ECG signal being measured has components in both the negative and positive
voltage domains. To cope with this, amplifiers in the system require positive and negative
power supplies. For wireless philosophy, a battery is used to power the remote nodes.
To rectify the positive voltage supplied by the battery into an equivalent negative voltage,
the LMC7660 switched capacitor voltage converter is used. This chip converts a supplied
positive voltage into the equivalent negative voltage with 95% power efficiency [28]. The
positive voltage from the battery and the negative voltage from the LMC7760 are then
regulated to +5V and -5V respectively through LM78L05 and LM79LO5 voltage
regulators. This gives a stable power supply that doesn't introduce noise and is suitable
for the microprocessors.
A first order filter was deemed to be adequate since little noise is contained in the
frequency band immediately above 100Hz and the 20dB/decade attenuation roll-off is
effective in removing the microprocessor and RF circuitry noise contained in the
megahertz.
25.45
-2.17
30.23
-2.17
47.77
-9.50
50
-14.74
54.30
-9.68
55.77
-7.35
56.68
-6.73
60
-3.12
61
-2.87
64
-2.39
72
-2.17
90
-2.17
VDD
R16
2.2k
U1:D
4
U1_V+
12
R17
14
10k
4
5
IPNULL1
IPNULL2
VS+
OPNULL1
OPNULL2
0.1uF
3.9M
LMC6464A
R19
3.9M
15
14
U1:A
4
R2
R18
C1
U3
R1
11
13
2.2k
R3
2k
R4
2k
R5
INRG1
G=100
G=200
G=500
RG2
IN+
SENSE
OUTPUT
10
3
R7
U2
2
13
14
3.3k
REF
VS7
11
2
16
13
12
11
3
1
47k
AD624
LMC6464A
R8
47k
47k
C4
R6
4.7uF
U1_V+
C2
0.1uF
10k
VDD
U1:B
32k
32k
R14
100k
C6
RD0/PSP0
RD1/PSP1
RD2/PSP2
RD3/PSP3
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
LMC6464A
11
4.8uF
R13
16k
C5
RB0/INT
RB1
RB2
RA0/AN0
RB3/PGM
RA1/AN1
RB4
RA2/AN2/VREF-/CVREF
RB5
RA3/AN3/VREF+
RB6/PGC
RA4/T0CKI/C1OUT
RB7/PGD
RA5/AN4/SS/C2OUT
RC0/T1OSO/T1CKI
RE0/AN5/RD
RC1/T1OSI/CCP2
RE1/AN6/WR
RC2/CCP1
RE2/AN7/CS
RC3/SCK/SCL
RC4/SDI/SDA
MCLR/Vpp/THV
RC5/SDO
RC6/TX/CK
RC7/RX/DT
200nF
R15
OSC1/CLKIN
OSC2/CLKOUT
C3
100k
C7
8
9
10
1
R11
11
U1_V-
R12
2
3
4
5
6
7
U1:C
9
R9
10k
33
34
35
36
37
38
39
40
15
16
17
18
23
24
25
26
19
20
21
22
27
28
29
30
PIC16F877A
100nF
10
100nF
LMC6464A
R10
100k
5.2.2 miKroC
mikroC is a powerful, feature rich development tool for PICmicros. It is designed to
provide the programmer with the easiest possible solution for developing applications for
embedded systems, without compromising performance or control.
PIC is the most popular 8-bit chip in the world, used in a wide variety of applications, and
C, prized for its efficiency, is the natural choice for developing embedded systems.
mikroC provides a successful match featuring highly advanced IDE, ANSI compliant
compiler, broad set of hardware libraries, comprehensive documentation, and plenty of
ready-to-run examples. Figure 5.10 shows the mikroC Integrated Drive Electronics (IDE).
Before the USB dongle is to be used, a communication link has to be established between
the Bluetooth Module and Bluetooth Dongle using IVT BlueSoleil. Following are the
steps of installing and establishing a link between the two
Install the software IVT BlueSoleil using CD included with the USB dongle
Once the software is successfully installed, plug in the USB dongle and run the
software
Switch on the power for the circuit with the SKKCA-21
BlueSoleil window is available as shown in figure 5.12. Click the orange ball in the
center of the window or press F5
After searching, Bluetooth module is detected in the window and its Icon is
available
Next, double click on the symbol of the Bluetooth module. The software
automatically selects the method to connect with the Bluetooth device.
Right click on the symbol to select Connect->Bluetooth serial port service. Figure
5.13 shows the setup for Bluetooth port.
Finally, window appears with the designated serial port. Click yes to proceed.
Figure 5.14 shows the Bluetooth connection that has been established.
i.
ii.
iii.
iv.
The settings are done using programming language of the PIC microcontroller. Figure
5.15 shows a flow chart of general concept for microcontroller to communicate and
process data from KC Wirefree Bluetooth transceiver.
There are 2 modes in Bluetooth configuration. First mode is Command mode, this mode
indicate that all data send from host is a command for Bluetooth transceiver, and data
send from Bluetooth transceiver to host is event reporting status of Bluetooth transceiver.
Second mode is Bypass mode; this mode can only appear when connection between 2
Bluetooth transceivers is established. In Bypass mode, every single byte of data from host
will be sent over Bluetooth wireless link to the other Bluetooth node.
4.2.6 LabVIEW2009
LabVIEW is a graphical programming environment used by millions of engineers and
scientists to develop sophisticated measurement, test, and control systems using intuitive
graphical icons and wires that resemble a flowchart. LabVIEW offers unrivaled
integration with thousands of hardware devices and provides hundreds of built-in libraries
for advanced analysis and data visualization. The LabVIEW platform is scalable across
multiple targets and operating systems, and since its introduction in 1986 has become an
industry leader. LabVIEW program for wireless ECG is presented below.
Front Panel and Block Diagram is shown in Figure 5.16 and 5.17 respectively.
6
6. Result and Discussion
6.1 Results
Wireless ECG sensor system with 0-110 Hz resolution has been developed. Snapshot of
the completed Wireless ECG is shown in Figure 6.1. All signals presented in this report
are recorded in LabView2009. The ECG signal obtained from Lead 1 is shown in Figure
6.2
The digital to analogue conversion and sample rate is controlled by the Microcontroller;
the sample rate of 400 Hz conforms to Nyquist theorem that states that the sample rate
must be at least twice the resolution of the signal. With the Philips PM5136 function
generator the real cut-off frequency of the ECG amplifier was established at 105 Hz..
The BlueSoliol software handled the connection to the ECG sensor system via a
Bluetooth virtual serial port. The LabView2009 application for the PC manages the
graphical display of the signals.
6.2 Discussion
This project has been more of a research project than a conventional master thesis, where
a lot of the time has been research for what is possible and finding a solution that will fit
the application more than just constructing and testing. The initial ideas of connecting the
ECG sensor system to a cellular phone and making a Java application for the graphical
presentation were found to be almost impossible to make a standard solution if even
possible. What seemed to be great advantages of using a regular cellular phone at the first
stage of the project, later proved to be an obstacle. There is no real standard of the
systems used in cellular phones as in PDA using windows mobile. This means that it
requires more than one program developed if it should be used in larger quantities than
just one system being able to connect to a specific cellular phone.
With the use of LabView2009, this is solved the only requirement is just that it is a
Bluetooth enabled PC with NI VISA installed in it, no requirement of a specific brand or
even a specific model of a brand as it would be with an application for cellular
phones/PC. When discussing cellular phones and medical application there is an obvious
disadvantage that it is not allowed having the cellular phone turned on in medical
environments. No such rules apply to PDAs/PC.
The cable replacement took more time than expected which left no time for further
development such as heart rate presentation or alarm function.
6.4 Summary
A small ECG sensor system with high resolution and effective noise reduction has been
developed to measure and present ECG signal [both 50 Hz noise and DC offset has been
successfully implemented in the ECG sensor system].
References
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10] Bronzino, Joseph D., The Biomedical Engineering Handbook, IEEE Press, 2000
[11]. Brenda M. Beasley, Michael C. West, Understanding 12-lead EKGs.
Saddle River, New Jersey: Prentice Hall Second Ed. 2003.
Upper
[12]
A.
Khorovets,
What
Is
An
Electrocardiogram,
2000
http://www.ispub.com/ostia/index.php?xmlFilePath=journals/ijanp/vol4n2/ekg.xm
l
[13]
BE304
Laboratory
Notes,
Michicgan
Technological
www.biomed.mtu.edu.au/osoykan/classes/be304/week3/week3.htm
[14]
University
[15] M. Lu, The Design and Construction of an ECG Telemetry System, University of
Queensland Thesis, 1994
[16]
[17]
[18]
[19]
[20] Vasudevan N., the BlueNurse Wireless Link, University of Queensland Thesis,
2001
[21]
[22]
[23]
[26]
[27]
[28]
Appendix A
PIC microcontroller C Program Code
The C code program that is downloaded on to the microcontroller is presented below with
comments to explain the function is marked with //.
void main()
{
Unsigned int temp_res = 0;
Usart_Init(57600);
ADCON1 = 0x80;
TRISA = 0xFF;
TRISB = 0;
Do {
temp_res = ADC_Read(1)<<2;
//Display on PORTB