Respiration Measurement in a Simulated Setting Incorporating the Internet of Things

: The Internet of Things (IoT) in healthcare has gained signiﬁcant attention in recent years. This study demonstrates an adaptation of IoT in healthcare by illustrating a method of respiration rate measurement from a platform that simulates breathing. Respiration rate is a crucial physiological measure in monitoring critically ill patients. The devised approach, with further development, may be suitable for integration into neonatal intensive care units (NICUs) to measure infants’ respiration rate. A potential advantage of this method is that it monitors respiration using a wireless non-contact method and could add beneﬁts such as preservation of skin integrity. The paper aimed to assess the accuracy of an IoT-integrated ultrasound (US)-based method for measuring respiration rate. Chest movement due to respiration was simulated by a platform with a controllable moving surface. The magnitude and frequency of the movements were accurately controlled by a signal generator. The surface movements were tracked using US as a reliable and cost-effective technology. ESP8266 NodeMCU was used to wirelessly record the US signal and ThingSpeak and Matlab © were used to analyze and visualize the data in the cloud. A close relationship between the measured rate of the simulated respiration and the actual frequency was observed. The study demonstrated a possible adaption of IoT for respiration rate measurement, however further work will be needed to ensure security and reliability of data handling before use of the system in medical environments.


Introduction
In this section, an overview of the Internet of Things (IoT) in healthcare is provided. Then, the need for measuring respiration rate (RR) and approaches for its measurement are introduced.

The IoT in Healthcare
The IoT is a collection of physical devices that are connected through the internet. These devices have sensors capable of transmitting to and receiving data from other devices or networks, through the cloud or the internet, along with distinct capabilities to analyze, make decisions or carry out important tasks [1][2][3][4][5].
The IoT is having an increasing impact in the medical field in assisting with monitoring patients and supporting healthcare activities [6,7]. The Internet of Medical Things (IoMT) is a subdivision of the IoT that deals with interconnected medical devices and equipment that constitute healthcare information technology. IoMT solutions offered by healthcare organizations are creating opportunities in improving clinical efficiency, home or remote monitoring, wearable sensors for physiological measurements and sleep monitoring conditions [8,9]. The developments in 5G networks can facilitate greater and more effective adaptation of the IoT [10] with smart healthcare solutions extending to asset management, remote monitoring, assisted living and telemedicine [11,12]. nature of the IoT that can result in compromise of a patient's privacy [31]. IoT security has been explored by considering the four-layer architecture of the IoT, i.e., application, middleware, network and perception layers [32]. The IoT in the medical field has security and privacy issues in all layers [33]. The perception layer acquires medical data (e.g., heart rate, respiration rate) from sensors and transfers them to the network layer. The forms of attack at the different layers could be [34]: • Application layer: account hijacking, ransomware and brute force • Middleware layer: cross-sire request forgery and scripting, session hijacking • Network layer: eavesdropping, replay, access, denial of service • Perception layer: device tampering IoT devices can be prone to hardware and software malicious attacks [35,36]. The attacks can be considered from the points of view of the IoT layers, methods, origins and levels of complexity [37].

Respiration Rate
Respiration rate (RR) represents average number of breaths per minute (i.e., average number of times air is inhaled and exhaled per minute). Its unit is breaths per minute (bpm). Its value varies in children and adults. It is around 15 bpm in healthy adults, and it is higher in young healthy children. RR is an important indicator of deterioration in critically ill patients and its monitoring is therefore clinically crucial [38].
The need for an accurate measurement of RR has been reported in several studies [39][40][41][42][43][44][45]. Respiratory rate is often not recorded due to the difficulties in its measurement [41], even though an abnormal respiratory rate can be an important predictor of serious events such as cardiac arrest. RR is probably the most in need of continuous monitoring among vital signs [42]. These points were further emphasized in other studies [43][44][45][46].
A number of approaches were devised to measure respiration rate, each having its own merits. In this section, some of these approaches are very briefly introduced. Respiratory airflow can be measured using nasal prongs placed in the nostrils [47]. This is an accurate method of measuring respiration rate as it directly detects respiratory airflow. However, since the prongs are placed in the nostril, it is not comfortable for some young children and they either refuse to accept it, or may remove it during long-term monitoring, such as an overnight recording. It also misses any respiratory airflow caused by mouth-oriented breathing.
Respiration rate has been measured by infrared thermal imaging. Using this method, the variations in infrared emission centered on the nose as the air is inhaled and exhaled are converted to a respiratory signal and respiration rate is obtained from it. The method is noncontact, i.e., the measurement device is not attached to the subject's body and thus it is better tolerated by children than nasal prongs. However, body movement during the recording needs to be tracked using a suitable procedure to ensure the correct region in the recorded thermal images is processed [48][49][50].
A thermistor placed close to the nose can also measure the respiratory-related temperature variations as the air is inhaled and exhaled and thus is another valid approach to measure respiration rate. However, the method can be affected by changes in skin and room temperature [40]. Monitoring chest movements using strain gauge sensors [51] and visual video imaging [52] provide other respiratory rate measurement solutions.
In the following sections, a description of IoT for neonatal intensive care units (NICUs) is provided due to the relevance of the IoT-integrated RR measurement approach for NICUs, the set-up used to simulate respiration rate measurement is outlined, the integration of IoT into the simulated respiration rate measurement system is explained and the results obtained are discussed.

IoT for the Neonatal Intensive Care Unit (NICU)
NICUs take care of premature babies who are unable to survive on their own and need the aid of incubators, monitors and breathing devices. Babies stay in a NICU from days to weeks depending on their health condition and whether they are born at fullterm or prematurely [53]. Neonates are nursed in incubators to maintain a constant body temperature and are monitored to ensure physiological parameters such as heart rate and RR are within their expected ranges and to direct clinical intervention when the infant's health is at risk [54]. Monitoring of RR is carried out by nurses who count the breaths per minute visually or using a stethoscope or via electrocardiography (ECG) stickers on the chest using an algorithm to calculate RR. Blood oxygen and carbon dioxide levels are measured using pulse oximetry, capillary or arterial blood sampling. Due to the fragile nature of the skin of premature neonates, this study explored a non-contact physiological measurement approach whereby the sensing unit is not attached to the body [55]. Infrared thermal imagining as a non-contact method for monitoring and diagnosis in neonates has previously proved effective in an NICU environment. For example, infrared thermal imaging was used to detect inflammatory intra-abdominal pathology in infants [56].
Integration of IoT into an NICU requires a wireless connection to IoT devices with 3G or higher, WiFi mesh or WiMax. For data transmission, solutions with universal computing are available, e.g., radio frequency identification (RFID), Bluetooth, ZigBee and wireless sensor networks (WSNs). Many hospitals use wireless local area networks (WLANs) for communication and patient data handling. WLANs and Wireless Personal Area Networks (WPANs) are the most affordable wireless network solutions for neonatal monitoring [57]. The mobility feature of WPANs helps to track other devices and facilitates non-obstructive neonatal monitoring [57].
By integrating a neonatal incubator with the IoT, parameters like RR can be monitored remotely via the internet. If the measured parameter moves out of the safe limits, it can be raised to the responsible healthcare provider through an SMS or an alarm to indicate the anomaly, thereby providing timely attention to the infant in the NICU. The electronic devices in NICUs are essentially IoT objects which are always connected to the internet, and then to a private or the public cloud. These objects are accessible remotely. They can interact with each other directly, through a process called Machine-To-Machine (M2M) communication. IoT objects send data continuously to the web using services like ubidots that also store data online. They trigger certain events in the cloud based on the data monitoring in the incubator. An advantage of the remote monitoring system is that clinicians can access real-time health data and monitor patients regularly through automated workflows or email and treat them at the onset of a health problem. A model of IoT-embedded NICU transmitting data over the cloud from sensors has been reported [58].

