IoT Enabled Wearable Device for COVID Safety and Emergencies

—The worldwide outbreak of COVID-19 has significantly changed the mindset of the people and over the period they started practicing healthy life-style to contain the spread of the virus. Despite this, increase in the number of cases and death rates across the globe are major cause of concern. In addition to maintaining the healthy lifestyle, it is also essential to exploit the technological advancements in the field of Internet of Things (IoT) [1] in designing a cost-effective wearable device which could possibly indicate the early stages of virus infection. In this work, a low cost IoT enabled wearable device is designed which generates alerts in case of any of the measured parameter goes out of the normal range besides sending notifications.


Introduction
Wearable devices can play an essential role in foretelling several diseases by combining essential vital symptoms with clinical symptomology. Owing to this, the usage of wearable devices has been considerably gaining momentum to curb the Covid-19 pandemic. Research has begun in ascertaining whether the large data collected by wearable devices can foresee the onset of the virus or not. Initial data from several researchers have indicated this is possible. Apple watch, Fitbit and other fitness tracking devices are being explored as techniques to identify the people who are potentially infected with Covid-19 before the onset of symptoms [2]. The heart rate, respiratory rate and other parameters measured by the wearable devices can indicate the early stage of infection, so that the person can undergo timely COVID-19 test. Fitbit is performing research, involving 100,000 people in the U.S. and Canada, including 900 diagnosed with the virus to know how its wearables can help in early detection of the disease. Among several researchers, a team led by Professor Michael Snyder of Stanford University School of Medicine is examining whether wearable fitness devices can provide an early warning. Among 31 users who tested positive for COVID-19, 80 percent had data on their wearable devices that revealed infection at the time or before symptoms surfaced on an average of three days.
As COVID cases rise, people are sensitized to the term oxygen saturation (SpO2) and they started realizing the importance of pulse oximeters and wearable devices which can measure the oxygen saturation of the blood. Hemoglobin is a protein in the blood that carries oxygen to cells of the body to ensure the proper functioning of various organs. The oxygen deficiency can lead to undesirable effects on the different organs. The SpO2 value for a healthy person lies in the range 95-100 percent. A value below 90 percent during a COVID could indicate low oxygen level, a condition known as hypoxemia that can lead to organ failures and cardiac arrest if not handled early. Nevertheless, asymptomatic COVID patients may be unaware of the SpO2 reduction if they are able to breathe properly. If anyone is home quarantined owing to COVID or suffering from diseases like hypertension, heart diseases, diabetes etc., it requires immediate hospitalization with inhalational oxygen in case SpO2 falls below 90 percent. This research aims to design an affordable wearable device that could assist these patients by sending emergency notifications comprising of location information to the healthcare officials whenever the measured parameters go out of the normal range. This helps in saving the life by immediate hospitalization.

Literature Review
There are some works reported in the literature in designing safety and emergency devices. Awodeyi Afolabi et al. [3] designed a panic button alarm system to monitor the security emergencies in realtime using Arduino Uno microcontroller, WiFi module, GPS module and a push button. The system sends and displays the GPS coordinates in a Google map whenever the push button is pressed. T. Sowmya et al. [4] designed a women safety system using Arduino Uno, GSM module, GPS module, WiFi module, accelerometer sensor, buzzer, panic button, and LCD. Whenever the woman presses the panic button, the system sends the emergency message to the registered mobile number and the nearest police station. The location information is continuously updated into a webpage. Accelerometer sensor is used to indicate the fall and the buzzer is used to signal the people at the vicinity about the danger. Mahejabeen Budebhai [5] designed an IoT based child and women safety system using Raspberry Pi, GPS, GSM, heart rate sensor, temperature sensor, microphone and, panic button which could be used to locate the lost children or the women in danger. The system is equipped with various sensors to measure several parameters and can send the messages to parents and/or police by pressing the panic button or uttering the keyword. Sandy Suryo Prayogo et al. [6] designed an IoT based home panic button for smart city using NodeMCU. The Message Queue Telemetry Transport (MQTT) protocol is used to send a message to the web. Anjo A N J et al. [7] designed a child security enhancement system using Raspberry Pi, to track the child using GPS and sense the pulse rate using pulse rate sensor. Wasim Akram [8] designed an IoT enabled safety device for women using Atmega 328 microcontroller, GSM, fingerprint sensor, and a buzzer to alert the nearby people and police when the women are in danger.
Though most of the affordable fitness trackers available in the market are able to measure the parameters like heart rate, blood oxygen level etc., they don't have mechanism to send the signal to the concerned whenever the value of the measured parameter goes out of the normal range. Also, safety or panic button to communicate the emergency to the nearest ones or the authority concerned is missing in these affordable fitness trackers. Though, most of the works reported in the literature try to address safety and emergency by providing location information in affordable manner, they are not designed to be as portable friendly as the fitness trackers available in the market. Nevertheless, the location information provided by the affordable GPS modules used in the literature may not be accurate for the indoor environments. The need of the hour is to design an affordable and portable IoT enabled wearable device to provide safety in case of emergencies by providing the accurate location information. Considering these things, the paper proposes a system in which a wearable device is designed to send the emergency data, and the Android mobile of the user is used to send the accurate location information to the concerned.

3
System Design Figure 1 shows the model of the proposed system. The wearable device is worn around the wrist like a wristwatch. The IoT enabled wearable device is equipped with heart rate sensor, temperature sensor and a panic button. The Android mobile is configured as mobile hotspot through which the wearable device sends the emergency data to the IFTTT (If-This-Then-That) [9] server. Also, it sends its location information to the concerned in case of emergency.

