Another tool/toy in the home sleep lab.

General Discussion on any topic relating to CPAP and/or Sleep Apnea.
User avatar
BasementDwellingGeek
Posts: 262
Joined: Sat Nov 05, 2011 12:54 pm
Location: N Billerica, MA, USA
Contact:

Another tool/toy in the home sleep lab.

Post by BasementDwellingGeek » Tue Jun 05, 2012 11:24 am

I've long wanted to know what position my head was in when Apnea events occurred. There were also some strange waveforms in my breathing data that I theorized were movement related and sometimes were reported as Clear Airway Apnea events.

I started with a clone WII controller and an Arduino microcontroller. That project was scrapped well before the fruition because I became concerned after waking a few times with the CPAP hose wrapped around my neck. I was concerned that I might strangle myself in my sleep with a thin cord.

I spent many hours looking for an affordable compact data logger with an integrated multiple axis accelerometer. I settled on X16-1C from Gulf Coast Data Concepts, LLC. It's bigger and heavier than I would like but it's also ½ to to 1/3 the price of the next better choices.
http://www.gcdataconcepts.com/xlr8r-1.html

Image
The graph is a result of a short test displayed in the tool that came with the device. The highlighted areas are walking between bed and computer. The other area is the actual test. I held the device on my head where I intend to strap it onto my CPAP headgear. The red line at center is when facing ceiling. Then it rises to indicate left side of my face in the pillow and falls to indicate right side in pillow. The squiggles in the green and blue lines are a few sit up like gestures just to see how they would be displayed.

The test convinced me to forge ahead and integrate the data into my monitoring application. The first night my attempt at strapping the device to my headgear failed. Night 2 was better but I had not configured the device properly and had way too much data to be useful. The stars aligned on night three with good data for the full night. A few more hours of hacking code and now it's mostly integrated. Scaling is still somewhat arbitrary and the other two channels still need to be integrated to be able to tell if I am face up or have my face buried in the pillow.

Image
This is one of those strange waves mentioned above. It shows about 20 seconds of breathing. The horizontal represent plus and minus 25 lpm. Note the one larger inhalation followed by a period hovering around zero.

Image
Here it is again with overlaid head position data. The blue line shows rolling over from right side down to right side up. I appear to be holding my breath while moving.

Image
Here is a 5 hour slice of the night showing periodic roll overs.

Image
Another benefit is being able to explain some of the loss of signal in the CMS50. The blue line shows activity in the more less same position. The orange lines in the pink panel is where the Oximeter has lost signal. The green lines are SpO2, the blue line heart rate. There is a strong correlation with the head movement and lost signal. I'm guessing my hand moved too.

The device can also be strapped to a leg monitor Restless Leg Syndrome.

_________________
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: own home grown SW to make it all work together, SH too.
bdg
(PR System One REMstar Pro CPAP Machine with C-Flex Plus and related humidifier as backup)

There are two types of people in this world. Those that can extrapolate from incomplete data

User avatar
Lizistired
Posts: 2835
Joined: Tue Dec 14, 2010 10:47 pm
Location: Indiana

Re: Another tool/toy in the home sleep lab.

Post by Lizistired » Tue Jun 05, 2012 1:19 pm

That's interesting. Have you tried attaching it to your torso somehow?
I think I will stick to video for now... seems simpler for my brain. You might want to send a data sample to jedimark though.
You are right though, once you see what's happening the numbers don't mean as much. I tend to stop breathing when I wake and turn over. A solution to the arrousals is what I need.

_________________
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: Swift FX sometimes, CMS-50F, Cervical collar sometimes, White noise, Zeo... I'm not well, but I'm better.

User avatar
MaxDarkside
Posts: 1199
Joined: Sun Dec 18, 2011 4:21 pm
Location: Minneapolis, MN

Re: Another tool/toy in the home sleep lab.

Post by MaxDarkside » Tue Jun 05, 2012 1:36 pm

Very good, BasementDwellingGeek! Another data channel into your sleep. This makes me wonder about building an Android app that uses the accelerometer in my phone and blue-tooth xyz over to my laptop where it would be sucked into my system.

_________________
Mask: Quattro™ FX Full Face CPAP Mask with Headgear
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: CMS-50E Oximeter, Zeo Bedside, Software: Comm'l grade AI analytics server & tools & SleepyHead
Do or Die... Sleep Apnea killed me, but I came back. Click for my story
Please visit my My Apnea Analytics blog. Maybe we can help each other.
54 yrs, 6' 1", 160->172 lbs

User avatar
pats
Posts: 289
Joined: Sun Apr 22, 2012 5:52 pm

Re: Another tool/toy in the home sleep lab.

Post by pats » Tue Jun 05, 2012 2:14 pm

MaxDarkside wrote:Very good, BasementDwellingGeek! Another data channel into your sleep. This makes me wonder about building an Android app that uses the accelerometer in my phone and blue-tooth xyz over to my laptop where it would be sucked into my system.
There is now an Arduino IMU that is far smaller and lighter than a phone. Perhaps attach its cable to the hose?

_________________
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Additional Comments: Software: SleepyHead.

User avatar
avi123
Posts: 4509
Joined: Tue Dec 21, 2010 5:39 pm
Location: NC

Re: Another tool/toy in the home sleep lab.

Post by avi123 » Tue Jun 05, 2012 2:27 pm

The Recording Accelerometer X16-1C has too much data in it. What's needed in our cases are:

1) Indication of body position
2) Indication of sleep or awake
3) Synchronization with SleepyHead, ResScan, etc.

_________________
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments:  S9 Autoset machine; Ruby chinstrap under the mask straps; ResScan 5.6
see my recent set-up and Statistics:
http://i.imgur.com/TewT8G9.png
see my recent ResScan treatment results:
http://i.imgur.com/3oia0EY.png
http://i.imgur.com/QEjvlVY.png

User avatar
Jay Aitchsee
Posts: 2936
Joined: Sun May 22, 2011 12:47 pm
Location: Southwest Florida

Re: Another tool/toy in the home sleep lab.

Post by Jay Aitchsee » Tue Jun 05, 2012 4:13 pm

That's pretty cool, Geek. I'd like to see your position profile dislplayed with your Zeo sleep graph. In my case, I found a very high correlation between body position (IR video) and sleep stage as reported by Zeo. I also noted movement related apneas. It seems there is a natural tendency to hold one's breath when rolling over.
For those of us not quite so technically inclined, can you provide a source that might give us an idea how to build a similiar device? I'd like to monitor my leg movements (PLMD) for an objective measure of any therapy I might try. I don't want to learn to write code. I'd like to be able to just connect a couple of things like an accelerometer, to some sort of processor, whose output I could record on my laptop. Cheaply, of course.

Jay

_________________
Mask: AirFit™ P10 Nasal Pillow CPAP Mask with Headgear
Additional Comments: S9 Auto, P10 mask, P=7.0, EPR3, ResScan 5.3, SleepyHead V1.B2, Windows 10, ZEO, CMS50F, Infrared Video

User avatar
avi123
Posts: 4509
Joined: Tue Dec 21, 2010 5:39 pm
Location: NC

Re: Another tool/toy in the home sleep lab.

Post by avi123 » Tue Jun 05, 2012 5:04 pm

Jay Aitchsee wrote:That's pretty cool, Geek. I'd like to see your position profile dislplayed with your Zeo sleep graph. In my case, I found a very high correlation between body position (IR video) and sleep stage as reported by Zeo. I also noted movement related apneas. It seems there is a natural tendency to hold one's breath when rolling over.
For those of us not quite so technically inclined, can you provide a source that might give us an idea how to build a similiar device? I'd like to monitor my leg movements (PLMD) for an objective measure of any therapy I might try. I don't want to learn to write code. I'd like to be able to just connect a couple of things like an accelerometer, to some sort of processor, whose output I could record on my laptop. Cheaply, of course.

Jay
Comment,

Email to gcdc@gcdataconcepts.com and explain your need for the PLMD monitor. The cost of the
Recording Accelerometer X16-1C is $89. They might be able to rig something with it to suit your need for less than $100.

_________________
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments:  S9 Autoset machine; Ruby chinstrap under the mask straps; ResScan 5.6
see my recent set-up and Statistics:
http://i.imgur.com/TewT8G9.png
see my recent ResScan treatment results:
http://i.imgur.com/3oia0EY.png
http://i.imgur.com/QEjvlVY.png

User avatar
Jay Aitchsee
Posts: 2936
Joined: Sun May 22, 2011 12:47 pm
Location: Southwest Florida

Re: Another tool/toy in the home sleep lab.

Post by Jay Aitchsee » Tue Jun 05, 2012 5:58 pm

Email to gcdc@gcdataconcepts.com and explain your need for the PLMD monitor. The cost of the
Recording Accelerometer X16-1C is $89. They might be able to rig something with it to suit your need for less than $100.
Thanks, Avi. I'll look into it.
Jay

