Effects of Changing Air Temperature at Different Sleep Stages on the Subjective Evaluation of Sleep Quality

The thermal environment in bedrooms is important for high-quality sleep. Studies confirm that, even during sleep, the human body remains sensitive to the ambient air temperature. This study assesses how changing indoor air temperatures at different sleep stages affects the subjective evaluation of sleep quality. We compare reports from two identical sleeping environments with different thermal control systems: an IoT-based control system that adjusts the indoor air temperature according to the sleep stage and a fixed control system that maintains a constant temperature throughout the night. Ten subjects participated in the experiments and completed a questionnaire about their sleep quality. Our results show that, overall, the subjects experienced better sleep in the room with the IoT-based control system than in the one with a fixed thermal control. The mean differences in sleep satisfaction levels between the two sleeping environments were generally statistically significant in favor of the room with the IoT-based thermal control. Our results thus illustrate the suitability of using the IoT to control the air conditioning in bedrooms to provide improved sleep quality.


Introduction
Sleep is an essential part of everyday life.Scientific studies have reported potential associations between poor sleep quality and several mental health conditions [1,2].On the other hand, good sleep quality is associated with an active immune system [3], improved cognitive functioning [4], reduced risk of cardiovascular diseases, etc.Despite the proven importance of sleep to people's well-being, poor sleep quality remains a major issue in many parts of the world.For example, an international survey conducted among 10,132 individuals found that 56, 23, and 31% of the subjects in the United States, Japan, and Western Europe, respectively, lacked sufficient sleep [5].Thus, improving the quality of sleep is of paramount importance.
To improve sleep quality, first of all, it is imperative to first understand the mechanisms of human sleep.Normal human sleep consists of two phases-non-rapid eye movement (NREM) and rapid eye movement (REM).NREM sleep is further divided into three stages: N1, N2, and N3.The N1 and N2 stages are associated with light sleep, and N3 is characterized by slow wave sleep and deep sleep [6].A person's sleep cycle is a progression of episodes from the N1 stage to the N3 stage and finally to the REM phase.Any disturbance to these synchronized sleep episodes can result in poor sleep quality and the negative mental and physical health effects associated with it.
Many factors can, if not properly controlled, disturb the sleep cycle.For example, the level of ambient lighting in a sleeping environment is an important factor that affects sleep quality because human bodies are governed by an internal clock known as the circadian rhythm [7], which controls sleep and wake cycles by regulating hormone levels (e.g., melatonin).A person's circadian rhythm is naturally linked to the cycle of the sun; light from the sun is one of the key factors that initiates the production or inhibition of the sleep-regulating hormones that determine a person's wake/sleep state.Artificial lighting at night can initiate the same changes in the human body and thus affect sleep quality [7].
Factors related to the thermal environment of a sleeping person are also primary causes of sleep disturbance because the human circadian rhythms are also affected by the core temperature of the body [8].It has been reported that the body's core temperature varies through different sleep stages; the body's core temperature decreases as a person begins to fall asleep and gradually increases as they reach the deep sleep stage [9].This implies that, to achieve a sufficient quality of sleep, the body's core temperature must be maintained at a level appropriate to each sleep stage.Because directly varying the core temperature of the body is impractical, controlling the skin temperature through the manipulation of the indoor air temperature might achieve the desired core body temperatures.Although the skin temperature needed to achieve good sleep quality varies from person to person, Liu et al. revealed that the average skin temperature required for good sleep quality in adults is 34.5 • C [10].Consequently, various building standards provide guidelines for the design of air temperature in bedrooms [11,12].For example, the European Standard [EN15251] recommends a minimum bedroom temperature of 20 • C during the heating season and a maximum of 26 • C during the cooling season [12].Those recommendations, however, do not consider the different temperature levels needed at each sleeping stage.Further evidence about thermal dissatisfaction in bedrooms is provided by several studies reporting comfort and health complaints in air-conditioned bedrooms.For example, a study conducted in Hong Kong revealed that 332 out of 554 respondents experienced poor sleep quality despite setting the air temperature to their preference prior to sleeping [13].Similarly, a survey in Indonesia reported health complaints as a result of low temperatures at night even though the occupants chose their preferred temperature while in their waking state [14].
Whereas the effects of physiological changes at different sleep stages have been well documented [15], the effect of changing air temperature, depending on sleep stage, on sleep quality has not been carefully investigated.Therefore, in this study, we assessed how changing indoor air temperatures in accordance with different sleep stages might affect the subjective evaluation of sleep quality.To do that, we developed an Internet of things (IoT)-based control system that adjusts the setpoint temperature for an air-conditioner in response to each stage of sleep.Ten subjects without sleep disorders participated in experiments.The sleep quality of the subjects was tested in two identical sleep chambers with different thermal control systems (thermal conditions): a fixed control and a dynamic control.The fixed control maintained a static/fixed setpoint temperature during the experiment, and the dynamic control adjusted the setpoint temperature as a function of the stage of sleep.We used IoT sensors to both identify the stage of sleep and adjust the setpoint temperature of the air-conditioning system in accordance with the identified sleep stage.To do that, we developed a set of guidelines based on the existing studies of indoor air temperature and its influence on sleep.
Additionally, previous studies have mostly focused on the evaluation of sleep quality in subjects with sleep disorders in clinical research facilities as opposed to normal healthy adults in normal sleeping environments.As such, our study contributes to the small but increasing number of studies that aim to evaluate sleep quality in regular home environments.
Furthermore, studies about the effects of the thermal environment on sleep quality are relatively rare, partly because of the difficulty associated with collecting data from sleeping subjects, especially in a home environment.Two methods have traditionally been used for data collection in sleep-related studies: polysomnography (PSG) [16] and actigraphy [17].Although both methods have been widely applied, especially in clinical research, they demonstrate certain shortcomings.For example, the PSG approach is expensive, and, because it requires the presence of trained personnel, it is not feasible for situations outside sleep laboratories.Actigraphy, on the other hand, estimates sleeping behavior based on body activity.However, body activity is not an accurate proxy for determining whether a person is asleep or awake; it is difficult to determine whether a person is asleep or merely motionless [18].This makes the data collected using actigraphy susceptible to errors and inaccuracy.To that end, the current study illustrates the availability of IoT-based systems as an alternative research tool for data collection in sleep studies.

