Development of Low-Cost ECG System for Comprehensive Monitoring Heart Function

A simple system, a low-cost, fully automated, and design for monitoring RR interval Electrocardiography (ECG) signal described in this paper. The platform, named Simple Low-Cost Electrocardiography System (SLES), is capable of monitoring RR interval and R peaks in 3 lead standards. The system is in .exe format, so it can be easily installed on a computer. The system's goal is to design a fully integrated system for measuring a characteristic of Heart Rate Variability (HRV) parameters for various applications in heart signal research and education. The ECG signal is analog ltered and amplied and processed from analog to digital. Eventually, the ECG signal will be shown on the monitor after digital ltering. The data obtained from the ECG will accurately reect the status of human heart health. The system has the benets of small volume, low power consumption, low cost, and real-time operation. All design and development reports, les, and system software will be given non-commercial use online on https://github.com/oktivasari.


Introduction
The heart is an organ that is vital for the human body. The emergence of abnormalities in the heart can be fatal for patients. At present, a device has emerged that provides health monitoring of vital signs that allow for free movement and observation during regular patient activity. For decades, arrhythmias have been the primary cardiovascular disease. It is very vital to identify heart disease. Heart activity can be recorded as ECG. The use of ECG for individuals is still minimal, expensive, and licensed. Currently, monitoring of heart signals can be done manually by individuals. Also, it can be independent, scheduled control, and e cient through the application of ECG systems in hospitals [1], [2], [3] with various ECG platforms or operating systems [4].
For example, the rst heart monitoring device, called an ECG heart rate monitor, was introduced in 1977, and wireless personal heart monitors in 1983 [5]. In 2012, the ECG signal acquisition circuit's architecture was implemented in detail, which included analog ltered, ampli ed, digital eld, displayed in the LCD after digital low-pass ltering in Digital Signal Processing, and the collected ECG data process [6]. Still, there are limitations because it uses the high-cost chip TMS320VC5509A [6].
The design of ECG data acquisition and processing systems is mainly achieved through the use of microcontrollers. Nevertheless, its processing functionality is restricted, and its storage capacity is too small, so it can not access old and complicated acquisition signals [7], and the limited digital data stream can only be saved on an SD memory card, allowing the ECG signal to be processed later on the Computer The ECG ampli er shall have a high input impedance, low output impedance, minimal bandwidth, and power-e cient as possible [8]. Besides, it should have a reasonable cost, a high power-supply-rejection ratio (PSSRR), and a common-mode rejection ratio (CMRR) [8]. Instrumentation ampli ers are needed to suppress unwanted common-mode signals.
One method to monitor heart conditions is to use the HRV method. HRV is a physiological phenomenon in which the time intervals between heartbeats have different values. Various things can affect HRV, including the in uence of the autonomic nervous system, tness, Body Mass Index (BMI), blood volume returning to the heart (venous return), respiration, arrhythmia, etc. [9]. In this study, it is being presented the development of a simple, a low-cost ECG solution with an integrated system in it, which can identify R-R intervals and average HR by using the time domain's HRV method. In the system, there was a statistics & histogram menu for monitoring the value of the RR interval per second, P onset-offsets, QRS onset-offsets, T-onset, amplitude, ISO level, and ST level. All values of the features will be processed into input for the HRV analysis.
As mentioned above, many technologies and tools have been developed, as existing systems are too costly for tracking heart signals and too big for individuals to purchase and use in real-world applications [8]- [12]. Furthermore, no fully open-source ECG framework will allow for modi cations for different purposes. So we are proposing a new open source in .exe le, simple system, small and inexpensive system that can store heart signals in real-time.
We have developed a completely simple ECG system (SLES) equipped with an AD 8232 sensor, and the National Instrument (NI) My-DAQ and ECG Sensor. The advantage of AD 8232 is a low cost, low power, portable (dimensions: 3.5 cm x 3 cm), has a fast recovery feature, thus improving lter settings and CMRR 80 dB (dc to 60 Hz), can apply gain and to lter out near dc signals simultaneously, and fully integrated single-lead ECG front end, with a special biological signal conditioning function, especially for the ECG signal conditioning from and the output is an analog [13,14,15,16]. NI My-DAQ is a low-cost data acquisition device that uses NI LabVIEW-based software to measure and analyze real-time signals.
In this study, several variable's values are obtained from the ECG record [14], average NN interval/heart rate, the deviation between the minimum and maximum NN intervals/heart rate, the standard deviation of the NN interval/ standard deviation of the NN interval (SDNN), NN 50, pNN50 and RMSSD [15]. Compared to similar devices at low prices [16]- [18], there are advantages to our system can detect normal heart function conditions in real-time. Many commercial ECGs involves high costs for infrastructure, software, operations and maintenance, and user training. In contrast to the ECG that we design, it is cheaper and easy system redesign and implementation with the block diagram and experimental setup uses three leads, the standard bipolar limb lead, and ECG system represented with the waveform, which the upright axis, is the amplitude (mV or V), while the horizontal axis is time (seconds or milliseconds) [19,20,21], shown in Fig. 1. This experiment, although low-frequency noise caused by member movements can occur [1] and [22].
Characteristic features of the designed device are: low cost per unit, low power requirement, create a le with a two-second entry in the form of the same heart signal and can thus be imported directly to the monitor, the ready availability of components and ease of construction, capability to use .exe through the multiple operating systems, the possibility to scale-up a large number of devices, ability to monitor battery voltage, power to run on 12 V batteries, available to monitor RR interval in real-time, easy to assemble and modify all system resources. One signi cant difference between our system and the previous platform is that our system transmits data in real-time and saves a graph of the heart signal to the monitor. Platform dimensions are 20 cm × 15 cm × 7 cm (width × length × height), and weigh about 1 kg, input 5 V, output 0-5 mV, AD8232 input 3.3 V, and output 0-5 V, allowing portability and accessibility for monitoring in the indoor or outdoor environment.

