HeartGuard is a prototype system that uses Internet of Things (IoT) technology to monitor cardiovascular health and predict risks. It combines physiological sensing, ECG data capture, wireless communication, database storage, and patient medical profiles within one integrated platform. The hardware centers on an ESP32 microcontroller and includes sensors for heart rate, oxygen saturation (SpO?), temperature, and ECG. The system displays data locally on an OLED screen and also sends it to a web application, allowing remote data viewing. The software integrates real-time sensor readings with patient details such as age, sex, blood pressure, cholesterol, chest-pain type, exercise-induced angina, ST depression, and resting ECG results. For risk prediction, HeartGuard uses a Random Forest machine learning model, while ECG arrhythmia classification relies on a convolutional neural network (CNN). Currently, these models are developed using publicly available data from Kaggle. In the future, HeartGuard aims to train models directly on data collected by the deployed sensors. The prototype presents cardiovascular risk as a percentage calculated at the application level, but future versions plan to use calibrated probabilities directly from the Random Forest output. The system includes interactive interfaces for risk visualization, ECG analysis, patient records management, and generates clinical-style PDF reports.
Introduction
The text describes HeartGuard, an IoT-based heart health monitoring prototype designed to continuously monitor physiological parameters, store patient health information, assess cardiovascular risks and generate clinical-style reports.
The system combines hardware sensors, an ESP32 microcontroller, wireless communication, database storage and a web-based application to provide an integrated heart health monitoring solution.
1. Introduction
Traditional heart health monitoring mainly depends on periodic hospital visits and medical tests. However, wearable and portable monitoring devices can collect health information continuously, even outside clinical environments.
HeartGuard uses Internet of Things (IoT) technology to connect physiological sensors with software platforms. It collects heart rate, oxygen saturation (SpO?), temperature and ECG signals.
HeartGuard is a research and decision-support prototype, not a clinically validated diagnostic device.
2. Review of Related Work
Previous research has explored several technologies relevant to HeartGuard:
Remote cardiac monitoring: Wearable and portable devices enable continuous monitoring beyond traditional clinical visits.
IoT-based healthcare: IoT connects medical sensors to remote databases and applications for real-time monitoring.
Machine learning: Algorithms such as Logistic Regression, Decision Trees, Random Forest, Support Vector Machines, K-Nearest Neighbors and neural networks are used for cardiovascular risk prediction.
ECG processing: Traditional algorithms such as Pan–Tompkins help detect QRS complexes, while Convolutional Neural Networks (CNNs) are increasingly used for ECG classification.
ECG datasets: The MIT-BIH Arrhythmia Database is widely used for developing and evaluating ECG classification models.
3. Problem Statement and Objectives
The main problem addressed by HeartGuard is the difficulty of integrating physiological sensors, wireless communication, patient medical records, machine learning and data visualization into one unified healthcare platform.
The project aims to:
Measure heart rate, SpO?, body temperature and ECG signals.
Display real-time measurements on an OLED screen.
Transmit sensor readings through Wi-Fi.
Store timestamped health readings in a database.
Maintain individual patient medical profiles.
Combine patient information with sensor data for cardiovascular risk assessment.
Visualize ECG waveforms and maintain patient records.
Generate structured clinical-style reports.
The system also maintains timestamps to distinguish recent readings from older stored data and reduce the risk of displaying outdated information as current.
4. System Architecture
HeartGuard follows a modular, five-layer architecture:
Sensor layer: Collects heart rate, SpO?, temperature and ECG signals.
Embedded acquisition layer: Uses an ESP32 microcontroller to collect sensor data and display readings on an OLED screen.
Communication layer: Transfers collected data through Wi-Fi.
Backend and database layer: Stores patient records, sensor measurements and historical readings.
Application layer: Performs analysis, displays dashboards and generates reports.
This modular architecture makes it easier to identify technical problems and upgrade individual components without redesigning the entire system.
5. System Implementation
A. Hardware Implementation
The physical prototype is developed using a breadboard and includes:
ESP32 microcontroller.
Heart-rate sensor.
SpO? sensor.
Temperature sensor.
ECG electrodes and sensing module.
OLED display.
Supporting electronic components.
B. Physiological Data Acquisition
The system continuously measures heart rate, oxygen saturation and temperature, while ECG signals are collected through a dedicated sensing mechanism.
The OLED displays sample readings such as:
Heart rate: 79 BPM.
SpO?: 96%.
Temperature: 32.3°C.
Wi-Fi connectivity status.
These are prototype readings and require validation against standard medical instruments.
C. ECG Signal Acquisition and Processing
The ECG module provides:
ECG waveform visualization.
Heart-rate calculation.
Arrhythmia classification.
Cardiovascular risk prediction.
Urgency indication.
PDF report generation.
A Convolutional Neural Network (CNN) is used for arrhythmia classification. An example recording uses a sampling frequency of 360 Hz for approximately 10 seconds and displays a heart rate of 72 BPM with a normal arrhythmia classification.
D. IoT Communication
The ESP32 acts as a communication bridge between the physical sensors and the software application.
It collects physiological readings, displays local information and transmits data through Wi-Fi to the backend system.
E. Data Storage and Database
HeartGuard uses the following technologies:
Supabase: Database backend for storing patient records, sensor readings and risk summaries.
Node.js: Backend development environment.
Express.js: Server-side framework for handling application requests.
Conclusion
HeartGuard integrates IoT physiological monitoring, ECG acquisition, wireless communication, database storage, patient-profile management, Random Forest cardiovascular risk assessment, CNN-based ECG classification, web visualization, patient records, and report generation. The current Kaggle-based model provides a development foundation, while future labelled sensor measurements will support a system-specific dataset, calibrated risk probabilities, and more rigorous validation.
References
[1] Sana, E. M. Isselbacher, J. P. Singh, E. K. Heist, B. Pathik, and A. A. Armoundas, “Wearable Devices for Ambulatory Cardiac Monitoring: JACC State-of-the-Art Review,” J. Amer. Coll. Cardiol., vol. 75, no. 13, pp. 1582–1592, 2020, doi: 10.1016/j.jacc.2020.01.046.
[2] H. Habibzadeh, K. Dinesh, O. R. Shishvan, A. Boggio-Dandry, G. Sharma, and T. Soyata, “A Survey of Healthcare Internet-of-Things (HIoT): A Clinical Perspective,” IEEE Internet Things J., vol. 7, no. 1, pp. 53–71, 2020, doi: 10.1109/JIOT.2019.2946359.
[3] P. P. Ray, D. Dash, and N. Kumar, “Sensors for Internet of Medical Things: State-of-the-Art, Security and Privacy Issues, Challenges and Future Directions,” Comput. Commun., vol. 160, pp. 111–131, 2020, doi: 10.1016/j.comcom.2020.05.029.
[4] A. Cuevas-Chávez, Y. Hernández, J. Ortiz-Hernandez, E. Sánchez-Jiménez, G. Ochoa-Ruiz, J. Pérez, and G. González-Serna, “A Systematic Review of Machine Learning and IoT Applied to the Prediction and Monitoring of Cardiovascular Diseases,” Healthcare, vol. 11, no. 16, p. 2240, 2023, doi: 10.3390/healthcare11162240.
[5] G. Quer, R. Arnaout, M. Henne, and R. Arnaout, “Machine Learning and the Future of Cardiovascular Care: JACC State-of-the-Art Review,” J. Amer. Coll. Cardiol., vol. 77, no. 3, pp. 300–313, 2021, doi: 10.1016/j.jacc.2020.11.030.
[6] J. Pan and W. J. Tompkins, “A Real-Time QRS Detection Algorithm,” IEEE Trans. Biomed. Eng., vol. BME-32, no. 3, pp. 230–236, 1985, doi: 10.1109/TBME.1985.325532.
[7] G. B. Moody and R. G. Mark, “The Impact of the MIT-BIH Arrhythmia Database,” IEEE Eng. Med. Biol. Mag., vol. 20, no. 3, pp. 45–50, 2001, doi: 10.1109/51.932724.
[8] U. R. Acharya, S. L. Oh, Y. Hagiwara, J. H. Tan, M. Adam, A. Gertych, and R. S. Tan, “A Deep Convolutional Neural Network Model to Classify Heartbeats,” Comput. Biol. Med., vol. 89, pp. 389–396, 2017, doi: 10.1016/j.compbiomed.2017.08.022.
[9] A. Y. Hannun, P. Rajpurkar, M. Haghpanahi, G. H. Tison, C. Bourn, M. P. Turakhia, and A. Y. Ng, “Cardiologist-Level Arrhythmia Detection and Classification in Ambulatory Electrocardiograms Using a Deep Neural Network,” Nat. Med., vol. 25, no. 1, pp. 65–69, 2019, doi: 10.1038/s41591-018-0268-3.
[10] L. Breiman, “Random Forests,” Mach. Learn., vol. 45, pp. 5–32, 2001, doi: 10.1023/A:1010933404324.
[11] S. M. Lundberg and S.-I. Lee, “A Unified Approach to Interpreting Model Predictions,” in Proc. Advances in Neural Information Processing Systems 30 (NeurIPS), 2017, pp. 4765–4774.
[12] H. Xie, L. Yang, B. Jiang, Z. Huang, and Y. Lin, “State-of-the-Art Wearable Sensors for Cardiovascular Health: A Review,” npj Cardiovascular Health, vol. 2, art. no. 53, 2025.
[13] S. E. El-deep, A. A. Abohany, K. M. Sallam, et al., “A Comprehensive Survey on Impact of Applying Various Technologies on the Internet of Medical Things,” Artificial Intelligence Review, vol. 58, art. no. 86, 2025, doi: 10.1007/s10462-024-11063-z.
[14] P. Matthew, S. Mchale, X. Deng, G. Nakhla, M. Trovati, N. Nnamoko, E. Pereira, H. Zhang, and M. Raza, “A Review of the State of the Art for the Internet of Medical Things,” Sci., vol. 7, no. 2, p. 36, 2025, doi: 10.3390/sci7020036.
[15] G. S. Collins, J. B. Reitsma, D. G. Altman, and K. G. M. Moons, “Transparent Reporting of a multivariable prediction model for Individual Prognosis Or Diagnosis (TRIPOD): The TRIPOD
[16] Statement,” Ann. Intern. Med., vol. 162, no. 1, pp. 55–63, 2015, doi: 10.7326/M14-0697.
[17] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger, “On Calibration of Modern Neural Networks,” in Proc. 34th Int. Conf. Machine Learning (ICML), 2017, pp. 1321–1330.
[18] T. Saito and M. Rehmsmeier, “The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets,” PLoS ONE, vol. 10, no. 3, p. e0118432, 2015, doi: 10.1371/journal.pone.0118432.
[19] M. Kachuee, S. Fazeli, and M. Sarrafzadeh, “ECG Heartbeat Classification: A Deep Transferable Representation,” in Proc. IEEE Int. Conf. Healthcare Informatics (ICHI), 2018, pp. 443–444, doi: 10.1109/ICHI.2018.00092.
[20] A. Rajkomar et al., “Scalable and Accurate Deep Learning with Electronic Health Records,” npj Digit. Med., vol. 1, art. no. 18, 2018, doi: 10.1038/s41746-018-0029-1.
[21] H. Kruse, B. Frederick, T. Jacobson, and D. K. Monticone, “Cybersecurity in Healthcare: A Systematic Review of Modern Threats and Trends,” Technol. Health Care, vol. 25, no. 1, pp. 1–10, 2017, doi: 10.3233/THC-161263.