HOME SLEEP LAB WITH INFRARED CAMERA

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:

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by jedimark » Fri Jun 17, 2011 9:31 am

Jay Aitchsee wrote:OK Jedi, sync the video, sounds great!
Now the next thing that I want to do is count leg movements (PLMD). I've tried some pedometers but didn't have much luck. Primarily because they're designed to work in the vertical plane. There are some that have more than one accelerometer so they work in two planes but they cost a little more and I haven't got around to buying one yet. Another possibility is motion detector circuitry. So, once we get the counter going we want to sync it to the rest of the software and we've just about got the Lab complete!
Just one more thing we need - a way to accurately capture arousals. To me, that seems the hardest. Even the medicos cant seem to agree completely on the definition and method of measurement. It would seem though, that brain wave monitoring is essential. The ZEO has some promise, but I'm not convinced it actually works. I know you did some work with one a while back. What did you think?
Just some things to think about. I don't want you to be getting bored.
Jay
WiiMotes.. <--bulky, and switches itself off when not in use (though I think there is a setting to control this), but easy bluetooth devices to work with. And good accelerometers, especially with Motion plus.
The balance board would also be worth doing to if I did that.. (very decent pair of scales.) Now if only I could work a practical use for the GuitarHero controllers.

I've already done some ZEO comparisons.. It's not particularly good at detecting what kind of sleep your in, but it's a pretty good indicate of if you are actually asleep. It only had 30second accuracy with thes CSV files I played with, which makes drawing useful conclusions difficult, even with a timesynced cpap machine. I have loader work for ZEO I've already done that I can port over when I get around to it.
There is a custom firmware (by Zeo) that allows you to access raw .dat files which include brainwaves.. The newer machines have a serial port with live brainwave data streaming..

There is also the SleepTracker watch, and some iphone apps, (both "solutions" accelerometer based)... but ZEO's got (slightly) more going for it than those things..

