I have had a long life of few memorable dreams, and those I did have would fade rapidly after waking. Then "life-circumstances" changed and I found myself having vivid nightmares which were (and still are) memorable in every detail.
I would wake to find that my pillow was soaking wet from sweating during these episodes.
Talking to a friend about this, I found out that his spouse had recent cranial surgery that left her with the same experience.
There are several "scientific" methods for monitoring dreams and REM sleep: (Electrooculography (EOG/E.O.G.), EEG, EMG, and other means for detecting brain activity and eye-movement to detect REM sleep. Some are used to induce Lucid Dreaming where an individual can realize they are in REM-stage sleep, then semi-consciously control their dreams ("Hey, I can fly!"). These techniques require wiring a plurality of sensors to the head, face, and body; not so good for a restful sleep, especially for someone who naturally makes several side-to-side turns during sleep.
I did not seek to interrupt REM sleep because it is supposed to be "natural" and "a good / needed phenomena" - rather I wanted to detect that I was having a nightmare and trigger something to wake me up so I could stop the dream (and hopefully not fall back into it again).
I have never awakened from a 'good' dream to find my pillow soaked, but these nightmares always resulted in this (and daily washing of bed linens needed).
So my hypothesis was that these nightmares were obviously elevating my heart rate (and thus my body temperature).
The Goal was to find the least obtrusive way to monitor my heart rate (e.g.: No 'wires'), and use software monitoring and filtering algorithms to detect that my heart rate was rising above normal for more than a short duration. I would then be awakened by some means so I could "escape" the nightmare.
The first prototype utilizes a heart rate monitoring "strap" which I wear across my chest that wirelessly sends heartbeats to a companion receiver where it could be monitored by software to "catch" me in one of these restless and disturbing dreams, and wake me up.
The current version utilizes the well established chest-worn monitor by Polar which can transmit each heartbeat wirelessly to a receiver. They have two models: the older and long-selling Polar H1 Heart Rate Transmitter which uses the ISM-band to send the signal to wrist-worn devices, or matching proprietary Receiver Modules, and the Polar H7 Bluetooth Smart Chest Transmitter which can be monitored by any BLE/BT Smart receiver board, or BT 4.0 phones/PCs/Dongles.
For the first prototype, I wanted the simplest and lowest-cost way to get the raw data into a micro where it could be filtered, analyzed, and then trigger an external annunciator so I went with the Adafruit Heart Rate Educational Starter Pack with Polar Wireless Sensors ($65). The Polar chest bands are available for individual purchase, and the receiver is actually available from Parallax who provide support and example files for a variety of micros including Arduinos. There are also tiny "cubes" which can plug in to the Audio Jack of a Smartphone in lieu of using the (at the time) more expensive BT Smart version of the wearable chest band; these can be taken apart to extract the receiver PCB, or wired into a female 3.5mm TRRS connector which is interfaced to the micro-of-choice.
Any type of Micro can be used, but I chose the ATmega328-based Adafruit Pro Trinket (5V version) for ease of programming and a small footprint.
While there are many types of alerting methods which can be triggered to wake one up, I opted for something that would be as unobtrusive as possible as to not jolt me awake like a piezo buzzer or something loud enough to disturb others. My choice was to use one of the tiny vibrator motors used in phones for "Vibrate Mode" and used this little Vibe Motor also from Adafruit, but this is a personal preference. I found that sticking this to my wooden headboard made a resonating hum...Read more »