Sleep tracking
Sleep tracking is a way to objectively measure the quality of your sleep.
By tracking your sleep, the app enables you to:
-
See a sleep graph for every night
-
Monitor your long term sleep quality (with sleep score and statistics )
-
Set up goals to improve your sleep quality
-
Use smart wake up for a pleasant wake up experience
|
See Sleep tracking theory for a more in-depth information on how sleep tracking works. |
Sleep tracking settings can be found in Settings → Sleep tracking.
- 1. Awake detection
- 2. Automatic sleep tracking
- 3. Sensor
- 4. Wearables
- 5. Pair tracking
- 6. Test sensor
- 7. Lullabies
- 8. Lucid dreaming
- 9. Screen dimming
- 10. Jet lag prevention
- 11. Do not disturb when sleeping
- 12. Priority mode
- 13. Stand-by
- 14. Battery optimized
- 15. Tracking screen
- 16. How to track sleep
2. Automatic sleep tracking
Options for automatic tracking, see details at Automatic sleep tracking
3. Sensor
Choose a sensor that will be used for motion tracking when you track using phone (ie. without wearables or Sleep Phaser). Read more about the available Sensors.
4. Wearables
Chose your wearable as the sleep tracking sensor. See details on wearables here. If wearable is selected and paired, the app will NOT use the phone’s sensors.
5. Pair tracking
More details: Pair tracking.
6. Test sensor
Test if your chosen sensor (Sonar or Accelerometer) is working correctly. See details at Sensors chapter.
7. Lullabies
Play calming melodies, audiobooks, or meditations to help you fall asleep. Details at Lullabies.
8. Lucid dreaming
Technique for controlling the dreams - see here for more info.
9. Screen dimming
Controls what will happen to the phone screen while sleep tracking.
Sleep does nothing, your system screen timeout applies
Screen dims, your system screen timeout applies
Screen dims, shows time, your system screen timeout applies
Screen dims, shows time, your system timeout DOES NOT apply
|
Always on clock will keep your screen on all night which will significantly affect battery consumption. |
10. Jet lag prevention
Technique for controlling the dreams - see here for more info.
11. Do not disturb when sleeping
If checked, do not disturb (DND) mode will be enabled during sleep tracking, and disabled again when sleep tracking ends.
Note the following special rules:
- if DND was active before sleep tracking started, Sleep will not touch it (ie. it won’t disable it in the morning)
- if DND was activated by Sleep, but you have toggled it during the sleep tracking, Sleep will not touch it again
12. Priority mode
Enables Priority DND - this mode allows using customizable exceptions, for example emergency contacts will get through even when DND is activated.
13. Stand-by
Sleep tracking will be put into standby mode when battery drops under level set here. No further sleep data will be collected. This saves battery for the alarm.
14. Battery optimized
This option will enable accelerometer sensor batching, if it is available on your phone. This means that the phone
does not have to have CPU awake all night to be able to read data from the sensor.
|
Due to Doze mode, starting from Android 6 we need to schedule a user-visible alarm every minute to be able to use sensor batching. This alarm will never ring, but will be visible on your status bar and lockscreen. |
15. Tracking screen
Figure 1, “Sleep tracking screen elements” shows common elements of the tracking screen
-
Show the progress of the current sleep track from start to alarm time, is only shown if there is an alarm in the next 24 hours.
-
Elapsed tracking time
-
Current time
-
Top right actions
-
Pausing
sleep tracking when you are awake, see Awake detection.
-
Play lullabies
for faster fall asleep, see Lullabies.
-
Stop tracking
, this will show a confirmation dialog whether you like to delete the record or save it.
-
-
If Noise recording is enabled, you will see an recording indicator, with current volume and the Recording volume threshold.
-
Shows your next alarm or a range in case of Smart wake up and beneath you can see further instructions depending on your settings
-
Action
to comment or tag your sleep graph and turn on your flash light
to e.g. navigate to the toilet.
In case you have configured Smartlight, the Pee-light option will use it at minimum brightness (and red if possible) to help you to navigate the room. -
Running sleep tracking is always indicated in the status bar as an ongoing notification. Even after leaving the tracking screen you can always get back through this notification.

Sliding up the Stop and Save slider will bring up further options show in Figure 2, “Sleep tracking screen elements”.
-
Stop and save stops current sleep tracking and immediately saves it. This option is only accessible after the slide to neglect any risk of accidental stop.
-
Pee-light uses your phones flashlight or any connected Smartlight.
-
Save battery switches sleep tracking into a low power mode. In this mode tracking will consume minimum battery, but Noise recording will be stopped and no activity will be tracked using Sensors. This is useful if you don’t have much battery but still want to track the time of your sleep.

