Twelve Channel ECG Phantom Based on MEGA2560 and DAC-MCP4921

Electrocardiograph (ECG) is one of the diagnostic sciences that is often studied in modern medicine, one of which is to diagnose and treat diseases caused by the heart. Therefore, it is necessary to check the function of the ECG recorder tool, namely by carrying out the tool calibration procedure using Phantom ECG. The purpose of this research is to design a Phantom ECG for a 12 channel ECG device which includes lead I, lead II, lead III, aVR, aVL, aVF, V1, V2, V3, V4, V5


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 midline of the sternum. The heart is covered by a membrane called the pericardium. The heart consists of four chambers, namely the left and right atria, the left and right ventricles. [1] Electrocardiograph (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. Phantom ECG is a tool for simulating ECG signals. This device is useful for testing ECG devices during repairs, for research purposes on ECG signals or for educational purposes. The ECG simulator or often called phantom ECG is in principle a signal generator in the form of an ECG like signal or an ECG signal that has been recorded. [2] Research on phantom ECG was conducted by Anna Dawatus Solichah in 2016 with the title ECG simulator. The tool uses arduino UNO ATMEGA328P and DAC R/2R ladder. The results and discussion in this study include testing the R/2R ladder with a sine wave at a frequency of 1-100Hz. Then it was further developed by Willa Olivia and Arfian Ahmad in 2017 with the title design of an electrocardiogram calibrator using an AT89S51 microcontroller with 0800 series DAC to form a heart signal. The device only has a heart rate range of 30, 60, and 120 BPM. [3] Then Gregory Mario Tani in 2017 with the title ECG simulator (phantom electrocardiograph). The device uses a digital to analog IC (DAC) type MCP4921 to form the desired heart signal. The only drawback of this tool is the heart rate value in the range of 30-110 BPM. [2] It was further developed by Ni Nyoman 74 Homepages: teknokes.poltekkesdepkes-sby.ac.id Sri Malini in 2017 to make an ECG simulator tool using the formation of an ECG signal with a 4017 IC counter and a NE555 clock. In contrast to the IC DAC which can be formed according to plotting the original image of the heart signal, IC counter 4017 still has a weakness in the use of capacitors, causing an imperfect ECG waveform in the S-T segment and the large capacitor value affects the segment width and interval on the PQRST wave. The ECG simulator has a BPM range of 30-240. In addition, BPM also appears to be weak in the frequency issued by the microcontroller, so that BPM is not stable. [4] In 2018 the ECG simulator was developed by M. Ziko Alamanda with the title phantom ECG. The advantage of this tool is that it already has a BPM range of 30-240 and uses a digital to analog IC (DAC) type MCP4921 to form the desired heart signal. However, the drawback of this tool is that it only has a sensitivity selection of 0.5 and 1.0 mV. [5] In 2019, the research was continued by 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 ECG paper. This tool is equipped with a sensitivity selection selector and BPM and uses the method of forming a heart signal through the MCP 4921 type DAC. [6] Based on the identification of the research above, the author intends to design a phantom ECG. Where this tool is equipped with sensitivity selection, beats per minute (BPM) and uses a digital to analog converter type MCP4921 as a heart signal formation. Therefore, this study aim to develop a phantom ECG that can be used as a 12 channel ECG tool calibrator which includes lead I, lead II, lead III, aVR, aVL, aVF, V1, V2, V3, V4, V5, and V6 and completes it with sensitivity selection.

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.5 mV, 1 mV, and 2.0 mV. With data retrieval repeated for 5 times. This research uses ATMEGA2560 microcontroller as data processing. The ATMEGA2560 output is in the form of a display on a 2.4-inch TFT Nextion as a display. This study uses the MCP4921 DAC IC as a signal formation with 12-bit resolution and a resistor network circuit that functions as a voltage distribution between leads. An ECG Recorder (Digital Electrocardiograph, Model: ECG-9012A, SN: ECG-9012A120435) was used as a measurement tool for the Phantom ECG module. The Fluke Biomedical Phantom ECG (Model: MPS450, PN: 3789865) was used for comparison with the module. In this study, after the design was completed, the output signal of this module was tested using the Phantom ECG comparison module which was recorded with the ECG Recorder. Data collection for each BPM was carried out 5 times each with sensitivity settings of 0.5 mV, 1.0 mV, and 2.0 mV.

B. THE DIAGRAM BLOCK
As in FIGURE 1, when the tool is turned on, the display will display the sensitivity and BPM selection while the microcontroller will wait for commands from the settings for the sensitivity and BPM selection to be selected. After setting the selection, the processed results from the microcontroller will be forwarded to the DAC (Digital to Analog Converter) circuit to convert digital data to analog, and the microcontroller settings will be displayed on the TFT display. After that the analog data will be forwarded to the Resistor Network block, which serves to provide the impedance difference for each lead. Then blocks RA, LA, LL, RL, aVR, aVL, AVF, V1, V2, V3, V4, V5, and V6 will receive the form of a signal that is issued by the DAC in analog form which has previously been processed in the Resistor Network block.

C. THE FLOWCHART
When the tool is turned on, the display will light up and there is a BPM and sensitivity selection. After setting, the microcontroller will work so that the digital signal will be converted into an analog signal. Then there will be a current distribution in the resistor network circuit which serves to provide impedance differences in each lead so that the signal can come out according to Leads I, II, III, aVR, aVL, aVF, V1, V2, V3, V4, V5, and V6. The module flowchart is shown in FIGURE 2.

D. ANALOG CIRCUIT
The important part of the development of this module is the analog circuit depicted in FIGURE 3 digital to analog converter circuit) and FIGURE 4 (resistor network circuit). Both circuits are used in processing the signals issued by the microcontroller.

FIGURE 3. Digital to Analog Converter
The DAC circuit is a circuit used for the microcontroller to communicate with the MCP4921 DAC, namely through the CS, SCK, and SDI PINs. 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.

III. RESULT
In this study, the Phantom ECG was tested using a Fluke Biomedical Phantom ECG comparison module (Model: MPS450, PN: 3789865). The test results show that the BPM and module sensitivity settings are in accordance with the comparison tool. The printout produced by the Phantom ECG module is shown in FIGURE 5 which was recorded using an ECG Recorder (Digital Electrocardiograph, Model: ECG-9012A, SN: ECG-9012A120435).

FIGURE 5. Phantom ECG Printout Results
To find out the number of BPM that is read on the results of the ECG recording, it can be calculated by: The design of the Phantom ECG module uses an ATMEGA2560 microcontroller, a DAC (Digital to Analog Converter) circuit using MCP4921 which functions to convert digital data from the microcontroller into analog data, as well as a resistor network circuit as a current distribution for the outputs of Lead I, II, III, aVR, aVL, aVF, V1, V2, V3, V4, V5, and V6, and uses a 2.4-inch TFT Nextion display.  190. 191. 192. 193. 194. 195. 196. 197. 198. 199 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 0.5 mV sensitivity is shown in Table 1, the error value at 1.0 mV sensitivity is shown in Table 2, and the error value at 2.0 mV sensitivity is shown in Table 3.

IV. DISCUSSION
The microcontroller will work when the BPM and sensitivity have been set. From the selection, the microcontroller will send digital data according to the settings, then it will be sent to the MCP4921 DAC (Digital to Analog Converter) which functions to convert digital data from the microcontroller into analog data. The analog data generated by the MCP4921 DAC will be forwarded to the resistor network block which functions to distribute the current from the analog signal so that the appropriate ECG signal output will appear on each lead.
In this study, the results of BPM measurements at BPM 30, 60, 120, and 180 were carried out by taking data five times by measuring using an ECG Recorder. From the five data that have been taken, the measurement error value with a sensitivity of 0.5 mV at BPM 30 is 0.00%, BPM 60 is 0.00%, BPM 120 is 0.00%, and BPM 180 is 0.56%. The measurement error value with a sensitivity of 1.0 mV at BPM 30 is 0.00%, BPM 60 is 0.00%, BPM 120 is 0.00%, and BPM 180 is 0.56%. The measurement error value with a sensitivity of 2.0 mV at BPM 30 is 0.00%, BPM 60 is 0.00%, BPM 120 is 0.00%, and BPM 180 is 0.56%. The results obtained from this study, when compared with previous studies, this study has a lower error rate, namely the largest error value is only 0.56% at BPM 180 with a sensitivity of 0.5 mV, 1.0 mV, and 2.0 mV. While at BPM 30, 60, and 120 the error value is 0.00% with a sensitivity of 0.5 mV, 1.0 mV, and 2.0 mV. This Phantom ECG uses a 2.4-inch Nextion TFT as a display as well as a BPM and sensitivity selection function. This study has weaknesses and limitations, namely only able to issue ECG signals with 3 sensitivities, which are 0.5 mV, 1.0 mV, and 2.0 mV and BPM 30, 60, 120, and 180 only. This is because this study uses a 2.4-inch TFT Nextion display whose program takes up quite a lot of memory on the ATMEGA2560 microcontroller, so its capacity is limited to BPM 30, 60, 120, and 180 only.

V. CONCLUSION
The purpose of this research is to design a Phantom ECG for a 12-channel ECG device which includes lead I, lead II, lead III, aVR, aVL, aVF, V1, V2, V3, V4, V5, and V6 and completes it with sensitivity selection. From this research, it can be concluded that the Phantom ECG can be made using the ATMEGA2560 microcontroller and using the MCP4921 DAC (Digital to Analog Converter) to convert digital data to analog, and using a resistor network block to distribute the current so that a signal can be formed on each lead. The following suggestions can be considered for improvement from the research that I developed, namely changing the resistor value at the aVL output so that the signal shape matches the comparator, and the connector cable socket uses the same socket as the original device.