Impact of Environmental Conditions on Sleep Quality

Data Science, Research

Making Sense of Sensors (DAB100)

2022

Thumbnail image

Summary

This research project investigated how indoor environmental conditions, specifically temperature, humidity, and light intensity, relate to physiological responses during sleep. Heart rate was used as a measurable proxy for sleep quality.


Our team developed a data-collection setup combining a YODL environmental sensing kit with Xiaomi Band 6 fitness trackers. The environmental sensors recorded temperature, humidity, and light levels near each participant’s sleeping area, while the wristbands measured heart rate throughout the night. Participants also maintained personal logbooks to document factors such as stress, alcohol consumption, and unusual sleep schedules.


The study initially involved five participants, with data collected over a minimum of 21 days. One participant’s environmental data was excluded because of sensor corruption. The remaining datasets were cleaned, standardized, resampled, and merged in Python using timestamp-based processing. Since the environmental sensors recorded data every ten seconds and the fitness trackers recorded heart rate every minute, the environmental measurements were averaged into one-minute intervals before analysis.


We used Jupyter Notebook and Python to perform exploratory data analysis, correlation testing, linear regression, t-tests, and ANOVA. Visualizations included participant heart-rate boxplots, scatter plots, regression lines, and correlation heatmaps.

The analysis found weak but statistically significant relationships between the measured environmental factors and sleeping heart rate. Higher temperatures and greater light intensity were associated with slightly increased heart rates, while humidity showed a weak negative relationship. Temperature produced the most consistent pattern across participants, whereas the effects of light and humidity varied considerably between individuals.


The project also highlighted several limitations, including the small participant sample, inconsistent wearable-sensor accuracy, limited variation in bedroom conditions, sensor-placement differences, and the use of heart rate alone as a proxy for sleep quality. These findings demonstrated the importance of careful sensor calibration, reliable data collection, contextual participant information, and cautious interpretation of statistical significance.

Sample project image
Sample project image
Sample project image
Sample project image
Sample project image
Sample project image
Sample project image

oskarmalage@gmail.com

oskarmalage@gmail.com

oskarmalage@gmail.com