PINE64
PineTime Sleep Tracking - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PineTime (https://forum.pine64.org/forumdisplay.php?fid=134)
+--- Forum: General Discussion on PineTime (https://forum.pine64.org/forumdisplay.php?fid=135)
+--- Thread: PineTime Sleep Tracking (/showthread.php?tid=15490)

Pages: 1 2


PineTime Sleep Tracking - any_mouse - 12-08-2021

I have been reading about the PineTime and it seems like a neat product. However, one feature that would really make me want to grab one is some kind of sleep tracking. From what I’ve seen, this feature is not implemented on the PineTime. 
What is the likelihood that this feature might be implemented down the road? What other features would need to be in place before this could be possible?


RE: PineTime Sleep Tracking - wibble - 12-13-2021

We've only got movement (accelerometer) and heart rate, neither of which are particularly good indicators of sleep state from what I've read. The heart rate is rather inaccurate at the moment too, by more than enough to throw off sleep state estimates. Some argue that wrist mounted optical sensors are never accurate enough for this use, so on its own a PineTime on its own may never be capable of accurate sleep tracking, and getting misled by inaccurate tracking is worse than no tracking at all.

You could potentially use it in combination with bluetooth sensors such as a chest strap for heart rate and/or breathing rate and depth measurement. I don't think we have any code yet for connecting to such devices, recording or analysis of their results. However it's done, someone will need to be able to record data with both the sensors and a separate known reliable system in order to verify accuracy. I wouldn't like to guess if or when this might happen - we could be lucky and have a sleep researcher wanting an inexpensive and portable device they can customise.


RE: PineTime Sleep Tracking - eFqLLnGo - 12-16-2021

I too am interested in buying a pinetime for this very purpose. I don't mind a low accuracy as I'm mostly interested in how much I move during my sleep.

Also the ability to wake up with a wrist vibration is a plus for me as it would avoid waking up my wife...

I would be willing to support financially any coder interested in helping out as I know only python and shell currently. Btw which language is actually required to code an app on the pinetime?

Is anyone else interested?


RE: PineTime Sleep Tracking - wibble - 12-17-2021

InfiniTime and Wasp-OS have an alarm app already, so waking with a wrist vibration should be viable.
https://wasp-os.readthedocs.io/en/latest/apps.html#alarm-application

InfiniTime is written in C/C++ while Wasp-OS uses MicroPython, and has an emulated watch you can use for testing on your desktop.
https://wasp-os.readthedocs.io/en/latest/appguide.html

If you want to record how much you move the step counter code would be a good working example for capturing and using accelerometer data.


RE: PineTime Sleep Tracking - eFqLLnGo - 12-17-2021

Thanks, that's really helpful


RE: PineTime Sleep Tracking - eFqLLnGo - 12-17-2021

(12-13-2021, 06:24 AM)wibble Wrote: We've only got movement (accelerometer) and heart rate, neither of which are particularly good indicators of sleep state from what I've read. The heart rate is rather inaccurate at the moment too, by more than enough to throw off sleep state estimates. Some argue that wrist mount...

I was surprised by your statement and looked up a few studies. I find them pretty encouraging. For example this one : https://academic.oup.com/sleep/article/43/7/zsaa045/5811697?login=true
Quoting the conclusion :

Data from multisensor consumer wearables are strongly correlated with reference devices at the epoch level and can be used to develop epoch-by-epoch models of sleep–wake rivaling existing research devices.


So I'm still quite hopeful about this and will try and give it a go in the next few months.


RE: PineTime Sleep Tracking - wibble - 12-18-2021

That does look more promising - perhaps what I read was outdated, or looking at the measures individually. Good luck - it would be good if you can get it to work well.


RE: PineTime Sleep Tracking - eFqLLnGo - 12-18-2021

Thanks! I created a very preliminary repo where I will develop the thing. Just linking it here in case anyone has a similar project Smile. Don't duplicate the effort!

https://github.com/thiswillbeyourgithub/sleep_tracker_pinetime_wasp-os


RE: PineTime Sleep Tracking - ksotar - 02-05-2022

Hi there, a new user of PineTime here.

As a many years user of Sleep As Android app, I can say that an accelerometer and a good algorithm is more than enough to have a sleep tracking.

As for optical pulse sensing, the same applies too, for example, my wife got some Garmin watch that do great in matter.

Problem with Sleep As Android is that there are hundreds of phone models, each with different hardware/software combination. So, I have poor performance with a Redmi phone.

That way, single platform with a certain hardware (i.e. PineTime) is ideal for finetuning.

Sleep As Android is capable to integrate various smart watches to get data, so I'm intended to do a little research here. It is always nice to have smartphone power to do math, while some wearable is providing data.


RE: PineTime Sleep Tracking - wmertens - 09-09-2022

(02-05-2022, 04:44 AM)ksotar Wrote: Problem with Sleep As Android is that there are hundreds of phone models, each with different hardware/software combination. So, I have poor performance with a Redmi phone.

That way, single platform with a certain hardware (i.e. PineTime) is ideal for finetuning.

Sleep As Android is capable to integrate various smart watches to get data, so I'm intended to do a little research here. It is always nice to have smartphone power to do math, while some wearable is providing data.

So Sleep As Android recently got Infinitime >1.9.0 support, and it works great.

However, it doesn't seem to do heart rate tracking. Anybody here know how to enable that?