16. How to track sleep
Sleep is always tracked using one main sensor and optionally a handful of additional sensors.
16.1. Using accelerometer
Accelerometer is present on every phone. It measures its own movement - so the general idea is that your movements during sleep will move the phone.
In case of using accelerometer, the phone has to be on your mattress with you - when you move during the night, phone has to move with you.

The accuracy of measured data depends on how well your bed is able to transmit your movement to the phone.
Wearable device > Arm band > Spring mattress > Latex > Hard foam > Soft foam > Thick slow foam layer > 100% Slow foam
16.2. Using sonar
Sleep as Android enables you to use the phone’s microphone and speaker as a sonar (for range and movement detection using ultrasound). It works on a lot of phones, but not all (some are unable to produce or capture frequencies above human hearing range).
Read more about sonar and how we invented it.

16.3. Using other devices
You can also track sleep with additional devices like Sleep Phaser and wearables.
FAQ
The Sleep Duration is total sum of all your sleep phases (Light, REM, and Deep), not counting the awake phases - because when awake, you are actually not sleeping.
So on default settings, the Sleep duration is always a bit shorter than the duration of tracking.
If you wish your Sleep duration is the same as tracking duration:
-
Disable the awake detection in Settings → Sleep tracking → Awake detection.
-
You can also try to adjust the sensitivity of each type of settings to get optimal results. In most cases, too much awake periods are caused by significant HR peaks.
-
If you are not sure, where those awake periods come from, please use Left ☰ menu →
Support →
Report a bug, and send us the application log.
-
Enable the tracking in Settings → Sleep tracking → Wearables →Bluetooth Smart (might be hidden under Advanced section).
-
Try to pair with your device (this may not be required for all devices and OS versions).
-
Make sure no other app is using your device while sleep tracking.
If nothing helps please send us a debug report using Left ☰ menu → Support →
Report a bug..
|
BT Smart heart rate tracking only works from Android 4.3 onward |
We use a different input than polysomnographists, and define our own sleep phases, reflecting an objective aspect of sleep, easy to measure with common devices. One naturally needs to ask whether there is any relationship between the EEG-phases and our ACT-phases.
Fortunately, several research teams raised similar questions before (See this one, or this one, or this one, or this one). They measured a bunch of people on a traditional polysomnograph and recorded their physical activity at the same time (By filming them and then counting the movements manually, or by using accelerometer readings). The published analyses show that there indeed is a significant statistical relationship between EEG-phases and body movements.
You can also read about comparison of Sleep as Android algorithms and Sleep lab results on our blog here.
Battery saving mode currently resumes full tracking before the smart wake up period in order to find the best moment for your wake up, so the tracking uses up just a fraction of the battery consumption for the whole night. If the battery would drop under your defined stand-by threshold (default: 10%) the battery saving mode will re-occur.
Accelerometric sensors are really sensitive, which is great for sleep tracking. Normally, what you see when you leave the phone on the table gets immediately dwarfed when you do some more significant move. Just leave phone on the table for a while and you will see a dramatic development, but then move the phone and you will see all the development is really tiny in comparison to the new peak.
So what you see is random noise, given by very small vibrations of the table or in very calm areas by seismic movement. We mark the data relatively, so you always get it distinguished into light and deep sleep. But the algorithm works well only in conditions that are assumed by it, i.e. in the bed with relatively large movement peaks.
To be more specific, if you leave the phone on a table, you can get values perhaps on the scale of 0.000001 to 0.000009 m/s2 (The value is made up here, but it is physically very small). In the bed, you may get values from 1 to 9 m/s2 (which is physically large). The algorithm sees though just that the high value is 9 times higher than the low value, in both cases.
We had to do this because every accelerometer (in different cell phones) measures differently, so we couldn’t assume any standard conversion formula that would respond to absolute values.
So if you use the phone in the bed, it is in fact drastically different from measuring on a calm spot, just like the table.
Please do not hesitate to ask for any clarification at support@urbandroid.org. You can also read more about comparison of our data with the sleep lab results in this post.
This depends on several factors. The general rule is to not allow the pet to move your phone, ideally only your movements should move the device. So in this case it’s best to place Your device either under the pillow or to have an armband or smartwatch/smartband. If your pet is a calm one, it may just work. However, if your pet is used to jump in and out of bed several times a night, the sleep tracking will most probably register these events as light sleep occurrences.
Ultrasound is generally considered safe if it is at normal volume. Regarding health effects, it works in a similar way to normal audible sound, i.e. very loud ultrasound can damage your hearing, whereas at low volume it is safe to hear. When using speakers, smartphones are nowhere close to be able to produce such loud sounds as to damage your hearing.
We also use ultrasound that is very close to the hearing range (around 20 kHz), so the effects of the ultrasound are almost identical to hearing a high pitched sound at the same volume (expect you can’t hear it at all).
The ultrasound volume we use is around 40 dB – which is lower than normal speech volume. You can measure the sound level yourself using e.g. this app.
For pets that are able to hear it, the ultrasound emitted from Sleep as Android is a constant low noise. The situation is similar to e.g. refrigerator noise. It is there, you can hear it, but it’s not so much disturbing. The ultrasound definitely cannot damage your pets hearing at the volume used in Sleep as Android.
Bats can be confused and fly into walls.
The only difference between normal audible sound and our sonar is that the frequency is a little higher (normal frequencies 2 Hz-20 kHz, our sonar frequencies 18 kHz-22 kHz). This is so small difference for the mic and speaker membranes that there is definitely no chance of damage, even with prolonged usage.
Usually this is not caused by the sleep tracking directly as this is usually not consuming too much resources (usually around 1-3% battery per hour of tracking).
The issue appears because we hold a wake lock (keeping the phone awake) – any badly written apps may access the CPU extensively during the sleep tracking time. We suggest checking which services are running before you get to sleep.
For us it is hard to debug this. Also battery statistics are not a hint here as all battery consumption is accounted to the app which holds the lock even it did not consume the battery – this is by design in Android.
To conclude, this issue may happen, although we did not get any similar reports for a very long time now. But the most probable cause is some wrong 3rd party service or app on your device.
To see more on the issue we would need a debug report (menu > report a bug).
A good test would be to reboot your phone before sleep tracking (or kill any unnecessary services running) and see if that helps.
At first Sleep as Android may look complex with all its options, but in fact it is fairly easy to get started improving your sleep and wake up.
You can delve deep into all the amazing options Sleep as Android provides later on. But to get started just rely on our carefully selected defaults.
-
Use the top right plus icon to set up your Alarm time (e.g. 8:00). Tap the desired time directly on the clock - hours first, minutes second.
Figure 1. Tap on the (+) iconFigure 2. Tap on the desired time - hours firstFigure 3. Tap on the desired time - minutes second -
Confirm the selected time with SET button, it will show you the new alarm settings. Confirm the alarm with DONE.
Figure 4. Confirm the time with SET button.Figure 5. Now you see the new alarm’s settings.Figure 6. Confirm with DONE -
Smart wake up makes sure to find the best time for your wake up between 7:30 – 8:00 based on your sleep cycle.
-
You can now see the alarm scheduled on the main screen.
-
Tap the moon and Sleep tracking starts, we use your phone’s sensor to find out what sleep phase you are in (see How it works).
We recommend turning on airplane mode during sleep tracking -
Now just place the phone on the mattress near your body (see Setup sleep tracking) so it is able to sense your movement and wake you in the right sleep phase to bring your wake up experience to a new level
-
After dismissing the alarm in the morning you will see your sleep phases, deep sleep % and more..
This can be a result of multiple things, so please make sure to do the following troubleshooting:
-
Make sure you have Sleep as Android Gear Addon installed on your phone
-
It can happen that the addon cannot be started by us if it was force stopped previously. In that case please go to Play Store app on your phone, open addon page tap on “OPEN”.
-
Opt out of any battery savers that you might have on your phone, for all involved apps (Sleep as Android, Sleep as Android Gear Addon, Samsung Accessory Services) – to find out how to do that, please consult dontkillmyapp.com
-
Samsung Accessory services sometimes misbehaves and prevents connection to the watch for 3rd party apps. Please uninstall and reinstall it.
We have reports that on some device you can hear audible artifacts during sonar tracking. It sounds like this:
Some of the signal gets into audible spectrum probably due to either insufficient quality of the speaker or some post processing which is applied to the output on your device firmware.
We have also some reports that Sonar can get audible suddenly during tracking in the night. Unfortunately we are not sure why this could happen, we only have very few such reports and we are not able to reproduce this on our phones.
To make any audible artifacts less likely:
-
Go to Settings → Sleep tracking → Test sensor.
-
Try different frequency from the drop down menu list.
-
When you find the least affected frequency, you could try lowering the volume a bit (the sliding bar). But keep it as high as possible to maintain reliable results.
|
If the volume needs to be adjusted, always confirm that sonar is still working - ideally after you change settings, try to sit calm in font of the test for few seconds and than move slightly - do you see a spike? |
If you get completely flat graphs with automatic tracking with sonar sensor after upgrading to Android 11, make sure the app has permission Draw over other apps, Display over other apps or Appear on top (Samsung).
This permission is necessary for accessing the microphone from the background.
-
System settings → Apps → Sleep → Appear on top / Display over other apps
-
System settings → Apps → More options (⁝) > Special access > Appear
on top / Display over other apps
If the tracking stops completely after few minutes, the background processes are restricted by your system.
-
Make sure no system restrictions are applied to Sleep as Android, or any companion app for a tracking with wearable: Check our guide here.
-
If the guide won’t help, send us your log using Left ☰ menu →
Support →
Report a bug.
-
Please make sure that you are not accidentally starting the Sleep as Android app from your watch. This would start sleep tracking immediately.
-
Make sure you are not using automatic start of sleep tracking in Settings → Sleep tracking → Automatic sleep tracking → Start sleep tracking.
You can find more information about automatic sleep tracking start here.
If your volume gradually lowers after a while, when the tracking is running, the option Turn off when sleeping is enabled. This feature lowers the system-wide volume, so it affects even music played outside Sleep.
-
Go to Settings → Sleep tracking → Lullabies → Turn off when sleeping.
-
Extend the minimal playback time (5-90 min).
-
Or disable the feature completely by setting it to Use current device volume.
|
The volume needs to be kept at maximum when tracking with sonar for maintaining the reliable results. |
-
Unfortunately, this also affects media volume in 3rd party apps, and we cannot control those separately from sonar media volume. This means that while using sonar, you can only use media apps on full volume.
-
You can set a time delay on start of tracking in Settings → Sleep tracking → Awake detection → Delayed sleep tracking.
- External players
-
When using sonar, you cannot control media volume by volume buttons as it always jumps back to maximum.
-
- Lullabies
-
You can control volume of lullabies from the Sleep app (Settings → Lullabies), and from the Lullaby add-on pack.
-
When you lower the volume with volume buttons, the lullaby volume is estimated and adjusted accordingly, sonar volume is still kept at maximum.
-
Usually battery consumption issue or related issues causing phone over-heating during sleep tracking are not caused by the sleep tracking directly.
In most cases sleep tracking itself is not consuming too much battery (usually around 1-2% per hour of tracking). But because we hold a wake lock (keeping the phone awake) any other usually badly written apps may access the CPU extensively during the sleep tracking time. We would suggest checking which services are running before you get to sleep. For us it is hard to debug this. Also battery statistics are not a hint here as all battery consumption is accounted to the app which holds the wake lock even it did not consume the battery (this is by design in Android).
A good test would be to reboot your phone before sleep tracking (or kill any unnecessary services running) and see if sleep tracking will still consume too much battery afterward. Features within Sleep as Android which may cause higher CPU load during tracking include noise recording. You may try tracking without it for a reference. Also I would strongly recommend to track with airplane mode on.
The red block indicates that something went wrong with tracking at that time and the device stopped providing sensor data for some reason. Usually those are some non-standard battery optimizations or battery savers, the battery gets too low so we preserve it for the alarm or connectivity issue if you use a wearable.
1. Battery restrictions
Make sure no system restrictions are applied to Sleep, or any involved apps like wearable companion app).
See our guide here, and follow the instructions.
2. Too low battery
When the battery is too low (usually below 10%), data collecting is terminated to preserve enough battery for alarm.
When the battery was too low, there is a battery icon is displayed on the graph:

