Digital ECG Phantom Design to Represent the Human Heart Signal for Early Test on ECG Machine in Hospital ECG

Electrocardiograph (ECG) is a diagnostic tool that can record the electrical activity of the human heart. By analyzing the resulting waveforms of the recorded electrical activity of the heart, it is possible to record and diagnose disease. Given the importance of the ECG recording device, it is necessary to check the function of the ECG recording device, namely by performing a device calibration procedure using the Phantom ECG which aims to simulate the ECG signal. The purpose of this research is to check the ECG device during repairs, besides that the Electrocardiograph (EKG) tool functions for research purposes on ECG signals or for educational purposes. Electrocardiograph (EKG) simulator or often called Phantom ECG is in principle a signal generator in the form of an ECG like signal or a recorded ECG signal. This device can be realized based on microcontroller and analog circuit. The advantage of this simulator research is that the ECG signal displayed is the original ECG recording and has an adequate ECG signal database. ECG This simulator also has the advantage of providing convenience for research on digital signal processing applications for ECG signal processing. In its application this simulator can be used as a tool to study various forms of ECG signals. Based on the measurement results, the error value at BPM 30 and 60 is 0.00% at the sensitivity of 0.5mV, 1.0mV, and 2.0mV, then the measurement results for the error value at BPM 120 are 0.33


I. INTRODUCTION
The heart is a muscular organ located in the space between the lungs (mediastinum) in the middle of the chest cavity. About two-thirds of the heart lies to the left of the mid-sternal line. The heart is covered by a membrane [1]. ECG is a diagnostic tool that can record the electrical activity of the human heart. By analyzing the waveform generated from the recording of the electrical activity of the heart, it can be seen from several aspects such as knowing the rhythm abnormalities in the heart, knowing the effect of drugs on the heart, knowing heart muscle abnormalities, estimating the enlargement of the heart, the value of the pacemaker function [2]. Based on the identification results from the background of the problem above, the author wants to develop a phantom ECG tool that is equipped with BPM, sensitivity and frequency selection with 12 channels including lead I, lead II, and lead III, aVR, aVL, and aVF, V1, V2, V3, V4, V5, and V6. as well as sensitivity selection of 0.5 mV, and 1.0 mV. Using the heart signal formation method with dac type mcp4921 which later is expected to be used for learning given the importance of studying ECG signals and the timing of ECG equipment on campus.
In 2016 a research entitled ECG simulator was also conducted by Anna Dawatus Solichah. The device uses arduino uno atmega 328P and DAC R/2R ladder. The results of this study did not mention the range of BPM values. The results and changes in this study include testing the R/2R ladder with a sine wave at a frequency of 1-100Hz. In a previous study by Willa Olivia and Arfian Ahmad in 2017 with the title design of an electrocardiogram calibrator using the AT89S51 microcontroller with 0800 series DAC to form a heart signal. However, the tool only has a heart rate of 30.60 and 120 BPM. Gregory Mario Tani in 2017 with the title ECG simulator phantom electrocardiograph. The method used is to use a Digital To Analog (DAC) IC type MCP4921 to form the desired heart signal. However, the device only has a heart rate value in the range of 30-110 BPM [3].
Furthermore, in 2017 Ni Nyoman Sri Malini also made an ECG simulator tool using the formation of an ECG signal with a 4017 IC counter and a NE555 clock. Unlike the DAC IC which can be formed according to plotting the original image of the heart signal, however, the 4017 IC counter used by Ni Nyoman Sri Malini still has a weakness in the use of capacitors, causing an imperfect ECG waveform in the ST segment and the large capacitor value affecting segment width and interval on the PQRST wave. [4] addition to this, related to BPM, there are also weaknesses in the frequency issued by the microcontroller so that the BPM is unstable. In 2018 the ECG simulator was also created by M. Ziko Alamanda with the title phantom ECG. The method used is to use a DAC type MCP4921 to form the desired heart signal. The ECG simulator has a BPM range of 30 -240 but the sensitivity selection is only 0.5 and 1.0 mV. In 2019 I Dewa Gede Budi Whinangun with the title microcontroller-based ECG simulator. The ECG simulator made is a 12 channel ECG tool which includes lead I, lead II, lead III, aVR, aVF, aVL, V1, V2, V3, V4, V5, and V6 which will be displayed on the ECG paper, and complete it with a selection selector. sensitivity and BPM as well as using the method of forming cardiac signals through the MCP 4921 type DAC. [2] Based on the weaknesses in previous studies that have been mentioned, among others, in 2016 a study was held with the title ECG simulator the weakness was that the range of BPM values was not stated. The results and changes in this study include testing the R/2R ladder with a sine wave at a frequency of 1-100Hz. In 2017 with the title design of an electrocardiogram calibrator using the AT89S51 microcontroller with a 0800 Series DAC. However, the tool only has a heart rate of 30, 60 and 120 BPM. in 2017 with the title ECG phantom electrocardiograph simulator. The method used is to use a DAC type MCP4921 to form the desired heart signal. However, the device only has a heart rate value in the range of 30-110 BPM. In 2017 Ni Nyoman Sri Malini also made an ECG simulator tool using the formation of an ECG signal with a 4017 IC counter and a NE555 clock. still has a weakness in the use of capacitors, causing the ECG waveform to be less than perfect in the S-T segment and the large capacitor value affects the segment width and interval on the PQRST wave. In 2018 ECG simulator the ECG simulator has a BPM range of 30 -240 but the sensitivity selection is only 0.5 and 1.0 mV. Year 2019 with the title microcontrollerbased ECG simulator. Based on the results of the identification of problems that exist from existing research, the authors want to develop and overcome these shortcomings by making a final project research entitled phantom ECG equipped with 12 leads and sensitivities 0.5mV, 1.0mV and 2.mV appear on the TFT display where the author is still using IC DAC MCP4921 for the formation of the output.