IoT Sensors
The IoT is the name for recent technology that allows a wireless exchange of information between hardware devices based on control algorithms.IoT sensors have been extensively applied to the automatic control of systems, particularly home automation systems [19].In this study, IoT sensors were placed beneath a mattress to collect the movements and reactions of sleeping subjects and thereby identify sleep stages.The collected data were sent through a smartphone application to a designated cloud server that recognized the stage of sleep.The smartphone application then adjusted the temperature setting of the air conditioners in real time based on the sleep-stage report it received from the cloud server.The cloud server linked with the IoT sensor estimated heart rates, respiratory rates, and the movement of each subject to determine the stage of sleep.The accuracy of our system was higher than 90% for the heart rate and respiratory rate measurements.The guidelines for shifting the setpoint temperatures were primarily based on the existing studies discussed in Section 2.2.

Transition of Setpoint Temperatures
As briefly discussed in the introduction, we set out to assess whether a person's sleep quality is influenced by changing the room temperature at different sleep stages.Therefore, we prepared two controls based on the IoT system.One is a fixed control, which maintains a static setpoint temperature.The other is a dynamic control, which changes the setpoint temperature of the air conditioner in accordance with the changing sleep stages.For simplicity, the fixed control system is referred to as the "fixed control," whereas the dynamic control system is referred to as the "IoT-based control" throughout the paper.
One way to determine the comfort level for a group of people is through the prediction of thermal sensations using Fanger's predicted mean vote model (PMV) [20].Although the PMV model was developed for people in their waking state and under specific conditions [21], it is useful in deriving optimum skin temperature required to be comfortable.Based on the PMV model, Schmit et al. [22] and Lan et al. [23] have reported that the optimum skin temperature required to feel thermally comfortable in healthy adults is approximately 34 • C.However, since it is impractical to directly vary skin temperature, we aimed to achieve optimum skin temperature by controlling air temperature.As such, to determine the setpoint temperature for the fixed control, we investigated existing studies on the influence of air temperature on thermoregulation and sleep quality.In the existing literature, the room temperature optimal for sleep has a wide range (20-32 • C) [24].The different levels of clothing that subjects wear when sleeping were the main reason for this wide variation.The optimal temperatures for covered subjects were reported to be between 20 and 22 • C, [25,26], whereas those for naked subjects were up to 32 • C [27,28].An experimental study by Lan et al. [23] found that maintaining the room temperature at 26 • C reduced the duration of sleep onset latency and improved the sleep quality of people with light, short-sleeved sleepwear.This finding was supported by a study by Lin et al., which applied a theoretical approach to defining comfortable indoor conditions for sleeping [24].Based on those studies, our fixed thermal control system used a static setpoint temperature of 26 • C. Table 1 shows a list of experimental studies reporting neutral thermal temperatures of individuals in a sleep state.For the IoT-based thermal control system, we based the transition of setpoint temperatures at different sleep stages on existing studies about the thermoregulation of the human body and sleep, which are closely related [34][35][36].
Sleep typically occurs when the core body temperature decreases, and body heat loss is at its peak [15,37].Previous studies have reported that a low temperature (i.e., 20-26 • C) in the sleeping environment is associated with a shorter time awake before entering the sleep cycle [38,39].In other words, an increase in peripheral heat loss is strongly associated with a decrease in sleep onset latency [40,41].In addition, low temperatures are conducive to falling asleep again after an interrupted sleep episode.Therefore, the IoT-based control maintained a setpoint temperature of 26 • C at the beginning of the experiment and throughout any waking stage.This is the same setpoint temperature used in the fixed control.Body temperature continues to decrease after sleep onset.Studies have found that an increase in skin temperature improved sleep efficiency and prolonged deep sleep stages [42,43].Additionally, the thermoregulatory function of the human body becomes minimal during deep sleep [35,44].Therefore, we maintained the highest setpoint temperature during the deep sleep stage.During the light and REM sleep phases, we used a setpoint temperature between the waking phase and the deep sleep phase temperature extremes.Although no specific comfort temperature has been established for a person in the light or REM phase, sudden shifts in room temperature can lead to arousal from sleep.Therefore, we used a mechanism that increases the setpoint temperature very gradually.
Previous studies have indicated that the core body temperature reaches its lowest point about halfway through the nocturnal sleep episode and then gradually increases [35,45,46].The propensity to wake up in the morning increases as the core body temperature rises (as body heat loss to the surrounding environment becomes lower than heat generation).Therefore, we maintained the highest setpoint temperature one hour prior to the wake-up time to facilitate a gradual increase in body core temperature and subsequent arousal from sleep.
In summary, assuming an initial setpoint temperature of T • C, the developed algorithm was designed to increase the setpoint temperature by 1 K (T + 1 K) after 4.5 h.In the light and REM sleep stages, the algorithm increased the setpoint temperature by 2 K (T + 2 K).In the deep sleep phase, the algorithm increased the initial setpoint temperature by 3 K (T + 3 K).As the subjects neared the wake-up time, the algorithm increased the setpoint temperature by 4 K (T + 4 K).More specifically, the IoT-based control that we tested maintained the initial setpoint temperature of 26 • C during the waking phase and raised it by 1 • C after 4.5 h.For the light and REM phases, the algorithm set the room temperature to 28 • C. In the deep sleep phase, the room temperature was set to 29 • C. To facilitate wakefulness in the morning, the algorithm set the room temperature to 30 • C. The need for different air temperature levels at different sleep stages can also be explained from the view point of metabolic rates; people's metabolic rates generally decrease as they progress from the waking state to deep sleep [47].These changes in metabolic rates condition the need for different temperature levels at each sleep stage.Figure 1 is an overall illustration of how the setpoint temperature of the air conditioner was adjusted in response to sleep stages in the room with the IoT-based system.For example, the setpoint temperature was 26 • C during the initial waking stage and then increased to 28 wakefulness in the morning, the algorithm set the room temperature to 30 °C.The need for different air temperature levels at different sleep stages can also be explained from the view point of metabolic rates; people's metabolic rates generally decrease as they progress from the waking state to deep sleep [47].These changes in metabolic rates condition the need for different temperature levels at each sleep stage.Figure 1 is an overall illustration of how the setpoint temperature of the air conditioner was adjusted in response to sleep stages in the room with the IoT-based system.For example, the setpoint temperature was 26 °C during the initial waking stage and then increased to 28 °C during light sleep.