Set-Up for the Simulated Respiration Rate Measurement
In this section, a prototype IoT-integrated system for noncontact respiration rate (RR) measurement is described. An ultrasound (US) sensor was used to track simulated chest movements associated with respiration. Neonates in incubators do not move around significantly, therefore once the US transceiver is focused on the neonate's chest, they could remain within the US recording beam. If the infant moves outsides the field of view of the US beam, a repositioning of the US transmitter and its associated receiver would be needed. This repositioning should be automatic through a feedback mechanism, however in this study, this feature was not implemented. Furthermore, in some infants, respiration may also cause abdominal movements and so both the chest and abdomen should be tracked. Again, this feature was not incorporated in this study. For clinical deployment, these features should be considered.
An US sensor transmits a high-frequency sound wave to the surface being tracked. A proportion of its energy is reflected back to the US receiver. This distance between the US source and the surface (L) can be measured by where t is the time taken for the wave to propagate to the surface and reflect back to the US receiver, v is the speed of the US wave in air and α is the angle between the transmitted and received US waves. The factor 0.5 is included as t represents the time taken for the US wave to propagate to the surface and to return from it, i.e., covering a distance of 2L. When the US transmitter and receiver are close to each other, α could be considered as zero, hence L = 0.5 vt.
The current face-to-face meeting restrictions (ethical issues) imposed due to COVID-19 at the time of this study prevented a clinical trial involving testing the method on patients. Instead, a set-up was devised to test the effectiveness of the system. This set-up simulated chest movements associated with respiration. It consisted of an accurate sinewave signal generator connected to a subwoofer. The surface of the subwoofer's cone was covered with a flat circular cardboard. Using this set-up, the magnitude and frequency of the movements of the surface could be accurately controlled by adjusting the amplitude and frequency of the sinewave signal produced by the signal generator. This set-up is shown in Figure 1. The distance of the US transceiver to the surface was 50 cm. The sample rate used in the data recording was 20 samples per seconds. An US sensor transmits a high-frequency sound wave to the surface being tracked. A proportion of its energy is reflected back to the US receiver. This distance between the US source and the surface (L) can be measured by where t is the time taken for the wave to propagate to the surface and reflect back to the US receiver, v is the speed of the US wave in air and α is the angle between the transmitted and received US waves. The factor 0.5 is included as t represents the time taken for the US wave to propagate to the surface and to return from it, i.e., covering a distance of 2L. When the US transmitter and receiver are close to each other, α could be considered as zero, hence L = 0.5 vt.
The current face-to-face meeting restrictions (ethical issues) imposed due to COVID-19 at the time of this study prevented a clinical trial involving testing the method on patients. Instead, a set-up was devised to test the effectiveness of the system. This set-up simulated chest movements associated with respiration. It consisted of an accurate sinewave signal generator connected to a subwoofer. The surface of the subwoofer's cone was covered with a flat circular cardboard. Using this set-up, the magnitude and frequency of the movements of the surface could be accurately controlled by adjusting the amplitude and frequency of the sinewave signal produced by the signal generator. This set-up is shown in Figure 1. The distance of the US transceiver to the surface was 50 cm. The sample rate used in the data recording was 20 samples per seconds.

Integration of IoT into the Simulated Respiration Rate Measurement System
This section explains the integration of the IoT as part of the simulated respiration rate measurement system. It outlines the methodology used to record the US signal, its transmission, analysis, display and determination of respiration rate. The set-up for remote monitoring of the recorded data from the cloud by IoT devices is explained. The hardware elements employed were: ESP8266 NodeMCU and a US transceiver (transmitter/receiver). The recorded real-time US data were wirelessly transmitted to the ThingSpeak every 15 s. Data analysis was performed in real-time and results were displayed utilizing the cloud. The steps involved were: i. Receiving the US signal reflected from the surface being monitored. ii. Real-time wireless US data transmission to the ThingSpeak server. iii. Data aggregation and analysis that included respiration rate calculation through the ThingSpeak server. iv. Displaying the results through the ThingSpeak server with the aid of integrated Matlab © software.

Integration of IoT into the Simulated Respiration Rate Measurement System
This section explains the integration of the IoT as part of the simulated respiration rate measurement system. It outlines the methodology used to record the US signal, its transmission, analysis, display and determination of respiration rate. The set-up for remote monitoring of the recorded data from the cloud by IoT devices is explained. The hardware elements employed were: ESP8266 NodeMCU and a US transceiver (transmitter/receiver). The recorded real-time US data were wirelessly transmitted to the ThingSpeak every 15 s. Data analysis was performed in real-time and results were displayed utilizing the cloud. The steps involved were: i.
Receiving the US signal reflected from the surface being monitored. ii.
Real-time wireless US data transmission to the ThingSpeak server. iii.
Data aggregation and analysis that included respiration rate calculation through the ThingSpeak server.
iv. Displaying the results through the ThingSpeak server with the aid of integrated Matlab © software.
The elements used for the set-up are shown in Figure 2. The details of elements making up the system are: • US transceiver-The type of US transceiver was HC-SR04. This is a 4-pin module, whose pin names are supply voltage (Vcc), trigger, echo and ground. It provides 2 to 400 cm noncontact distance measurement. Its distance measurement accuracy can be 3 mm. The module contains US transmitter, receiver and control circuits. It operates by automatically sending eight 40 kHz signals for its measurements. • ESP8266 NodeMCU-This is an IoT device that connects to an active wireless network. It was used to record the US signal and wirelessly transmit it to the ThingSpeak for processing over the cloud. NodeMCU connects an active wireless network for data transmission to the ThingSpeak. It is an open-source IoT platform. It has a firmware which runs on ESP8266, an integrated Wi-Fi chip, a power amplifier, power management modules, antenna switches and filters.

•
ThingSpeak-This is an open-source web-based IoT analytics platform that allows users to aggregate data, analyzes them using web-integrated Matlab © and visualizes live data streams in the cloud. It allows users to create channels like YouTube or television [59]. The data can be analyzed and visualized using different ThingSpeak applications based on packages such as Matlab © . Matlab © was used for data analysis in this study. ThingSpeak has designed a secured system for user data protection. Each ThingSpeak channel has its own unique and secure read and write Application Programming Interface (API) keys.
chnologies 2021, 9, x FOR PEER REVIEW 6 of 12 The elements used for the set-up are shown in Figure 2. The details of elements making up the system are: • US transceiver-The type of US transceiver was HC-SR04. This is a 4-pin module, whose pin names are supply voltage (Vcc), trigger, echo and ground. It provides 2 to 400 cm noncontact distance measurement. Its distance measurement accuracy can be 3 mm. The module contains US transmitter, receiver and control circuits. It operates by automatically sending eight 40 kHz signals for its measurements. • ESP8266 NodeMCU-This is an IoT device that connects to an active wireless network. It was used to record the US signal and wirelessly transmit it to the Thing-Speak for processing over the cloud. NodeMCU connects an active wireless network for data transmission to the ThingSpeak. It is an open-source IoT platform. It has a firmware which runs on ESP8266, an integrated Wi-Fi chip, a power amplifier, power management modules, antenna switches and filters.

•
ThingSpeak-This is an open-source web-based IoT analytics platform that allows users to aggregate data, analyzes them using web-integrated Matlab © and visualizes live data streams in the cloud. It allows users to create channels like YouTube or television [59]. The data can be analyzed and visualized using different ThingSpeak applications based on packages such as Matlab © . Matlab © was used for data analysis in this study. ThingSpeak has designed a secured system for user data protection. Each ThingSpeak channel has its own unique and secure read and write Application Programming Interface (API) keys. The hardware set-up is shown in Figure 3.

Private cloud
Ultrasound Transceiver

IoT NodeMcu Controller
The Internet ThingSpeak server -Data aggregation ThingSpeak server -Malab © data analysis Dashboard -Visualise data Remote access The hardware set-up is shown in Figure 3. The hardware also integrated environmental humidity and temperature sensors and an LCD display to interface with the user. It adapted an LED and a miniature buzzer to raise visual and audio alarms when RR exceeded the preset range indicated by the user. Figure 4a shows an example of the signal recorded using the system. The signal generator's frequency was set to 0.4 Hz. Figure 4b shows the magnitude frequency spectrum of the signal in Figure 4a. The peak of the magnitude frequency spectrum appears at 0.397 Hz, characterizing the frequency of the dominant signal component which is close to the signal generator set frequency of 0.4 Hz. Relating this frequency to respiration rate, 0.4 Hz corresponds 0.4 Hz × 60 s = 24 breaths per minute (bpm). Table 1 provides the signal generator frequency varied in the range of 0.1 to 1 Hz (corresponding to a breathing range 0.1 Hz × 60 s = 6 bpm to 1.0 Hz × 60 s = 60 bpm) and the associated US signal frequencies determined by identifying the frequency corresponding to the peak in the signal's magnitude frequency spectrum.  The hardware also integrated environmental humidity and temperature sensors and an LCD display to interface with the user. It adapted an LED and a miniature buzzer to raise visual and audio alarms when RR exceeded the preset range indicated by the user. Figure 4a shows an example of the signal recorded using the system. The signal generator's frequency was set to 0.4 Hz. Figure 4b shows the magnitude frequency spectrum of the signal in Figure 4a  From the data in Table 1, the mean and standard deviation of the frequencies associated with the signal generator were 0.550 and 0.303 Hz. The mean and standard deviation of the frequencies associated with the US recorded signal were 0.565 and 0.300 Hz. The percentage difference between the stated means is −14.6%. The related measurements are shown in Figure 5.  Table 1 provides the signal generator frequency varied in the range of 0.1 to 1 Hz (corresponding to a breathing range 0.1 Hz × 60 s = 6 bpm to 1.0 Hz × 60 s = 60 bpm) and the associated US signal frequencies determined by identifying the frequency corresponding to the peak in the signal's magnitude frequency spectrum. From the data in Table 1, the mean and standard deviation of the frequencies associated with the signal generator were 0.550 and 0.303 Hz. The mean and standard deviation of the frequencies associated with the US recorded signal were 0.565 and 0.300 Hz. The percentage difference between the stated means is −14.6%. The related measurements are shown in Figure 5.  From the data in Table 1, the mean and standard deviation ciated with the signal generator were 0.550 and 0.303 Hz. The m tion of the frequencies associated with the US recorded signal w The percentage difference between the stated means is −14.6% ments are shown in Figure 5. A close relationship was observed between the two sets 0.99). The differences between the signal generator's frequenci signal's frequencies are partly related to:

Results and Discussion
• Accuracy of the frequency setting on the signal generator. • Accuracy of manually reading the frequency associated wi nitude frequency spectrum. • Level of accuracy provided by the US transceiver.
The study focused on a possible use of the IoT that could b A close relationship was observed between the two sets of frequencies (gradient 0.99). The differences between the signal generator's frequencies and the US-recorded signal's frequencies are partly related to: • Accuracy of the frequency setting on the signal generator. • Accuracy of manually reading the frequency associated with the peak in the magnitude frequency spectrum. • Level of accuracy provided by the US transceiver.
The study focused on a possible use of the IoT that could be integrated into a platform that simulated respiration and its rate. Although there are a number of RR measurement methods, these tend to be contact-based, i.e., the sensing device is attached to the patient's body. This in turn may affect the patient's comfort and thus alter the respiration rate. US, as a harmless, cost-effective technology, has the potential to provide noncontact RR measurement. A number of further developments are needed to utilize the reported system in clinical environments. These include: • Tracking: The US-based RR measurement method works while the baby's chest (or abdomen if moving due to respiration) remains within the US field of view. If the baby moves, repositioning of the US transceiver will be needed. This repositioning requires the position of the baby to be tracked. A number of tracking algorithms were reported that may be considered. A relatively simple tracking approach is template matching. In this approach, the template of the section being tracked is segmented from the first image in the video and correlation is used to identify the section in the following images [60]. Another approach is the Kanade-Lucas-Tomasi (KLT) feature tracker [61] that looks for unique feature points in a region of interest and then tracks these points in subsequent images. The tracking algorithm requires a camera. An infrared thermal camera allows the baby to be viewed without reliance on background light, but it is more expensive than a visual camera. • Incorporation into neonatal incubators: This requires design considerations that encompass the infants, medical practitioners and family members [62].

•
Integration into smart hospital infrastructure: This will allow clinicians to be alerted if an anomaly in the child's breathing is detected through warning messages sent to the clinicians' digital devices [63].

Conclusions
Adaptation of the IoT in healthcare can provide flexibility in patient data collection and storage. It has the potential to improve patient experience and reduce cost. This study outlined a simulated setting, whereby the IoT could be adapted into a neonatal intensive care unit (NICU) to measure respiration rate. Chest movements were simulated through a devised platform with a controllable moving surface. US was used to accurately measure the platform's surface movement. ESP8266 NodeMCU was used as an IoT device to connect to the active wireless network, capture the US signal and transmit it to the ThingSpeak. Real-time wireless data transmission took place in the ThingSpeak server, where data aggregation and analysis to determine respiration rate were performed using Matlab © . The frequency of the platform surface movement closely matched with the frequency measured by the IoT-integrated US system. Further development work will be needed to fully adapt the system as part of NICU and use it in a hospital environment.