A. Experimental Setup
This study uses measurements of BPM values in the range of 30, 60, 120, and 180. The sensitivity values are in the range of 0.5mV, 1.0 mV, 2.0 mV. With data retrieval repeated for 6 times.

1) MATERIALS AND TOOL
This research uses ATMega 2560 microcontroller as data processing. The ATMega 2560 output is in the form of a display on a 2.4 Inc TFT as a display. This research uses the MCP4921 DAC IC as a signal formation with 12-bit resolution and a networking circuit that functions as a voltage distribution between leads.

2) EXPERIMENT
In this study, after the design was completed, testing was carried out using an ECG recorder, namely by looking at the suitability of the sensitivity 0.5 mV, 1.0 mV and 2.0 mV and BPM 30, 60, 120, and 180.

B. The Diagram Block
When the device is turned on, the display will start to initialize as shown in Fig. 1 which will display the sensitivity and BPM selection then we can set the BPM and sensitivity to issue a PQRST signal output, then the processed results from the MCU will be displayed on the TFT display. . While blocks LA, RA, LL, RL, aVR, aVL, AVF, V1, V2, V3, V4, V5 and V6 will receive the form of signals issued by the DAC in analog form which has previously been processed in the resistor network circuit block. This resistor network circuit block serves to provide a difference in impedance for each Lead.

C. The Flowchart
The arduino program is built based on the flowcarty as shown in fig. 2 When the tool is turned on in the initial conditions, an initialization process occurs on the TFT display. After that we can make the selection of BPM and sensitivity as desired. Furthermore, the selection of the data will be input into the microcontroller to be processed and forwarded to the DAC circuit to be converted from digital to analog, which will later be forwarded to the networking resistor then the incoming voltage will be distributed to each output in the circuit.

1) Main Circuit
On the TFT display there is a button for the regulation of bpm, Sensitivity, which will later be entered into the program command on the atmega 2560 which functions as a processor of the tool. Where the pins used are MOSI, MISO, SCK RST and GND which function to upload programs. Atmega 2560 can work when given a voltage of 4.5 -5.5 Vdc. (Fig. 3).

2) Circuit of DAC MCP4921
The DAC circuit is a circuit used for the microcontroller to communicate with the MCP4921 DAC through PIN CS, SCK and SDI. The microcontroller will provide a digital signal form through the program and the MCP4921 DAC will translate it into analog data with 12-bit resolution. (Fig.4)

III. RESULT
This study, the Phantom Ecg has been tested using a ECG Recorder (Digital Electrocardiograph, Model : ECG-9012A, SN : ECG-9012A120435). The result shows that the recording is feasible to record the ECG signal from the human body. The proposed design is shown in Fig. 6 and . Figure 6 is the analog and digital part of this design and Figure 7 is design box phantom Ecg.

