🌏
International Publishing Platform
Serving Researchers Since 2012

Intelligent ECG Monitoring for Detection and Classification of Cardiac Arrhythmia

DOI : 10.17577/IJERTCONV14IS060062
Download Full-Text PDF Cite this Publication

Text Only Version

Intelligent ECG Monitoring for Detection and Classication of Cardiac Arrhythmia

1 Prof Ajay M

Dept.of ECE Rajarajeswari College of Engineering

Bengaluru, India ajaym666@gmail.com

4 Preksha M T

Dept.of ECE Rajarajeswari College of Engineering

Bengaluru, India prekshamt1234@gmail.com

2 Priyadarshini N

Dept.of ECE Rajarajeswari College of Engineering

Bengaluru, India priyadn35@gmail.com

5 Purvika B S

Dept.of ECE Rajarajeswari College of Engineering

Bengaluru, India bspurvika@gmail.com

3 Sahana M

Dept.of ECE Rajarajeswari College of

Engineering Bengaluru, India sahanamurali605@gmail.com

AbstractCardiac arrhythmias represent a signicant portion of global cardiovascular diseases, and their early detection is essential to prevent sudden cardiac complications. In this work, an intelligent ECG monitoring system is developed using machine learning and IoT technologies to enable continuous, real-time arrhythmia detection and classication. The system integrates a portable hardware module consisting of an ESP32 microcon- troller, AD8232 ECG sensor, temperature sensor, and a battery- powered design that allows uninterrupted cardiac monitoring. The collected physiological data is analyzed using multiple supervised machine learning algorithmsincluding K-Nearest Neighbors (KNN), Weighted KNN, Support Vector Machine (SVM), Logistic Regression, Naive Bayes, and feature selection using ExtraTrees Classierto classify the cardiac condition with improved accuracy. A Flask-based web application provides a user-friendly interface for prediction, while ThingSpeak cloud and a Telegram bot enable real-time remote monitoring and emergency alerts. The results demonstrate that the proposed system is capable of reliably acquiring ECG signals, detecting abnormalities, and offering early warnings, making it suitable for personal healthcare monitoring and telemedicine applications.

