Inspiration

Our inspiration was the creators of this hackathon, and the biggest battle they face. There are countless days when we wake up feeling tired and wish we had the energy to go to the gym or get work done before class. On the path to success, tiredness can be the most devastating roadblock. One small fix to our routines can change this. Sleep is divided into stages that comprise 90-minute recurring cycles, comprised by three stages of progressively deeper sleep followed by REM sleep. Many people are rudely awakened during their deeper stages of sleep due to the unfortunate timing of alarms, potentially hindering memory consolidation and embarking on their day with a negative mood. Research shows that waking up during the Stage 1 sleep (the lightest stage of sleep) is the optimal time to wake up feeling rested and ready to kickstart the day.

With this in mind, we invented the SleepSmart pillow. The SleepSmart pillow measures heart rate characteristics from your sleep cycle to time gentle vibrations upon reaching light sleep around your natural wake time.

What it does

The SleepSmart pillow utilizes sleep variables like heart rate variability (HRV) and user sleep range preference to predict the user's Stage 1 sleep within a self-adjusted range of wake-up times.

Features

1. Measures Sleep stages using heart rate variability

HRV is a measurement of the relative variation in time between heartbeats. During sleep, heart rate variability increases into deep sleep, and decreases during light sleep. In other words, we see more regularly-timed heartbeats during light sleep. This pattern allows us to distinguish between stages using a heart rate monitor.

2. Set the Preferred range of wake-up time

As aforementioned, the brain enters stage 1 sleep multiple times throughout the night upon the start of a new sleep cycle. Since we do not want to wake the user during the stage 1 they experience in the middle of the night, we let the user choose a wake-up time range so that their awakening falls within their desired range.

3. Hard wake-up time after the range passed

If the user has not entered stage 1 in that period, then after the period ends, the vibrations do go off and will wake you up no matter what.

4. Physical alarm guarantees a wake-up

Unlike phone alarms that can be distracting right in the morning and "snoozable", the SleepSmart pillow alarm has a one-time, deliberate feature to ensure you are awake if you skip the inputted wake-up period.

How we built it

We used 4 components to bring this project to life:

  1. A Microcontroller (Arduino Uno R3)

  2. OLED Display

  3. Heart Rate Monitor (GY MAX30102)

  4. Vibrators ( NFP-FLAT-C0720)

The Arduino Uno R3 was chosen due to its ease of use and the team's experience in C over Python. The Microcontroller connects to the heart rate monitor, button, OLED display, and vibrational motors.

Challenges we ran into

Heart-Rate Monitor (HRM)

Configuring the heart rate monitor was tedious and took most of our 36 hours. The lack of knowledge of how different electronics work made it hard to work with them. We also had to test that parts were functional in the first place. After preliminary coding and multiple trials of confusions, we learned that the monitor we were using was malfunctioning. After swapping it out and fixing multiple lines of code, the monitor started to run. The next challenge was to have as much accuracy in the reading as possible. This meant stabilizing the component, changing the way we compute data, and sometimes reducing visible light.

Finding parts and Compatibility

This was a big problem for us at the beginning. We were struggling to get parts we wanted, parts that were compatible with each other. After a lot of compromises, we decided to do this project.

Coming up with an idea

With so many amazing things we wanted to do, there's only so much time and resources available. It was a challenge to figure out what we really wanted to do. We spent almost 6-7 hours just to figure out what we want to do, and then figuring out parts took another 6-7 hours.

What we learned

How to research and learn about the parts we need and how they work. How to wire stuff together and effectively use the Arduino Uno.

What's next for SleepSmart

The gold standard of measuring sleep stages is polysomnography (PSG), which directly measures electrical differences in brain waves throughout the sleep stages. In further development of our project, we hope to include aspects of PSG to make a more accurate prediction of stage 1 sleep. We will also consolidate all electronics to one PCB, and clean up wiring. Finally, building a safe case with a battery pack included so that it can last without the computer and fully negate the risk of overheating in the pillow case.

References

Boudreau, P., Yeh, W.-H., Dumont, G. A., & Boivin, D. B. (2013). Circadian Variation of Heart Rate Variability Across Sleep Stages. Sleep, 36(12), 1919–1928. https://doi.org/10.5665/sleep.3230

Naitoh, P., Kelly, T., & Babkoff, H. (1993). Sleep inertia: best time not to wake up? Chronobiology International, 10(2), 109–118. https://doi.org/10.1080/07420529309059699

Suni, E. (2023, December 8). Stages of sleep: What happens in a sleep cycle. Sleep Foundation; Sleep Foundation. https://www.sleepfoundation.org/stages-of-sleep

Built With

  • arduino
  • c
  • esp32
  • gy-max30102
  • nfp-flat-c0720
  • oled
Share this project:

Updates