THE PHANTOM ECG DESIGN
Analog photos and design series photos of phantom ecg are shown in Fig. 6 and Fig. 7. The analog circuit section consists of a resistor circuit and a DAC circuit. The voltage divider circuit consists of 18 resistors and the DAC circuit consists of a 1 capacitor circuit, a voltage divider circuit and the MCP4921 IC. There is also a variable resistor (multiturn 10k) for adjusting the sensitivity value of the result to produce the same amplitude.

THE LISTING PROGRAM FOR ARDUINO PHANTOM ECG
The listing below shows the void setup which functions as a function that can be executed only once when the program is started, and also contains the initialization functions used in the program such as the pins of the Arduino IC.

3) THE LISTING PROGRAM DAC INTERFACE
The listing contained in Pseucode 1. shows the program to send data that has been processed by the microcontroller to the DAC circuit for conversion into analog data.

5) Measurement Results of Each Increase in BPM
The error value on the Phantom ECG is obtained from the measurement results 5 times with BPM 30, 60, 120, and 180 with a sensitivity of 0.5 mV, 1.0 mV, and 2.0 mV. The error value at the BPM value of 0.5 mV is shown in Table I, the error value at the BPM 1.0 mV value is shown in Table II, and the error value at the BPM value of 2.0 mV is shown in table I.   Table II above is the result of calculating the average value and error value at BPM 30, 60, 120, and 180 using a sensitivity of 1.0 mV. In the table above it can be seen that the highest error value is at BPM 120 with an error value of 0.33% and BPM 180 with error value of 0.22%.

IV. DISCUSSION
In this study, measurements of BPM values ranged from 30, 60, 120 and 180 with sensitivity of 0.5mV, 1.0mV, and 2.0mV using an ECG recorder with data retrieval 5 times.
There is a similar signal pattern, consisting of P, Q, R, S, and T waves at the signal output. Based on the measurement results, the error rate value is 0.00% at BPM 30 and 60 with a sensitivity of 0.5mV, 0.1mV and 2.0mV. Furthermore, there is an error value at BPM 120 of 0.33% at a sensitivity of 0.5mV, 1.0mV and 2.0mV, and there are values error at BPM 180 is 0.22% at sensitivity 0.5mV, 1.0mV and 2.0mV.
The weakness of this tool is that the selection of the BPM value is only capable of up to 180 BPM, because the memory capacity of the ATmega2560 microcontroller is full (low memory). Because the TFT display itself requires a lot of memory. This causes the BPM values of 240, 280, and 300 to not work. And also the aVL signal waveform is still not compatible with the comparator. The benefit of this research is as a tool to study various forms of ECG signals and also to provide convenience for further research on digital signal processing applications used for processing ECG signals.

V. CONCLUSION
The purpose of this study is to make a Phantom ECG on a 12 channel ECG device which includes lead 1, lead II, lead III, aVR, aVF, aVL, V1, V2, V3, V4, V5, and V6 and is equipped with a sensitivity selection of 0.5mV, 1.0mV and 2.0mv. From this research it can be concluded that Phantom can be made using Atmega2560 as a data processing microcontroller. then after processing the data it will pass through the MCP4921 DAC IC to convert analog data into digital data as a form of heart signal, after that it passes through a resistor network circuit as a current channel so that a signal can be formed on each lead and also uses a 2.4-inch TFT nextion as a screen. Based on the measurement results, the error value is 0.00% at the BPM values of 30 and 60 for each sensitivity, namely 0.5mV, 1.0mV, and 2.0mV. In the measurement of BPM 120, the highest error value is 0.33% at the sensitivity of 0.5mV, 1.0mV and 2.0mV. And for the BPM 180 measurement, the highest error value is 0.22% at a sensitivity of 0.5mV, 1.0mV and 2.0mV.
From the results of the research that has been done, the following are some suggestions that can be made for further research, namely, comparing the results of the phantom ECG with a comparison phantom ECG that is calibrated and suitable for use, using a microcontroller that has a storage capacity and storage capacity greater, the patient cable socket using a socket that is the same as the original tool, optimizing the formation of BPM on the module because the BPM value on the module only reaches BPM 180, changing the resistor value so that the shape of the AVl signal is not reversed, using a larger TFT screen.