Sleep tracking

What is sleep tracking?

Sleep tracking enables you to measure quality of Your sleep.
During the night, your body cycles through several sleep phases. Sleep as Android uses your device’s sensors (accelerometer or sonar) to create a graph of these phases.

Measuring your sleep cycles enables the app to:

  1. Visualize the sleep process in a sleep graph and hypnograms
  2. Calculating your deep sleep % and cycle count, which can be an indicator of healthy / unhealthy sleep.
  3. Smart wake up, finding the best moment for the alarm to wake You up.
  4. Gathering statistics to analyze your sleep in the long term.
  5. Setup goals and improve your sleep parameters

How does sleep tracking work?

Sleep tracking uses your device’s sensors to measure how much you move during the night. This is called actigraphy. Actigraphy is based on the finding that body movements are directly related to the current sleep phase. Generally, more movement means lighter sleep. More about the method in the theory section or on Wikipedia.

You can use either accelerometer or sonar as sensors. Select your sensor in Settings > Sleep tracking > Sensor.


Sleep as Android supports two ways of sleep tracking out of the box. Accelerometer and Sonar.

  • Accelerometer measures the magnitude of your sleep movement by a tiny electromechanic device that is present in every smartphone. The phone has to be in bed with you in order to transfer your motion to the accelerometer.
  • Sonar measures your movement by low-ultrasonic waves (we use 18-22 kHz) that traverse through air. Sonar is able to detect your breathing motion, so in addition to mapping sleep motion, it can also point to possible breathing issues. For sonar to work, the phone has to lie still on a bedside table.

Tracking with accelerometer

Accelerometer can be either in the phone or in a wearable device. The measuring device has to have direct contact with you to be precise. This means that the phone has to be in bed with you. Accelerometer is the default sensor and works on every phone.


The movement is measured relatively. This means that it doesn’t matter whether you are a tiny girl or a McDonald’s regular – the app is always able to distinguish between ‘moving a little’ and ‘moving a lot’. Heck – it should be able to measure a fly sleeping on the phone! You always see the maximum of your movement as a maximum of the sleep graph – and the same with minimums.

If you leave the phone lying on the table, you will get some readings. Some people have written us that Sleep as Android does not work because of this notion – but the device is so sensitive that if you leave Your device lying flat somewhere on the floor or a table, you are effectively using the app as a seismograph (i.e. tracking ground movement).

Phone placement
Position of your phone in the bed is important in order to correctly detect sleep phases. The phone needs to keep contact with the mattress in order to capture your movements. We recommend putting it on the mattress near your body. Good positions include: under the pillow, at your legs, under the sheet to fix the phone, in your pajamas pocket etc.
Using an armband is a trade-off between a little discomfort and better data accuracy. Or you may want to consider using on of our integrated Wearable devices.
Mattress types

Another decisive factor for data accuracy is the the mattress type. In general sleep tracking works better on mattresses which do better transmit your movements to the phone’s accelerometer sensor. In general, sleep tracking works well on most mattresses out there excluding some 100% slow foam mattresses (such as Tempur) where it may be necessary to use an arm band or other similar solution.

Data accuracy
Wearable device > Arm band > Spring mattress > Latex > Hard foam > Soft foam > Thick slow foam layer > 100% Slow foam

Tracking with 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). See the growing list of compatible devices.

The phone has to be on a bedside table, lying still. Sonar has effective range of about 1 meter. The closer you are, the more precise are the results.


Sonar can drain up to 50% of battery overnight, so make sure to put your phone on charger!

Breathing detection

If you are close enough (reliable distance is about 0.5 meter), sonar is able to detect your breathing motion. In the morning, you will see a plot of your breathing level as a blue line with pinpointed periods of low or no breathing activity.

The numbers in circles signify your maximum and minimum breathing rate (breaths per minute) for a given night.


Is tracking with sonar bad for your health or for the device? Find out here. (Spoiler alert: It’s not bad!)

Phone placement

To obtain best results while tracking with sonar, keep the phone on your bedside table. The range of the sonar is 1 meter.

To detect respiration, make sure to be closer to the phone – the respiration detection range is around 0.5 meter.


Sonar health concerns

Sonar is absolutely safe to use. For details, please take a look at

Start sleep tracking!

To start sleep tracking, tap the  inv_ic_action_track button on the Dashboard, alarm tab, or even from the phone desktop using our alarm widget with moon icon.

NOTE: The moon button can have one of 3 colors:

  • cyan – default
  • green with progress – 2 hours countdown to bedtime
  • red – it’s past bedtime

