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)

_________________
Machine: AirCurve™ 10 VAuto BiLevel Machine with HumidAir™ Heated Humidifier
Additional Comments: Resmed F30i mask
Attachments
SPREADSHEET2.png
SPREADSHEET2.png (650.24 KiB) Viewed 390 times
OSCAR.png
OSCAR.png (269.42 KiB) Viewed 390 times
HARDWARE2.jpg
HARDWARE2.jpg (87.81 KiB) Viewed 390 times