Introduction: Lucid Dream/Dream Recall Machine Using Infrared.

Picture of Lucid Dream/Dream Recall Machine Using Infrared.

This is my first instructable, so I hope everything is clear and hoping you find it interesting, and would appreciate any feedback, so here I go. I am sill testing this device with other people,  but  personally I have found  my dream recall has improved dramatically, wow! some of the dreams are totally amazing. 

WARNING. Because of the flashing Led this could pose a problem with people that are affected by epilepsy. One solution would be to connect a switch to the Led, therefore there would only be a sound as a dream trigger.

   If any one is interested in this project I can sell a kit of parts or sell a complete and tested device. Please contact me for prices at.  

The device will scan the closed eye using infrared and when movement is detected(REM) the PIC microcontroller will flash an LED and produce a sound on a piezo. This should wake one up into a dream. Useful for Lucid dreaming or if one wants to better their dream recall. I have found using this device, my dream recall has greatly improved.

After switching on the device there will be a delay of approximately 60 seconds, to allow one to settle into bed. Then the device will scan the closed eye three times, to check functionality, after this the device will stop scanning for three hours. It will then go into a cycle of scanning the eye then delay for 15 minutes until the device is turned off or the push button is pressed. If button is pressed the LED will illuminate then flash once after which there will be a delay of 30 minutes then scanning is resumed. This is to allow you to interrupt the cycle eg. sleep was interrupted so as to allow you to go back to sleep or can be used for a nap.

Setup mode.
1/ Keep push button pressed then turn on and release button, the LED will flash and piezo will sound, this is to allow adjustment of the LED light intensity VR1 and piezo volume VR2,  also to check battery state of charge.
2/ Press button until LED only flashes and release, this will enter infrared functionality test.
3/ Pressing button again, the device will go into the main program or turn off device.

Summary of operation.
1/ When one is ready for sleep turn on device then count to 60(seconds approximately).
2/ Move the eyes under closed lids until the device has triggered three times. This is to test functionality.
3/ Device will go into a three hour delay until scanning starts.
4/ Then it will scan the eye, delay for 15 minutes and repeat until the device is turned off or the push button is pressed.
5/ If push button is pressed the Led will stay on until released then flash once, there will then be a delay of 30 minutes and continue as in 4/. The button can be pressed at any time.
6/Sweet dreams and or great lucids.
7/Turn off device with the slid switch. Good morning

   Jeff Barnes


Picture of PARTS LIST

Parts list.
R1 = 3K3 1/4 WATT
R2 = 10K
R3 = 5K6
R4 = 150R

C2 = 100nF CERAMIC

5mm LED
PIEZO 20mm



  Jeff Barnes



   Please refer to schematic and board overlay
For the circuit board I have used Vero/stip board and the tracks cut using a spot face cutter or a 3mm drill bit, as indicated by  X's in the circuit board layout, 9 in total. I have also included a PCB lay out.

Construction of the board is pretty straightforward, just have to watch for the polarity of the electrolytic cap, IC1, infrared led, infrared tran(collector denoted by the short leg) and visible led.
  Some things to watch out for:-
  The push button legs will have to be straightened to fit into the correct position, as shown in the circuit board overlay.
  The two white rectangles by the side of the piezo are the double sided sticky pads for securing the battery holder.
   Piezo is glued to the circuit board with a small amount of adhesive.
   The battery holder:-
                                    Two lengths of tined copper wire are soldered onto the board at the points marked with a + and a _,  then pass them through the solder tags on the battery holder, stick holder in place after sewing to sleep mask with the two double sided sticky pads and solder wires to the solder tags, being careful not to use too much heat, are the plastic of the holder will melt.
   Led, infrared led and infrared transistor:- (infrared tran collector denoted by short leg)
                                                                         Use 1mm sleeving on the legs of these components and try to keep them as long as possible when soldering to board. The short lead on the infrared transistor indicates the collector. Bend these components out from the board and bend the heads so as to be able to shine on the eyes. Next stitch board to sleep mask, as indicated on the board overly, mark the position of the Leds and transistor on the mask, then cut small holes using a leather hole punch or something simular, press the heads of these components through so the leds protrude approximately 3mm and the photo tran 2mm, making shore the infrared led is slightly angle towards the photo transistor and then glue into place using supper glue. There is a photo of the templates I used showing the position of these components, there is another photo showing the ideal position of the infra red led and photo transistor in relation to the eye.   WARNING, ALLOW AT LEAST 3 HOURS BEFORE PUTTING MASK ON FACE, BECAUSE  FUMES FROM THE GLUE CAN IRRITATE THE EYES.
 The PCB software I am using is from

    Jeff Barnes




    Adjust the two presets, lower right side of board, so as to wake you up in a dream but not totally, you will probably have to experiment with these settings. Please refer to intro for explanation of entering setup mode.
    To check for infrared detection functionality please refer to intro for explanation of entering setup mode.

   Jeff Barnes

