1 Introduction

The world has been observing an exponential increase in COVID-19 since the beginning of 2020. Nearly, 450 million people have suffered from SARS-CoV-2 across the globe, as per the WHO report [1]. In India, 30 million people have suffered from this virus along with other pathogenic diseases. This virus emanated as a “pandemic” in March 2020 with its contemplation of being an epidemic. The key symptoms of COVID-19 caused by the virus SARS-CoV-2 are fever, breathing troubles, chest cramps, cold, etc. It is evident from lab findings that it has distended geographic diffusion [2]. In order to tame the respiratory disease’s transfusion and to flinch the second wave, distinct nations had foisted partial or complete lockdowns, isolations, and quarantines [3]. The scrimping and saving of the globe enfeebled with this showdown, expected to continue leaving a long haul quiver. Consequently, the conventional life of every individual is ultimately crippled by adhering to the guidelines systematized by the government such as physical distancing, confinement, travel bans, lockdowns, stay at home orders, and restrictions on opening any business, institution, or enterprise. The number of infected cases has been increasing progressively because of the silent spreaders or the asymptomatic carriers who show no symptoms but, are infected with and upturn the spread of this virus. The mainspring of this spread is caused by improper maintenance of human health safety and the scanty resources such as oximeters and steaming devices to have habitual monitoring of health. The pandemic has resulted in a scarcity of required resources including hospital amenities, doctors, and nurses. Besides, the inadequate patient to doctor ratio restricted the patients with regular updates on their health at appropriate time. Hence, preclusion and expeditious inception are considered as the important strategies to reduce its impact. The transmission of this novel coronavirus (nCoV) can be scaled down if people stringently carry on with physical distancing and make use of facial masks. Despite providing protection, a conventional face mask cannot monitor the vital parameters such as temperature, respiratory rate(RR), and heart rate(HR) which are essential for the detection of Covid 19. Hence, it necessitates the development of a smart mask to monitor any acute change in the essential parameters which in turn would herald the onset of the serious disease. With the recent augmentation of wearable devices health technology and overture in telehealth, it is capacitating people to become cautious of their health and society and come to grips with the pandemic [4].

Nowadays, IoT has enabled huge and distinct network-linked devices for assisting human life with their service and sustainability with the cutting-edge industrial amelioration. The latest editorial inferred that beyond 100 billion devices would be accessible by the internet in reach 2025 [5]. IoT has been indubitably favorable in the COVID-19 pandemic by encompassing collection, transfer, analytics, and storage of data, being a computerized solution. The superiority of the IoT-enabled devices is the user-based application feature (App). Tightly coupled applications validate intelligent and keen communities to reinforce nations' robustness and economic conditions to combat this epidemic and further pandemic fastidiously [6]. The recent elevation in the IoT research makes it an ideal scientific approach to anticipate, supervise and documenting the impediment of this pandemic. It has become feasible to ensure that the protocols are followed conforming to the medical needs with the help of IoT. IoT is beneficial to provide lightning deliverance to the medical staff by remote monitoring of in-home patients [7]. The augmentation of a new structure that is proficient in monitoring the health of a citizen on COVID-19 and also developing an emergency alert and curative summary to the user, their guardian, or medical experts is essential [8]. The vital parameters such as blood pressure (BP), HR, temperature, RR, height, and weight are the considerable evaluations of the functioning of a typical body. In particular, temperature, respiratory rate, and heart rate are concentrated as any alteration in functional status will possibly indicate the onset of the serious disease. The main technique among the various approaches for developing an IoT system is to integrate various components onto a single platform with the least prototype cost. The chosen strategy needs to be “smart” enough with the sensor outputs.

This paper presents a smart mask that is for both inpatients and outpatients. The proposed system concurrently takes continuous values from a single LM35 temperature sensor integrated with an ESP32 controller that has an inbuilt Bluetooth and Wireless-Fidelity (Wi-Fi) connectivity. The onboard controller provides the adaptation, which calculates the parameters using their prominent relations. The respective data is then published on the Thing Speak cloud, which acts as a real-time cloud data store, and graphical analysis is done. A Beta controlled version App is also created with a unique id and password to update the person wearing the mask.

