339 lines
19 KiB
Plaintext
339 lines
19 KiB
Plaintext
______________________________________________________________________________
|
|
| File Name : LDMON122.ASC | Online Date : 12/19/95 |
|
|
| Contributed by : Jerry Decker | Dir Category : BIOLOGY |
|
|
| From : KeelyNet BBS | DataLine : (214) 324-3501 |
|
|
| KeelyNet * PO BOX 870716 * Mesquite, Texas * USA * 75187 |
|
|
| A FREE Alternative Sciences BBS sponsored by Vanguard Sciences |
|
|
| InterNet email keelynet@ix.netcom.com (Jerry Decker) |
|
|
| Files also available at Bill Beaty's http://www.eskimo.com/~billb |
|
|
|----------------------------------------------------------------------------|
|
|
There are three files associated with the Lucid Dream project;
|
|
|
|
LDHELP.ASC - electronics tutorial
|
|
LDMON122.ASC - details and circuit to build the Lucid Dreamer
|
|
LDMON.BAS - QBASIC program to operate your device
|
|
------------------------------------------------------------------------------
|
|
|
|
REM Sleep Monitoring and Signaling Circuit and Program
|
|
created by
|
|
John Goldsworthy - jgoldswo@coyote.csusm.edu
|
|
developed by
|
|
Boyd Johnson - johnson@spectra.com
|
|
Version Beta 1.22
|
|
|
|
Plans, description and Qbasic program for a dream detection and signaling
|
|
system. The following device can be put together with just a few dollars of
|
|
parts from an electronics store (eg. Radio Shack), a hardware store and a
|
|
sporting goods store. Other requirements are:
|
|
|
|
An IBM compatible PC with a game port and a parallel port
|
|
DOS 5 or greater with the bundled Qbasic interpreter
|
|
VGA monitor (optional - for graphing REM data)
|
|
|
|
My goal is to design a cheap, easy to assemble device that feeds raw input to
|
|
a computer requiring few or no additional purchased hardware or software that
|
|
will be fairly accurate in detecting periods of rapid eye movement (REM). I
|
|
have very little money to spend on parts, not a lot of electronic design
|
|
background, and a decent amount of free time to work on a program that will
|
|
run it all. I would like to thank John Goldsworthy for creating the basic
|
|
program structure that I was able to build on, since I haven't worked with
|
|
BASIC in many years, have no Qbasic manual and had no idea how to access ports
|
|
and files.
|
|
------------------------------------------------------------------------------
|
|
BASIC OPERATION OF CIRCUIT AND PROGRAM
|
|
|
|
An infrared (IR) LED reflects off your eyelid and into a PhotoTransistor(PT).
|
|
Any eye movement changes the amount of light entering the PT. The circuit is
|
|
extremely simple in that the PT connects directly to the game port, feeding
|
|
the raw light change values to the computer.
|
|
|
|
The program as it is right now takes these changes and accumulates all changes
|
|
(over a value of 2 (user changable via menu), which I consider noise) for a
|
|
period of 10 seconds. If the accumulated value (MOVEMENT) is over a user-
|
|
defined THRESHOLD the PERIOD counter is increased by one (0 -> 1). Whether or
|
|
not that minimum is reached the timer is reset for another 10 seconds. If
|
|
three _consecutive_ PERIOD's of THRESHOLD or more MOVEMENTs are read this is
|
|
an indication of "rapid eye movement", whether it is REM sleep or you wake up
|
|
and look around.
|
|
|
|
At the point REM is verified the FLASH subroutine is called, flashing the LED
|
|
a user-defined number of times. Then the flash is disabled for a user-defined
|
|
amount of time (default 15 minutes).
|
|
|
|
During the entire monitoring time the TIME, MOVEMENTS and PERIODS are written
|
|
to a file. There is a built-in graphing routine that will plot this data to a
|
|
VGA monitor, showing different colors for 0, 1, 2, and 3 PERIODS and for the
|
|
flash disable period. The THRESHOLD line is drawn over the graph lines to
|
|
show if you chose a good THRESHOLD value.
|
|
|
|
Disclaimer: I am providing these plans and program as experimental aids in
|
|
achieving lucid dreams by way of monitoring eye movements and signaling the
|
|
user when he or she is probably in a dream state. I will assume no
|
|
responsibility for damage to your computer or yourself caused by using this
|
|
information. The Infrared LED emits only .0005 watt of light/heat. I am not
|
|
an expert, but even at a centimeter from your eye I can't imagine it causing
|
|
eye damage. The green LED emits 6.3mcd, whatever that is (milli-candles?).
|
|
It flashes only at the start of REM sleep, so it shouldn't cause damage
|
|
either. The wires provide a maximum of 5 volts of current-limited power. If
|
|
they are plugged into the wrong pins or shorted together there is a
|
|
possibility of causing computer damage or fire. Make sure to tape or use heat
|
|
shrink tubing on all exposed wires.
|
|
|
|
The program makes the circuit continuously self-calibrating, so slight shifts
|
|
in goggle position will have very little effect. It is very cheap and easy to
|
|
make. The program needs a fancy algorithm to more accurately determine REM
|
|
sleep. Currently you need to watch the graph and determine the optimum
|
|
THRESHOLD movement level.
|
|
------------------------------------------------------------------------------
|
|
MINIMUM PARTS LIST (about $10 + or -):
|
|
|
|
$1.99 IR LED/Detector pair (Radio Shack P/N 276-142)
|
|
$ .99 Green LED pair (RS 276-022) {or use red, yellow, "bright",
|
|
etc}
|
|
$ .79 Diode (1N4005) (RS 276-1104 any 1N4000 series will work, 2
|
|
diodes per pack, need 8 diodes=4 packs)
|
|
$1.49 25 pin male D plug (RS 276-1547) {printer port plug}
|
|
$ .49 3.1K (or so) resistor (package of 5)
|
|
$ .49 1K resistor (RS 271-1321) 2 in parallel = 500 ohms
|
|
$ .98 2.2K ohm resistor (two packages of 5)
|
|
$1.80 30 ft. (or distance PC to bed) of 4 wire phone cord (Home Depot)
|
|
$1.29 "Intermediate" sized swim goggles (Thrifty Drug) or better ones
|
|
$1.99 Game port (15 pin male) solder plug (hard to find)
|
|
|
|
Here is how the simplified circuit looks like. Resistors are what I could
|
|
find on old PC-XT boards, and are not critical values. The 3.1K can probably
|
|
be anything from about 1K to 50K. The 500 ohm resistor should be at least 250
|
|
ohm and probably not more than 1K or so. I used all eight parallel port pins
|
|
rather than just one. I burned out my parallel port, and suspect either by
|
|
overdriving it by powering the LED with just two data signals soldered
|
|
together, or maybe by trying to print while the monitor connector was shorting
|
|
out the pins.
|
|
|
|
Basically, all you need to do is get eight small diodes, solder the banded end
|
|
together on all of them, and solder the other ends to 2.2K resistors and
|
|
solder them to pins 2 through 9 of the parallel port connector. Put a plastic
|
|
tubing sleeve over each resistor/diode pair before soldering to the parallel
|
|
port to keep them from shorting together. This configuration has the bonus of
|
|
being able to brighten or darken the flashing LED by changing the number of
|
|
data pins used. I added that to the program. Alternatively the LED could be
|
|
"effectively" darkened by adding increasingly more "off cycles" within the LED
|
|
flash loop.
|
|
|
|
The diodes in the parallel port circuit are there to make sure there is no
|
|
voltage feedback between on and off pins. After burning out one port I'm not
|
|
taking any chances. Any suggestions for a simplified circuit from a qualified
|
|
electronic engineer would be appreciated. The purpose of all resistors is to
|
|
reduce the 5V to a point where the LED or PT won't be damaged by higher than
|
|
rated voltage (typically 2V).
|
|
|
|
A 4 wire phone cable is sufficient for computer to goggle connection for 5V,
|
|
gnd, detect & flash. Some concern about connecting the two printer port data
|
|
pins together may be warranted. One pin might supply enough power to drive
|
|
the green LED. You may want to get a 6 conductor phone cord at 2 cents more
|
|
per foot to add an additional sensing circuit that is in the program already
|
|
or to allow for an audio cue from a miniature earphone plugged into a sound
|
|
board with a vocal "You are sleeping" played at flash time. Find out your
|
|
"dream signs" and use a cue you will recognize in your dream.
|
|
------------------------------------------------------------------------------
|
|
|
|
500
|
|
------> ---------/\/\/\---+
|
|
| | |
|
|
| | +-----/\/\/\---+---------------------------o pin 1 (+)
|
|
| IR PT 3.1K ((Game Port))
|
|
SW[1] | +------------------------------------------o pin 3 (joystick)
|
|
| ----------------------------------------------o pin 5 (-)
|
|
| |
|
|
| green LED 2.2K
|
|
| | resistors diodes ((Parallel Port))
|
|
------> --------------------------------+--/\/\/\--|<--o pin 2
|
|
|
|
|
+--/\/\/\--|<--o pin 3
|
|
|
|
|
+--/\/\/\--|<--o pin 4
|
|
|
|
|
+--/\/\/\--|<--o pin 5
|
|
|
|
|
+--/\/\/\--|<--o pin 6
|
|
|
|
|
+--/\/\/\--|<--o pin 7
|
|
|
|
|
+--/\/\/\--|<--o pin 8
|
|
|
|
|
+--/\/\/\--|<--o pin 9
|
|
|
|
NOTE [1] Optional switch for "reality check"
|
|
|
|
The 15 pin game port connector on the back of the computer is numbered like
|
|
this:
|
|
|
|
8 1
|
|
o o o x o x o x (The x's mark the pins in the diagram above.)
|
|
o o o o o o o
|
|
15 9
|
|
|
|
The 25 pin parallel port SOCKET (female) type connector on the back of the
|
|
computer is numbered like this:
|
|
|
|
13 1
|
|
o o o o x x x x x x x x o
|
|
o o o o o o o o o o o o
|
|
25 14
|
|
|
|
------------------------------------------------------------------------------
|
|
The NovaDreamer that this is patterned after does not use goggles, but uses a
|
|
very comfortable "light mask" type of device, something like a "Lone Ranger"
|
|
or "Zorro" mask. I'll describe it and see if someone can come up with a
|
|
reasonable substitute in materials.
|
|
|
|
The mask is 8 1/2" wide by 4" high at the widest points. It is made of a
|
|
vinyl material silky on the outside and textured on the inside. There are 9"
|
|
by 2" elastic straps sewed into each end. The other end of one strap has a 2"
|
|
by 2" velcro "hook" patch. The other strap has three 2" by 1" velcro "pile"
|
|
patches sewed every other inch, so that no matter where the velcro attaches
|
|
there is 1" of hook/pile connection.
|
|
|
|
There is a 4 1/2" wide by 4" high pouch in the back of the mask that holds the
|
|
circuit board with 2 AAA batteries, 3/8" piezo-electric speaker, LEDs and PT
|
|
and electronic components (16 pin EPROM, 8 pin TLC25L2CP, 7 capacitors, 14
|
|
resistors + 1 SIPP resistor, 10 position switch, earphone jack, MC reality
|
|
switch) and it is held into the pouch with two 3/8" square pieces of velcro at
|
|
the top, back corners.
|
|
|
|
Stuck to the inside pouch there is a 3 1/2" by 3 1/2" cloth-backed on one
|
|
side, adhesive on the other side soft 1/2" foam rubber. There are 1 5/8"
|
|
diameter semicircles cut on each side of the foam and a widened nose shaped
|
|
cutout at the bottom of the foam. The semicircles center 1 3/4" below the top
|
|
of the foam. The nose cutout goes to 2 1/4" from the top of the foam and out
|
|
to the lower corners.
|
|
|
|
There are 3/4" cutouts toward the bottom of the semicircles for the flashing
|
|
bright red LEDs on both sides and IR LED and PT on the right side. All LEDs
|
|
are recessed into the circuit board, so there is about 1/2" between all LEDs
|
|
and PT and eye side of foam. Your eyes will be back somewhat from there.
|
|
|
|
There is a "reality test" button on the front center 1 1/4" from the top. The
|
|
foam rubber goes from 1/2" from the top of the mask down exactly to the bottom
|
|
edge. This needs to be added to my circuit, since after wearing the mask
|
|
awhile people tend to dream that they are wearing it. They need a reliable
|
|
indicator they can push that should flash the LEDs.
|
|
|
|
In a dream pressing the button usually doesn't produce the correct flash and
|
|
sound. The button will reset delay cycles if held down for 1 second. I
|
|
intend to add a feedback circuit with this type of switch that will
|
|
momentarily flash and sound the earphones if pressed quickly and will reset
|
|
delays or possibly change other features if pressed repeatedly or held for a
|
|
second. This circuit would use wires 5 or 6 and would go to a joystick switch
|
|
terminal. An easier way would be to connect a momentary contact switch
|
|
between 5V (with resistor) and the flash LEDs.
|
|
|
|
However, this would not allow a feedback to the program. When the mask is
|
|
worn it completely blocks out light except for some coming in from the bottom.
|
|
It should be snug but not uncomfortable.
|
|
|
|
The Lucidity Institute sells another device called the DreamLight. The
|
|
DreamLight mask itself is sold by the Lucidity Institute for $15. Its
|
|
description is the same as the NovaDreamer mask without the circuit board.
|
|
The DreamLight with all associated electronics is sold for $1200. It is
|
|
basically a NovaDreamer with several additional features including a wire that
|
|
runs to a computer module that will save data gathered from several nights of
|
|
monitoring. I have tried calling the Lucidity Institute many times and always
|
|
get a recording. They don't call back and I'm not going to leave a credit
|
|
card number on a recording.
|
|
|
|
I Added a second movement recorder on 9-13-94. The main purpose for this is
|
|
to use in conjunction with the NovaDreamer to compare ND triggering with this
|
|
circuit triggering and find a correlation. I am assuming REM for both eyes
|
|
will be the same. The ND uses only the right eye for REM detection.
|
|
|
|
Putting the goggle over the left eye with a second PT on top of it facing the
|
|
ND flashing LED will record all ND flashes along with REM sensed with this
|
|
circuit. I'll have about a week to test this with after I buy and install the
|
|
second PT.
|
|
|
|
I tested the ND for over two weeks with mixed results. When I used two
|
|
joystick inputs they seemed to interfere with each other, causing a lot of
|
|
noise on the second movement sensor graph. I had a lot of other observations
|
|
about the ND that would be too verbose to add here.
|
|
|
|
If you use goggles they should be assembled something like this (1 or 2 eye,
|
|
your preference):
|
|
|
|
/---------\
|
|
/ O O<--\--IR & PT pair about 5/8" apart toward top of eye
|
|
| |
|
|
\ O <--/--flashing LED
|
|
\-------/
|
|
|
|
I used a 3/16" drill bit and a tiny file to make the holes slightly larger.
|
|
The IR LED has a fairly narrow beam of light, so it is important to aim it so
|
|
the LED light beam meets the center of the field of view of the PT as closely
|
|
as possible to where your eyelid is. If you use both sides of the goggle you
|
|
should put a flashing LED on both sides, but the IR/PT pair only needs to be
|
|
on one side. There have been reports that the listed IR LED may not shine
|
|
directly out, so use one of the following techniques to find the path of the
|
|
invisible IR light.
|
|
|
|
Use a camcorder viewfinder in low-light to find the direction of light output
|
|
from the LED. If not vertical try to place the LED so the light "shines" more
|
|
toward the PT. Then simply line up the LED light axis so it converges with
|
|
the expected PT axis right at the eyelid. Once you do that test it by being
|
|
_in_almost_complete_darkness_ with the "Calibrate" option of my program or in
|
|
the idle loop waiting for STARTTIME while displaying light values.
|
|
|
|
As you move your hand slowly toward the place your eye would be the values
|
|
should continue to increase. After a certain point, hopefully closer to the
|
|
LED than your eyelid would be, the values will sharply drop off again. Mine
|
|
had high values in the low 200's and a value of 0 with nothing blocking the IR
|
|
light. These are total light reflection values, not movement (change) values
|
|
over a period as noted in the first paragraphs.
|
|
|
|
If you don't have a camcorder handy you can just as accurately determine the
|
|
light path by separating the LEDs from the goggle and pointing them directly
|
|
at each other, then rotating the LED and monitoring the output as above. You
|
|
could also do that with the PT to see if there is a more sensitive input path
|
|
for it. I would be interested to see if the PT had better sensitivity with a
|
|
non-vertical direction or if the sensitivity drops off very sharply.
|
|
|
|
Color the goggle lens black to keep out outside light, since it is very
|
|
succeptible to incandescent light. I replaced the rubber seal on the cheap
|
|
goggle I bought (that left a ring around my eye) with foam rubber. I think I
|
|
need a thinner foam layer, because now REM activity is less obvious.
|
|
|
|
The LED polarity (on the Radio Shack IR LED & flashing LED listed) is
|
|
determined by looking through the lens. The opaque metal in the base is
|
|
divided in two pieces. The smaller piece connects to the positive lead (V+).
|
|
|
|
The PT (dark red) should be connected reversed from this diagram. Wrong
|
|
polarity will probably be indicated by an apparent open circuit with full
|
|
voltage at + side of LEDs/PT and nothing working.
|
|
|
|
/^\
|
|
| |
|
|
|.==| LED/IR-LED "picture"
|
|
-----
|
|
+ | | -
|
|
| |
|
|
|
|
If you add audio cues with a soundboard you can purchase a cheap set of
|
|
earphones (I used a $3.99 Memorex 1/2" wide separate foam pad set) cut the
|
|
earphone cord in the middle, _carefully_ strip the two wires, and connect the
|
|
center conductor of them to wires 5 & 6 if you got the 6 wire AT&T phone cord.
|
|
My SoundBlaster Pro has stereo output with a common ground. I didn't need to
|
|
ground the computer end of the headphone plug, since it was already grounded.
|
|
|
|
The goggle end of the earphones needs to be grounded to the ground wire used
|
|
with the LEDs. The center conductors connect to the same two wires used on
|
|
the plug end of the phone wire. If the computer is close enough you can just
|
|
connect the headphones directly to the soundboard without cutting it, or use a
|
|
headphone extender. Radio Shack has one for under $3 I believe. An
|
|
alternative audio device would be a Radio Shack piezo-electric buzzer. It
|
|
runs on 1.5V to 4V DC and could be connected directly to the flashing LED
|
|
terminals. Add a toggle switch to one lead to enable or disable it.
|
|
|
|
The "reality test" button on the NovaDreamer could be simply emulated by
|
|
putting a resistor and switch between the flash LED and the 5V line at the
|
|
goggle (game port pin 1) or even just a switch between the flash LED and the
|
|
point between the IR-LED and the 500 ohm resistor as noted in the diagram.
|
|
------------------------------------------------------------------------------
|