______________________________________________________________________________ | File Name : LDHELP.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 | |----------------------------------------------------------------------------| The following file was written to accompany the Lucid Dream project. 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 ------------------------------------------------------------------------------ Mini Electronics Tutorial This is a little primer to get people without an electronics background up to speed to be able to build this circuit and know how it works. It will also help you troubleshoot it if it doesn't work. I cut pieces out of a mail message I had sent to someone trying to build it, so it may not be laid out well at this point. Any corrections, additions, or best of all, pointers to a good brief, on-line electronics tutorial would be appreciated. Send to (johnson@spectra.com). ------------------------------------------------------------------------------ I'll start out with the basic concepts of electronics. Resistance, as the name says, is something that _resists_ the flow of electricity. It is not related to either flow or force. An analogy they sometimes start with in electronics classes is drinking a very thick chocolate malt. If you use a normal straw it is kind of hard to suck out the malt. If you have a 1/2 inch wide straw it would be much easier, and if you had one of those plastic coffee stir sticks with the tiny holes through it it would be almost impossible to drink it. The difference is the resistance of the straws. Voltage is the force behind the electricity. It is highest at the power source (battery, power supply, wall outlet) and gets lower as it goes through the circuit back to the return. Using the malt analogy, voltage is the "pressure (or vaccuum in this case)" you use when you suck on the straw. The harder you suck on the straw, the more malt you get. Current is the volume of flow of electricity. It is the malt in our analogy. These three are totally separate concepts but they are the only three variables in probably the most important formula in electronics, Ohm's law. Voltage ("E", which stands for "electromotive force") equals current ("I", I don't know what 'I' stands for) times resistance ("R"). That is, E=I*R. Example 120 = 2 * 60. If you have 120 "volts" of electricity going through a 60 "ohm" resistor you will _always_ have 2 "amps" of current flow (providing the resistor doesn't burn out :)). Voltage and resistance are the two factors that are easiest to control. The variables can be switched around using laws of math (dividing both sides of an equation by the same thing) so that all three of the following formulas are the same. E=I*R, R=E/I, I=E/R. Using our analogy, if you cut the resistance in half by using two straws side- by-side instead of one straw and suck the same amount (voltage) you will get twice as much malt (current). If you double the resistance by putting the two straws end-to-end you will get half as much malt. That is all there is to parallel and series resistor circuits. If you put resistors in parallel the same amount flows through each resistor, but more current is flowing after they connect again into the circuit. If you put two resistors end-to-end the same voltage is spread between the two resistors, so with half the voltage only half the current will flow through the resistors. That is the purpose of the resistors in my circuit. They "divide" the voltage across several (2 or 3) "components" so by the time it gets to the LED there is only 2 volts left. One more related concept is "power". Power is the product of voltage and current, so P=I*E. I won't go any further, but you can substitute the equivalents of I and E from Ohm's law in there also if you don't know what one of the variables is. END OF TUTORIAL ------------------------------------------------------------------------------ Some troubleshooting information for the Lucid Dreamer REM sensing circuit. I used silicon diodes, but germanium diodes should work almost the same. The only difference is silicon diodes "drop" .7 volts in saturation while germanium diodes drop .3 volts. That just means the 5V you start with will be 4.7v instead of 4.3 volts after it passes through the diodes. You need to get it down to about 2 volts by the time it gets to the LED, depending on how the LED is rated on the package it came in. You need to make sure that in any electronic circuit diodes are not backwards. This includes all silicon based components such as diodes, zeners, LEDs, phototransistors or transistors. One thing you should notice is with no power to the circuit (NEVER MEASURE _RESISTANCE_ WHILE THERE IS POWER TO THE CIRCUIT) the "resistance" across a diode will read drastically different depending on which direction the diode is pointing, or rather what side of the diode the red and black meter leads are. That is because the purpose of a diode is to let electricity through in only one direction. That is why I chose them. I don't want the voltage from one parallel port pin to loop back to another parallel port pin. If the circuit does not have power applied to it the DCV setting will not display anything of value. Only something like a photocell will display anything of value, because it is a source of power. The DCV range measures voltage only, and if there is no voltage applied to the circuit nothing of value can be read. I say nothing "of value" because even if you hold the meter leads in your hands and have it on a very sensitive range you'll possibly see something just from the minute electrical fields in your body. On resistance also your skin will make a difference, so it's best not to hold both leads with your fingers while measuring resistance of something. The best way to test the circuit would probably be with the voltmeter. I'll draw up a little chart showing _approximations_ of what you should expect and what other readings could be caused by. I haven't measured them to see just what they should be. Use the "Calibration" menu option of the ldmon program and create test flashes by using sub-option B or C. You need to use the voltmeter to find out if they are backwards. The meter won't tell you until you get experience with _your_ meter seeing which meter lead is positive and which is negative. It may or may not be the red for positive. It probably is, but I never really checked many different meters for comparison. With power applied to the circuit, connect the black meter lead to the negative power lead. In my circuit it is pin 5 (-) of the game port. Leave it there for all voltage measurements _unless_ you are specifically measuring the voltage _across_ a certain component. Now put the red lead on the parallel port pin 2 side of the diode or resistor on that line. MAKE SURE THE METER IS ON VOLTAGE AND NOT CURRENT OR RESISTANCE. Failing to do so could burn up your meter. You will probably not ever need to use the current measurement position on your meter if it has it. You have to really know what you are doing before using it anyway, otherwise you burn out your meter. Make the circuit activate from the Configuration menu, selecting the (B) or (C) options, then pressing 0 to flash it. Look at the meter. It should be going between 0V and 5V. If so, your parallel port is working right. Move on to the next step. Move the red meter lead to the other side of the diode (assuming it is a diode and not a resistor. I probably better make that one way or the other in the diagram for troubleshooting help). Make it flash again. If the voltage barely changes from 0V at all your diode is backwards. If it goes to 4.3 or 4.7V (germanium or silicon) it is correct. If it is _always_ nearly 5V your LED is backwards. Now move the red meter lead to the other side of the resistor just before the circuit gets to the LED. The point on the wire makes no difference. A wire is supposed to be just like a point in electricity and has very little resistance. Make it flash again. The voltage _should_ go between 0V and 2V now. If it is below 2V your resistor may be too big. If it is higher your resistor may be too small (ohms, not size). However, the LED may mask anything that's not a drastic difference, because it isn't a simple resistor providing a constant resistance. It _tries_ to keep the voltage across it to 2V. Here is the circuit from highest voltage on left to lowest on right. Since all points along connected wires are electrically the same as if they were at the same point I will change the diagram wiring to simplify it for test point locations. The components are still laid out the same despite the difference in appearance. Red meter lead voltage test points (A) to (K) , joystick pins JS-1, JS-3, JS- 5, and parallel port pins PP-2 and PP-3 out of 8 pins. Keep the black meter lead on test point (C). 5V ground JS-1--(+) (-) | | circuit |(A) 500 (B) (C)| 1. ---> +-----------/\/\/\-----------IR----------------+ | | |(A) 3.1K (D) (E) | 2. ---> +-----------/\/\/\-----------PT-------JS-3 | | (F) diode (G) 2.2K (H) (C)| 3. ---> PP-2--------->|----------/\/\/\--------+--LED---+ | (I) diode (J) 2.2K (H) | 4. ---> PP-3--------->|----------/\/\/\--------+ Four circuits above have voltage tables listed below: 1. IR LED circuit (A) (B) (C) Comment ___ ___ ___ ________________________________ 5 2 0 Normal voltages 5 5 0 IR is backwards or burned out 5 1 0 Resistor is too high value or bad 2. PhotoTransistor circuit (A) (D) (E) Comment ___ ___ ___ ________________________________ 5 4 1 Normal voltage with no light 5 2 1 Normal voltage with bright light 5 5 ? LED is backwards or burned out 5 3 3 Resistor is too high value or bad {I'm not sure about what should be at (E)} 3. First flash circuit line PP-2 (F) (G) (H) (C) Comment ___ ___ ___ ___ ________________________________ 0 0 0 0 Flash is not enabled 4 3.5 2 0 Flash is active (INTENSITY 1-8) 4 1 1 0 Diode is backwards 4 3.5 1 0 Resistor is too high value or bad 4 3.5 3.5 0 LED is backwards or burned out 4. Next flash circuit line (I) (J) (H) (C) Comment ___ ___ ___ ___ ________________________________ 0 0 0 0 Flash disabled or INTENSITY 1 4 3.5 2 0 Flash is active (INTENSITY 1-8) 4 3.5 2 0 Flash is active (INTENSITY 2-8) 4 1 1 0 Diode is backwards 4 3.5 1 0 Resistor is too high value or bad 4 3.5 3.5 0 LED is backwards or burned out If you use the camcorder IR LED viewing technique described in the description, it's best in total darkness, and if you have a black-and-white camcorder eyepiece it will be dull gray. It gets brighter gray when it is pointed directly at the camera lens. Hold it as close to the lens as the camera will focus. You may need to turn off auto-focus so it doesn't keep trying to refocus in the dark. > Maybe the IR and PT need more power than they're getting. The package says > they can have a maximum of 20V. (On a different part it says it can only > take a reverse voltage of 2 though). I'm not an expert, but I believe that means it will take 20 volts when it is backwards, not putting off any light (or in the case of the PT not changing resistance). If it is forwards in the active state it is only supposed to be 2V. > Since I have no real knowledge of electronics, I'm not sure how everything > works, but in your diagram where the PT is connected up to pin one (+) > then goes to connect with pin 3, what is pin 3 used for? Doesn't the PT > need a negative voltage as well? (that's probably what pin 3 is right?) Pin 3 is the joystick sensing line. There is internal circuitry on the I/O board to return it to (-). On a normal joystick moving the stick changes the value of resistance between 5V and the sense line on pin 3. That is exactly what you are doing with the resistor and PT. ------------------------------------------------------------------------------