Close
0%
0%

Dream Catcher

Life-changing circumstances led me to begin having Nightmares in which I would wake up finding my pillow soaking wet, and vivid memories it.

Similar projects worth following

This Project attempts to detect "Nightmares" vs. Normal, restful sleep or REM Sleep in which the person is not 'caught' in a dream in which they cannot wake. It monitors heart rate and determines a Baseline, then detects restless or disturbing dreams by watching for an elevation in the sleeper's heart rate, then attempts to wake (gently) the sleeper so they can "Escape." Elevated Heart Rate leading to profuse sweating is what the system is looking for [you don't wake in a cold sweat from 'pleasant' dreams but certainly do from nightmares].

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 »

  • But the Silicon Labs Devices means Spinning a PCB...

    Grayson Schlichting07/11/2016 at 08:14 0 comments

    To have a purpose-built heart rate monitor that sends its data telemetry out BLE using the components found on the Thunderboard will require a custom built PCB.

    A viable (read: wearable) solution that could be made from off-the-shelf componentry for experimentation could be assembled that uses light-through-skin vs. the electrode method of the not-so-comfortable Polar solution I began with.

    Using parts made by Adafruit such as Trinkets and other new Arduino-compatible boards they continuously design and build, along with something like the "Pulse Sensor Amped" by pulsesensor.com, I think a more comfortable "prototype" could be assembled which would include the pulse sensor, a processor, and perhaps still the nRF24L01+ transceiver for the headboard alert. But if you're going to "wear" the data processing engine anyway, then the vibrating motor could be included onboard having the same "waking impact" just as the silent alarms do on a FitBit.

    Check out the Pulse Sensor Amped "kit" sold by Adafruit: https://www.adafruit.com/products/1093

    And a project using it in their LEARN section: https://learn.adafruit.com/pulse-sensor-displayed-with-neopixels/the-code?view=all

    I think this is where I will take the next prototype whilst working with Silicon Labs and Arrow on a version that would be the most comfortable and power efficient custom design.

  • Silicon Labs Thunderboard to the Rescue!

    Grayson Schlichting07/11/2016 at 07:49 0 comments

    Unlike the Silicon Labs Sensor Puck, which had a 3rd party light/UV/Pulse device (and a non-Silicon Labs Bluetooth chip on the backside), enter the Silicon Labs "Thunderboard Wear ARM".

    This little guy, again a demonstration / development platform, is PACKED with goodies, and this time they are all Silicon Labs devices.

    I am pointing a breadboard jumper at the ambient/UV/Pulse Detector on this guy (it's TINY):

    Due to the header right next to it (and the fact I have only had it for a couple of weeks), I have yet to "wear" this, but it has the same functionality as the Puck; place your finger over that 8-pin device and you get heart rate.

    It uses the Silicon Labs BGM111 Bluetooth Smart Module which has its own stack in a certified module. Also, devices like the BGM111 (and other sensors on the Thunderboard) can run in an autonomous manner where they can do "work" without waking the host processor. The components and architecture of this family of devices on the Thunderboard will yield the lowest power wearable for this application (and they have the power performance monitoring tools to prove it!).

    Every wearable hacker should get one of these little gems when they hit the market later in July. The Toolchain for it is incredible, and you can write code in a simple "BASIC-like" language to control it, and then do real-time power profiling. Silicon Labs rules on this suite of wearable and small form factor monitoring goodies.

  • Enter the Silicon Labs Sensor Puck

    Grayson Schlichting07/11/2016 at 07:28 0 comments

    Enter the Silicon Labs "Sensor Puck" which includes a dual-mode light sensor which can measure ambient light, UV light for UV exposure accumulation, and when you place your finger over the plastic-covered LED assembly (at the bottom of the Puck), it changes modes and goes into pulse rate monitoring (ala FitBit).

    https://www.silabs.com/products/sensors/Pages/environmental-biometric-sensor-puck.aspx

    U5 is under a plastic shield, and it can monitor Heart Rate, and send the data out using Bluetooth BLE. I have actually been able to strap this to myself such that the window I am pointing at is close enough for the Puck to go into Heart Rate mode (J1 is a bit painful so it took some clever work with velcro strips and bandage tape).

    The Puck is a bit too large to wear, but it's only a demonstration platform. Here is the back side where you see a CR2032 battery, and at the top the Bluetooth Chip:

    Obviously not ideal as a purpose-built monitor! Also, the LED light/UV/Pulse sensor on the front are from various vendors and not designed by Silicon Labs.

  • Why Not a FitBit Charge HR?

    Grayson Schlichting07/11/2016 at 06:48 1 comment

    I have one of these, and wear it 24/7. It sends out a constant "greenish" pulse of light from 2 LEDs to accomplish its measurements.

    There are two problems:

    1) The FitBit unit itself averages your heart rate in its normal operating mode. You can press and hold the button on the side to go into "Workout Mode" and it will read (and log) continuous heart rate measurements.

    2) FitBit uses Bluetooth BLE to send its telemetry, but it is encrypted and proprietary. The only way to get this data is after it has made a trip through BLE to your computer or SmartPhone (with the FitBit App) and then is transmitted to the FitBit "cloud."

    This is not ideal, because there is a time delay, and API calls out to the Internet must be made to get (then parse) this information.

    See https://dev.fitbit.com/docs/heart-rate/

  • Using a Polar Heart Rate Monitoring Chest Band

    Grayson Schlichting07/11/2016 at 06:37 0 comments

    I started out with the Polar Chest Band which transmits heart rate wirelessly (via Bluetooth or a proprietary RF method). I used the Non-Bluetooth model to simplify the project since the receiver board is just that; it requires no setup or programming. It just sends out a 20ms. pulse (ha ha) on each heartbeat it receives from the band.

    Starting point was this:

    Heart Rate Educational Starter Pack with Polar Wireless Sensors

    from Adafruit: https://www.adafruit.com/products/1077

    The Polar bands use electrical pick-up pads to detect heart beats, and you have to wear it just under you pectoral region. It's a bit uncomfortable, but it was where I started.

    Heart Rate Educational Starter Pack with Polar Wireless Sensors

    This picture is from Adafruit.com. With the parts included, you can wire it up and see your pulse on that (jumbo) red LED. Pictured are a battery holder for 3V to power the receiver board (the Polar has an internal CR2032 for powering the EKG sensor and the transmitter). You wear the sensor band as described across your chest, and what is pictured left and above the band is the adjustable elastic band that holds it around your torso.

    The resistor is for current-limiting the LED, and you can see the Receiver Board which has only 3 pins: power, ground, and out. Snap off all but 3 of the header peices, solder them to the RX PCB, and plug it all into the provided Protoboard and you can watch the LED flash as your heart beats.

    For my first prototype, I sent the Receiver's Out pin to a GPIO pin on an Adafruit Trinket (small Arduino compatible board). That's where the sensor is monitored, filtered, and analyzed. When it detects a rise in heat rate of x% over time (t) then "something" is happening. If you are having a dream so intense that it causes you to sweat, then your heart rate WILL increase. Your "x%" and "t" will vary. For the final build, I am considering perhaps 2 potentiometers for setting this.

    When a threshold is detected, then the Trinket is used to drive the nRF24L01 transceiver which wirelessly connects to the "alerting device" - in my case, I have it drive a small vibrating motor stuck to my headboard which resonates loud enough to wake me up.

    I used this: https://www.adafruit.com/products/1201

    I am happy with the "receiving-side" of the project, but really needed a way to measure heart rate more "comfortably."

View all 5 project logs

Enjoy this project?

Share

Discussions

Grayson Schlichting wrote 07/11/2016 at 08:20 point

Oops, I forgot to include the link for the Silicon Labs Thunderboard in the Logs.

https://www.silabs.com/products/mcu/32-bit/Pages/thunderboard-wear.aspx

  Are you sure? yes | no

Neil K. Sheridan wrote 04/26/2016 at 18:22 point

Hi, I was thinking of doing something similar later in the year specifically to detect REM and provide haptic feedback (e.g. via piezo actuator).! Anyway this paper might be useful about how HR varies during sleep stages: http://circ.ahajournals.org/content/91/7/1918.full

  Are you sure? yes | no

Grayson Schlichting wrote 07/11/2016 at 06:39 point

Thanks Neil for that useful link.  I will try "tuning" the Final Solution to see if I can detect REM.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates