IOT Based Cardiac Rhythm Monitoring System Using Geolocation and Automation

Objectives: Numerous individuals among us lose their life to heart assault. Currently in India, the heart attack death rate is 34%. This is a result of their eating regimen, age, less physical movement, and numerous different components. The main cause of death during heart attack is not providing immediate help to the patient. By continuously monitoring the pulse rate and sweat of a patient, heart attack can be detected. The objective of this proposition is to develop a high-productivity and low cost gadget which measures the number of heart beats per minute of the patient and distinguishing the heart assault by putting sensors on any one of the fingers (except thumb due to absence of capillary tissues) or at any spot on the body that the pulse can be estimated from, and afterward showing the outcome on the serial monitor of the Arduino IDE. Methods: To increase the accuracy of the system, a moisture sensor is used to detect sweat cold. If any abnormalities occur, the Global System for Mobile Communications (GSM) module is activated and it sends an alert message to the mobile numbers which are already provided in the Arduino code. Findings: Using the Google Maps API the nearest hospital to the patient is located and the details are shared to the nearest ambulance and family members. The Electronic Health Records (EHR) is shared to the respective hospital before the arrival of the patient. Novelty/improvements: The framework performs precise identification and insinuation of messages to the distinctive overseers of the patients. Numerous lives might be spared in the brief length by utilizing this created framework.


Introduction
Heart attack occurs due to the blockage of coronary artery, stopping the supply of blood. The number of beats per minute (BPM) will either be extremely low or high. Sweating will be caused due to complex regional pain syndrome (CRPS) which occurs during a heart attack.The delay in the treatment of blockage leads to damage in the heart muscles. Figure  1 shows the plague formation on the walls of the artery, thus decreasing the flow of blood to the heart causing blood clot.
Meanwhile, the blood flow to the heart has to be restored quickly in order to save the person. If the person is in the emergency setting for symptoms of heart attack, he/she will undergo some tests like Electrocardiogram test (ECG), blood tests. Some additional tests like chest X-ray, Echocardiogram, Coronary Catheterization (angiogram), Exercise stress test, Cardiac CT, or MRI are taken. These tests delay the treatment.
It is important to seek immediate emergency help during a heart attack to start treatment as soon as possible because thousands of heart cells die every minute the blood flow is stopped so it is important to give quick treatment to the heart attack suffered person.
The internet of things (IOT) has numerous applications in healthcare applications like remote monitoring with the help of the smart sensors. These days there is an increase in the number of heart diseases which majorly includes heart attacks. Hence, with the help of IOT smart the heart attack can be easily detected and the treatment can be given faster.
Our system monitors the patients who have heart problems by continuously reading the heart beat and sensing the moisture content of the patients. When the sensed value crosses the threshold limit which is set, then an alert message will be sent to the given family members. Nearest ambulance and hospital is found and immediate help is provided to the patients.

Literature Survey
In Ref. [1], authors proposed a technique which measures the heart rate of a person through an optical sensing mechanism and Arduino. It uses Photo Plelthysmo Graphy FIGURE 1. Narrowed artery due to plague.

Indian Journal of Science and Technology
Vol 13(05), DOI: 10.17485/ijst/2020/v13i05/148671, February 2020 (PPG) to measure the variation in the blood volume. The infrared (IR) sensors are used to detect the density variation in the blood. In Ref. [2], authors proposed a system to monitor and alert the patient and the people around him if there occur any abnormalities. The unusual behavior is detected by attaching ECG cables and electrodes to the patient's vest to detect the electrocardiograph signals. Temperature is monitored and these values are processed in the microcontroller and the result is displayed in the output.
In Ref. [3], this system an infrared transmitter and receiver circuit is used to implement PPG to measure real time heart rate. The values are sent to Raspberry Pi which is used as a gateway. The Message Queuing Telemetry Transport (MQTT) protocol sends the data to the cloud. Alert messages are sent as mail and SMS to the user.
In Ref. [4], authors proposed a system to monitor remote patients. A specialized person is connected via a router to the IP address of the wireless monitoring system. The biomedical signal can be monitored easily.
In Ref. [5], authors developed a Heart Beat (HB) sensor which is accurate, less cost, and an easy way to monitor the heartbeat. The user should keep one finger in between a Light Dependent Resistance (LDR) and a Light Emitting Diode (LED), the intensity of light falling on the LDR varies and these variations are amplified using LM324 and converted into pulses.
In Ref. [6], authors proposed a system to monitor and provide help to the elderly people who are mostly alone. This system monitors the body temperature using temperature sensor, pulse rate using PPG to detect arrhythmia, high blood pressure and sweating to monitor the Galvanic Skin Response (GSR) of a person.
In Ref. [7], authors developed a system to monitor heart rate and temperature using portable devices. It then processes the data in the Arduino UNO microcontroller system and shows it on the Android application instantly. This is mainly developed for rural areas where there is no doctor nearby.

System Architecture
The base of the Cardiac Rhythm Monitoring System consists of Arduino UNO microcontroller. It hosts three components: pulse rate sensor, moisture sensor, and GSM module.
The pulse rate sensor is attached to any one of the fingers or any part of the body where the heart beat can be sensed. The moisture sensor is attached to the parts of the body where there are more number of sweat glands.
The block diagram of the proposed system (Cardiac rhythm monitoring system using geolocation and automation) is shown in Figure 2. This system consist of five working blocks which includes power supply, pulse rate sensor, moisture sensor, Arduino UNO board, and a GSM module. The heart beat sensor and the moisture sensor are directly attached to the body of the patient. Code is written in the Arduino IDE and uploaded in Indian Journal of Science and Technology Vol 13(05), DOI: 10.17485/ijst/2020/v13i05/148671, February 2020 the Arduino UNO board which checks for the abnormality in the heart beat rate and also the sweat level of the body. If the algorithm finds any abnormality, then it activates the GSM module and sends alert to nearby hospital, ambulance and also to the people whose contact numbers are registered as the guardian of the patients. Thus, this system provides help at the right time and saves the life of the patient.

Power Supply
The power supply for the Arduino UNO is provided from the computer using an USB Connector (5V). Even though there are other means of supplying voltage to the board using a regulator, it is not advisable because it could sometimes damage the board. So power supply using USB is optimum for the system to work efficiently. And also after powering the Arduino board power supply for other components like GSM module, sensors can be shared from the 5V pin present on the Arduino board itself.

Pulse Rate Sensor
A pulse rate sensor is a low cost device that works on the principle of optoelectronics. A heart beat is an expansion and contraction of blood vessel when blood enters and leaves the heart. A pulse rate sensor consists of 2 components: LED and LDR. To detect the pulse LED passes the light from one side of the finger and LDR detects it from the other side. When the heart pumps the blood cell observes more light, resulting in less intensity measure of LDR and also increase in resistance of LDR. Thus, a cumulative calculation for a minute is taken and BPM is calculated.

Moisture Sensor
A moisture sensor is used to measure the amount of sweat present in the surface of a patient's body. It consist of electrodes that determines the amount of moisture present. The electrodes present in the sensor consist of poor electric flow in absence of sweat on the body. If there is an increase in the amount of sweat level, then the amount of electricity increases, which result in an increase in value of the output.

Arduino UNO
The Arduino UNO is a microcontroller board based on the ATmega328P. It has an IDE to code the logic of the programmer. In this proposed system, an abnormality detector algorithm is coded and uploaded in the board. The board receives the input from the sensor and tests for abnormality. If any found, then it activates the GSM and sends alert. It also computes the nearest hospital and ambulance with respect to the patient's current location using Google Maps API.

GSM module
SIM800C is a quad-band GSM/GPRS module which works on GSM850MHz, EGSM900MHz, DCS1800MHz, and PCS1900MHz frequencies. SIM800C has GPRS multi-slot class10/class12 (optional) and supports the GPRS coding schemes CS-1, CS-2, CS-3, and CS-4. It is used to send the alerts in form of a text message, including the Electronic Health Record (EHR) link to the nearest hospital. The location of the patient and the nearby hospital is sent to the nearest ambulance and the hospital's details are shared with the guardians.

Software Description
The algorithm consists of the sequential steps that occur in the implementation of this system.
Step 2: The pulse rate sensor attached to the finger analyses the beats per minute of the patient.
Step 3: The output of the pulse rate sensor is given as input to the algorithm that checks for abnormality.
Step 4: If algorithm detects abnormality, proceed with the next step else go to Step 2.
Step 5: The moisture sensor analyses the sweat content of the body and sends the data to the abnormality detection algorithm.
Step 6: If abnormality found in the input from the previous step then heart attack is detected and continued with the further step, else go to Step 2.
Step 7: The current location of the patient is taken and the nearest hospital and ambulance is computed using Google Maps API.
Step 8: GSM module is activated.
Step 9: An alert to the hospital is sent along with the Electronic Health Record of the patient.
Step 10: The ambulance driver receives an alert attached with the details of the hospital and patients current location.
Step 11: An alert is sent to the patient's guardian pinged with hospital location.

Results and Discussion
The IOT Based Cardiac Rhythm Monitoring System is designed and implemented. Figure  3 shows the physical view of the system. It comprises of four components namely pulse rate sensor, moisture sensor, Arduino UNO, and GSM module. A bread board is used externally to connect the devices with one another. The pulse rate sensor shown in Figure 4 has three pins: "S" is the signal pin which can be connected to any digital pin on the microcontroller, "+" is the power supply pin which can support 3V to 5V, and "−" pin is connected to the ground.
Code is written in the Arduino IDE to read the input from the pulse rate sensor. The values are sensed from the patient's body and sent via the Arduino board to the IDE. The number of heart beats per minute (BPM) is displayed in the serial monitor as shown in Figure 5.  The alert message is sent using the GSM module shown in Figure 6, by a mobile number SIM card inserted in it. The location is tracked and the nearest hospital and ambulances are found using the GPRS technology.
When the heart beat sensed is above the given threshold value and the moisture level is also higher than the given normal value, then it is an abnormal behavior of the patient's body. An alert message is sent along with the Electronic Health Record text file link to the nearest hospital and the guardians in charge as displayed in Figure 7.
By using the Google Maps API, the patient is located and the nearest ambulance is found by calculating the smallest distance between them as shown in Figure 8. The nearest hospital to the patient is also loacted and the location of the patient and the hospital are sent to the ambulance driver via google map link as SMS.

Conclusion
IOT based Cardiac Rhythm Monitoring System using geolocation and automation is designed and implemented. It has provided with 90% accuracy in the detection of a heart attack. It is always best to stay preventive of the consequences. It is better to check our body when small symptoms show. This proposed system provides a way to check for the small disorders in advance. The main goal of the system is to provide a low cost and accurate device to monitor the cardiac rhythm and alert the patient. This system can be made as a ring and worn easily. This device monitors the heart rate and moisture level continuously and intimates the respective persons for help in case of an emergency. Thus, many lives can be saved and the treatment for heart attack can be given within very short duration.