Step 4:

This is the HEX code for programing the 12F675 PIC microcontroller.

    Jeff Barnes


Ata0Ana (author)2015-05-01

hi can you send me your ASM file(source of micro)??? i need it because if somebody write asm file for me i should pay money ...(much money in my country)

Ata0Ana (author)2015-04-30

hi.... where you placed new program ??? and my programing language is visual basic v6.0

jeffxxx (author)Ata0Ana2015-05-01

Hi, The new HEX file is down this page labled IRED(5)HEX. If you use visual basic for programing the ASM file will be no good to you as I program in machine code. Hope this is helpful.


Ata0Ana (author)2015-04-27

ok friend dont answer me not mind but note the cost of your plane for me about 90 dollar i pay about 90 dollar up to now i dont conclude and this is not mind for you i paddle and try about 2 months and now i am tired.... i just wanted you your original program just it ,ok goodbye and thanks for all your guides dear

jeffxxx (author)Ata0Ana2015-04-29

Hi, Sorry you are having problems. The program that I have placed here for you should work ok with the circuit changes you have made, infact it should work with my circuit. Can you tell me what programing language you use.


Ata0Ana (author)2015-04-13

hi jeff i have questions :

now i dont have programmer ,in this new HEX file after 5 second delay after turn on device ,do the device go three hours delay and then start scan??? and cycles of scanning are 8 minutes ???

how about after push the PB1 ???

thanks jeff you are very kind

i am very very very sorry that pester you , please excuse me

jeffxxx (author)Ata0Ana2015-04-19

Hi Ata0Ana,
Here is the HEX file you requested with the changes
If PB1 is pressed there will be a delay of 30 minutes
and then scan the eye delay, continue until device
is turned off or PB1 is pressed.
Size of HEX file is 1.38KB,


jeffxxx (author)Ata0Ana2015-04-13

Hi Ata0An,

You are correct, the device will start a 1 minute scan after a three hour delay, then start scanning after every 8 minutes.

If the PB1 is pressed there will be a delay of 8 minutes then the scan cycle will start, 1 minute scan then 8 minutes delay and will continue until the device is turned off or PB1 is pushed

Hope this is clear.

I am glad and hope I have been of help to you.


Ata0Ana (author)2015-04-12

dear can you change program(hex file) again , i want after turn on start scan after 5 Seconds, not 60 Seconds and cycle of scanning be 8 minutes, not 15 minutes thank you

sorry that i cant change program(hex file) myself

jeffxxx (author)Ata0Ana2015-04-13


Here is the HEX file with the changes you asked for.

Please let me kown how you get on with it.


Ata0Ana (author)2015-04-12

hi jeff please tell me how many frequencies are there in out put of PIC(sixth base) for IR LED sender ??? 38 KHz ??? and give me your hex file original source i want change times of scan .... these are important for me please jeff...i wait you


jeffxxx (author)Ata0Ana2015-04-12

Hi Ata0Ana,
Sorry for the misunderstanding, but I have replaced
the old HEX file with a new one and can be found at
step 4, named NEWIR.hex.
Please let me know if it works ok for you.

Ata0Ana (author)jeffxxx2015-04-12

hi dear thank you , you are very kind

i am very very very sorry that pester you , please excuse me

i inform you certainly

thanks again

jeffxxx (author)Ata0Ana2015-04-12

Ata0Ana (author)2015-04-11

and there are many types of phototransistore but you didnt say me for example: LTR 4206E but i use photo diode(5mm) please say me what is your photo tran number and model exactly?? and dont forget that answer how many frequencies are there in out put of PIC for IR LED sender

i wait you thanks

jeffxxx (author)Ata0Ana2015-04-11


You could try a new HEX file(NEWIR.hex) in STEP 4.

Hope this will solve the problem.


Ata0Ana (author)2015-04-10

i find this ....what is your idea about it ...

jeffxxx (author)Ata0Ana2015-04-10

Hi Ata0Ana,
I am sorry you are still having problems.
This circuit looks ok but I have had no problems with my circuit and I have built many.
This is a way to check the IR.
1) If you go into the IR testing part and use an
infrared television controller and press a button
while holding close to the IR tran, this should
flash the visible led and activate the sounder.
2) If you have a smartphone you can get an app
which will let your camera see infrared light,
there are a number of them at the app store.

These steps will show if the infrared part is working
Please let me know what happens.

Ata0Ana (author)2015-04-08

and what is it ????

Ata0Ana (author)2015-04-08

i want use PIR sensor instead of IR photo tran ,how can i do it without change circuit?? must i change circuit ?????

and this is my new circuit ...

Ata0Ana (author)2015-04-06

oh i forgot a thing this is that i dont use battery rather i use power supply 3 volt , 500 mA

jeffxxx (author)Ata0Ana2015-04-06

Hi Ata0Ana,

I would not recommend R4 lower than 82 ohms.

R3 will be ok at 3.3k ohm.

Would be better to bend the IR LED and IR photo tran slightly towards each other.

Hope this is helpful.


Ata0Ana (author)2015-04-06

o my god Jeff you finally came back but i deleted R4 and my IR led is healthy and work goodly !!!

1-can i continue without R4 or i put 27 ohm ???

2-and i want decrease R3 to 3.3 kohm , is it ok ???

3-and do i must bend and recurve just IR led toward IR photo tran???

thank you Jeff for your attention

jeffxxx (author)2015-04-06

Sorry but the max output current for this PIC is
25mA, so to be safe R4 should not be lower than

Ata0Ana (author)2015-04-05


Ata0Ana (author)2015-04-04

please answer i cant wait more

Ata0Ana (author)2015-04-04

i want change R3 of IR tran ????

Ata0Ana (author)2015-04-04

i deleted R4 but nothing happened and i am sure problem is IR tran , it is not sensitive anywise i changed it with the new IR Tran but nothing happened again... i am very tired and disappointed for wait you if you dont answer me i will kill myself ..... i need my dreams

Ata0Ana (author)2015-04-01

can i delete this resistor(R4) forever i mean 0 ohm..??? and how i put the IR led and tran together for be sensitive (the black detector in image is in IR transistor 5mm role)

Ata0Ana (author)2015-03-10

helloooo, any body here ???? M.r Jeff Barnes are you here ??? i have more questions sir

Ata0Ana (author)2015-03-05

oh excuse me i forgot two things, first i use which color LED ?(blue green or red )

and the LED how many times flashes(in rem status) ?

Ata0Ana (author)2015-03-05

first i should say thank you for this reply but i have a question dear

if i were in "non-rem" Status and the device begins for scan and my eyes moving around slowly(non-rem) so the device will turn on leds and piezo and so i will wake up !!?? i think the IC1 should be adjusted someway that don't sensitive to slow movements,just sensitive to rapid movements ,do i say right my dear??

and whether i need press PB1 always ? i mean,only needs for press PB1 to be checked once a month


Ata0Ana (author)2015-03-03

Excuse me ,what is the "DreamMach.HEX" file ???

Can i use this file for programming of "IC 12f675" ??? is this file enough?? my mean is dont i need write new program ???

and other question What is the function(task)of push button(PB1) ??? pleas explain

thanks dear

jeffxxx (author)Ata0Ana2015-03-04

Hi Ata0Ana,

Thank you for showing a interest in my project.

Yes the file "DreamMach.HEX" is all you need to program the 12f675 PIC.

As for PB1

1/ Keep push button(PB1) pressed then turn on with slide switch and release push button(PB1),
the LED will flash and piezo will sound,
this is to allow adjustment of the LED light intensity VR1 and piezo volume VR2, also to check battery state of charge.
2/ Press button(PB1) until LED only flashes and release, this will enter infrared functionality test, where by moving your eye under closed eye lid, as in REM, should flash the LED and sound the piezo.
3/ Pressing button again, the device will go into the main program or turn off and on(slide switch) device


This procedure only needs to be checked say once a month, to check state of battery.

Operation of push button(PB1) when machine is on.
If push button(PB1) is pressed the LED will stay on until released then flash once, there will then be a delay of 30 minutes and then it will start to scan the eye a number of times, to check for REM, delay for 15 minutes and repeat until the device is turned off or the push button is pressed.
The push button(PB1) can be pressed at any time. This can be used if sleep has been interrupted or one wants to experience Lucid/Dream recall at any other time.

Hope this is helpful

Good luck,


Ata0Ana (author)2015-03-03

hello dear

dear i want make a "dream machine" just like your device and sorry In order that i can't buy this device of you because i am in Iran. can you help me that i make it ?first i should say i can't work with PIC so can i use AVR instead of PIC, of course with same function???

and i have an algorithm that i wrote this from your algorithm please check it if a part of this algorithm was not right please help me and edit it until i modify algorithm

this is my algorithm :


1- 20 second after turn on device start scan eyes for three times (20 sec delay then scan) and go Second step

2- 3 hours delay

3- (after 3 hours) start scan for 3 times if eyes are in rem state go fourth step and if eyes are in non-rem state go fifth step

4- turn on LEDs and piezo and go sixth step

5- 15 minutes delay and go third step

6- 30 minutes delay and go third step


i wait for your replay

thank you dear

daksi990 made it! (author)2014-08-07

But it still does not work :)

jcastaneda5 (author)daksi9902014-10-28

Hope you figured it out. think it could do with that big ass capacitor?

pingiant (author)2014-09-27

Hello, I have done some research now and this is the best project I have seen so far. Thank you for sharing it, I am very excited to build it. Has there been any updates since you made this, seeing that it was made in 2010 ? Best regards

daksi990 (author)2014-08-07

Hi i have a problem with infrared triggering the machine is running but only the blink of an eye When moving eyes under closed lids machine not working!I have tried moving the infra red LED and transistor but without success.I also saw a separate picture settings Led and transistor but still without success.

jeffxxx (author)daksi9902014-09-10

Hi Daksi,
Sorry you are still having problems.
You could try using different IR trans and leds or I can supply you with
the parts I use, say for 5 Euros this includes postage. If this is acceptable let me know

jeffxxx (author)daksi9902014-08-13

Hi daksi990,

You could try decreasing the value the IR led resistor R4 to 100 ohms, this will increase the current and therefore increase the light intensity.

Hope this works out. Thank you for checking out my machine.


daksi990 (author)jeffxxx2014-08-15

Hi i put resistor 68R (68 ohms But still not working!What to do?

daksi990 (author)daksi9902014-09-05

I fixed it with this scheme

bilal sardar (author)2013-11-15

can you please provide the flow chart, i want to use avr attiny13. and by the way who writes in machine language these days?

kamill9619 (author)2012-11-14

I have a Problem, I don't know I choose transistor IR ? :{


goldenshuttle (author)2012-05-13

I like this project. how much if I wanna buy the pre-programmed PIC only(2 pcs). I have all the other components and can solder kits well. I only don't know about PIC programming and so.

jeffxxx (author)goldenshuttle2012-05-16

Hi goldenshuttle,
The cost of two PICs and postage will be 11Euros.
Hope this is acceptable.

rasimmonds (author)2012-01-17

Hi, thanks for this instructable, it looks great. I've never done electronics before but am willing to give it a try. Maplin is the main place to buy components in the UK and I see they are in Ireland too so hopefully you are familiar with them too. Looking at their website the range of components is quite daunting. I wondered whether u could do me a big favour and say what the Maplin product codes are for each component. Would be very much appreciated. Thanks

TheREALfatNINJA (author)2012-01-06

Hmmm... You know I've always wanted to try one of these devices. Problem there is that I have ZERO experience with micro controllers. :/ What can I say, it's on my 'to do' list.

Say, I see that your were willing to sell of kits or even complete units. Are you interested in putting together one of these?

jeffxxx (author)TheREALfatNINJA2012-01-09

Hi Therealfatninja,
Glad you found the project interesting.
If you are interested in a kit this will cost 35 Euros including recorded postage and for a completed devise 70 Euros also postage included. Sorry I can not offer it at a lower price, the sleep mask is quite expensive.
Best regards,

About This Instructable




More by jeffxxx:Lucid Dream/Dream Recall Machine using infrared.
Add instructable to: