2. 122 Arpitchoudhary, Mohit Kumar, Kundan Kumar, Rachana Singh & Sapnakatiyar
Major Parts in the Design of an Ecg System are
• ECG electrodes unit
• Analog amplifier and filtering unit
• Microcontroller and processing unit
• Analysis unit
• Storage unit
• Display devices
FIRST UNIT
The first and the main unit of this systemis to sense the weak bio-potential signal generated
inside the human body due to activities of the heart. To capture this weak electrical signal ECG unit is
used. This unit makes the interface between the patients heart’s electrical activity and thefurther electric
circuitry. The ECG lead unit may be 12 lead, 6 lead,5 lead or 3 lead one. Depending on the clinical
application and real time complexity of the placement of electrodes any of these lead systems is
employed. For this circuit 3 disposable ECG electrodes system areemployed [13].
SECOND UNIT
This unit ofthe system is analog bio-potential amplifier and filtering unit. This unit is very
important due to weak values of the electrical signal itself as well the environment and the apparatus in
which the measurement is done. The weak electrical signal is amplified using an instrumentation
amplifier and filtered using a passive band pass filter. The signal is further amplified using a non-
inverting amplifier which provides an additional gain. The main characteristics of the instrumentation
amplifier are high Common Mode Rejection Ratio (CMRR) to reject interference from mains, low-noise
for high signal quality, and ultra-low power dissipation for long-term power autonomy, configurable gain
and filter characteristics that suit the needs of different bio-potential signals under different applications
[4-9]. After this unit the ECG signal can be seen on the DSO. After this a pulse is generated with the help
of a comparator. Whenever the signal crosses a certain reference voltage the comparator generates a high
to low pulse to indicate a beat, which is used as an interrupt source for microcontroller. With the help of
time duration between two pulses beats/minute is calculated and displayed on the LCD with the help of
Microcontroller. Meanwhile the signal is also converted into digital using ADC and transferred to the PC
via RS232 interface. The signal is received at the USB port using USB to serial converter, where it is
read by the MATLAB and plotted in real time.
THIRD UNIT
This unit is Microcontroller and processing unit. This unit is used for the digitization of the
ECG signal [1–3]. To convert the available analog signal into digital we have used an ADC. Also RS232
interface is used to interface microcontroller and PC. Microcontrollers are low-cost, low-power,
programmable, cheap and high-speed data acquisition systems. Microcontroller generates the
3. Design and Development of Low Cost Microconoller Based ECG System for Realtime Analysis 123
communication protocol for transmission to a PC. This enables a direct connection between the
‘compact’ front-end and the Host[12].HereMicrocontroller is used for calculating the beats/minute and
displaying it on LCD and to send the data to the computer. MATLAB is one of the most powerful data
processing platforms and is used to plot the data in real time situation using serial port interface [4-6].
SYSTEM BLOCK DIAGRAM
The Figure (1) shows the block diagram of the system for microcontroller based heart beat
monitor [13].The heart pulse received on the skin by electrodes is a result of traveling electrical activity
from the heart. At the skin, this signal has a relative potential in the range of about ~2mV. The desired
components of a typical ECG signal lies in the frequency range 0.5 Hz to150 Hz. Three disposable ECG
electrodes are used to sample the desired signal from human body. The bio-potential electrical signal is
the input to differential amplifier. It takes the difference of received signal from the left and right arm.
Left leg is used as ground reference. The difference of the signals is amplified for further processing.The
received electrical signal from the body contains a large amount of noise. To separate the desired signal
from the noise a passive band pass filter is used. Output of the filter is connected to additional gain
amplifier and then amplified output may be display or store in DSO [7-11].
For further analysis output from additional gain amplifier may also be digitalized using ADC.
The output of comparator is used as a source of interrupt for microcontroller. Further Microcontroller is
used to calculate heart beat rate, to display it on LCD, to control the analog to digital conversion and to
transmit them serially. TTL to RS-232 is used for converting TTL standard to RS-232 standard.
Figure 1: System Block Diagram
4. 124 Arpitchoudhary, Mohit Kumar, Kundan Kumar, Rachana Singh & Sapnakatiyar
HARDWARE IMPLEMENTATION
Instrumentation amplifier is used as a differential amplifier, which is implemented using four
741 op-amp ICs. The over all gain of instrumentation amplifier is 940. A band pass filter of cut-off
frequency 0.5 Hz to 150 Hz is used for removing the noise. To further amplify the desired signal an
additional gain amplifier of gain 5.1 is used, which leads to an over all gain of 4794. The output of
additional gain amplifier is around 4 volt peak-to-peak. This signal is displayed on DSO. Comparator is
implemented using 741 op-amp IC. AT89C51 microcontroller has been used for the measurement of
heart beat rate. LCD and ADC0804 are interfaced with microcontroller. MAX-232 IC is used for TTL to
RS232 conversion. Serial data is received on USB port of PC with the help of serial to usb converter,
which is read by MATLAB for plotting the signal in real time. Fig (3.1) shows the actual circuit that has
been implemented.
Figure 2. Implemented Circuit
SOFTWARE IMPLEMENTATION
• The programming of the microcontroller 89c51 is done in assembly language[12].
• Editor : Programmer’s Notepad
• Assembler : 8051 IDE
• Programmer: VPL UPROG VX universal programmer
5. Design and Development of Low Cost Microconoller Based ECG System for Realtime Analysis 125
To achieve the goals of the project following steps are taken for programming the
microcontroller[12].
1. Initialize the LCD
2. Number of clock ticks is recorded between two successive pulses coming from the
comparator.
3. Beats per minute is calculated every second with the help of clock pulses recorded in step 1.
4. These are displayed on the LCD by converting them to ASCII.
5. Simultaneously the microcontroller controls the ADC0804 for converting the analog signal
into digital
6. This digital data received at the PORT0 is sent serially to the PC via MAX232.
STEPS USED TO VISUALIZE WAVEFORM
The digital data coming on serial port (or USB port) is plotted with respect to time and Figure 3
shows the steps being performed:
Figure 3: Steps used to receive data on PC
Plot received data
against time
Read the data from
input serial data
Created a serialobject
in MATLAB
Customized the figure
window
Created a while loop
6. 126 Arpitchoudhary, Mohit Kumar, Kundan Kumar, Rachana Singh & Sapnakatiyar
RESULTS
The results at various stages are shown in the following figures:
Figure 4: Filtered ECG signal on DSO
Figure 5: Comparator output with ECG signal.
Figure 6: Heart Beat Rate on LCD
Figure 7: ECG signal on MATLAB
Figure 4. Filtered ECG signal on DSO
Figure 5. Comparator output with ECG signal.
7. Design and Development of Low Cost Microconoller Based ECG System for Realtime Analysis 127
Figure 6. Heart Beat Rate on LCD
Figure 7. ECG signal on MATLAB
8. 128 Arpitchoudhary, Mohit Kumar, Kundan Kumar, Rachana Singh & Sapnakatiyar
CONCLUSIONS
The prototype of the low cost microcontroller based heart beat monitor was efficiently designed
and verified. This prototype has facilities to display ECG signal on computer screen or on DSO. It
accepts weak ECG signal coupled with high power noise and effectively amplifies the signal for further
processing. Received ECG signal has been effectively used for the calculation of heart beat rate per
minute with a very small error. In addition to DSO the amplified ECG signal has been successfully
received on computer screen by using MATLAB and RS232.Therefore all objectives perceived in the
project have been successfully realized and implemented. This system can be upgraded for the detection
of disease states of the heart of the patients who are located in the remote areas and are not in a position
to report to the doctor for immediate treatment. The ECG signal can be transmitted using the internet to
the doctors and advises can be sought for saving the life of the patient.
REFERENCES
[1] R. Gupta, J.N. Bera, M. Mitra*, Development of an embedded system and MATLAB-based
GUI for online acquisition and analysis of ECG signal, Measurement 43 (2010) 1119–1126.
[2] K Krishna bai, S. C. Prasanna Kumar, Design of a Low Cost ECG system: Review, Canadian
Journal on Biomedical Engineering & Technology Vol. 3 No. 2, February 2012.
[3] M. Bertrand, R. Guardo, F.A. Roberge, P. Blondeau, Microprocessor application for numerical
ECG encoding and transmission, Proceedings of IEEE 65 (5) (1977) 714–722.
[4] O. Orlov, Dmitri V. Drozdov, et al., Wireless ECG monitoring by telephone, Journal of
Telemedicine E-Health 7 (1) (2001) 33–38.
[5] M. Engin, E. Caglav, E. ZekiEngin, Real-time ECG signal transmission via telephone network,
Measurement 37(2) (2005) 167–171.
[6] C.J. Yen, W.Y. Chung, M.C. Chi, Micro-power low-offset instrumentation amplifier IC design
for biomedical system applications, circuits and systems I: regular papers, IEEE Transactions on
Circuits Systems I 51 (4) (2004) 691–699.
[7] M. Burke, D. Gleeson, A micropower, dry-electrode ECG preamplifier, IEEE Transactions on
Biomedical Engineering 47 (2) (2000) 155–162.
[8] R. Pallas-Areny, J. Webster, AC instrumentation amplifier for bioimpedance measurements,
IEEE Transactions on BiomedicalEngineering 40 (8) (1993) 830–833.
[9] E. Spinelli, R. Pallas-Areny, M. Mayosky, AC-coupled front-end for biopotential measurements,
IEEE Transactions on Biomedical Engineering 50 (3) (2003) 391–395.
[10]R. Coughlin, F. Driscoll, OPAMP and linear integrated circuits, sixth ed., Pearson Education
Asia, India, 2002.
9. Design and Development of Low Cost Microconoller Based ECG System for Realtime Analysis 129
[11]E. Spinelli, N. Martinez, M. Mayosky, R. Pallas-Areny, A novel fully differential biopotential
amplifier with DC suppression, IEEE Transactions on Biomedical Engineering 51 (8) (2004)
1444–1448.
[12]M. A. Mazidi, J.G. Mazidi& R.D. McKinlay: The 8051Microcontroller And Embedded System,
2nd
ed.
[13]R.S. Khandpur: Biomedical Engineering.
[14]VPL UPROG VX manual.