POST UPDATED on 2018/11/26 with a new feature: Sleep time estimate.
There is a large and growing interest from you, users of Sleep as Android, in automatic fall asleep detection.
Sleep as Android can estimate your sleep time. But there is no reliable way yet to do fall asleep detection on smartphones.
What? Others have fall asleep detection, you pesky liars!
The truth is, others do not have it. They claim it in their marketing materials, and they also trigger their sleep tracking at certain times. But more often than not, you are not really sleeping at those times.
Heck, you are often not even using the device.
Why is that?
To detect falling asleep reliably is a really tough task. There’s a reason why Apple currently makes big waves with their new detection mechanisms like trying to estimate your daily routine and detect your before-bed rituals like toothbrushing.
Because it is next to impossible to detect a sleeping person using just an accelerometer and/or heart beat sensor.
What are the issues?
A large problem is distinguishing between a sleeping person and a person lying in the bed calmly, but awake. For example, someone reading or doing something on a smartphone.
The other issue is battery drain. To detect when you fall asleep, we’d need to monitor your movements for the whole day. Reading accelerometric data on an app level would kill your phone’s battery in just a few hours.
So what does Sleep as Android do?
At this moment we are using the Google Activity recognition API which gives us data about phone states and estimates your current activity. We run the data through our own algorithms to increase reliabililty and reduce false positives. Then we ask you to confirm the sleep duration estimate, and if all checks pass, you get a new sleep record without manually tracking!
We are still actively researching cutting edge methods that we could use or combine to reliably detect falling asleep.