Download as pdf or txt
Download as pdf or txt
You are on page 1of 99

IOT BASED HEART ATTACK DETECTION AND HEART

RATE ANALYSIS
A MAJOR PROJECT REPORT

Submitted by

NANDHIGAMA ABHINAV [Reg No:RA2011028010125]


MANTHURI HRITHIKESH [Reg No: RA2011028010133]
KAKANI SASI VADAN [Reg No: RA2011028010143]
Cite all the tables and figures inside
the content. For example,
Under the Guidance of Figure 1 shows that
Table 1 represents

Dr. NIVEDHITHA M

Associate Professor, Department of Networking and Communications

In partial fulfillment of the Requirements for the Degree of

BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE ENGINEERING
With a specialization in CLOUD COMPUTING

DEPARTMENT OF NETWORKING AND COMMUNICATIONS


SCHOOL OF COMPUTING
COLLEGE OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
KATTANKULATHUR -603203

i
April 2024

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

KATTANKULATHUR – 603 203 BONAFIDE


CERTIFICATE

Certified that this project report titled “IOT BASED HEART ATTACK DETECTION AND
HEART RATE ANALYSIS” is the bonafide work of Mr. NANDHIGAMA ABHINAV
[RA2011028010125], MANTHURI HRITHIKESH [RA2011028010133] and KAKANI SASI
VADAN [RA2011028010143] who carried out the project work under my supervision. Certified further,
that to the best of my knowledge, the work reported herein does not form part of any other thesis or
dissertation on the basis of which a degree or award was conferred on an earlier occasion for this or any
other candidate.

ii
Department of Networking and Communications
SRM Institute of Science & Technology
Own Work Declaration Form
Degree/ Course : Bachelor of Technology, Computer Science Engineering

Student Name : Nandhigama Abhinav, Manthuri Hrithikesh, Kakani Sasi Vadan

Registration Number : RA2011028010125, RA2011028010133, RA2011028010143

Title of Work : IOT based heart attack detection and heart rate monitoring

We hereby certify that this assessment compiles with the University’s Rules and Regulations
relating to Academic misconduct and plagiarism, as listed in the University Website, Regulations,
and the Education Committee guidelines.
We confirm that all the work contained in this assessment is my / our own except where indicated, and
that we have met the following conditions:
• Clearly references / listed all sources as appropriate
• Referenced and put in inverted commas all quoted text (from books, web, etc)
• Given the sources of all pictures, data etc. that are not my own
• Not made any use of the report(s) or essay(s) of any other student(s) either past or present
• Acknowledged in appropriate places any help that I have received from others (e.g.
fellow students, technicians, statisticians, external sources)
• Compiled with any other plagiarism criteria specified in the Course handbook / University
website
We understand that any false claim for this work will be penalized in accordance with the University
policies and regulations.

DECLARATION:

We are aware of and understand the University’s policy on Academic misconduct and
plagiarism and we certify that this assessment is our own work, except were indicated by
referring, and that we have followed the good academic practices noted above.

Student 1 signature:

Student 2 signature:

Student 3 signature:

iii
ACKNOWLEDGEMENT
We express our humble gratitude to Dr C. Muthamizhchelvan, Vice-Chancellor, SRM Institute of Science and
Technology, for the facilities extended for the project work and his continued support.

We extend our sincere thanks to Dean-CET, SRM Institute of Science and Technology, Dr T.V.Gopal, for his
invaluable support.

We wish to thank Dr Revathi Venkataraman, Professor & Chairperson, School of Computing, SRM Institute of
Science and Technology, for her support throughout the project work.

We are incredibly grateful to our Head of the Department, Dr. Annapurani K, Professor, Department of Networking
and Communications, SRM Institute of Science and Technology, for her suggestions and encouragement at all the
stages of the project work.

We want to convey our thanks to our program coordinator Dr. M. Saravanan, Associate Professor, Dr. Thenmalar
S, Panel Head, Department of Networking and Communications, SRM Institute of Science and Technology, for
her inputs during the project reviews and support.

We register our immeasurable thanks to our Faculty Advisor, Dr. TYJ Naga Malleswari, Assistant Professor,
Department of Networking and Communications, SRM Institute of Science and Technology, for leading and
helping us to complete our course.

Our inexpressible respect and thanks to our guide, Dr. M Nivedhitha, Assistant Professor, Department of
Networking and Communications, SRM Institute of Science and Technology, for providing us with an opportunity
to pursue our project under her mentorship. She provided us with the freedom and support to explore the research
topics of our interest. Her passion for solving problems and making a difference in the world has always been
inspiring.

We sincerely thank the Networking and Communications Department, staff and students, SRM Institute of Science
and Technology, for their help during our project. Finally, we would like to thank parents, family members, and
friends for their unconditional love, constant support, and encouragement.

NANDHIGAMA ABHINAV [RA2011028010125]

MANTHURI HRITHIKESH [RA2011028010133]

KAKANI SASI VADAN [RA2011028010143]


iv
ABSTRACT

Cardiovascular diseases (CVDs) remain a significant global health concern, contributing to millions of
deaths annually. Among them, heart attacks represent a critical and often lifethreatening manifestation.
Early detection and continuous monitoring of cardiac parameters are essential for timely intervention
and improved patient outcomes. In response to this pressing need, this project proposes an innovative
IoT-based system that integrates Arduino LCD technology for heart attack detection and heart rate
analysis. The proposed system combines wearable sensors capable of capturing vital signs such as heart
rate, blood pressure, and electrocardiogram (ECG) signals with Arduino microcontrollers featuring LCD
displays. These wearable sensors, strategically placed on the user's body, continuously monitor
physiological parameters. The acquired data is then processed by the Arduino microcontroller and
displayed in real-time on the LCD screen, providing immediate feedback to the user.

Key to the system's functionality is its integration with Internet of Things (IoT) technology. The Arduino
microcontroller is equipped with Wi-Fi modules, enabling seamless data transmission to a cloud-based
server for centralized storage and further analysis. This cloud-based approach facilitates remote access
to the user's health data, empowering healthcare professionals with realtime insights into the patient's
cardiac status. An essential component of the system is its alarm mechanism, which triggers alerts in
response to abnormal fluctuations in vital signs. This feature ensures that both the user and healthcare
providers are promptly notified of potential cardiac events, allowing for timely intervention. Moreover,
the system incorporates advanced machine learning algorithms that analyze the collected data to detect
patterns indicative of heart attacks or abnormal cardiac activity. This predictive capability enhances
diagnostic accuracy and enables personalized healthcare interventions. The user interface provided by
the Arduino LCD display is intuitive and user-friendly, enhancing user engagement and adherence to the
monitoring protocol. The display offers visual representations of vital signs, allowing users to monitor
their cardiac parameters with ease. Additionally, the system's scalability and cost-effectiveness make it
suitable for deployment in both clinical and home settings. By leveraging Arduino LCD technology
within an IoT framework, this project addresses several critical challenges in cardiovascular health
monitoring. The system provides continuous, real-time monitoring of cardiac parameters, enabling early
detection of abnormalities and timely intervention. Furthermore, its remote access capabilities empower
healthcare providers with actionable insights, facilitating personalized patient care.

In summary, the proposed IoT-based system offers a comprehensive solution for heart attack detection
and heart rate analysis. By integrating wearable sensors, Arduino LCD technology, and IoT connectivity,
it represents a significant advancement in cardiac health monitoring, with the potential to improve patient
outcomes and quality of life.
v
TABLE OF CONTENTS

S.NO TITLE PAGE NO


ABSTRACT v
LIST OF FIGURES ix
LIST OF TABLES xi
ABBREVIATIONS xii
1. INTRODUCTION 1
1.1 General 1
1.2 problem statement 2
First letter capitals everywhere, Eg: "Problem Statement"
1.3 Motivation for the selection of the problem Delete this 3
1.4 Overview 4
1.5 Inference of the project 5
1.6 Problem Identification 6
1.7 Aim of the project 6
Why these many topics? Overview, Inference
Problem Identification, Aim, Scope, Objective all
1.8 Scope of the project similar topics, edit
7
1.9 Objective 8
1.10 Applications 8
1.11 Statistical Method 9
1.12 Heart rate Monitoring Techniques 9
1.13 Potential Effects and Benefits 11
1.14 Early warning systems for heart health Early warning signs or 12
systems?

1.15 Heart Attacks Predicting 13


2. LITERATURE REVIEW 15
2.1 Reviews of Papers 15
3. DESIGNING A IOT BASED HEART ATTACK 29
Design of DETECTOR

