History of Lucid Dreaming devices
Stephan LeBarge and the Lucidy Institute were pioneers in developing devices to aid lucid dream induction and they were best placed for this because of the wider remit of the Lucidity Institute’s study of dreaming and the number of practicing lucid dreamers to test and develop hardware with. The DreamLight mask was developed in the early 90’s, not many of these were made available and they were very expensive. The NovaDreamer was the more commercial device that was produced following the studies with DreamLight/Dreamlink, I don’t know what they retailed for originally, they have never been cheap though and they are mega rare to find now.
The basic principle of these devices was to detect eye movement using IR and then cueing the user with a colour LED that would flash at set intervals, these flashes would be visible to a wearer within a dream state. This biofeedback mechanism had been proven to work with DreamLight and I’d argue that these masks, despite being nearly 30 years old, have never really been improved upon. There have been products that detect REM using brainwaves and there’s been some interesting studies recently that will no doubt lead to more of these – however to cue a user in a dream state, the best we’ve got in terms of biofeedback is still signalling via light, so I feel eye movement detection is still a more efficient and cost-effective approach given that you’ll still need some kind of hardware over the eye.
There was a company in Europe that developed the REM Dreamer & REM Dreamer Pro that used similar hardware and techniques that was basically a copy of the NovaDreamer, and these continued to sell after the NovaDreamer was discontinued in ~2004, I bought one of these at the time. The mask, despite being actually more comfortable than it looks, is still not actually comfortable. I can vouch that it detects eye movement and cues correctly but in most cases it would either wake me up from a dream state or it would just cue when I’d open my eyes in the morning. The latter kinds of issues would be easy to offset by adding an accelerometer and/or gyro to detecting face movement and thus wakefulness. Given that you are effectively paralised during dream state, if the device briefly assessed for motion, it could then make a better decision as to whether to cue a wearer or not.
Circuit PlayGround Express
The CPX is one of Adafruit Industries best selling products not least because it is such a versatile little dev board. It’s been updated several times and one of the newer features is support for CircuitPython, which makes development cycles much quicker where you just have to copy code to a single file for your application to work – no need for development environments and setting up. The drawback vs compiling as an Arduino sketch is I guess slower execution speeds and memory usage limitations – the code for this project is pretty much the very limit of how many lines you can have at around ~250 so you do have to think carefuly about the code’s workflow.
From all the features documented, one that isn’t detailed is the ability of the board to perform proximity detection using IR. The board has a built in IR LED and a sensor with some basic hardware that makes it possible to read raw data but it’s implementation is such that there are a lot of variables that make it difficult to accurately document an ideal method of taking proximity measurements. Despite it not being documented, Ladyada put a video on Youtube of an approach to get proximity detection working. The approach described was conducted using normal Arduino code and sketches and Adafruit’s forums suggest that it’s not possible with Circuitpython given it’s slower execution speed – but it is. The caveat to using CircuitPython is it appears you need to keep the IR on for longer than you would if you did this as an Arduino project, which may not be great for the lifespan of the LED. I haven’t tested faster speeds but it might be possible to run it quicker and thus extend the LED lifespan – discussed in more detail in the GitHub project doc. Having tested different speeds I managed to get proximity detection working using IR, I just needed to test how effective it is at detecting eye movement.
The placement of the sensor and LED and the LED’s field-of-view appear to work well for REM detection, I've added a small bit of tape around the IR LED for better seperation from the sensor but I'm not sure it's required. Once I’d modified a sleeping mask to hold the board and test by moving my eyes – I could see and chart the increase in variability compared to when stationary:
With eye movement detection now sorted, the next stage is to detect face movement and wakefulness – the board has a built in accelerometer so again, with no additional components required, this is easy to do and this time there’s no hacks needed.
The board features 10 RGB NeoPixels and these can be used to cue a wearer in a REM state. These can be programmed in a number of ways but I’ve kept the Rainbow Cycle that is part of the initial example code file that comes with the OS when you install it – it’s pretty cool. Most other devices just use a standard red LED as they're the cheapest you can get and the thought that most light appears red when your eyes are closed given the blood vessels it passes through but I can definitely perceive variations in colour with the NeoPixels. The way I’ve placed the board on the mask means that the light is scattered indirectly rather than straight towards your retina as well - if I find this not to be effective I can just cut more of the mask and expose the Neopixels more.
The sleeping mask I used to fit the board to looked ideal for this with thin eye socket areas to cut away but I don't like the material so will probably find another mask to attach it to and that's easy to do because the mounting is modular as you can see in the video.
Full code on GitHub
Other interesting links (there’s more project specific links on GitHub)
Stephen LeBarge’s original paper on DreamLight:
Validity Established of DreamLight Cues for Eliciting Lucid Dreaming