Experimental Conditions and Procedures
The experiments were conducted in South Korea, during the summer season, using two identical rooms with the different thermal control mechanisms just described: the IoT-based control and the fixed control.To provide a sleeping test environment close to real sleeping conditions, we used a regular apartment for our study.We chose the 18th floor of an apartment building to avoid the street and traffic noise common on lower floors.The room dimensions were 3800 × 4400 × 3000 mm.
We used the within-subject experimental approach, so all subjects were tested in both sleep environments.On the day of each experiment, subjects were asked to arrive 2 h before the start of the experiment (at 9:50 p.m.).Upon arrival, the subjects received explanations about the experiment and changed into the experimental clothing we provided.Thus, before beginning the experiment, the subjects had 2 h to adapt to the ambient environment.This was done to eliminate any effects that previous weather conditions (i.e., outdoor air temperature) could have had on the sleep quality of the participants.After the 2 h provided for acclimatization and change of clothing, the experiment commenced (at 12:00 a.m.).The subjects slept for seven hours and then completed the subjective questionnaire survey.Two subjects at a time, chosen at random, participated in the experiment for two consecutive nights.Each subject was randomly assigned to a room and the subjects had no prior knowledge regarding which room contained the IoT-based thermal control system or which contained the static thermal control system.This was done to prevent preconceived judgement that may lead to certain biases.There was one subject per room for each session of the experiment.Figure 2 shows the experimental protocol followed in the study from the time the participants arrived to the end of the experiment.

Experimental Conditions and Procedures
The experiments were conducted in South Korea, during the summer season, using two identical rooms with the different thermal control mechanisms just described: the IoT-based control and the fixed control.To provide a sleeping test environment close to real sleeping conditions, we used a regular apartment for our study.We chose the 18th floor of an apartment building to avoid the street and traffic noise common on lower floors.The room dimensions were 3800 × 4400 × 3000 mm.
We used the within-subject experimental approach, so all subjects were tested in both sleep environments.On the day of each experiment, subjects were asked to arrive 2 h before the start of the experiment (at 9:50 p.m.).Upon arrival, the subjects received explanations about the experiment and changed into the experimental clothing we provided.Thus, before beginning the experiment, the subjects had 2 h to adapt to the ambient environment.This was done to eliminate any effects that previous weather conditions (i.e., outdoor air temperature) could have had on the sleep quality of the participants.After the 2 h provided for acclimatization and change of clothing, the experiment commenced (at 12:00 a.m.).The subjects slept for seven hours and then completed the subjective questionnaire survey.Two subjects at a time, chosen at random, participated in the experiment for two consecutive nights.Each subject was randomly assigned to a room and the subjects had no prior knowledge regarding which room contained the IoT-based thermal control system or which contained the static thermal control system.This was done to prevent preconceived judgement that may lead to certain biases.There was one subject per room for each session of the experiment.Figure 2 shows the experimental protocol followed in the study from the time the participants arrived to the end of the experiment.

Subjects and Clothing
A total of 10 healthy subjects participated in the experiment.All subjects were Korean male workers in their 20s.The average age of the subjects was 23.5 years.Their average height and weight were 177.5 cm and 71.2 kg, respectively.The subjects had an average body mass index (BMI) of 22.6 kg/m².To ensure that the study participants were not involved in activities that may hinder the normal sleep process, we conducted two types of survey questionnaires during the process of selecting the participants.First, during the recruitment process, candidates completed the Pittsburgh Sleep Quality Index (PSQI) [48], which evaluates 19 items related to sleep quality and produces a score from 0 to 3 for each of seven components, including sleep latency and sleep duration.The combined score thus falls between 0 and 21, with low scores indicating healthy sleeping habits.The PSQI is widely used in clinical and sleep-related research.We excluded candidates who scored more than 5 points on the PSQI index to ensure that all our subjects had normal sleeping habits.In addition, prior to the start of the actual experiment, we conducted a "pre-experiment" questionnaire that asked subjects about their daily activities in the last two days leading to the experiment.Participants who were found to have consumed alcohol or caffeine products, smoked, over-worked, or suffered from diverse sleeping disorders were excluded from the study.Additionally, a single subject was absent for the IoT-based control experiment due to personal reasons.
In regard to the level of clothing, all subjects wore cotton underwear and a long sleeved cotton shirt.The total insulation level of the clothing alone was estimated at 0.46 clo.However, the subjects were also provided with linen beddings, with an estimated clothing insulation level of 1.18 clo, throughout the night.As such, the combined insulation level provided by both the clothing and bedding was estimated at 1.64 clo.

Subjective Questionnaires
Subjective sleep quality was assessed using the self-rating Scale for Sleep and Awakening Quality questionnaire [49], which is widely used to quantify sleep quality.The survey questionnaires asked the subjects to provide responses to the questions in Table 2 using the scales shown in the table.

Subjects and Clothing
A total of 10 healthy subjects participated in the experiment.All subjects were Korean male workers in their 20s.The average age of the subjects was 23.5 years.Their average height and weight were 177.5 cm and 71.2 kg, respectively.The subjects had an average body mass index (BMI) of 22.6 kg/m 2 .To ensure that the study participants were not involved in activities that may hinder the normal sleep process, we conducted two types of survey questionnaires during the process of selecting the participants.First, during the recruitment process, candidates completed the Pittsburgh Sleep Quality Index (PSQI) [48], which evaluates 19 items related to sleep quality and produces a score from 0 to 3 for each of seven components, including sleep latency and sleep duration.The combined score thus falls between 0 and 21, with low scores indicating healthy sleeping habits.The PSQI is widely used in clinical and sleep-related research.We excluded candidates who scored more than 5 points on the PSQI index to ensure that all our subjects had normal sleeping habits.In addition, prior to the start of the actual experiment, we conducted a "pre-experiment" questionnaire that asked subjects about their daily activities in the last two days leading to the experiment.Participants who were found to have consumed alcohol or caffeine products, smoked, over-worked, or suffered from diverse sleeping disorders were excluded from the study.Additionally, a single subject was absent for the IoT-based control experiment due to personal reasons.
In regard to the level of clothing, all subjects wore cotton underwear and a long sleeved cotton shirt.The total insulation level of the clothing alone was estimated at 0.46 clo.However, the subjects were also provided with linen beddings, with an estimated clothing insulation level of 1.18 clo, throughout the night.As such, the combined insulation level provided by both the clothing and bedding was estimated at 1.64 clo.

Subjective Questionnaires
Subjective sleep quality was assessed using the self-rating Scale for Sleep and Awakening Quality questionnaire [49], which is widely used to quantify sleep quality.The survey questionnaires asked the subjects to provide responses to the questions in Table 2 using the scales shown in the table.

Statistical Analysis
For the subjective assessment of sleep quality, we used the Wilcoxon signed-rank test [50], a non-parametric test that determines whether the mean difference between two sets of observations derived from the same experiment is zero.We used it to compare the sleep quality levels reported after sleeping in the rooms with the fixed control and the IoT-based control.We chose the Wilcoxon signed-rank test because our data sample was relatively small (n < 10) and our subjective response data did not approximate a normal distribution.Statistical significance was determined at p-value < 0.1.

Results
Figure 3 summarizes the answers to the survey question, "How well did you sleep?"The responses were rated on a seven-point scale on which 1 indicates that the subject slept poorly and 7 indicates that the subject slept very well.The results indicate that the average level of sleep satisfaction was approximately 26% higher in the sleeping environment with the IoT-based control than in the room with the fixed control, which the Wilcoxon signed-rank test indicated was statistically significantly (Z = −1.706,p = 0.055) at a 90% confidence level.0.1.

Results
Figure 3 summarizes the answers to the survey question, "How well did you sleep?"The responses were rated on a seven-point scale on which 1 indicates that the subject slept poorly and 7 indicates that the subject slept very well.The results indicate that the average level of sleep satisfaction was approximately 26% higher in the sleeping environment with the IoT-based control than in the room with the fixed control, which the Wilcoxon signed-rank test indicated was statistically significantly (Z = −1.706,p = 0.055) at a 90% confidence level.
The maximum and minimum sleep satisfaction levels in the room with the fixed control were 6 and 2, respectively.On the other hand, the maximum and minimum sleep satisfaction levels in the room with the IoT-based control were 7 and 3, respectively.The difference in the level of sleep satisfaction was also reflected in the mean satisfaction score from the two sleeping environments.The mean sleep-satisfaction score from the room with the fixed control was 4.0, which indicates an average sleeping level, whereas the mean sleep-satisfaction score from the room with the IoT-based control was 5.6, which is between the levels "slept quite well" and "slept very well." The individual analysis of the results shows that 7 of the 10 subjects reported better sleep satisfaction in the room equipped with IoT-based control than in the one with the fixed control.Only one subject reported sleeping better in the room with fixed control, and the remaining two subjects expressed no differences in the sleep satisfaction levels offered by the two rooms.The average score of the subjects who expressed better satisfaction with the IoT-based control was 1.4 points higher than that of the single subject who felt more satisfied in the room with the fixed thermal control.Figure 4 shows the responses to the survey question, "Did you sleep well?"These responses were graded on a four-point scale on which 1 indicated that the subjects did not sleep well, 2 indicated a slight satisfaction with the quality of sleep, and 3 and 4 indicated a moderate and high satisfaction, The maximum and minimum sleep satisfaction levels in the room with the fixed control were 6 and 2, respectively.On the other hand, the maximum and minimum sleep satisfaction levels in the room with the IoT-based control were 7 and 3, respectively.The difference in the level of sleep satisfaction was also reflected in the mean satisfaction score from the two sleeping environments.The mean sleep-satisfaction score from the room with the fixed control was 4.0, which indicates an average sleeping level, whereas the mean sleep-satisfaction score from the room with the IoT-based control was 5.6, which is between the levels "slept quite well" and "slept very well." The individual analysis of the results shows that 7 of the 10 subjects reported better sleep satisfaction in the room equipped with IoT-based control than in the one with the fixed control.Only one subject reported sleeping better in the room with fixed control, and the remaining two subjects expressed no differences in the sleep satisfaction levels offered by the two rooms.The average score of the subjects who expressed better satisfaction with the IoT-based control was 1.4 points higher than that of the single subject who felt more satisfied in the room with the fixed thermal control.
Figure 4 shows the responses to the survey question, "Did you sleep well?"These responses were graded on a four-point scale on which 1 indicated that the subjects did not sleep well, 2 indicated a slight satisfaction with the quality of sleep, and 3 and 4 indicated a moderate and high satisfaction, respectively.We found that the average score was 19% higher in the room with the IoT-based control than in the room with the fixed control, which was statistically significant (Z = −1.730,p = 0.078).Of the 10 subjects in the fixed control environment, 7 experienced moderately good sleep quality (three points), and 3 subjects experienced slightly good sleep quality (two points).The mean score was therefore 2.8, indicating moderate sleep satisfaction.When the same subjects slept in the room with the IoT-based control, half reported high sleep quality (four points), four subjects reported moderate sleep quality (three points), and the remaining subject reported slightly good sleep quality (two points).The mean score, therefore, was 3.4, indicating that the overall sleep satisfaction level in the room with the IoT-based control was between moderate and high.
respectively.We found that the average score was 19% higher in the room with the IoT-based control than in the room with the fixed control, which was statistically significant (Z = −1.730,p = 0.078).Of the 10 subjects in the fixed control environment, 7 experienced moderately good sleep quality (three points), and 3 subjects experienced slightly good sleep quality (two points).The mean score was therefore 2.8, indicating moderate sleep satisfaction.When the same subjects slept in the room with the IoT-based control, half reported high sleep quality (four points), four subjects reported moderate sleep quality (three points), and the remaining subject reported slightly good sleep quality (two points).The mean score, therefore, was 3.4, indicating that the overall sleep satisfaction level in the room with the IoT-based control was between moderate and high.
In comparing the two sleeping environments, seven of the subjects indicated that they slept better in the room with the IoT-based control than in the room with the fixed thermal control; one subject expressed better sleep satisfaction in the room with the fixed control, and the remaining two subjects experienced no difference between the rooms.In regard to the actual satisfaction levels, half of the subjects in the room with the IoT-based control reported high satisfaction with their sleep quality (four points).For the room with the fixed thermal control, however, 7 of the 10 subjects rated their sleep quality as moderately satisfactory (three points).Four of the subjects reported deeper sleep in the room with the IoT-based control than in the room with the fixed control, and one subject reported deeper sleep in the room with the fixed thermal system.The remaining subjects expressed no difference between the rooms in terms of deep sleep.In In comparing the two sleeping environments, seven of the subjects indicated that they slept better in the room with the IoT-based control than in the room with the fixed thermal control; one subject expressed better sleep satisfaction in the room with the fixed control, and the remaining two subjects experienced no difference between the rooms.In regard to the actual satisfaction levels, half of the subjects in the room with the IoT-based control reported high satisfaction with their sleep quality (four points).For the room with the fixed thermal control, however, 7 of the 10 subjects rated their sleep quality as moderately satisfactory (three points).
Figure 5 shows the responses to the survey question, "Did you have deep sleep?"The responses were rated on a four-point scale with 1 indicating that the subjects did not experience deep sleep and 4 indicating very deep sleep.The results show that the mean deep-sleep satisfaction in the room with the IoT-based control was 23% higher than in the room with the fixed control, which was statistically significant (Z = −1.841,p = 0.063).
A closer look at the individual responses shows that 6 of the 10 subjects in the room with the fixed thermal control gave their deep-sleep satisfaction three points, indicating moderately deep sleep; 2 subjects gave their deep-sleep satisfaction two points, indicating slightly deep sleep; 1 subject reported no deep sleep, and 1 subject reported very deep sleep.The mean score of the subjects was 2.67, which indicates moderate deep-sleep satisfaction overall.
In the room wired with the IoT-based control, half of the subjects reported four points on the deep-sleep scale, indicating very deep sleep; three of the subjects reported three points on the scale, indicating moderately deep sleep, and one person reported slightly deep sleep.The mean score of all subjects was 3.4, indicating a deep-sleep satisfaction level between moderate and very deep.
Four of the subjects reported deeper sleep in the room with the IoT-based control than in the room with the fixed control, and one subject reported deeper sleep in the room with the fixed thermal system.The remaining subjects expressed no difference between the rooms in terms of deep sleep.In the room equipped with the IoT-based control, five subjects gave their deep-sleep satisfaction level four points, whereas in the room with the fixed thermal control, six subjects gave their deep-sleep satisfaction level three points.This outcome also highlights that the overall satisfaction level of the subjects was much higher in the room equipped with the IoT-based control than in the room with the fixed thermal control.the room equipped with the IoT-based control, five subjects gave their deep-sleep satisfaction level four points, whereas in the room with the fixed thermal control, six subjects gave their deep-sleep satisfaction level three points.This outcome also highlights that the overall satisfaction level of the subjects was much higher in the room equipped with the IoT-based control than in the room with the fixed thermal control.Figure 6 reports the responses to the survey question, "Did you have difficulty falling asleep?"The responses were rated on a four-point scale on which 1 indicated no difficulty in falling asleep and 4 indicated great difficulty in falling asleep.The results show that the overall mean score from the room equipped with the IoT-based thermal control was 40% lower than that from the room with the fixed thermal control, but that difference was not statistically significant (Z = −1.633,p = 0.125).
A more detailed look at the results shows that in the room equipped with the fixed thermal control, six of the subjects rated their level of difficulty in falling asleep as a 1 on the scale, which indicated no difficulty in falling asleep; two subjects gave their difficulty in falling asleep three points, which expressed moderate difficulty in falling asleep; and the remaining two subjects answered this question with two points, indicating slight difficulty in falling asleep.The overall mean score was therefore 1.6, indicating between no and slight difficulty in falling asleep.In the room with the IoTbased control, eight of the subjects answered with one point, indicating no difficulty in falling asleep, and one person answered with two points, indicating a slight difficulty in falling asleep.Thus, the overall mean score for this group was 1.1, nearly no difficulty in falling asleep.
Three of the subjects reported more difficulty falling asleep in the room with the fixed control than in the room with the IoT-based control.The remaining subjects reported no difference in the level of difficulty falling asleep between the two rooms.The highest number of subjects rated their level of difficulty in falling asleep as a 1 on the scale in both rooms.However, a slightly higher number of subjects reported one point in the room equipped with the IoT-based control (8 out of 9) than in the room with the fixed control (6 out of 10). Figure 6 reports the responses to the survey question, "Did you have difficulty falling asleep?"The responses were rated on a four-point scale on which 1 indicated no difficulty in falling asleep and 4 indicated great difficulty in falling asleep.The results show that the overall mean score from the room equipped with the IoT-based thermal control was 40% lower than that from the room with the fixed thermal control, but that difference was not statistically significant (Z = −1.633,p = 0.125).Figure 7 shows the subjects' responses to the question, "Did you have difficulty staying asleep?"The responses were rated on a scale of 1-4, where 1 indicated no difficulty in staying asleep and 4 indicated great difficulty in staying asleep.The results show that the mean score from the room with the IoT-based control was 40% lower than the mean score from the room with the fixed thermal control, which was statistically significant (Z = −2.000,p = 0.063).
The responses from the room with the fixed control varied between one and two points on the scale, indicating no or slight difficulty in staying asleep, for an overall rating of 1.56.On the other hand, the responses from the room with the IoT-based control were mostly one point; only one subject A more detailed look at the results shows that in the room equipped with the fixed thermal control, six of the subjects rated their level of difficulty in falling asleep as a 1 on the scale, which indicated no difficulty in falling asleep; two subjects gave their difficulty in falling asleep three points, which expressed moderate difficulty in falling asleep; and the remaining two subjects answered this question with two points, indicating slight difficulty in falling asleep.The overall mean score was therefore 1.6, indicating between no and slight difficulty in falling asleep.In the room with the IoT-based control, eight of the subjects answered with one point, indicating no difficulty in falling asleep, and one person answered with two points, indicating a slight difficulty in falling asleep.Thus, the overall mean score for this group was 1.1, nearly no difficulty in falling asleep.
Three of the subjects reported more difficulty falling asleep in the room with the fixed control than in the room with the IoT-based control.The remaining subjects reported no difference in the level of difficulty falling asleep between the two rooms.The highest number of subjects rated their level of difficulty in falling asleep as a 1 on the scale in both rooms.However, a slightly higher number of subjects reported one point in the room equipped with the IoT-based control (8 out of 9) than in the room with the fixed control (6 out of 10).
Figure 7 shows the subjects' responses to the question, "Did you have difficulty staying asleep?"The responses were rated on a scale of 1-4, where 1 indicated no difficulty in staying asleep and 4 indicated great difficulty in staying asleep.The results show that the mean score from the room with the IoT-based control was 40% lower than the mean score from the room with the fixed thermal control, which was statistically significant (Z = −2.000,p = 0.063).Figure 7 shows the subjects' responses to the question, "Did you have difficulty staying asleep?"The responses were rated on a scale of 1-4, where 1 indicated no difficulty in staying asleep and 4 indicated great difficulty in staying asleep.The results show that the mean score from the room with the IoT-based control was 40% lower than the mean score from the room with the fixed thermal control, which was statistically significant (Z = −2.000,p = 0.063).
The responses from the room with the fixed control varied between one and two points on the scale, indicating no or slight difficulty in staying asleep, for an overall rating of 1.56.On the other hand, the responses from the room with the IoT-based control were mostly one point; only one subject in that room answered this question with two points.The overall rating score, therefore, was 1.11.
Four of the subjects found the room with the IoT-based control more comfortable than the room with the fixed control.The remaining subjects expressed no difference in the comfort levels offered by the two rooms.Furthermore, eight out of nine subjects in the room equipped with the IoT-based control responded with one point, indicating that most subjects experienced no difficulty in staying asleep.On the other hand, half the subjects in the room in the fixed control responded with two points, indicating slight difficulty in staying asleep.
IoT-based control was 19% higher than that for the room with the fixed thermal control, which was statistically significant (Z = −2.236,p = 0.031).
the subjects generally felt moderately refreshed.
Five of the subjects reported feeling more refreshed after sleeping in the room with the IoT-based control than after sleeping in the room with the fixed thermal control.The other subjects found no difference in how they felt after sleeping in the two sleeping environments.No subjects reported feeling more refreshed after sleeping in the room with the fixed thermal control than after sleeping in the room with the IoT-based control.After sleeping in the room with the fixed control, most subjects provided a three-or two-point response, indicating that they felt moderately or slightly refreshed.On the other hand, after sleeping in the room with the IoT-based control, all the subjects except one provided a three-point response, showing that they generally felt moderately refreshed.Figure 9 shows the responses to the question, "How often did you wake up during the night?"The responses were given on a five-point scale, with 0 indicating that the subjects did not wake up during the night and 5 indicating that the subjects woke up five times during the night.When we compared the mean number of awakenings, we found that the subjects awoke during the night 91% For the room with the fixed thermal control, four of the subjects answered with three points on the scale, indicating that they felt moderately refreshed; five subjects rated their after-sleep feeling with two points, showing that they felt slightly refreshed; and one person rated his after-sleep feeling with one point, indicating dissatisfaction.The overall rating, therefore, was 2.3, indicating that the subjects generally felt slightly refreshed after sleeping in the room with fixed thermal control.
After sleeping in the room equipped with the IoT-based control, eight of the subjects answered with three points on the scale, indicating that they felt moderately refreshed, and one person rated their after-sleep feeling with two points, indicating that they felt slightly refreshed.The mean score of the subjects from the room equipped with the IoT-based control was therefore 2.89, indicating that the subjects generally felt moderately refreshed.
Five of the subjects reported feeling more refreshed after sleeping in the room with the IoT-based control than after sleeping in the room with the fixed thermal control.The other subjects found no difference in how they felt after sleeping in the two sleeping environments.No subjects reported feeling more refreshed after sleeping in the room with the fixed thermal control than after sleeping in the room with the IoT-based control.After sleeping in the room with the fixed control, most subjects provided a three-or two-point response, indicating that they felt moderately or slightly refreshed.On the other hand, after sleeping in the room with the IoT-based control, all the subjects except one provided a three-point response, showing that they generally felt moderately refreshed.
Figure 9 shows the responses to the question, "How often did you wake up during the night?"The responses were given on a five-point scale, with 0 indicating that the subjects did not wake up during the night and 5 indicating that the subjects woke up five times during the night.When we compared the mean number of awakenings, we found that the subjects awoke during the night 91% more often when sleeping in the room with the fixed control than when sleeping in the room with the IoT-based control, which was statistically significant (Z = −1.897,p = 0.045).
more often when sleeping in the room with the fixed control than when sleeping in the room with the IoT-based control, which was statistically significant (Z = −1.897,p = 0.045).The average number of times that the subjects awoke when sleeping in the room with fixed thermal control was 2.33.On the other hand, the average number of times that the subjects awoke when sleeping in the room with the IoT-based thermal control was 1.22.
Eight of the subjects indicated that they woke up more often when sleeping in the room with the fixed thermal control than when sleeping in the room with the IoT-based control.The collected reports indicate that the subjects woke up an average of 1.7 more times when sleeping in the room with fixed thermal control than in the room with the IoT-based control.Only a single subject reported having woken up more times in the room with IoT-based control than in the room with fixed thermal control.

