Summary

Drowsiness, whether it lasts for a single post-hackathon Monday or a lifetime of going to bed a little bit too late, can be a huge annoyance. Before now, if you were tired enough to fall asleep accidentally with the TV on, while in class, or on the road, there wasn't anything you could do about it. Now, however, with the help of wearable technologies and the Internet of Things, Wake will detect when you unintentionally fall asleep and enable your environment to respond intelligently -- pausing your TV show, gently nudging you to wake up in class without alerting those around you, or sounding emergency alarms if you doze off behind the wheel.

At Home

Sometimes falling asleep isn't the problem, but rather the housekeeping tasks that go undone when you nod off early. Did you turn all the lights off? Did you lock the door? Depending on electricity costs and neighborhood safety, failing to do these things can be problematic. Therefore when Wake detects that you have fallen asleep while relaxing at home, it sends a message to the SmartThings home hub, which wirelessly turns off all lights attached to its SmartThings SmartPower outlets and locks the network-connected door lock. Falling asleep while the television is playing is also a common problem. According to Sleep Review: The Journal for Sleep Specialists, 61% of Americans fall asleep with the TV on [1]. This wastes electricity, leads to poor sleep quality [2], and means that the viewer misses the rest of the show after he or she falls asleep. With Wake and DirecTV, however, the television pauses and eventually goes into standby mode as soon as you fall asleep, saving electricity, giving you a more restful night's sleep, and making sure you can resume your TV programs right where you left off.

Daytime

Some of our daytime activities can be less than exciting. One study found that 28% of high school students fall asleep in class at least once per week [3], and many adults find it difficult to stay awake during work meetings. Unlike situations like doing homework, however, audio alarms cannot be used, since they would disrupt people around you and reveal the potentially embarrassing fact that you were sleeping. Therefore instead of a typical alarm Wake has integrated a vibrating wrist alarm with the Pebble smart watch, so that you can be woken up without letting everyone around you know that you fell asleep. Wake uses integration with Google Calendar to determine whether you are in an event and should be woken up with this subtle method.

Driving

Driving while drowsy is dangerous, conservatively accounting for 100,000 car crashes per year in the United States, but more than 60% of drivers continue to do it. [3] Wake detects nodding off at the wheel, and counters with an audio and tactile alarm system for maximum impact. We use a headband-mounted Pebble smart watch to detect head nodding for close-to-real-time sleep detection, then use Twilio to call your phone and Pebble watch to vibrate in order to wake you up.

Sensing Sleep

In an enterprise-grade version of our solution, sleep detection would likely use a combination of an eye tracking device and a pulse oximeter, both expensive pieces of hardware with few customization opportunities at this time. Instead of buying (and expecting our users to buy and carry around) these new devices, we combined a Pebble watch with a FitBit fitness tracker, both wearable technologies that are already integrated into our lives. When the user wants to be alerted of sleep as quickly as possible, e.g. as soon as their head nods while driving, we ask the user to clip the Pebble to a headband or directly to their hair so we can detect the position of their head with the Pebble's accelerometer. When the user wants a less intrusive, higher latency solution we subscribe to FitBit's data to find out when they fall asleep. Depending on the model, the FitBit detects sleep through motion sensing or a combination of motion sensing and heart rate monitoring.

Technical Details

Our system has three applications that interface with several different APIs. First and foremost, we have a Ruby on Rails web app hosted on Heroku and written in Ruby and JavaScript that acts as an API by serving the data and queries to the APIs, along with a mobile web interface that acts as the main user interface. We also have a native Pebble app written in C and JavaScript in order to capture data and send commands between the Pebble interface and Ruby on Rails app. Finally, we built a Groovy web app hosted by SmartThings in order to interact with their hub and peripherals. In addition to the applications, we interact with many different APIs. In order to control the DirecTV, we use their set-top box APIs. In order to detect whether the user is in a meeting/class, we use the Google Calendar API. In order to create a non-platform-specific audio alert, we use the Twilio API to call the user's phone as a form of alarm. Finally, we use the FitBit API to gather data from that platform. To demonstrate our application in the hackathon setting, we have two silly extra hacks. One is a wide cloth headband with a metal hair clip and two bobby pins to attach the Pebble watch to the user's head. The second is an Arduino application with blinking LEDs to represent the light in a house, since we couldn't find a lamp or night light to demonstrate the utility of the SmartThings SmartPower outlet.

  1. http://www.sleepreviewmag.com/2014/07/nearly-two-thirds-fall-asleep-tv/
  2. http://sleepfoundation.org/sleep-news/lights-out-good-nights-sleep
  3. http://sleepfoundation.org/sites/default/files/2006_summary_of_findings.pdf
Share this project:

Updates