Results
In this segment, we compared SLES with commercial ECG. We developed an ECG system to collect data every 10 seconds and send it to a computer for further storage and analysis. Compared with commercial ECG 12 leads products, we use V5 data from commercial ECG transmission to be as fair as possible with data available from our products, which only uses three standard leads. The ECG signal's comparison result with three leads, and the commercial ECG 12 lead products in the Hospital is shown in Fig. 2. Data collected at the Hospital, with average patient age of 40-70, and most have heart defects. One of the purposes of capturing ECG data was to see all the ripples on the graph ( Fig. 2b and 2c).
Various ampli cation and ltration tests have been conducted during electrocardiogram signal processing to minimize noise (Fig. 2d). The performance of all the ECG devices (statistics-histogramwaveform) tested were shown in Fig. 3a. The signal results for Fig. 2-3 were taken from the same respondents.
The results of the processing of two programs, ECG features extraction and HRV method in the time domain of the HRV analysis, were shown in the statistics & histogram menu. The illustration in Fig. 3 showed the time domain HRV and the signal for the sample with exercise and relaxation on the same respondent with fewer exercise conditions. The histogram in Fig. 3a tends to spread out, indicates that the heart rate before doing the exercise was less and the variable time interval. On the other hand, the histogram shape in Fig. 3b tends to be closer and dominant at a particular time axis point. The histogram indicates that the heart rate after doing more exercise is constant at intervals that are typical to be the same. An increase in the mean HR value because exercise expends energy, making the heart rate work harder. Increasing the mean HR value will result in a decreased mean RR because the RR interval's time size is inversely proportional to the mean HR.
The histogram (Fig. 3) at the top tends to spread out and indicates that the heart rate before exercising is less and the variable time interval. In contrast, the shape of the histogram at the bottom tends to be closer and dominant at a particular time axis point, that the heart rate after doing more exercise is constant at intervals that are typical to be the same. Values that were processed from ECG feature extraction are displayed in various features, while the HRV analysis results were shown in statistics and histogram tabs. The signi cance of irregular heartbeat depends on various factors, such as the ECG pattern produced, the frequency and length of activities, the frequency, and duration of events, combined with other symptoms identi ed simultaneously [23]- [25]. Regular monitoring for a long time provides a record of heart activity during daily life.
Many factors may affect the HRV index, such as gender, insulin resistance, BMI, hyperlipidemia, hypertension, ischemic and non-ischemic cardiomyopathy, and smoking status [26]- [28]. For example, an increased BMI can independently decrease HRV, particularly central adiposity, such as the class of hypertensives [28].
Participants were divided into four BMI levels (gender, weight, and height) and based on physical activity, by answering questions about physical activity habits, with options for each intensity (number of sports activities in a week, exercise duration, type of exercise (low, moderate, and heavy)). This test will focus on categories of BMI values, ideal and overweight. Standard BMI for Indonesian (Table 1), and formula in equation 1 [29]. Class 1 and 2 consists of males with a BMI value of 18-25 kg/m 2 or ideal category, and with a BMI value of 25-27 kg/m 2 , the category fat [30]. Simultaneously, group 3 consists of the ideal class of women with a BMI value of 17-23 kg/m 2 . Otherwise, obese women with a BMI value of 23-27 kg/m 2 were in class 4. Table 2 showed the RR and HRV values' results for each class that there was an increase in the HR value and a decrease in the RR value for conditions from relaxation to exercise [31].
See formula 1 in the supplementary les.

Discussion
The main ndings in this study were: (i) a simple and a low-cost system; (ii) the system can record RR and HR values for further analysis; (iii) signal quality similar to ECG commercial tool. The SLES provides real-time monitoring of heart function.
Patients can e ciently operate the device themselves and can save the signal results for consultation with doctors. In this study, the detection of R wave to R wave intervals was a feature that plays an essential role in the HRV method, with the mean and HR mean RR values contained in the time domain.
From the results of the heart signal images before and after exercise in Fig. 3, tended to experience a density and an increase of 4 beats in the 10-second sample of sampling, concluded that the signal pattern after exercise would increase the rate because it releases energy and makes the heart work harder.
Compared with the results of other studies with the much more expensive ADAS tool for three leads [32], the results in Fig. 3 shown there was no signi cant difference in the quality of the recorded signal. The results were the same without any signi cant difference compared with the signal from hospital commercial ECG equipment (Fig. 2a).
The test was carried out on 20 participants with four groups according to BMI value and gender. Class 2 and 4, which contain overweight male and female subjects and less exercise, tend to have a high HR mean above 100 bpm after exercise ( Table 2). All classes after exercise showed an increase in HR values and a decrease in RR values. The value of BMI and activity can be one factor that can affect the heart's work because a more signi cant body requires more oxygen-lled blood to ow to all body tissues, so the heart has to work harder. Besides, the heart in the body that rarely did exercise tends to beat faster. In contrast to people who often did sports, the heart will beat more stable.
This study's limitations were diagnostic decision automation, which will need to develop proper ECG control and a su ciently adequate database, privacy, and security [18] for future work. The R-R can represent important information about physiological stress and fatigue levels during and after training [33][34]. In incorporation P onset-offset value, QRS onset-offset, T onset-offset, ST level, and R peaks, the addition of physiological outcome measures, such as stress levels, physiological, and body mass index structure, would allow a more exible and affordable option for an individual monitor. We also designed a versatile system for further improvements, such as Bluetooth, Wi-Fi, prints, etc.
A single product's overall price is estimated at $ 30 for the 3-lead model, with more production leading to reduced prices. Commercial research-level ECG devices in the Hospital can be costly around. In the market, a 12 channels commercial ECG used in hospitals costs around $ 1,093.99-16,950, and a three channels commercial ECG with a hospital scale is in the range of $ 900-1500, with a variety of products from several countries. Low-cost ECG is becoming more readily available, but the challenges mentioned above are limited. This ECG design is a low cost because the system is formed in format .exe and then made an installer that can include the LabVIEW Run-Time engine (free). It makes the device easily adaptable to the learning needs of students, researchers, or doctors. The complete hardware is available in Table 3. We discuss a description of our hardware's architecture, together with software that runs on devices available online on https://github.com/oktivasari. SLES is what we plan to focus on in the future, such as supporting laboratories for hardware-based education and adding other detection components for a complete hearth functionality detection approach.

Methods
Operating Procedure of ECG Hardware. The operation of the tool starts with attached three electrodes to the cable, connected the cable with the AD8232 module, and adjusted AD8232 with NI My-DAQ by con guring pins. The 3.3V IN pin on the AD8232 is coupled to + 5V on the NI My-DAQ, GND PIN on AD8232 connected to AGND pin on M-DAQ, the output on pin AD8232 was connected to pin Ai1 on NI My-DAQ, connected NI My-DAQ with computer via USB cable; attached the electrodes to the patient, provided that: red pad electrode was positioned on the right arm of the patient, a yellow electrode was placed on the patient's left arm, and a green electrode was placed on the patient's leg [19]. Finally, the ECG system (.exe) was opened, then checked the database and ECG signal data to ensure the tools can run properly.
Operating Procedure of ECG System. System operation includes installation of the system ECG, open the ECG system, run the ECG system after nished connecting the device, open the waveform menu to see the ECG signal, where the y-axis is amplitude. The x-axis is time, and we can see the signal before and after ltering.
Method of Noise and Filtering. One of the biggest challenges with ECG hardware is noise reduction. Noise elimination is done by ltering the signal both with high pass lters and low pass lters. In this tool, AD8232 works as a lter. The ability to amplify small ECG signals and eliminate the effects of DC signal offset voltages caused by op-amp and offset internal offsets due to the less ideal non-polarizing effect of the electrodes. The primary forms of noise are Baseline Wandering, which gets superimposed on a biopotential signal. Baseline Wandering usually originates from breathing at wandering frequencies between 0.15 and 0.3 Hz. In this experiment, Baseline Wandering was eliminated. Digital highpass lters or wavelet transforms are used to eliminate baseline wandering by eliminating trending ECG signals. After removing Baseline Wandering, the resulting ECG signal is stationary and explicit than the original signal.

Data Availability
The data that support the ndings of this study are available from the corresponding author upon request.  Table 3. Bill of materials (ECG system). Figure 1 The ECG system. (a) Block diagram of a simple ECG system. The system includes an electrode sensor, three leads, AD8232 module as an ampli er and lter, MyDAQ module for data acquisition device, and a monitor to display data. The electrode sensor captures the cardiac biopotential signal. Signals collect and process by data acquisition device, and results can be shown on a monitor by the ECG system. (b) Experimental setup for testing of the ECG system. In the heart signals measurement, the electrode sensor is placed in the right arm, left arm, and left leg. (c) Screenshot of a recorded ECG system. The system displays RR intervals, average HR values from the ECG feature array, and waveform and statistichistogram.

Figure 2
The comparison signals of the commercial ECG 12 leads (a) and signals of a recorded 3-leads ECG le (b) before and (c) after ltered in 4 seconds. The data was taken directly from the same patient in the hospital. (d) ECG signal before and after ltered in 5 seconds. ECG signal was better after ltering.