2 Review of literature

Researchers and scientists involved in the detection of coronavirus as well to develop strategies to fight along with practices would give sustenance to the infected patients. Identification of COVID-19 positive victims through CT scan and chest X-ray images was expatiated using AI and data science approaches [9]. This proposition was computed and achieved an accuracy of 93% by employing the decision tree classifier. Ouyang et al. [10] also proposed a dual sampling network to discover this virus from gathered Pneumonia records using chest machine tomography. The 3D convolutional neural network of an online consolidation section was implied in the generation of medical decisions. The transmission pattern of this virus prediction proven to be one of the chief epidemiological models is the susceptible exposed quarantined recovered death sensitive model [11]. The described techniques conclusively have an effective accuracy of 95% and have greatly yielded the exhilaration of medical science.

Temperature is an important physiological factor that needs to be monitored in various conditions as it is an essential sign, which can detect rapid refuse in health due to SARS-CoV-2. Guangli Long [12] suggested the model of a contactless infrared thermometer that can realize the temperature and time of acquisition. Various other contact measurement systems using thermistors, thermocouples, and RTDs were developed but the preeminent concerns are the inimical psychological and neurological effects they bring in through repeated use. A temperature-dependent resistor, well known as a thermistor was used to mold a wireless wearable body sensor network (BSN) for accurate non-invasive temperature measurement for medical research [13]. Rahman et al. (2018) constructed a smart health band that opted for a digital sensor to compute the human body temperature resembling the mercury thermometer which ascertains the harmful effects on our body [14].

As nCoV is essentially examined as a respiratory disease [15], the respiratory rate gives a piece of significant information regarding the person’s breathing performance, whose abnormality is a key for observing illness progression. Research conducted over COVID-19 infected patients hospitalized at the University of Washington in Seattle and Rush University in Chicago [16], between March 1, 2020, and June 8, 2020 concluded that the respiratory rate was strictly concomitant with the relative risk of mortality. To derive the respiratory rate easily, methodologies like impedance pneumography, capnometry, and spirometry are developed which provide accurate (95%) results on the cost of uncomfortableness and inability to perform continuous monitoring [17]. These precepts also demand special devices for analysis and can also interfere with natural breathing. Lately, Drummond et al. [18] concluded from their experiments that assessing respiratory rate from the nonce clinical practices cede untrue and faulty values. They performed this research on unwell patients and the periodic analytic evaluation varied considerably with the parameter not exigently testing the same averaged over a prolonged time. It can only be made sure if a person was physically making necessary changes to the breathing rate measurement, which accounts for sluggishness. Scaling the breathing rate remotely using an odd point infrared temperature sensor resulted in great rigor [19]. A sinusoidal curve function axiomatically exacting the breathing rate presents the relative rate by regularly capturing the temperature at the sub-nasal area of the face. Detecting a person's heartbeat through a pulse sensor is one of the most dominant modes on the Internet of Medical Science field [20]. Being a contact sensor, the LED located on the sensor when brought in contact with the blood vein in a human body starts emitting light. Blood circulation transpires every time the heart pumps. The exceeding amount of light received by the sensor reflects the blood flow, which determines the heartbeat or pulse over the examination. The principle is known to detect oxygen saturation through the blood flowing through the finger. Similarly, the pulse sensor integrated with the smart health band [14] aids in measuring the heartbeat rate.

The literature survey shows that the design and implementation of minuscule wearable devices that would directly measure various health parameters of the body and give precise reports for more extended periods are possible with the help of the Internet of Things incorporated through the Cloud.The residuum of the paper is systematized subsequently. The recent technologies and motivation of the proposed system are described in Sects. 2 and 3, followed by system architecture, and implementation in Sect. 3.1. Section 4 reports the experimental tests and results. The conclusion and potential further works are drawn in Sect. 5.

2.1 Motivation and contributions

The combination of the Internet of Things and cloud computing encouraged us to propose a smart mask model for telehealth that can be used to garner an enormous amount of statistics regularly, to smartly prognosticate the consequence of this transferable disease for an individual specifically.

