Bedside Monitor Based on Personal Computer Using STM32F7 Microcontroller

A vital sign examination is one of the important indications used to establish the diagnosis of a disease and is useful for determining the medical treatment plan needed for the patient. An electrocardiograph (ECG) is a parameter in medical equipment used in the process of measuring the electrical activity of the heart muscle by measuring biopotential differences from the body surface. In 2016, cardiovascular disease was the number-one cause of death in the world. This happens because the detection of cardiovascular disease is often late, so a monitoring tool is needed that can monitor the patient's condition quickly and efficiently. The purpose of this research is to create a tool that is used to facilitate the monitoring of patient conditions. The implication of this research is that in the many cases where the signal produced is not perfect and there is still a lot of noise, this can be overcome by using the STM32F7 microcontroller, which has a 16-bit resolution, so that the resulting signal will be better, smoother, and have less noise. produced is very small. The method used in this study was to use a phantom ECG as a comparison and to use five respondents whose BPM values were to be compared with another comparison using a pulse oximeter. The design of this tool uses an ECG analog circuit that is placed on the patient's lead II leads to detect the patient's electrocardiograph signal. Data processing will be done using the STM32F7 microcontroller, and the results of the data processing will be sent to the PC using Visual Basic. The results showed that the BPM error value using a phantom ECG was 2.5%. While the smallest error value is 0,83%. In BPM measurements using 5 respondents, the largest error value was 0.9% and the smallest error value was 0%. The results of these tests indicate that this module can be used to monitor the value of each parameter in accordance with the plan.


I. INTRODUCTION
The determination of health can be done by examining TTV (Vital Signs).An examination of a patient's vital signs is a measurement of the most basic body functions to find out clinical signs, is useful for strengthening the diagnosis of a disease, and functions in determining the medical treatment plan needed by the patient [1].Monitoring and diagnosis to detect the presence of a disease can be done using ECG and SpO2.Combining information from ECG and SpO2 signals can improve the accuracy of calculating heart rate (HR) on patient monitors in real-time [2].A change in vital signs in a patient can occur when the body is sick or in a state of fatigue.These changes are an indicator of a systemic disorder in the patient's body.Vital signs that are usually used by the medical team to determine a patient's condition include blood pressure, body temperature, oxygen saturation, pulse, and respiratory rate [3].The heart is one of the body's most important organs and also a vital organ that works non-stop [4] [5].Pulse, or heartbeat, is an important indication in the health sector and is useful as an evaluation material that is relatively effective and fast to determine the condition and health of a person's body [6].Based on data from The Institute for Health Metrics and Evaluation (IHME) (2016), it shows that deaths in the world caused by heart and blood vessel disease have reached 17.7 million people, or around 32.26% of total deaths in the world.Most, or 63%, of deaths from heart disease (cardiovascular) were patients over 70 years old, 29.13% aged 50-69 years, and 7.61% aged 15-49 years [7].This happens because the detection of cardiovascular disease is often late.Cardiovascular disease detection can be done by examining the electrocardiogram (ECG) [8].The electrocardiogram (ECG) signal has been proven to be a potential biometric for use in diagnosing arrhythmias or pathologies in the human body that use non-invasive methods in their examinations.One of the important pieces of information that can be extracted from the ECG signal is the electrical activity of the heart that forms the PQRST wave [9].The P wave represents atrial depolarization, the QRS complex represents ventricular depolarization, and the T wave represents ventricular repolarization [10].Normal adult heart rates range from 60 to 100 bpm.Heart rate abnormalities can occur when the rate is less than 60 bpm, which is known as bradycardia.In addition, heart rate abnormalities can also occur when the rate exceeds 100 bpm, which is known as tachycardia [11] [12].
Considering this health information, researchers are interested in designing a reliable health monitoring system.The health care data is collected using sensors that are connected to communication devices such as PCs to provide the health care services that users need.The development of microcontroller technology in control systems involving software is not new.The application of microcontroller systems is carried out in various fields such as telecommunications, automotive, household appliances, robotics, medical equipment, and computers [13].One example of the development of the microcontroller is the ARMCORTEX STM32 microprocessor [14].The STM32 is a microcontroller with a core process using the ARM Cortex-M7, which has high performance with a clock speed of 216 MHz.With this high clock speed, the STM32 has a larger resolution of 16 bits when compared to other types of microcontrollers.This is what causes the signal results using STM32 to be smoother when compared to other micros [15].
Based on a literature search, Agnia Nerlika conducted research on electrocardiography (ECG) using a personal computer (PC).The aim of this research is to create an ECG instrumentation system that can be displayed on a PC.The advantage of this research is that the ECG signal is read using the AD8232 sensor so that the resulting signal has less noise, and the signal results will be displayed on a PC so that it is more modern.However, this study only displays the shape of the ECG signal, does not display the BPM value, and does not yet have the SpO2 parameter [16].Salwin Anwar conducted research by creating a design for an electrocardiograph device that appeared PC.In this study, the aim was to monitor heart signals using a PC.The advantage of this research is that the ECG signal processing uses a digital process so that the resulting signal is not interfered with by noise caused by PLN grids or noise generated from the body.The research results will be displayed on a PC using the Delphi application.The drawbacks of this study are that it only displays ECG signals without displaying the BPM value of heart rate, does not use the SpO2 parameter, and is not portable [17].Furthermore, Hidayatullah et al have conducted research on a heart rate measuring instrument using a PPG-based photodiode sensor and an ATMEGA32A microcontroller.This study aims to monitor ECG and BPM values by utilizing infrared LEDs as light sources and photodiodes as light detectors.The advantage of this study is that it uses a sensor for measuring heart rate, so the resulting signal has less noise when compared to using an analog circuit.However, this study has a drawback, namely that it does not have the SpO2 parameter [18].Rohadatul Aisy conducted research on cardiac monitors with PC-based ECG parameters.This study aims to develop previous research by combining the two tools in previous research, namely ECG and PPG.The advantage of this study is that the ECG parameters used have displayed the signal as well as the BPM and PPG parameters, which display the signal simultaneously, and have obtained information about the first heart sound (S1) against the intercepted heart signal.The drawback of this research is that the experimental results displayed on the PC are not equipped with ECG signal analysis results and do not have SpO2 parameters [19].Yunarni conducted research on a 3-channel ECG using Arduino.This study aims to monitor the ECG signal that will be displayed on the PC.The advantage of this research is the number of channels used to display ECG signals.Where the number of channels used is 3-channels, while in other studies only 1-channel is used to display ECG signals.The resulting signal displayed on the PC using the Delphi interface is in the form of an ECG signal with leads I, II, and III.The drawbacks of this study are that it does not yet have SpO2 parameters and is not portable [20].Sollu et al have conducted research on monitoring heart rate and body temperature using an Arduino microcontroller.This research succeeded in implementing a heart rate and body temperature monitoring system through the application of sensors and fundamental research and is useful in reducing the burden on medical personnel and preventing diagnostic errors from occurring.The advantage of this study is that the ECG signal using the AD8232 sensor has less noise.The tool is also equipped with an LED indicator that is used to see whether the sensor is working properly or not.If the sensor can work properly, the indicator LED will light up, and if it cannot, the indicator LED will turn off.The signal results from this study will be displayed on the PC.However, the drawbacks of this study are that the BPM values obtained are inaccurate, and the resulting signal is unstable because it is influenced by improper electrode placement, and is not equipped with the SpO2 parameter [21].Furthermore, Reyhan Issatyadi conducted research on the 12-lead ECG tool using the STM32F401 microcontroller.This study aims to monitor the patient's heart condition using 10 leads on 12 leads.The advantage of this study is that it uses the STM32 microcontroller to process ADC data so that the processed data will be displayed on the PC.By using the STM32F4 microcontroller, the resulting signal will be smoother with less noise because the STM32F4 has a higher resolution than other types of microcontrollers.However, this study only used ECG parameters, did not yet have SpO2 parameters, and did not display the patient's BPM [22].Indra Yessianto et al. also conducted research on monitoring heart signals using Arduino.This study aims to monitor the heart condition and BPM value.The advantage of this study is that the results of examinations that have been carried out on patients will be sent directly to the patient's WhatsApp.The drawback of this study is that it does not yet have SpO2 parameters and does not display SpO2 signals [23].Muhammad Nezar Abdullah Mufarid conducted research on central monitoring via wireless.This study aims to monitor ECG signals and BPM values from patients through a wireless system or without using cable media for data transmission.The advantage of this study is that there is an alarm or buzzer system that is used as an indicator of danger during inspection.The drawback of this study is that it does not have SpO2 parameters to monitor SpO2 signals and oxygen saturation values in patients [24].Rahul Kher et al conducted an ambulatory ECG recording study using the STM32L431xx.This study aims to develop a portable device that can monitor patient ECG signals displayed on an OLED and transmit them to a PC via the HC-05 Bluetooth module.This monitoring system can help doctors directly monitor human heart abnormalities.The advantage of this study is that it uses the STM32L4 microcontroller, so the resulting signal has a small amount of noise but a smoother signal.However, this tool does not display BPM values and does not have SpO2 parameters [25].
Based on the literature search that has been described above, it can be concluded that there are still many previous studies that have not been able to display a heartbeat signal; some have not displayed the BPM value of the patient; and some do not have SpO2 parameters.When viewed from the point of view of the microcontroller used in previous studies, it still uses Arduino, Atmega, and ESP-32 and has not used the STM32 type microcontroller.This causes the signal generated from the three microcontrollers to not produce a perfect signal, and the resulting noise is also very large.Therefore, the purpose of this study is to make a Bedside Monitor tool Using the STM32F7 Microcontroller Show PC (ECG LEAD II) that will display ECG signals and SpO2 signals along with BPM and SpO2 values from patients using the Visual Basic application with the aim of facilitating the monitoring process.patient's ECG and BPM signals.The contribution of this study is to combine two parameters, namely ECG and SpO2, by displaying the signal and also the value of these two parameters, which aim to monitor and monitor the patient's condition to avoid unwanted conditions, and the patient immediately gets more appropriate treatment related to the patient's vital condition.

II. METHOD
In this study, BPM values were taken using a phantom ECG as a comparison, and using 5 respondents whose BPM values were taken 5 times for each respondent, these values were compared using other comparisons, such as a pulse oximeter.The research design used in this study was pre-experimental with the one-group post-test design because, by giving treatment to the tool, direct measurements were taken without any comparison group or control group.There are 3 variables used in this study: the independent variable is the ECG signal, the dependent variable is the ECG circuit, and the control variable is the STM32F767ZI microcontroller.

FIGURE 2 Flowchart System Bedside Monitor
This study uses an analog ECG circuit connected to the STM32F7 microcontroller to process data and will display it on a PC using Visual Basic.This paragraph can explain FIGURE 1 When the power button is pressed, the bedside monitor will turn on.The electrodes that are attached to the body will take input data in the form of an ECG signal from the patient's body.Then, the signal from the electrode will pass through the instrumentation circuit.This circuit serves to amplify the tapped ECG signal.The output of the instrumentation circuit will be the input for the filter circuit.The filter circuit functions to pass the signal according to the cut-off frequency used.Then the signal will enter the notch filter circuit to reduce noise caused by PLN grids.Furthermore, the output of the notch filter circuit will enter the non-inverting circuit to be strengthened again with a gain of 1.7 times.The output of this non-inverting circuit will enter the adder circuit.The adder circuit functions to increase the baseline so that it can be read perfectly by the ADC.Furthermore, the adder signal output will enter the STM32F7 microcontroller to be processed.The resulting data will then be displayed on the PC using the Visual Basic program.In visual basics, it will display signals and BPM values from the patient's body in real time.
FIGURE 2 is a system flowchart on a bedside monitor.When the tool module is turned on, the program initialization process will run.The electrodes attached to the patient's body will detect electrical signals from the heart.The signal that has been detected will then enter the microcontroller to be processed into a BPM value for the patient.If the ECG signal detection process is not successful, initialization will be carried out again.The detected ECG signal will then enter the microcontroller to be processed into the patient's BPM value.The BPM value to be calculated uses the equation in the microcontroller program.After the data processing is complete, the ECG and BPM signal results will be displayed on the PC. while the LCD is only used to display the BPM value in the form of numbers.

A. RESPONDENT
In this study, the measurement of BPM values was carried out in two ways, namely by using a phantom ECG as a comparison and using 5 respondents, in which each respondent would be taken at 5 times the BPM.The results of the BPM values of these respondents will then be compared using a pulse oximeter that has been calibrated beforehand.While taking the BPM value using a phantom, the electrode cable will be attached to the phantom ECG with lead II (RA-LA-LL).then setting the BPM value from the smallest to the highest.Each BPM value that is set will be measured five times.

