Breath rate detection & blood oxygen measurement

1. What it does

Makes use of sensors that can measure either your breath rate (sonar or Sleep phaser) or your blood oxygenation (oximeter).

Sonar or Sleep Phaser measure your abdominal movements and thus estimate your breath rate.

Any pause in in the detected breath rates is depicted as an O2 symbol ic action cpap in the sleep graph and may hint at respiratory issues or cause by an outage of the sensor.

Using Oximeter we can track blood oxygenation levels (SPO2) directly. Oximeters provide a better - more precise - respiratory issues tracking. They can even hint on some severe issues such as the Sleep apnea.

2. Where to find it

No action is required. You will see breath rates if you use the Sonar or the Sleep phaser if the overall setting in your bedroom and the device in use reach the required level of sensitivity.

With an oximeter, you can track your blood oxygen levels (SpO2). See Oximeter docs for details.

3. Options

In Settings → Wearables:

Low breath rate alarm

If enabled, this will wake you up if you have a low breathing rate (or blood oxygen level) for a while.

4. Guide

A blue line on your sleep graph shows breath/oxygen data from connected devices, see Figure 1, “Breath-rates in sleep graph”.

Whenever a significant dip in value occurs, a O2 symbol ic action cpap will be shown in the graph. This is a breathing disturbance. From those disturbances, we compute your Section 4.1, “RDI” value.

breath rate
Figure 1. Breath-rates in sleep graph

Read about sleep apnea.

4.1. RDI

Respiratory Disturbance Index is the average count of respiratory disturbance episodes per hour.
E.g. if you stop breathing once per every hour of your sleep, RDI would be 1.

0 - 10

RDI under 10 is considered normal, some of the disturbance events measure may be faults of the sensor and how tight the sensor is around your finger for instance.

10 - 15

RDI from 10 to 15 is considered a mild respiratory disturbance. We strongly recommend to do the measurements repeatedly to minimize any errors in measurement

15 - 30

RDI from 15 to 30 is considered moderate respiratory disturbance. It can be a warning sign. Definitely do measurement repeatedly to verify this result.

30 and more

RDI over 30 is considered severe. We recommend to consult your doctor.

hrbr
Figure 2. SPO2 data in sleep graph

FAQ

How do I get BT smart heart rate device work with Sleep as Android?

  1. Enable the tracking in Settings → Wearables →Bluetooth Smart (might be hidden under Advanced section).

  2. Try to pair with your device (this may not be required for all devices and OS versions).

  3. Make sure no other app is using your device while sleep tracking.

If nothing helps please send us a debug report using Leftmenu → ic bug Report a bug.

Note BT Smart heart rate tracking only works from Android 4.3 onward

How does Sleep as Android (actigraphy) compare to Polysomnography?

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.

How does the Battery saving mode in Sleep tracking work?

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.

I do not trust the results, it is fake / generating random data

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.

I have a dog / cat sleeping with me in bed. Will the sleep tracking be accurate?

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.

Is sonar safe?

Is sleep tracking with sonar safe for your health?

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.

Is sonar safe for your pets (cats, dogs, bats)?

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.

Is sleep tracking with sonar safe for your smartphone?

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.

Oximeter troubleshooting

1. OLD Oximeter (non BTLE)

The app can ONLY connect to the stress locator when it’s first paired with the phone (or removed and re-paired) and no other app has been used (e.g. StressLocator app).

2. NEW Oximeters (BTLE)

  • 2017 and beyond
    The app can only connect to the Oximeter when it is NOT PAIRED to the phone.

Phone gets hot during tracking

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.

Samsung Galaxy Gear - Watch app stucks at Start tracking

This can be a result of multiple things, so please make sure to do the following troubleshooting:

  1. Make sure you have Sleep as Android Gear Addon installed on your phone

  2. 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”.

  3. 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

  4. Samsung Accessory services sometimes misbehaves and prevents connection to the watch for 3rd party apps. Please uninstall and reinstall it.

Sonar chirp audible in lullaby

  • We have reports that this can happen on some devices, this depends on how the device mixes audio channels.

  • Try different frequency in Settings → Sleep tracking → Test sensor, frequencies are listed in drop down menu list.

Sonar is audible, strange sounds when using sonar

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:

  1. Go to Settings > Sleep tracking > Test sensor.

  2. Try different frequency from the drop down menu list.

  3. 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.

Note 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?

Sonar is recorded, strange sound, chirping in recordings

  • Probably some filter to enhance audio experience is applied to speaker or mic.

  • Try different frequency in Settings → Sleep tracking → Test sensor, choose a frequency from the drop down menu list.

  • When you find the least affected frequency, you could try increasing the recording threshold a bit in Settings → Sleep noise recording → Recording volume threshold.

Note We have also discovered, that this exact issue can be solved by different positioning of the phone - if the bottom of the phone (where mic and speaker are) is not touching any surface, the artifacts are gone. So try to put the phone on a book or something similar with the bottom of the phone over the edge. If you are not hearing the sonar itself during tracking, but it only gets recorded, this usually helps.

Tracking crashes, stops suddenly

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 Leftmenu → ic bug Report a bug.

Tracking starts on its own

  1. Please make sure that you are not accidentally starting the Sleep as Android app from your watch. This would start sleep tracking immediately.

  2. Make sure you are not using automatic start of sleep tracking in Settings → Sleep tracking → Start sleep tracking.
    You can find more information about automatic sleep tracking start here.

Volume jumps to max when tracking

Warning 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.

Why is Sleep eating so much battery? What about battery overheating?

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.

Why is there a red bar / section / block in my sleep graph?

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:

low battery
Figure 1. Low battery 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:

red wearable
Figure 2. Connection lost during tracking
  1. Opt-out from any battery restrictions is applied by your system (https://dontkillmyapp.com/)

  2. Pair the wearable with your phone in System settings.

  3. Make sure the BT is not lost, and try lowering the distance between the phone and the wearable.

  4. Try settings the device as Trusted device.

Why it is not possible to enable airplane mode automatically after sleep tracking starts?

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.

Why sleep record data count towards the end date

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.

Will sleep tracking work with two people in the bed?

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.