Since, there is a synchronized transfer of data with an immediate response to the user, having functioning with low bandwidth; this framework becomes an exemplary and feasible application. IoT models are entrenched in different medical aspects to help reduce human effort; virtual hospital/wards, wearable biosensors, smart thermometers, connected inhalers, and automated insulin delivery (AID) systems to name a few [21]. The comprehensive capability is guided by the repetitive as well as the consequential data mustered. The contribution of this text is paramount to proffer an integrated cloud and IoT system to unremittingly monitor the health of the person wearing the mask and generate a record of it for time-to-time analysis and database.

Conclusively, we outline the project and suggest prospects of the development of a system from the transfer of data to the culminated result. Figure 1 is a graphical abstract of the framework submitted in this paper. The smart mask unit with the fixed IoT devices forms the user sub-system, which would physically acquire the data to the database a medical anamnesis. The health information from the user sub-system is sent to the cloud sub-system through Wi-Fi wherein the user or medical experts can have a health record for continuous health monitoring.

Fig. 1
figure 1

Overall Framework for the Proposed System

3 Proposed framework

3.1 System architecture

The increasing demand for the Internet of Things (IoT) has rapidly aggrandized to control and maintain diverse devices and mechanisms. The prerequisite of an IoT device is helpful for connectivity with a small form factor and a wide range of applications. It can be radically recounted as a cluster of devices collaborating by dint of machine to machine (M2M) communications, permitting assortment and castling of data. Researchers carried out in wearable biosensors for BSN [22], building profiles for ambient assistive living for supporting early diagnosis [23], developing an Interactive health system for diabetics [24], management of Parkinson’s disease [25], IoT based rehabilitation system [26] have discerned IoT in remote health monitoring plausible and a prospective panacea to lighten the load on health-care systems, satisfaction and convenience added up in various other contexts is perhaps salient. A concise description of the major components of this Internet of Things smart mask has been visually depicted in Fig. 2:

Fig. 2
figure 2

Block Diagram for the Proposed System

3.1.1 ESP32 microcontroller

The ESP32 can perform as a complete standalone system with integrated Wi-Fi, and Bluetooth; thus, narrowing the communication stack on the central processer [27]. The System on Chip (SoC) microcontrollers along with Wi-Fi, Bluetooth, also supports Serial Peripheral Interface (SPI), I2C/UART, ADC consolidated on this single chip. The ESP-WROOM-32 is one of the most broadly used controllers because of the facile integration on a grind PCB with minimization. The Arduino IDE platform has been hand-picked for building up the ESP32 chip controller. It is an extended electronic platform to reinforce microcontrollers utilizing a repository development environment. The straightforward and manageable framework makes the Arduino platform convenient for programming microcontrollers. Below is an example of the composition for Wi-Fi profile:

figure a

3.1.2 LM35 sensor

The LM35 sensor is used to measure the temperature, which outputs an analog signal directly proportional to the instantaneous temperature (in °C). Owing to its precision, wide working range, and linear output [28], the ultimate low-cost temperature sensor easily narrows down the temperature range to our convenience. It does not require extraneous clipping or tuning to provide accurate results. The rate or amount of transpose of temperature to voltage adds up to the senor’s sensitivity, which is 10 mV/degree. To illustrate, if the output voltage assessed is 300 mV, the temperature is likely to be 30 degrees in Celsius. According to our convenience, the temperature can be obtained in Celsius or Fahrenheit using Eq. (1).

$$Temperature\;in\;Farenheit=(Temperature\;in\;Celcius\ast(9/5))+32$$
(1)

Any temperature sensor that dawdles in temperature concerning time will not be able to proffer a precise and faultless representation. The process of gleaning and supervising further actions becomes unchallenging of its inherent calibration, and high reliability embedded with real-time systems to achieve long-term observations [29].

3.1.3 Ultrasonic sensor

The ultrasonic technology possesses untold benefits such as reasonable, high speed, and unobjectionable. It is entrenched in numerous ancillary detection fields namely robotics, engineering studies, industrialization. The ultrasonic wave emitted is appropriate as a contactless descry technology for range computation. The sensor develops an electronic pulse by using a commercialized 40 kHz piezoelectric reverberating transducer [30]. The range of sound waves perceived by a human ear is around 20 to 20,000 times a second. Nonetheless, ultrasound boosts a frequency on top of 20,000 Hz, which is imperceptible for humans. This supersonic system is split up into a compound and entire structure in keeping with the arrangement of acoustic transmitting and receiving pair units [31]. The compound structure has individual transmitting and receiving transducers whereas, the exclusive structure has a single transducer capable of performing twain functions. The compound structure HC-SR04 model has been put to use here, because of its accuracy of 3 mm and exceptional non-contact detection betwixt 2 cm and 400 cm. This transducer is governed with an input voltage of 5 V, due to which it can be facilely hooked with any microcontroller working under 5 V logic. The first action to commence with the sensor begins when a 10-microsecond pulse is exercised through the trigger pin. The sensor acknowledges it by a sonic blowout of eight pulses pattern at 40 kHz, which creates a unique identification helping the receiver to extricate the diffusive ultrasonic noise. As the 8 ultrasonic pulses advance via air, the echo pin switches HIGH to order to go ahead with the casting of the echo back signal. Conceding that, the echo signal will reinstate to LOW if the pulses are not thrown back. This interlude takes 38 ms, which specifies zero interference inward sensor. Granted that, the signal is collected, the echo pin still goes LOW and generates a pulse regulated by the time duration of the received one. The distance is computed within the sensor using Eq. (2).

$$D=k*T*V$$
(2)

where T = time of flight of an ultrasonic pulse, i.e., the period during which the pulse covers a distance of D,

k = constant which is approximately 0.5, which relies on the sensor conformation, and.

V = velocity of sound in air.

An immediate correspondence exists in the ultrasonic detection tract allying to the steady computed distance and transferal time [32]. Accordingly, it is foremost necessary to acquire the transmission time of the medium, given that the limits are concluded sustained.

3.1.4 ThingSpeak platform

When sensors are implemented for far-flung monitoring of circumambient guidelines or supplementary things, it is conventional to familiarize with the wireless anticipation of data and transmission to the required framework across the network [33]. The ThingSpeak cloud platform acts as an interface by way of the internet. The internet works as a ‘data packet’ carrier between the affixed data or sensor and the cloud platform. ThingSpeak is a non-proprietary source and an IoT analytics platform service that allows us to view and visualize the live data in synchronization with the user’s system which has been used as a cloud for this system. The central trait of its functionality is the ‘Channel’ that has ample fields to be used for various services like data storage, location and so many respectively. These services can be accessed using the GET requests API to execute the query. It enables the person to remotely view his detailed health data and also for telehealth purposes. Figure 3 depicts the schematic diagram of the developed system.

Fig. 3
figure 3

Smart Mask-Set up of the ESP32 Controller with sensors

3.2 Operational principles

The LM35 sensor has an operating temperature of -55 °C to + 150 °C, which is connected and administrated with the ESP32 controller. The ESP32 controller has an inbuilt ADC, which eases our additional computation problem by only connecting the sensor to the analog pin in the controller. This arrangement is mounted inside the mask in a way that the sensor faces towards the nostrils. The sensor senses the temperature of the person wearing the mask through the air particles present in the hallway and the analogous voltage is converted into the desired electrical quantity through the linearity property of the sensor. Since the normal temperature of an average human being itinerating 97°F (36.1 °C) to 99°F (37.2 °C), any alterations or modulations can be a key indicator of the abnormalities in vital parameters.

The normal respiratory (breathing) rate of a person is from 15 to 20 breaths per minute. Fluctuations in this not only report an integral prognostic nCoV factor but also lead to other chronic problems like bradypnea (RR < 12), tachypnea (RR > 30), and sleep apnea (RR = 0) [34]. The air-flow-based method has been implied in this prototype by detecting the temperature changes, admittedly that expiration is warmer than the inhaled air [34]. It generally requires a sensor near the nasal airways to measure the airflow temperature. Scholkmaan and Wolf in the year 2019 [35] derived a pulse-respiration quotient (PRQ) which is the proportion of two vital body parameters; a ratio of the rapid and transitory HR (heart rate) to RR (respiration rate) over a defined time interval. The experimented PRQ has been found to be 4, the proclivity of the leaned coupling resulting in 4:1. It is a very powerful, easy-to-measure parameter that captures the intricate and convoluted interchange between the cardiac and respiring systems [36]. The propensity to apprehend the sole cardio-respiratory condition of a personage in a distinguished centripetal scheme makes it the future scope of advancement in clinical conclusion, the perusal of disease, and therapeutics. The PRQ quotient obtains the heart rate theoretically and experimentally proved as in Eq. (3).

$$HR=4*RR$$
(3)

Getting a pulse also indicates the heart rhythm and strength of the pulse, which on average is 72 bpm (beats per minute). A fit and youthful populace well exhibits broad disparity in these parameters, and the biological transitions complicate its measurement with ordinary senescence and medicament. The ultrasonic sensing module is connected to the ESP32 controller via the four pins (VCC, echo, trigger, and ground). It is built up in the mask in a manner that the transducers face towards the exterior, i.e. the environment and the entire controller board is integrated between the layers of the mask so that it does not easily get affected or damaged with dust or any other particles. A LED is also connected to the controller through one of the GPIO pins to act as a triggering alarm. The alarm can be either a LED or a buzzer whichever is preferred by an individual supposed to wear it. The ultrasonic sensor generates a trigger by glowing a LED if the person neglects the social distancing pronouncement and assists in the maintaining people in an area. Figure 4 concisely depicts the workflow in a visual representation as professed.

Fig. 4
figure 4

Working Flow of the Ensemble Framework

The data gathered from the sensor and acquired health parameter values through calculations reconditioned in the form of analytical and rational equations in the code are now redirected to the ThingSpeak IoT analytics platform for storage and visualization purposes. A new ‘channel’ is created for this mask with divergent fields added for temperature, respiratory rate, heart rate, and social distancing alert as shown in Fig. 5. This is a snapshot taken from the channels created for our experimentation purpose in the ThingSpeak IoT Cloud Platform. An application programming interface key abbreviated as API is initiated for this channel, which is streamlined in the code in Arduino IDE to send the data. The channel is permitted with the sharing options for as many people necessitate. For instance, the hospital’s database can be linked with every patient with different channels for regular health updates and monitoring. The data can be sent either every 10 s or 60 s or even 10 min depending on the user or their health background. Figure 6 shows the design of the login page is fashioned using the MIT App Inventor. It is a simplistic tool to develop Android applications utilizing a web crawler and either a connected phone or emulator. It also keeps a track of the project work done which means it deploys in the cloud in itself. The App is modeled using Google Firebase, which is an authentic application development software to run successful apps. The login credentials and users can be limited and only with the registered IDs can it be opened; which hereby accounts for data privacy and protection from theft.

Fig. 5
figure 5

Formation of Channels and Fields in ThingSpeak

Fig. 6
figure 6

Design of Android App using MIT App Inventor

4 Results and discussion

4.1 Experimental results

The smart telehealth mask was tested with numerous folks and sufficient data has been gathered. The entire result can be formulated in the below four-step process.

Step 1: Calibration of sensors:

Sensors play a very significant role in acquiring datas from the Smart mask. Concerning to get precise and accurate data, calibration of sensors are very imperative. Calibration and verification of sensor parameters are done by comparing with the conventional methods. In our experimental setup, analog parameters such as temperature and distance are vital and are initially measured using conventional methods. The room temperature during different environment conditions were measured using an analog thermometer and plotted. Simultaneously the room temperature is also measured using temperature sensor LM35 and the reading were plotted. Figure 7 shows the difference between the analog temperature readings taken by a thermometer and the digital temperature readings taken by the LM35 sensor during calibration. The plotted error graph justifies the sensor's standard exactitude of ± 1/4 °C. Similarly the measurement of distance using ultrasonic sensor is also calibrated. The distance between different sets of people was measured conventionally using a scale or ruler and the same was also measured using ultrasonic sensor. The results were plotted to determine the percentage of error. Figure 8 suggests that the ultrasonic sensor has a great directional sensitivity with high structural resolution due to high transmission [37]. The graphs signify the accuracy of the results bing measured for Smart mask.

