With smartphones, tablets and smart watches glowing and buzzing on our night stands, it's no wonder that low-quality sleep has become a public health problem. Sleep-monitoring apps for smartphones can help.
One app that has given me good results is SleepBot (free on iOS and Android), which has provided insights into my sleeping habits and helped me work out the distractions and habits that seem to mar my sleep.
As with many other sleep apps, you set an alarm time, then slide your phone under your pillow while keeping the phone plugged in to your charger so you don't wake up to a drained battery. As you shift through various stages of sleep during the night, SleepBot logs your body's moves.
When it's time for your alarm to go off, SleepBot waits until your phone's sensors detect that you're moving more, which means you are probably in a period of light sleep. Then it sets off your alarm.
More ...
http://www.nytimes.com/2016/07/07/technology/personaltech/a-snooze-worthy-app-collection-to-add-to-the-smartphone.html?