# Sleep and Dreams > Research >  >  Sensosr for detecting REM sleep

## frost458

Hi,

Do any of you knows good sensors for detecting rem sleep?
I'm in electronics engineering so I can work with anything.

I found 3 ways of reliably detecting rem sleep :

Heart rate : R-R power spectrum in the low frequency is quite different during rem sleep
eyes movement : it's in the name, REM, rapid eyes movement.
ECG : just monitor the right signals

*Heart rate :*
I recently made an optical heart rate sensor working on you finger, forehead or ear lobe.
But it is greatly influenced by movement, plus keeping it 9h on you while you sleep require unconfortable attachment method.
influenced by movement : movement in any of your lim will chance the blood flow and cause false readings.

I wouldn't use an electrical ECG, it has electrodes directly in contact with your skin, too many things can lead to fibrilation.

*EOG :*
I could make a optical EOG to detect eye movment but you get the same problem than before :
hard to keep in place
unconfortable
However motion artifact can be ignored using a accelerometer, and thus being able when the head is moving.

Electrode based EOG is also out of the question for the same reason than the ECG.

*ECG :*
Too complex, to get a reliable rem detection you need a lot of electrodes (and dangerous, because electrodes)
commercial ECG like zeo are just not reliable at all.

----------------------------

Commercial sensors :
I found a wrist optical based sensor for heart rate : mio alpha
but it's expensive, 200$, I have no idea if the heart rate reading is really reliable or not
and I have no idea if it's hackable or not (if the circuit is drowned in epoxy resin I won't be able to do anything).

So if any of you know any other way, or any other sensors.

----------


## Goldenspark

I don't know why you hink Zeo is not reliable. I still use mine and it looks to produce believable results. I wake after each REM cycle with good dream recall, so I can tell it's working.
They claimed 70% of sleep lab reliability.

----------


## IAmCoder

I have tried everything and invented some more. The best sensor I have found so far is OpenEEG. You can get it plug-and-play ready for under $200.

I have recorded my heart rate during sleep, but have not been able to work out an algorithm to detect REM sleep from it yet. Here is a minute long printout:



How would you go about working out when REM occurred? I have logs of an entire night, and could record in parallel with other sensors if that helps.

I just started looking into EOG from a camera stream. I measure the amount of change between each frame - it seems like the most promising as it is non-invasive.

----------


## Goldenspark

Have you watched the Zeo seminars;
Behind the Headband (1): How Zeo Works - YouTube
The difficult bit is turning the complex signal into the four simple stages that they do in Zeo  "Wake - Light - REM - Deep". They claim to use some fuzzy logic to do it.
I don't imagine it is that easy!

----------


## IAmCoder

The different stages of sleep are much harder to see. I just look for rapid eye movements - too easy.

----------


## philquiet

I've heard of an alarm clock Iphone app that use the built-in accelerometer. You place the phone somewhere on the mattress and apparently movements during sleep can tell about the sleep cycle. Also there's image processing, for example with a webcam, for analysing your movements during sleep.

----------


## philquiet

For the hearth rate: I've tried to hunt the algorithm once, but the only clue I had is that it is about the "rate of change" of the heart rate.

----------


## xqua

Hi Guys,

If you still are interested in finding an algorithm that works, it is described in that paper. 
It is an increase in the chaotisity that you are looking for (decrease in D2 degree of freedom)

Good luck ! ^^

PS : I can't post links so here is the references :

Nonlinear analysis of continuous ECG during sleep II. Dynamical measures
J. Fell, K. Mann, J.Roschke, M. S. Gopinathan
Department of Psychiatry, University of Mainz, Untere Zahlbacher Strasse 8, 55101 Mainz, Germany
Department of Chemistry, Indian Institute of Technology, 600 036 Madras, Chennai, India
Received: 7 June 1999 /Accepted in revised form: 10 December 1999

----------


## IAmCoder

Elite, thanks.

I have an algorithm and channel for heart-rate variability (not shown in the minute above). It sounds like chaotisity is related to that. What is the D2 degree of freedom? Any pointers for the algorithm - count the variance between the amount of milliseconds between each heartbeat in a minute, and if that variance is significantly higher in a given minute, trigger the audio track?

----------


## StephL

> I don't know why you hink Zeo is not reliable. I still use mine and it looks to produce believable results. I wake after each REM cycle with good dream recall, so I can tell it's working.
> They claimed 70% of sleep lab reliability.



I found this:





> *Sleep coach company Zeo is shutting down
> By: Brian Dolan | Mar 12, 2013 *  
> Since late last year it has been something of an open secret in some digital health circles that Newton, Massachusetts-based sleep monitoring and coaching company Zeo was winding down its operations and searching for a buyer. At least one investor was making veiled references to the company running out of money during various question-and-answer periods at the mHealth Summit in Washington DC last year. Zeo’s absence from the Consumer Electronics Show (CES) in Las Vegas this year — a must-attend for any company selling devices and companion services to consumers — was telling.
> 
> This past week the Better Business Bureau listed the company as being “out of business” and Zeo CEO Dave Dickinson participated in an online TEDMED event as the company’s “former CEO”. While there is no official announcement, no known buyer yet, it’s clear that Zeo as we knew it is now over.
> 
> Zeo’s original offering was a sleep monitor that included a wireless-enabled, sensor-equipped headband that users wore at night and a bedside display alarm clock that captured the data transmitted from the headband. When Zeo was first conceived by a group of Brown University students almost 10 years ago, the idea was for an alarm clock that could wake you up at just the right moment in your sleep cycle, during the right sleep stage, so that you would awake feeling refreshed. Zeo’s alarm clock had this functionality built right in when it launched in 2009. Before that launch, however, the startup discovered in early product tests that users wanted a device that could do more than just wake them up better, they wanted to know how well they were sleeping, too.
> 
> “They wanted to know more about how they could get more REM and deep sleep,” Zeo Co-Founder and former CTO Ben Rubin told MobiHealthNews in 2010. “They wanted explanations for why they woke up seven times last night and how they can improve that. So we set about creating not just a smart alarm clock, but a personal sleep coach that would show you what was affecting your sleep and suggest improvements that could be made.”
> ...



That sounds like a sad story!!





> Have you watched the Zeo seminars;
> Behind the Headband (1): How Zeo Works - YouTube
> The difficult bit is turning the complex signal into the four simple stages that they do in Zeo  "Wake - Light - REM - Deep". They claim to use some fuzzy logic to do it.
> I don't imagine it is that easy!



That video is so horrible, that I didn't go on watching it - acoustically.
Fuzzy logic is not only a cute name also!  :wink2: 
So you say the thing works?
Wow!
Who else?





> Hi Guys,
> 
> If you still are interested in finding an algorithm that works, it is described in that paper. 
> It is an increase in the chaotisity that you are looking for (decrease in D2 degree of freedom)
> 
> Good luck ! ^^
> 
> PS : I can't post links so here is the references :
> 
> ...



Shame you can't - German again - and India - great - thank you for lurking into DV to tell us this!

----------


## IAmCoder

xqua, you should be able to post links now... here they are in any case:
Nonlinear analysis of continuous ECG during slee... [Biol Cybern. 2000] - PubMed - NCBI
http://epileptologie-bonn.de/cms/upl.../fell/Ecg2.pdf

Can you please have a quick look at the raw data here: 2013-05-03  Synchronous Heartbeats | LSDBase.

It was recorded at 10 Hz - is that enough to see increases in chaotisity or should I record again a little faster?

----------