B. DATA ACQUISITION
In this study, the process of collecting BPM data using a phantom was carried out by attaching the electrode cable to the phantom using lead II leads (RA-LA-LL).then the electrode cable input will be connected to the ECG analog circuit that has been made.The ECG signal generated from the ECG phantom will pass through the instrumentation circuit to the adder circuit.After passing through the adder circuit, the output of the adder circuit will be the input for the STM32F7 microcontroller.On the STM32F7 microcontroller, the signal data from the phantom will be processed to become BPM value data, which will later be displayed on a PC using Visual Basic.
While data collection of BPM values uses respondents, electrode cables will be attached to the patient's body using lead II (RA-LA-LL).then the instrumentation circuit in the ECG analog circuit will detect the electrical signal in the respondent's heart.After passing through the filter circuit to the adder circuit, In the adder circuit, the resulting negative signal will be processed into a positive signal so that the ADC can process the signal on the microcontroller.On the STM32F7 microcontroller, the signal data will then be processed into BPM value data, whose results will be displayed on a PC using Visual Basic.The results of the BPM values that have been displayed will be compared with the pulse oximeter as a comparison.

D. DATA ANALYSIS
For each measurement of the BPM value on the phantom ECG and the respondents, five times the data was collected.The average value of measurements using the phantom ECG and the respondents is obtained using the mean, or average, using equation ( 1): while %error indicates a system error.The lower error value is the average difference between each set of data.Errors may indicate deviations between the comparison value and the value indicated on the tool module.The % error value can be calculated using equation ( 2): The standard deviation is a value that indicates the degree of variation in a data set or a measure of the standard deviation of the mean.The magnitude of the standard deviation (SD) value in BPM measurements can be shown in equation ( 3):

III. RESULT
In this study, the results of the BPM values displayed on the visual basic have been compared using the phantom ECG and pulse oximeter.In FIGURE 5, you can see the result of measuring the BPM value using the phantom ECG.6 shows the results of testing the BPM value of the respondent by placing the climb electrode on the respondent's body using lead II (RA-LA-LL).BPM measurement results on respondents will be compared using another comparison in the form of a pulse oximeter.For each respondent, BPM testing will be carried out five times.

FIGURE 6. BPM test results for respondents
TABLE 2 shows the results of BPM measurements using respondents.Data collection was carried out five times, during which the BPM values of the respondents were compared using a pulse oximeter.In the measurement results, the largest error value is 0.9%, and the smallest error value is 0%.After testing the BPM value using a phantom ECG and pulse oximeter as a comparison, the error graph obtained from the module is as follows: Meanwhile, in the BPM error graph for respondents, it can be seen that the largest error value produced is 0.9% and the smallest error value is 0%, which is shown in FIGURE 8 below.

FIGURE 8. BPM error graph on responden
From the results of BPM testing using Phantom ECG and the respondents shown in FIGURE 7 and FIGURE 8, it can be said that the module can function properly so that it produces an error value below 5%.The maximum BPM error value is 5% of the BPM value, and all error values from this module are less than 5%, so this module meets the standard error and is good enough to get BPM values from the phantom ECG.

