Low-Cost Portable ECG Monitoring Device for Inaccessible Areas in Pakistan

The need for a constant health monitoring system is essential especially for Cardiovascular Disease (CVD) that may cause sudden stroke or even death. In this paper, we present the design and development of a low-cost, efficient, and user-friendly portable Electrocardiography (ECG) monitoring device. Most of the existing heart rate measurement devices and tools available in underdeveloped countries like Pakistan are quite expensive, far to reach and inaccessible in the majority of the rural areas especially for the female population to reach the healthcare centers. Our proposed device monitors the patient’s body information using three lead-silver chloride ECG disposable electrodes and detects the pulse signal. The detected heart pulse signal is first filtered and then amplified. The device can display the heart signal on an external PC/laptop Graphical User Interface (GUI) and the digitized pulse rate on a Liquid Crystal Display or (LCD) to detect any signs of abnormality. We have tested the device on several trial subjects. Finally, the results were compared with the standard ECG signal. Our device measures the pulse signal with good accuracy similar to commercial devices with higher costs.


I. INTRODUCTION
According to World Health Organization (WHO), Cardiovascular Disease (CVD) is a major cause of global mortality and it will remain the prime cause of mortality by 2030, with over 75% in third-world countries [1]. The mostreported prevalent psychosocial risk factors for CVDs are depression, stress, anxiety, physical and social inactivity, obesity, quality of life, and inappropriate sleep patterns [2].
A study conducted in 2018 shows heart failure risk factor is high at a younger age with female preponderance in Pakistan [3]. In underdeveloped rural areas, poverty and slow transportation is the major hurdle in accessing sufficient treatment. The death of many heart patients is due to the lack of adequate treatment or the inaccessibility of expensive medical tests and treatments. This also affects the people with special needs like visually impaired persons to use the existing Electrocardiogram (ECG) devices that require additional features such as Text-To-Speech (TTS) conversion proposed by authors to be used with PC and laptop [4]. Many technical issues and faults occur in the devices that are currently available in the market that led to false information reading and at times are outdated. Inaccurate measurements occur while monitoring the patients due to noise interferences such as muscles, respiratory or electromagnetic interference (EMI) from the instruments, which can cause major problems for the doctors and cardiologists while analyzing the patient's ECG. To encounter such limitations and better detect cardiac diseases, the ECG signal must be correctly filtered from all external noises [5]. Another critical issue in the remote and inaccessible areas of Pakistan arises due to long power outages and unavailable continual power supply [6] and [7]. Healthcare centers can be prioritized to facilitate the patients [8]. It can also be resolved with a small renewable energy system coupled with the ECG device proposed by researchers [9] or integrating flexible solar cells on the device surface [10]. However, our proposed work is only related to designing a low-cost and portable ECG system.

II. RELATED WORK
Willem Einthoven invented the first ECG machine in 1901 by a string galvanometer to measure ECG signals and assigned the letters P, Q, R, S, and T (called the characteristic points) to the various deflections and form ECG signal pattern as shown in Figure 1. Heart disease can be detected by detecting heart rate rhythm, P-wave, PR-interval, QRS-complex, ST-segment, and the QT-interval. The 'Holter monitor', one of the earlier portable commercial ECG devices to monitor the signals can cost between 199 to 355 USD even today, which is unaffordable for many patients and healthcare staff. Moreover, replicating and developing a low-cost solution domestically remains a challenge [11]. Several proposed works in the past have focused on affordable design solutions and techniques to monitor heart rate. A low-cost monitoring device using Bluetooth was developed by Nofitasari and his associates in 2020, for around 35 USD [12]. However, Bluetooth reliability is a concern for a secure connection and portability for long distances. A wearable ECG device with amplifiers for noise removal and suppressing harmonic interferences using moving average filters and phaselocked-loop was recently proposed [13]. In another study, a smartphone-based ECG monitoring system was proposed [14]. But the cost of these developed systems was unspecified.
Although there are some cost-effective solutions for ECG measurements proposed by researchers with a minimum cost of 11.5 USD [15] and [16]. However, the feasibility of reproduction and commercialization has not been thoroughly investigated on trial subjects. For this reason, we have designed a cost-effective computer-assisted health device compatible in compliance with the IS0/IEEE 11073-10102:2014 annotated ECG standard. This is a health communication standard that bridges medical devices and external systems such as laptops and PCs. Further, it supports plug-and-play interoperability and can capture and visualize the analog signal in real-time. Numerous highperformance ECG systems in the past were implemented, but these machines are very expensive and require a dedicated and sophisticated platform [17] and [18]. Therefore, an indigenous customized portable and economical solution for ECG measurement is proposed in our work, especially for the under-developed rural areas of Pakistan. The outline of the paper is organized as follows. Section III explains the proposed design of the ECG monitoring device. Section IV presents our results and discussion. Section V is the conclusion and Section VI describes the future work.

