loading
This is part of both the "let it glow" challenge and the robot challenge, so please vote for either/or category that you see fitting if you enjoyed/liked this instructable. Remember, voting is different than giving it a good rating.

First off, this is a Collaboration between me Guyfrom7up and Gmoon

Gmoon did all of the programming, debugging, etc.

Guyfrom7up did all of the hardware, PCB, etc.

What is Lucid Dreaming? Lucid Dreaming is when you are sleeping and dreaming and that you are aware that your are asleep and that you are dreaming, yet you don't wake up. This can be great, giving you full control of your dreams, jumping off of buildings, going into space, whatever your mind can create.

The Lucid Dream Machine is a pair of glasses that you wear while you are sleeping. About 4 hours into your sleep the AVR microcontroller pulse LEDs that shine through your eyelids. This half wakes you up. The flashing lights helps you become aware (in your sleep) that your are sleeping and dreaming, in doing so you become more likely to be able to control your dreams.

Our Collaboration give you the Lucid Dream Machine.

Sorry, but to watch a video you will have to download it, for some reason the video won't work on both youtube and metacafe.
(gmoon: I tweaked the video and uploaded to my account... I need to do this for all my videos, also.)

Step 1: Supplies

In order to build the device you need:

1x ATtiny13v AVR Microcontroller
2x LEDs (color of your choice, we used red because it works at low voltage, shines through eyelids well, and is cheap)
2x Resistors (value of your choice)
1x SPST or SPDT switch (it's only used as a power switch, so it doesn't matter)
1x Normally off momentary switch
1x Lithium 3volt Watch Battery (we used a CR2032)
1x Lithium Watch Battery Holder (we used a CR2032 holder)
Some way of mounting the device to your face, such as glasses).

Wire
Solder
Ways of making a PCB or just Prefboard (up to you, we used a custom PCB using toner transfer and Eagle)
An AVR programmer

Step 2: About the Program

Other than initialization, the lucid13 software runs entirely via interrupts. Timer-triggered IRQs count through the long initial wait until the subject is in a deep sleep. The timing scaler is then switched to a high rate to create the smooth PWM for the lucid dreaming LED blinking.

Functioning modes:

--User input/options
--Wait-for-sleep mode
--PWM dreaming mode

Startup

During startup the LED lights up for approx. 2 seconds to indicate operation.

The device also checks if the input button was pressed and held during power up for those initial 2 seconds. If it was, "immediate mode" is entered: the LEDs begin blinking. This is mostly so guyfrom7up could easily test the hardware without waiting for four hours ;-).

It could also be used for "catnap" type sleep states.

However, we could also add a bit of code to vary the pulse width...whattay think?

The Timer and IRQ setup for the initial wait state

After checking for user input, etc., and setting up the IRQ, the ATtiny13 is immediate placed in sleep mode. In this mode only the timers, clocks and IRQs are functional. Of course, this is a power-saving measure.

Rollover time for a 16-bit counter, per timer scaler value (times approx)--
-----------------------CS00:        13.75sCS01:        110s (1m, 50s)CS02:        3520s (58m, 40s)CS00 + CS02: 14080s (3.91h)

A ~4 hour wait is possible with the CS02 and CS00 flag combination, a clock scaler of 1024. In this state, the IRQ is triggered 4.6 times per second. The WAITING state could easily be fine tuned, by using the 16-bit counter (for durations < 4 hrs) together with the waitstate counter (for longer delays.)

Since four hours is as good a delay as any, a longer-duration waitstate isn't used. A longer delay would be a trivial matter to implement.

NOTE: guyfrom7up has found the waitstate for his AVRs is somewhat greater than 4 hours, while mine is somewhat less. The internal oscillator of the AVR isn't highly accurate, but it's good enough for our needs....

At 4.6 IRQs per second, CPU power consumption should be very low. Of course the AVR cannot be in power-down mode, as that requires an external wake up signal. Ours must be timed internally, so SLEEP_MODE_IDLE is our best choice.

IRQs per second, for each scaler (approx)--
---------------------CS00:         4766 /s   (during dream phase)CS01:         593.8 /sCS02:         18.6 /sCS00 + CS02:  4.6 /s    (during initial waitstate)

