Sleep tracking

PSG = 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 oneor thisor thisor this). 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.

Category: Sleep tracking

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

Category: Sleep tracking

Huawei together with Xiaomi are the most troubled phones on the market, some vendors tent to ignore Android best practices and implement very bizzare custom modification which make background task nearly impossible to run.

Please take a look at http://sleep.urbandroid.org/documentation/faq/alarms-sleep-tracking-dont-work/

Category: Sleep tracking
  • 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 hearable 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 hearable 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.
Category: Sleep tracking

When blocking cards from other apps that you didn’t want to go to your watch, you might’ve accidentally blocked Sleep as Android. Delete the block.

Sleep as Android doesn’t come with automatic sleep tracking. Actigraphy by itself isn’t a good method to tell if you have fallen asleep.

On the other hand, you can setup Sleep as Android to start sleep tracking at specific time, using Tasker. Just install Tasker and create a profile which starts “Start sleep tracking” event at the time of your choice.

Category: Sleep tracking

Please check our integrations table – only devices with a heart icon will measure heart rate with Sleep as Android. Other smartwatches with HR sensor need to go around SaA – save HR to S Health or Google Fit, from where Sleep as Android will download it. Please note that Sleep as Android downloads the measurements usually with a day’s delay (the sync is triggered once another record is saved).

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

On Samsung S2, we observed an issue where sleep tracking started really on its own. We have found a solution for the issue, so please uipdate to the latest version of Sleep as Android to have it.

Category: Sleep tracking

Unfortunately, quite a lot Android devices out there do not support gathering accelerometric data (sleep tracking) with screen-off. This is duo to a bug which is on 100% of devices with Android version 1.6 to 2.3.4, on many +2.3.5 device and even on several devices with +4.0. We are doing an automated detection of whether you device is screen off tracking capable or not. In case we detect it isn’t we turn screen on automatically during sleep tracking in order to keep tracking functional.

If you think we did detect your device incorrectly you may try to re-detect using the following process:
1) Go to settings misc.
2) See what does the option “Screen-off tracking” say.
3) You can try to reset this option by clicking on it and confirming.
4) Then turn off the screen, wait for ~3 minutes and turn it back on.
5) See what does the option say now. If it says the screen-off tracking is supported, the next tracking you run should automatically turn off the screen. If it, on the other hand, says it is not supported, then your phone likely does not allow sleep tracking with screen off. You can try to use an option lower in the menu “Force screen-off tracking”, but beware it may result in sleep tracking and smart wake up malfunctioning
Category: Sleep tracking

Crashing during sleep tracking seems very rare but still may happen on some firmwares, especially on custom ROMs.

Here is a list of featured with has been reported as causing rare crashing issues on specific firmwares. You may want to try disabling them:
– noise recording
– screen dimming
– wake up with flashlight
Also make sure you don’t use any task killer apps or automated backup tools. And if you insist on using them than please try to white-list Sleep as Android.
Also it may happen that the app updates during the night. We have a restarting mechanism in the Sleep as Android Unlock app which shall restore sleep tracking under normal conditions. If this mechanism is failing for some reason you may want to disable auto-updating or track with airplane mode which is anyway highly recommended.
Finding out what is the cause of the problem on each individual firmware is a very difficult task as this problem is not caused by the application but on the contrary by a bug in the firmware itself.
If you would like to help us debug the problem please try the following (SD card needed, Android <4.2!):
1) Download alogrec (free) from Play Store
2) Start it before you start tracking.
3) Start tracking.
4) If the tracking is not running in the morning, send us the output of alogrec.
Category: Sleep tracking

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.
Category: Sleep tracking

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.
Category: Sleep tracking
Tags: battery, hot

On Galaxy Nexus and few Motorola devices, you may be experiencing an issue that the sleep graphs turns wild at a specific hour during all tracking.

There is a known bug in acceleremeter which is causing the accelerometer data to go wild whenever any other app touches the accelerometer and sets it to mode DELAY_NORMAL. The apps we know about are triggering this is Noom Weight Loss and Noom Pedometer. But in general, although we are not sure, we believe this may be triggered by any other app which is using the accelerometer.
Category: Sleep tracking

From various error reports we know that the accelerometer sensor implementation on some firmwares has issues. Over the time the accelerometer may get into a broken state and it stops sending data. The only way we know to resolve this issue is to do a reboot. In all cases so far, reboot did solve this issue.

To test whether the accelerometer is working, you can use menu > test sensors or some 3rd party app such as Sensor List.

Category: Sleep tracking

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.

Category: Sleep tracking

The red block indicates that something went wrong with tracking at that time. We did not get the expected data from accelerometer. Maybe Your phone has restarted or if You are using smartwatch, we could have lost connection to it.

Category: Sleep tracking

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.

Category: Sleep tracking

Filter is based on comments and tags. For example you can easily only show your graphs when you did some sport the day before by typing sport into the filter field.

Category: Sleep tracking

Please refer to our documentation How it works.

Category: Sleep tracking

In most cases sleep tracking itself is not consuming 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 and the consumption is anyway mistakenly accounted to the app holding the wake lock (Sleep as Android in this case). We would suggest checking which services are running before you get to sleep and try to kill some of them or reboot your phone prior tracking. For more details, please read Troubleshooting.

Category: Sleep tracking

Probably your phone has been detected as unable to track with screen off (please check Application settings → Misc → Screen off tracking). Please see Troubleshooting for more details.

Category: Sleep tracking

You are free to use any mp3 files you like or any player. Just start the playback in your favorite player. Lullaby volume down will take care to bring to volume down after you fall asleep. For more details refer to Lullabies.

Category: Sleep tracking

We calculate 4 most frequent places from a year of data history. I year should be sufficient so that you can for example watch your sleep at your holiday home where you go regularly in the summer. Should you move, your new home will gradually become geo3->geo2->geo1->home after some time as it becomes dominant in your data.

Category: Sleep tracking

We use a method called sleep actigraphy and there are several scientific papers which show that it is not as precise as PSG but still provides reasonable data and more over it is more convenient for the user. The phone has an accelerometer sensor build in which is very sensitive and if placed in your bed we have a record of your movement over the nigh. In deep sleep your muscular movements are suppressed (otherwise you would be running or jumping around according to your dreams :)) and thus in this phase the sleep graph gets nearly flat. This is in short how we measure your sleep phases, for more details refer to How it works.

Category: Sleep tracking

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, please check here. This certainly solves the problem for a little convenience trade-off.

Category: Sleep tracking