III. DESIGN METHODOLOGY
There are high-performance devices for ECG heart monitoring; however, the cost and power consumption factors remain a concern. We propose a low-cost portable ECG device that monitors a patient's heart pulse with only three lead electrodes. The signal measured is passed through the detector circuit and then filtered for further amplification. Digitization of data is done using an Analog-to-Digital Conversion (ADC) which is serially transmitted using an Atmega16 microcontroller. The results of the ECG signal are displayed on a GUI for analysis and the heart rate is shown on a 2 x 16 matrix LCD. A block diagram of our proposed device is shown in Figure 2. The design and details of each module are discussed below: A. Electrode Placement Three lead electrodes were used to convert the obtained signals into electrical voltage in the range of 1-5 mV. The sensor pair is attached to the right and left arm and the right leg of the patient.

B. ECG Detector Design
We have used an AD620 instrumentation amplifier with 40 parts per million (ppm) accuracy that required only one external resistor for gain adjustment at the first stage, also known as an ECG detector. The gain was controlled by the potentiometer (Rg) according to Eq. (1), connected between Pin 1 and Pin 8 of the amplifier [19].
The ECG signal from electrodes along with noise was enhanced by another detector amplifier circuit. The signal was then filtered out from all noises and re-amplified (second stage amplifier) to our desired level of output signal between 2V to 3V. Proteus simulation is shown in Figure 3.

C. ECG Filter Design
The signal received from a patient's body is very weak, on average around 1.1 V. Other noise signals are also added which makes the signal undetectable for further analysis. Consequently, a filter here was needed to remove noises from the ECG signal.

D. Filter Design
To remove noise, a Low Pass Filter (LPF) with a cutoff frequency (fc) of 0.05 Hz and a High Pass Filter (HPF) with fc of 100 Hz was used. Alternately, a single Band Pass Filter (BPF) can be selected to cover all remaining aspects. However, the cutoff frequencies may not be exact in the case of BPF with a higher error probability. We designed an LPF of less than 50 Hz to get desired ECG signal as shown in Figure 4. The equations used in designing of filter are given by Eq.
By varying the value of the second potentiometer, we designed a filter to match our requirements by calculating the frequency of the signal using Eq. (4).
Having the first frequency, we calculated the value of the resistor to adjust the second potentiometer and set the cutoff frequency to less than 50 Hz, here taking 40 Hz in Eq. (5).

E. ECG Amplifier Design
After filtering, the ECG signal was further amplified. A pair of operational amplifiers OP27 was used as a noninverting amplifier shown in Figure 5. The gain was set using two variable resistors. Keeping one resistor constant and varying the other, helped to adjust the gain using Eq. (6).

Gain = Vout/Vin = 1 + 4 th Pot/3 rd Pot
Taking Vout to be 4.3 V and Vin to be 130 mV, we calculated the final gain of the circuit. It is to be noted that; one potentiometer was kept constant when the gain is known. The value of the third potentiometer was calculated using Eq. (7) where the fourth potentiometer (fixed) and the gain were found earlier.

F. Microcontroller Interfacing
ATmega16 was used in this study. An 8-bit microcontroller with low power consumption and high performance along with 16 KB programmable flash memory. ATmega16 was used for Analog-to-Digital Conversion (ADC) of the ECG signal and to measure the heart Beats Per Minute (bpm) by counting the highest peak (QRS complex) of the ECG signal over a period of 60 seconds. The result of the heart rate was displayed on the LCD. The data from the ATmega16 was sent to MATLAB using serial communication at a baud rate of 9600 for further signal processing.

G. Serial to USB Communication
An RS-232 (UART port) serial communication protocol gives binary 1 and 0, requires a voltage of between -3 V to -15 V and +3 V to +15 V respectively but is incompatible in the case of TTL and CMOS communication. Hence, for the conversion of the electrical voltage in both directions, a MAX232 chip was used. The digitalized output ECG signal of the microcontroller was in TTL logic. For serial transmission, a standard RS232 in Figure 6 was used to define the signal level requirements at the transmitter and receiver. A Virtual Serial Port Emulator (VSPE) software was initially used to test our results without needing to have the real hardware. A Serial to USB converter was used for connecting with the external PC/laptop without having a serial port. Here we summarize the overall working of our developed system. The medical device consists of interconnected modules i.e., power supply, analog filters, analog amplifiers, microcontroller, and interfacing circuits. The device collects the ECG signals of frequency between 0.05 Hz and 115 Hz. The ECG signals were collected from the subjects using the 3 leads system. The attained signal through this module was further transferred to a laptop via a USB-serial cable. The microcontroller interfacing was used to convert the input analog to the digital output signal. This acquired signal can be used for further clinical analysis by the doctor or healthcare. A GUI was implemented in MATLAB to continuously monitor the ECG signal traces and to record the ECG data with higher precision. The designed parameters are presented below in Table 1.

IV. RESULTS AND DISCUSSION
Our device results were simulated in MATLAB. The output was very close to the real-time ECG signal results as shown in Figure 7. The vertical axis gives the amplitude of the signal while the horizontal axis represents the time. The experiment was conducted using a 3-lead electrode with three random female volunteers aged 21, 22, and 24 seated in a relaxed manner. All subjects reported no abnormality indicating the detected ECG was accurate. The pulse rate was within the range showing all of them are normal. The ECG signal strength was measured at distinct intervals for about 23 seconds and is tabulated in Table 2. A customized GUI was also implemented in MATLAB that graphically shows the health pulse signal shown in Figure 8. The components used for this device were inexpensive and easily accessible from the local electronics market with a net cost of 1610 PKR (~9 USD), much less than the current ECG electronic reported in the literature. The cost breakdown of the developed ECG device is tabulated in Table 3. The only additional cost would be to have a MATLAB license to view the results on GUI. Printed Circuit Board (PCB), etching, and fabrication were done ourselves using our laboratory equipment. The only additional cost varies according to the PC/laptop, LCD, or smartphone device connected to the device for monitoring purposes that makes it portable and compatible. Our prototype device was operated with a 5 V DC converted regulated supply while can also being powered with a USB cable. The developed ECG monitoring device modules on PCB and attachable electrodes are shown in Figure 9 weighing a total of 580 grams. It is to note that the transformer weight alone weighs 350 grams, which can be replaced with a wave rectifier and a chopper circuit [20][21][22][23][24][25][26]. ECG device using an analog amplifier was designed and fabricated in this study to be used in the rural areas of Pakistan. The cost incurred to design the ECG device was only 9 USD (176 PKR/USD) and can be connected to an operating system (PC/Laptop, smartphone, or tablet) for real-time analysis. The development of the proposed GUIbased analog amplifier and detector was primarily focused on capturing and evaluating ECG signals with good accuracy. This robust ECG monitoring device can be used in biomedical applications especially for heart monitoring with its high Common-Mode Rejection Ratio (CMRR) and low input noise amplification. To reduce frequencyoriented noise, low and high-pass filters were designed with specific cutoff frequencies. The GUI showed a realtime simulation of ECG signals. The results exhibited were reliable and in compliance with IEEE ECG standards.

VI. FUTURE WORK
In the future, a compact implantable ECG device can be developed for round-the-clock e-health monitoring. This could also facilitate the doctor who could remotely assess the patient's health condition and can suggest medical attention incorporating the IEEE 802 biometric data sending/receiving wireless communication method. Further, an IoT-based management system can be a viable option to keep an update of a patient's record. A multilayer PCB design for minimizing the overall device size, reducing the signal noise and impedance sensitivity can be taken into consideration for high-speed processing in realtime. In addition, a small deep learning prediction model can be embedded on the microcontroller to automatically detect abnormality and report to the patient without the need for a doctor's presence. Visually aided TTS modules can be incorporated for special persons.