Any electronics geeks out there?

General Discussion on any topic relating to CPAP and/or Sleep Apnea.
User avatar
jedimark
Posts: 1300
Joined: Fri Feb 18, 2011 12:45 am
Location: Bundaberg, Australia
Contact:

Any electronics geeks out there?

Post by jedimark » Tue Jun 17, 2014 9:44 pm

As a side project, I'm playing with some micro-controller stuff again, after a few years of letting my electronics skills get a bit rusty. It's a nice feeling having my soldering iron out again.

I'm working on a design for a data logging "box", with a respiratory sensor that will provide flow rate (and related) data for people who don't have machines that record this information, plus a few other useful sensor inputs, which will be able to be imported into SleepyHead.

For starters, I plan on using an Arduino compatible board, or at least the Atmel MCU, and logging to an SD card, and perhaps later using Raspberry PI or similar for a little on-the-fly waveform parsing. (and perhaps even later on down the track, a new design featuring a PWM controlled ducted fan, adjusting speed rapidly based on detected events? )

This is the data sheet for the pressure transducer I'm going to test for this purpose: http://www.freescale.com/files/sensors/ ... PX5010.pdf
I originally ordered one for a tank level sensor for my Aquaponics system expansion, but after reading the data sheet, I think it will do perfectly for this project.

My ideal little device will have a real time clock, SD card socket, a respiratory sensor, orientation sensor, accelerometer sensors for basic "sleep staging", and perhaps some kind of effort belt once I figure out a practical way to construct one. (Perhaps the accelerometer alone will give enough data to gauge chest movement?) Maybe even an input for an external oximeter clamp, to keep the timestamps neatly lined up for SleepyHead. If any pins are left over (shift register IC's will help conserve outputs here, or just use a bigger MCU), perhaps even a sexy little LCD display. And perhaps a LiION charge circuit and battery, in addition to DC jack.

I was delighted to discover the gcc compiler used in the Arduino IDE supports all my favourite C++ toys, so programming these devices is an absolute breeze. I've already written a nice little general purpose task scheduler and had a little explore through the MCU's power saving modes, plus tinkered with all my little sensors and outputs I had on hand already. I'm very much liking the Atmel chip design (previously, I only ever used Pic MCU's).

If anyone has any comments, suggestions, or is interested in helping design/build/back/etc such a project, I'd be delighted to hear from you.

And don't worry, I'm still working hard on SleepyHead, I just need to break things up a bit sometimes or I go bonkers.

/Mark

_________________
Machine: ResMed AirSense™ 10 AutoSet™ CPAP Machine with HumidAir™ Heated Humidifier
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: CMS50D+/F Oximeter, S9 VPAP Auto/Adapt, PRS1 Auto, Intellipap Auto, SleepyHead :)
Author of the free, cross platform, open-source sleep tracking software SleepyHead.
Download http://sleepyhead.jedimark.net
Source Code http://gitlab.com/sleepyhead/sleepyhead-code

User avatar
chunkyfrog
Posts: 34545
Joined: Mon Jul 12, 2010 5:10 pm
Location: Nowhere special--this year in particular.

Re: Any electronics geeks out there?

Post by chunkyfrog » Tue Jun 17, 2014 9:49 pm

I am in awe of you, Mark. We are not worthy, etc.

_________________
Mask: AirFit™ P10 For Her Nasal Pillow CPAP Mask with Headgear
Additional Comments: Airsense 10 Autoset for Her

User avatar
palerider
Posts: 32299
Joined: Wed Dec 16, 2009 5:43 pm
Location: Dallas(ish).

Re: Any electronics geeks out there?

Post by palerider » Tue Jun 17, 2014 11:20 pm

jedimark wrote: This is the data sheet for the pressure transducer I'm going to test for this purpose: http://www.freescale.com/files/sensors/ ... PX5010.pdf
I originally ordered one for a tank level sensor for my Aquaponics system expansion, but after reading the data sheet, I think it will do perfectly for this project.
the differential model might work for your flow sensor, that's what the resmed models use (not that particular one but a differential sensor reading both sides of a baffle. and then a regular pressure sensor at the output to read ... well, pressure

_________________
Mask: Bleep DreamPort CPAP Mask Solution
Additional Comments: S9 VPAP Auto
Get OSCAR

Accounts to put on the foe list: dataq1, clownbell, gearchange, lynninnj, mper!?, DreamDiver, Geer1, almostadoctor, sleepgeek, ajack, stom, mogy, D.H., They often post misleading, timewasting stuff.

aytikvjo
Posts: 73
Joined: Tue Apr 01, 2014 7:13 pm
Location: Chicago, IL

Re: Any electronics geeks out there?

Post by aytikvjo » Wed Jun 18, 2014 7:28 am

Hey, MechE here in controls /automation

I played with doing some stuff like this a while back, but mainly focus on a quick and dirty diagnosis of an apnea.
I also stuck to the arduino platform because it was a quick way to get a SD-card data logger up and running. Most of my experience with it is in motion control though, and even then half of that was with PIC's.

My design used a simple nasal cannula for oxygen administration to detect breathing out of the nose. The pressures here are pretty low, on the order of magnitude of 10-100 Pa, so a pretty sensitive pressure transducer is required.
The part I was going to play with is digikey # 223-1110-ND http://www.digikey.com/scripts/DkSearch ... 2278369829