IV. DISCUSSION
BPM testing using a phantom ECG is done by connecting the ECG electrode cable on the module to the phantom ECG with lead II, namely RA-RL-LL.BPM testing is done by setting the BPM value on the phantom ECG.Then, for each BPM value that has been set, data will be retrieved five times.The data that has been obtained from the results of these measurements will then be used to calculate the error value on the module, which is shown on Visual Basic as a display, and the comparative error value, which is printed on the phantom ECG screen.The error values obtained from each BPM value are 2.5%, 2.3%, 2%, 1%, 0.83%, and 0.85%.Based on these data, the smallest error value is 0.83%, and the largest error value is 2.5%.While testing BPM using respondents, data collection was carried out five times for each respondent.The climb electrode will be attached to the respondent's body using Lead II (RA-LA-LL) leads.From the results of BPM testing on five respondents, the error values for each respondent were 0.5%, 0%, 0%, 0.5%, and 0.9%.The maximum BPM error value is 5% of the BPM value, and all error values from this module are less than 5%, so this module meets the standard error and is good enough to get BPM values from the phantom ECG and respondents.
The comparison of the tools made with previous studies lies in the parameters used and the type of microcontroller used.In the tool that we make, there are two parameters that we use, namely ECG and SpO2, by displaying the signal and also the values of the two parameters.Whereas in previous research, we only used one parameter and only displayed the signal or value of that parameter.Then, in terms of the microcontroller used, in the tool we made, we used the STM32F7 microcontroller, which has a higher resolution than other microcontrollers, which is 16 bits.With the large resolution that is owned by the STM32F7, it produces a smoother signal with less noise when compared to other microcontrollers.
In the tool module created, there are several weaknesses in the tool that can later be improved and perfected through further research.The weakness of our tool lies in the basic visual view that we use.On the display, the R wave on the ECG signal cannot be stable, so it affects the reading of the BPM value.The cause of the R wave instability on the visual basic display is caused by the process of separating the data for signal and value readings.The data to be displayed on the visual basic must first be parsed to separate signal data from value data.New data readings will be sent to Visual Basic every 10 ms.This is what causes Visual Basic to become stuck and is considered an error, so that the process of separating the data fails.
The positive impact of the bedside monitor tool we made is that this tool is used to monitor the patient's vital condition, with the parameters displayed being ECG and SpO2 in the form of signals and values.The bedside monitor tool uses the STM32 microcontroller, which has a larger resolution of 16 bits so that it can produce a smoother signal and reduce the resulting noise.To monitor the signal results and the values of each parameter, namely ECG and SpO2, a PC is used to display the signal results and values.

IV. CONCLUSION
After completing the writing process, module testing, and data collection, the writer can conclude that:The purpose of this study is to design a bedside monitor tool using analog circuits to detect electrical signals in the heart, using the STM32F7 microcontroller to process signal data and BPM values to be displayed on a PC using Visual Basic.
In this study, BPM was tested using a phantom ECG and compared using a pulse oximeter as a comparison.Based on the test results for the BPM value, the ECG module series works well; BPM when tested using the phantom ECG produces the largest error of 2.5% and the smallest error of 0.83%.The results of testing the BPM value with respondents whose results will be compared using a pulse oximeter show that the smallest error value is 0% and the largest error value is 0.9%.The maximum BPM error value is 5% of the BPM value, and all error values from this module are less than 5%, so this module meets the standard error and is good enough to use.The form of the signal generated by using the respondent is also different.This is influenced by several factors, such as the patient's movement, the patient's unhealthy condition, and the inappropriate placement of the electrodes.
Developments that can be made in this study include using a better ECG series so that the measurement results obtained can be more stable and replacing the visual basic application with other applications to display the ECG signal results and BPM values so that the displayed signal results are more stable and the BPM value is more stable.

FIGURE 1 .
FIGURE 1. Diagram Block System Bedside Monitor

Figure 3
Figure 3 illustrates the process of conducting BPM measurements using lead II leads (RA-RL-LL) attached to the ECG phantom.The data measurement procedure involves the following steps: 1. Begin by securely attaching the electrode cable to the ECG phantom using the lead II leads (RA-RL-LL).2. Prepare the personal computer (PC) to function as a fundamental visual display, facilitating the data collection process.3. Proceed to collect data at six distinct BPM values, and for each BPM value, conduct five measurements with a 1-minute interval between each reading.

Figure 5 BPM
Figure 5 BPM test results on the Phantom ECG

FIGURE 7 .FIGURE 7
FIGURE 7. BPM error graph on phantomFIGURE7shows an error graph of the BPM value obtained by testing using the phantom ECG.It can be seen that the largest error value obtained is located at BPM 40 of 2.5%, and the smallest error value is located at BPM 120 of 0.83%.Meanwhile, in the BPM error graph for respondents, it can be seen that the largest error value produced is 0.9% and the smallest error value is 0%, which is shown in FIGURE8below.

TABLE 1
shows the results of BPM measurements using the phantom ECG.Data collection was carried out five times.The measurement results obtained the largest error value of 2.5% at BPM 40 and the smallest error value of 0.83% at BPM 120.