An IoT-Based Smart Framework for a Human Heartbeat Rate Monitoring and Control System

: This research paper presents the design and implementation of an internet of things-based (IoT) smart framework for human heartbeat rate monitoring and control system. A comprehensive study of various techniques and technologies that are used in controlling the heartbeat rate is explored. The proposed system was designed and implemented on a breadboard with the various system components that are assembled, connected and tasted. Experimental results obtained from the implemented prototype were found to be accurate, as the system was able to sense and read the heartbeat rate of its user and transmit the sensed data through the internet. The system components were soldered on a breadboard, and cased inside a plastic container with the heart pulse sensor stretched, so as to be clipped on the fingertip of the system’s user. Experimental results demonstrate that the resting heartbeat rate of children below the age of 17 is between 65 to 115 beats per minute (bpm) and the resting heartbeat rate of an adult between the ages of 17 to 60 is 60 to 100 bpm. In addition, the resting heartbeat rate of old people who are 60 years old and above, their heartbeat rate is between 65 to 120 bpm. These findings are in agreement with the state-of-the-art in the medical field. Furthermore, this research paper presents an approach that is flexible, reliable, and confidential for heartbeat rate monitoring and control system using sensor network and IoT technology which can be deployed to the medical field to assist the medical practitioners in doing their work easily.


Introduction
The IoT technology tremendously increases the data value, performance, efficiency, accuracy and the speed of the system operation, and the output results. The use of sensors has made data transmission, analytics and visualization efficient, as well as real-time processing. These functionalities significantly changed the way we communicate within and outside organizations and industries. In addition, they have changed the way a huge volume of data is stored and retrieved from the cloud and data centers [1].
Myocardial infarction or heart attack is a death of a section of a heart muscle. This death of the heart muscle will result in the interruption or stoppage of blood flow to the heart organ. The heart's main function is to pump blood into the circulatory system in human beings and animals; if one of its ventricles fails to work in either human or animal, the heart gets attacked, and in due course, leads to death if not resuscitated on time [2].
Nowadays, cardiac arrest is becoming a major concern within the entire population. However, with the advancement in technology that has given rise to smart wearable devices, along with the internet of things (IoT), helps to provide a solution to this global menace [3].
The advancement in the internet of things (IoT) technology coupled with the sensors, has brought about tremendous development in the health care system. Sensors and an integrated IoT health care system have provided the possibilities of monitoring and control of patient's data remotely [4]. For better patient monitoring, there is the need to have a medical specialist close to the patient for direct monitoring and control. However, having a specialist at all times to look after the patient for treatment, drug administration etc., is not possible due to their scarcity and very tight schedules. Therefore, remote patient monitoring and control is the best approach to take proper care of the patient. This approach will provide the physical parameters that are required by the medical specialist, and the data can be transmitted remotely through the internet [5]. Therefore, an approach for a dedicated monitoring and control of parameters for the heart activity is essential. An integrated system that combines electrocardiography, mobile devices and a wearable heart sensor is a new approach to monitor the heart activity [6].
Recently, public health has gained a tremendous attention due to the rapid increase in the human population and the high cost of medical expenses. It is a clear fact that an organized healthcare monitoring system can detect, monitor, and control abnormalities of health conditions in real-time, and provide a diagnosis based on the captured patient data. An essential method to diagnose heartrelated diseases is the use of ECG signal monitoring. This method has gained wider audiences. However, the ECG devices depend on a mobile application for data collection and visualization [7].
The internet of things (IoT) plays an essential part in our daily lives. It has provided the means whereby many devices and machines used today can be monitored and controlled remotely without human intervention. The important parameters that are measured in patients with a heart disease include: the heart rate; heart rate variability; and body temperature. These parameters need to be measured regularly to ensure safety of life and well-being [8].
A heart attack, most of the time, results in a sudden death before the patients get any attention from a medical expert. For instance, in the republic of China, they practice a traditional health care system. This means that the concerned patients make a call to the healthcare service centers themselves. In an event of a sudden heart attack, the unconscious patient may not be able to call the service, and hence the unwanted death situation will occur. With the help of the IoT technology, the problems of a heart attack can be overcome. The patients can switch the system from inactive (traditional) to a pervasive one, and trigger the health care services to be aware of his/her situation. Hence, this calls for a remote patient monitoring and control system [9].
Nowadays, we can observe a very long waiting period (queue) in our hospitals, and the patient monitoring is becoming a critical issue. These problems call for a patient health monitoring framework that can assist the medical practitioners and the patient to monitor important parameters such as the heartbeat rate, and reports vital signs to the medical experts for immediate action [10]. The use of the Ballistocardiographs (BCGs) method plays a vital role in measuring and recording of the mechanical and physiological activities of the human heart. This method also helps in monitoring the biological signals in infants [11]. The monitoring and control of physiological parameters can help in different fields of human endeavors to enhance performance. For instance, professional athletes need to be monitored for better training and high performance while in the field [12].
Every generation of human beings has their diverse health issues that affect the generation. However, in this 21st generation, cardiac arrest is one of those health problems that is terrorizing and causing early deaths of our youth. Myocardial infarction is a global problem that becomes a worldwide threat. Several efforts have been made to mitigate this global menace. Researchers and manufacturers have come up with ideas and tools to tackle the heart-related infections. Several devices have been manufactured to detect heart attack and to monitor heartbeats. However, these efforts made are not enough to solve the present heart-related challenges [13].
Despite several efforts made by researchers and the manufacturers, there are several health challenges associated with the current methods of detecting heart attack and monitoring of the heartbeats. Amongst the problems are: (1) insufficient manpower and technical expertise in handling the heart-related issues; (2) non-provision of sophisticated and state-of-the-art equipment to speed up detection and monitoring of heart-related problems; (3) the use of a manual check-up, procedure, to discover and monitor the heart attack and (4) the existing devices and tools are expensive to procure and difficult to use.
This research paper aimed to design and implement a user-friendly and smart framework for a human heartbeat rate monitoring and control system. This approach, employed the use of sensors and internet of things (IoT) technology to produce an integrated prototype to ease monitoring and control of heart-related problems.
The salient contributions of this research paper are as follows: 1. A working prototype to detect and monitor the human heartbeat rate in real-time. 2. The system displays the user's heartbeat rate on liquid crystal display (LCD) screen in real-time. 3. The system transmits the user's sensed data to the internet for analytics and visualization. 4. Medical practitioners can monitor and control the patient remotely at any location.