3. Connectivity issues with a wearable
When the connection with the wearable is lost, you can see red sections on the graph. The app always tries to reach the wearable again.
The graph can look like this:

-
Opt-out from any battery restrictions is applied by your system (https://dontkillmyapp.com/)
-
Pair the wearable with your phone in System settings.
-
Make sure the BT is not lost, and try lowering the distance between the phone and the wearable.
-
Try settings the device as Trusted device.
Unfortunately due to dummy security restrictions the Android team introduced in 4.2 there is no option to enable airplane mode from an app automatically. You always have to use the settings or long touch power button. If you have a rooted phone you may consider using https://play.google.com/store/apps/details?id=lv.id.dm.airplanemh we have support for that in Sleep. There is a similar hack for 4.3.
If you don’t agree with the Android team design decision you can upvote issue 40497 here http://code.google.com/p/android/issues/detail?id=40497.
There is no clearcut answer to which day the sleep between them belongs.
We have decided to attach the sleep to the day after, because how you slept will largely determine how your day will be.
If you have separate mattresses there is minimum interference from your partner. If you have one big shared mattress (which isn’t recommended as you partner may need different mattress for his healthy sleep), it could still work assuming you keep your phone close to your body and ideally on your side of the bed.
You can also consider using a armbands or smartwatches. This certainly solves the problem for a little convenience trade-off.
If both of you are tracking, you can enable pair tracking, which filters out the partner’s activity.