The phone will use the accelerometer sensor by default, sense your movements during sleep and estimate your sleep phases. The result of sleep tracking is an actigraphic record of your sleep (sleep graph). Sleep graphs are explained in more details in How it works and Statistics.


The sleep tracking screen shows current time, time to alarm, smart wake up window and much more. But for starters, let’s just focus on:

  • inv_ic_action_pause pause button – will pause sleep tracking for 5 minutes (to tell the app that you’re awake, e.g. to go on the toilet)
  • inv_ic_action_lullaby lullaby button – will start playing a lullaby, which will fade out after a preset time

On the background, a graph of your movements starts to show up moments after you start sleep tracking.

Settings explanation

When you first install Sleep as Android, you do not have to set anything in order for sleep tracking to work. Later, you might discover that there are some things you might want to tweak.

Go to Settings > Sleep tracking.

Silent profile when tracking

On: Starting sleep tracking puts the phone in the silent mode so no notifications or phone calls are heard. Alarms will be heard.

Delayed sleep tracking

When enabled, sleep tracking will not start immediately when you click the inv_ic_action_track moon button, but after a set delay.

Airplane mode

For Android version less than 4.2 (or for any rooted devices), Sleep as Android can turn on airplane mode automatically. For higher version Android, this setting only turns off WiFi and the user has to do any airplane mode settings manually: long press power button > Airplane mode.

IMPORTANT: We do strongly recommend using airplane mode during the whole period of sleep tracking in order to lower “electromagnetic smog” in your bedroom.

You can setup automatic airplane mode on rooted phones: on 4.2 with JB Airplane Mode installed and on 4.3+ you need the Airplane mode Exposed plug-in.
NOTE: We do strongly disagree with the Android team design decision to drop automatic airplane. If you share the same opinion please up vote the issue #40497.
The airplane mode could be easily switched off after the sleep tracking has ended by using the airplane icon in the “Rate Your sleep” screen.

Flip to pause

Simply flip the phone over to add +5 minutes to your current pausing time.

Hidden morning stats to avoid rating bias

Seeing the hypnogram and actigraph in the morning may already influence how you rate you sleep. This options allows to hide the measured results until you do you rate your sleep with stars.

Stand-by and charging

Although on newer Android versions sleep tracking consumes only around 1-2% of battery per hour of tracking we still recommend putting the phone to a charger during sleep tracking in order to prevent missed alarms due to phone discharge. By default sleep tracking will terminate when battery gets under 10% leaving the phone to stand-by in order to preserve battery for the alarm. If 10% is not enough for your device you may configure higher thresholds in Settings > Sleep tracking > Stand-by.

Screen dimming

  • Disabled: Leave screen on during sleep and show sleep graph
  • Dim: Let the system control screen during sleep
  • Dim with clock: Show clock for 20s, then let the system control screen during sleep
  • Clock screen on: Leave screen on during sleep and show clock

Battery saving mode

It is possible to use the accelerometer reading to just determine the best moment to wake up – without sleep tracking the whole night – by using the Battery saving mode. You normally set the alarm, start tracking, and in the “Sleep tracking” screen go to [menu]>save battery. This will start full tracking not immediately, but only right before the smart wake up period.

Tracking with external devices

For tracking with external devices, please see Smart watch and Wearable.

Calibration and testing

Our sleep tracking algorithm is designed to work well with any device out there. No calibration is required, because we handle actigraphic data relatively, and establish thresholds for sleep phase detection and smart wake up throughout the whole night.  In most cases, a 45-minute tracking is enough to auto-calibrate sleep tracking.
NOTE: Even if there is no calibration, you can still adjust the sensitivity of the smart wake up algorithm in case the default setting does not work well for your device or bedroom setting. See Alarms.
You can easily test the ability of sleep tracking to capture your movement with your device and in your bedroom conditions using the sensor test feature available through Settings > Sleep tracking > Test sensor.
If you sleep graphs look similar to the first graph above then your setup is correct. You see that sleep tracking is getting all the required data – has detected 5 sleep cycles with deep sleep and light sleep phases taking turns in a regular pattern. See How it works for more on how to read the sleep graphs.
On the other hand, if your graph is nearly flat-lined or most of your sleep is light sleep this indicates something was wrong as such deep sleep % and lack of movement is unlikely. Either the phone wasn’t placed correctly close to your body or there are some issues with the sensor. For the latter, please consult FAQ.