Sleep Position Tracking, a diy approach

General Discussion on any topic relating to CPAP and/or Sleep Apnea.
User avatar
PaulC
Posts: 11
Joined: Wed Dec 28, 2022 5:17 am

Sleep Position Tracking, a diy approach

Post by PaulC » Sun Sep 06, 2026 5:31 am

I’ve been looking into ways to correlate sleeping positions to OSCAR datasets, especially SpO2 levels(acquired from a Wellue O2Ring with a 1 second sample rate and imported into OSCAR).

The sleep position sensors I could find don’t seem that great, and strapping a cellphone to my chest sounds very uncomfortable.

I decided to do a diy build of a wearable sensor that records the time and sleeping position every second, and then integrate that data into the oxygen/heartrate dataset timeline.
I want it to be as small and light as possible.
I decided on using a small “nRF52840 Sense” device, it has some interesting and useful specs, like a 6-axis IMU (Inertial Measurement Unit), which includes:
3-axis accelerometer — measures linear acceleration
3-axis gyroscope — measures rotational motion
Accelerometer range: ±2g / ±4g / ±8g / ±16g (selectable)
Gyroscope range: ±125 / ±245 / ±500 / ±1000 / ±2000 dps (degrees per second)

I wired it to a very small lithium ion rechargeable battery, and programmed it to detect sleeping position every second and onboard record that with timestamps.
Total cost ~$20.
The combo weighs 5 grams and can be easily and comfortably worn on a chest strap, elastic collar, or other method.

Have been using for a few nights so far and it works quite well.
I post-process the data it captures to integrate into an SpO2 spreadsheet, and also a produce a Somnopose formatted file that imports directly into OSCAR, adding Orientation and Inclination graphs to the OSCAR graph set.

I may build a few more of these and try them out on other data capture tasks, like gait analysis, athletic position/speed recorders, or lots of other potential uses. (suggestions welcomed)
Attachments
SPREADSHEET2.png
SPREADSHEET2.png (650.24 KiB) Viewed 72300 times
OSCAR.png
OSCAR.png (269.42 KiB) Viewed 72300 times
HARDWARE2.jpg
HARDWARE2.jpg (87.81 KiB) Viewed 72300 times

RNeil
Posts: 79
Joined: Tue Jul 31, 2018 7:58 am
Contact:

Re: Sleep Position Tracking, a diy approach

Post by RNeil » Tue Sep 22, 2026 9:02 am

Cool!

User avatar
kteague
Posts: 7793
Joined: Tue May 16, 2006 8:30 pm
Location: West and Midwest

Re: Sleep Position Tracking, a diy approach

Post by kteague » Tue Oct 20, 2026 2:31 am

I'm not technical enough to have any meaningful conversation about this but just thinking back to when I was dealing with such horrid periodic limb movements this or some version of it could have been helpful to me. A whole lot of position changes could have been an indicator whether my treatment was working or not without repeated stints in the sleep lab with my legs wired.