Discussion and Conclusions
Scientific studies have reported the role of core body temperature in human circadian rhythms and sleep quality [37,51].The general conclusion from those studies is that an appropriate thermal environment is essential for high-quality sleep [15].Whereas many studies have considered the effect of the thermal environment on physiological responses during sleep [9], few studies have considered the effects of the thermal environment during different sleep phases.In addition, most of the existing studies relate to sleeping disorders or sleep deprivation, and they have been commonly carried out in clinical research laboratories.Consequently, the results from such studies are not fully applicable to healthy individuals in normal sleeping conditions.Therefore, we conducted experimental research on 10 working males to study the effect of thermal environment on subjective sleep quality in a regular home environment.Wireless sensors were used to estimate the sleeping stages of the subjects.In turn, the room's air temperature was automatically varied in real time using a developed algorithm to facilitate continued sleep at different sleep stages.This approach was compared to the traditional approach to controlling the thermal environment for sleeping subjects, maintaining a fixed air temperature throughout the night.
Our results, based on self-rating subjective scales, indicate that the sleep quality of the subjects was generally higher in the room with the dynamic thermal control than in the room with static temperature levels.For example, subjects reported having had shorter sleep-onset latency in the room The average number of times that the subjects awoke when sleeping in the room with fixed thermal control was 2.33.On the other hand, the average number of times that the subjects awoke when sleeping in the room with the IoT-based thermal control was 1.22.
Eight of the subjects indicated that they woke up more often when sleeping in the room with the fixed thermal control than when sleeping in the room with the IoT-based control.The collected reports indicate that the subjects woke up an average of 1.7 more times when sleeping in the room with fixed thermal control than in the room with the IoT-based control.Only a single subject reported having woken up more times in the room with IoT-based control than in the room with fixed thermal control.

Discussion and Conclusions
Scientific studies have reported the role of core body temperature in human circadian rhythms and sleep quality [37,51].The general conclusion from those studies is that an appropriate thermal environment is essential for high-quality sleep [15].Whereas many studies have considered the effect of the thermal environment on physiological responses during sleep [9], few studies have considered the effects of the thermal environment during different sleep phases.In addition, most of the existing studies relate to sleeping disorders or sleep deprivation, and they have been commonly carried out in clinical research laboratories.Consequently, the results from such studies are not fully applicable to healthy individuals in normal sleeping conditions.Therefore, we conducted experimental research on 10 working males to study the effect of thermal environment on subjective sleep quality in a regular home environment.Wireless sensors were used to estimate the sleeping stages of the subjects.In turn, the room's air temperature was automatically varied in real time using a developed algorithm to facilitate continued sleep at different sleep stages.This approach was compared to the traditional approach to controlling the thermal environment for sleeping subjects, maintaining a fixed air temperature throughout the night.
Our results, based on self-rating subjective scales, indicate that the sleep quality of the subjects was generally higher in the room with the dynamic thermal control than in the room with static temperature levels.For example, subjects reported having had shorter sleep-onset latency in the room equipped with the IoT-based thermal control than in the one with fixed control.In addition, they felt more refreshed the next morning than they did after sleeping in the fixed control room (Figure 8).
Our results confirm that low temperatures (20-26 • C) are appropriate in the waking phase of sleep.However, as a person progresses from the waking phase to the REM phase, a mild increase in temperature is required to facilitate uninterrupted deep sleep.This outcome is consistent with previous studies that found that a mild to moderate increase in ambient temperature was conducive to prolonged deep sleep phases [52,53].Consequently, the neutral bedroom temperature recommendations from numerous institutions, such as the European standard (21-25.5 • C) [12], might not effectively provide sufficient sleep quality.Further evidence is provided by several studies that reported experiences of poor sleep quality resulting from thermal dissatisfaction while sleeping in air-conditioned bedrooms [13,14].A possible explanation for the widely experienced sleep quality issues in air-conditioned bedrooms is that people set their sleeping thermal environment based on their thermal sensation in the waking state.However, as shown by scientific studies, different air temperature conditions at different sleep stages are needed to facilitate good sleep [52,53].Our study thus illustrates the potential use of IoT-based sensors to identify sleep stages and use that information to adjust the thermal conditions in real time to keep them conducive to good sleep.
In addition, as mentioned in the introduction, traditional methods of data collection in sleep studies (i.e., PSG and actigraphy) are expensive and require the presence of trained personnel.In that regard, our study used a novel approach for data collection based on the IoT.We thus demonstrated the availability of IoT-based methodologies as an alternative research tool for sleep-related studies, especially studies of healthy subjects in regular home sleeping environments.
In addition, although the subject of thermal comfort in waking people has been well discussed in the literature and the resulting theory is well represented in practice [54], thermal comfort for sleeping subjects has still not been well established in theory or practice.For example, the temperature setpoint values for bedrooms recommended by the EN 15251 [12] are primarily based on a metabolic rate assumption of 1.2 met and fixed clothing insulation levels for different seasons (i.e., 0.5 clo in summer and 1 clo in winter).These two assumptions are rather unrealistic for healthy people in regular sleeping environments.Our study, therefore, illustrates the potential of integrating IoT systems into building control systems to achieve thermal environments appropriate for sleeping occupants.Such a system is also likely to offer substantial cooling/heating energy reductions, in addition to providing a favorable sleeping environment at night [55].Future research should, therefore, further explore the energy-saving benefits of integrating IoT systems (i.e., temperature regulating systems) into building control systems at night.
It is worth noting that our study has certain limitations.For example, we used only 10 subjects.Although the use of few subjects is common in sleep-related studies, only a large number of study subjects can provide sufficient data to determine causal relationships between study variables.Therefore, future studies should use larger samples in the evaluation of sleep quality.Additionally, our study subjects were all working males of a particular age group (average age 23.5 years).However, age and gender are critical elements in the thermoregulatory responses of the body [56] and thus influence sleep quality.Future studies should, therefore, assess the effects of thermal environment on sleep stages among subjects of different genders and age groups.Furthermore, the current study is based on data collected during the summer season.Future studies should explore the sleep quality and energy-saving benefits offered by IoT-based thermal control systems on, for instance, an annual basis.