Fig. 1. System Model
The wearable device is designed using M5Stack Core [10] which is powered with an ESP32 microcontroller. The M5Stack Core module is depicted in Figure 2. The device boasts of 4MB Flash memory, 520 kB SRAM, 2-inch color TFT LCD screen, 1W speaker, 150 mAh battery, Wi-Fi module, Grove port, UART, GPIO pins, and 3 buttons. Platforms and programming languages such as Arduino IDE, Blockly language with UIFlow and Micropython are supported by the device.
To measure the heart rate, MAX30100 sensor depicted in Figure 3 is used. It is a pulse oximetry and heartrate sensor system. LM35 temperature sensor depicted in Figure 4 is used to measure the body temperature.    Figure 5 shows the wearable device designed using the heart rate and temperature sensor modules. The heartrate module is connected to the grove port using a grove cable and the analog output of LM35 temperature sensor module is connected to GPIO pin 36, which is the analog input of on chip ADC. Button A can be used as Panic/Emergency button.

Fig. 5. Wearable device design
The operation of the system is depicted in Figure 6.

Fig. 6. System operation
The M5stack is configured to connect to the Android mobile hotspot by using its SSID and password. MAX30100 sensor is initialized to measure the heart rate and blood oxygen level. The sensor has an integrated pulse oximetry and heart-rate monitor sensor. It blends two LED's, a photo detector, optimized optics, and low-noise analog signal processing to detect pulse and heart-rate signals. It has two LEDs, among which one emits the red light, and the other emits the infrared light. It requires only infrared LED to measure the pulse rate and both the LEDs to measure the oxygen level in the blood. The oxygenated blood increases whenever the heart pumps the blood and decreases whenever the heart relaxes. The pulse rate can be calculated by getting the time between the increase and decrease of oxygenated blood. The oxygenated blood absorbs more infrared light and passes more red light whereas the deoxygenated blood absorbs more red light and passes more infrared light. The absorption levels for both the light sources read by the sensor are stored in a buffer that can be read via Grove port using I2C protocol. The Arduino MAX30100 library from the GitHub is used to calculate the heartrate and SpO2 values from the sensor data. For the experimentation, heart rate in the range 60-100 beats per minute (bpm) and SpO2 in the range of 95-100% are considered as normal.
The LM35 module can measure the ambient temperature in the range -55 to 150 °C. For experimentation, the normal range of body temperature is considered as 36-38 °C. The output voltage of the LM35 temperature sensor is linearly proportional to temperature in centigrade. For every degree change in the temperature, the output voltage changes by 10 mV. Analog output of the LM35 is converted into digital by the on chip 11-bit ADC. Using this digital value D, the temperature in degree centigrade T can calculated as: (1) Mobile Hotspot and GPS are to be switched ON in the Android mobile, and IFTTT and MacroDroid [11] applications need to be installed. IFTTT is a web service using which users can create chains of simple conditional statements, called "Applets". These applets can be triggered through the "Webhooks" service. Identified by an event name, Webhook can send HTML POST and GET requests. The IFTTT Applet with the event name Emergency_REQ depicted in Figure 7 is created. This Applet is uniquely identified by a key. The M5Stack uses GET web request method to trigger an event using URL: https://maker.ifttt.com/trigger/Emergency_REQ/with/key/<unique_key>. Whenever the measured parameters are not in the normal range or Button A is pressed, the wearable device sends IFTTT notification comprising of Heart Rate (bpm), SpO2 percentage, Temperature (°C), and the status of the switch (ON/OFF) using HTTP GET request method to the IFTTT server. IFTTT Applet is configured to add the values received through the notification as a new row to a Google sheet.
Macrodroid application is used to automate the tasks in the android mobile by creating macros. Each macro is associated with trigger, action, and constraint. Whenever the event specified in the Trigger occurs, specified Action is performed.

Fig. 7. IFTTT Applet
Constraints are optional which are used to indicate the conditions under which the macro could run. A macro with the name Emergency_Data depicted in the Figure 8 is created. Notifications received from the IFTTT application is added as the Trigger and Send Email to specific Email ID is added as the Action. The Email subject is configured as "Emergency Request" and the Email message text is configured to insert the Google sheet and last known location links. IFTTT Application installed in the mobile, displays the IFTTT notification in the notification bar, upon receiving a notification from the wristband. This notification runs the macro which in turn sends the email as specified by the Action field.

Results and Discussion
The final protype of the IoT enabled wearable device is designed using M5Stack Core, MAX30100 and LM35. The heart rate and oxygen saturation measurement accuracy are compared using Honor Band 5, a popular smart band as depicted in Figure 9. The temperature measured by the device is compared with Thermomate mercury thermometer. It can be seen from the Table 1 that the results displayed for 5 people with different age groups by the proposed IoT enabled wearable device are almost close to the values obtained by smart band and thermometer.  Emergency Email functionality is tested by pressing the Emergency Button A. Figure 10 depicts the Email received by the intended recipient. The message comprises of links for the google sheet and the last known location. Each row in the Google sheet comprises of Heart Rate, SpO2, Temperature, Button A Status, and Timestamp of the data. By analyzing the current and past data and getting the last known location, suitable emergency assistance could be provided by the intended recipient of the Email.

Conclusion
Owing to the outbreak of COVID-19 pandemic, people started realizing the importance of the personal hygiene, wearing the masks, social distancing, and quarantine to contain the spread of the deadly virus. Despite this, number of cases are increasing day by day and the promising vaccine for the disease is not yet ready. It is also observed that the patients are very responsive to the treatments by detecting the disease in the early stage. This has prompted us to exploit Internet of Things (IoT) in designing a costeffective wearable device which generates alerts in case of any of the measured parameters go out of the normal range besides sending notifications to the doctor or healthcare officials.