A microphone is easy.. If it's sensitive enough, you'll be able to pick up stuff.. provided the room is quiet (and you don't have b***tard dogs barking not stop all night like my neighbors) and your not a constant sleeptalker.

Webcam with software can do all the motion detection stuff... provided it's got the I/R lighting.. (No sense recording data with you just laying there doing nothing but light breathing.. might miss the start of events though.)

If you want much more than that, your better off getting into ECG/OCG.. (incidentally, SH's foundation could do multi channel ECG quite well, but it's meant to be home software.)
Though if you honestly liked being hooked up to a ECG hairnet/tangled web every night, your probably a little bit nutty.

_________________
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
Lizistired
Posts: 2835
Joined: Tue Dec 14, 2010 10:47 pm
Location: Indiana

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Lizistired » Fri Jun 17, 2011 7:15 pm

More info on arousals would be cool! I know mine are fewer now though. I'm sure I'm sleeping deeper by my mouth falling open. So it's progress.
Jay I have to see if mine will do frame by frame. It goes so fast..
On lighting: Would have to use several tv LEDS to get enough light. They project a pretty direct beam.
What did work great was a black light bulb. I remembered I had one, 60W. Waste of wattage but nice dark light. I have in a clip light with a shade so I don't see the bulb.
Went to sleep at 23:30, woke up at 04:30 to find Windows installed updates and restarted my computer at 00:30!
Auto updates is off now. Tonight is another night.

_________________
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
Jay Aitchsee
Posts: 2936
Joined: Sun May 22, 2011 12:47 pm
Location: Southwest Florida

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Jay Aitchsee » Sat Jun 18, 2011 7:42 am

Liz,

I was waiting to see how it went. Discouraging about the auto-update, huh?

Black light, that's cool. I guess anything on the edge of the visible spectrum will work. Black light, isn't that ultra violet? Do you suppose there's a risk of exposure there?

I thought the beam from one IR Led might be too narrow. Unless, of course, you just wanted to focus on your head or something. The room I'm using for a lab has a chandelier with a dimmer. I just swapped out a couple of the red lights for the whites and loosened the others so they wouldn't come on and I have a dimmable red light source. I put the reds in a spot I couldn't see from the bed and I get nice ambient red that doesn't bother me. I think I'll go down to radio shack and pick up a few IR LED - maybe 10 and arange them in a circle so they shine on the bed like a flood. Or, maybe not, the reds work pretty good for me.

Did you read Jedimark's post on measuring other variables? Cool stuff there. I think, though, that for arousals wer'e pretty much limited to EEG type info. I want to pursue the ZEO further, I think it may be able to tell us something useful.

If you want to get more individual frame data, I think you could change the number of FPS your video maker is using, It's probably about 25 now. You could essentially make a slow motion time lapse - I think. The other possiblility is the raw data. The still's used to make the video are somewhere (I dump mine into recycle after making the video) on your computer. You could call up those to see individual frames.

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
JointPain
Posts: 261
Joined: Thu Apr 28, 2011 10:41 am
Location: Houston, TX

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by JointPain » Sat Jun 18, 2011 8:28 am

I tried this in visible light using an LED torch set to moonlight (very low) level and my DSLR with a fast lens set wide open and slow exposure (0.5 second per frame). The light was dim enough it didn't bother me and the camera had pretty good exposure (noisy but more color than I could see with my eye), and the resulting video was quite good. Unfortunately, I can't lock my mirror up, so every 10 seconds there was loud racket from the camera as it took another frame. No way could I sleep with that.

Someone with a mirror-less camera might have better luck. Or, I could try building a glass-fronted soundproof box.

_________________
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: Pressure is 11-14. Old CPAP was a Resmed S6 Lightweight. Also have Profile lite mask. ResScan is actually version 3.14. Now I use Sleepyhead.

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

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Jay Aitchsee » Sun Jun 19, 2011 8:10 am

Lizistired,
With my version of Media Player (Win 7), If I right click on the video playing and then select "enhancements" and then "Play speed settings", it brings up a tool that allows changes in playback speed and buttons to select next or previous frames.
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
Lizistired
Posts: 2835
Joined: Tue Dec 14, 2010 10:47 pm
Location: Indiana

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Lizistired » Sun Jun 19, 2011 3:11 pm

Jay Aitchsee wrote:Lizistired,
With my version of Media Player (Win 7), If I right click on the video playing and then select "enhancements" and then "Play speed settings", it brings up a tool that allows changes in playback speed and buttons to select next or previous frames.Jay
Thanks, I'll try that. I've just been using the "YouCam3" software that came loaded with the laptop camera.
Well, The black light works great.
After the Windows Update Thursday night...

Friday night we had storms again, the power went out, I didn't wake up, so I didn't take my mask off... and damn near suffocated.. o2 dropped to 77% and some point. I was a zombie all day till I just finally went back to bed. Also figured out that the time lapse software on my computer defaults to a 2 hour shut off, so I know to set that now. But I had no idea how long the power was off or when it came back on. Just that the S9 came back on 4 times for a short period and I wasn't breathing during any of them. One was for 95 seconds.

Sat evening I went in search of a "power out" alarm, but no one had them in stock so I have one on order.
https://www.cpap.com/productpage/relian ... light.html
Sat night, more storms, sirens went off, then the power went off after I went back to sleep. It's nice that I can tell how long it was off by the camera because I didn't put my mask back on for another 1.5 hours after it came back on. So I'll have the power out alarm, to tell me to take the mask off. And my storm radio, an old Panasonic AC/DC is going to get plugged in from now on so I hear it when the power comes on, to put the mask back on.

The video is great. I found out the leak problem I have been having is when I turn on my right side and the hose pulls on the mask. So I extended the hose and I'll be able to see if that fixes it.

_________________
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
Jay Aitchsee
Posts: 2936
Joined: Sun May 22, 2011 12:47 pm
Location: Southwest Florida

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Jay Aitchsee » Sun Jun 19, 2011 4:39 pm

Wow Liz, I guess you do need a power off alarm. Are you a mouth taper? Nasal pillows and mouth tape would be kind of suffocating without power, I'd think. I haven't used them in a while, but it seems it's easier to breath with my FFM when the machine is off.

You should be able to play back your videos with Media Player and then have the ability to see frame by frame.

Glad that black light is working for you. I'm trying something new tonight. I've painted a couple of the small red bulbs and a couple of clear night light bulbs black with a Sharpie felt tip pen. I tested them today in the daylight and they seem to work. I'm sure they run hotter with the black paint so they'll probably burn out quicker but it's another good experiment.

I did try lighting by a tv remote and it's definitely brite enough, but the beam's just too narrow. I think it might require a minimum of 6. Next time I go to town, I think I'll stop by radio shack and pick up a few LED's and resistors. I've got several old AC to DC transformers laying around, out of old phone sets, etc. I can probably find one that will work as a power supply.

I put out a request for feedback on ZEO's and haven't got a lot, but they're on sale now for $159, so I'll probably just go ahead and buy one. I haven't had a major issue with desats so I don't have an oximeter. What are you using? I figure with an oximeter, Zeo, infrared lighting, and autopap I'll just about be able to start taking in clients for PSG's.

I'll let you know how the painted bulbs work out. Hope you get your alarm soon.

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
Lizistired
Posts: 2835
Joined: Tue Dec 14, 2010 10:47 pm
Location: Indiana

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Lizistired » Sun Jun 19, 2011 7:49 pm

Jay Aitchsee wrote:Wow Liz, I guess you do need a power off alarm. Are you a mouth taper? Nasal pillows and mouth tape would be kind of suffocating without power, I'd think. I haven't used them in a while, but it seems it's easier to breath with my FFM when the machine is off.
Actually I had tried taping that night, though I haven't had much luck with it. I wasn't expecting the storm or power outages or I wouldn't have tried it that night. I have no idea when I took it off. I'm disappointed because I always loved sleeping in stormy weather. "Good sleepin' weather" we called it. But since they installed a storm siren about 150 feet from my house, that is a thing of the past now. The damn thing sounds to tell you it's going to sound again in 10 minutes.... wtf? I don't know what it means, thunderstorm vs tornado, so I turn on the TV, and can't hear the weather report because the damn siren goes for 2-3 minutes. Gee, you woke me up for a thunderstorm?? This year has been extreme for storms and power outages.
Jay Aitchsee wrote: Glad that black light is working for you. I'm trying something new tonight. I've painted a couple of the small red bulbs and a couple of clear night light bulbs black with a Sharpie felt tip pen. I tested them today in the daylight and they seem to work. I'm sure they run hotter with the black paint so they'll probably burn out quicker but it's another good experiment.

I did try lighting by a tv remote and it's definitely brite enough, but the beam's just too narrow. I think it might require a minimum of 6. Next time I go to town, I think I'll stop by radio shack and pick up a few LED's and resistors. I've got several old AC to DC transformers laying around, out of old phone sets, etc. I can probably find one that will work as a power supply.
I might try a dimmer on my black light. It works really well and I kind of like the glow! here's a link I found on using floppys on flashlight bulbs. http://lucidscience.wordpress.com/2011/ ... s-project/
I may try something like this. I have a wall lighter plug adaptor and a variable voltage lighter plug that goes up to 12 volts, so I might try that with various flashlight bulbs and reflectors.
I saw some infrared LED discs for security cameras on EBAY for a couple bucks a piece but you would probably have to wait for them to ship from china. I think they were 12 volt. Up to 48 LEDS.

My oximeter is the CMS-50F, the wrist unit. I bought the finger 50H but it was uncomfortable compared to this one.
I hope you get some feedback on the ZEO. My impression was that it wasn't doing much or people would be bragging about it.

_________________
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
Jay Aitchsee
Posts: 2936
Joined: Sun May 22, 2011 12:47 pm
Location: Southwest Florida

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Jay Aitchsee » Sun Jun 19, 2011 8:40 pm

Liz, enjoyed the link. I probably have some floppys squirreled away somewhere, I'll have to try and find 'em.

The painted bulbs worked great. I used three red C7 bulbs, went over them with a black felt tip, it's difficult to cover the bulbs completely with the felt tip, but that's OK. Each bulb has a few slivers of red showing through - just enough to yield some very low ambient lite, kind of like a soft glow, not at all distracting, but yielding plenty of IR light for the webcam.

For me, I'm satisfied with the results of the painted red bulbs. For infrared generators, it looks like incandescent bulbs are one of the most practical sources, but they produce a lot of heat and need some type of visible light filter or IR pass filter. See the link provided by Lizistired above for various filter materials. One material not mentioned in the link is black garbage bag. Unfortunately, most of the readily availble filter materials are sensitive to heat.

I see Amazon's got an Infrared LED light source for cameras, a Sima SL-100IR, for less than $25 that has received good reviews there and on other sites. Can't hardly build one for that. Advantage of LED, far less heat, no filter required, no visible light.

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
Jay Aitchsee
Posts: 2936
Joined: Sun May 22, 2011 12:47 pm
Location: Southwest Florida

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Jay Aitchsee » Thu Jun 23, 2011 9:28 am

Infared Flood Lamp

OK, here's the infrared lamp to go with the camera. I think it works pretty good. Keeps the room in total darkness, at least to humans. Biggest expense here was the LED's, less than 20 bucks. For power, I used an old cordless phone transformer I had laying around. I mounted 8 LED's in series with a resistor on a breadboard temporarily, but I'm thinking about using a small alarm clock body as a case.

If you wanted to use battery power, I'd suggest a couple of 6volt lantern batteries in series, or a small 12 volt. I think AA's might work but you'd have to string about 9 of them together, and then I'm not sure how long they'd last.

See here for the results of the experiment: https://www.youtube.com/watch?v=Y6y0FItoZdA
Keep in mind, the camera was not optimized. I think settings and placement can be tweaked a little.

See below for circuit particulars,
Jay

Power Supply = Discarded Cordedless Phone Power Supply, rated output 9V DC @ 420mA. As used, no load voltage = 15V, Operating voltage = 13V @ 75mA
Circuit Current, I = 75mA
Circuit resistance, R = 47 ohms, 1/2 watt
LED= (8ea.) Radio Shack Hight Output Infrared Led, $2.19 Ea.
Rated: Forward Voltage = 1.2 V, Forward Current = 100mA, Wavelength = 940nm
Total power used in circuit 975 mW, by Resistor 264 mw, by LED 711mW.
8 LED in series with one reisistor chosen to limit current to less than 100mA

E +----|>|----|>|----|>|----|>|----|>|----|>|----|>|----|>|---/\/\/----

Edit: Here's what it looks like: viewtopic.php?f=1&t=65101&st=0&sk=t&sd= ... 67#p697090

_________________
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
Last edited by Jay Aitchsee on Thu Apr 19, 2012 7:28 am, edited 1 time in total.

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

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by Jay Aitchsee » Wed Oct 05, 2011 5:39 am

Here's an old thread for new interest.

_________________
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

derek70
Posts: 99
Joined: Sat Dec 24, 2011 9:55 am

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by derek70 » Tue Mar 06, 2012 4:37 pm

Has anyone had success with a Infrared Pir with 6 Led as light source?
http://www.ebay.com/itm/Infrared-Pir-6- ... 377wt_1009

What's the cheapest way to get a infrared light?
I'm the kind of person that a light light annoys my sleep.
I need total darkness.

_________________
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Additional Comments: Diagnosed AHI ~40 / Titrated @ 10 / CPAP8 EPR 0

-tim
Posts: 710
Joined: Sat Dec 03, 2011 7:46 pm
Location: Melbourne Australia

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by -tim » Wed Mar 07, 2012 12:01 am

Keep in mind that bright IR light will effect the eye's iris (which is fun when the helpful traffic safety officer points a high power IR laser at your eyes...)

We have some b/w security cams at work that can see in starlight. Look for a low LUX rating. .2 is common and much lower ratings can be found on the lower pixel count devices.

LEDs are somewhat direction. Use a remote control to test your camera for IR (or after removing the filter).

If jedimark is still reading...
grab a frame, drop it to something like 64x64 in 16 color gray scale while dropping the outer frame of the image. You may have to balance the image first for cheap usb cameras. If that is the same as a the last 3 pictures, drop it. You can use hashes or just compare the whole thing. Modern computers won't spend much time doing that at all.

_________________
Mask: AirFit™ N20 Nasal CPAP Mask with Headgear
Humidifier: S9™ Series H5i™ Heated Humidifier with Climate Control
Additional Comments: Resmeds overpriced SpO2

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

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by BasementDwellingGeek » Wed Mar 07, 2012 7:24 am

The ad states:
Six bright white LED light
The leds are to light up the area when the PIR (Passive Infrared Sensor) detects motion. Typically these sensor detect the body heat of an object moving through various zones as defined by a machined lens. I saw nothing in the ad to indicate an IR light source.

_________________
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

derek70
Posts: 99
Joined: Sat Dec 24, 2011 9:55 am

Re: HOME SLEEP LAB WITH INFRARED CAMERA

Post by derek70 » Wed Mar 07, 2012 3:50 pm

i thought that the 6 leds were 6 infrared leds.

_________________
Mask: Swift™ FX Nasal Pillow CPAP Mask with Headgear
Additional Comments: Diagnosed AHI ~40 / Titrated @ 10 / CPAP8 EPR 0