The Timer and IRQ setup for dreaming PWM mode

The timer scaler value changes to CS00 when MODE_DREAMING begins--in order to create the gentle transitions of the software pwm. The duty cycle for the CPU (and IRQ) is much greater (about 4.7K per second.) But the LED duty cycle is much less than it would be with a simple on/off switch. A trade off between cpu and LED current draw...

The overall pulse width (length) of the LED blink is controlled by the MACRO_WIDTH and MACRO_GAP constants. The PWM is handled by incrementing the pwm and transition variables by the constants PWM_VAL and TRANS_VAL. Altering those constants will change how rapidly the PWM "ramps up."

Currently, the dreaming frequency LED pulse rate is approx 1.5 hz.

Program Size

The current version (0.2b) uses only 438 bytes of flash memory. This is well short of the 1K limit on the ATtiny13.

So adding more features is certainly do-able.

Step 3: The Code

For some reason code isn't showing up right anymore, so I've attached a file with the C program

Step 4: The Circuit Board/Schematic

We used a custom circuit board to make the end project look much cleaner for instructables (and the watch battery holder only worked on a custom PCB). The Circuit board pattern and schematic is posted below, but if you choose to make a PCB it's very likely that you have to redesign it because you won't have the exact same pieces as we do. We left a lot of wire pads so that it would be easy to upgrade in the future (such as adding more switches, LEDs, etc).

Step 5: Soldering

If you do not know how to solder, watch videos such as this one:

and look into some soldering Instructables such as:
https://www.instructables.com/id/How-to-solder/



Solder some longs wires to the other side of the resistors and ground. It's easier to make them too long and then cut them shorter than the other way around. The other side is later going to be soldered to LEDs which hover over your eyes.

Step 6: Prepare the Mask

I used a sleeping mask, so some of this might be purely situational, but it's just what I did.


Most masks are made up of 2 pieces of fabric and some squishy foam in the middle for comfort, what you need to do is somehow mount the Lucid Dream Circuit on the mask (above the nose) and cut out eye holes for the LEDs.

To mount the PCB I cut into one of the pieces of fabric and just slipped the PCB between the 2 pieces of fabric.

For eyes I just slowly guessed and check with a pair of scissors (make sure you don't cut the mask while it's on your face!!!)

Step 7: Line Up the Wire

Line up & cut the wire to the correct length where you are going to mount the LEDs over your eyes.

Step 8: Solder on the LEDs

Solder the LEDs to the wires above the eyes. You may want to slip on some heat-shrink before you solder it up to prevent shorts later. Make sure the LEDs are facing the right way!

Step 9: Test It Out!

Test out your finished Lucid Dream Machine! Turn it on, it should be able to shine through your eyelids, then the LEDs should go off and wait for 4 hours, and when you fall asleep they'll start blinking at you.


This will give you a good chance at controlling your dreams.

Have fun with it!

Step 10: Personal Experiences

I, honestly haven't been able to keep this device on for long enough when I'm sleeping for it to start working. For example, 1 night I think I took it off in my sleep without me knowing it, and another night I tossed and turn so much in my sleep in the first hour or so that when I woke up 2 hours from when I started sleeping I found the mask near the foot of my bed. Another night I think I took it off in my sleep...

I will update this once I get a successful experience.


Don't forget to vote!
<p>Does this thing work or not? I&acute;ve been trying to train my brain and nothing's work. I would like to know if it works before I build this. Sounds really cool.</p>
<p>que tremenda pelotudes.....hace algo productivo pendejo...cascate el mani...</p>
Is this real life :o
If anyone has tried this please tell us what happened to insure that its safe!!
<p>Yes! It works! But... no magic! close the eyes, turn on the machine and go to the matrix is false! This &quot;machine&quot; do 5% of work, the other 95% is your mind learning the work.</p><p>The leds call your mind for attention only. Several months are request to you &quot;wakeup&quot; in a lucid dream.</p><p>My first lucid dream comes after 4 months usind everyday. Now, after 2 years, I do not need the machine. I can wakeup in a lucid dream by my self (when sleeping sure). But the sound around me is distractions and do dificults to still dreaming.</p><p>In the dream is very dificult still lucid, everytime I lost the control.</p>
<p>Yes! It works! But... no magic! close the eyes, turn on the machine and go to the matrix is false! This &quot;machine&quot; do 5% of work, the other 95% is your mind learning the work.</p><p>The leds call your mind for attention only. Several months are request to you &quot;wakeup&quot; in a lucid dream.</p><p>My first lucid dream comes after 4 months usind everyday. Now, after 2 years, I do not need the machine. I can wakeup in a lucid dream by my self (when sleeping sure). But the sound around me is distractions and do dificults to still dreaming.</p><p>In the dream is very dificult still lucid, everytime I lost the control.</p>
What's the worst that could happen? The mask could fall off and choke you i guess, but otherwise it's risk free.
Maybe epileptic fits. I dunno
The lights aren't that bright of flashy.<br />
&nbsp;As a person with epilepsy any blinking light causes this. If you read in the agreement with Yahoo within the email account even they tell you there is chance of epileptic seizures. Just surfing your inbox can cause this. Best to not offer an opinion on something unless you know what you are talking about when this could cause harm. ANd really you could reprogram your mind with this device this type of stuff should not be allowed to be on this site. There is a reason there is an FDA even though they are not perfect.<br /> You could cause yourself to be stuck in certain parts of sleep patterns and not fully get out like when you are driving.
<p>&quot;Any blinking light&quot; will NOT cause epileptic seizures, and even if it did, that would COMPLETELY obviate this point, as this would be no more problematic than ANYTHING else.</p><p>(And my degree in neuroscience trumps your psych degree.)</p>
<p>Snap.</p>
I don't want to resurrect a dead flame war, but I feel obligated to correct misinformation when I stumble across it. <br> <br>It's a bad idea to take someone's credentials at face value on the internet. An anonymous person who claims to hold a master's degree in psychology could just be a cat lady who took Inception a little too seriously. I'm not attacking haunted_lady's credentials, I'm just giving a cautionary note. <br> <br>Fact: the percentage of people who have photosensitive epilepsy, who will be triggered by lights blinking slowly, is extremely low. A television is more dangerous than this instructable, and televisions are available for mainstream sale. I'm sure you aren't organizing a door to door campaign to ban the use of decorative lights around the holidays. <br> <br>These lights are not going to hypnotize you into sleep patterns that catch back up with you in the afternoon when you're driving home from work. At worst, they may contribute to incidents of sleepwalking in individuals who are predisposed to it. OTC sleeping pills are just as dangerous, though.
I respect your input, and give due respect to your epileptic knowledge, but on the subject of this not being on the site I must disagree. Instructables is an open community of makers where any idea, no matter how unique or dangerous, is respected. A bit of discretion must be exercised when a project may be potentially dangerous, but Instructables usually leaves that up to the individual readers.<br /> <br /> In short:<br /> If you know you have epilepsy, then you should know better than to strap blinking lights to your face. Further, I don't believe that it is possible to get stuck in a particular stage of sleep.<br /> <br /> TL;DR<br /> Use common sense, I want proof of mind-stickage
Who cares if it's safe? It's science!!!
Are you GLaDOS or what? ^_^
A bit.
Anways, I think that the prgress of Science can't be stopped because of dangers too!
<p>thirty dollars it does not work</p>
Try mounting some bright leds on the bed side, pointing towards your face.
<p>You might consider a chin strap so that the mask doesn't end up tangled up around your toes. I'm a bit skeptical about the floating LEDs above your eyes. Do those LEDs poke your eyes when you turn over your pillow?</p>
<p>The assumption that &quot;The flashing lights helps you become aware (in your sleep) that your are sleeping and dreaming&quot; is a huge leap. It takes a trained mind to achieve such consciousness. </p>
<p>INCEPTION....!!!!!!</p>
<p>I need to comment. </p><p>1st off, I love this instructable. </p><p>I did however read the comments. It was quite humorous. </p><p>Ooops....I just realized these comments were a few years ago. So I shall keep my mouth shut and not stir up the pot again. </p><p>I think this is a great idea, and If I ever have some free time Im going to make one of these. I have been Lucid dreaming for years.....But it comes and goes. I have not had it happen for a while....And if there was a way to induce this. O man, Im excited. Hope it helps.....Last time I had Lucid Dreams. I was learning to Fly...LMAO.....People need to educate themselves a bit on Lucid dreaming before they try it tho....And one of the best places to get info on it is on WIKI.....Not the library...As long as u remember everything u read, whether on internet or in an old book in the library...U still must take everything with a grain of salt as they say..Just because someone wrote it does not mean its 100% accurate. </p>
<p>meow </p><p>Awesome lucid dream thing! *Gives thumbs up*</p>
<div><span style="font-size: 10.0pt;">This is a great start. Next step is to coordinate two or more lucid dream machines with computer connections and allow very simple communication between dreamers; a multi-player dream game, if you will.</span></div> <div>&nbsp;</div> <div><span style="font-size: 10.0pt;">The ingredients for multi-player lucid dream connectivity are:</span></div> <div>&nbsp;</div> <div><span style="font-size: 10.0pt;">1.&nbsp;&nbsp;&nbsp; A lucid dream cuing device such as a dream mask or audio device with dreamer response detection and interpretation.</span></div> <div><span style="font-size: 10.0pt;">2.&nbsp;&nbsp;&nbsp; Computer software (LD program) that has two-way, real-time communication with the cuing device.</span></div> <div><span style="font-size: 10.0pt;">3.&nbsp;&nbsp;&nbsp; Computer software (LD program extension) that has two-way, real-time communication with a remote host site.</span></div> <div><span style="font-size: 10.0pt;">4.&nbsp;&nbsp;&nbsp; A multi-player host website program that receives input from the LD programs and issues messages to them.</span></div> <div>&nbsp;</div> <div><span style="font-size: 10.0pt;">Here are a few scenarios that could be fun for dreamers in a multi-player environment:</span></div> <div>&nbsp;</div> <div><span style="font-size: 10.0pt;">1.&nbsp;&nbsp;&nbsp; Two players register and log onto the LD multi-player website, selecting the other player to communicate with that night and which player is to be the guide player (first dreamer cued).&nbsp;The respective local LD programs monitor the eye movements during the sleep of the players and upon REM detection send a message to the website that the respective dreamer is in REM; the website host program waits for both players to reach REM, then the host sends a command to the local LD software to signal the guide dreamer via audio/visual cue that she is dreaming.&nbsp;When (if) she becomes lucid, this lucid dreamer now signals (via eye movement) the mask/program to stop cueing and, in addition, send a message to the host program to notify the other dreamer that he is dreaming by audio/visual cue (could even be a pre-recorded audio cue in the guide&rsquo;s own voice).&nbsp;The signal to the recipient&rsquo;s to become lucid is now coming directly from the guide dreamer and may carry more meaning than a neutral cue (and lots more fun).&nbsp;For those folks with an interest in mutual dreaming, this may prove also to be a useful initiator for such a dream, coordinating the timing for lucid dream sharing. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div> <div>&nbsp;</div> <div><span style="font-size: 10.0pt;">2.&nbsp;&nbsp;&nbsp; A lucid dream race:&nbsp;players log on and join the race, then go to sleep. &nbsp;The host site waits until all the respective LD local programs indicate REM state for all the players (hopefully at some point all REM&rsquo;s coincide).&nbsp;The host site sends commands to all the local programs to cue all the dreamers more or less at the same time.&nbsp;The dreamers, upon becoming lucid, signal to stop the cue and, in addition, send a message to the host site that they are lucid.&nbsp;&nbsp; The winner of the race is recorded on the host site and the players can view the results--just for fun, of course, but competition can have a strong motivational effect, as many psychologists know. </span></div> <div>&nbsp;</div> <div><span style="font-size: 10.0pt;">3.&nbsp;&nbsp;&nbsp; This multi-player scenario would require a mask with various colored lights or audio cues and dreamer feedback variability. &nbsp;The dreamers, upon both becoming lucid, signal different eye movements to the other dreamer (via the local LD programs&rsquo; connection to the host website) which result in varied cues, the meaning of which is agreed upon beforehand when the players register for this &lsquo;game.&rsquo;&nbsp;A &ldquo;hello&rdquo; signal from one dreamer can result in a &lsquo;blue&rsquo; cue to the other; an &ldquo;I am flying&rdquo; signal from the other dreamer could result in a &lsquo;yellow&rsquo; cue to the first, and so on.&nbsp;Audio messages could be used as well.</span></div> <div>&nbsp;</div> <div><span style="font-size: 10.0pt;">4.&nbsp;&nbsp;&nbsp; Masks or other cuing devices with multiple cuing options such as varied colors could also be used to enable more than two dreamers to send messages to the entire group in the same session.&nbsp;Dreamers sign up for the night&rsquo;s session and assign themselves a color cue or audio cue.&nbsp;As the dreamers become lucid, the host software sends that dreamer&rsquo;s cue sign to the rest of the group.&nbsp;A dreamer, for example, recognizes the &lsquo;red&rsquo; cue as &ldquo;Mike has just joined us&rdquo; and the &lsquo;blue&rsquo; cue as &ldquo;Sally&rsquo;s lucid now too.&rdquo;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></div> <div>&nbsp;</div> <div><span style="font-size: 10.0pt;">While the lucid dreamer communication described here is very rudimentary, the exciting thing is that such dream games as outlined above are technologically feasible right now.&nbsp;We are at the point with inter-dream communication that Alexander Bell was when he spoke &ldquo;</span><span style="font-size: 10.0pt;">Mister </span><span style="font-size: 10.0pt;">Watson, come here! I need you!&quot;&nbsp;And we saw where that led. </span></div> <div>&nbsp;</div>
But wait there's more!<br>Have you ever put a needle with a styrofoam packaging peanut on it in between your teeth and touched a moving turntable ,with a record on it, with the point of the needle? The result is the song on the record plays in your head. I don't know about you but I have dreams where the words of people talking (irl) within ear shot of me while I'm sleeping has been incorporated into my dream. So you could maybe have a tiny speaker in your mouth and have people talk to you. I also heard (pun not intended) that I talk A LOT in my sleep so you could possibly communicate in your sleep while doing this &quot;race&quot;. <br><br>I also wonder would the track vary from dreamer to dreamer, because how you may imagine a cat may be different than how you imagine a cat. A hitch in this idea is that in MY dream I would most certainly always win because it is MY dream. <br>Over all good concept. Too bad divergent isn't till another 100 some years :-).
<p>has anyone tried this? if so, please comment...</p><p>and speaking of comments. haunted_lady favorited <a href="https://www.instructables.com/id/Make-a-pair-of-Audiostrobe-compatible-LED-glasses-/" rel="nofollow"> https://www.instructables.com/id/Make-a-pair-of-Au...</a>. no negative input from her there. fascinating.</p>
<p>DON'T FEED THE TROLLS!! </p>
<p>My goodness, where to begin&hellip;I guess the first place is<br>thanks for the cool instructable. Nice but the LEDs in the eyes bit dose needs attention. I&rsquo;m sure there would be no permanent damage but it would not feel good either. Second the person in the first few pages of comments that calms to have a &ldquo;Masters degree in psychology&rdquo; It seems to me you have a Masters in PSYCHOTIC instead of psychology. I only have a bachelors of science in electronics But I still could have expressed my opinion in a MUCH more receptive way than the flame you where thronging! Please do enlighten us on the university you got your &ldquo;Degree&rdquo; from so everyone knows to steer clear of it. It seems to me you wasted a lot of time, effort and money on your &ldquo;degree&rdquo; or maybe you just graduated at the bottom of your class.</p><p>For those wondering how to get the AVR programmed a good<br>plase to start would be http://arduino.cc/<br>lots of good people and info.</p>
<p>Also, I can't imagine that having a blinking light flashing on your retina all night and over-stimulating your ocular nerve is such an awesome idea either.</p>
<p>As someone who regularly suffers from sleep apnea I'm very familiar with the half-awake state of sleep. <br><br>I'm also very familiar with the effects of sleep deprivation. When you are half-sleeping you are not sleeping, period and the effects will wear on your health after a very short time; with the minor annoyance of the tendency to fall asleep during boring work or school periods to having heightened irritability which can severely effect your judgment, how you deal with others, your ability to manage stress and your ability to problem solve which can severely effect your relationships with those you love and those who sign your paycheck.<br><br>The long-term effects of sleep deprivation are high blood pressure, inability of the body to burn off calories during sleep so a higher concentration of body fat and a lower metabolism and all the health risks that incurrs.<br><br>Also, there's plenty of psychological evidence that dreams are important for the mind to collaborate the day's stresses and problems and categorize them into either short memory or deep memory and/or to help make sense of problems or issues one deals with. Not having these flowing subconscious dream-states robs your brain of basic rebuilding time and in the long run, your mental health.<br><br>Do it every now and again for a kick? Sure. All the time? No way!</p>
<p>As someone who regularly suffers from sleep apnea I'm very familiar with the half-awake state of sleep. <br><br>I'm also very familiar with the effects of sleep deprivation. When you are half-sleeping you are not sleeping, period and the effects will wear on your health after a very short time; with the minor annoyance of the tendency to fall asleep during boring work or school periods to having heightened irritability which can severely effect your judgment, how you deal with others, your ability to manage stress and your ability to problem solve which can severely effect your relationships with those you love and those who sign your paycheck.<br><br>The long-term effects of sleep deprivation are high blood pressure, inability of the body to burn off calories during sleep so a higher concentration of body fat and a lower metabolism and all the health risks that incurrs.<br><br>Also, there's plenty of psychological evidence that dreams are important for the mind to collaborate the day's stresses and problems and categorize them into either short memory or deep memory and/or to help make sense of problems or issues one deals with. Not having these flowing subconscious dream-states robs your brain of basic rebuilding time and in the long run, your mental health.<br><br>Do it every now and again for a kick? Sure. All the time? No way!</p>
<p>I'm intrigued! I've been thinking of buying something similar that is due to be released earlier this year, but if I can make my own, I just might dust off the old soldering iron! I must say, and please note this is intended only as humor, my first thought was &quot;OMG! The Borg have assimilated the Lone Ranger!&quot; I wish you every success and thank you for this posting!</p>
<p>have you try NE555 timer and use some capasitor</p>
<p>Try switching a blue LED in one eye or slightly higher power red units.</p>
<p>Unless you strictly sleep on your back, you risk getting LEDs in your eyes. That would be painful and most probably harmful.</p>
<p>Where can I change the wait-time ? I want to change it to a higher value, because as far it doesn't work...</p>
cool, but it sounds sorta painful
This is very cool, and might have some theraputic value as well for someone with trumatic reoccuring nightmares (a close friend of mine). <br>Might also help me better control my bipolar-- control the dream, better resist strong emotional impulses.
what compiler you use? <br>because i want to simulate the mask
Have you got the PCB Schematics of this circuit?
Thanks for the nice instructable, I'll probably try it myself. Any comments as of the battery life? How many nights should it hold, more or less?
Althu it needs some work to keep the eyes safe. But the idea is brilliant, good job guyfrm7up..
CAN WE PLEASE JUST ENJOY THE INSTRUCTABLE AND NOT COMMENT ANYMORE ABOUT HOW DANGEROUS CAN IT BE?? <br>We all are humans, we can make the decisions of our own. Each individual determines if this instructable is dangerous or not on his own. <br>So let's stop the pointless argument and comment about the flaws of the project and the experiences of people who've actually used it!
you should make an instructable on how to add sound cues
How do you keep from poking your eyes with the LEDs if you turn face down on the pillow?&nbsp;(I do that often. I&nbsp;mean turning face down, not poking my eyes)<br />
makes me wonder if you could attach sun glass lenses to the outside and drill holes in them just big enough for the led body to slide through. then it'd be a matter of placing a dot or two of super glue on the other side where the led shoulder touches the lens.
it might be a better idea to us a red sharpi marker to locate the eye holes. the red will show up on the outside for you to use as a cutting guide and im *sure* it'd be safer.
holy crap it worked did it last night and was skeptical but it was soooooooooo ooooooooo oooooo awesome

About This Instructable

174,046views

474favorites

License:

More by guyfrom7up:Stylish Battery Belt Cloth Covered Earbuds How to Solder in 30 Seconds 
Add instructable to: