Uncategorized

SONAR: Revolutionary contactless sleep tracking

Introducing a new way of sleep tracking using ultrasonic waves.sonar2

Have you been interested in monitoring your sleep, only to be repelled by the fact that you need a phone in your bed? Or an expensive hardware?
Sleep tracking has been known as a notoriously uncomfortable process, where you worry about hot phones under your pillow and cables twisted around your legs.
Over the last year, we have developed a way to put that all behind. A way to track movement at a distance — with ultrasound.

A sonar on your phone.

You don’t need any new hardware for that – everything is already in your smartphone. Microphone, speaker and a hell of a computing power. The only thing missing was the code. Not anymore.

Sleep as Android now uses your phone as sonar to contactlessly track your sleep.

With other sleep trackers, you need to have some device in your bed – a wearable or a smartphone. With Sleep as Android, you just put your phone on a nightstand and go to sleep. It will monitor your movement with the sonar.

And not only the movement!

Breathing detection

At half a meter range, sonar is so accurate it can measure your breathing rate.

Sleep as Android can also measure your breathing at range with sonar.

In the morning, you’ll see a line showing the development of your breathing throughout the night.
screen15-02-55_framed

What is this good for? People usually don’t have a clue whether they suffer from any nightly breathing disorder.
Sleep as Android will keep an eye (umm…ear actually) on your lungs and will show you in the morning how many times you have stopped breathing.

Health concerns

  • Sonar emits sound that is on the edge of audible and inaudible sound (around 20 kHz). The frequency itself is perfectly safe for human hearing.
  • The volume of the sound is maximally around 50 dB, which is less than the volume of a normal conversation. A refrigerator sound level is comparable.
  • 1 meter away from the phone, the sound level can be compared to a pin falling to the ground

Ultrasound does not pose any threat to your health.

  • Since the sound is so low, animals usually do not care about our sonar.

Limitations

  • On some devices you can hear audible artifacts during sonar tracking. Some of the signal gets into audible spectrum. This can be due to insufficient quality of the speaker, or some post processing which is applied to the audio output.
  • Sonar won’t work with headphones, so it is not possible to listen to lullabies privately before sleeping.

How to try it?

  1. Download Sleep as Android app from Play Store.
  2. Start the app, go to Settings > Sleep tracking > Sensor and select Sonar.
  3. Let the app test your phone if sonar works for it.
  4. Start sleep tracking by tapping on the moon button in the main screen of Sleep as Android.

Troubles?

Please see the docs.