_________________
Mask: AirFit™ P10 Nasal Pillow CPAP Mask with Headgear
Additional Comments: S9 Auto, P10 mask, P=7.0, EPR3, ResScan 5.3, SleepyHead V1.B2, Windows 10, ZEO, CMS50F, Infrared Video

User avatar
BasementDwellingGeek
Posts: 262
Joined: Sat Nov 05, 2011 12:54 pm
Location: N Billerica, MA, USA
Contact:

Re: Another tool/toy in the home sleep lab.

Post by BasementDwellingGeek » Thu Jun 07, 2012 7:40 am

Liz, I suppose I could tape it to my body. At roughly 1 inch by 1 inch by 4 inch it might be uncomfortable to roll onto. I might try taping it to my abdomen some night just to see if I could correlate the movement to the breathing process. I figured that my face would facing the ceiling if I were on my back and the headgear was a convenient place to attach. It could possible confirm CAs. I did PM jedimark with the details.

That Arduino IMU is very interesting indeed. I was thinking about designing something similar with memory for logging until I found the X16-1C. The hassle and cost to prototype my own made the using the commercial product seem sensible.

Jay, after only 3 nights of data I might suggest that there is a tendency to change sleep state based on changing position.
Image

Image

Image

The only programming required is to edit the configuration file to specify how frequently to sample, the required amount of change to cause a sample to be recorded and how often to record in the absence of change. It's really pretty simple. The device records to a CSV file on an included SDcard. Just plug it into a USB port and it looks like a flash drive. You can load the CSV into Excel or Calc or whatever. But, the device has an installed application, a java JAR file, that does a pretty neat job of displaying the information. You can download the application for free http://www.gcdataconcepts.com/xlr8r.zip

I've posted some data you can use to check it out. http://www.basementdwellinggeek.org/CPA ... TA-002.zip

_________________
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: own home grown SW to make it all work together, SH too.
bdg
(PR System One REMstar Pro CPAP Machine with C-Flex Plus and related humidifier as backup)

There are two types of people in this world. Those that can extrapolate from incomplete data

User avatar
avi123
Posts: 4509
Joined: Tue Dec 21, 2010 5:39 pm
Location: NC

Re: Another tool/toy in the home sleep lab.

Post by avi123 » Thu Jun 07, 2012 9:19 am

BasementDwellingGeek wrote:
Jay, after only 3 nights of data I might suggest that there is a tendency to change sleep state based on changing position.
Question,

In those graphs which body positions are shown?

_________________
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments:  S9 Autoset machine; Ruby chinstrap under the mask straps; ResScan 5.6
see my recent set-up and Statistics:
http://i.imgur.com/TewT8G9.png
see my recent ResScan treatment results:
http://i.imgur.com/3oia0EY.png
http://i.imgur.com/QEjvlVY.png

User avatar
Jay Aitchsee
Posts: 2936
Joined: Sun May 22, 2011 12:47 pm
Location: Southwest Florida

Re: Another tool/toy in the home sleep lab.

Post by Jay Aitchsee » Thu Jun 07, 2012 10:02 am

Jay, after only 3 nights of data I might suggest that there is a tendency to change sleep state based on changing position
Or, vice versa.

That really interesting, isn't it Geek? I don't know how useful, but interesting.

Thanks for the info. I did go to GCDC site and saw that this would be pretty simple to set up. I may just have to get one.

Jay

_________________
Mask: AirFit™ P10 Nasal Pillow CPAP Mask with Headgear
Additional Comments: S9 Auto, P10 mask, P=7.0, EPR3, ResScan 5.3, SleepyHead V1.B2, Windows 10, ZEO, CMS50F, Infrared Video

User avatar
BasementDwellingGeek
Posts: 262
Joined: Sat Nov 05, 2011 12:54 pm
Location: N Billerica, MA, USA
Contact:

Re: Another tool/toy in the home sleep lab.

Post by BasementDwellingGeek » Thu Jun 07, 2012 10:07 am

Perhaps I should have typed head position. The only body position I can say with certainty is at the tail end of the night while I was laying on my back looking at the ceiling or the tops of the tree out the window. When the line is centered in it's range I infer that I am on my back. Other wise I am probably on my side or belly.

_________________
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: own home grown SW to make it all work together, SH too.
bdg
(PR System One REMstar Pro CPAP Machine with C-Flex Plus and related humidifier as backup)

There are two types of people in this world. Those that can extrapolate from incomplete data