vi
3.1 Existing System block diagram 29
3.2 Disadvantages of Existing System 30
3.3 Proposed block diagram 31
3.4 Advantages of proposed ssytem Why advantages of 32
proposed system in design part?`
3.5 Flow chart 33
3.6 Circuit Diagram 34
3.7 Schematic Diagram 35

METHODOLOGY OF SMART HEALTHCARE


4. 36
INTEGRATED SYSTEM
4.1 Methodology 36
4.2 Model 36
4.3 Pre- Processing Check the report that i sent you and modify
37
the table of contents accordingly
4.4 Components Used 38
4.5 Hardware Requirements 39
4.5.1 Arduino UNO 39
4.5.2 Pulse Sensor 42
4.5.3 Breadboards 44
4.5.4 ESP8266 45
4.5.5 LCD module 47
4.5.6 Jump Wires 48
4.6 Hardware Setup 50
4.7 Software Requirements 51
4.8 Constraints 51
4.9 Trade-off 52
4.10 Development 53
4.11 System Architecture 54

vii
5. IMPLEMENTATION AND TESTING 56
5.1 Software Testing 56
5.2 Testing Levels 57
5.3 System Tests 58
6. RESULTS AND ANALYSIS 59
6.1 Simulation 59
6.2 Simulation for Proposed System 61
6.3 Hardware and results 63
6.4 Heart alert message display on LCD 65
7. CONCLUSION AND FUTURE ENHANCEMENT 67
7.1 Summary 67
7.2 Conclusion 68
7.3 Future Extension 69
REFERENCES 70
APPENDIX 74
A. CODE 74
B. SCREENSHOTS 85

PAGARISM REPORT

viii
LIST OF FIGURES

Figure No. Figure Name Page No.

1.1 Remote Patient Monitoring 2

1.2 Heart rate monitoring techniques 10

3.1 Block Diagram of Existing System 29

3.2 Bock diagram of proposed diagram 31

3.3 Flow chart of proposed system 33

3.4 Circuit Diagram 34

3.5 Schematic diagram 35

4.5.1 Arduino UNO Board 42

4.5.2 IDE Software 42

4.5.3 Pulse Sensor 43

4.5.4 Breadboard 45

4.5.5 ESP8266 46

4.5.6 LCD Module 48

ix
4.5.7 Jump wires 49

4.6 System Architecture 55

6.1 Program Output 60

6.2 Simulation of proposed system 61

Simulation for heart attack detection


6.3 62

6.4 Hardware of proposed system 63

6.5 Result of proposed system(Graph) 64

6.6 Result of heart attack detection 64

6.7 Heart rate display 66

x
LIST OF TABLES

Table No. Table Name Page No.

Requirements for Arduino Uno connection


4.5 41

xi
LIST OF ABBREVATIONS

BPM - Beats Per Minute

ECG - Electrocardiography

PVC - Premature Ventricular Contractions

LED - Light Emitting Diode

LCD - Liquid Crystal Display

PPG - Photo-Plethysmography

BCG - Ballistocardiography

MCU - Multipoint Control Unit

PTT - Pulse Transit Time

UART - Universal Asynchronous Receiver Transmitter

CABG - Coronary Artery Bypass Grafting

WBAN - Wireless Body Area Network

PIEM - Portable Intelligent ECG Monitor

MQTT - Message Queuing Telemetry

SHS - Smart Hospital System

WSN - Wireless Sensor Network

SMS - Short Message Service

PHDs - Personal Healthcare Devices

xii
Chapter 1

INTRODUCTION

1.1 GENERAL

The proposed project revolves around the creation of a sophisticated heart rate monitoring and
heart attack detection system, harnessing the capabilities of an integrated Wi-Fi module. This
innovative approach not only enables continuous monitoring of patients' heart health but also
facilitates immediate transmission of critical data to healthcare professionals, thereby
revolutionizing the provision of urgent care. The advent of remote patient monitoring heralds a
transformative era in healthcare delivery, extending its reach beyond the confines of traditional
clinical settings to encompass various facets of daily life, including work, home, and
recreational activities.
Chronic diseases stand as a formidable challenge to public health globally, with India
grappling with their significant burden, notably as a leading cause of mortality. The essence of
continuous and long-term monitoring for effective management of heart-related conditions
cannot be overstated. Herein lies the promise of IoT technology, which offers a paradigm shift
from conventional monitoring systems to a more efficient and accessible framework. By
leveraging IoT, critical patient data concerning heart rate and associated parameters become
readily available to healthcare providers, empowering them to make informed decisions
promptly.
At the heart of IoT lies the interconnectedness of diverse objects, transcending the realm of
computers to encompass everyday items such as wearable devices, household appliances, and
medical equipment. This interconnected network facilitates seamless communication and data
exchange, fostering real-time monitoring and intervention. The IoT ecosystem envisages a
future where inanimate objects become imbued with intelligence, enabled by embedded
sensors and computational capabilities.Central to the project's vision is the utilization of IoT
for heart rate monitoring, recognizing its potential to revolutionize cardiovascular care. By
seamlessly integrating IoT-enabled devices into patient care pathways, healthcare providers

1
gain unprecedented insights into patients' physiological parameters, allowing for timely
interventions to mitigate adverse events. Furthermore, the real-time monitoring capabilities
extend beyond the confines of healthcare facilities, enabling remote monitoring by nurses and
duty doctors.
In essence, this project represents a pioneering endeavor at the intersection of healthcare and
IoT, promising to redefine the landscape of cardiovascular care. By harnessing the power of
connectivity and real-time data analytics, it seeks to empower both patients and healthcare
professionals in the ongoing battle against heart-related diseases.

Fig 1.1 Remote Patient Monitoring

1.2 PROBLEM STATEMENT

According to WHO, 17 million people die from CVD which makes up to 31% of the deaths
worldwide. Hence a method to prevent or to help in reducing the losses of people's lives. With
the advancements in biotechnology, the standard heart rate monitoring system have raised
great attention in terms of its use in hospitals and clinics. However, the use of this concept

2
gives rise to portable heart rate monitors (HRM). On contrary, there are several issues in the
field of biotelemetry, one of which is the brainstorming of bioelectrical signals generated
from the (HRMs). The heart signals obtained from such portable devices might not be that
accurate compared to the standard at hospitals. Another problem arises in optical heart
monitors, is the accurate placement of the sensors around the body parts, i.e. knowing which
part of the body gives the greatest or least amplitude of the pulse. Furthermore, the
interferences such as noise, skin tone, the crossover problem gives bad results in optical
HRMs. When compared to standard heart monitors, the performance of wearable pulse
oximeters lacks in terms of calculating heart rate giving huge errors in detection.

1.3 MOTIVATION FOR THE SELECTION OF PROBLEM

Prioritizing occupational health and safety (H&S) within organizations is imperative due to the
escalating occurrences of workplace accidents and injuries. These incidents often stem from
various hazards such as hazardous equipment, electricity, toxic substances, and fire,
underscoring the critical need for robust safety protocols. The significance of H&S in the
workplace is underscored by the invaluable nature of human resources, as the loss of human
life is both irreplaceable and profoundly distressing for both families and organizations alike.

Effective H&S management within the workplace serves as a cornerstone for safeguarding the
lives of workers, with tangible benefits extending to enhanced productivity and heightened
employee loyalty. By fostering a safe and healthy work environment, decision-makers across
all industries can bolster the overall well-being of both employees and employers. Mitigating
workplace accidents, which occur with alarming frequency, is pivotal for preserving human
capital and minimizing disruptions to operations.

In the realm of H&S products, prioritization is paramount, particularly in the aftermath of


workplace accidents. First aid kits emerge as indispensable assets, directly contributing to
saving lives in emergency situations. The absence of essential items within these kits could
potentially exacerbate injuries and result in tragic outcomes. Similarly, fire extinguishers

3
assume critical significance in averting catastrophic damage to individuals, infrastructure, and
organizational assets.

Furthermore, specialized safety equipment such as earplug dispensers play a pivotal role in
safeguarding employees exposed to prolonged periods of high-level noise, mitigating the risk
of hearing loss. The proactive deployment of such safety measures underscores a commitment
to employee well-being and underscores the organization's ethical and legal responsibilities.

Traditionally, the monitoring of H&S data has relied on manual processes conducted at
periodic intervals, thereby risking outdated information and equipment non-compliance. This
approach not only proves inefficient but also necessitates substantial expenditure on labor
costs. Embracing digital solutions for H&S monitoring offers a more dynamic and responsive
approach, enabling real-time updates and ensuring ongoing compliance with safety
regulations.

1.4 OVERVIEW

The IoT-based Heart Attack Detection and Heart Rate Monitoring System project aims to
revolutionize real-time monitoring by tracking and identifying heart-related irregularities. It
employs an array of sensors strategically placed on the patient's body to continuously track
vital parameters such as heart rate and blood pressure. This data is then seamlessly
transmitted to a cloud-based platform for comprehensive analysis and ongoing monitoring.

The system's core functionality lies in its ability to swiftly identify any deviations from
normal heart function and promptly alert healthcare professionals or concerned family
members. This early detection mechanism holds immense potential in mitigating the risk of
heart attacks and other cardiovascular ailments, potentially saving lives in the process.

Utilizing IoT technology, the project integrates a network of interconnected devices and
sensors, operating cohesively to deliver real-time data insights. Wireless communication
protocols like Bluetooth and Wi-Fi facilitate seamless data exchange between the sensors and
the cloud platform, ensuring uninterrupted monitoring capabilities.

4
The versatility of the Heart Attack Detection and Heart Rate Monitoring System extends its
utility beyond patient care. It serves as a valuable tool for individuals afflicted with
cardiovascular conditions or those at heightened risk of heart attacks. Moreover, healthcare
professionals can leverage its capabilities for remote patient monitoring, whether in hospital
settings or distant locations.

In essence, this innovative system holds promise in not only preventing heart-related
illnesses but also in enhancing the overall quality of life for patients grappling with
cardiovascular diseases. Its seamless integration of IoT technology marks a significant
advancement in healthcare monitoring, poised to make a tangible difference in patient
outcomes and well-being.

1.5 INFERENCE OF THE PROJECT

The IoT-based Heart Attack Detection and Heart Rate Monitoring System is a groundbreaking
application of IoT technology aimed at enhancing real-time monitoring of vital health
parameters. Its primary objective is to enhance the early identification of heart-related
irregularities, thereby mitigating the risk of heart attacks and related cardiac conditions.

Central to the system are multiple sensors strategically positioned on the patient's body,
continuously monitoring critical metrics such as heart rate and blood pressure. These sensors
relay data to a cloud-based platform for in-depth analysis and ongoing surveillance. Any
deviations from normal heart function trigger immediate alerts to healthcare professionals or
concerned individuals, enabling prompt intervention.

This innovative solution holds significant promise for patients grappling with cardiovascular
diseases or those at heightened risk of heart attacks. It also proves invaluable for healthcare
providers, facilitating remote patient monitoring in hospital settings or remote locations.

Ultimately, the project aims to enhance the quality of life for individuals afflicted with
cardiovascular ailments by enabling early detection and timely medical intervention. By

5
empowering healthcare professionals with actionable insights, it seeks to reduce the incidence
of heart attacks and improve overall patient outcomes in the realm of cardiac health.

1.6 PROBLEM IDENTIFICATION

Precision: The precision of the heart attack detection system stands as paramount, as any
inaccuracies could lead to erroneous diagnoses and potential harm. Thus, ensuring the sensors'
reliability and accuracy is imperative.

Real-time Data Analysis: Swift processing of collected data is essential for timely detection
of potential heart attacks. This necessitates the implementation of sophisticated algorithms
capable of swiftly analyzing data to identify anomalies or patterns.

User Interface: A user-friendly interface is crucial for effective communication of data to both
healthcare professionals and patients. The interface should be intuitive, facilitating easy
comprehension and navigation.

Power Efficiency: Minimizing power consumption is vital to prolonging device battery life.
High power consumption could render the system impractical for extended use without
frequent recharging.

Affordability: The system's cost should be reasonable to ensure accessibility to the general
populace. Affordability is key to widespread adoption and utilization of the heart attack
detection system.

1.7 AIM OF THE PROJECT

The objective of the IoT-based heart attack detection and heart rate monitoring project is to
create a dependable and efficient solution for continuous heart rate monitoring and early
identification of potential heart attacks. The project endeavors to deliver a user-friendly,
precise, and widely accessible system tailored for individuals susceptible to heart disease or
those with a history of heart-related issues.

Leveraging IoT technology, the project seeks to enable real-time heart rate monitoring using
sensors, with data transmission to the cloud for analysis and timely detection of potential heart
6
attacks. Additionally, the system aims to furnish users with historical data and notifications
highlighting significant fluctuations in heart rate, empowering them to proactively manage
their heart health and adopt lifestyle changes to mitigate the risk of cardiovascular diseases.

Furthermore, the project endeavors to tackle various implementation and deployment


challenges, including ensuring the accuracy of sensor data, addressing privacy considerations,
and ensuring affordability and accessibility across diverse demographics.

In essence, the overarching goal of the project is to develop a comprehensive and efficient
solution for heart rate monitoring and early detection of potential heart attacks. By doing so,
the project aims to enhance the overall health and well-being of individuals vulnerable to heart
disease, ultimately contributing to better cardiovascular outcomes and improved quality of life.

1.8 SCOPE OF THE PROJECT

The project scope for an IoT-based heart attack detection and heart rate monitoring system
encompasses a series of key stages, including design, development, testing, and deployment,
with the ultimate goal of providing continuous heart rate monitoring, early detection of
potential heart attacks, and access to historical data and notifications regarding significant
heart rate changes.

Specifically, the project entails the following components:

Sensor Development: Creation and testing of sensors capable of accurately measuring heart
rate and transmitting data to the cloud.

Cloud Infrastructure Development: Establishment of a robust cloud infrastructure for


receiving, storing, and analyzing heart rate data.

Data Analysis and Alert System Development: Development of algorithms to analyze heart
rate data and detect potential heart attacks, alongside the implementation of an alert system to
notify users or emergency contacts in such events.

User Interface Development: Creation of an intuitive user interface providing easy access to
heart rate data and notifications.
7
Testing and Validation: Rigorous testing and validation processes to ensure the system's
accuracy, reliability, and efficacy.

Deployment and Maintenance: Rollout of the system to individuals requiring continuous


heart rate monitoring, coupled with ongoing maintenance to uphold performance standards.

Additionally, the project may address challenges such as data privacy and security,
affordability, accessibility, and compliance with regulatory requirements concerning health
data usage.

In essence, the project's overarching objective is to develop and implement a comprehensive


heart rate monitoring system capable of significantly improving health outcomes for
individuals at risk of heart disease.

1.9 OBJECTIVE

Early detection of heart attacks through continuous monitoring of patient heartbeats is a


primary goal of this system.
• Recognizing the significance of health-related parameters and issues, numerous systems have
been devised to monitor fluctuations in these parameters.
• This system introduces real-time remote monitoring and management of heart functionality
and epilepsy.
• Employing a wireless module, this system implements a cost-effective, efficient, and
adaptable heart rate detection and alert mechanism.
• In the event of sudden changes in patient heartbeats or bodily functions, the system
autonomously notifies both the attending physician and relevant family members via IoT.
Simultaneously, it archives patient details in the cloud for future reference.

1.10 APPLICATIONS
Early Heart Attack Detection: Utilizing IoT technology, a heart attack detection system
continuously monitors key indicators such as heart rate and blood pressure to swiftly identify
any abnormalities signaling a potential heart attack. Prompt alerts are then issued to either the
patient or healthcare provider, facilitating timely medical intervention.
Remote Patient Monitoring: Employing IoT-enabled heart rate monitoring, healthcare
8
providers gain access to real-time data on patients' heart health, even remotely. This proves
particularly advantageous for individuals managing chronic heart conditions, enabling early
detection of any changes in their health status.
Tailored Treatment Strategies: Through longitudinal tracking of vital signs, IoT-based
systems empower healthcare professionals to craft personalized treatment plans attuned to
each patient's unique requirements, optimizing health outcomes.
Cost Savings in Healthcare: By proactively detecting potential heart attacks and facilitating
prompt medical attention, IoT-based heart attack detection systems contribute to mitigating
healthcare expenses. Prevention of costly hospitalizations and interventions underscores their
role in driving down overall healthcare costs.

1.11 STATISTICAL METHOD

Monitoring heart rate is crucial for maintaining cardiovascular health, with different age
groups having varying optimal heart rate ranges. To address this, an IoT-based system has
been developed, utilizing a NodeMCU and pulse sensor to monitor heartbeats. This system
incorporates an alert mechanism triggered by predefined thresholds, ensuring timely
intervention if the heart rate exceeds or falls below acceptable levels as per the algorithm.
Alerts are relayed to doctors via a mobile application, granting them access to patient heart
rate data from any location. Additionally, nurses or duty doctors can monitor patients' heart
rates in real time through a serial monitor interface, enhancing patient care and facilitating
swift responses to any irregularities detected.

1.12 HEART RATE MONITORING TECHNIQUES

Wearable heart rate sensors, discreetly embedded in devices like smartwatches and fitness
bands, offer continuous real-time monitoring of the wearer's cardiac activity. These sensors
detect subtle fluctuations in blood flow, translating them into easily accessible heart rate data
for seamless tracking of cardiovascular health.

9
Fig 1.2 Heart rate Monitoring Techniques

Incorporating IoT technology into cardiac monitoring systems establishes a network


facilitating remote data collection and analysis. Whether sourced from wearable sensors or
implanted devices, heart rate measurements are securely transmitted to a centralized platform
for comprehensive evaluation.

Wireless communication protocols such as Bluetooth or Wi-Fi enable the effortless transfer of
heart rate data from wearables to smartphones or other IoT-enabled devices. This connectivity
ensures instant access to heart rate information, optimizing monitoring efficiency and user
convenience.

Advanced algorithms process raw heart rate data to uncover valuable insights, including heart
rate variability analysis and detection of abnormal patterns indicative of cardiac issues or
potential heart attacks. These algorithms, powered by machine learning, continuously enhance
accuracy and adapt to individual variations in heart rate patterns.

With the emergence of telemedicine and remote patient monitoring, remote heart rate detection
is now feasible regardless of the patient's location. This advancement underscores the

10
transformative potential of technology in revolutionizing cardiac care and enhancing patient
outcomes.

1.13 POTENTIAL EFFECTS AND BENEFITS

Detecting Cardiac Abnormalities Early: Through continuous heart rate monitoring using
IoT devices, individuals can spot subtle changes in their heart activity, signaling potential
cardiovascular issues or impending heart attacks. Timely detection enables swift medical
intervention, potentially averting severe complications and improving overall health outcomes.

Better Cardiovascular Health Management: Real-time access to heart rate data empowers
individuals to actively monitor their heart health and make informed lifestyle choices. By
tracking heart rate trends over time, they can identify patterns, set health goals, and take
proactive measures such as regular exercise, stress management, and adopting heart-healthy
dietary habits.

Enhanced Remote Patient Monitoring: IoT-based cardiac monitoring systems enable remote
patient monitoring, allowing healthcare providers to track heart rate data in real-time from afar.
This capability proves invaluable for individuals with chronic heart conditions or heightened
cardiovascular risk, enabling early complication detection and timely intervention, even
outside traditional clinical settings.

Tailored Healthcare Solutions: Advanced algorithms analyzing heart rate data offer
personalized insights and recommendations tailored to individuals' unique cardiac profiles. By
identifying abnormal heart rate patterns and associated risk factors, these algorithms aid
healthcare providers in crafting customized treatment plans and interventions to optimize
patient outcomes.

Improved Quality of Life: Early detection of cardiac abnormalities and timely intervention
facilitated by IoT-based heart rate monitoring can lead to enhanced patient outcomes, reduced
hospitalizations, and an overall improvement in quality of life for individuals with heart
conditions. By empowering proactive management of cardiovascular health, these

11
technologies have the potential to alleviate the burden of cardiovascular disease and associated
healthcare costs.

1.14 EARLY WARNING SYSTEMS FOR HEART HEALTH

Baseline Heart Rate Comparison: Regularly monitoring your resting heart rate and
comparing it to your typical baseline can reveal deviations that may signal underlying heart
issues. Sudden spikes or drops in resting heart rate could indicate cardiovascular stress or
impending problems.

Heart Rate Variability (HRV): HRV, reflecting variations in the time intervals between
consecutive heartbeats, offers insights into the autonomic nervous system's heart regulation.
Monitoring HRV can detect abnormalities associated with increased heart attack risk, as
decreased HRV has been linked to cardiovascular events.

Continuous Heart Rate Monitoring: Wearable devices like smartwatches or fitness trackers,
equipped with heart rate sensors, enable continuous heart rate monitoring. Real-time alerts for
abnormal heart rate patterns prompt timely medical attention, especially for sudden
fluctuations beyond normal levels.

Exercise-induced Heart Rate Response: Monitoring heart rate during physical activity helps
identify abnormal responses indicating cardiovascular strain or reduced blood flow to the
heart. Excessive increases in heart rate or failure to reach target levels during exercise could
signal underlying heart issues.

Heart Rate During Rest and Sleep: Monitoring heart rate during rest and sleep uncovers
nocturnal abnormalities like nocturnal angina or arrhythmias, posing nighttime heart attack
risks. Wearable devices with sleep tracking capabilities detect irregular heart rate patterns
during sleep, warranting further evaluation.

12
Integration with Health Monitoring Systems: Integrating heart rate monitoring with other
health metrics like blood pressure, blood glucose, and physical activity offers a holistic view of
cardiovascular health. Advanced systems employing AI algorithms analyze multiple data
points to generate personalized early warning alerts for individuals at high heart attack risk.

1.15 HEART ATTACKS PREDICTING

Utilizing Multiple Sensors: IoT devices can amalgamate data from various sensors like
accelerometers, gyroscopes, and skin temperature sensors alongside heart rate monitoring.
This multi-sensor fusion enables a comprehensive assessment of physiological status,
capturing subtle shifts in activity levels, sleep patterns, stress indicators, and autonomic
nervous system activity that may precede a heart attack.

Harnessing Machine Learning: Sophisticated machine learning algorithms, including


supervised, unsupervised, and deep learning techniques, analyze multi-dimensional sensor data
to discern patterns linked to heightened heart attack risk. By assimilating historical data, these
algorithms detect anomalies, predict future occurrences, and furnish personalized risk
assessments.

Feature Engineering: Extracting pertinent features from sensor data—such as heart rate
variability (HRV) parameters, time-domain and frequency-domain metrics, stress indices,
sleep quality indicators, and activity intensity measures—enhances heart attack prediction.
Feature selection methods identify the most predictive features for model development.

Incorporating Risk Factors: Heart attack prediction models amalgamate traditional


cardiovascular risk factors—like age, gender, family history, smoking status, blood pressure,
cholesterol levels, diabetes status, and medical history—to bolster predictive accuracy.
Integration of demographic, clinical, and lifestyle data with sensor-derived metrics offers a
comprehensive cardiovascular risk assessment.

Real-time Alerts and Interventions: Once operational, predictive models deliver real-time
alerts and interventions for individuals at heightened risk of heart attacks. IoT devices
13
promptly notify users, caregivers, or healthcare providers of abnormal heart rate patterns,
warning signs, or imminent cardiac events, facilitating timely intervention, emergency
response, and preventive measures.Validation and Clinical Trials: Rigorous validation and
evaluation procedures assess the performance, accuracy, reliability, and clinical viability of
IoT-based heart attack prediction models. Large-scale clinical trials involving population
studies and outcome validation validate the predictive prowess of these systems, affirming
their efficacy in real-world scenarios.

14
CHAPTER 2

LITERATURE SURVEY

2.1 REVIEW OF PAPERS

D. Selvathi et al.'s (2017) proposed embedded-based automatic heart attack detector and
imitator offers a novel solution for continuous heart health monitoring. This system utilizes a
heartbeat sensor that, upon finger contact, generates a digital output synchronized with each
heartbeat, represented by LED flashes. By measuring changes in light intensity caused by
blood flow, the sensor effectively detects heartbeats in real-time.The microcontroller processes
this digital output, directly measuring the heart rate in Beats Per Minute (BPM). Powered by a
PIC16F877 controller, the system executes a heart attack detection algorithm programmed to
distinguish between normal and pathological heart rhythms. Aberrant heart rates falling below
60 or exceeding 90 BPM trigger the activation of a GSM module, facilitated by the SIM300
GSM GPRS Modem.The SIM300 modem, operating on tri-band frequencies, ensures reliable
communication by activating whenever an abnormal heartbeat is detected. This plug-and-play
modem, integrated with an industrial-quality PCB for enhanced performance and noise
immunity, serves as a crucial component in the system's ability to promptly alert designated
helplines in case of potential heart issues.In essence, this system provides an effective means
of continuously monitoring heart health, offering potentially life-saving intervention by
promptly notifying medical authorities upon detection of abnormal heart rhythms.

Andriy Temko et al. (2017) introduced a pioneering method for accurately monitoring heart
rate during physical exercise using Photoplethysmography (PPG). Their technique, known as
WFPV, employs sophisticated algorithms like Wiener filtering to mitigate motion artifacts and
a phase vocoder to enhance tracking of the subject's physiology. This approach, coupled with
user-adaptive post-processing and an offline variant of Viterbi decoded heart rate estimation,
achieved remarkably low average absolute errors of 1.97 and 1.37 across a dataset of 23 PPG
recordings. Athletes stand to benefit significantly from this precise heart rate monitoring,

15
enabling them to fine-tune their training load and align it more effectively with their
programming goals. Unlike conventional Electrocardiography (ECG), which necessitates
ground and reference sensors secured to the chest, PPG-based monitoring offers a practical
alternative. PPG sensors embedded in wearable devices, positioned at extremities like wrists,
fingertips, or earlobes, capture signals emitted as light onto the skin. These sensors measure
changes in light intensity, typically corresponding to cardiac rhythm, facilitating heart rate
estimation.This innovative approach eliminates the need for cumbersome chest-mounted
electrodes, making heart rate monitoring more accessible and convenient for users. By
leveraging the periodicity of PPG signals, derived from light transmission or reflection
through the skin, this method provides accurate heart rate estimates without compromising
comfort or mobility during physical activity.

Priyanka Sasidharan and colleagues (2018) devised a novel wearable cardiorespiratory


monitoring device with the capability of predicting heart attacks. This innovative system offers
real-time monitoring and display of four vital parameters on either a phone screen or a
computer monitor. It encompasses heart rate, respiration rate, oxygen saturation in the
capillaries, and body temperature, all crucial indicators of cardiovascular and respiratory
health. The core technology employed in this device is photoplethysmography (PPG), a
method that measures heart rate by detecting changes in blood volume as blood flows through
arteries or organs. Light is emitted onto the skin, and variations in blood volume alter the
intensity of the reflected light, facilitating heart rate measurement. The system utilizes an
Arduino microcontroller equipped with an ATmega328P processor to process and display the
collected data.One unique feature of this device is its ability to calculate Pulse Transit Time
(PTT) from detected heart rates and respiration rates. By employing signal processing
techniques and applying linear interpolation and finite impulse response (FIR) filtering, the
system derives smooth PTT series, which aids in determining respiration rate. Additionally, the
device incorporates a SpO2 sensor, typically a fingertip sensor, to measure oxygen saturation
levels based on changes in light intensity, in accordance with Beer-Lambert's law.This
wearable monitoring system not only offers convenience and portability but also serves as a

16
valuable tool in managing cardiovascular and respiratory conditions. Its previous iteration
relied on MATLAB programming, but the updated version is fully integrated with the Android
system, enhancing its usability as a wearable device. This adaptation ensures that users can
easily access and interpret their physiological data, making it particularly beneficial for
individuals with conditions such as asthma or other respiratory disorders.

MD Rysul Kibria Badhon and team (2019) introduced a microcontroller-based system for
detecting missing heartbeats and monitoring heart rate in real time. This device utilizes a pulse
sensor, an Arduino Uno board, and an ATmega328p microcontroller, employing the
photoplethysmography (PPG) process. The system not only monitors heart rate but also
identifies missing heartbeats, particularly due to premature ventricular contractions (PVCs),
enhancing its potential to preemptively alert individuals to potential heart issues. Initially, the
device displays heart rate and missing beat information on a Liquid Crystal Display (LCD).
Subsequently, this data is transmitted via serial communication to an ESP8266 Wi-Fi module,
which uploads the information to a designated website using the Message Queuing Telemetry
Transport (MQTT) protocol. This seamless integration allows users to continuously monitor
their heart rate and missing pulse information remotely, enabling timely intervention if
necessary. To enhance signal accuracy, the system compares the PPG signal with data from a
triple-axis accelerometer to mitigate environmental noise, thereby improving the reliability of
heart rate measurements. Furthermore, the pulse sensor can be refined to enhance noise
immunity, ensuring more accurate readings. Beyond its current capabilities, the device has the
potential for further enhancements to measure additional vital signs such as blood pressure
and respiratory rate. Moreover, an authentication system, possibly employing facial
recognition or fingerprint verification, could be implemented to ensure secure access to the
device's data and functionalities. Overall, MD Rysul Kibria Badhon's device represents a
significant advancement in wearable health monitoring technology, offering comprehensive
heart rate monitoring and early detection of potential cardiac irregularities, with the potential
for further refinement and expansion of its capabilities.

17
Minal Patil and her team (2019) introduced a heart rate monitoring system designed to
display heart rate readings on devices such as mobile phones or laptops. The system utilizes a
pulse sensor, which requires users to place their finger on top to measure heartbeats. The pulse
sensor functions by detecting changes in light caused by the expansion of capillary blood
vessels, amplifying these variations, and converting them into pulses. In hospitals, ECG tests
typically require electrodes to be connected to the patient's body to view ECG graphs on a
CRO. Similarly, the proposed system allows patients to view their own ECG pulses by
connecting an external ECG sensor to the device, enabling them to observe their pulse waves
on a laptop. Electrocardiograms (ECGs) represent the voltage graph produced by the heart,
with five features denoted by the letters P, Q, R, S, and T, corresponding to different stages of a
heartbeat. By detecting the R peak and measuring the time between them, the heart rate can be
calculated and displayed. While some systems utilize pulse oximeter sensors, the proposed
system opts for a PPG sensor due to its lower cost and comparable results. Additionally,
instead of Zigbee modules limited to specific areas, the proposed system leverages IoT
technology to cover a broader range. Moreover, unlike systems reliant on app interfaces, which
may pose usability challenges, the proposed system operates via SMS, ensuring accessibility
for all users. The system continuously monitors the patient's heartbeat, transmitting data to a
cloud server via a Wi-Fi module. When the heartbeat deviates from a predetermined threshold,
the system triggers an alarm and sends notifications via GSM to the patient's relatives and
doctor. It also maintains a record of database files on the cloud server for future reference.
Designed with minimal hardware to reduce costs, the system offers an affordable and easy-to-
implement solution for detecting heart attacks. In summary, Minal Patil's system achieves its
aim of detecting heart attacks effectively by setting threshold values with a microcontroller to
trigger notifications when exceeded, providing a user-friendly and accessible approach to heart
rate monitoring and emergency response.

T.Elakkiya and colleagues (2017) introduced a wearable safety wristband device tailored for
monitoring the health of elderly individuals and those with physical disabilities, offering

18
features such as fall detection and heart attack alarms. This innovative solution aims to address
the challenges of caring for vulnerable individuals in today's fast-paced world, providing them
with a convenient method of notifying others about their condition via smartphones. Central to
this approach is the integration of multiple functionalities into a single device, allowing for the
monitoring of location, heart rate, alarm activation, device location tracking, and medication
adherence. One notable feature involves the use of inexpensive NFC tags embedded in
medication bottle lids or packaging for medical tablets. These tags, which function as
permanent memory cards with wireless access, store information about prescribed
medications. When it's time to take medication, the individual simply presses the medicine
record button on the Elder-GUARD device and brings the medicine tag within close proximity
(less than 10cm). The device reads the tag's content and stores it in its memory, subsequently
indicating whether the medication should be taken through a color-coded light system. To
ensure efficient operation, the device employs a high-end processor and controller from the
ARM Cortex M0+ series, equipped with high-speed interfaces for UART, I2C, and SPI
protocols. Additionally, it utilizes smart e-paper technology for display, offering superior
performance compared to traditional display methods. By consolidating multiple
functionalities into a single device, this project provides valuable assistance to elderly
individuals, children, and those with physical disabilities. While the NFC standard offers
intrinsic security benefits, its short range presents a limitation. Future iterations may explore
the integration of new low-power wireless technologies such as Bluetooth Smart ready
(Bluetooth Low Energy) to enhance functionality and connectivity.

Po-Wei Huang and collaborators (2020) introduced a heart rate monitoring framework
tailored specifically for real-world drivers, utilizing remote photoplethysmography (rPPG).
The significance of ensuring traffic safety cannot be overstated, with studies indicating that a
notable percentage of disease-related vehicle accidents stem from cardiovascular issues. In this
context, assessing a driver's medical condition or fatigue level often relies on heart rate (HR)
measurements, which serve as a key indicator.Traditionally, HR assessment has relied on
contact sensors for electrocardiograms (ECGs) and photoplethysmography (PPG). However,
the physical contact required by these sensors can lead to discomfort and distraction for
drivers. To mitigate this risk, the adoption of HR measurement through remote

19
photoplethysmography (rPPG) emerges as a promising alternative.The proposed method
presents a novel approach to HR extraction and analysis using rPPG, significantly enhancing
the accuracy of HR monitoring in driving scenarios. Leveraging statistical signal processing
techniques and Monte Carlo simulation, the algorithm offers an interpretable model based on
probability, striking a balance between robustness and sensitivity. Furthermore, the study
includes the creation of a comprehensive database encompassing various vehicles and
challenging routes, a pioneering effort in this domain.Notably, this research marks the first
attempt to analyze the impact of different vehicles on HR monitoring. The introduced
algorithm achieves a notable reduction in HR mean absolute error (MAE) across datasets
representing passengers, compact cars, and buses. Interdataset and intradataset analyses further
confirm the superior performance of the proposed algorithm over benchmark techniques,
particularly in driving contexts.Overall, the framework presents a significant advancement in
HR monitoring for drivers, offering improved accuracy and reliability, particularly in diverse
and challenging driving scenarios.

Lena Gohlke and colleagues (2020) proposed an innovative IoT-based system for low-cost
heart rate measurement employing photoplethysmography (PPG) sensors. This system aims to
address the challenge of conducting first-level medical examinations, particularly in rural areas
of emerging countries, where access to healthcare resources is limited. Traditionally, such
examinations require various parameters like body temperature, blood pressure, heart rate, and
respiratory rate. To enable remote assessment of these parameters, the development of
affordable, user-friendly, and IoT-enabled devices is essential. The focus of this study is on the
development of a heart rate sensor as the first step toward creating a comprehensive toolkit for
medical diagnosis in rural settings. The resting heart rate typically falls within the range of 40
to 109 beats per minute (bpm), establishing the minimum dynamic range for the heart rate
sensor. Photoplethysmography (PPG) emerges as a promising method for measuring heart rate
and blood pressure without the need for cuffs or invasive procedures. In PPG, light emitted by
LEDs is partially absorbed and reflected by tissue, with a photodiode detecting the reflected
light, which correlates with changes in blood volume due to heartbeats. However, challenges
arise due to signal interference from bones, motion artifacts, ambient light fluctuations, and
tissue deformation, complicating heart rate extraction from raw PPG data. Moreover, blood
pressure measurement from PPG data requires two spatially displaced sensors to establish the
20
relationship between blood pressure and arterial blood flow speed. To address these
challenges, the proposed system simultaneously acquires PPG signals from two sensors placed
at the wrist and fingertip of the patient, enabling the measurement of heart rate, blood pressure,
and blood oxygenation. Remarkably, the total cost of the prototype system, including PPG
sensors, Raspberry Pi, and 3D printed parts, is less than 30 USD. Signal processing is
performed on the Raspberry Pi, with processed data accessible remotely via a website. The
system's efficacy in measuring heart rate using a custom-developed algorithm was successfully
demonstrated on data collected from 45 patients, showing excellent agreement between the
low-cost system and a medical-grade device. Overall, this IoT-based approach offers a
promising solution for affordable and accessible healthcare in resource-constrained settings.

Dhruv R. Seshadri and colleagues (2020) conducted a study to evaluate the accuracy of the
Apple Watch 4 (AW4) in measuring heart rate in patients with atrial fibrillation (AF), a
prevalent cardiac arrhythmia affecting millions of individuals in the United States. While
wearable devices have gained popularity, concerns have arisen regarding their reliability in
clinical settings due to limited clinical data assessing their accuracy, especially in monitoring
conditions like AF. Previous research primarily focused on assessing the accuracy of
wristworn monitors in healthy individuals, leaving a gap in understanding their performance in
patients with cardiac arrhythmias like AF. The study aimed to fill this void by examining the
AW4's heart rate monitoring function specifically in individuals with AF. One notable finding
was the difference in heart rate measurement accuracy between patients with AF and those
with normal sinus rhythm or other cardiac rhythms. However, the study identified a significant
limitation: patients had to manually trigger the heart rate measurement by pressing a button on
the device's side. This reliance on manual input posed challenges, particularly in cases where
patients were asymptomatic or experiencing persistent AF. Ideally, the AW4 would
automatically detect changes in a patient's rhythm and initiate heart rate measurements
accordingly. However, the current model lacks this functionality, highlighting a crucial area for
improvement. Moreover, the study identified additional limitations that could impact the
device's accuracy and long-term utility in clinical settings. These included factors such as fluid
overload and edema post-surgery, as well as potential interference with other medical
equipment. In summary, while the AW4 shows promise as a wearable device for heart rate
monitoring, particularly in individuals with AF, there are notable limitations that need to be
21
addressed to enhance its clinical utility and accuracy. Future iterations of such devices should
aim to automate rhythm detection and mitigate factors that may affect measurement accuracy
and reliability in real-world clinical scenarios.
Christoph Hoog Antink and his team (2020) introduced a novel approach utilizing bed-
integrated ballistocardiography (BCG) sensors for unobtrusive nighttime physiological
monitoring, particularly focusing on heart rate (HR) estimation. While BCG monitoring has
gained traction in wellness applications for sleep quality assessment, its potential in clinical
settings remains relatively untapped. The study aimed to explore the clinical applicability of
BCG monitoring, particularly for patients in hospital wards, where continuous real-time
monitoring could provide valuable insights into recovery progress and early detection of
complications. Current monitoring practices for such patients are often sporadic and visual,
lacking systematic, continuous surveillance. Heart rate variability (HRV), an underutilized
measure of autonomic nervous system function, was also investigated as a potential marker for
patient recovery. Previous studies have shown alterations in HRV parameters following
surgery, particularly in patients experiencing postoperative complications. Monitoring
techniques utilizing cardiac-associated vibrations, such as BCG and wearable
seismocardiography sensors, have demonstrated accuracy in HR and HRV measurements in
healthy individuals. However, challenges arise when estimating HRV parameters due to the
need for consecutive beat-to-beat intervals (BBIs) and the potential impact of missing beats.
The study found that while estimation of HRV parameters, such as SDNN and RMSSD, was
feasible, there were discrepancies compared to electrocardiography (ECG) reference data.
These discrepancies may be attributed to the iterative estimation approach employed, which
tends to reduce variability and steer estimation closer to the median BBI interval. Moving
forward, further research is needed to refine estimation algorithms and assess their
performance using synthetic data to systematically control HRV parameters. Additionally,
exploring surrogate measures that correlate well with established HRV parameters could
enhance the accuracy and clinical utility of BCG-based monitoring systems.

Alessio Burrello and colleagues (2021) introduced a novel approach to energy-efficient heart
rate (HR) monitoring using photoplethysmography (PPG) sensors in wearable devices. In
recent years, there has been a notable shift from electrocardiogram (ECG) chest bands to
wrist-worn devices equipped with PPG sensors for HR tracking. While ECG sensors provide
22
accurate readings, they often come with discomfort and are costly, leading to the adoption of
PPG sensors for more comfortable and cost-effective HR monitoring directly from wrist-worn
devices. PPG sensors function by emitting light onto the skin using Light-Emitting Diodes
(LEDs) and measuring variations in light intensity caused by blood flow using photodetectors.
Peaks in the PPG signal correspond to heartbeats, making it an ideal method for HR
monitoring. However, one major challenge faced by PPG sensors is motion artifacts (MA),
which can introduce inaccuracies in HR measurements due to movements of the user's arm
and hand, altering the pressure on the skin or allowing ambient light to interfere with readings.
While ECG chest straps still outperform PPG-based HR tracking systems, especially in the
presence of motion artifacts, efforts have been made to bridge this gap through sensor fusion
approaches that integrate PPG with inertial sensors. These approaches aim to generate a rich
set of optimal models balancing accuracy and memory consumption. In their study, Burrello et
al. developed Q-PPG, a set of quantized deep learning models spanning three orders of
magnitude in memory occupation. These models achieve mean absolute errors (MAEs)
ranging from a state-of-the-art 4.36 beats per minute (BPM) to approximately 20 BPM on a
large dataset, addressing the limitation of previous research focusing solely on maximizing
performance. Q-PPG models are derived from a single seed network using a cascade of
automatic tools to progressively improve tracking performance or reduce model complexity
and memory footprint. The researchers deployed some of these models on a wearable
microcontroller unit (MCU)-based device, demonstrating real-time HR tracking with low
error rates. Importantly, these models contribute to only 14.1% of the total energy
consumption of the system, considering sensing and communication components as well. The
findings of this study hold significant implications for both clinical contexts and daily life, as
accurate and energy-efficient HR monitoring on wearable devices becomes increasingly
important. By addressing the challenge of motion artifacts and optimizing energy
consumption, Q-PPG models pave the way for more reliable and efficient HR tracking,
ultimately enhancing the usability and effectiveness of wearable health monitoring devices.

Manar M. Edris and colleagues (2021) have proposed an innovative IoT-based monitoring
system designed to detect epileptic seizures through heart rate variation (HRV). Epilepsy, a
23
neurological disorder characterized by seizures, affects individuals across demographics,
posing significant health risks and disruptions to daily life. Traditional methods of seizure
monitoring, such as electroencephalography (EEG), require attaching electrodes to the scalp
and are impractical for daily use due to time constraints and complexity in interpretation.

Recognizing the link between abnormal neuronal activity and alterations in the autonomic
nervous system (ANS), particularly in heart rate patterns, the researchers aimed to develop a
practical and accessible solution for seizure detection. While previous studies have
demonstrated changes in HRV preceding epileptic seizures, there has been limited research on
HRV-based seizure prediction.

The IoT-based monitoring system developed by Edris et al. leverages heart rate data to predict
seizures, providing essential information to healthcare providers or family members and
reducing the risk of sudden seizure episodes. The system comprises a pulse sensor as the input
unit, an LCD display for real-time monitoring, and a NodeMCU model for processing and
transmitting data.

The pulse sensor reads heartbeats and converts the data into signals, which are then processed
by the microcontroller and transmitted via a Wi-Fi module to the ThingSpeak platform.
ThingSpeak allows for the analysis and visualization of heart rate data in a user-friendly
format, accessible remotely via the internet. By recording the patient's heart rate over time,
caregivers can monitor the patient's health status from anywhere in the world, facilitating early
intervention and support.

The implementation of the IoT-based seizure monitoring system demonstrates high accuracy in
measuring pulse changes in epilepsy patients in real-time. The device utilizes an LCD display

24
to provide instant and clear heartbeat monitoring, enhancing usability for patients. Testing
conducted using the ThingSpeak application confirms the device's functionality, with results
available within 15 seconds of the test.

Overall, the IoT-based monitoring system offers a promising solution for seizure detection and
management, leveraging advances in technology to improve patient outcomes and quality of
life. By providing timely insights into heart rate variations, the system empowers patients and
caregivers to take proactive measures in managing epilepsy and reducing the impact of
seizures on daily activities. With further refinement and validation, this innovative approach
holds potential for widespread adoption in clinical settings and home-based care environments,
revolutionizing the way epilepsy is monitored and managed.

Charushila Patil et al.., (2021) proposed Heart (Pulse Rate) Monitoring using Pulse Rate
Sensor, Piezo Electric Sensor and NodeMCU The major difference between the above
mentione medical diagnostic system and techniques are that the first one takes the data from
the manually stored systems and the second one remotely. Remote health monitoring system
catches the data using Wireless Body Area Network (WBAN), an emerging area in Wireless
communication There are a variety of health or bio-sensors that operate within the body or
attached on or kept near to the human body, which in turn gather the required information
from the human body. The collected data is transmitted to the appropriate destination via the
communication network for processing. There upon, the decisions are made based on the
analysis result. Conventionally, ECG system is used in which up to 12 electrodes (sensors) are
attached on chest and limbs of patient for recording the signals that make heartbeat, the
electrodes are having sticky patches with wires that connect to a monitor. A computer records
the information and displays it as waves on a monitor or on paper. A human’s natural heartbeat
rate is 72 per minute. The resonance frequency is also the measurement factor of the human
body that can be useful to detect most of the diseases.In measuring the heart rate, the
resonance frequency of body also plays important role. Fusion of sensors will be made to
make system more compact and handy. In future the system will upgraded for the more vital
parameters like blood pressure, temperature, brain waves for real time monitoring.

25
G. Muhammad et al.., (2017) discussed and suggested the use of IoT-cloud technologies to
monitor patients' speech pathologies. Their project involved creating an Internet of Things
(IoT) monitoring system that detects voice signals and transmits them a smartphone serving as
the hosting device that then transports them to a cloud appropriately. After cloud verification,
the medical professional obtained the processed data for analysis and decision- making. The
local binary pattern on a representation of the Mel- spectrum was used by the authors to
construct their framework's vocal pathology monitoring system. To identify pathology, an
extreme learning machine was employed as a classifier. The suggested monitoring system was
easy to use and had a high level of detection precision.

T. A. Rahman et al.., (2016) provided a modified design for a healthcare monitoring system
that can remotely and in real time monitor patients' vital indicators such their heart rate, blood
pressure, body temperature, and blood sugar level. The proposed "mobile health monitoring
system" contained several wearable sensors that could link to the cloud and automatically
summon assistance when required.. To make the system's implementation easier, they built it
in two basic steps. The sensors initially sent the data they had gathered to an Android
application that had been created to serve provides a channel of communication between LTE
mobile networks and the sensors. The patient's acquired data were sent to the LTE network in
the second stage using a new dynamic scheduling mechanism that was based on how sensitive
the patient's condition was. This technique provided the data based on the priority of the
application's class and served the sensors in accordance with the demands made by the
applications, such as amount, postponement, and container damage rate.

M. S. Hossain et al.., (2016) presenteda real-time controlling and monitoring system to access
and examine patient healthcare data in order to provide highquality pate care and avoidable
patient deaths by implementing IoT technologies for enhancing the healthcare industry
(Health-I-IoT). The proposed Health-I-IoT system was built on a number of practical
strategies, including interconnected technologies, sensors, devices, apps, and health

26
professionals who can access, store, and analyse patient data anywhere in real time to
continuously monitor and track the patients. By simulation and experimental evaluation, the
viability of this strategy was confirmed. Mobile devices and sensors captured health-I- IoT
information (such as ECG signals) and securely communicated it to the cloud so that
healthcare professionals could access and monitor it safely. In order to prevent identity theft
and clinical blunders, the authors used a variety of analytical techniques, prior to transferring
the data to the cloud, e.g. signal augmentation and healthcare data watermarking.

Neha A. sarnarik et al.., (2018) developed a system in which the location of a heart attack
was logged and the heartbeat was monitored. Pulses can be read via to the utilized connection
to a microcontrollerr.and sent over the Internet. The user can choose the maximum and
minimum heartbeat rates. Afterwards, monitoring starts to see if the heartbeats are going over
or below the thresholds. The patient is connected to the transmitting circuit, and the authorized
staff is connected to the other circuit A database recordings of healthy participants' 24-hour
ECGs and people who had just had myocardial infarction is then evaluated sing the novel
approach. The study reveals that the model parameters of sick patients and those in the
reference group differ statistically significantly of healthy individuals.LCD panel displays
current pulse rate as determined by the heartbeat sensor. This proposed system has no
limitations and can be applied everywhere. You are not required to use the device at home.

J. Haritha et al.., (2018) In this system The Arduino Uno controls the system, and the GSM
module manages communication. The patient's heart rate is constantly monitored by the pulse
oximeter. In a pulse oximeter, the photodetectors are placed next to one another. When a
finger is employed in the reflecting technique, the light is reflected back to the sensor. The
amount of blood in the finger grows with each heartbeat, increasing the amount of light
reflected back to the sensor. The heart rate is therefore represented by the peak in the
waveform of the signal that was received. the microcontroller-provided threshold value is
continuously compared to the detected heart rate. When the continuously monitored heart rate
falls or rises outside of the predetermined range, the microcontroller automatically sends a
message to the patient's physician or family members using the standard GSM module

27
connected to the controller unit. Also, the doctors can access the patient's most recent medical
history from the database to ensure that the patient receives the required treatments.

Tamas Horvath et al.., (2022) Explain an effort to circumvent this issue in the proposed
system by utilizing a novel HRV time series evaluation method in this study. they develop a
master curve (or "M- curve") for characterizing the HRV(HR) function based on a modified
Poincare plot of the data acquired by a wearable heart-rate and activity sensor. This curve
displays impressive invariance to the majority of other overt elements (time, physical activity,
etc.), leading researchers believe that it can be used to measure an individual specifically
Usually, two exponentials can be used to fit the M-curve if the HR interval is large enough.;
additionally, they provide a stochastic model based on biomimetic principles for a more
comprehensive mathematical explanation.

Uchechukwu et al.., (2015) In this system, the functionality of the device was enhanced and
carefully considered in order to reflect desired features like price, complexity of the design,
the lack of portability, weight, size, and software development. For extremely accurate
detection and monitoring changes in heart rate, this design makes use of a tiny pulse sensor
(IC sensor). The system uses the microcontroller to calculate the heart rate in beats per minute
(BPM), displays the measured heart rate on a 16X2 character LCD, and sends an SMS with
the current BPM value if the heart rate changes above a set threshold. In addition, the patient
module's associated buzzer alarm sounds as a warning. The LCD display Minimaturised
sensor were chosen with mobility and compact size in mind in order to do away with the need
for a PC display and make the device easy to carry around for continuous monitoring.
Because of this, real- time remote monitoring is flexible regardless of location or distance.

28
CHAPTER 3

DESIGNING A IOT BASED HEART ATTACK DETECTOR

Utilizing IoT technology, we've developed a Heart Rate Monitoring system aimed at
detecting patients' heartbeats to monitor their risk of heart attacks and ensure regular health
check-ups. Body health monitoring is paramount for maintaining overall well-being. Our
cost-effective device focuses on monitoring heart rate (HR) from fingertips using Bluetooth
technology.

Comprising a Heart Rate module, Android application, and Bluetooth module, our system
employs a noninvasive technique, Photoplethysmography, to capture heart rate signals from
patients. These signals are wirelessly transmitted to a computer or Android application via
Bluetooth, enabling seamless data transfer within a radius of 15 to 20 meters. The received
data can be stored and reviewed for further medical assessment, making our device prototype
invaluable for diverse clinical investigations.

3.1 EXISTING SYSTEM BLOCK DIAGRAM AND EXPLANATION

Fig 3.1 Block Diagram Of Existing System

29
The model consists of different types of cardiac cells connected via a path model along a
conduction network. These cells and paths are represented using hybrid automata, which
account for complex dynamics like action potential and conduction velocity restitution, as
well as overdrive suppression. The model incorporates a hierarchy of pacemaker functions to
simulate normal sinus rhythms, while also allowing for the introduction of abnormal
automaticity to simulate various arrhythmias such as escape ectopic rhythms. Parameters of
the model are fine-tuned using experimental data and previous simulations.

3.2 DISADVANTAGE OF EXISTING SYSTEM

• The previous system only tracked heart rate and temperature.

• There was no provision for detecting epilepsy beforehand in the previous system.

• Arduino has limited memory and processing capabilities compared to NodeMCU.

• The previous system lacked the ability to generate electric pulses.

30
3.3 PROPOSED BLOCK DIAGRAM AND EXPLANATION

Fig 3.2 Block Diagram Of Proposed System

To enable remote heart rate monitoring from the comfort of home, our system employs
specialized sensors capable of detecting heartbeats. These sensors are seamlessly integrated
with a microcontroller, which processes the heart rate data and transmits it online. Users are
afforded the flexibility to set personalized upper and lower limits for heart rate monitoring.
Once these thresholds are configured, the system initiates continuous monitoring of the
patient's heart rate. In the event that the heart rate exceeds the predetermined limits, the

31
microcontroller promptly sends an alert online to both medical professionals and concerned
individuals. This ensures proactive monitoring of heart rate and enables swift response to
potential cardiac emergencies, regardless of the user's location. Additionally, the system
incorporates an electric pulse simulator, enhancing its capabilities by simulating electric pulses
throughout the body. This comprehensive approach to remote heart rate monitoring empowers
users to monitor their cardiovascular health effectively and receive timely alerts when
intervention is needed.

3.4 ADVANTAGE OF PROPOSED SYSTEM

• This feature enables concerned individuals to observe the patient's heart rate remotely

and promptly alert them to any signs of a heart attack, regardless of their location.

• Remote monitoring reduces the patient's workload by allowing them to check their

health details from home instead of visiting the hospital frequently.

• In the event of sudden changes in the patient's heartbeat or physiological functions, the

system automatically alerts both doctors and relatives.

• Additionally, during episodes of epilepsy or heart attacks, the system utilizes an electric

pulse simulator to administer pulses throughout the body, aiding in emergency

response.

32
3.3.5 FLOW CHART

Fig 3.3. Flow Chart of Proposed system

33
3.6 Circuit Diagram

This circuit comprises an Arduino Uno microcontroller, a heart rate sensor module, a reset
button, and an LCD display. The Arduino Uno serves as the central control unit, managing the
entire process of the system. It reads pulses from the heart rate sensor module, calculates the
heart rate based on these pulses, and then transmits the data to the LCD for display.

Additionally, the sensitivity of the heart rate sensor module can be adjusted using the built-in
potentiometer located on the module itself. This allows for fine-tuning the sensor's
responsiveness to accurately capture heart rate variations.

Fig 3.4 Circuit Diagram

34
3.7 Schematic Diagram

Fig 3.5 Schematic diagram

35
CHAPTER 4

METHODOLOGY

4.1 METHODOLOGY

Describe the project's goals and scope, outlining its aim to develop a system for heart attack
detection and heart rate monitoring. Define the target users, such as patients and healthcare
providers, and elucidate their distinct needs and expectations from the system. Detail the
technical requirements, including the types of sensors, IoT platform, data communication
protocols, and design considerations for the user interface.

4.2 MODEL

This study proposes a heart rate measurement technique utilizing a pulse sensor, Arduino
microcontroller, and Android Smartphone. The method relies on detecting variations in blood
volume using infrared light emitted by an LED and detected by a photodiode. The sensor,
placed on the fingertip, reflects the LED light to measure heart rate. The system integrates
components like the Arduino UNO, LCD, and Bluetooth Module to display real-time heart
rate data.

A crucial aspect of this device is its low cost and fingertip-based design, utilizing Bluetooth
technology. Comprising a Heart Rate module, Android application, and Bluetooth module, the
system facilitates wireless transmission of heart rate data.

Furthermore, the system is adaptable for universal application in hospital rooms. A centralized
monitoring setup enables operators to monitor multiple patients from a single location. Upon

36
detecting abnormal heart rates, the system triggers alerts using LED lights and a buzzer,
ensuring timely intervention.

With a rapid detection time of under 15 seconds, the system can promptly notify healthcare
providers of any deviations from normal heart rate levels. Notifications are tailored to indicate
heart rate status, such as BPM (Beats Per Minute), ensuring efficient patient monitoring and
management.

4.3 PRE-PROCESSING

Preparing data for heart attack detection and heart rate monitoring systems via IoT involves a
series of crucial preprocessing steps. Initially, raw sensor data is collected from IoT devices,
which may include signals like photoplethysmography (PPG), electrocardiogram (ECG), or
accelerometer readings. These signals often contain noise and artifacts, which necessitates
noise removal techniques to enhance signal quality. Filters are applied to eliminate unwanted
disturbances such as motion artifacts and electrical interference, ensuring that important
features related to heart rate are preserved.

Once the data is cleaned, it undergoes segmentation, where continuous sensor readings are
divided into discrete time windows or epochs. This segmentation simplifies subsequent
analysis and feature extraction, with window lengths tailored to the specific requirements of
the application and the expected dynamics of heart rate changes. Following segmentation,
baseline correction techniques are applied to address any shifts or drifts in the sensor data.
These corrections ensure consistency and accuracy in heart rate measurements by removing
baseline variations while preserving the integrity of the signal.

Artifact rejection is another critical preprocessing step, involving the identification and
removal of data segments contaminated by motion artifacts, electrode contact issues, or signal
dropout. Quality control measures are implemented to flag unreliable data segments for further
scrutiny or discard. Subsequently, heart rate estimates are calculated from the preprocessed
sensor data using appropriate algorithms. For instance, PPG signals may require peak

37
detection and inter-beat interval computation, while ECG signals rely on R-wave peak
detection to derive instantaneous heart rate.

Further analysis involves heart rate variability (HRV) analysis, which captures temporal
variations in heart rate dynamics. Time-domain and frequency-domain metrics are calculated
to assess autonomic nervous system activity and cardiovascular health. To ensure
comparability across individuals and sensor modalities, heart rate and HRV features are
normalized and scaled to a common range using standardization techniques. Finally, relevant
features are extracted from the preprocessed sensor data to characterize heart rate patterns and
physiological dynamics, encompassing various time-domain, frequency-domain, and nonlinear
measures.

In summary, preprocessing steps play a pivotal role in ensuring that data is cleaned,
segmented, and transformed to facilitate accurate analysis and interpretation in heart attack
detection and heart rate monitoring systems using IoT.

4.4 COMPONENTS USED


Heart rate monitoring system using Arduino Uno, a pulse sensor, connecting cables, an
LCD display, USB cable, and I2C (Inter-Integrated Circuit) communication, follow these
steps:
Components Needed:

1. Arduino Uno board

2. Pulse sensor module

3. Bread Board

4. ESP8266

5. LCD display (with I2C backpack)

6. Jumper wires for connections

38
7. USB cable for Arduino Uno

4.5 HARDWARE REQUIREMENTS

4.5.1 ARDUINO UNO:

The Arduino Uno serves as the central processing unit for this project, functioning as an open-
source microcontroller available in both hardware and software formats. Acting as the project's
brain, this board possesses all necessary features to operate the controller efficiently. It
facilitates seamless connectivity to a computer via a USB cable, enabling the transfer of code
to the controller using Integrated Development Environment (IDE) software. IDE, designed
specifically for Arduino programming, supports various operating systems including
Windows, MAC, and Linux. While IDE is compatible with multiple platforms, Windows is
often preferred for its ease of use. Programming languages such as C and C++ are employed
within the IDE environment to develop and execute code for Arduino-based projects.

General pin functions

The Arduino board features several key pi

ns and components that facilitate its operation and connectivity with external devices:

• LED: The board includes a built-in LED that is controlled by digital pin 13. When the

pin is set to a high value, the LED illuminates, and when it's low, the LED turns off.

• VIN: This pin serves as the input voltage for the Arduino board when using an external

power source. It allows voltage to be supplied directly to the board, either through this

pin or via the power jack.

• 5V: Outputting a regulated 5V from the onboard regulator, this pin supplies power to

39
the board. The board can be powered through the DC power jack, USB connector, or

VIN pin.

• 3V3: This pin provides a regulated 3.3V supply generated by the onboard regulator,

with a maximum current draw of 50 mA.

• GND: Ground pins are provided for electrical grounding purposes.

• IOREF: Serving as the voltage reference for the microcontroller's operation, this pin

allows shields to adapt to the appropriate power source or enable voltage translators for

compatibility with 5V or 3.3V systems.

• Reset: Typically used to incorporate a reset button for shields that may obstruct the

onboard reset button.

These components and pins play essential roles in powering, controlling, and interfacing with
external devices and circuits connected to the Arduino board.

Special pin functions

The Arduino Uno board features 14 digital pins and 6 analog pins, each of which can
serve as either an input or output, controllable via software commands such as
pinMode(), digitalWrite(), and digitalRead(). Operating at 5 volts, these pins can handle
a maximum current of 20 mA under recommended conditions. They also come equipped
with internal pull-up resistors (ranging from 20-50K ohm), although these are initially
disconnected. It's crucial to note that exceeding a maximum of 40mA on any I/O pin can
result in permanent damage to the microcontroller.

Additionally, the Uno provides 6 analog inputs, labeled A0 through A5, each offering
10 bits of resolution (equivalent to 1024 different values). By default, these pins
measure voltage levels from ground to 5 volts. However, users have the option to
modify the upper limit of this range using the AREF pin in conjunction with the analog
function. This flexibility allows for precise analog signal readings tailored to specific

40
project requirements.

Table 4.5 Requirements for Arduino Uno connection

In addition, some pins have specialized functions:

Communication:
The Arduino Uno facilitates communication with various devices, including computers,
other Arduino boards, or microcontrollers, through multiple channels. The ATmega328
microcontroller provides UART TTL (5V) serial communication, accessible via digital
pins 0 (RX) and 1 (TX). Additionally, an ATmega16U2 chip on the board manages
serial communication over USB, presenting itself as a virtual com port to computer
software.The firmware on the 16U2 chip utilizes standard USB COM drivers,
eliminating the need for external drivers. However, Windows systems may require a .inf
file for proper operation. The Arduino Software (IDE) features a serial monitor,
enabling straightforward exchange of textual data with the board. While transmitting
data via USB-to-serial conversion, the RX and TX LEDs on the Arduino Uno flash to
indicate activity. Furthermore, the Uno supports serial communication on any of its

41
digital pins through the Software Serial library. This feature enhances flexibility by
allowing users to establish serial connections using pins beyond the dedicated RX and
TX pins.

Fig(4.1-1). UNO BOARD Fig(4.1-2). IDE SOFTWARE

4.5.2 ELECTRIC PULSE SENSOR

A pulse sensor serves as a real-time heart rate measurement tool, typically incorporating an
optical sensor that detects blood volume changes under the skin, often at the fingertip. This
optical sensor, commonly a photoplethysmography (PPG) sensor, emits light into the skin and
measures the reflected light, which varies with blood volume alterations.

With each heartbeat, blood flows through the arteries and capillaries, leading to fluctuations in
blood volume at the fingertip. The pulse sensor detects these changes in light intensity and
converts them into an electrical signal. Through signal processing, this electrical signal is
transformed into a pulse waveform, representing the rhythmic arterial expansion and
contraction.

42
Subsequently, the pulse waveform undergoes analysis to determine the heart rate, typically
quantified in beats per minute (BPM). This calculation entails measuring the time interval
between successive peaks or troughs of the pulse waveform.

Fig 4.5.3 pulse sensor

Arduino-compatible pulse sensors offer a plug-and-play solution for integrating live heart rate
data into various projects. By simply placing a finger on the sensor, users can observe the
blood movement and receive numerical output of the heart rate. This accessibility makes pulse
sensors suitable for anyone seeking to incorporate heart rate monitoring capabilities into their
developments.

Features:

• Biometric Pulse Rate or Heart Rate detecting sensor


• Plug and Play type sensor
• Operating Voltage: +5V or +3.3V
• Current Consumption: 4mA
• Inbuilt Amplification and Noise cancellation circuit.
• Diameter: 0.625”
• Thickness: 0.125” Thick

43
4.5.3 BREADBOARDS

A breadboard is an indispensable tool in electronics prototyping, providing a versatile platform


for constructing and testing circuit designs without the need for soldering. Its rectangular
plastic structure features numerous tiny holes arranged in a grid pattern, allowing electronic
components to be easily inserted and interconnected to form circuits. Originally, the term
"breadboard" referred to polished wood boards used for slicing bread. However, in the 1970s,
solderless breadboards, also known as plug boards or terminal array boards, emerged as
convenient alternatives for circuit prototyping.

Underneath the surface of a breadboard are metal strips that connect the holes on the top layer.
These strips are organized in a specific layout: the top and bottom rows of holes are
horizontally connected and split in the middle, while the remaining holes are vertically
connected. This arrangement facilitates the creation of both simple and complex circuits by
providing multiple connection points.

Through-hole electronic components, characterized by their long metal leads, are commonly
used with breadboards. These components can be inserted into the holes on the breadboard and
easily interconnected to create circuit connections. The absence of soldering allows for rapid
experimentation and modification of circuit designs, making breadboards ideal for prototyping
and educational purposes.

In a breadboard, holes that are electrically connected are considered part of the same node
within a circuit. A node represents a point where two or more components are linked by a
short circuit, enabling the flow of current without resistance. Conversely, holes that are not
electrically connected form an open circuit, through which no current can pass. Therefore,
there is no restriction to the potential voltage difference across an open circuit, while
electrically connected points allow current flow without impedance.

The design of a breadboard allows for easy debugging and troubleshooting of circuits.
Components can be quickly rearranged or replaced to test different configurations or diagnose

44
issues. Additionally, the grid layout of the breadboard provides a visual reference for
organizing and structuring circuit connections, helping users understand the circuit topology
and improve their electronics skills.

Overall, breadboards play a crucial role in electronics prototyping by providing a flexible and
accessible platform for experimenting with circuit designs. Whether used by hobbyists,
students, or professionals, breadboards offer a practical and user-friendly way to bring
electronic projects to life without the need for specialized equipment or advanced soldering
skills.

Fig 4.5.4:Breadboard

4.5.4 Esp8266

The ESP8266 module stands out as a cost-effective and user-friendly solution for adding
internet connectivity to various projects. Its versatility is remarkable, capable of functioning
both as an access point, creating a Wi-Fi hotspot, and as a station, connecting to existing Wi-Fi
networks. This dual functionality enables seamless data retrieval and uploading to the internet,
simplifying the implementation of Internet of Things (IoT) applications. Additionally, the
module can access data from online sources using APIs, expanding the range of information
accessible to projects and enhancing their intelligence.

One of the module's notable advantages is its compatibility with the Arduino IDE, a popular
development platform known for its ease of use. This compatibility streamlines the

45
programming process, making it accessible to a wide range of users, from beginners to
experienced developers. Despite its compact size, the ESP8266 boasts impressive processing
power and onboard storage, allowing for seamless integration with sensors and other
application-specific devices via its GPIOs. This integration minimizes development efforts and
runtime overhead.

Furthermore, the ESP8266's onboard features contribute to its efficiency and performance. Its
self-calibrated RF capabilities ensure reliable operation across various environmental
conditions, eliminating the need for external RF components. The module supports APSD for
Voice over IP (VoIP) applications and interfaces with Bluetooth coexistence, further
expanding its functionality. Its design emphasizes minimal external circuitry, optimizing PCB
layout and reducing space requirements, ideal for compact projects where space is limited.

In summary, the ESP8266 module offers a compelling combination of affordability,


versatility, and ease of use, making it an attractive choice for a wide range of IoT and
connectivity projects. Its integration-friendly design, compatibility with Arduino IDE, and
onboard features position it as a valuable asset for developers seeking efficient and cost-
effective solutions for internet-enabled applications.

Fig 4.5.5: ESP8266

46
47

The ESP8266 module operates strictly at 3.3V, and exceeding 3.7V can irreparably damage
the module. Therefore, it's crucial to exercise caution when designing circuits that involve
this module. Here's a breakdown of its pin functions:
Ground (GND): This pin connects to the ground of the circuit, providing the reference
voltage.
Tx/GPIO-1: Used for transmitting data, this pin is typically connected to the Rx pin of a
programmer or microcontroller for uploading programs.
GPIO-2: A general-purpose input/output pin, providing flexibility for various functions in
the circuit.
CH_EN (Chip Enable): This pin is activated to enable the operation of the chip, typically
held at a high voltage.
Flash/GPIO-0: Another general-purpose input/output pin, often utilized for specific tasks
in the circuit.
Reset: When triggered, this pin resets the module, restoring it to its default state.
RX/GPIO-3: Receives data, typically connected to the Tx pin of a programmer or
microcontroller.
Vcc: This pin is connected to the power supply and must be supplied with precisely 3.3V
to ensure proper functioning of the module.

4.5.5 PULSE RATE DISPLAY ON LCD SCREEN


Configure the hardware setup by connecting the pulse sensor and an LCD display with I2C
communication capability to the Arduino Uno. Utilize the analog input pins of the Arduino
to read the analog signal produced by the pulse sensor, which reflects changes in blood
volume corresponding to the heartbeat waveform.
Next, process the analog signal obtained from the pulse sensor to determine the heart rate.
This involves filtering out noise, identifying peaks or troughs in the signal that represent
individual heartbeats, and calculating the time intervals between successive peaks to derive
the heart rate value.
Once the heart rate is calculated, utilize the appropriate functions or commands from the
LCD library to display the heart rate value on the LCD screen. Ensure that the LCD display
is updated in real-time to provide continuous monitoring of the heart rate. This entails
periodically reading the pulse sensor data, recalculating the heart rate, and updating the
display with the latest heart rate value. This real-time monitoring functionality enables
users to track their heart rate fluctuations instantaneously for better health management.

Fig 4.5 LCD Screen

4.5.6 JUMP WIRES

Jumper wires, also known as jump wires, serve as essential components in solderless
breadboarding, facilitating the connection of electronic components and creating
electrical circuits. They are available in ready-to-use sets or can be manually
manufactured, although the latter method may be laborious for larger circuits.
Ready-made jump wires vary in quality and may feature tiny plugs attached to the
wire ends for convenience.

The ideal material for jump wires, whether pre-made or homemade, is 22 AWG
(0.33 mm2) solid copper wire with tin plating. This ensures conductivity and
durability, assuming no plugs are attached to the wire ends. The wire ends should be
stripped to a length of 3⁄16 to 5⁄16 inches (4.8 to 7.9 mm). Stripping wires too short

48
may result in poor contact with the board's spring clips, while longer stripped wires
increase the risk of short circuits. Needle-nose pliers and tweezers are valuable tools
for inserting or removing wires, especially on crowded breadboards.

To maintain organization and clarity in circuit design, differently colored wires are
often used, with adherence to color-coding discipline. While the number of available
colors may be limited, it helps distinguish between various signal types or paths
within the circuit.

Jumper wires are typically available in three versions: male-to-male, male-to-female,


and female-to-female. Each version differs in the endpoint of the wire. Male ends
feature a pin protruding, allowing them to plug into connectors, while female ends
lack protrusions and are designed for receiving plugs. Male-to-male jumper wires are
the most common and frequently used type, particularly for connecting two ports on
a breadboard.

When creating connections on a breadboard, selecting the appropriate jumper wire is


crucial for establishing a reliable electrical connection. Whether connecting
components within a circuit or interfacing with external devices, jumper wires play a
pivotal role in prototyping and testing electronic systems. Their versatility and ease
of use make them indispensable tools for electronics enthusiasts, hobbyists, and
professionals alike.

Fig 4.5.7: Jump wires

49
4.6 HARDWARE SETUP

Setting up the hardware involves connecting both the pulse sensor module and the LCD
display to the Arduino Uno. Here's a simplified step-by-step guide:

Pulse Sensor Module Connection:

Attach the VCC pin of the pulse sensor module to the 5V pin on the Arduino Uno.

Connect the GND pin of the pulse sensor module to the GND pin on the Arduino Uno.

Establish a connection between the OUT pin of the pulse sensor module and any digital pin
on the Arduino Uno.

LCD Display Connection:

Connect the SDA pin of the LCD display to the A4 pin on the Arduino Uno.

Attach the SCL pin of the LCD display to the A5 pin on the Arduino Uno.

Connect the VCC pin of the LCD display to the 5V pin on the Arduino Uno.

Establish a connection between the GND pin of the LCD display and the GND pin on the
Arduino Uno.

Power and Programming:

Utilize a USB cable to connect the Arduino Uno to your computer. This connection serves
the dual purpose of providing power to the Arduino Uno and facilitating programming
tasks.

By following these straightforward steps, you can effectively set up the hardware
components for your project. This configuration enables the Arduino Uno to interact with
both the pulse sensor module and the LCD display, allowing for heart rate monitoring and
display functionality.

50
4.7 SOFTWARE DESCRIPTION

Securely transmitting sensor data to the cloud is crucial in today's interconnected world.
With sensors embedded in various devices, from our homes to our cars, data collection is
pervasive. Arduino IDE facilitates this process by allowing data to be sent to the cloud via
sensors and devices. By default, the data is stored privately, but sharing via public channels
is also an option.

Once the data is in the cloud, it becomes accessible for analysis and visualization. Online
analytical tools enable users to explore the data, identify correlations, trends, and patterns,
and even generate new insights. Visual representations such as gauges, charts, and graphs
provide intuitive ways to interpret the data.

The convenience of cloud storage extends to collaborative efforts and communication with
other devices, web services, and social media platforms. Whether analyzing trends, plotting
diagrams, or assessing ideas, having access to cloud-stored data streamlines the process
and enhances decision-making capabilities.

4.8 CONSTRAINTS

Technical constraints - Creating such a system requires a multidisciplinary approach


involving hardware and software engineering, data analysis, and medical expertise.
Technical limitations may arise due to the availability of suitable sensors, communication
protocols, and decision-making algorithms.

Data privacy and security - Given the sensitive nature of medical data collected by the
system, stringent measures must be implemented to safeguard against unauthorized access
or data breaches. Robust data privacy and security protocols are essential to maintain the
confidentiality, integrity, and availability of the data.

User acceptance - The system's success hinges on its acceptance by both patients and
medical professionals. A user-friendly design and intuitive interface are paramount to
ensure ease of use and minimize any additional burden on users.

51
Reliability and accuracy - The system must deliver reliable and accurate results in
detecting heart attacks and monitoring heart rate. Any inaccuracies or false alarms could
lead to unnecessary interventions or delayed treatments, posing significant risks to
patients' health.

Regulatory compliance - Compliance with regulatory standards such as HIPAA is


imperative to ensure legal and ethical adherence to data collection, storage, and
transmission practices. Non-compliance may result in severe penalties and reputational
damage.

Cost - Developing an IoT- Developing an IoT-based heart attack detection and heart rate
monitoring system entails significant costs, including hardware and software development,
data storage, and ongoing maintenance expenses. Cost-effectiveness must be carefully
assessed to ensure the system delivers value for money.

4.9 TRADE-OFF

Cost Considerations:

Developing and implementing an IoT-based heart attack detection and heart rate
monitoring system entails significant costs. This includes expenses associated with
acquiring high-quality sensors and deploying sophisticated data analysis algorithms.

Privacy Concerns:

The collection and transmission of personal health data via the internet raise privacy
concerns. To mitigate risks, robust security measures must be implemented to encrypt and
protect data during transmission and storage.

Accuracy and Reliability:

Ensuring the accuracy of the system is paramount to avoid incorrect diagnoses and
treatments, which could pose risks to patients' well-being. Regular calibration and rigorous
testing protocols are essential to maintain system accuracy.

52
Battery Life Management:

IoT devices rely on continuous power supply, making battery life a crucial consideration.
Longer battery life increases device cost but reduces the need for frequent recharging.
Conversely, shorter battery life may necessitate more frequent charging intervals.

User-Friendly Design:

The system's usability is vital, particularly for users with limited technical proficiency, such
as elderly individuals. Simplified setup processes and intuitive interfaces enhance user
experience and accessibility, promoting widespread adoption.

In summary, while an IoT-based heart attack detection and heart rate monitoring system
offers numerous benefits, careful attention to these tradeoffs is essential to ensure
effectiveness, safety, and user accessibility.

4.10 DEVELOPMENT

Enhance the Heart Rate Monitoring System:

Data Logging: Implement a feature for logging heart rate data over time, allowing users to
track their heart rate trends and patterns.

Threshold Alarms: Integrate threshold alarms to alert users when their heart rate exceeds
or falls below predefined levels, enhancing safety and awareness.

Visualization of Heart Rate Trends: Develop graphical representations of heart rate


trends on the LCD display, enabling users to visualize their heart rate data more intuitively.

Customizable User Interface: Customize the LCD display interface to include additional
information such as date, time, or user settings, providing a more personalized user
experience.

Sensor and Display Module Exploration: Experiment with different sensors and display
modules to expand the system's functionality. For example, explore the use of OLED
displays or touch screens for improved interaction and visibility.

By incorporating these additional features and exploring different hardware options, the
heart rate monitoring system can evolve into a more comprehensive and versatile tool for
monitoring heart health in real-time.
53
4.11 SYSTEM CIRCUIT ARCHITECTURE

The proposed system harnesses the power of Internet of Things (IoT) technology to detect
potential heart attacks by monitoring heart rate in real-time. Utilizing a pulse sensor,
Arduino board, and Wi-Fi module, the system offers a comprehensive solution for
continuous heart rate monitoring. Upon system initialization, the pulse sensor initiates the
process of capturing heart rate readings, which are then promptly displayed on an LCD
screen for easy visualization.

Crucially, the integration of the Wi-Fi module enables seamless transmission of heart rate
data over the internet, facilitating remote monitoring and analysis. The system incorporates
a user-defined set point, allowing individuals to establish personalized thresholds for
normal heart rate levels. By comparing real-time heart rate data against these
predetermined limits, the system can promptly identify deviations from the expected range.

Once the monitoring parameters are configured, the system diligently tracks the patient's
heart rate, continuously evaluating it for any abnormal fluctuations. In the event that the
heart rate surpasses or falls below the predefined threshold, the system triggers an alert
mechanism, promptly notifying caregivers or medical professionals. This proactive
approach ensures timely intervention and potentially life-saving assistance in critical
situations.

As part of the project's comprehensive approach, an Android application is being developed


to complement the hardware setup. The application will serve as a dedicated platform for
monitoring the heart rate of individual patients with precision and accuracy. Leveraging the
capabilities of the mobile platform, the application will provide real-time updates on heart
rate status and deliver emergency alerts in the event of potential heart attack indicators.

Overall, the proposed system represents a significant advancement in remote heart rate
monitoring, offering enhanced capabilities for early detection and intervention. By
seamlessly integrating IoT technology with reliable sensor data and mobile applications,
the system empowers individuals and healthcare professionals alike to proactively manage
heart health and respond swiftly to potential emergencies.
54
Fig 4.7 System Architecture

55
CHAPTER-5

IMPLEMENTATION AND TESTING

5.1 SOFTWARE TESTING

Software Testing is a process of executing the application with intent to find any
software bugs. It is used to check whether the application met its expectations and all
the functionalities of the application is working. The final goal of testing is to check
whether the application is behaving in the way it is supposed to under specified
conditions. All aspects of the code are examined to check the quality of application.
The primary purpose of testing is to detect software failures so that defects may be
uncovered and corrected. The test cases are designed in such way that scope of
finding the bugs is maximum.

Implementing heart attack detection using heart rate monitoring with Arduino
involves a systematic approach to ensure the accuracy and reliability of the system.
The first step is the hardware setup, where the pulse sensor module is connected to
the Arduino board, establishing the necessary power, ground, and signal
connections. Once the hardware is configured, the focus shifts to programming the
Arduino. In this phase, the Arduino code is written to read the analog signal from the
pulse sensor and process it to calculate the heart rate. Advanced algorithms may be
implemented to detect abnormal heart rate patterns indicative of a potential heart
attack.

After programming the Arduino, the next crucial step is defining threshold values for
normal and abnormal heart rates. These thresholds serve as reference points to
trigger alerts when the heart rate crosses predefined limits. A robust alert mechanism
is then implemented to notify the user or medical personnel when an abnormal heart
rate pattern is detected. This mechanism may include visual indicators such as LEDs
or LCD displays, as well as auditory alerts such as buzzers.

Testing the system is a critical phase to ensure its accuracy and reliability in
detecting abnormal heart rate patterns. Various testing scenarios are conducted using

56
simulated data or real-world scenarios to validate the effectiveness of the heart attack
detection algorithm. During testing, the system's response to different heart rate
patterns and scenarios is thoroughly evaluated to identify any potential issues or
areas for improvement.

Integration with other components, such as Wi-Fi or GSM modules, enables remote
monitoring and alerting capabilities. This integration expands the system's
functionality and allows for real-time monitoring of heart rate data from remote
locations. Once testing is successful, the system can be deployed in real-world
settings, such as homes, hospitals, or clinics. Proper training and instructions are
provided to users on how to interpret and respond to alerts generated by the system.

Continuous monitoring and maintenance are essential to ensure the optimal


functioning of the heart attack detection system. Regular performance monitoring
helps identify any issues or anomalies that may arise over time. Software updates
and maintenance activities are conducted as needed to address any identified issues
or implement improvements to the system. By following this systematic approach to
implementation and testing, a heart attack detection system using heart rate
monitoring with Arduino can be effectively developed and deployed with confidence
in its accuracy and reliability.

5.2 TESTING LEVELS

There are various testing levels based on the specificity of test.

• Unit testing: Unit testing refers to tests conducted on a section of code in


order to verify the functionality of that piece of code. This is done at the
function level.

• Integration Testing: Integration testing is any type of software testing that


seeks to verify the interfaces between components against a software design.
Its primary purpose is to expose the defects associated with the interfacing of
modules.

• System Testing: System testing tests a completely integrated system to verify

57
that the system meets its requirements.

• Acceptance testing: Acceptance testing tests the readiness of application,


satisfying all requirements.

Performance testing: Performance testing is the process of determining the speed or


effectiveness of a computer, network, software program or device such as response time
or millions of instructions per second etc.

5.3 SYSTEM TEST

A test case is a set of test data, preconditions, expected results and post conditions,
developed for a test scenario to verify compliance against a specific requirement. I have
designed and executed a few test cases to check if the project meets the functional
requirements.

We have tested the working of our model in two ways:(1)Reversing the actual conditions,
i.e., our model will turn on the alarm and send the notification in normal conditions
because we cannot simulate the actual conditions for such a long time period so we tested it
in this way. Figures 6(a) and 6(b) show the validation graphically

As you can see, our BPM is 50 and it is the same for 1 min, i.e., in normal condition.

So, the alarm was turned on and notifications were sent; the visualization was also made
simultaneously as shown in Figures 7(a) and 7(b).(2)To test whether the conditions in our
code work properly if BPM fluctuates between critical and normal conditions. So, to test
this we removed the sensor from hand and try reading random values As you can see in the
graphs the BPM first falls, then increase, and then fall again this does not make our model
turn on the alarm and send a notification because when it enters the critical condition it
checks it for a particular time period and if it continues to remain same then it turns on the
alarm. But, in this case, BPM was not the same it was changing every min. This does not
make it turn the alarm on. Figure 8 represents this testing step.

58
CHAPTER 6

RESULTS AND DISCUSSION

6.1 SIMULATION

For simulation purposes, we have employed the Arduino Software (IDE), which serves as a
comprehensive platform for developing and testing Arduino programs. Within the Arduino
IDE, users have access to a text editor tailored for writing code, a message area for viewing
feedback and notifications, and a set of tools encompassing common functions essential for
programming tasks. The software seamlessly connects with Arduino and genuine hardware,
facilitating the uploading of programs and communication with connected devices.

The coding aspect of the project is conducted entirely within the Arduino IDE. Users write
and refine their program code within the IDE's text editor, utilizing its features for syntax
highlighting, auto-completion, and error detection. Once the code is developed, it is
uploaded to the Arduino board via the IDE's interface. During the upload process, the IDE
communicates with the connected hardware, transferring the program instructions and
configuration settings.

Following the upload, the program is executed on the Arduino board, and the results are
observed in real-time. The Arduino IDE provides immediate feedback on the execution
status, indicating whether the program was uploaded successfully and if any errors were
encountered during runtime. Through this iterative process of coding, uploading, and
testing, developers can refine their programs until they achieve the desired functionality.

Ultimately, the Arduino IDE serves as a vital tool for the development and validation of
Arduino-based projects. Its intuitive interface, coupled with robust features for code
development and hardware interaction, streamlines the process of prototyping and testing
Arduino applications, ensuring efficient and reliable results.

59
Fig 6.1 program output

60
6.2 SIMULATION OF PROPOSED SYSTEM AND EXPLANATION

Fig 6.2 simulation of proposed system

61
Fig 6.3 simulation for Heart Attack Detection

When analyzing heart rate data, different ranges signify distinct physiological conditions.
A low pulse rate, denoted by a BPM (beats per minute) falling between 40 and 60,
suggests potential medical concerns requiring professional intervention.
Conversely, a BPM ranging from 60 to 100 falls within the normal pulse rate range,
indicating a healthy physiological state devoid of complications.
However, a high pulse rate, spanning from 100 to 150 BPM, signals an elevated heart rate,
potentially indicative of underlying cardiovascular issues. These categorizations assist in
identifying and addressing various health conditions based on observed heart rate patterns.

62
6.3 HARDWARE AND RESULTS

Fig 6.4 Hardware of Proposed System

The heart rate monitoring system employs a GSR sensor interfaced with a NodeMCU
microcontroller, enabling real-time heartbeat detection transmitted over the internet via a
WiFi module. Users can customize threshold settings to monitor heart rate variations.
When the heart rate surpasses the predefined thresholds, alerts are triggered, indicating
potential health risks such as high or low heart rates and the likelihood of a heart attack.
The system autonomously notifies relevant parties, including medical professionals and
family members, via IoT communication protocols in the event of sudden changes in heart
rate or other bodily functions. Furthermore, to ensure data accessibility and continuity of
care, patient details are securely stored in the cloud for future reference and analysis.
This setup offers a comprehensive solution for continuous heart rate monitoring, leveraging
IoT technology to provide timely alerts and interventions. By integrating sensor data with
cloud-based storage and communication capabilities, the system enhances the monitoring
and management of cardiovascular health. Users benefit from personalized threshold

63
settings and real-time alerts, empowering them to take proactive measures to mitigate
health risks. Medical professionals can remotely monitor patients' heart health status and
intervene promptly in case of emergencies. Additionally, the system's ability to store
patient data in the cloud facilitates longitudinal tracking of health metrics and enables
retrospective analysis for research and clinical purposes. Overall, the heart rate monitoring
system represents a significant advancement in remote patient monitoring, offering
convenience, reliability, and enhanced healthcare outcomes.

Fig 6.5 Result of Proposed System

Fig 6.6 Result of Heart Attack Detection

64
Whenever the heart beat goes above 60-100 ,it detects heart attack and it gives alert to the
doctor and the respective relatives about the patient status.

6.4 To showcase a heart alert message on an LCD screen, it's imperative to first detect
irregular heart rate patterns or any signs hinting at potential cardiac concerns. This process
involves continuous monitoring of the heart rate through a pulse sensor linked to an
Arduino board. Defining thresholds or parameters for what qualifies as an abnormal heart
rate is crucial; these thresholds can be based on medical standards or personalized health
profiles. For instance, heart rates exceeding predefined limits, either too high (tachycardia)
or too low (bradycardia), might be flagged as abnormal.

Real-time analysis of heart rate data is then conducted using algorithms designed to
identify irregular patterns indicative of abnormal heart rate variations, arrhythmias, or other
cardiovascular issues. These algorithms are instrumental in detecting subtle deviations
from the norm, allowing for early intervention when necessary.

Upon detecting an abnormal heart rate pattern, the system triggers the display of a heart
alert message on the LCD screen. This alert serves as a visual prompt for the user,
signaling the need for attention or medical intervention. The message displayed on the
LCD screen can convey critical information regarding the detected anomaly, enabling
prompt action to address potential health risks. Through this process, the heart alert
message system facilitates proactive monitoring of cardiac health, providing users with
valuable insights and promoting early detection of cardiac abnormalities.

65
Displaying the Alert Message:

Fig 6.7 Herat Rate Dispaly

Utilize the LCD library's built-in functions or commands to effectively showcase the alert
message on the LCD screen. Craft the alert message to be conspicuous, employing large
fonts, contrasting colors, or flashing text to instantly capture the user's attention.

Incorporate additional details or directives within the alert message, such as advising
immediate medical attention. The system is programmed with predefined thresholds for
heart rate limits. As the system commences heart rate monitoring, it continuously evaluates
the human heart rate against these set limits. Should the heart rate surpass the upper
threshold, indicating heightened activity, an alert is promptly dispatched. Conversely, alerts
are also triggered for abnormally low heart rates.

By integrating these features, the system ensures that users are promptly informed of any
deviations from the established heart rate norms, facilitating timely interventions and
promoting proactive management of cardiac health.

66
CHAPTER 7

CONCLUSION AND FUTURE ENHANCEMENT

7.1 SUMMARY

The project endeavors to create a cutting-edge IoT system tailored for heart rate
monitoring and early detection of heart attacks. Central to this system is a wearable device
outfitted with advanced sensors capable of continuously monitoring the user's heart rate.
Accompanying this wearable is a mobile application designed to relay real-time heart rate
data and issue alerts promptly should any irregularities be detected.

Functionally, the wearable device will diligently gather heart rate data, which will then be
transmitted to the mobile app through either Bluetooth or Wi-Fi connectivity. Leveraging
sophisticated machine learning algorithms, the app will meticulously analyze this data,
swiftly identifying any deviations from normal heart rate patterns. In the event of a
potential heart attack, both the user and designated emergency contacts will be promptly
alerted, ensuring timely intervention.

Moreover, the system boasts a feature-rich capability to archive and catalog the user's heart
rate data over extended periods. This comprehensive data repository empowers both users
and healthcare professionals to track longitudinal trends and discern any emerging patterns
or anomalies in heart rate dynamics.

Crucially, the overarching goal of this project is to democratize access to effective heart
rate monitoring and heart attack detection solutions. By prioritizing affordability and
accessibility, particularly for individuals deemed at heightened risk of heart disease, the
project aims to foster proactive management of cardiac health and enhance overall well-
being.

67
In summary, this IoT-based system represents a pioneering endeavor at the intersection of
technology and healthcare, poised to revolutionize how heart rate monitoring and heart
attack detection are approached. Through seamless integration of wearable technology,
mobile applications, and advanced data analytics, the project endeavors to empower
individuals with the tools and insights needed to safeguard their cardiac health effectively.

7.2 CONCLUSION

In conclusion, our study delved into the development of a robust system for heart attack
detection through continuous heart rate monitoring. Leveraging the integration of a
microcontroller and a heartbeat sensor interface, our system adeptly senses and transmits
heart rate data over the internet via a Wi-Fi module. This functionality is augmented by the
system's capability to set customized heartbeat restrictions, enabling individuals to monitor
their heart rate proactively.

Upon setting these restrictions, users are empowered to track their heart rate fluctuations,
receiving timely alerts should their heart rate surpass predefined thresholds. These alerts
serve as crucial warnings, signaling the potential onset of a heart attack. Moreover, our
system extends its vigilance beyond mere heart rate monitoring, promptly notifying
healthcare providers and designated relatives in the event of any sudden deviations in heart
rate or bodily functions.

Furthermore, the system's integration with cloud storage facilitates the secure retention of
patient information, ensuring accessibility for future reference or analysis. By harnessing
the power of IoT technology, our system not only provides real-time insights into cardiac
health but also fosters proactive measures for heart attack prevention.

In essence, our investigation culminates in the realization of a comprehensive solution for


heart attack detection, underscoring the pivotal role of continuous heart rate monitoring in
safeguarding cardiovascular health. Through seamless integration of hardware, software,
and IoT capabilities, our system stands poised to revolutionize cardiac healthcare, offering
individuals a proactive means of mitigating the risks associated with heart attacks.

68
7.3 FUTURE EXTENSION

Enhanced Decision-Making Algorithms: Elevate the sophistication of our algorithms to


enhance heart attack detection accuracy and speed. By incorporating advanced machine
learning techniques and leveraging expansive datasets, we can achieve superior precision in
identifying critical cardiac events.

Wearable Technology: Pioneering the development of wearable devices capable of


continuous monitoring of vital parameters, including heart rate. These wearables
seamlessly integrate with our IoT-based heart attack detection system, enabling real-time
monitoring and prompt alerts to users.

Predictive Analytics: Harness the potential of predictive analytics models to identify


individuals predisposed to heart attacks based on multifaceted factors like medical history
and lifestyle choices. This empowers us to offer tailored preventive strategies and
interventions for high-risk individuals.

Integration with Electronic Health Records (EHRs): Forge a seamless integration


between our IoT-based heart attack detection system and Electronic Health Records
(EHRs). This synergy furnishes healthcare professionals with a holistic perspective of a
patient's health profile, fostering early detection and timely interventions.

Telemedicine: Spearhead the development of telemedicine capabilities, allowing


healthcare providers to remotely monitor patients utilizing our IoT-based heart attack
detection system. This innovative approach enhances healthcare accessibility, minimizing
the necessity for in-person consultations.

Integration with Other Medical Devices: Foster interoperability by integrating our IoT-
based heart attack detection system with diverse medical devices such as blood pressure
monitors and glucose monitors. This holistic approach enables comprehensive health
monitoring and facilitates proactive interventions for optimal patient care.

69
EFERENCES

[1] A. M. Gillinov et al., ‘‘Variable accuracy of commercially available


wearable heart rate monitors,’’ J. Amer. College Cardiol.,vol. 69, no. 11, p.
336, Nov. 2017.
[2] A. N. Koshy et al., ‘‘Smart watches for heart rate assessment in atrial
arrhythmias,’’ Int. J. Cardiol., vol. 266, pp. 124–127, Sep. 2018.
[3] Aboobacker sidheeque1, Arith Kumar2, Balamurugan .R3,Deepak K .C
4, K. Sathish, “Heartbeat Sensing and Heart Attack Detection using Internet
of Things: IoT “, International Journal of Engineering
Science and Computing, April 2017.
[4] Aboobacker, Arith , Balamurugan, Deepak, Sathish “Heartbeat Sensing
and Heart Attack Detection using internet of Things: IoT” International
Journal of Engineering Science and Computing April 2017.
[5] Ajitha, U., et al. "IOT Based Heart Attack Detection and Alert System."
International Journal of Engineering and Management Research (IJEMR)
7.2 (2017): 285-288.
[6] B. Sun and Z. Zhang, “Photoplethysmography-based heart rate
Monitoring using asymmetric least squares spectrum subtraction and
Bayesian decision theory,” IEEE Sens. J., vol. 15, no. 12, pp. 7161–7168
Dec. 2015.
[7] Bandana Mallick , Ajit Kumar Patro, “ Heart Rate Monitoring System
Using
44
Finger Tip Through Arduino And Processing Software” International Journal
of Science, Engineering and Technology Research (IJSETR),
Volume 5, Issue1, January 2016.

70
[8] C.W. Sung, J.S. Shieh, W.T. Chang, Y.W. Lee, J.H. Lyu, H.N. Ong W.T.
Chen,C.H. Huang, W.J. Chen, and F.S. Jaw, “Machine learning analysis of
heart rate variability for the detection of seizures in comatose cardiac arrest
survivors,” IEEE Access, vol. 8, pp. 160515-160525 2020.
[9] E. S. Izmailova, J. A. Wagner, and E. D. Perakslis, ‘‘Wearable device in
clinical trials: Hype and hypothesis,’’ Clin. Pharmacol. Therapeutics, vol.
104, no. 1, .pp. 42–52, Jul. 2018.
[10] F. M. Yassin, N. A. Sani, and S. N. Chin, “Analysis of heart rate and
body temperature from the wireless monitoring system using arduino,”J.
Phys.:
Conf. Ser., 2019.
[11] J. B. Bathilde, Y. L. Then, R. Chameera, F. S. Tay and D. N. A.
Zaidel,“Continuous heart rate monitoring system as an IoT edge device,”
IEEE Sensors Applicat. Symp. (SAS), Seoul, March 2018, pp. 1 – 6.
[12] J. Pavei, R.G. Heinzen, B. Novakova, R. Walz, A.J Serra, M. Reuber, A.
Ponnusamy, and J.L.B Marques, “Early seizure detection based on cardiac
autonomic regulation dynamics,” Front. Physiol., vol. 8, pp. 1-12, 2017. [13]
M. Mashhadi et al., “Heart rate tracking using wrist-type
photoplethysmographic (PPG) signals during physical exercise with
accelerometry,” IEEE Signal Process. Lett., vol. 23, no. 2, pp.
227–231,Feb. 2016.
[14] Mallick, Bandana, and Ajit Kumar Patro. "Heart rate monitoring system
using finger tip through arduino and processing software." International
Journal of Science, Engineering and Technology Research 5.1 (2016)
45
[15] N. S. Ali, Z. A. A. Alyasseri, and A. H. A. Mohson, “Real-time heart
pulse monitoring technique using wireless sensor network and mobile

71
application,” Int. Journal of Electrical and Computer Engineering, vol. 8, no.
6, pp. 5118- 5126,2018.
[16] P. Bansal, M.Malik and R. Kundu, “Smart heart rate monitoring
system”, in
2018 IEEMA Eng. Infinite Conf. (eTechNxT), New Delhi, Mar. 2018,
[17] P. H. Charlton, T. Bonnici, L. Tarassenko, D. A. Clifton, R. Beale, and
P. J. Watkinson, “An assessment of algorithms to estimate respirator rate
from the electrocardiogram and photoplethysmogram,” Physiological
measurement, vol. 37, no. 4, p. 610, 2016.
[18] P. K. D. Pramanik, A. Nayyar, and G. Pareek, “WBAN: Driving
healthcare
Beyond Telemedicine to Remote Health Monitoring:Architecture and
Protocols,” In: Hemanth D. Jude, Valentina Emilia Balas. Eds:
Telemedicine Technologies, Academic Press, 2019, pp.89-1.
[19] R. Lazazzera, Y. Belhaj, and G. Carrault, “A new wearable device for
blood pressure estimation using photoplethysmogram,” Sensors, vol. 19, no.
11, p. 2557, 2019.
[20] R.Vinodhini and R. Puniarasi, “Heart rate monitoring system using
pulse sensor with data stored on server,” IJEAT, vol. 8, no. 6, pp. 2374-2377,
2019.
[21] S. Gillinov et al., ‘‘Variable accuracy of wearable heart rate monitors
during aerobic exercise,’’ Med. Sci. Sports Exerc., vol. 49, no. 8pp. 1697–
1703, Aug.
2017.
[22] Ufoaroh S.U , Oranugo C.O, Uchechukwu M.E ,“Heartbeat Monitoring
And Alert System Using GSM Technology” International Journal of
Engineering Research and General Science Volume3, Issue 4, July-
August, 2015.
72
[23] Yadav, Yashasavi, and Manasa Gowda. "Heart Rate Monitoring and
Heart Attack Detection using Wearable Device." International Journal for
technical research and Application (2016).
[24] Zhiyuan Lu, Xiang Chen, Zhongfei Dong, Zhangyan Zhao, and Xu
Zhang,

73
APPENDIX A

CODING

This section contains the main code which includes the Aurdino Uno code for
the model and displays the heart rate in the LCD module.

CODE:-

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3,

POSITIVE); int pulsePin = A0; int blinkPin

= 13;

// Volatile Variables, used in the interrupt service routine! volatile int BPM; //

int that holds raw Analog in 0. updated every 2mS volatile int Signal; // holds the

incoming raw data volatile int IBI = 600; // int that holds the time interval between

beats! Must be seeded! volatile boolean Pulse = false; // "True" when User's live

heartbeat is detected.

"False" when not a "live beat".

volatile boolean QS = false; // becomes true when Arduoino finds a beat.

static boolean serialVisual = true; // Set to 'false' by Default. Re-set to 'true' to see

Arduino Serial Monitor ASCII Visual Pulse

volatile int rate[10]; // array to hold last ten IBI values volatile unsigned

long sampleCounter = 0; // used to determine pulse timing volatile unsigned

long lastBeatTime = 0; // used to find IBI volatile int P = 512; //

74
used to find peak in pulse wave, seeded volatile int T = 512; // used to

find trough in pulse wave, seeded volatile int thresh = 525; // used to find

instant moment of heart beat, seeded volatile int amp = 100; // used to

hold amplitude of pulse waveform, seeded volatile boolean firstBeat = true; //

used to seed rate array so we startup wi

th reasonable BPM volatile boolean secondBeat = false; // used to seed rate array

so we startup with reasonable BPM

void setup()

Serial.begin(115200); // we agree to talk fast! interruptSetup(); // sets up to

read Pulse Sensor signal every 2mS

// IF YOU ARE POWERING The Pulse Sensor AT VOLTAGE

LESS THAN THE BOARD VOLTAGE,

// UN-COMMENT THE NEXT LINE AND APPLY THAT

VOLTAGE TO THE A-REF PIN

// analogReference(EXTERNAL); lcd.begin(16,2);

// Where the Magic Happens void loop()

se

75
ria

lO

ut

pu

t()

if (QS == true) // A

Heartbeat Was Found

// BPM and IBI have been Determined

// Quantified Self "QS" true when arduino finds a heartbeat

serialOutputWhenBeatHappens(); // A Beat Happened, Output that to serial.

QS = false; // reset the Quantified Self flag for next time

delay(20); //

take a break

void interruptSetup()

// Initializes Timer2 to throw an interrupt every 2mS.

76
TCCR2A = 0x02; // DISABLE PWM ON DIGITAL PINS 3 AND 11, AND GO INTO

CTC MODE

TCCR2B = 0x06; // DON'T FORCE COMPARE, 256 PRESCALER

OCR2A = 0X7C; // SET THE TOP OF THE COUNT TO 124 FOR

500Hz SAMPLE RATE TIMSK2 = 0x02; // ENABLE INTERRUPT

ON MATCH BETWEEN TIMER2 AND OCR2A sei(); //

MAKE SURE GLOBAL INTERRUPTS ARE ENABLED } void

serialOutput()

{ // Decide How To Output Serial.

if (serialVisual == true)

{ arduinoSerialMonitorVisual('-', Signal); // goes to function that makes

Serial

Monitor Visualizer

} else { sendDataToSerial('S', Signal); // goes to

sendDataToSerial function

} void

serialOutputWhenBe

atHappens()

{ if (serialVisual == true) // Code to Make the Serial Monitor

Visualizer Work

{ lcd.setCursor(0,0);

77
Serial.print(" Heart-Beat Found "); //ASCII Art Madness

Serial.print("BPM: ");

Serial.println(BPM);

lcd.print("Heart-Beat

Found ");

lcd.setCursor(1,1);

lcd.print("BPM: ");

lcd.setCursor(5,1);

lcd.print(BPM);

delay(300);

78
}

{ sendDataToSerial('B',BPM); // send heart rate with a 'B' prefix

sendDataToSerial('Q',IBI); // send time between beats with a 'Q' prefix

} void arduinoSerialMonitorVisual(char

symbol, int data )

{ const int sensorMin = 0; // sensor minimum, discovered through

experiment const int sensorMax = 1024; // sensor maximum, discovered

through experiment int sensorReading = data; // map the sensor range to a

range of 12 options:

int range = map(sensorReading, sensorMin, sensorMax, 0, 11);

// do something different depending on the

// range value:

void sendDataToSerial(char symbol, int data )

79
{

Serial.print(symbol);

Serial.println(data);

ISR(TIMER2_COMPA_vect) //triggered when Timer2 counts to 124

cli(); // disable interrupts while we do this

Signal = analogRead(pulsePin); // read the Pulse Sensor sampleCounter

+= 2; // keep track of the time in mS with this variable int N =

sampleCounter - lastBeatTime; // monitor the time since the last beat to avoid

noise

// find the peak and trough of the pulse wave if(Signal <

thresh && N > (IBI/5)*3) // avoid dichrotic noise by waiting 3/5 of last IBI

{ if (Signal < T) //

T is the trough

T = Signal; // keep track of lowest point in pulse wave

} if(Signal >

thresh && Signal > P)

80
{ // thresh condition helps avoid noise

P = Signal; // P is the peak

} // keep track of highest point in pulse wave

// NOW IT'S TIME TO LOOK FOR THE HEART BEAT

// signal surges up in value every time there is a

pulse if (N > 250)

{ // avoid high frequency noise

if ( (Signal > thresh) && (Pulse == false) && (N > (IBI/5)*3) )

Pulse = true; // set the Pulse flag when we think there is a

pulse digitalWrite(blinkPin,HIGH); // turn on pin 13 LED

IBI = sampleCounter - lastBeatTime; // measure time between beats in mS

lastBeatTime = sampleCounter; // keep track of time for next pulse

if(seco

ndBeat

{ // if this is the second beat, if secondBeat == TRUE

secondBeat = false; // clear secondBeat flag for(int i=0; i<=9; i++)

// seed the running total to get a realisitic BPM at startup

81
{

rate[i] = IBI;

} if(firstBeat) // if it's the first time we found a beat, if firstBeat ==

TRUE

{ firstBeat = false; // clear firstBeat flag

secondBeat = true; // set the second beat flag sei();

// enable interrupts again return; // IBI value is unreliable so

discard it

// keep a running total of the last 10 IBI values word runningTotal =

0; // clear the runningTotal variable

for(int i=0;

i<=8; i++)

{ // shift data in the rate array rate[i] = rate[i+1];

// and drop the oldest IBI value runningTotal += rate[i]; // add

up the 9 oldest IBI values }

rate[9] = IBI; // add the latest IBI to the rate array

runningTotal += rate[9]; // add the latest IBI to runningTotal

runningTotal /= 10; // average the last 10 IBI values BPM =

60000/runningTotal; // how many beats can fit into a minute? that's BPM!

QS = true; // set Quantified Self flag

// QS FLAG IS NOT CLEARED INSIDE THIS ISR

82
}

} if (Signal < thresh &&

Pulse == true)

{ // when the values are going down, the beat is over

digitalWrite(blinkPin,LOW); // turn off pin 13 LED

Pulse = false; // reset the Pulse flag so we can do it again amp = P -

T; // get amplitude of the pulse wave thresh = amp/2 + T;

// set thresh at 50% of the amplitude

P = thresh; // reset these for next time

T = thresh;

>

83
0

{ // if 2.5 seconds go by without a beat thresh =

512; // set thresh default

P = 512; // set P default T = 512;

// set T default lastBeatTime = sampleCounter; // bring the

lastBeatTime up to date firstBeat = true; // set these to

avoid noise secondBeat = false; // when we get the heartbeat

back } sei(); // enable interrupts when youre done!

}// end isr

84
APPENDIX B

SCREENSHOTS

Screenshot 1 The Output is displayed in the LCD.

85
Screenshot 2 The Heart rate is displayed in the Arduino Interface.

86
Screenshot 3 The Arduino is monitoring the heart beat with respective to
the Pulse Sensor.

87

You might also like