53 thoughts on “SONAR: Revolutionary contactless sleep tracking

    1. Hello Alison, the blue numbers are maximum and minimum of your breathing rate throughout the night.
      When you stop breathing for a considerable period of time, we add a marker to your graph. You can also set up an Apnea alarm to wake you up when you stop breathing.

    1. Hi Dinh, could you please try it? The heater will probably not emit ultrasound signals, so it shouldn’t interfere with the sonar measurement. But please try it (you can do that with the free version) and then please send me a debug log (menu-report a bug) and a screenshot to support+jiri@urbandroid.org
      Jiri

      1. Hi Jiri, just being curious as I never asked this before. Does the sonar work if I use a Pebble watch with heart rate sensor? I observe that on nights when I sleep with HR on, there is no sonar recorded and vice versa. Not sure if this is how the app is set up(?)

          1. Mi Band 2 has its own accelerometer. So we use the sensor that is in the Mi Band 2. We are not using phone’s accelerometer/sonar at the same time – that would be pointless.

  1. Hi Jodi, I have been using my smartphone for a long time tracking my sleep with your app. I have a tablet so I used the tablet with the sonar in addition to the smartphone. The results seem quite different. The smartphone shows consistently about half (plus) the deep sleep as the tablet shows. For example, last night the smartphone shows 2:48 4x and the tablet shows 4:59 8x. Have I done something wrong with the setup?

  2. Hi! I am just giving sonar a try. Before sonar, I used to listen to audio while going to sleep. I sleep alone so don’t use headphones (which the FAQ says you can’t do) and just play it quietly into my space. The problem is the volume now turns up involuntarily every few minutes. I can turn it down manually, but it just keeps continuing to rise again every few min. Obviously, this doesn’t work since increased volume can startle you awake! Is there anything I can do about this issue? A setting I can change, etc?

    1. Hi Danae, yes, we need to keep media volume up for the sonar, so you can’t change it by volume buttons. But you can change the lullaby volume separately in Settings-Lullaby.

    1. Hello Charrat, yes, there should be no problem with using both at the same time. The only issue would be if there are some exposed continuously moving parts in the machine that would get detected by the sonar.

  3. Hi there, was trying sonar with galaxy s7 edge, on 10% and on 50% setting but the sound recording also recorded the sonar beebs. I read a article about this problem but it didnt come up with a solution. I was wondering if you know about a “fix” for this or is it still a mystery?
    Ps: im not a sound expert and was wondering if i should just switch to motion detection or try a smart watch or other device?

  4. Hello, is it normal to hear sonar beeps/noise during playback in the morning?
    My device is S7 Edge and I can definitely hear those weird sounds from sonar while playing.

    Is this an issue to be solved, or not?

    Thanks.

    1. Hi Valo, sorry for the late response. Yes, on some devices this is normal. You should definitely experiment with the Settings>Sleep tracking>Test sensor. You should be able to get a balance of the sonar volume where you would not hear the artifacts, but sonar would be still working.

      We are working on solving this issue on our side with the second round of sonar redesign.

  5. Hello,
    I have a refrigerator in the kitchen which produces some noise when it’s working. In my bedroom which is next to the kitchen I can hear such sounds. And I wonder if such sounds will be perceived and consequently recorded by the Sonar as snoring?

    1. Hello Nina, they should not. We check for frequencies not only of the sound itself, but also for some rhythmicity in the sound. So unless the refrigerator makes sound with the breathing frequency (around once per four seconds or less often), then it’s okay 🙂

  6. Hello, I’m having a hard time understanding the blue line. Why does it only appear in small chunks? What do the numbers mean? Does a 16 mean I stopped breathing for 16 seconds? Or does it mean I was taking 16 breaths per minute? Thanks! Love your app!

    1. Hi Justin, the blue line shows breathing rate (i.e. breaths per minute). The numbers show the maximum and minimum breathing rate of the given night. They appear in small chunks simply because it isn’t always possible to compute the breathing rate — sometimes sonar doesn’t see your chest (e.g. if you turn away from your phone or move away on the bed).

  7. I’m not getting any breathing data on my charts even though I am using the sonar. My data ends up looking as if I was only using the accelerometer, even though I have selected sonar and the signal seems quite strong when I’ve tested it (1200-1800). Any thoughts on how I could fix this?

    1. Hi Eric, I would think not, because the fan moves at much higher frequency…but you can easily test it with fan turned off/ turned on in Settings > Sleep tracking > Test sensor

  8. My question is, how will this app work if your spouse is asleep beside you and also snores? Mine for the most part, is facing the other direction but will the sonar part of the app and snoring confuse the app with two people within the apps reach? I am using my Samsung Tab A 8.0.

    1. The sonar has limited range of about 1 meter and also loses a lot of energy with distance, so in the case you describe there should be no trouble if you have the phone on your side of the bed.

  9. Sorry with my questi9n but instead of using sonar isnt that possible to record the breathing on some particular frequency ? It is too low ? I guess with advanced filtering process it should be possible to extract a rythm and find a S/N acceptable. Sonar process is smart i wouldnt have think of it but then also depends on speaker. What about measurint body movement with sonar also instead of accelerometer which add constraints ? Isnt that possible to measure brain activity with phone antenna ? (Guess no or S/N too low)

    1. Hi Leonard,

      1) Breathing does not have one frequency. If it did, it would be very easy, but we don’t know your breath frequencies beforehand. We just know the very rough frequency range, which is not enough to get the rhythm in all the noise clutter that is usually present. Also if you use accelerometer as a sensor, there is too much movement noise, whereas when you use sonar, the breathing volume is too low so pretty bad S/N.
      2) We do measure body movement with sonar.
      3) Measure brain activity with phone antenna – I’m not sure, might be possible – but anyway you don’t have access to the raw values from the antenna on Android or on any other phone I’m aware of.

  10. Is sonar more accurate than wearing a Pebble for example (accelerometer and heart rate monitoring)? Do you have plans to allow heart rate monitoring with sonar? I noticed that if sleep tracking with “use wearable” is checked sonar does not come on and also disables heart rate monitoring.

    1. Hi Ryan, many thanks for your comment. Pebble would be most accurate, since it directly translates your motion to the app. However our latest comparisons shows no difference in the accuracy of sonar and a wearable – identical sleep phases are detected.

      Heart rate + sonar is on our todo, hopefully we implement it with the release of Sleep Phaser next month.

  11. Hello, will a heart watch allow sleep to better get the breathing data? I am not sure I understand that. Also, What are those “smart wake up” icons, (a cloud or a comics bubble as when someone is thinking?) I have some, or many of them’.! I use the sonar with success with Galaxy edge 6.
    But what I want is to be dure of checking my breathing. Any hint? Thankyou

    1. Heart measurement won’t help with measuring breathing. To better measure breathing using sonar, keep the phone about 50 cm maximum from your body when you sleep.
      Thick sheets will somewhat hinder the possibility of tracking breathing.

      Regarding those icons, those are most probably “lucid dreaming” icons. If you don’t want this, turn this off in Settings > Lucid dreaming. You can also read more about it here: https://sleep.urbandroid.org/documentation/extended-features/lucid-dreaming/

  12. 1. Is sonar even safe for us humans?
    2. What can be the possible damages because of sonar in general ?
    3. Can you add new features to the Lucid Dreaming section?

    1. 1) Yes. It’s not loud and it’s not too much ultrasound. We use 18-20 kHz (on the top of the normal hearing range). Loudness is about the same as normal speech.
      2) This depends on the total energy that the ultrasonic device emits. High-energy ultrasonic cleaner can mix up your brain, if you use it improperly. This is however really extreme and really far from the sonar that we use. Our sonar is more like a quiet ultrasonic whistle that is used to call dogs home.

    1. Hi, no it doesn’t as the sonar works by sending and receiving very specific sound patterns and it is very improbable that these would be present in the music/lullaby.

  13. Hello!
    I’ve been using Sonar for a while and seems to work good. Also breath detection is huge advantage, it made me realise that I could have breathing issues. Anyway, I just found out, that I can use my Garming Forerunner to track my sleep, so I installed all the apps and gonna try that today, probably it’s the most accurate method to track, am I right? The next advantage of using Garmin is that I can also track my heart rate. But.. When I’m using my watch, Sonar is off and as I read in comments here only one tracking method works at the same time. So when using Garmin I can’t track my breath anymore? So in comparison which method is the best to use? Watch with built-in accelerometer or Sonar? Thanks in advance, great job!

    1. Hi Marek!
      With the watch you’ll have the best accuracy in general, however if you’ve been consistently getting breath readings from the sonar, then your sonar setup is apparently pretty good.
      In your case there is no clear winner between sonar and Garmin unfortunately 🙂

      Garmin watch may be uncomfortable when sleeping, but that’s an individual thing.
      I would think that you don’t need to have breath detection every day, just a few days of screening would suffice to get the general picture, so maybe the heart rate trends would be more useful in the long term.

    1. At some point it will, but it kinda defeats the comfort we had imagined sonar would bring (no device in bed/on wrist).
      We don’t currently have a time schedule for this…

    1. It was formerly a CPAP mask icon – we changed it a few months ago to O2. The icon means that the app detected a decrease in breathing frequency at that moment.

  14. This is really incredible work by your team. As a mechanical engineer I can’t imagine how difficult this was to implement. I am curious. How does the breathing accuracy vary when the patient is facing away from the phone vs towards it?

    1. @2Hedz big thanks, very much appreciate. This depends on too many factors – position of phone, the subject, blanket.. in fact if you breath the whole upper body is moving which makes it easier even when facing away.. Also if you are covered with a thin blanket the blanket is also moving.. but definitely you usually get better signal when facing the phone, also it depends heavily on the ability of the phone to produce ultrasound. On some device you can see gaps in detected breath rate adn they can very well correlate with the time the users is facing away..

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.