2.2.1. Wearable Device
This section describes the workflow for the target function of the WHDD. The overall workflow can be divided into two stages, namely, the stage before running and during running. The workflow for each section is described in detail below.
During the first stage (before running), the physiological information of the user is recorded. This information will be compared with the physiological information of the user during running. The change in the physiological information before and during running is an important factor for predicting heat stroke risk. Two physiological features, the heart rate and the skin resistance, of the user are recorded by the sensors during this stage. The overall workflow is shown in
Figure 4.
This workflow comprises the following steps:
Initialization of all the sensors.
The heart rate sensor monitors the user’s heart rate for 1 min with a sampling frequency of 2 Hz (one sample every 0.5 s). After 1 min, a total of 120 measurement points are obtained, whose average value is considered as the user’s heart rate before running.
Determine whether the heart rate is normal. The heart rate of a normal adult ranges from 50 to 90 bpm [
22]. If the heart rate cannot be detected by the sensor, equals zero, or falls within the range associated with an adult in a non-resting condition, then an abnormal phenomenon is identified, and the heart rate is measured again.
The user’s skin resistance is measured through the galvanic skin response for 1 min with a sampling frequency of 2 Hz (one sample every 0.5 s). A total of 120 measurement points are obtained and the average value is used as the user’s skin resistance before running.
Determine whether the user’s skin resistance falls within the normal range. The skin resistance of an adult under resting conditions is approximately 10–50 μS [
23]. If the skin resistance cannot be measured, equals zero, or falls within the range associated with an adult in non-resting conditions, then an abnormal phenomenon is identified and the skin resistance is measured again.
In the second stage (during running), the wearable device mainly captures information about the surrounding environment and the user’s physiological condition. Subsequently, this information is packaged and transmitted to the monitoring end by the LoRa wireless transmission module. The main workflow is shown in
Figure 5.
This workflow comprises the following steps:
Initial timer interruption program and external interruption program. The timer interruption program allows the wearable device to receive the heat stroke risk level from the monitoring system on a regular basis. The external interruption program enables the user to ask for help by pressing a button on the device. In this case, the device immediately sends the physiological and environmental information back to the monitoring end.
Determine whether the device must be turned off, namely, by removing the battery from the device and shutting down the program.
Collection of the user’s physiological and environmental information by the sensors (e.g., temperature and humidity sensor). The information is collected in the following order: environmental temperature and humidity, skin resistance, heart rate, and body temperature. This information is collected at intervals of 3 ms. Therefore, 15 ms are required to complete an entire cycle of information collection.
The heart rate and body temperature signals are preprocessed, first by a threshold-filtering algorithm, then by an error-filtering algorithm, and finally by a moving-average algorithm. When the number of samples reaches 60, all the filtered information is packaged and transmitted to the monitoring system by LoRa. The interval between each data transmission is approximately 15 ms × 60 = 900 ms (approximately 1 s)
When the number of samples is less than 60 or the data transmission is finished, the device continues executing the workflow from step 2.
The detailed signal processing workflows for the two most important indices for evaluating the heat stroke risk, i.e., the heart rate and body temperature, are discussed below.
Because the heart rate sensor is designed to be positioned on the user’s wrist, the movement of the arms while running can potentially induce errors in the heart rate measurements. To resolve this issue, a threshold-filtering, error-filtering, and moving-average strategy is adopted to preprocess the heart rate signal and mitigate measurement errors. The code of the program is shown in Algorithm 1.
Algorithm 1 Heart rate filtering |
- 1:
Global Variables: - 2:
TrueHR △TrueHR is the final filtered value of user’s heart rate - 3:
count = 0, mincount = 0, maxcount = 0 - 4:
Let HR[60] to be a new array - 5:
HR[0] = RelaxHR △RelaxHR is the user’s relax heart rate - 6:
function HRThresholdFilter(Value) △Value comes from HR sensor - 7:
count + + - 8:
if 50 ≦ value ≦ 190 then - 9:
HR[count] = Value - 10:
else - 11:
HR[count] = HR[count − 1] - 12:
end if - 13:
Call function HRErrorFilter(HR[count]) - 14:
if count = 59 then - 15:
Call function HRMovingAverage() - 16:
end if - 17:
end function - 18:
function HRErrorFilter(Value) - 19:
Error = Value − HR[count − 1] - 20:
if Error < −10 then - 21:
mincount + + - 22:
if mincount ≦ 6 then - 23:
HR[count] = Value − Round(Error ∗ 1.05) - 24:
else - 25:
HR[count] = HR[count − 1] - 26:
mincount = 0 - 27:
end if - 28:
else if Error > 25 then - 29:
maxcount + + - 30:
if ( thenmaxcount ≦ 2) - 31:
HR[count] = Value − Round(Error × 0.6) - 32:
else - 33:
HR[count] = HR[count − 1] - 34:
maxcount = 0 - 35:
end if - 36:
else - 37:
Keep HR[count] - 38:
end if - 39:
end function
|
In the heart rate threshold-filtering program, heart rate signals falling outside the range of 50 to 190 bpm are filtered out. This is because the heart rate of an adult at rest ranges between 50 and 90 bpm [
22]. Therefore, 50 bpm is selected as the lower limit of the heart rate. The upper limit is selected based on the study by Tanaka et al. [
24], who proposed in 2001 that the maximum heart rate (
) of an individual during exercise should be calculated based on the age instead of the gender. Roy et al. [
25] in 2015 reviewed all the existing equations for calculating the maximum heart rate during exercise. They found that the equation proposed by Tanaka is rather accurate. This equation is given by
Here, we assume the age to be 26 and derive the maximum heart rate to be approximately 190. Therefore, the upper limit of the heart rate is selected to be 190.
In the heart rate error-filtering program, each measured heart rate (
) is compared with the heart rate recorded in the previous cycle. The error between neighboring measurements is given by
This difference is used to revise the heart rate measurement based on a comparison between the performance of the heart rate sensor used in this study and that of a commercial heart rate belt. A fixed equation is derived to convert the measured heart rate to the actual value based on the difference between neighboring heart rate measurements. The revised heart rate is given by the following equation
Finally, when the number of heart rate measurements reaches 60, a heart rate moving-average program is executed to obtain the average value of the heart rate measurements obtained over 60 cycles. The final value is used as the anticipated heart rate (
), which is given by
The sensor used for measuring body temperature in this study is a non-intrusive sensor. First, it measures the human skin temperature using an infrared sensor and then it converts that to the adult body temperature using a conversion equation. This temperature sensor is placed on the inner side of the user’s wrist. Owing to the low thickness of the skin, this location is the most suitable place for measuring body temperature. According to a study by John Gammel [
26], the following equation, together with the parameters (
α) listed in
Table 3, are used to convert skin temperature to core temperature.
However, we found that the sweat generated during exercise reduces the surface temperature of the skin, and therefore, results in a lower body temperature. This impact also varies significantly with different levels of sweating for different people. Specifically, the measured skin temperature is increasingly smaller than the actual skin temperature for those generating a larger amount of sweat during exercise and vice versa. Therefore, the error of the core temperature obtained using the conversion equation is greater with increasing exercise time. To reduce the error induced by this physical phenomenon, the temperature data are filtered and processed using the program code shown in Algorithm 2.
Algorithm 2 Body Temperature filtering |
- 1:
Global Variables: - 2:
BodyTemp △BodyTemp is the final filtered value of user’s body temperature - 3:
TempDiff = 0 - 4:
Let Temp[60] to be a new array - 5:
functionTempThresholdFilter(Value) △Value comes from MLX90614 sensor - 6:
if 28 <= Value <= 35 then - 7:
Temp = 35 − Value - 8:
if Temp ! = TempDiff then - 9:
TempDiff = Temp - 10:
Temp[count] = Value + TempDiff × 1.5 - 11:
else - 12:
Temp[count] = Temp[count − 1] - 13:
end if - 14:
else if 35 < Value < 40 then - 15:
Temp[count] = Value - 16:
else - 17:
Temp[count] = 36 - 18:
end if - 19:
if count = 59 then - 20:
Call function TempMovingAverage() - 21:
end if - 22:
end function
|
After converting the skin temperature to the core temperature (
), the core temperature is processed by a temperature-threshold filter to yield a reasonable body temperature. This revision is based on a comparison between the body temperature measured using the system developed in this study and the value measured using an ear thermometer. A compensation equation is derived from this comparison to revise the core temperature measured by our device. The equation and the applicable temperature ranges are given by
When the measured core temperature (
) is in the range 31–35 °C, the real body temperature is obtained by compensating the difference between the core temperature and 35 °C proportionally. When the measured core temperature is 35–40 °C, no further revision is required. If the measured core temperature is outside the above ranges, it is assigned with a constant value of 36.0 °C, as explained below. According to Reference [
27], humans are warm-blooded animals, and the normal body temperature (no disease) of an adult human range between 35.0 and 37.0 °C based on forehead temperature measured by an infrared temperature gun. Therefore, all abnormal body temperatures were converted to the average human body temperature of 36.0 °C in this study.
Finally, similar to the process used for the heart rate and skin resistance signals, the body temperature data are also processed by a moving-average program that calculates the average value of 60 temperature measurements. Equations (3) and (4) are used to yield the final body temperature of the user ().