Related Work
An IoT-based remote patient monitoring and control system is a fantastic area of research that many researchers focus on and make contributions. However, there are quite a few numbers of works that have been presented by the respective authors. Majumder et al. [3], presented a multi-sensory system that employed the use of the internet of things (IoT), to collect the body area sensor (BAS) data, in order to provide the first initial information and early warning of the possibility of cardiac arrest. The main objective of the proposal is to design and develop a combined smart IoT system that will provide low power communication to collect heartbeat rates and body temperature using smartphones, without causing obstruction to the daily activities. The research work proposes the use of signal processing and machine learning techniques to analyze the sensor data to identify and possibly predict, with a high level of accuracy, the sudden cardiac arrest.
The work of Mohammed et al. [4], presented an IoT-based health monitoring system, employing the use of the MySignals development shield and a low power long range (LoRa) wireless technology. Several sensor components were used. These include the electrocardiogram (ECG) sensor; body temperature sensor; pulse rate and oxygen saturation sensors. These components are integrated and used with MySignals and LoRa technology. In order to evaluate the performance and effectiveness of their approach, the authors employed the use of physiological data and statistical analysis methods. The main goal is to allow the MySignals to obtain the physiological data and transmit the data to a personal computer using LoRa wireless connectivity. The authors claimed that the results showed that MySignals is fully integrated with the ECG, oxygen saturation, and heart pulse rate sensors. Furthermore, the anticipated sensor's data are captured and analyzed.
Reshma et al. [5], proposed a system that integrates an infrared-based heartbeat sensor and Arduino Uno microcontroller. The system possesses the capabilities to detect the body temperature and heart pulse respectively. The heartbeat sensor was used for detecting the heart pulse. The system allows its users to measure their mean blood vessel weight (MAP), and measure the body temperature to be displayed on the Android screen for viewing. Furthermore, the system can be used to measure important parameters such as heart rate and body temperature.
Brezulianu et al. [6], presented an experimental model to assess the mechanical activity of the heart, employing the use of inductive sensors that are worn in the clothes' fabrics. In the proposed system, a single sensor is placed in the clothes' frontside fabric and senses the cardiorespiratory activity. In addition, the sensor array is placed in the rear part of the body to sense other parameters. The important parameters that are sensed are the heart data rate and respiration. The authors mentioned that the presented results are considered as a preliminary investigation. Therefore, the main aim of their research work is to extract the value of the respiration and heart data rate parameters of the output signal that is generated by the inductance-to-number convertor using a precise algorithm. The proposed device is envisioned to be among the wear and forget equipment that are devoted to the continuous monitoring of crucial heart signs.
Zhe et al. [7], presented a modern method for ECG monitoring using IoT technology. The data obtained from the wearable monitoring devices are transmitted to the cloud via a WiFi wireless connectivity. The system can be deployed to any smart device with a capable web browser. This will allow the display of the ECG data in a simplified way without using a cross-platform tool. The authors presented an experimental result conducted on healthy individuals to ascertain the efficiency and reliability of the proposed system. The results demonstrate that the system is reliable in terms of real-time ECG data collection and visualization. This approach will assist in the primary diagnosis of different kinds of heart diseases.
Mehmet [8], presented an Android application that monitors the heart rate, heart rate variability and CT parameters for the cardiovascular patients under constant care and monitoring. The system components comprise of wearable sensors that continuously measure the patient's cardiovascular signs by a wireless connectivity. The system then transmits the sensed signals to an Android interface through the wireless connectivity. The system is configured to determine if the critical value of the three parameters (Heart rate (HR), Heart rate variability (HRV), and Body Temperature (BT) is exceeded. If so, then the values of the three parameters and the real-time location of the patient are transmitted to the doctor and the family members as an email message, and Twitter notification for quick response. This system, provides the patients with mobility within their surroundings for better living.
Chao et al. [9], presented a real-time pervasive patient monitoring system that transmits sensed physical signals (parameters) to a remote medical application. The proposed system integrates two parts, namely, data acquisition and data transmission. The data acquisition part of the system is responsible for monitoring of the system's parameters and the number of each parameters in the system. This is designed based on the knowledge gathered from medical experts. The second part includes parameters that are designed to be measured at different time rates; these include the blood pressure; heart rate; pulse rate; blood fat; glucose and patient's location. The authors presented an easy-to-use prototype to demonstrate the workability of the proposed system.
Arnob et al. [10], presented a framework that uses sensors to track patient health information and web technology to notify the family members and friends in case of sudden heart attack. The proposed framework makes use of a temperature sensor and heartbeat pulse sensors to monitor the patient health status. These sensors are integrated with a microcontroller and a wireless connection to provide an IoT-based system for transmitting the patient data. The main goal is to provide instant alert messages about the heartbeat and the body temperature of the patient over the internet for necessary action or assistance. The system also provides the health statistics information of the patient on a video display screen for viewing. This will help to save human life in real-time.
Lee et al. [11], presented a physiological signal monitoring bed based on load-cells and used an algorithm to measure the heart rate and breathing rate from the examined load-cell signals. The authors conducted a total of thirteen (13) experiments using four infants. The electrocardiogram and respiration signals are used as a reference signal and are measured from a commercial device. The combined signals from the sensors are selected by the algorithm to determine the optimal sensor signal to measure the heartbeat and respiratory information of the patient. Experimental results show that the load-cell sensor signals in comparison with the reference signals demonstrates that the heartbeat and respiratory information were found to have an average percentage error of 2.55% and 2.66% respectively. As claimed by the authors, the method proposed verified the feasibility of their approach.
Zompanti et al. [12], presented a study for the monitoring of physiological parameters and an athlete's performance while in the training field. The key parameters used are the anaerobic threshold, lactate concentration, and respiratory parameters. The supervised machine learning technique and partial least squares (PLS) is used to build the model based on the data collected by the sensors. This technique allows to precisely predict the parameters of interest. The sensing device is able to measure the lactate concentration from a sample of saliva and it can measure a respiratory parameter. For example, the maximal oxygen consumption, maximal carbon dioxide output and respiratory rate can be measured from a sample of breath out. The primary advantages of the device are the low power; the wireless communication; and the non-invasive sampling method, which allow its usage in a substantial context of sporting activities. Kumar et al. [13] presented a heartbeat sensing and Heart Attack detection using internet of things (IoT). Other approaches to IoT-based systems for monitoring and control are provided in our previous works [14][15][16][17].

System Architecture and Design
This study considers the design and implementation of a human heartbeat rate monitoring and control system using heart pulse sensor and IoT-based technology. This sensor, senses human heartbeats. The heartbeats are sensed and read as data signals. The read data are processed by the microcontroller and transmitted to the WiFi module for uploading to the internet server platform (www.thingspeak.com) for further analytics and visualization [18]. The data are processed and stored in real-time with the date and time stamp when the data was captured.
The proposed system architecture consists of input, output and processing units. The input units are the user's fingertips capturing unit; heart pulse sensor unit, the power supply unit and the user interface unit. The output units are the liquid crystal display (LCD) and the WiFi Module unit. The microcontroller serves as the processing unit, also referred to as the monitoring and control unit.
The system is controlled by the ATmega32p microcontroller and programmed using embedded C programming language. The sensor and other devices are programmed and controlled using embedded C codes. The heart pulse sensor is responsible for sensing the heartbeat. The sensed data from the sensor is transmitted to the analog to digital converter (ADC) for conversion to digital signal. The converted digital signal is then transmitted to the microcontroller. The microcontroller acts on the signal based on the instructions coded in the embedded C language. The processed data are transmitted to the LCD screen for user information. Furthermore, the data are sent in real-time to the WiFi module and transmitted to the webserver (www.thingspeak.com) for further analytics and visualization. The analyzed and visualized data are updated synchronously in real-time to reflect the status of the human heartbeat rate. Figure 1 illustrates the proposed system architecture.  Figure 2 illustrates the schematic diagram of the proposed system architecture using Proteus 8.0 design tools and Arduino Uno integrated design environment [19,20]. In order to demonstrate the concepts of the proposed simulation methodology, a simple heartbeat monitoring and control model was built as shown in Figure 2. This model consists of the power supply; the heart pulse sensor; the microcontroller, ESP8266 WiFi module; liquid crystal display; resistors; capacitors, etc. These components are interconnected to ensure the proper working and functionality of the entire system. Figure 3 illustrates the system flowchart. The flowchart describes the logical steps taken by the implemented algorithm to determine the heartbeat rate of the system's user. If the read heartbeat is greater than zero and less than 60 bpm, the system displays a message that the heartbeat of the user is low. If the read heartbeat is greater than 60 bpm and less than 100 bpm, the system will display the status message that the heartbeat of the user is stable. Furthermore, if the read heartbeat of the user is greater than 100 bpm, the system will display the status message that the heartbeat of the user is high. The system will loop several times to capture the heartbeat of the user from his/her inserted fingertip on the device prototype.

Experimental Results
Herein, we present the experimental results obtained from the implemented device prototype. The heart pulse sensor transmits data to the Arduino microcontroller. The microcontroller processed the data and sends it to the LCD screen for display. The data are then transmitted to the ESP8622 WiFi module and from there it is then transmitted to the thingspeak IoT platform through a wellestablished internet connection. To access the heartbeat data, all you need to do is to log on to your thingspeak.com account and view your data which is visualized and displayed in graphical form. Similarly, the data can be visualized in tabular form with the date and time stamped when the data was captured. An important information to adhere to is that there are various factors that make the heartbeat rate of different people at rest time to differ. As a general case, the average heartbeat rate of an adult at a resting state is said to be at 72 bpm. The heartbeat rate of a child between the ages of 7 to 16 ranges between 70-120 bpm, while the heartbeat range of an adult of ages 17 to 55 ranges between 60 to 100 bpm. Similarly, the heartbeat of older people with their age range from 60 and above, their heartbeat at rest is between 65 to 125 bpm. Other important factors that affect the heartbeat rate are the body size, exercise level of an individual, etc. Figure 4a shows the heartbeat rate of an old man at rest state. We can observe that the heartbeat is fluctuating between 65 to 125 bpm. Figure 4b illustrates the heartbeat rate of an adult at rest state. We can observe that the heartbeat is fluctuating between 60 to 100 bpm. These graphs demonstrate the efficiency and reliability of the proposed approach.

Conclusions
An IoT-based smart framework for human heartbeat rate monitoring and control system is developed. This system uses the capability of a heart pulse sensor for data acquisition. A human's heartbeat is captured as data signals and processed by the microcontroller. The processed data are transmitted to the IoT platform for further analytics and visualization. Experimental results obtained from the implemented prototype were found to be accurate as the system was able to sense and read the heartbeat rate of its user and transmits the sensed data through the internet. The system components were soldered on a breadboard and cased inside a plastic container with the heart pulse sensor stretched so as to be clipped on the fingertip of the system's user. From the results obtained, it was found that the resting heartbeat rate of children below the age of 17 is between 65 to 115 bpm and the resting heartbeat rate of an adult between the ages of 17 to 60 is 60 to 100 bpm. In addition, the resting heartbeat rate of old people who are 60 years old and above, their heartbeat rate is between 65 to 120 bpm. These findings are in agreement with the state-of-the-art in the medical field. Furthermore, this research paper presents an approach that is flexible, reliable, and confidential for a heartbeat rate monitoring and control system using sensor network and IoT technology. The implemented device prototype can be deployed to the medical field to assist the medical practitioners to efficiently and reliably do their work without difficulties.