Index TermsECG Monitoring, Arrhythmia Detection, Ma- chine Learning, IoT, SVM, KNN, AD8232, ESP32, Flask, ThingS- peak, Telegram Bot

  1. Introduction

    Cardiovascular diseases continue to be a leading cause of mortality, and a signicant number of these deaths occur due to undiagnosed or untreated cardiac arrhythmias. Traditional ECG monitoring systems, although clinically reliable, are often limited by their cost, bulkiness, and the need for constant supervision by medical professionals. With the growth of IoT devices, wearable sensors, and machine learning algorithms, there is a rising demand for intelligent systems that can support continuous cardiac monitoring outside hospital environments. This project aims to address these limitations by creating a compact, portable, and intelligent ECG monitoring system capable of capturing ECG signals, analyzing them in real time, and transmitting vital information to caregivers through cloud

    platforms and messaging services. By combining hardware sensing, machine learning classication, IoT data manage- ment, and automated alerts, the system delivers a comprehen- sive approach to early arrhythmia detection.

  2. PROBLEM DEFINITION

    Despite technological advancements, continuous ECG mon- itoring remains inaccessible to many individuals due to the cost and complexity of existing systems. Furthermore, manual interpretation of ECG signals is time-consuming, and mis- interpretation can lead to delayed medical attention. Remote monitoring capabilities are also limited in most portable ECG devices. Therefore, the challenge lies in developing a low-cost yet intelligent system that performs real-time ECG acquisi- tion, applies machine learning-based classication, visualizes physiological data in the cloud, and triggers immediate alerts during abnormal cardiac activity. The proposed solution aims to bridge this gap by integrating robust hardware, AI-driven analytics, and IoT-based communication into a unied health monitoring ecosystem.

  3. RELATED WORK

    Existing literature shows considerable progress in wear- able health monitoring, particularly in ECG-based arrhythmia classication. Many researchers have explored the use of machine learning algorithms such as SVM, KNN, and deep learning models to identify abnormal cardiac patterns with high accuracy. However, these systems often rely heavily on cloud computation, which increases latency and reduces reli- ability during poor connectivity. Some studies have explored hardware-based detection using Arduino or Raspberry Pi, but these systems lack extensive real-time alerting and cloud in- tegration. Furthermore, many papers emphasize classication accuracy but overlook feature selection, which is crucial for reducing model complexity and improving efciency. Addi- tionally, few studies integrate a complete pipeline involving

    hardware acquisition, on-device preprocessing, cloud storage, machine learning analysis, and automated messaging services. This project addresses these gaps by offering an end-to-end intelligent ECG monitoring system that combines feature- optimized ML models, IoT cloud visualization, Telegram- based alerting, and portable real-time hardware measurement.

  4. PROPOSED SYSTEM

    1. Hardware Architecture

      The hardware architecture is designed to be compact, portable, and suitable for continuous physiological monitoring. The central processing unit is an ESP32 microcontroller, cho- sen for its built-in WiFi module, low energy consumption, and compatibility with analog sensors. The AD8232 ECG module acts as the primary cardiac biosignal acquisition unit, capturing electrical impulses from the body through surface electrodes. A temperature sensor is included to enhance health assessment by monitoring body temperature alongside cardiac activity. A 16×2 LCD display provides immediate on-device feedback by showing ECG values, temperature levels, and alerts such as arrhythmia warnings. A rechargeable Li-ion battery powers the system, making it fully portable. The components are interconnected on a stable protoboard, ensuring secure signal ow and reliable real-time operation.

      Fig. 1. Block Diagram

    2. ECG Acquisition

      The AD8232 module captures the hearts electrical activity and outputs a clean analog ECG waveform. Electrodes placed on the users chest collect signals, which are then amplied and ltered by the AD8232s internal instrumentation ampli- er. The ESP32 reads the analog values through its ADC pins, converts them into digital samples, and transmits them for further processing. Proper electrode placement and grounding help maintain signal quality, while built-in ltering reduces motion artifacts and noise.

      Fig. 2. Complete hardware Prototype

    3. IoT Cloud (ThingSpeak)

      ThingSpeak cloud platform is integrated to log and visualize physiological data in real time. The ESP32 continuously uploads ECG and temperature values to ThingSpeak channels, enabling caregivers and users to access historical patterns and live charts. This IoT integration ensures remote monitoring even when users are not physically present near the device, making it highly suitable for elderly or chronically ill patients who require continuous health supervision.

    4. Web App (Flask)

      A Flask-based web application serves as the user inter- face for predictive analytics. Users can enter physiological parameters such as age, gender, heart rate, temperature, and ECG values. The backend loads a trained machine learning model, processes theinputs, and predicts the cardiac condition along with deviation percentages and risk levels. The interface is lightweight, clean, and optimized for mobile and desktop browsers. This ensures that both patients and clinicians can quickly interpret the systems predictions.

    5. ML Models Used and Algorithms Explanation

    Several supervised machine learning algorithms are tested to classify arrhythmia using the processed ECG dataset. KNN is employed to classify data based on the similarity of neigh- boring samples, while Weighted KNN enhances this approach by giving higher signicance to closer neighbors. SVM with a linear kernel develops a hyperplane that best separates normal and arrhythmia classes. Logistic Regression predicts class probabilities using a mathematical sigmoid function, making it effective for binary classication. Naive Bayes applies proba- bilistic classication assuming statistical independence among features. To enhance performance, the ExtraTrees Classier is used to extract the most relevant features, thereby reducing dimensionality and improving model speed and accuracy.

  5. METHODOLOGY

    1. Pre-processing

      Raw ECG datasets often contain missing values, noise, and inconsistencies that must be addressed before training ML models. In this project, missing values were replaced using column-wise mean imputation to ensure uniformity. Data types were standardized, and features were normalized to ensure equal contribution during model training. The dataset was

      organized into input features and output labels to facilitate efcient learning.

    2. Feature Selection

      Feature selection was performed using the ExtraTrees Clas- sier, which evaluates the relative importance of each attribute based on decision tree ensemble analysis. Features contribut- ing signicantly to arrhythmia detection were retained, while less informative features were removed. This process reduced computational overhead, improved model interpretability, and prevented overtting. analysis to real-time alerting.

    3. Model Training

      The processed dataset was divided into training and testing subsets. Each modelKNN, Weighted KNN, SVM, Logistic Regression, and Naive Bayeswas trained using the selected features. Hyperparameters such as number of neighbors and SVM regularization values were tuned to optimize perfor- mance. The training process enabled the system to learn cardiac patterns and distinguish between normal and abnormal ECG signals.

    4. Model Comparison

      The performance of all classiers was evaluated using accuracy metrics. Models were compared based on their ability to detect arrhythmia from unseen data. Weighted KNN and SVM demonstrated higher consistency due to their robustness in dealing with overlapping feature regions. The comparison helped determine the most reliable model for real-world im- plementation.

      Fig. 3. model comparison

    5. Telegram Bot Workow

    A Telegram bot was integrated into the system to enhance remote health monitoring. Once physiological measurements are processed, the system sends these values to the Telegram bot using API calls. The bot delivers instant notications con- taining ECG values, temperature levels, risk classication, and medical suggestions. This real-time alerting feature ensures timely response during abnormal cardiac events.

  6. RESULTS AND OUTPUTS

    1. Web App Results

      The web application successfully predicts arrhythmia by analyzing user-provided inputs. It displays risk levels, devi- ation percentages, and classication results clearly, offering

      an intuitive interface suitable for both clinical and personal use.

      Fig. 4. web app prediction page

    2. Hardware LCD Output

      The LCD module displays ECG and temperature readings in real time, along with alerts such as CARDIAC ARRHYTH- MIA when abnormal activity is detected. The portability and immediacy of this output make the device suitable for continuous monitoring.

    3. Telegram Bot Output

      The Telegram bot provides structured real-time notications that include patient details and health status. This enables caregivers to track the users condition remotely and take timely action.

      Fig. 5. Telegram bot output image

    4. ThingSpeak Graphs

    ThingSpeak graphs visualize ECG and temperature data over time, allowing users to observe patterns and detect anomalies. The cloud integration ensures that data is accessible even when the user is away from the device.

  7. CONCLUSION

    The intelligent ECG monitoring system developed in this project successfully integrates hardware sensing, machine learning-based arrhythmia classication, IoT cloud visual- ization, and automated remote alerting. The combination of ESP32, AD8232, machine learning algorithms, a Flask web in- terface, and a Telegram bot results in a comprehensive cardiac health monitoring platform. The system demonstrates reliable ECG acquisition, accurate classication, and real-time alerting, making it suitable for personal healthcare, telemedicine, and continuous patient monitoring.

  8. FUTURE SCOPE

Future work can focus on expanding the system into a wear- able format using a compact PCB and rechargeable battery system. Deep learning algorithms such as CNNs and LSTMs may be applied to improve arrhythmia classication. Mobile application integration, GPS-based emergency alerting, multi- lead ECG support, and hospital dashboard integration may further enhance the systems real-world usability.

References

  1. Dr. S. Sharanya, Ashwin G, Ajitha U , ECG tracing using wearable nano sensor, 2025 , unpublished.

  2. H. R. Mohsin, V. K. Verma, and S. Kumar, IoT-enabled real-time health monitoring using ESP32 and cloud services, in Proc. IEEE Int. Conf. Smart Electronics and Communication, 2022, pp. 512517.

  3. A. Bouchikhi, M. Assous, and F. Z. Benhammadi, Wearable ECG moni- toring systems: A review of signal processing methods and applications, IEEE Access, vol. 9, pp. 140158, 2021.

  4. Y. Liu, T. Zhang, and L. Chen, Deep learning for arrhythmia classi- cation using ECG signals: A comprehensive review, IEEE Reviews in Biomedical Engineering, vol. 15, pp. 156170, 2022.

  5. P. Rajalakshmi and R. Karthik, A cloud-integrated IoT framework for continuous ECG monitoring, IEEE Sensors Journal, vol. 22, no. 4, pp. 34813490, 2022.

  6. M. S. Hossain, ECG-based arrhythmia classication using hybrid ML models for edge devices, IEEE Internet of Things Journal, vol. 9, no. 12, pp. 1024510256, 2022.

  7. R. Misra, S. Bala, and A. Gandhi, A low-cost wearable system for early cardiac abnormality detection using AD8232 and ESP32, in Proc. IEEE Int. Conf. Articial Intelligence and Data Engineering, 2024, pp. 275280.

  8. K. Zhang, Y. Wang, and M. Li, Real-time ECG anomaly detection using lightweight CNN models for wearable devices, IEEE Transactions on Instrumentation and Measurement, vol. 71, pp. 110, 2022.

  9. S. R. Gupta and P. N. Keshri, IoT-driven remote cardiac monitoring system using cloud analytics and mobile alerts, in Proc. IEEE Interna- tional Conference on IoT and Applications (ICIOT), 2021, pp. 8893.

  10. A. Alabdulkreem, M. A. Alqarni, and F. Alsolami, Portable ECG monitoring using edge compuing and machine learning, IEEE Access, vol. 10, pp. 6502165033, 2022.