There are hundreds and hundreds on the market, but that one was reasonably cheap and had a convenient digital output. If you're good at analog frontend stuff you could probably design one based around an analog transducer, but part count would increase due to need of amplification and filtering. Going this way would at least let you save on digital I/O pins, but you're kind of limited by Arduno's 10bit ADC.

As to externally capturing the data usually avaialble from a typical cpap machine, i'm assuming all this would be in-situ and you don't want to modify / use a special mask:
I think the biggest challenge here is to find a cheap and available orifice plate adapter that can be used in-line on the proximal mask connection.

Starting point: Check out Respironics part # 1050408 or 1050534. These are proximal orifice plates for the Trilogy 200. Expensive though at like ~$30 each. But at least you know that they will perform to an adequate specification for the task at hand.
Without a spec sheet though It's pretty hard to guess at what the flow rate vs. pressure drop across the plate will be, so you'll probably have to do a little guesswork as to appropriate transducers and then rebuild the flow rate vs. delta P curve.
If I had some measurements of the internal dimensions I could probably crack open my old fluids book and get a good estimate.

There are probably other online sources for flow sensors like this for cheaper.

The effort belt is a good idea, it would allow you to differentiate between centrals and obstructives. I'm going to look at how these things are constructed out of curiosity. They use them in sleep labs so there must be pretty standardized design or even cheap supplier out there somewhere.

I guess a lot of the design work depends on how off the shelf you want to go. There are a multitude of Aruino shields that have sd card capability, LCD's, HMI boards, etc etc but they can be kind of 'dirty' looking and aren't really appropriate for a product to be used by normal people. At some point you might find you want to spin your own boards / enclosures and at that point the Arduino software side can be more restrictive than you want for the amount of effort you'd be putting in.

Could you elaborate on what you would use the accelerometer for / how you are going to mount it( You'll need a triple axis for position data)?

Thats all I got for now, i'll probably think of more later / refine.

User avatar
archangle
Posts: 9293
Joined: Sun Mar 27, 2011 11:55 am

Re: Any electronics geeks out there?

Post by archangle » Wed Jun 18, 2014 2:24 pm

One thing many CPAPers really need is a "don't take off the mask in your sleep" gadget.

I visualize some sort of nagging alarm, and some sort of "drunk test" to turn it off. Many people take their mask off, store the hose, and turn off the machine but don't remember doing it the next morning.

I'm thinking of several options.

1) A potty break setting. Gives you x minutes before it goes off so you can take a bathroom break. Maybe with a "snooze button" type setting or just always wait x minutes before setting off an alarm.
2) A "combination lock" setting to turn it off. You have to press a certain button sequence or respond to some sort of challenge/response test. Something you can't easily do without waking up fully. It would need to be something of variable complexity since some people seem to be more able to do something complex "in their sleep."
3) A "get up out of bed" setting. You have to get out of bed, and push a button or grab something across the room to shut the alarm off. No turning it off "for just a minute" and falling back to sleep.
4) Covers the scenario of taking the mask off, and also the scenario of turning the machine off.
5) A big leak warning.
6) A very long apnea warning.
7) A power outage/machine failure warning.
8) Other event alarms.

You'd want all of these things to be configurable.

_________________
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: Also SleepyHead, PRS1 Auto, Respironics Auto M series, Legacy Auto, and Legacy Plus
Please enter your equipment in your profile so we can help you.
Click here for information on the most common alternative to CPAP.
If it's midnight and a DME tells you it's dark outside, go and check for yourself.

Useful Links.

User avatar
palerider
Posts: 32299
Joined: Wed Dec 16, 2009 5:43 pm
Location: Dallas(ish).

Re: Any electronics geeks out there?

Post by palerider » Wed Jun 18, 2014 3:31 pm

archangle wrote:One thing many CPAPers really need is a "don't take off the mask in your sleep" gadget.

I visualize some sort of nagging alarm, and some sort of "drunk test" to turn it off. Many people take their mask off, store the hose, and turn off the machine but don't remember doing it the next morning.

I'm thinking of several options.

1) A potty break setting. Gives you x minutes before it goes off so you can take a bathroom break. Maybe with a "snooze button" type setting or just always wait x minutes before setting off an alarm.
2) A "combination lock" setting to turn it off. You have to press a certain button sequence or respond to some sort of challenge/response test. Something you can't easily do without waking up fully. It would need to be something of variable complexity since some people seem to be more able to do something complex "in their sleep."
3) A "get up out of bed" setting. You have to get out of bed, and push a button or grab something across the room to shut the alarm off. No turning it off "for just a minute" and falling back to sleep.
4) Covers the scenario of taking the mask off, and also the scenario of turning the machine off.
5) A big leak warning.
6) A very long apnea warning.
7) A power outage/machine failure warning.
Other event alarms.

You'd want all of these things to be configurable.
you forgot #9... superglue..

_________________
Mask: Bleep DreamPort CPAP Mask Solution
Additional Comments: S9 VPAP Auto
Get OSCAR

Accounts to put on the foe list: dataq1, clownbell, gearchange, lynninnj, mper!?, DreamDiver, Geer1, almostadoctor, sleepgeek, ajack, stom, mogy, D.H., They often post misleading, timewasting stuff.