Fig. 7
figure 7

Temperature Difference Error Graph

Fig. 8
figure 8

Accuracy of the Ultrasonic Sensor

As the mask includes few low cost sensors compared with the literatures, where complex image processing algorithms with complicated system architectures, the system proves to be a cost-effective wearable realization with excellent long-term stability and power efficiency. Scholkmaan and Wolf [35] derived a PRQ, a very powerful, easy-to-measure parameter has been found to be 4, the productivity of the leened coupling resulting in 4:1. PRQ captures the intricate and convoluted interchange between the cardiac and respiring systems [36]. After careful analysis from the above literatures, the health data attained from the sensor’s output and the relationship of these parameters with each other can be derived from Fig. 9(a & b). As the person's temperature rises, the respiratory rate also increases above the normal range of the human body. With each level of increase in the temperature, the heart beats 10 times faster. The linearity principle between the respiratory and heart rate is presented in the these plots to to add justification for Eq. (3).

Fig. 9
figure 9

(a and b) Linear Relationship between Respiratory Rate and Heart Rate

Step 2: Data acquisition:

Initially, the sensing modules and the Wi-Fi modules were tested individually to make sure that the data is sent to the cloud immediately as it is acquired. The system approximately takes the early 10 s to establish the connection and institute the sensors. The temperature sensor and ultrasonic sensor take the analog and digital voltage values respectively. The temperature is computed by converting the analogous voltage to discrete value using the inbuilt ADC. The respiratory rate is calculated every time the person exhales; according to the principle that the exhaled air temperature is warmer than the inhaled air. The heart rate is derived using the PRQ quotient. The distance from the ultrasonic sensor input is estimated keeping in reference the speed of sound in air, which is 340 m/s. The distance between two persons were detected and notified if the minimum physical distancing was not maintained properly. The integrated crystal rectifier within the controller glows up to alert the person at the terribly moment and also the lamp indicator within the cloud turns red in such cases as shown in Fig. 10. This figure is a symbolic representation of the real-time working LED depicted through the ThingSpeak platform.

Fig. 10
figure 10

Wearable Social Distancing Alert

Step 3: Data analysis in cloud:

The data is sent to the ThingSpeak cloud platform in an interval of 10 s, which can also be modified according to the health and needs of the person wearing the mask. The data can be sent every 60 s or 10 min if the person is healthy and could be majorly decreased if he is COVID-19 positive. Having each field illustrating different health parameters, we have created four fields in a channel. Figure 11 shows the overall health statistics received by the ThingSpeak cloud platform. The first snapshot represents the discrete data of temperature, respiratory rate, pulse rate and social distance values. The latter illustrates the graphical visualization of the above mentioned parameters to derive a detailed history of a person wearing the smart mask. The graphical view has the date and time in the abscise axis to have a greater understanding of proper supervision over a period of time.

Fig. 11
figure 11

Health Data received by Cloud

Step 4: Data representations on App:

Figure 12 is the screencast of the Android application developed with an authenticated login system. All the three vital body parameters can be analyzed easily through it. The verified results of the test system compared with the analogous data observed are discussed in the next part of the section.

Fig. 12
figure 12

Built Android Application

5 Conclusions

The prospective IoT based system is developed to provide telehealth and analysis of an individual's health with the ease of wearing the mask. The person need not go to the hospital for every single inkling that his/her body shows without being first ascertained through this smart mask. The system has provided realistic results in obtaining the data as well as aiming to be a low-cost help by using a single temperature-sensing module to attain the three vital parameters of the body. This system can also help people once infected with the SARS-CoV-2 to have an unceasing analysis of their health, which would effectively guide them in maintaining precaution within their surroundings. The research work can be further enhanced by applying Machine Learning (ML) and Deep Learning (DL) Algorithms to predict the possibility of the persons being infected by COVID from the acquired data sets. Developing a minimalist system with additional features such as GPS module to it can add up for the benefit of society is also our future scope. This research will be a breakthrough for future telehealth systems that will adapt and learn as time progresses.