Figure 1 .
Figure 1.Setpoint temperature of the air conditioner in response to sleep stage.

Figure 1 .
Figure 1.Setpoint temperature of the air conditioner in response to sleep stage.

Figure 3 .
Figure 3.Comparison of questionnaire responses to the question, "How well did you sleep?"

Figure 3 .
Figure 3.Comparison of questionnaire responses to the question, "How well did you sleep?"

Figure 4 .Figure 5
Figure 4. Comparison of questionnaire responses to the question, "Did you sleep well?"

Figure 4 .
Figure 4. Comparison of questionnaire responses to the question, "Did you sleep well?"

Figure 5 .
Figure 5.Comparison of questionnaire responses to the question, "Did you have deep sleep?"

Figure 5 .
Figure 5.Comparison of questionnaire responses to the question, "Did you have deep sleep?"

Figure 6 .
Figure 6.Comparison of questionnaire responses to the question, "Did you have difficulty falling asleep?"

Figure 6 .
Figure 6.Comparison of questionnaire responses to the question, "Did you have difficulty falling asleep?"

Figure 6 .
Figure 6.Comparison of questionnaire responses to the question, "Did you have difficulty falling asleep?"

Figure 8 .
Figure 8.Comparison of questionnaire responses to the question, "Do you feel refreshed after sleeping?"

Figure 9 .
Figure 9.Comparison of questionnaire responses to the question, "How often did you wake up during the night?"

Figure 9 .
Figure 9.Comparison of questionnaire responses to the question, "How often did you wake up during the night?"

Table 1 .
Thermal neutral temperatures reported in previous studies.

Table 2 .
Questions used to assess subjective sleep quality.

Table 2 .
Questions used to assess subjective sleep quality.