Mind Performance Projects for the Evil Genius

240

Transcript of Mind Performance Projects for the Evil Genius

Page 1: Mind Performance Projects for the Evil Genius
Page 2: Mind Performance Projects for the Evil Genius

Mind PerformanceProjects for

the Evil Genius: 19 Brain-Bending

Bio Hacks

Page 3: Mind Performance Projects for the Evil Genius

Evil Genius Series

Bike, Scooter, and Chopper Projects for the Evil Genius

Bionics for the Evil Genius: 25 Build-It-Yourself Projects

Electronic Circuits for the Evil Genius: 57 Lessons with Projects

Electronic Gadgets for the Evil Genius: 28 Build-It-Yourself Projects

Electronic Games for the Evil Genius

Electronic Sensors for the Evil Genius: 54 Electrifying Projects

46 Science Fair Projects for the Evil Genius

50 Awesome Auto Projects for the Evil Genius

50 Green Projects for the Evil Genius

50 Model Rocket Projects for the Evil Genius

51 High-Tech Practical Jokes for the Evil Genius

Fuel Cell Projects for the Evil Genius

Mechatronics for the Evil Genius: 25 Build-It-Yourself Projects

Mind Performance Projects for the Evil Genius: 19 Brain-Bending Bio Hacks

MORE Electronic Gadgets for the Evil Genius: 40 NEW Build-It-Yourself Projects

101 Outer Space Projects for the Evil Genius

101 Spy Gadgets for the Evil Genius

123 PIC® Microcontroller Experiments for the Evil Genius

123 Robotics Experiments for the Evil Genius

125 Physics Projects for the Evil Genius

PC Mods for the Evil Genius

Programming Video Games for the Evil Genius

Solar Energy Projects for the Evil Genius

Telephone Projects for the Evil Genius

22 Radio and Receiver Projects for the Evil Genius

25 Home Automation Projects for the Evil Genius

Page 4: Mind Performance Projects for the Evil Genius

Mind PerformanceProjects for

the Evil Genius: 19 Brain-Bending

Bio Hacks

BRAD GRAHAM and KATHY McGOWAN

New York Chicago San Francisco LisbonLondon Madrid Mexico City Milan New Delhi

San Juan Seoul Singapore Sydney Toronto

Page 5: Mind Performance Projects for the Evil Genius

Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Except as permitted under the United States Copyright Act of 1976, nopart of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the priorwritten permission of the publisher.

ISBN: 978-0-07-162393-3

MHID: 0-07-162393-0

The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-162392-6, MHID: 0-07-162392-2.

All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we usenames in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designa-tions appear in this book, they have been printed with initial caps.

McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs.To contact a representative please e-mail us at [email protected].

Information contained in this work has been obtained by The McGraw-Hill Companies, Inc.(“McGraw-Hill”) from sources believed to be reliable.However, neither McGraw-Hill nor itsauthors guarantee the accuracy or completeness of any information published herein, and neitherMcGraw-Hillnor its authors shall be responsible for any errors, omissions, or damages arisingout of use of this information. This work is published with the under-standing that McGraw-Hilland its authors are supplying information but are not attempting to render engineering or otherprofessional services. If suchservices are required, the assistance of an appropriate professionalshould be sought.

TERMS OF USE

This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of thiswork is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you maynot decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish orsublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; anyother use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.

THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCU-RACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMA-TION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRAN-TY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR APARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your require-ments or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inac-curacy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the contentof any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental,special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of thepossibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tortor otherwise.

Page 6: Mind Performance Projects for the Evil Genius

For Trudy “SilverWolf.” Thank you for your wonderful support and friendship.

—NorthernWolf

Page 7: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 8: Mind Performance Projects for the Evil Genius

Brad Graham is an inventor and electronicshobbyist. He is the coauthor of 101 Spy Gadgetsfor the Evil Genius, Atomic Zombie’s BicycleBuilder’s Bonanza, and Bike, Scooter, andChopper Projects for the Evil Genius, all fromMcGraw-Hill Professional.

Kathy McGowan is Mr. Graham’s other “evilgenius” half, providing administrative, logistical,and marketing support for Atomic Zombie’smany human-powered, electric, technical, andpublishing projects. She also manages the dailyoperations of their high-tech firm and numerousWeb sites.

About the Authors

Page 9: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 10: Mind Performance Projects for the Evil Genius

ix

Introduction: Getting StartedWelcome “Noobs”! 1

The Breadboard 1

Electronic Building Blocks 6

The Resistor 9

The Capacitor 12

The Diode 15

The Transistor 16

RTFM—Read the Flippin’ Manual! 19

Asking for Help 20

Tools of the Trade 21

Beyond the Breadboard 26

Section OneExploring the Human Body

Project 1 Biofeedback Device 31

Project 2 Reaction Speedometer 41

Project 3 Body Temperature Monitor 51

Project 4 Respiratory Monitor 59

Project 5 Heart Rate Monitor 65

Project 6 Lie Detector 79

Section TwoThe Dreaming World

Project 7 White-Noise Generator 89

Project 8 Introduction to Lucid Dreaming 95

Project 9 Waking-Reality Tester 101

Project 10 Audio Dream Director 109

Project 11 Light-Sensing Lucid-Dream Mask 123

Project 12 Motion-Sensing Lucid-Dream Mask 133

Project 13 Lucid-Dream-Mask Controller 141

Section ThreeAn Inward Journey

Project 14 The Ganzfeld Effect 155

Project 15 Alpha Meditation Goggles 165

Project 16 Clairvoyance Tester 173

Project 17 Visual Hypnosis Aid 183

Project 18 Color-Therapy Device 189

Project 19 Synchro Brain Machine 197

Conclusion 203

Appendix 205

Index 219

Contents

Page 11: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 12: Mind Performance Projects for the Evil Genius

Sincerest thanks always to our “evil genius”collaborator, Judy Bass, senior and series editorat McGraw-Hill Professional in New York. Yourenthusiasm and support keep us motivated toforge ahead and never give up. You are a veryspecial lady.

Also thanks to many people who take aninterest in our projects and encourage us to

pursue our dreams. We would especially like tothank Paul Tulonen, industry advisor with theNational Research Council of Canada and theIndustrial Research Assistance Program, and theextraordinarily talented folks at DigitalEngineering, Inc., Thunder Bay, Ontario.

Acknowledgments

Page 13: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 14: Mind Performance Projects for the Evil Genius

Mind PerformanceProjects for

the Evil Genius: 19 Brain-Bending

Bio Hacks

Page 15: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 16: Mind Performance Projects for the Evil Genius

Getting Started

Introduction

1

Welcome “Noobs”!If you have been experimenting with electronicsfor any amount of time, then chances are that youcan skip right past this chapter and start digginginto some of the projects presented in this book.If you are just starting out, then you have a littlegroundwork to cover before you begin, but don’tworry, the electronics hobby is well within reachfor anyone with a creative mind and a desire tolearn something new.

As with all things new, you have to start fromthe beginning and expect a few failures along theway. We electronic “nerds” call this “letting outthe magic smoke,” and you will fully understandthis phrase the first time you connect your powerwires in reverse! Please do not be intimidated bythe huge amount of technical material availableon electronic components and devices becausechances are that you need only a small amount ofwhat is available to complete a project. Allproblems can be broken down into smaller parts,and a schematic diagram is a perfect example ofthis. Once you understand the basic principles,you will be able to look at a huge schematic orcircuit and see that it is made up of smaller basicbuilding blocks just like a brick wall.

Because of limited space in this book, I willcover only the essential basics you need to getstarted in this fun and rewarding hobby, but thereare thousands of resources available to researchas you move forward one step at a time. You havethe “evil genius” itch; now, all you need is a goodpile of junk and a few basic tools to set yourideas into motion!

The BreadboardThis oddly named tool is probably the mostimportant prototyping device you will ever own,and it is absolutely essential to this hobby. Abreadboard or solderless breadboard is a devicethat lets you connect the leads of semiconductorstogether without wires so that you can test andmodify your circuit easily without soldering.Essentially, it is nothing more than a board full ofsmall holes that interconnect in rows so that youcan complete a circuit. In the early days, our “evilgenius” forefathers would drive a bunch of nailsinto an actual board (such as a cutting board forbread) and then connect their components to thenails. So you can thank those pioneering “evilgeniuses” who once sat in their workshops with abreadboard full of glowing vacuum tubes andwires for the name!

Page 17: Mind Performance Projects for the Evil Genius

Today’s breadboards look nothing like theoriginals, often containing hundreds of rows toaccommodate the increasing complexity and pincount of today’s circuitry. It is common to have50 or more complex integrated circuits (ICs) on abreadboard running at speeds of up to 100 MHz,so a lot can be done with breadboards. One of mylatest breadboard projects was a fully functional8-bit computer with a double-buffered videographics array (VGA) output and complex soundgenerator. This project ran flawlessly on abreadboard at speeds of 40 MHz and had an ICcount of over 30, so don’t let anyone tell you thata breadboard is only for simple low-speedprototyping. Let’s have a look at a typicalsolderless breadboard that can be purchased atmost electronics supply outlets (Figure I-1).

A breadboard such as the one in the figuretypically will cost you around $30 and willprovide years of use. Without a breadboard, youwould have to solder your components togetherand hope that your design worked on the first try,something that is only a pipe dream in this hobby.The connections under the plastic holes aredesigned so that the power strips (marked +

and –) are connected horizontally, and theprototyping-area holes are connected vertically.The small gutter between the prototyping holes is there so that your ICs can press into the board with each row of legs on each side of thegutter. Figure I-2 shows a close-up of theinterconnections underneath the plastic board.

As you can see, the power-strip holes connecthorizontally, and the prototyping holes connectvertically. In this way, you can have power alongthe entire strip because ground (GND) and power(VCC) often have multiple connection points in acircuit. Once you are familiar with a breadboard,it is easy to rig up a test circuit in minutes, evenone with a high component count. Once yourcircuit is tested and working, you can move it to amore permanent home, such as a copper-cladboard or even a real printed-circuit board (PCB).

To make the connections from one row ofholes to another, you will need wires, manywires. Breadboard wires should be solid, notstranded, have about ¼ in of bare wire at theend, and come in multiple colors and lengths tomake tracing your circuit easier. You canpurchase various breadboard-ready wiring packs

2

Getting Started

Figure I-1 A typical solderless breadboard.

Page 18: Mind Performance Projects for the Evil Genius

from electronics supply stores, but when you getinto larger prototyping, it may get expensive topurchase as many wires as you need. The bestsolution I have found is to get a good length ofCategory 5 (Cat5) wire, which is used for

computer networking, and then strip the ends foruse on the breadboard. The nice thing aboutCat5 wire is that it has eight colored wires witha solid copper core that are a perfect size to fitinto a breadboard. Figure I-3 shows some of the

3

Getting Started

Figure I-2 Connections between holes on a breadboard.

Figure I-3 You can never have enough wires.

Page 19: Mind Performance Projects for the Evil Genius

4

Getting Started

Cat5 wiring cut and stripped for use in mybreadboard.

Cat5 wiring comes as four twisted pairs, so Ijust cut a bunch of lengths, unwind the wires, andthen strip the ends of the plastic sheathing using adull utility knife. Just place the wire over a dullblade, and press down with your thumb to scorethe end so that it pulls away from the wire. Anactual wire stripper works just as well, but thedull blade seems a lot faster when you want 100or more wires for your breadboard. For starters,you will need about 20 wires (each) in lengths of1, 2, 4, and 6 in and a few longer wires forexternal devices. The 1-in wires also shouldinclude red and green (or similar) colors thateasily identify your power connections. Thepower wires will be the most-used wires on yourboard, so make sure that you have enough ofthem to go around.

Figure I-4 shows why it is important to have adull blade for stripping the wires if you choose todo it this way. I purposely sanded the edge of this

utility knife so that it would be sharp enough toscore the wiring shield yet not cut my thumbafter repeated stripping of hundreds of wires in arow. A wire-stripping tool also works well, but Ifind it to be a little slow when I need 128 bluebus wires for a circuit I want to complete beforethe end of the night. Now that you have abreadboard and an endless supply of wires topress into the holes, you can begin prototypingyour first circuit. Learning to look at a schematic,identifying the semiconductors, and thentransplanting the connections to your breadboardwill open up an entire world of fun, so let’s findout how it is done.

Figure I-5 shows a simple schematic of acapacitor and a resistor wired in parallel. Thiswiring is transferred to the breadboard by placingthe leads of the two components into the holesand then using the wires to join the rows. Sincethe holes are all connected to each other invertical rows, the wires can be placed in any oneof the five holes that make a row. Although abreadboard circuit may have 500 wires, there is

Figure I-4 Stripping the Cat5 wiring for the breadboard.

Page 20: Mind Performance Projects for the Evil Genius

5

Getting Started

not much more to it than that. Now you can seewhy prototyping a circuit on a breadboard is easyand lends itself well to modification. There are,however, a few breadboard “gotchas” to keep inmind, and capacitive noise, or crosstalk, is one ofthem.

Crosstalk can be a real problem on abreadboard because the metal plates that make upthe rows of holes are close enough together to actas capacitors. This can induce noise in yourcircuit, possibly causing it to fail or act differentlythan expected. Radiofrequency (rf) or high-speeddigital circuits are prone to noise and crosstalk,and this can create all kinds of “evil genius”headaches. Sometimes you can design a high-speed or rf circuit on a breadboard and have itwork perfectly, only to find that it fails completelyor acts differently when redone on a permanentcircuit board. The capacitance of the plates isactually part of the circuit now! Although you cannever really eliminate this error, there is always a

way to greatly reduce noise on a breadboard, andit involves adding a few decoupling capacitors onyour power strips.

Decoupling capacitors act as filters so that rfand alternating-current (ac) noise don’t leak intoyour power source, causing havoc throughout theentire circuit. When working with high-speedlogic, microcontrollers on a clock source, or rfcircuits, decoupling capacitors are very importantand should not be left out. If you look at an oldlogic circuit board, you will notice that almostevery IC has a ceramic capacitor nearby ordirectly across the VCC and ground pins. Thesecapacitors are nothing more than 0.01-μF ceramiccapacitors placed between VCC and ground oneach of your power-supply rails, as shown inFigure I-6. Also notice in the figure that thepower rails need to be connected to each otherbecause each strip is independent. If you forget toconnect a rail, it will neither carry VCC nor begrounded, so your circuit will fail. Usually,

Figure I-5 Learning to use the breadboard.

Page 21: Mind Performance Projects for the Evil Genius

6

Getting Started

adding decoupling capacitors on each end of thepowers strips will be adequate, but in a largehigh-speed or rf circuit, you may need themcloser to the IC power lines or other keycomponents.

When your designs become very large orcomplex, the standard breadboard may not offerenough real estate, but not to worry, you canpurchase individual breadboard sections and snapthem together to make a larger prototyping area.Figure I-7 shows 10 breadboard sections snappedtogether and then bolted to a steel cookie sheet inorder to create a grounding plate. The steel basealso helps to reduce noise, and all breadboardsshould have a metal base. This massive cookie-sheet breadboard circuit is a fully functional 20-MHz video computer that can display high-resolution graphics to a VGA monitor andgenerate complex multichannel sound. The entirecomputer was designed on the breadboard shownin the figure and went directly to the final designstage based on the breadboard circuit. I have builthigh-speed computer systems running at more

than 75 MHz on a breadboard as well as high-power video transmitters, robot motor controllers,and every single project in this book. Until youbreak the 100-MHz barrier, there is not much youcan’t do on a breadboard, so become good friendswith this powerful prototyping tool!

Electronic Building BlocksSo you’ve just found a cool schematic on theInternet, and you have a brand-new breadboardwith 100 wires waiting to find a home, but wheredo you get all those components? If you havebeen doing this for a while, then your “junk box”is probably well equipped, but for those juststarting out, you have to be resourceful to keepyour budget under control. A simple circuit with10 small components might cost you only $5 atthe local electronics shop, but often you mayneed a lot more than 10 parts or might need someuncommon semiconductors. The best source forfree electronic components is from old circuit

Figure I-6 Fighting breadboard noise.

Page 22: Mind Performance Projects for the Evil Genius

boards. Dead VCRs, fried TVs, baked radios, andeven that broken coffee maker will have a pile ofusable components on the circuit board. A smallradio PCB might have 200 semiconductorssoldered to it, and at 50 cents apiece, that adds upfast. You may never use all the components, buton a dreary day when you are in your “madscientist” laboratory in need of some oddballresistor value, a box of scrap circuit boards isgreat to have.

I keep several large boxes full of circuit boardsthat I find, and I often find that they yield most ofthe common parts I need and often have hard-to-find or discontinued ICs that I need whenworking on older schematics. Figure I-8 showsone of the 20 or more large boxes of scrap PCBsI have collected over the years. Removing theparts from an old circuit board is easy, especiallythe simple two- or three-pin parts such ascapacitors and transistors. For the larger ICs withmany pins, you will need a desoldering tool, alsoknown as a “solder sucker.” A low-budgetsoldering iron (34 W or higher) with a blunt tip

and a solder sucker can make easy work ofpulling parts from old PCBs. Figure I-9 shows ahand-operated solder sucker removing an eight-pin IC from an old VCR main board. To operate asolder sucker, you press down on the loadinglever, heat up the pad to desolder, and then pressa button to suck up the solder away from thatpad.

I prefer to desolder using a cheap iron with ahigher wattage and fatter tip than used for normalwork because it heats up the solder faster,reaching both sides of the board easier. There areother tools that can be used to desolder parts,such as desoldering wicks, spade tips, and evenpump vacuums, but the $10 solder sucker hasalways done the job for me, even on ICs with asmany as 40 pins, without any problems at all.When you really start collecting parts, you willfind that a giant bowl of resistors is more of apain that having to desolder a new one, so sometype of organization will be necessary. You willsoon discover that there are many common partswhen it comes to resistors, capacitors, transistors,

7

Getting Started

Figure I-7 Breadboard circuits can get large.

Page 23: Mind Performance Projects for the Evil Genius

8

Getting Started

Figure I-8 Old PCBs are a gold mine of parts.

Figure I-9 Removing parts from an old circuit board.

Page 24: Mind Performance Projects for the Evil Genius

and ICs, so having them sorted will make it veryeasy to find what you need. Storage bins such asthe ones shown in Figure I-10 are perfect for yourelectronic components, and you can easily fill100 small drawers with various parts, so purchasea few of them to get started.

I have an entire closet full of these componentdrawers, and I store the larger parts or PCBs inplastic tubs. It’s a rare day when I can’t find theparts I need, even for a retro project that needssome long-discontinued component. Of course,there are always times when you will want newparts or need something special, so one of themany online sellers will be glad to take yourmoney and send you the part in a few days.

The ResistorIf you are new to this hobby, then you probablyhave seen a few schematics and thought that theymade about as much sense as cave hieroglyphics.Don’t worry, though; knowledge of schematicswill come as you use them more and start to

decode the electronic-component datasheets. Ifyou want to take the fast track, then you mightconsider getting a book on basic electronics toget you kick-started, but for those who want tolearn as you go, here are a few of the basics youwill need to complete the projects in this book.

Resistors like the ones shown in Figure I-11 arethe most basic of the semiconductors you will beusing, and they do exactly what their nameimplies—they resist the flow of current byexchanging some current for heat that is dissipatedthrough the body of the device. On a large circuitboard, you could find hundreds of resistorspopulating the board, and even on tiny circuitboards with many surface-mounted components,resistors usually will make up the bulk of thesemiconductors. The size of the resistor generallydetermines how much heat it can dissipate, and theresistor will be rated in watts, with ¼ and 1⁄8 Wbeing the most common type you will work with(the two bottom resistors shown in the figure).Resistors can become very large and will requireceramic-based bodies, especially if they are ratedfor several watts or more, such as the 10-W unit

9

Getting Started

Figure I-10 Organization makes finding parts a snap.

Page 25: Mind Performance Projects for the Evil Genius

shown at the top of Figure I-11. To save space,some resistors come in packs, such as the one inthe figure that has multiple legs.

Because of the recent drive to make electronicsmore “green” and power conservative, large,power-wasting resistors are not common inconsumer electronics these days because it ismore efficient to convert amperage and voltageusing some type of switching power supply orregulator rather than by letting a fat resistor burnaway the energy as heat. On the other hand,small-value resistors are very common, and youwill find yourself dealing with them all the timefor simple tasks such as driving a light-emittingdiode (LED) with limited current, pulling up aninput pin to a logical 1 state, biasing a simpletransistor amplifier, and thousands of othercommon functions. On most common axial-leadresistors, such as the ones you will use most oftenin your projects, the value of the resistor is codedonto the device in the form of four colored bandsthat tell you the resistance in ohms. Ohmage isrepresented using the Greek capital letter omega

( ) and often will be omitted for values over 99 �, which will be stated as 1K, 15K, 47K, orsome other number followed by the letter K,indicating the value is in kiloohms (thousands of ohms). Similarly, for values over 999K, theletter M will be used to show that 1M is actually1 megaohm, or 1 million �. In a schematicdiagram, a resistor is represented by a zigzag linesegment, as shown in Figure I-12, and will eitherhave a letter and a number such as R1 or V3relating to a parts list or simply will have thevalue printed next to it, such as 1M, or 220 �.The schematic symbol on the left of Figure I-12

10

Getting Started

Figure I-11 Resistors with fixed values.

Figure I-12 Variable (left) and fixed (right) resistorsymbols.

Page 26: Mind Performance Projects for the Evil Genius

represents a variable resistor, which can be setfrom 0 � to the full value printed on the body ofthe variable resistor.

A variable resistor is also known as apotentiometer, or pot, and it can take the form ofa small circuit board–mounted cylinder with aslot for a screwdriver or a cabinet-mounted canwith a shaft exiting the can for mating with sometype of knob or dial. When you crank up thevolume on an amplifier with a knob, you areturning a potentiometer. Variable resistors aregreat for testing a new design because you canjust turn the dial until the circuit performs as youwant it to and then remove the variable resistor tomeasure the impedance (resistance) across theleads to determine the best value of fixed resistorto install. On a variable resistor, there are usuallythree leads—the outer two connect to the fixedcarbon resistor inside the can, which gives thevariable resistor its value, and a center oneconnects to a wiper, allowing the selection of

resistance from zero to full. Several commonvariable resistors are shown in Figure I-13, withthe top-left unit dissected to show the resistorband and wiper.

As mentioned earlier, most fixed-value resistorswill have four color bands painted around theirbodies that can be decoded into a value, as shownin Table I-1. At first, this may seem a bit illogical,but once you get the hang of color-banddecoding, you will be able to recognize mostcommon values at first glance without having torefer to the chart.

There almost always will be either a silver orgold band included on each resistor, and this willindicate the end of the color sequence and willnot become part of the value. A gold bandindicates the resistor has a 5 percent tolerance(margin of error) in the value, so a 10K resistorcould end up being anywhere from 9.5K to 10.5Kin value, although in most cases it will be veryaccurate. A silver band indicates that the

11

Getting Started

Figure I-13 Common variable resistors.

Page 27: Mind Performance Projects for the Evil Genius

tolerance is only 10 percent, but I have yet to seea resistor with a silver band that was not on acircuit board that included vacuum tubes, soforget that there is even such a band! Once youignore the gold band, you are left with three colorbands that can be used to determine the exactvalue as given in Table I-1.

So let’s assume that we have a resistor with thecolor bands brown, black, red, and gold. Weknow that the gold band is the tolerance band,and the first three will indicate the values toreference in the chart. Doing so, we get 1(brown), 0 (black), and 100 � (red). The thirdband is the multiplier, which would indicate thatthe number of zeroes following the first to valueswill be 2, or the value is simply multiplied by100 �. This translates to a value of 1000 �, or1K (10 � 100 �). A 370K resistor would havethe colors orange, violet, and yellow followed bya gold band. You can check the value of theresistor when it is not connected to a circuitsimply by placing your multimeter on theappropriate resistance scale and reading back thevalue. I do not want to get too deep intoelectronics formulas and theory here becausethere are many good books dedicated to thesubject, so I will simply leave you with two basicrules regarding the use of resistors: (1) Put them

in series to add their values together, and (2) putthem in parallel to divide them. This secondsimple rule works great if you are in desperateneed of a 20K resistor, for instance, but can findonly two 10K resistors to put in series. Inparallel, they will divide down to 5K. Now youcan identify the most common semiconductorthat is used in electronics today, the resistor, sowe will move ahead to the next most commonsemiconductor, the capacitor.

The CapacitorA capacitor in its most basic form is a smallrechargeable battery with a very short charge anddischarge cycle. Where a typical AAA batterymay be able to power an LED for a full year, acapacitor of similar size will power it for only afew seconds before its energy is fully discharged.Because capacitors can store energy for apredictable duration, they can perform all kindsof useful functions in a circuit, such as filteringac waves, creating accurate delays, removingimpurities from a noise signal, and creating clockand audio oscillators. Because a capacitor isbasically a battery, many of the large ones lookmuch like batteries with two leads connected to

12

Getting Started

TABLE I-1 Resistor Color-Code Chart

Color 1st Band 2nd Band 3rd Band Multiplier

Black 0 0 0 1�

Brown 1 1 1 10�

Red 2 2 2 100�

Orange 3 3 3 1K�

Yellow 4 4 4 10K�

Green 5 5 5 100K�

Blue 6 6 6 1M�

Violet 7 7 7 10M�

Grey 8 8 8

White 9 9 9 0.1

Gold 0.01

Silver

Page 28: Mind Performance Projects for the Evil Genius

one side of a metal can. As shown in Figure I-14,there are many sizes and shapes of capacitors,some of which look like small batteries.

Just like resistors, capacitors can be as large asa garbage can or as small as a grain of rice—itreally depends on the value. The larger devicescan store a lot more energy. Unlike batteries,some capacitors are nonpolarized, and they canbe inserted into a circuit regardless of currentflow, whereas some cannot. The two differenttypes of capacitors are shown by their schematicsymbols in Figure I-15, C1 being a nonpolarizedtype and C2 a polarized type. Although there arealways exceptions to the rules, generally, thedisk-style capacitors are nonpolarized, and thelarger can-style electrolytic types are polarized.An obvious indicator of a polarized capacitor isthe negative markings on the can, which can beseen clearly in the larger capacitor shown at thetop right of Figure I-14.

Another thing that capacitors have in commonwith batteries is that polarity is very importantwhen inserting polarized capacitors into a circuit.

If you install an electrolytic capacitor in reverseand attempt to charge it, the part likely will heatup and release the oil contained inside the case,causing a circuit malfunction or dead short. In thepast, electrolytic capacitors did not have apressure-release system and would explode likefirecrackers when overcharged or installed inreverse, leaving behind a huge mess of oily paperand a smell that was tough to forget. On manycapacitors, especially the larger can-style ones,the voltage rating and capacitance value are

13

Getting Started

Figure I-14 Various common capacitors.

Figure I-15 Capacitor symbols.

Page 29: Mind Performance Projects for the Evil Genius

simply stamped on the case. A capacitor is ratedin voltage and in farads, which defines thecapacitance of a dielectric for which a potentialdifference of 1 V results in a static charge of 1 C.

This may not make a lot of sense until you startmessing around with electronics, but you willsoon understand that, typically, the larger thecapacitor, the larger the farad rating will be, andthus the more energy it can store. Since a farad isquite a large value, most capacitors are rated inmicrofarads (μF), such as the typical value of4700 μF for a large electrolytic filter capacitorand 0.1 μF for a small ceramic-disk capacitor.Picofarads (pF) are also used to indicate verysmall values, such as those found in many

ceramic capacitors or adjustable capacitors usedin rf circuits (a picofarad is one-millionth of amicrofarad).

On most can-style electrolytic capacitors, thevalue is simply written on the case and will bestated in microfarads and voltage, along with aclear indication of which lead is negative. Voltageand polarity are very important in electrolyticcapacitors, and they always should be insertedcorrectly, with a voltage rating higher thannecessary for your circuit. Ceramic capacitorsusually will have only the value stamped on themif they are in picofarads for some reason, andoften no symbol will follow the number, just thevalue. Normally, ceramic capacitors will have a

14

Getting Started

TABLE I-2 Ceramic Capacitor Value Chart

Value Marking Value Marking Value Marking

10 pf 10 or 100 0.001 uF 102 0.10 uF 104

12 pf 12 or 120 0.0012uF (1200pf) 122 0.12 uF 124

15 pf 15 or 150 0.0015uF 152 0.15 uf 154

18 pf 18 or 180 0.0018 uF (1800pf) 182 0.18 uF 184

22 pf 22 or 220 0.0022uF 222 0.22 uF 224

27 pf 27 or 270 0.0027uF 272 0.27 uF 274

33 pf 33 or 330 0.0033 uF 332 0.33 uF 334

39 pf 39 or 390 0.0039uF 392 0.39 uF 394

47 pf 47 or 470 0.0047uF 472 0.47 uF 474

58 pf 58 or 580 0.0056uF 562 0.56 uF 564

68 pf 68 or 680 0.0068uF 682 0.68 uF 684

82 pf 82 or 820 0.0082uF 822 0.82 uF 824

100 pf 101 0.01 uF 103 1uF 105 or 1uf

120 pf 121 0.012 uF 123

150 pf 151 0.015 uF 153

180 pf 181 0.018 uF 183

220 pf 221 0.022 uF 223

270 pf 271 0.027 uF 273

330 pf 331 0.033 uF 333

390 pf 391 0.039 uF 393

470 pf 471 0.047 uF 473

560 pf 561 0.056 uF 563

680 pf 681 0.068 uF 683

820 pf 821 0.082 uF 823

Page 30: Mind Performance Projects for the Evil Genius

three-digit number that needs to be decoded intothe actual value, and this confusing schemeworks as shown in Table I-2.

Who knows why they just don’t write the valueon the capacitor? I mean, it would have the samenumber of digits as the code! Oh well, you getused to seeing these codes, just like resistor colorbands, and in no time you will easily recognizethe common values, such as 104, which wouldindicate a 0.1-μF value according to the chart.Capacitors behave just like batteries when itcomes to parallel and series connections, so inparallel, two identical capacitors will handle thesame voltage as a single unit but double theircapacitance rating, and in series, they will havethe same capacitance rating as a single unit butcan handle twice the voltage. Thus, if you need tofilter a really noisy power supply, you might wantto install a pair of 4700-μF capacitors in parallel

to end up with a capacitance of 9400 μF. Wheninstalling parallel capacitors, make sure that thevoltage ratings of all the capacitors used arehigher than the voltage of that circuit, or therewill be a failure—an ugly, noisy, smelly failure!

The DiodeDiodes allow current to flow through them in onedirection only, so they can be used to rectify acinto direct current (dc), block unwanted currentfrom entering a device, protect a circuit from apower reversal, and even give off light in the caseof LEDs. Figure I-16 shows various sizes andtypes of diodes, including an easy recognizableLED and the large full-wave-rectifier module atthe top. A full-wave rectifier is just a blockcontaining four large diodes inside.

15

Getting Started

Figure I-16 Several styles of diodes, including an LED.

Page 31: Mind Performance Projects for the Evil Genius

16

Getting Started

As with most other semiconductors, the size ofthe diode is usually a good indication of howmuch current it can handle before failure, and thisinformation will be specified by the manufacturerby referencing whatever code is printed on thediode to some datasheet. Unlike resistors andcapacitors, there is no common mode ofidentifying a diode unless you get to know someof the most common manufacturers’ codes bymemory, so you will be forced to look up thedatasheet on the Internet or in a cross-referencecatalog to determine the exact value and purposeof unknown diodes.

For example, the NTE6248 diode shown inFigure I-16 in the TO220 case (left side of figure)has a datasheet that indicates that it is a Schottkybarrier rectifier with a peak reverse-voltagemaximum of 600 V and a maximum forwardcurrent rating of 16 A. Datasheets will tell youeverything you need to know about a particulardevice, and you should never exceed any of therecommended values if you want a reliablecircuit. The schematic symbol for a diode isshown in Figure I-17, D1 being a standard diodeand the other an LED (the two arrows representlight leaving the device).

The diode symbol shows an arrow (anode)pointing at a line (cathode), and this will indicatewhich way current flows (from the anode to thecathode, or in the direction of the arrow). Onmany small diodes, there will be a stripe paintedaround the case to indicate which end is thecathode, and on LEDs, there will be a flat side on

the case nearest the cathode lead. LEDs come inmany different sizes, shapes, and wavelengths(colors) and have ratings that must not beexceeded to avoid damaging the device. Reversevoltage and peak forward current are veryimportant values that must not be exceeded whenpowering LEDs, or damage will easily occur. Atthe same time, though, you will want to get asclose as possible to the maximum value if yourcircuit demands full performance from an LED,so read the datasheets on the device carefully.Larger diodes used to rectify ac or control largecurrent may need to be mounted to the proper heatsink to operate at their rated values, and often thecase style will be a clear indication owing to themetal backing or mounting hardware that maycome with the device. Unless you know howmuch heat a certain device can dissipate in openair, your best bet is to mount it to a heat sink if itwas designed to be installed that way. As withmost semiconductors, there are thousands of typesand sizes of diodes, so make sure that you areusing a part rated for your circuit, and double-check the polarity of the device before you turnon the power for the first time.

The TransistorA transistor is one of the most usefulsemiconductors available and often the buildingblock for many larger ICs and components suchas logic gates, memory, and microprocessors.Before transistors became widely used inelectronics, simple devices such as radios andamplifiers would need huge wooden cabinets,consume vast amounts of power, and emit large,wasteful quantities of heat owing to the use ofvacuum tubes. A vacuum tube–based computercalled ENIAC was built that used 17,468 vacuumtubes, 7200 crystal diodes, 1500 relays, 70,000resistors, and 10,000 capacitors and had morethan 5 million hand-soldered joints. It weighed 30tons and was roughly 8 � 3 � 100 ft in size andconsumed 150 kW of power! A simple computer

Figure I-17 Diode schematic symbol (LED on theright).

Page 32: Mind Performance Projects for the Evil Genius

17

Getting Started

that would rival the power of this power-hungrymonster could easily be built on a few squareinches of perforated board using a few dollars inparts today by any electronics hobbyist, thanks tothe transistor. A transistor is really just a switchthat can control a large amount of current byswitching a small amount of current, thuscreating an amplifier. Several common types andsizes of transistors are shown in Figure I-18.

Depending on how much current a transistor isdesigned to switch, it may be as small as a grainof rice or as large as a hockey puck and require amassive steel heat sink or fan to operate correctly.There are thousands of transistor types and sizes,but one thing most of them have in common isthat they will have three connections that can becalled the collector, the emitter, and the base andwill be represented by one of the two schematicsymbols shown in Figure I-19.

The emitter (E), base (B), and collector (C) onboth the NPN and PNP transistors do the samejob. The collector/emitter current is controlled bythe current flowing between the base and emitterterminals, but the flow of current is opposite ineach device. Today, most transistors are NPNowing to the fact that it is easier to manufacture abetter NPN transistor than a PNP, but there arestill times when a circuit may use a PNPtransistor owing to the direction of current or intandem with an NPN transistor to create amatched pair. There is enough transistor theory tocover 10 books of this size, so I will condensethat information to help you understand the verybasics of transistor operation. As a simple switch,a transistor can be thought of as a relay with nomechanical parts. You can turn on a high-currentload such as a light or motor with a very weakcurrent such as the output from a logic gate or

Figure I-18 Various common transistors.

Page 33: Mind Performance Projects for the Evil Genius

light-sensitive photocell. Switching a large loadwith a small load is very important in electronics,and transistors do this perfectly and at speed thata mechanical switch such as a relay could nevercome close to achieving. A audio amplifier isnothing more than a very fast switch that takes avery small current such as the output from a CDplayer and uses it as the input into a fast switchthat controls a large current such as the dc powersource feeding the speakers. Almost anytransistor can easily operate well beyond thefrequency of an audio signal, so they areperfectly suited for this job. At much higherfrequencies, such as those used in radiotransmitters, transistors do the same job ofamplification but are rated for much higherfrequencies, sometimes into the gigahertz range.

Another main difference between the way amechanical switch and a transistor works is thefact that a transistor is not simply an on or offswitch. It can operate as an analog switch, varyingthe amount of current switched by varying theamount of current entering the base of thetransistor. A relay can turn on a 100-W light bulbif a 5-V current is applied to the coil, but atransistor could vary the intensity of the same lightbulb from zero to full brightness depending on thevoltage seen at the base. As with allsemiconductors, the transistor must be rated for the

job you intend it to do, so maximum current,switching voltage, and speed are things that needto be considered when choosing the correct part.The datasheet for a very common NPN transistor,the 2N2222 (which can be substituted for the2N3904 often used in this book), is shown inFigure I-20.

From this datatsheet, you can see that thistransistor can switch about half a watt (624 mW)with a voltage of 6 V across the base and emitterjunction. Of course, these are maximum ratings,so you might decide that the transistor will worksafely in a circuit if it had to switch on a 120-mW LED from a 5-V logic-level input at thebase. As a general rule, I would look at themaximum switching current of a transistor andnever ask it to handle more than half the ratedmaximum value, especially if it is the type oftransistor designed to be mounted to a heat sink.The same thing applies to maximum switchingspeed—don’t expect a 100-MHz transistor tooscillate at 440 MHz in an rf transmitter circuitbecause it will have a difficult enough time justreaching the 100-MHz level.

18

Getting Started

Figure I-19 NPN and PNP transistor schematic symbols.

Page 34: Mind Performance Projects for the Evil Genius

RTFM—Read the Flippin’Manual!

Let’s face it, “evil geniuses” don’t often readmanuals and frequently prefer to learn by trialand error, which really is the best way to learnmost of the time. When it comes to determiningthe specs on an electronic component with morethan two pins, you really have no choice but toread the datasheet to figure out how it works andto avoid letting out the smoke. This is especiallytrue for transistors and ICs because you reallyhave no idea what is inside the “black box”without the datasheet. That eight-pin IC may bejust a simple timer, or it could be a state-of-the-art 100-MHz microprocessor with a built-in USBport and a video output. Without the datasheet,you would never know. There are also times

when you may have found some cool schematicon the Internet, and it has a parts list that youdetermine contains mostly discontinuedtransistors, so you will have to compare thedatasheets to find suitable replacements. Onceyou learn the basics, you will be able to makesmart substitutions for almost any part.

You can dig up just about any datasheet on anydevice, even those that have been off the marketfor decades, so learn how to find them, and youwill never be in the dark when it comes tocomponent specs. The datasheet for the verycommon 2N2222 transistor was found by typing,you guessed it, “2N2222 datasheet” into Google(Figure I-21) and looking for the PDF file.Although there are a few bogus datasheet serversout there that try to suck you into joining so thatthey can spam your e-mail address for life, mostof the time you will find a datasheet with little orno fuss. If you know the manufacturer of the

19

Getting Started

Figure I-20 Datasheet for the common 2N2222 NPN transistor.

Page 35: Mind Performance Projects for the Evil Genius

device, try its Web site first, or try a large onlineelectronics supply site such as Digikey.combecause it will have online datasheets forthousands of components. The Internet is also agreat source for general information onelectronics, so if you find yourself needing toknow the basics, consult your favorite searchengine.

The wealth of information found by searching“LED basics” was almost endless. Even the firstsite (Figure I-22) had more than enoughinformation on the LEDs presented in a veryeasy-to-understand format. The fact is that almostall the information you will need when learningelectronics can be found on the Internet with alittle patience.

Asking for HelpWhen the Internet fails to provide you withanswers or you really feel that you need guidancefrom those who may know the answers, there arecountless forums that you can join and look for

help or discuss your projects with other “evilgeniuses.” As with all things in life, forums havetheir own special rules of etiquette, so before youjump in and scream “Help me!”, please take thetime to read the posting rules and consider thefollowing: Most of the knowledgeable people ona forum who would consider answering yourquestion(s) are doing so on their own time, just tobe nice. They do this because they rememberwhat it felt like to be starting out and in need of alittle guidance to make a project a success. If youhave not bothered to cover the basics or givenmuch effort to solving your own problems first,you will get zero respect in a forum and either beignored or “spanked” publicly.

Here is how not to ask for help in a forum (I see this a lot):

Urgent: can’t program themicrocontroller. Pls help me, urgent! iam a noob and don’t know how 2 getthe code in2 the avr. Whut do I need 2buy? Can some1 pls send me the file?

20

Getting Started

Figure I-21 The Internet is your friend.Figure I-22 Finding the basics online.

Page 36: Mind Performance Projects for the Evil Genius

This type of post may never get a response formany reasons. First of all, why would yourproblem be of concern to anyone else? Mostpeople on a forum also have a life and a job, sotheir first thought will be, “If your problem is sourgent, pay someone to solve it.” Be patient, andremember that if someone is kind enough to helpyou in the next few days, then you are very lucky.Also, making multiple posts of the same orsimilar request in other threads hoping that moreposts from you will encourage responses likelywill get you into trouble with moderators andregular members. It may take days for a response,but remember that everyone else has urgentthings in their lives to look after before taking thetime to help you and others.

The next reason why most forum members willignore this kind of post is because of the sloppyuse of language. Posting like this would be thesame as showing up for a formal job interviewwearing your garage clothes and is a clearindication of laziness. The message also indicatesthat the poster has done nothing to help himselfor herself and expects to be “spoonfed” by thosewho have done the groundwork or have investedin many years of formal and informal education.The question also has little information, so theforum members are left to guess.

Here is a much better way to ask the samequestion and likely get a response:

Project X—Question regarding the AVRselection. Hello everyone. I’m workingon the Mind Reader project and waswondering if the AVR644p could be usedto replace the AVR324p? I have read thedatasheets on both chips but just wantto make sure that there aren’t someissues with this chip that I should knowabout. Has anyone out there compiled aHEX file for this device yet? If not, I’mprobably going to give it a try and uploadthe file if it works. Thanks for your help.

Now, the poster has asked a clear question thatindicates both the project and the part numbers,as well as what he or she has done to helphimself or herself first. People who are willing totry to solve their own problems first and then askpolitely for additional help are welcomed in aforum because they are likely the type of personto come back later and help others when theymake the transition from newcomer toexperienced hobbyist. Consider these pointsbefore asking for help online.

Tools of the TradeOnce you have a good supply of junk to messaround with and a basic understanding of theparts and schematic symbols, you can begin toturn your ideas into reality. Of course, you willneed a few basic tools, which can be purchased atmost electronics suppliers. Much like thebreadboard, a soldering iron is the workhorse inthe electronics industry. You can create and testyour circuit on a breadboard, but to move it to amore permanent home, you will have to solderthose components down. I like to have twosoldering irons for this hobby—one is a cheapunit to use when unsoldering parts from scrapboards, and the other is a better, heat-controlledunit with interchangeable tips for fine work.

The ability to control the heat and replace thetips on a soldering iron such as the one shown in Figure I-23 makes it easy to work on all types of projects. For delicate surface-mountedcomponents, you need a sharp point and low heat,but for soldering down a large heat sink, youneed a blunt tip and lots of heat, so the ability toturn a dial and switch the tip is very handy. Alsoshown in the figure is the holster and sponge bathfor cleaning the tip. You certainly can get awaywith using a $10 soldering iron for most of theprojects in this book, but if you plan to dive deepinto this hobby, then consider investing in aquality soldering station.

21

Getting Started

Page 37: Mind Performance Projects for the Evil Genius

Unless everything you build is going to runfrom a 9-V battery, you will need some type ofadjustable power supply like the one shown inFigure I-24. Often, a circuit will need twodifferent voltages, so a dual supply makes it easyto just dial up the voltage you need. These test-bench power supplies also allow you to set thecurrent, so you can help to eliminate friedcomponents by slowly adjusting the voltage whileyou watch for spikes in the current. If youaccidentally reverse the power pins on your lastmicrocontroller and drop on a 1-A “wall wart,”you most certainly will see some fireworks. Ifyou limit the current on an adjustable supply andslowly turn up the voltage, chances are very highthat you will catch the error before any damage isdone to the chip. Having an amp meter also letsyou figure out how much power your circuitneeds when it comes time to choose a regulator.An adjustable power supply is another one of

those “must have” devices for the electronicshobby.

A multimeter such as the one shown in FigureI-25 also will be needed to measure componentvalues, check voltages, and test your circuits. Avery basic multimeter will measure voltage,current, and resistance, and a more advancedmodel also might include a frequency counter,capacitance tester, transistor checker, and evensome basic graphing functions. You will use yourmultimeter to check voltage and measureresistance most of the time, so even a basic modelwill be fine for most work.

If you really want to run with this hobby orlearn electronics on a professional level, youeventually will want an oscilloscope (Figure I-26)for your bench. A modern oscilloscope canmeasure just about anything and then display iton a high-resolution color screen or download the

22

Getting Started

Figure I-23 A midrange heat-controlled soldering iron.

Page 38: Mind Performance Projects for the Evil Genius

23

Getting Started

Figure I-24 A variable dual power supply.

Figure I-25 A basic digital multimeter.

Page 39: Mind Performance Projects for the Evil Genius

results to your computer for analysis. Even anolder tube-based “scope” can be very useful whenyou need to see instant feedback from a circuit ona screen. As your circuits become larger, faster,and more complex, a simple multimeter may notbe enough to debug problems because it cannotrespond in real time or detect such high-speedvoltage changes. This becomes important whendesigning high-speed digital devices that expect acertain sequence of digital information to betransmitter or received. An oscilloscope lets you“dig deep” into a signal and look at it one bit at atime until you find the bug. You also can displayanalog signals in real time, compare multiplesignals, and even save the results to a PC forfurther analysis. Although you will not need anoscilloscope to build the projects in this book, Icould not have done many of them without one,so when you start designing your own circuits, ascope is invaluable.

In the time before millions of transistors werecrammed onto a single IC, you had a few basiclogic gates, a handful of transistors, and yourusual resistors and capacitors. Now the selectionof components is so vast that printing a supplier’scatalog is almost a dream. If you can dream up a use for 1s and 0s, there are probably 10companies making a chip for it, so the selectionis massive, and often, because of mass-scaleproduction, finding a single IC can be verydifficult. Maybe you just tore into a VCR andisolated the on-screen display chip, found thedatasheet, and thought, “Cool, I want that for myrobot.” After a bit of a search, you find that thesupplier’s minimum order quantity is 100,000units, and the programmer needed to make thechip work is the same price as a small car. Thesimple fact is that as electronics become morecomplex and the faster the industry moves, theless chance us hobbyists have of sourcing thelatest parts. Sure, transistors, resistors, and the

24

Getting Started

Figure I-26 An oscilloscope for more advanced work.

Page 40: Mind Performance Projects for the Evil Genius

basic components will always be available, butcomplex ICs designed for consumer deviceseither will not be available in small quantities orwill have packages so small that you need amicroscope just to see all the pins. Enter themicrocontroller.

A microcontroller is like a blank IC ready to be made into whatever you want it to be. A $5microcontroller can take on the function of a 16-input gate or become something as complex asa fully functional Pong game that will displayvideo on your television. A microcontroller is achip that contains a processor, some memory, anda few peripherals such as serial ports or even ahigh-speed USB port. There are evenmicrocontrollers that have MP3 decoders andhigh-resolution video generators onboard.Although learning to program a microcontrolleris almost a hobby in itself, it does open up a doorthat allows you to create just about any functionon a single IC so that you don’t have to worryabout what the market is doing or if a chip will

be available. Sure, there are limits, but not thatmany, and microcontrollers are king in the hobbyworld of electronics. Figure I-27 shows a fewmicrocontrollers with varying pin counts and aprogrammer from Microchip as well as Parallax.

To make a microcontroller do your bidding,you first write code on your PC using C,Assembly, or Basic, and then you compile andsend your program to the programmer, which fits it into the microcontroller onboard Flashmemory. If your code works properly, yourmicrocontroller now becomes your own customIC. Microcontrollers typically cost between $5and $20 depending on Flash memory size andonboard peripherals, and programmers costbetween $50 and $200 depending on chip support and debug functionality. There are evenWeb sites that show you how to build your ownprogrammers for a few bucks, so microcontrollersare certainly well within anyone’s budget.

25

Getting Started

Figure I-27 Microcontrollers and programmers.

Page 41: Mind Performance Projects for the Evil Genius

26

Getting Started

Beyond the BreadboardOnce you have your prototype up and running onyour breadboard, you will need to move thecomponents to a more permanent home so thatyour device can fit into a cabinet and become realhardware. This migration usually involvesmoving everything to a fiberglass board withholes with or without copper traces and thenadding the wires. This perforated board is usuallycalled perf board and is available in many sizeswith or without copper-plated holes or strips thatcopy the connections on a solderless breadboard.Figure I-28 shows an empty and populatedcopper-hole perf board with a dual stepper-motordrive prototype soldered and tested.

For small circuits, I usually use a non-copper-plated perf board and just solder wires on the

bottom of the board where the component leadsstick through because this is easy, quick, andinexpensive. Larger circuits become a messquickly, so having copper-plated holes or eventraces like a solderless breadboard can makemigration a lot easier. Perf board is available as alarge sheet, and it is easy to just cut off a piecethe size you need using a utility knife to score thesurface and then break it apart. A perf boardcircuit made correctly is just as good as amanufactured PCB, so don’t underestimate whatcan be done with a handful of wires, a fewdollars worth of perf board, and some hard work.Have a look at the complex VGA computerprototype on the huge breadboard in the top halfof Figure I-29. The prototype now lives on an 8� 5 in perf board (lower half of the figure) andfunctions perfectly at 20 MHz.

Figure I-28 A perf board becomes a permanent home.

Page 42: Mind Performance Projects for the Evil Genius

27

Getting Started

The next step after hardwiring your project to aperf board will be an actual PCB like the oneshown in Figure I-30. When you are usingsurface-mounted components with very smallpitch leads, you don’t have many options besidesa real PCB. A PCB also makes more sense whenyou need to duplicate a project or want to get intoselling your designs. Bringing a professionalPCD to market is a costly and time-consumingprocess often involving many failed attempts andboard revisions, but for us hobbyists, there arealternatives that may be viable if a real PCB isneeded. If you search the Internet using “PCBproduction,” you will find several companies that will allow you to download their freesoftware to design your PCB and then order afew boards for around $100. This is actually afair deal considering the amount of investmentand time it would take to produce your own PCB

at home using a chemical etching– or photo-based system. Of course, you will have to decideif the cost is worth it.

Well, let’s dig into some of the projects andhave some fun. Remember that we all had to startfrom the beginning, and if something does notmake sense at first, turn off the power supply,take a break, and search the Internet for moreinformation. Electronics is a great hobby, andwith a little investment in time and money, youwill be able to create just about anything. Whenyou start to get a good handle on things, feel freeto try out your own modifications to the projectspresented in this book, or mix and match themtogether to create completely new devices. Oh,and don’t feel too bad when you accidentally letthe smoke out of your semiconductors—theywon’t feel a thing!

Figure I-29 My Retro Game System on a massive breadboard.

Page 43: Mind Performance Projects for the Evil Genius

28

Getting Started

Figure I-30 A professionally made printed circuit board.

Page 44: Mind Performance Projects for the Evil Genius

Exploring the Human Body

Section One

This section is about measuring and testing reactions that occur in the physical body.Although the mind is not in complete control of some of the involuntary physical

functions, a certain level of control can be measured and enhanced with proper trainingusing feedback. Heart rate, body temperature, and even reaction time can be controlledto a certain degree with a little training and with the help of some of the devicespresented here. Maybe you want to enhance your physical state before an athleticcompetition? How about showing your friends how you can “beat” a lie-detector test(polygraph)? By training your mind to react based on the output of some of thesedevices, you can train and enhance the mind and body link and become more in tunewith your own physical machine.

Page 45: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 46: Mind Performance Projects for the Evil Genius

This biofeedback device measures the electricalresistance of the skin and then changes the toneof an audio oscillator depending on the reading.This type of body measurement is also known asgalvanic skin response (GSR), electrodermalresponse (EDR), psychogalvanic reflex (PGR),and skin conductance response (SCR). This typeof device has been used in the medical field tomeasure a patient’s emotional response and totreat disorders such as phobias, anxiety, andstuttering.

One interesting and controversial use of abiofeedback device is called an E-meter,which is used in some forms of the Dianetics and Scientology auditing. This device is formallyknown as the Hubbard electrometer, for theChurch of Scientology’s founder, L. RonHubbard. Interestingly, the Church of Scientologyrestricts use of the E-meter to trainedprofessionals, seeing it as a religious artifact thatcan measure the state of electrical characteristicsof the static field surrounding the body. Themeter is believed to reflect or indicate whether ornot the confessing person has been relieved fromthe spiritual impediment of his or her sins. It canbe used only by Scientology ministers orministers in training, and these devices aremanufactured at the Church of Scientology‘sGolden Era Productions facility in California.

Biofeedback also can be used to measure aperson’s response to physical activity because thedirect result of exertion will be a response in thesweat glands. Maybe you need to learn to speakpublicly without breaking a sweat or to beat a lie-detector test? No matter what your “evil genius”motives are, you probably will find ways to usethe biofeedback device for your own agenda.

The biofeedback device is a voltage-controlledaudio oscillator that increases its frequency asresistance decreases. Thus, the more you sweat,the higher is the pitch of the resulting output. Theoscillator also has a volume control so that youwon’t go insane from the nonstop sound that itproduces while in use. For silent operation, thespeaker can be removed and the output fed intoany multimeter with a frequency-measuringfunction to display the results in hertz (Hz) ratherthan an audio signal. Let’s review Figure 1-1 tosee how the biofeedback device works.

Transistors Q1 and Q2, along with R1, R2, R3,R4, C1, and C2, form a basic audio oscillator thatruns on a 9-V battery. To make the tone of theoscillator change in response to voltage, Q3 actsas an amplifier that feeds a voltage back into thecircuit between R2 and R3, changing the outputfrequency. Since the base of Q3 is connecteddirectly to the subject’s body along with the 9-V

Biofeedback Device

Project One

31

Page 47: Mind Performance Projects for the Evil Genius

supply, the resistance of the skin creates changesin the voltage feed into the oscillator. To give theaudio oscillator some output gain, Q4 is a simpleamplifier that can be controlled by turning thevariable resistor VR1.

A piezo buzzer also can be used in place of aspeaker in case you are tight for cabinet space ordon’t want the full volume of a speaker. Theschematic shown in Figure 1-2 feeds the outputfrom amplifier transistor Q4 through a piezoelement rather than to a standard speaker. Piezobuzzers are small coin-sized disks with a bit ofcrystal attached to one side that respond tovoltage changes. These piezo buzzers or elementscan be found in cordless phone bases, handsets,and many other devices that beep or blip. Thecover of any digital watch is also a piezo buzzer.Figure 1-3 shows a few speakers taken from myjunk box along with a piezo buzzer in a plasticcase (bottom right). Piezo buzzers can be as smallas a thumbtack and produce a decent level ofsound, so they are great when you need to savespace in a black box.

As for the speaker, any large or small speakerwith a rating of 4 to 16 � will work fine with thiscircuit, although you probably don’t needanything too large. A speaker taken from a deadportable radio would be good. It’s always a goodidea to breadboard a project before consideringsoldering the components in case you want tomake modifications or test a component

32

Project 1. Biofeedback Device

Figure 1-1 Biofeedback device schematic.

Figure 1-2 Piezo buzzer alternative output.

Page 48: Mind Performance Projects for the Evil Genius

substitution. This circuit is pretty forgiving, sopractically any small NPN transistor probablywill work. When you are initially testing thebreadboard version, just grab hold of two wiresfor probes because that will work just fine. Figure1-4 shows the biofeedback circuit being tested ona solderless breadboard.

Once your circuit is working properly, youshould hear nothing out of the speaker until yougrab hold of the probe wires or short themdirectly together. When shorted together, theaudio oscillator will generate its highestfrequency, which will be similar to the output if aperson is really sweating profusely. If you do nothear any audio when the probe wires are shortedtogether, turn the variable resistor VR1 back andforth to make sure that the volume is not turnedoff. If there is still no output, then you have eithera wiring problem or a wrong component. After 30 years as an electronics hobbyist, I havelearned that 99 percent of all problems are wiringproblems, so recheck the wiring if your circuitfails to work. Once you are happy with operation

of the circuit, it can be moved to a morepermanent home for installation into a cabinet.

Unless my circuit has a large number ofcomponents or integrated circuits (ICs), I alwayssnap off an appropriately sized piece of perfboard and then add the wiring on the underside ofthe board. Copper-clad perf board is also nice,but it can cost a lot more and make it moredifficult to change or fix wiring at a later date.Since there are only 13 small semiconductors inthe biofeedback device, it fits nicely on a 1 � 2in piece of perf board, as shown in Figure 1-5. Ifyou copy the general parts layout that was usedon your breadboard, then it will be easier to addthe wiring. Also, if you have the spare parts, it isa good idea to leave the breadboard version alivewhile you build the perf board version so that youcan compare the two if something does not workon the final version.

Most of the simple devices in this book will fitinto a small plastic hobby project box with roomfor a battery and necessary switches. Mostelectronics supply stores will have various sizes

33

Project 1. Biofeedback Device

Figure 1-3 Possible output speaker selections.

Page 49: Mind Performance Projects for the Evil Genius

34

Project 1. Biofeedback Device

Figure 1-4 Testing the circuit on a breadboard.

Figure 1-5 Migration from breadboard to perf board.

Page 50: Mind Performance Projects for the Evil Genius

of plastic boxes, and you could even use thosegray ABS plastic electrical boxes found athardware stores to mount your projects. If youare on a really tight budget, you always can getcreative and look around the house for a suitableenclosure, such as a soup can or an emptyproduct container. Figure 1-6 shows the battery,variable resistor, on/off switch, and mountingterminals fit into a small black plastic boxpurchased from RadioShack. I always install anon/off switch between one of the battery wires bydefault, and a circuit like this can run from agood battery for a long time.

Once you find a project box large enough tohold the battery and hardware, you will need toconsider the size and shape of the circuit board.Figure 1-7 shows how I came up with the 2 � 1in size for the perf board, which was just largeenough to fit alongside the battery and containthe 13 components. If the underside of the circuitboard is in contact with the battery case or any ofthe mechanical parts, you can wrap it in electricaltape once it is tested and working to create aninsulating barrier. Also, don’t forget about all theconnecting wires when choosing a cabinet

because they can take up a bit of space when itcomes time to cram the lid on the box. Now, thebiofeedback device is almost ready for use.

Although the biofeedback device worksperfectly fine just by grabbing the probe wiresbetween your fingers, this will not be a reliableway to measure your skin resistance because theharder you grip the wires, the more resistance youcreate. Someone trying to “trick” the unit simplycould vary the tone by changing his or her grip onthe probes, so some way to attach them to thebody will be necessary. Two methods I have foundthat work very well are copper finger bands andcopper plates taped to the subjects’ arms. Bothfinger bands and plates can be made from somecopper tubing from the hardware store, as shownin Figure 1-8. The finger bands are small lengthsof 1-inch-diameter copper tubing with a slit cutalong the length so that they can be safely placedover a finger. The slit allows the diameter to betweaked, if necessary, by placing a flat-headscrewdriver in the slit to widen the opening. Thisis also a safety release function in case the ringbecomes stuck on a finger. The flat plates shownin Figure 1-8 are also bits of the same copper

35

Project 1. Biofeedback Device

Figure 1-6 Finding a suitable cabinet.

Page 51: Mind Performance Projects for the Evil Genius

36

Project 1. Biofeedback Device

Figure 1-7 Test-fitting the circuit board.

Figure 1-8 Making finger and body probes.

Page 52: Mind Performance Projects for the Evil Genius

tubing hammered flat into plates. All edges shouldbe sanded or filed so that there are no sharp edges,and the copper can be cleaned with some steelwool for best conductivity.

The 1-inch-diameter copper tubing should be a good fit for most people, either a finger orthumb. If you find that the rings are too small ortoo large, then adjust them by squeezing orprying open the slit to change the diameter. Therings should slide on easily but also make goodcontact for the biofeedback machine. Some typeof probe jelly normally is used to make a betterskin connection, but in this case that would defeatthe purpose of the machine because it is theresistance between the skin and the probe that isbeing measured. For this reason, probes arealways installed on dry skin.

The quick-disconnect jacks shown in Figure 1-10 are useful because you can easily change theprobes when needed. You might even want to try

multiple probes in different series or parallelconfigurations to see what happens. Now thatyour biofeedback device is ready to use, youmust come up with some creative “evil genius”ways to use it. To verify that it is functioningproperly, get comfortable, and connect the probesso that you get a steady unchanging tone out ofthe box. It may take a minute for the tone tostabilize as the moisture between the probes andyour skin settles, so relax until the frequencyseems steady. Once the tone has not changed,contract your leg muscle as hard as you can sothat you exert yourself somewhat, and the toneshould increase slowly as your skin resistancechanges. Responses will be slow and gradual,with increases in frequency occurring much fasterthan decreases because moisture evaporates tolower the frequency. For more accurate and quietreadings, you can connect a frequency meteracross the speaker output or remove the speakercompletely and just measure the frequency.

37

Project 1. Biofeedback Device

Figure 1-9 Test-fitting the two finger probes.

Page 53: Mind Performance Projects for the Evil Genius

38

Project 1. Biofeedback Device Figure 1-10 The completed biofeedback device and probes.

Figure 1-11 Using a frequency meter for silent operation.

Page 54: Mind Performance Projects for the Evil Genius

I added an output jack to my cabinet so that Icould plug in an external frequency meter, asshown in Figure 1-11, for more accurate andsilent operation of the device. Silent operationmay be preferred if you don’t want your subjectto influence or try to trick the machine. Byconnecting a frequency meter instead of aspeaker, you can see much smaller changes inthe frequency, which also may help those whoare a little tone deaf when looking for smallchanges. My multimeter also has a serial port, soI can connect it to a PC and graph the results inreal time, making it easy to compare a long-termtest over time. Also notice in the figure the useof arm probes, which are held in place by someelectrical tape. You may have to play around withthe best place to connect the probes for thedesired result, but keep in mind that bare skinmakes for better testing.

Well, I hope that you have fun with this deviceand that there are many other things you can do tomodify or improve on the design. The placementand types of probes used certainly will affect theresults, so get creative and try some now ideas.Maybe a pair of metal spheres held under thearmpits? How about some kind of forehead band?Another thing you could try doing is to use thedevice to check moisture in soil by making probesout of some nails. Add a power supply forcontinuous operation, and you now have a waterflood alarm for your basement by placing theprobes in a problem area. I’m sure that any “evilgenius” will come up with all kinds of uses andmodifications for this device. Have fun!

39

Project 1. Biofeedback Device

Page 55: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 56: Mind Performance Projects for the Evil Genius

This reaction speedometer will measure aperson’s motor reaction time to a series of lightsor a trigger sound. The test begins as soon as thetester flips the switch on the main unit, causingthe 10 light-emitting diodes (LEDs) on the box tobegin lighting in sequence. The subject isinstructed to flip his or her handheld switch assoon as he or she sees either the first LED lightor when he or she hears a sound from theoptional sound add-on circuit. The fewer LEDsthat are on once the subject flips the switch, thehigher is his or her reaction time. To increase thedifficulty of the test, a variable control allows theLED sequence to be adjusted from a slow crawlto a lightning-fast chase that few will be able tokeep up with.

Because this project also includes an optionalsound add-on that will send an audio tone oncethe first few LEDs light up, you can test yoursubject’s motor responses to light, sound, or bothat the same time. The reaction speedometer alsocan be used to hone one’s response time for suchthings as improving in sports, martial arts, oreven video games. Daily testing also can givesome cues to alertness or the effects of suchthings as sleep or caffeinated beverages.

The heart of the reaction speedometer is the74HC4017 (or 74LS4017) decade-counter IC,which can turn on one of 10 outputs in sequence

each time a clock pulse is sent. The clock pulsesare variable, so the speed of the LED sequencecan be controlled to make the test easier orharder.

Figure 2-1 shows the main part of the reactionspeedometer schematic without the optionalsound output circuit. As you can see, the 4017decade counter (IC2) is in charge of lighting allthe 10 LEDs in sequence, which will happen at arate controlled by the clock-pulse circuit madefrom the 555 timer (IC1). There are also twoswitches—one that allows the tester to start orreset the test sequence and another to allow thesubject to freeze the sequence in order tocomplete the test. A variable resistor (VR1)adjusts the speed of the clock pulses so that thetest can be adjusted to the subject’s best abilities.

Although the schematic is quite basic, it isalways a good idea to first build the device on asolderless breadboard for testing so that you canverify its operation and make any possiblemodifications before heating up the solderingiron. You also may want to build the optionalsound add-on to enhance the test with an audiocue as well as the visual light show.

The optional sound add-on lets the subjectrespond to an audio tone that will occur as thefirst few LEDs light up, enhancing the test. Thesimple schematic shown in Figure 2-2 is an

Reaction Speedometer

Project Two

41

Page 57: Mind Performance Projects for the Evil Genius

42

Project 2. Reaction Speedometer

Figure 2-1 Reaction speedometer schematic.

Figure 2-2 Sound add-on schematic.

Page 58: Mind Performance Projects for the Evil Genius

audiofrequency oscillator made from another 555timer and is practically the same circuit as theoriginal 555 clock circuit shown in the maindiagram. The output from the timer is fed into apiezo buzzer so that an audible tone will be heardas soon as the circuit is triggered. Triggering isaccomplished via pin 4 and the resistors (R3–R5)that connect to the output pins on the 4017decade counter.

Depending on which output pins you connectto the sound trigger, you can alter the length andtiming of the audio tone as the 4017 stepsthrough its outputs. In my reaction speedometer, I decided to connect to output pins 2, 3, and 4 sothat the sound is on for about a third of the timeas soon as the test sequence begins. I did notconnect to the first output pin because doing sowould mean that the sound would be on while thetest is in ready (reset) mode, which causes thefirst LED to remain lit. If you want the tone tolast longer, add more connection points. If youwant the tone to start later on in the sequence,move the connection points to higher output pinson the 4017 counter. To alter the tone, playaround with different values for R1, R2, and C1.

Figure 2-3 shows the reaction speedometerbuilt on a solderless breadboard for initial testing.Notice how each of the three subcircuits (i.e.,sound, clock, and counter) are shown in thefigure. To make the circuit work, you also willneed a pair of single-pole, single-throw toggleswitches for the subject and tester. The tester’sswitch will be mounted to the main box, or it alsocould be made remote like the subject’s switch, tobe held in one hand. In one position, the tester’sswitch will reset the counter, causing the firstLED to stay lit. In the other position, the test willstart, causing every other LED to light insequence at a rate controlled by the variableresistor in the 555 clock circuit.

Once the test is in motion, the subject mustthrow the switch as fast as possible to freeze thetest, which will cause the clock to stop. If the testgets all the way to the last LED, the subject hasfailed, and the test will need to be reset. If thesubject cannot beat the test before the last LED islit, the tester will have to lower the clock rateuntil the subject can freeze the test somewherebetween LED number 2 and LED number 9.

43

Project 2. Reaction Speedometer

Figure 2-3 Breadboarded test circuit.

Page 59: Mind Performance Projects for the Evil Genius

When you have verified the operation of thecircuit and made any necessary modifications,you can move the components to a morepermanent home on some perforated board forinstallation into a cabinet.

Since I added the sound part of the circuit afterI built the main circuit, only the clock andcounter are on the perforated board shown inFigure 2-4. There probably was enough room tojam the sound add-on onto the board as well, butI thought it might be handy to have the soundboard separate to be reused as a generic audiooscillator in some other project later. In my usualstyle of building a perf board circuit, thecomponent leads are bent on the underside of theboard, and all wires are also soldered on theunderside of the board. There a quite a few wirescoming from the circuit board owing to the 10LEDs, two switches, variable resistor, and powerwires needed.

The sound add-on circuit board shown inFigure 2-5 is completed in the same manner as

the original circuit, using a small bit of perf boardand adding all the wires to the underside of theboard. Also shown in the figure is the small piezobuzzer, which could be replaced by a standardspeaker if you wanted by adding a 250-� resistorin series with the speaker leads to reduce currentdraw on the timer output pin. Having the soundcircuit on a separate board is handy if you need asimple sound system that can be triggered by avoltage change on some output pin.

There are several ways that you can set up thereaction speedometer for use. The simplestmethod is to have all the tester’s controls in onemain box, and place the subject’s switch remotelyin some type of handheld container. You alsocould make the tester’s start switch the same wayso that the LED speedometer is placed betweenthe tester and the subject. A simple handheldswitch unit can be made by placing the toggleswitch inside a small plastic box or containersuch as the film container shown in Figure 2-6.The subject now can hold the unit in one hand

44

Project 2. Reaction Speedometer

Figure 2-4 Biofeedback circuit on a perf board.

Page 60: Mind Performance Projects for the Evil Genius

45

Project 2. Reaction Speedometer

Figure 2-5 Sound add-on perf board.

Figure 2-6 Subject’s handheld switch.

Page 61: Mind Performance Projects for the Evil Genius

and work the switch with his or her thumb. I keptthe tester’s switch on the main box, but theadvantage to having both switches remote fromthe main box is that there will be no distractionsas the tester flips the switch to start the LEDsequence counter.

Both circuits will run from 5 or 6 V, so you canpower the unit with either four 1.5-V batteries inseries or a larger battery or power pack and aregulator. The four AA batteries shown in Figure2-7 will give the circuit 6 V and run for a verylong time because the unit uses very little power.Although most 74 series logic chips, like the74HC4017, specify only 5 V, they usually willrun with higher voltages, so 6 V is not a problem.For use with a higher-voltage battery, such as a 9-V battery, you certainly will need a regulator toreduce the voltage to avoid damaging the chip.

The simple 5-V regulator schematic shown inFigure 2-8 will allow you to connect a 9- or 12-Vbattery or a direct-current (dc) wall adapter with avoltage between 9 and 15 V to practically anyproject in this book requiring 5 V. Because all thecircuits in this book use very little power, a heatsink will not be needed because the 7805

regulator will not be working very hard at all. R1 and D1 are optional, but they do let you know when your project is switched on. Havingan ON-indicator LED is nice, especially if thereis no way to tell if your circuit is on when youput it away.

Figure 2-9 shows the simple 5-V regulatormade on a small bit of perf board and ready foruse with any of the 5-V projects presented in thisbook. The ON-indicator LED and current-limiting resistor are not shown on the boardbecause they usually are placed somewhere onthe cabinet front, away from the circuit board. Ifyou have modified your circuit to include manymore components, then your regulator may needa heat sink to dissipate the extra heat away fromthe case. If the regulator is so hot that you can’tkeep your finger on the small metal tab, then youshould add some type of heat sink to help coolthe device. Any small bit of steel or copper plateusually will be adequate to cool the regulator. Ifyour entire circuit uses more than 1 A, then youprobably will have to find a larger regulator thanthe 7805.

To make the reaction speedometer a little moreinteresting, I made an oval 10-digit speedometerusing Photoshop and then printed it out so that Icould glue it to the plastic box. This template alsoserved as a guide when drilling the holes for the10 LEDs. To drill a perfect hole, start with thesmallest drill bit in your kit, and your hole willnot wander as you use larger bits. As shown inFigure 2-10, the pilot hole (second drilled hole) isa lot smaller than the hole needed for the 3⁄16-inch-diameter LEDs that I am using. It is goodpractice to drill a small pilot hole anytime youneed to make an accurate drill hole in a cabinet.Having multiple holes line up is important whenthere are a few controls or lights in a row becausethe accuracy of your work will really show.

The completed reaction speedometer is shownin Figure 2-11, ready to help me train my reflexesto the cutting edge. I can set the speed dial toabout half and still pass the test before the lastLED lights, but any more than that is just way too

46

Project 2. Reaction Speedometer

Figure 2-7 Six volts from four batteries.

Page 62: Mind Performance Projects for the Evil Genius

47

Project 2. Reaction Speedometer

Figure 2-8 Optional regulator schematic.

Figure 2-9 Five-volt regulator breadboard.

Page 63: Mind Performance Projects for the Evil Genius

48

Project 2. Reaction Speedometer

Figure 2-10 Adding a graphic speedometer.

Figure 2-11 Reaction speedometer ready to use.

Page 64: Mind Performance Projects for the Evil Genius

fast. I have noticed that after drinking acaffeinated coffee, I can flip the switch betweenone and two LEDs quicker then when I am notbuzzing from caffeine. When I am tired, I noticethat my speed decreased by one or two LEDs. Toget the most accurate results, I take the test 10times, add the results, and then divide by 10 toget the real speed average. Another thing I havenoticed is that when using only the sound as atrigger, I am faster than when using only theLEDs. I guess my ears are quicker than my eyes!

The reaction speedometer works very well, andthere are a lot of interesting modifications you

could make to enhance the design. Addingcolored LEDs might make the test look moreinteresting. How about replacing the piezo buzzerwith a headphone jack so that you can have yoursubject wear headphones? Maybe you coulddesign a random trigger using a few morecounters and a clock so that you can test yourself.How about a tactile test where the output fromone of the LEDs is fed into a transistor or relaythat switches a solenoid placed on the subject’sbody? I am sure you will find many ways tomodify and experiment with this simple circuit inorder to satisfy your own “evil genius” needs.

49

Project 2. Reaction Speedometer

Page 65: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 66: Mind Performance Projects for the Evil Genius

Body Temperature Monitor

Project Three

51

Body temperature varies throughout the daydepending on our mental and physical state.Normally, our bodies remain at a temperature of98.2°F (36.8°C) when we are awake and notinvolved in strenuous physical activity. Measuringbody temperature during sleep experimentation isparticularly useful because our bodies drop totheir lowest normal temperatures when we reachthe second half of our sleep cycle. This low-temperature point is called the nadir and will beabout a degree cooler than the normal wakingbody temperature.

The device presented here is an example ofhow an inexpensive digital thermometer IC canbe connected to a microcontroller to monitorbody temperature. Although this project is verysimple and displays only a two-digit temperaturevalue, it would be very easy to modify andexpand this example to log data, display decimalvalues, or interface with a computer.

The Maxim DS1621 is just one of manyexamples of inexpensive and easy-to-usetemperature sensors that can be connected to amicrocontroller with very minimal effort.Depending on the device, temperature sensorscan output data in many different ways. Someexamples include serial data, parallel bytes,analog data, and pulse-width modulation. TheDS1621 is a two-wire serial interface, so it is

well suited to microcontrollers with a low pincount and can be controlled easily by a basicprogram. As you can see in the body temperaturemonitor schematic (Figure 3-1), there is not muchto it besides the DS1621 thermometer (IC1), an8-bit Atmega88 microcontroller (IC2), and a pairof seven-segment LED displays. The DS1621sends its data to the microcontroller every fewseconds, and then the data are converted to thenearest degree and displayed on the two LEDdisplays. You could easily modify the code todisplay the decimal values as well or even changethe display to Fahrenheit, although that wouldrequire three LED displays if you want to seereadings over 99°F. I wanted to keep this exampleas simple as possible because there are so manydifferent ways you could modify this project.

To keep the number of input/output (IO) pins toa minimum, the two transistors (Q1 and Q2)switch between the dual displays at such a fastrate that they all seem to be on at the same time.This time-sharing trick is how most LED displayswork, where there are hundreds or thousands ofLEDs to control and only a limited number ofconnecting wires. There really is no limit to howmany seven-segment LEDs you can connect aslong as you have sufficient drive current andmicroprocessor speed and can spare the extra IO pin for each common connection. The

Page 67: Mind Performance Projects for the Evil Genius

seven-segment LED is a very common andinexpensive display that you are already familiarwith because it is used in everything from yourdigital clock to the panel of your microwaveoven. There are actually eight segments if youinclude the decimal point, but we don’t use it inthis application. These displays come as eitherstand-alone blocks or chained blocks containingmore than a single digit. Some LED displayseven have alphanumeric capabilities or multiple“dots” so that they can make any characterimaginable. LED displays are either commoncathode or common anode, which means thateither the positive connections or the negativeconnections all go to a common point. It reallydoes not matter which type you use as long asyou install them in your circuit so that current isflowing in the proper direction. To use acommon-cathode LED display in this circuit, youwould have to tie the driver transistors/emitters toground and connect the common cathode to thecollector instead.

Once you have the code compiled and installedin the Atmega88, powering up the breadboardwill instantly show you the temperature in yourroom. Figure 3-2 shows the completed circuitreading 21°C, which is only 1 degree differentfrom what the hallway thermometer wasclaiming. When I placed my finger on theDS1621, the temperature slowly climbed to 32°C,which seemed about right because I had coldhands, and the temperature outside the body isusually a few degrees colder than inside. Fordream research, the actual temperature is notwhat counts, but rather the variance oftemperature over the entire night. Notice theaddition of the 7805 regulator on the top right ofthe breadboard so that the system will run on a 9-V battery.

If you build the circuit compact enough, youmay find that it will fit into a cabinet smallenough to be placed directly on the body usingsome kind of elastic strap. I decided to place theelectronics in a cabinet but run the temperature

52

Project 3. Body Temperature Monitor

Figure 3-1 Body temperature monitor schematic.

Page 68: Mind Performance Projects for the Evil Genius

sensor externally so that it would be morecomfortable as a sleep experimentation device. Ialso wanted a little extra room inside the housingto add some circuitry later that allows a wirelessconnection through a simple rf transmittermodule. Figure 3-3 shows the perf board thatcarries all the components except for the DS1621temperature sensor. There will be limits as to howfar your temperature sensor can be away from themicrocontroller owing to noise and impedance ofthe wiring, but a few feet should be no problem atall for most devices.

The temperature sensor lives on a tiny bit ofperf board with the power and signal wirescoming into it (Figure 3-4). I use the top part of a sock to hold the sensor against the subject’sarm, where the skin gives good contact with thetop of the sensor package. You also might want to run a fine bead of hot glue or nonconductivecaulking along the pins of the IC package so thatperspiration does not create resistance between

the pins of the device if they come in contactwith the skin.

The completed body temperature monitor is shown in Figure 3-5, again reading thetemperature in my laboratory, which was gettinga bit too warm owing to the huge lights I used formaking these photographs. Operation of thedevice could not be more simple; just turn it onand read the temperature, which changes aboutonce per second. I later added one of thosemicroprocessor-compatible rf transmitters to theunit so that I could read the data from themicrocontroller into a computer in order to graphthe results during the night. Many electronicsdistributors carry inexpensive rf solutions, whichare easy to use and can send serial or paralleldata to or from any microcontroller.

The sensor package must come into goodcontact with the skin to give a reliable reading,and a cut-up sock makes a good armband thatkeeps the sensor motionlessness and insulates the

53

Project 3. Body Temperature Monitor

Figure 3-2 Testing the circuit on a solderless breadboard.

Page 69: Mind Performance Projects for the Evil Genius

54

Project 3. Body Temperature Monitor

Figure 3-3 The completed temperature monitor on some perf board.

Figure 3-4 The remotely located temperature sensor.

Page 70: Mind Performance Projects for the Evil Genius

sensor from the outside world. Different parts ofthe body will give different temperature readings,so don’t be alarmed if your sensor shows that youhave a very low body-core temperature. Thesurrounding hardware also will affect thereadings, so you might want to consider adding aline to the source code that compensates for the–3 to –5°C difference this device will havecompared with a thermometer stuck under yourtongue. If your main goal is reading changes intemperature, then it really makes no differencewhat the sensor shows so long as it varies alongwith changes in your subject’s body temperature.

The complete source code for the bodytemperature monitor is shown in Listing 3-1 ofthe appendix and was written in Bascom AVR tokeep it as simple as possible. Basic is a greatlanguage for fast prototyping and can be portedeasily to any platform in a hurry because it isextremely readable. I will explain what eachblock of code does so that you can understand theworkings of the program and port it to whatevermicroprocessor you plan to use.

The code following this comment is required totell Bascom that we are going to target theAtmega88 device and that our clock will be anexternal crystal resonator running at 4 MHz.Telling the compiler your clock speed becomesimportant when using commands that deal withtiming-sensitive routines such as serialtransmission or analog-to-digital readings.Defining the device also helps the compiler togenerate user errors that have to do with IO pins.In this way, you can’t accidentally try to togglean IO pin that does not exist on the actual device.Critical timing is not an issue in this program, soyou can use whatever crystal you happen to havein your parts box.

55

Project 3. Body Temperature Monitor

Figure 3-5 The completed body temperature monitor taking a body temperature reading.

' DEFINE TARGET = MEGA88 @ 4MHZ

$regfile = "M88def.dat"

$crystal = 4000000

Page 71: Mind Performance Projects for the Evil Genius

This block of code sets up the pins that willconnect to the LED display (outputs) and to thetwo-wire serial interface to the DS1621. “Scl”and “Sda” are special Bascom reserved keywordsthat specify the serial data and serial clock lines.

Basic uses variables, which are letters or wordsused to hold values. I like to use single letterssuch as A, B, and C for simple programs such asthis one, but when you are working on a large,complex program, use of more descriptivevariable names is recommended. “TIMER2” or“REDLED1,” for example, would be descriptivevariable names that make a lot more sense in ahuge block of code. The variables “Msb” and“Lsb” will store the 2 bytes that are returnedfrom the DS1621. “Msb” is the most significant

byte and will contain the whole-number value ofthe current temperature, whereas “Lsb” is theleast significant byte containing only the decimalvalue. “Lsb” is not being used in this version ofthe code.

This block of code sets up an array of 10values for the variable “LED.” Although this mayseem confusing at first, the values correspond towhich of the seven segments will be lighted todisplay a particular number. To make this a littlemore confusing, the value in parentheses isactually one higher than the representednumerical value, and to light a segment, we wanta low bit, not a high bit, so the value of “Led(9) =0” says that to display the decimal number 8, wewant all bits to be off. This means that allsegments light up, and an “8” will be displayed.It can be a bit of a chore computing these valuesby adding port bits, but once you have done itonce for your segment, the hard work iscompleted.

56

Project 3. Body Temperature Monitor

' CONFIGURE IO PORTS

Config Scl = Portb.2

Config Sda = Portb.1

Config Portd.0 = Output

Config Portd.1 = Output

Config Portd.2 = Output

Config Portd.3 = Output

Config Portd.4 = Output

Config Portd.6 = Output

Config Portd.7 = Output

Config Portb.3 = Output

Config Portb.4 = Output

' DEFINE VARIABLES

Dim Led(10) As Byte

Dim Msb As Byte

Dim Lsb As Byte

Dim A As Byte

Dim B As Byte

Dim C As Byte

' DEFINE LED DIGITS

Led(1) = 8

Led(2) = 187

Led(3) = 97

Led(4) = 49

Led(5) = 178

Led(6) = 52

Led(7) = 4

Led(8) = 185

Led(9) = 0

Led(10) = 48

' ********** MAIN LOOP **********

Main:

Do

Page 72: Mind Performance Projects for the Evil Genius

Everything from here on is going to happencontinually until the word “Loop” is reached,which causes program execution to start againwhere it first encountered the word “Do.” This iscalled an endless loop because it never stopsunless forced to by another command or an error.

This code block sends the initializationsequence to the DS1621 in two-wire serial format using the built-in “I2C” commands.Having ready-to-use “I2C” basic commands takes a lot of work out of your hands and makesrapid prototyping a snap. The values presentedhere are only for the DS1621 and are based onthe datasheet for the device as well as severalcode examples found on various forums. Thewhole-number value is stored in the variable“Msb,” and the decimal value is stored in “Lsb”(which is not used). If you are using some otherdigital thermometer IC, then most likely it willuse a different set of commands forcommunication.

This small bit of code converts the value storedin the variable “Msb” into a pair of bytes (“A”and “B”) containing the two digits that make upthe value. This is necessary because each LEDdisplay can display only the values from 0 to 9.Once variables “A” and “B” are set, the“Ledshow” routine is called.

The “Loop” command causes programexecution to jump back to the main routine wherethe “Do” command was encountered. This is theend of the infinite loop, and all other commandsbeyond here must be called by either “Goto” or“Gosub” commands.

57

Project 3. Body Temperature Monitor

' READ DS1621 TEMPERATURE

I2cstart

I2cwbyte &H90

I2cwbyte &HEE

I2cstop

I2cstart

I2cwbyte &H90

I2cwbyte &HAA

I2cstop

I2cstart

I2cwbyte &H91

I2crbyte Msb , Ack

I2crbyte Lsb , Nack

I2cstop

' DISPLAY DATA ON LEDS

A = Msb Mod 10

B = Msb \ 10

Gosub Ledshow

' RESTART MAIN LOOP

Loop

End

****** LED DISPLAY ROUTINE ******

Ledshow:

Portb.4 = 0

Portb.3 = 1

C = A + 1

Portd = Led(c)

Waitms 2

Portb.4 = 1

Portb.3 = 0

C = B + 1

Portd = Led(c)

Waitms 2

Return

Page 73: Mind Performance Projects for the Evil Genius

58

Project 3. Body Temperature Monitor

This is the routine that displays a digit on eachof the two LED displays. A little trick calledpersistence of vision is used here to switchbetween displays so fast that your eyes think theyare all on at the same time. As you can see, onlyone bit of the two ”Portb” pins is on at a singletime, and then the variables “A” and “B” are sentto the display for only 2 ms each. Because 2 msis so fast, it appears that each display is on all thetime, and the seven-segment lines can be shared,saving valuable IO overhead. Since Bascom arrayvariables start at 1 not 0, the line “C = A + 1”adds 1 to the array pointer so that the value in“Led(c)” is the same as the decimal value wewant. This conversion just makes it easier tounderstand the code, especially when trying tocompute the segment bits from scratch the firsttime. Once the displays have been lighted for 2 ms each, this routine just “returns” to where itwas originally called.

That’s all there is to it! A lot can beaccomplished in very few lines using Basic, and

since microcontrollers work at nanosecondspeeds, you have a lot of power at your fingertips.

Since this is a very plain and simpletemperature monitor, you likely will want tomodify the code to expand and add your ownfeatures, such as a decimal readout and maybe aserial or USB interface to send the data to acomputer logging program. Simply by expandingthe number of LED displays to four, you couldsend the type bytes as a more accurate decimalvalue. Adding a wireless link to send data to alogging program for sleep research or dream-statedetection is another interesting modification Iplan to do later to this simple device. Using bodytemperature in conjunction with some of theother sleep-research tools really can increase yourability to monitor and predict your sleep anddream cycle through the night. Next, we willbuild a simple device to measure respiration.

Page 74: Mind Performance Projects for the Evil Genius

Respiratory rate varies greatly depending on howmuch oxygen the body requires. The averageperson will take 10 to 20 breaths per minutewhile at rest and between 30 and 40 breaths perminute during strenuous physical activity. Duringsleep, breathing rate also increases, so adding arespiratory monitor to your arsenal of sleep-research tools would be handy. This projectpresents a novel method of monitoring a subject’sbreathing rate that uses the noise picked up by asensitive microphone and preamplifier to feed arecording device. The resulting waveform is veryeasy to analyze because it will contain visiblebursts of data each time the subject inhales orexhales. Any computer program capable ofdisplaying a waveform along with the time can beused to determine breaths per minute or breathsper hour.

The respiratory monitor is actually anextremely sensitive audio preamplifier thatexploits the fact that moving air close to amicrophone causes an overload in the audiooutput. It is this high-gain noise that creates thevisible bursts of data that can be seen on thecomputer screen while viewing the waveform.Exhaling creates the largest spike in data, so youcan easily determine how many breaths perminute the data contain by either counting thelarger spikes or counting all data spikes and then

dividing them by two. Figure 4-1 shows the ultra-high-gain preamplifier, which is fed by an electretmicrophone. An electret microphone is a tinymetal can that contains not only a microphoneinside but also a sensitive transistorized amplifierso that the output is already amplified somewhatbefore it reaches the LM358 op amp (IC1).

An electret microphone is the most commontype of microphone you will find in audiorecording devices and most computermicrophones. Even those large plastic multimediamicrophones you can purchase for your computermay contain nothing more than a pair of tinyelectret microphones inside, along with a chunk of metal to make the device feel heavy(seriously). Answering machines, telephones, and most other small recording devices all willcontain an electret microphone, and you also canpurchase them new at most electronics suppliersfor a few dollars each. Figure 4-2 shows a few of the many electret microphones that I havecollected by ripping apart old electronic devicesover the years. Some have a rubber cap or may be sealed in plastic, but inside, you will find thesame basic tiny metal can with a hole at one endand a pair of leads or solder spots at the otherend. All you need to know is which lead ispositive and which is negative, but this is veryeasy to determine.

Respiratory Monitor

Project Four

59

Page 75: Mind Performance Projects for the Evil Genius

60

Project 4. Respiratory Monitor

Figure 4-1 The respiratory monitor schematic.

Figure 4-2 Several electret microphones.

Page 76: Mind Performance Projects for the Evil Genius

An electret microphone requires power to runthe small amplifier contained within the tinymetal can. Although the power requirement isvery small, you still have to figure out which leadis positive and which one is ground so that youcan insert the microphone into your circuitcorrectly. Looking at the underside of the

microphone (Figure 4-3), you usually will seethat one lead or solder spot is also connected tothe metal can by a small trace at the edge. Theside that connects to the can almost always willbe the negative, or the ground, lead. The goodnews is that if there is no visual indication ofpolarity on your microphone, you simply can tryit both ways in the circuit without damaging themicrophone in any way. If you have the polarityreversed, you simply will get no output from themicrophone.

Since the goal is to position the microphone asclose to your subject’s nostrils as possible, aninexpensive multimedia headset such as the oneshown in Figure 4-4 would be perfect for thisproject because under that block of foam is justanother electret microphone. By using a premadeheadset microphone, you don’t have to take thehousing apart because you can simply add a 1⁄8audio jack to connect the microphone to the inputof your preamplifier. You also can make a simple

61

Project 4. Respiratory Monitor

Figure 4-3 Electret microphones are polarized.

Figure 4-4 A headset containing an electret microphone.

Page 77: Mind Performance Projects for the Evil Genius

headset by bending a coat hanger or simply use abit of double-sided tape to hold the tiny electretmicrophone just under the subject’s nose to get agood reading.

The breadboarded preamplifier circuit is shownin Figure 4-5 and is so simple that it can be builtonto a very small circuit board or without anycircuit board at all. The circuit will run on as lowas 3 V and as much as 12 V, but a 9-V batteryseemed most convenient and would power thepreamplifier for a very long time. Thispreamplifier also makes a decent high-gainmicrophone amplifier for voice recording, so itcan be used for many other experiments needinga sensitive microphone and preamplifier. You alsocan reduce the circuit further by replacing thevariable resistor (VR1) with a fixed resistor witha value between 1 MW and 500K. The 1-MWresistor will give the amplifier the most gainpossible, but it may be too much if you do plan touse the device to record voice or audio.

The preamplifier circuit had so fewcomponents that I decided to build it without acircuit board to save space and make the compact

unit shown in Figure 4-6. I replaced the variableresistor with a 1-MW fixed resistor so that theamplifier would have full gain at all times.Because the LM358 IC was the largest part, itwas used as a base to hold the other componentsinto a “blob” circuit that was about half the sizeof a penny. I also could power the amplifier froma 3-V button cell and place the entire setup insidea bottletop so that only the output leads needed tocome from the device. The completedpreamplifier performed so well that I even used itfor telecommunications over the Internet becauseit had better gain and clarity than the microphoneconnected to my laptop. Now all you have to dois find a way to log and analyze the data once themicrophone is ready to record your subject’srespiration.

The burst of audio data can be seen clearly inFigure 4-7 after recording a few hours ofbreathing using audio recording software. I usean older version of Sony Sound Forge, but justabout any software-based audio recordingsoftware that allows you to see waveform dataand time will do the job. The larger bursts of data

62

Project 4. Respiratory Monitor

Figure 4-5 Breadboarded respiratory monitor circuit.

Page 78: Mind Performance Projects for the Evil Genius

63

Project 4. Respiratory Monitor

Figure 4-6 Building a circuit without a circuit board.

Figure 4-7 Data bursts shown from the device.

Page 79: Mind Performance Projects for the Evil Genius

are exhalations, and the smaller ones areinhalations, so you can just count the bursts for 1 minute and then divide that value by two to getthe average respiratory rate. If you are loggingseveral hours through a sleep cycle, then you willeasily see the changes to respiratory rate thatoccur during dream cycles. Breathing becomesshallow and erratic while we dream, so addingrespiratory data to your dream laboratorycertainly will help you to log your subject’scycles and trigger any external devices you areusing. The audio-recording software is the mostbasic method of using the preamplifier to monitorrespiration, and many other programs areavailable that can perform much more advancedanalysis of these simple data.

You also could feed the audio output into ananalog-to-digital converter built into amicrocontroller and log the respiratory datadirectly as digital data. A comparator could be setup to read only the exhalation waveform becauseit is two or three times greater than the inhalationwaveform. The circuit and source code presentedin the light-sensing lucid-dream mask project inSection Two also could be modified easily to takeits input from this circuit if you want to monitordata without the need of a computer. Add a fewLED displays, and you could add a counter thatsimply counts breaths for as long as the circuit isrunning. Next, we will build a device to monitorheart rate.

64

Project 4. Respiratory Monitor

Page 80: Mind Performance Projects for the Evil Genius

Of all the body responses one could monitor,heart rate is one of the most important because itfluctuates greatly depending on our state of mindand physical condition. Heart rate during physicalactivity gives us a direct indication of our fitnesslevel, and heart rate changes throughout the nightcan be clear indicators of when a dream cycle hasbegun. A heart rate monitor is also a very easydevice to use for extended periods because it canbe placed on the body in such a way that is notuncomfortable or in the way of any normalactivity.

Our heart rate varies with age, gender, andphysical condition, but the normally acceptedrange for adults is between 50 and about 100beats per minute. While we rest, our heart rate isusually between 50 and 75 beats per minute, andit could climb to over 200 beats per minute whileworking the body to its near-maximum effort.Heart rate also becomes erratic during sleepcycles, so it can be used to trigger some type ofdream experiment or be used in conjunction withmany of the other dream-research devicespresented in this book to track the dream cyclesmore accurately throughout the night.

The heart rate monitor project presented hereuses a sensitive light-detecting resistor to detectsmall changes in the light beaming through yourfinger as your blood pumps through the tiny

arteries in the finger. This device is not the sameas the heart rate monitors typically used inhospitals because those use skin probes thatdetect changes in electrical activity as the heartbeats. This heart rate monitor actually “sees”your pulse through the body, so it can be used ona finger, toe, or even your earlobe.

This project is a bit more involved than someof the other devices presented in this book, but itstill can be built on a small breadboard with afew inexpensive components in a day or two. The completed heart rate monitor is very stableand as accurate as any you would find built intohigh-quality exercise equipment. Your heart ratewill be displayed as a three-digit number on theLED readout, which updates its average onceevery few seconds. There is much room forimprovement and modification owing to thesimplicity of the microcontroller code, so you can easily adapt this device to just about anyhardware or data-logging device.

The heart rate monitor is a combination ofanalog and digital circuitry, as shown in Figure 5-1. The LM324 quad op amp (IC1) forms asensitive amplifier and a low-pass filter that will“lock” onto tiny variations in voltage that fallwithin the typical heart rate frequencies. Thevarying voltage comes from the light-dependentresistor (LDR), which changes a very small

Heart Rate Monitor

Project Five

65

Page 81: Mind Performance Projects for the Evil Genius

amount each time blood pumps through the tinyarteries in between the visible red LED and theLDR surface. After the signal is conditioned bythe low-pass filter, it is fed out of the op amp intothe analog input of an Atmega88 microcontroller,where the program counts the beats and keeps arunning average of beats per minute. Theresulting heart rate is displayed as a three-digitnumber on the triple seven-segment LEDdisplays. Because the microcontroller was addedto this device after it was designed, you coulddecide to leave out the digital part of this projectand take the output directly from the op amp andfeed it either to an LED that will blink with eachheartbeat or to some other data logger or deviceof your own making. The output from the op ampis very close to being TTL (transistor, transistorlogic) compliant, so it could be adapted easily todrive most digital equipment requiring a 5-V TTLsignal input. I recommend that you build theanalog part of this circuit first because it is the

most complex part of the circuit. LED2 will blink each time a heartbeat is detected, so thismakes debugging the system much easier. Whenyou get to the digital part of the circuit, anotherdebugging LED (LED3) will blink each time themicrocontroller receives a pulse signal from theanalog section of this project.

The light-dependent resistor (LDR) is acommonly used semiconductor that can be foundin practically every device that needs to respondto some change in ambient light levels. Streetlights, security lights, light meters, and evendollar-store night lights such as the one shown inFigure 5-2 will contain an LDR. You also canpurchase an LDR from most electronicssuppliers, but the dollar-store night light is moreconvenient, costs about the same as a bare LDR,and gives you a few other bits for your junk box,such as a triac and a few resistors. An LDR iseasy to identify because it will be visible to thelight it must sense and will look like a tiny button

66

Project 5. Heart Rate Monitor

Figure 5-1 The heart rate monitor schematic.

Page 82: Mind Performance Projects for the Evil Genius

with a snakelike pattern on its surface. This canbe seen clearly under the tiny plastic eye in thefigure.

The snaking track along the surface of the LDRshown in Figure 5-3 is connected to the two pinsthat exit the device. As light strikes the surface ofthe LDR, the resistance drops greatly, acting likean analog light switch of sorts. Notice how

amazingly simply the circuit ripped from thenight light really is—just an LDR feeding a triacthrough a resistor to turn on the 120-V ac lightbulb. To remove the LDR, either use a solderingiron to release it from the circuit, or just bend theleads back and forth until the device breaks free.

The breadboarded heart rate monitor is shownin Figure 5-4, and as you can see, most of thereal estate has been taken up by the triple-digitLED display and all its supporting hardware. Theanalog pulse-detection circuitry at the top of thebreadboard consists of the LM324 op amp and afew resistors and capacitors. The large 1000-μFcapacitor (C5) shown under the 9-V battery isnecessary only if you are using a dc poser adapteror find that the pulse-detection circuit falselytriggers when the LEDs change. The analogcircuit is so sensitive that the change in voltagefrom a single LED coming on actually can triggerthe circuit into an oscillation if your powersupply is not rock solid. The huge capacitor actsas a power-supply buffer to help filter out anytiny fluctuations caused by the LED display

67

Project 5. Heart Rate Monitor

Figure 5-2 A good source for a light-dependent resistor (LDR).

Figure 5-3 The LDR is easy to identify and extract.

Page 83: Mind Performance Projects for the Evil Genius

68

Project 5. Heart Rate Monitor

circuitry. I found that the circuit worked finewithout the large capacitor as long as it wasrunning from a battery pack. Using a dc adapterdid require the large filter capacitor to beincluded.

The component to the right of the 9-V batteryis an LM7805 regulator to bring the supplyvoltage down to 5 V, as needed by themicrocontroller. If you are building only theanalog part of this circuit, it actually can be runfrom a supply voltage as high as 12 V directly.When first powered up, the LED display will read“060” and not change until a pulse is detected.Every 10 seconds, the average is recalculated,and then the readout is ramped up or down by avalue of one on each following pulse. This slowramp helps to filter out glitches in the averageowing to movements of the body that might bedetected as pulses. There is a lot of room toimprove the microcontroller code because it wasmade to be short and simple to keep it printable.

To test the analog circuit, place a high-brightness red LED over the LDR, as shown inFigure 5-5, so that there is just enough room toplace your finger in between the light and theLDR. You will have to keep your hand extremelystill and at the same time take your own pulseusing your other hand on your neck. When the

Figure 5-4 The breadboarded heart rate monitor.

Figure 5-5 Insert finger here.

Page 84: Mind Performance Projects for the Evil Genius

analog circuit is functioning properly, the pulseindicator LED (LED2) will flash almost at thesame time that you feel the pulse in your neck.

If you just can’t hold your hand still enoughover the breadboard, move ahead and build thefinger clip, which will eliminate false readingsfrom accidental movement. You also will have toadjust the variable resistor (VR1) to some settingnear its center of rotation to get the strongestreading on the pulse-indicator LED. The variableresistor biases the LDR in either the positive ornegative direction, so you do not have to beoverly concerned about the type of visible redLED you choose. The LED does have to be fairlybright and needs to be red because that is thecolor that passes through our skin the easiest.White light also will work, but green and blueLEDs will not work very well at all in thissystem.

I found that the system worked perfectly on thebreadboard as long as I could keep my hand stillenough not to send false readings to the analogcircuit. If I rested the side of my hand on the deskand placed my thumb between the red LED andthe LDR, then I rarely got a false reading. Figure5-6 shows the result of 60 seconds of testing,getting a heart rate of 72 beats per minute, whichjives perfectly with what I counted while takingthe pulse on my neck. At this point, the analogcircuit is fairly quirky when it comes to handmovement or even ambient light changes in theroom, so some type of finger clasp will be neededto make the system much more stable.

The hair clip shown in Figure 5-7 justhappened to fit around my finger or thumbperfectly, and it was not so tight that it becameuncomfortable. There are hundreds of devicesyou could invent to attach the visible red LED

69

Project 5. Heart Rate Monitor

Figure 5-6 Getting a new reading on the LED display.

Page 85: Mind Performance Projects for the Evil Genius

70

Project 5. Heart Rate Monitor

and LDR to your body, and remember that thisdevice also will work through your earlobe. Iintended to use my heart rate monitor for dreamresearch, so it made the most sense to place thedevice on my thumb or toe so that it would not beannoying during the night. The method used toposition the sensor should be both comfortableand secure enough not to move around easily.

To make the finger clip as compact as possible, the two ends of the hair clip aretrimmed as shown in Figure 5-8. The clip nowwill work on any finger and on a large toe,although it seemed to work best on my thumb. I have poor circulation in my hands and feet, butsince there is a large artery in our thumbs, thepulse was strong there no matter how cold myhands felt. Shooting the beam through the area ofyour fingernail also seemed to be the mosteffective place to get a strong and solid readingon the pulse-indicator LED.

The LDR and the visible red LED are placed ateach end of the hair clip, as shown in Figure 5-9,so that the beam is directed onto the surface ofthe LDR once the clip is placed around a fingeror thumb. My LDR had a small plastic bubbleover the top of the detector surface, but some donot. I am not sure if moisture from your skinwould affect an LDR without a lens, but if itdoes, then a small piece of tape or clear plasticplaced over the surface of the LDR solves theproblem easily. Don’t worry if the LED beam

Figure 5-7 This hair clip fits a finger perfectly.

Figure 5-8 The hair clip is trimmed to make it smaller.

Page 86: Mind Performance Projects for the Evil Genius

does not always line up perfectly onto the surfaceof the LDR because your finger will diffuse thelight anyhow before it reaches the sensor. Sincethe analog circuitry is so sensitive, it takes verylittle light to actually cause the pulse detector tooperate.

To ensure that the finger clip was working aswell as or better than the original breadboardsensor, I placed it into the circuit for a reading.The variable resistor (VR1) actually needed a bitof a tweaking because the finger clip was muchbetter aligned and passed more light to the LDR.After 10 seconds, the heart rate display climbedfrom the default power-on value of 60 to 89 beatsper minute as my test subject held still under mymassive camera lights for the shot. The elevatedpulse was due to straining in the awkwardposition under 2000 � of light for over a minutewhile I got the shot I wanted.

It’s amazing how little it takes to make ourpulse shoot up from the normal, “doing nothing”rate. Just getting up from the desk was enough toadd 5 beats per minute to my heart rate, although

it quickly went back down to just over 60 beatsper minute if I was not exerting myself in anyway. Now the task of moving the circuit from thebreadboard to a more suitable home will begin.

You will need a perf board that is at least 4 � 4in to contain all the components in this project.However, take your time with the wiring, andstart with the analog part of the circuit, just aswas done on the breadboard. There are a lot ofwires!

To keep the circuit board as small as possible, Ireplaced the LED displays with the smallest unitsI could find. If you have some talent with asoldering iron and PCB-making equipment, youprobably could shrink the heart rate monitordown to the size of a matchbox, but I prefer the“old school” perf board method of prototypingbecause it is very easy to modify and correcterrors.

Figure 5-10 shows the completed perf boardready to find a new home inside a plasticelectrical box found at a local hardware store.The variable resistor (VR1) was replaced with a

71

Project 5. Heart Rate Monitor

Figure 5-9 Open jaws reveal the LED and the LDR.

Page 87: Mind Performance Projects for the Evil Genius

72

Project 5. Heart Rate Monitor

board-mounted potentiometer because it onlyrequired adjustment once for the new clip-mounted optical sensor. If you plan to experimentwith different sensor styles, then mounting thevariable resistor externally might be a betteroption because it could require tweakingdepending on the angle and amount of lighthitting the LDR.

The completed heart rate monitor shown inFigure 5-11 performs as well as any store-boughtunit but allows easy modification to adapt to justabout any device you can imagine. There isplenty of room inside the cabinet for a small rfmodule, which would allow the heart pulses to besent wirelessly to a computer for more advanceddata logging. Because there are free IO pins onthe microcontroller, it would be very easy tocontrol some other device through a transistor orrelay for further enhancements to the hardware.The source code is also very easy to adapt and

expand because it was written to be as minimal aspossible using the Basic language. Each block ofcode will be explained so that you can easilyconvert it to any microcontroller family orlanguage.

Have a read through the complete Basic sourcecode of Listing 5-1 provided in the appendix sothat you can get an idea of how the programworks. If you are an experienced programmer,then this trivial code probably is something youcould write in 15 minutes from scratch, but if youhave never written a program in your life, not toworry because Basic is called that for a reasonand is easy to understand. The lines in theprogram listing that start with an apostrophe arecomments, and I will explain the code in blocksafter each comment. The compiler used is theBascom AVR, and it is a very good compiler forthe Atmega family and includes a verycomprehensive instruction set.

Figure 5-10 Heart rate monitor on a perf board.

Page 88: Mind Performance Projects for the Evil Genius

73

Project 5. Heart Rate Monitor

Figure 5-11 Installing the components into a cabinet.

Figure 5-12 The completed heart rate monitor.

Page 89: Mind Performance Projects for the Evil Genius

The code following this comment is required totell Bascom that we are going to target theAtmega88 device and that our clock will be anexternal crystal resonator running at 4 MHz.Telling the compiler your clock speed becomesimportant when using commands that deal withtiming-sensitive routines such as serialtransmission or analog to digital readings.Defining the device also helps the compiler togenerate user errors that have to do with IO pins.In this way, you can’t accidentally try to togglean IO pin that does not exist on the actual device.

This block of code sets up the IO pins that willconnect to the LED display outputs. You canchange these around any way you like to makeyour wiring as simple as possible, but it is best tokeep the LED digits to a single port forsimplicity. Port D is being used here.

Basic uses variables, which are letters or wordsused to hold values. I like to use single letterssuch as A, B, and C for simple programs such asthis one, but when you are working on a large,complex program, use of more descriptivevariable names is recommended. “TIMER2” or“REDLED1,” for example, would be descriptivevariable names that make a lot more sense in ahuge block of code.

Variables are also defined as the number of bitsthey are to contain, so in our code, “A” and “B”are 8-bit bytes that can contain a value between 0and 255. Variable “F” is an integer that can rangein value from –32768 to +32767. Variable “D” isa “Word” that can contain a value between 0 and65535. Although you could just define allvariables using larger data types, this is a wasteof memory space and will slow down your code.

74

Project 5. Heart Rate Monitor

' DEFINE TARGET = MEGA88 @ 4MHZ

$regfile = "M88def.dat"

$crystal = 4000000

' CONFIGURE IO PORTS

Config Portd.0 = Output

Config Portd.1 = Output

Config Portd.2 = Output

Config Portd.3 = Output

Config Portd.4 = Output

Config Portd.6 = Output

Config Portd.7 = Output

Config Portb.3 = Output

Config Portb.4 = Output

Config Portb.5 = Output

Config Portb.2 = Output

' DEFINE VARIABLES

Dim Led(10) As Byte

Dim A As Byte

Dim B As Byte

Dim C As Byte

Dim D As Word

Dim E As Word

Dim F As Integer

Dim G As Word

Dim H As Word

Dim J As Integer

Dim K As Integer

Page 90: Mind Performance Projects for the Evil Genius

This block of code sets up an array of 10values for the variable “LED.” Although this mayseem confusing at first, the values correspond towhich of the seven segments will be lighted todisplay a particular number. To make this a littlemore confusing, the value in parentheses isactually one higher than the representednumerical value, and to light a segment, we wanta low bit, not a high bit, so the value of “Led(9) =0” says that to display the decimal number 8, wewant all bits to be off. This means that allsegments light up, and an “8” will be displayed.It can be a bit of a chore computing these valuesby adding port bits, but once you have done itonce for your segment, the hard work iscompleted. Your values most likely will becompletely different from mine as you “map” outthe pins and segments on your LED displays.

This sets up the variable “K” with a default ratethat is close to the typical resting adult heart rate.By setting the average to 60 beats per mnuterather than starting it at zero, the calculated valuedoes not have to “ramp” up so far to reach its

final value. This will make more sense once yousee how the heart rate monitor operates.

The “Start Adc” command tells the compiler toinclude the code necessary to set up and initiatethe onboard analog-to-digital converter on theAtmega88. This will allow us to read in an analogvoltage and convert it to a value in order to detectchanges in voltage from the LDR sensor.

Everything from here on is going to happencontinually until the word “Loop” is reached,which causes program execution to start againwhere it first encountered the word “Do.” This iscalled an endless loop because it never stopsunless forced to by another command or an error.

This command reads the analog-to-digitalconverter on pin 0 of the Atmega88 into variable“D,” which is where the output from the LDR isconnected. Since the ADC returns a 10-bitreading, values can range from 0 to 1024, whichis why variable “D” needed to be a “Word,” not abyte.

75

Project 5. Heart Rate Monitor

' DEFINE LED DIGITS

Led(1) = 8

Led(2) = 187

Led(3) = 97

Led(4) = 49

Led(5) = 178

Led(6) = 52

Led(7) = 4

Led(8) = 185

Led(9) = 0

Led(10) = 48

' SET DEFAULT HEART RATE

K = 60

' READ ADC VALUE

D = Getadc(0)

' START ADC RUNNING

Start Adc

' ********** MAIN LOOP **********

Main:

Do

Page 91: Mind Performance Projects for the Evil Genius

These three lines compare the current ADCreading “D” with the last known reading “E” bysubtracting them into “F.” The “Abs(F)”command changes the value in “F” to an absolutenonnegative value so that we only get thedifference as a whole number, not a negativenumber, if “E” were greater than “D.” Thus whatthis does is only give us the difference since thelast ADC reading, not the actual value.

This chunk of code acts like a crude low-passfilter that does not allow pulses to be detectedthat are much faster than what would beconsidered the upper limit for a human heart rate.Each time a new pulse is detected (“F > 4”), acounter is set to 40 and has to count down to zerobefore another pulse can be registered.

To aid in debugging the circuit and setting upthe optical sensor, a pulse-indicator LED willflash on both the analog part of the circuit andthe digital part of the circuit. This piece of codejust looks to see if the heart beat filter has beenreset and then turns an LED on and off for halfthe counter cycle.

To display the heart rate as beats per minute, arunning counter “H” is incremented until the nextpulse is detected. The value in “H” then isdivided into a value (9840) that was calculated togive a fairly accurate result of beats per minute.This large number has to do with how manyinstruction cycles there are between the mainloop of this program and took a bit of effort toget using an oscilloscope. Changing theauscultator frequency would completely throw off the calculated heart rate.

To filter out the regain a little more, changes donot happen immediately but are “ramped” up ordown on each pulse by a value of 1. By waitinguntil each pulse is detected (“G=1”), the finalvalue “K” is compared with the calculated value“J” and incremented or decremented accordinglyby 1. Without this ramping sequence, a singleglitch or false detection would result in a wildand instantaneous change in the LED readout.

76

Project 5. Heart Rate Monitor

' GET ADC CHANGE SINCE LAST

F = D - E

F = Abs(f)

E = D

' HEART BEAT FILTER

If G > 0 Then G = G - 1

If F > 4 And G = 0 Then G = 40

' HEART BEAT LED FLASHER

If G = 1 Then Portb.2 = 0

If G = 20 Then Portb.2 = 1

' CALCULATE HEART RATE PER MINUTE

H = H + 1

If G = 1 Then

J = 9840 / H

H = 0

End If

' SLOWLY ADJUST RUNNING AVERAGE

If G = 1 Then

If K > J Then K = K - 1

If K < J Then K = K + 1

End If<

Page 92: Mind Performance Projects for the Evil Genius

Since the LED display contains threeindividual seven-segment displays and the actualvalue is contained in the “Word” variable “K,” itmust be broken down into three digits and sent tothe display routine, which expects a valuebetween 0 and 9 to be stored in each variable“A,” “B,” and “C.” By using division and the“Mod” command, the values are taken from thevariable “K” and broken into 1s, 10s, and 100sfor the display routine.

The “Loop” command causes programexecution to jump back to the main routine wherethe “Do” command was encountered. This is theend of the infinite loop, and all other commandsbeyond here must be called by either the “Goto”or “Gosub” command.

This is the routine that displays a digit on eachof the three LED displays. A little trick calledpersistence of vision is used here to switchbetween displays so fast that your eyes think thatthey are all on at the same time. As you can see,only one bit of the three “Portb” pins is on at asingle time, and then the variables “A,” “B,” and“C” are sent to the display for only 2 ms each.

77

Project 5. Heart Rate Monitor

' DISPLAY DATA ON LEDS

If K > 99 Then

C = K Mod 10

B = K \ 10

B = B Mod 10

A = K \ 100

End If

If K < 100 Then

C = K Mod 10

B = K \ 10

A = 0

End If

If K < 10 Then

C = K

B = 0

A = 0

End If

Gosub Ledshow

' RESTART MAIN LOOP

Loop

End

' ****** LED DISPLAY ROUTINE ******

Ledshow:

Portb.5 = 1

Portb.4 = 0

Portb.3 = 0

D = A + 1

Portd = Led(d)

Waitms 2

Portb.5 = 0

Portb.4 = 1

Portb.3 = 0

D = B + 1

Portd = Led(d)

Waitms 2

Portb.5 = 0

Portb.4 = 0

Portb.3 = 1

D = C + 1

Portd = Led(d)

Waitms 2

Return

Page 93: Mind Performance Projects for the Evil Genius

Because 2 ms is so fast, it appears that eachdisplay is on all the time, and the seven-segmentlines can be shared, saving valuable IO overhead.Since Bascom array variables start at 1 not 0, theline “D = A + 1” adds 1 to the array pointer sothat the value in “Led(d)” is the same as thedecimal value we want. This conversion justmakes it easier to understand the code, especiallywhen trying to compute the segment bits fromscratch the first time. Once all three displays havebeen lighted for 2 ms each, this routine just“returns” to where it was originally called.

I’m sure that you will find many ways toimprove the program code and modify thisproject to suit your needs. With all those unusedIO pins and code space, it would be easy to

create a lucid dream-detection system by addingan 8-hour timer that looks for dream stages bycomparing time with fluctuating heart rate. Theaddition of a relay or driver transistor couldtrigger just about any device, creating a completedream-detection or -induction system that wouldwork just as well as the eyelid movement–sensingdevice presented earlier. The ability to writeBasic code and work with microcontrollers makesrapid prototyping a snap, so there really is noidea you can’t set in motion with a littleimagination and work. Enjoy!

For the last project in this section, we willcontinue to explore the reactions of the humanbody with an effective, sensitive lie-detectordevice.

78

Project 5. Heart Rate Monitor

Page 94: Mind Performance Projects for the Evil Genius

A real lie detector, or polygraph, is a complexand sensitive piece of electronic equipment thatlogs several physical responses at the same timeas the subject undergoes a battery of questions. Areal polygraph, such as the ones a governmentagency might use, would usually include circuitryto monitor blood pressure, pulse, respiration,breathing rhythms, body temperature and skinconductivity, and even brain waves. The simpleversion of the lie detector presented here, basedon the very old designs, measures only skinconductivity, although it could be used inconjunction with many of the other projects inthis chapter to create a much more elaborate liedetector.

The lie-detector schematic shown in Figure 6-1is surprisingly simple considering that it does avery good job of measuring the subject’s skinconductivity. The two transistors form a very-high-gain amplifier that measures a tiny amountof current that will pass along the surface of thesubject’s skin as he or she holds onto the testprobes. Since skin does not conduct if it iscompletely dry, the more the subject perspires,the higher will be the reading on the analogmeter. Since it is a known fact that we perspire alittle more when we lie, the tester can grill thesubject and then look for small changes on themeter. Since the amplifier is so sensitive and we

all have differing levels of skin conductivity, thevariable resistor (VR1) can adjust the initialsetting so that the meter is pointing to the middleof its range before the test begins. If the subjecttries to relax too much, this will cause the meterreading to drop and could be interpreted as thesubject trying to trick the test. A higher readingfollowing a question would indicate that thesubject may be lying and perspiring more thannormal.

The circuit is so simple that you probably canforego the breadboarding process and build itright onto a bit of perf board. As shown in Figure6-2, there are only two transistors and tworesistors on the board. The only change youmight need to make is the addition of a resistor inseries with your analog meter if it happens toshoot all the way to the end even when theadjustment VR1 is all the way down. If youranalog meter fails to move much at all, then youmight have to increase the voltage by addinganother 9-V battery in series with the currentbattery to make 18 V. Likely, your meter will befine with this circuit, but it really depends on theimpedance and rated voltage of the tiny coilinside. Most analog meters will respond to a verytiny voltage, even if their readouts say somethinglike “kiloamperes” or “megavolts”!

Lie Detector

Project Six

79

Page 95: Mind Performance Projects for the Evil Genius

80

Project 6. Lie Detector

Figure 6-1 The lie-detector schematic.

Figure 6-2 The lie detector on a perf board.

Page 96: Mind Performance Projects for the Evil Genius

Analog meters can be quite costly to buy brandnew, so you might want to do a little scroungingto find one to play around with. Second-handshops often carry old stereo gear that may haveone or more analog meters. Another source mightbe an old CB radio, battery tester, analogmultimeter, or any other appliance from the1970s or 1980s that had to display some value.Now that LEDs and semiconductors cost pennies,expensive mechanical display devices are veryhard to find on mass-produced consumerelectronics.

If you turn up the variable resistor and grabhold of the probe wires, your analog meter shouldjump to the end of its range in a hurry. If themeter fails to respond, try turning the variableresistor the other way in case you have the wiperlead connected in reverse. If there is still noresponse (unlikely), connect the probe wirestogether to drive the amplifier to its maximumvalue. If the meter still fails to move, then it iseither not working or requires a lot more voltageto move the needle. If you are having the

opposite problem and can’t turn the variableresistor down enough to get the meter below thehalfway mark, then add a resistor in series withthe meter. A 1K resistor would be a good one tostart with. Figure 6-3 shows the response youwant to get—the meter at the halfway point afteradjusting the variable resistor. You should be ableto make the meter swing all the way over bywetting your finger or just by putting a lot ofpressure on the probe wires.

Your analog meter likely will have a scalemeasuring amperage, voltage, or some othervalue unrelated to our biologic subject. It isactually very easy to make a replacement readoutplate just by cutting out something you made in acomputer paint program and then affixing it tothe original plate. The plastic cover can bepopped off by placing a small screwdriver orblade in the tiny slots to pry it off the backingplate, but be careful not to damage the sensitivemeter or any of its moving parts once the coverhas been removed. Figure 6-4 show thereplacement readout plate I made that is a bit

81

Project 6. Lie Detector

Figure 6-3 Testing the range of the analog meter.

Page 97: Mind Performance Projects for the Evil Genius

more on the “funny” side of things because Iplanned to use my lie detector just for kicks. Youcan make your readout say whatever you like, but

try to create three distinct zones so that you canhave your needle point to the center point whenadjusted properly. Remember, a low reading willindicate either a bad connection between subjectand probes or a subject trying to fake the result,and a high reading will indicate above-normalperspiration or a lie.

Once you have your clear plastic cover priedfrom the backing plate, simply glue or tape yournew display over the old one, as shown in Figure6-5. You do not have to remove the originalreading plate because there will be plenty ofroom between the needle and the original plate toinsert your paper display as long as it is glueddown flat. I used a small dab from a glue stick tohold the new readout in place so that it can beremoved easily at any time without damaging theoriginal plate. Again, be careful when workinginside the meter because that tiny needle is veryeasy to bend or break.

Although you can connect the probes just aboutanywhere on the subject’s body, the old “sweaty

82

Project 6. Lie Detector

Figure 6-4 Making a replacement readout plate.

Figure 6-5 Gluing the new display over the old one.

Page 98: Mind Performance Projects for the Evil Genius

palms of a liar” factor certainly applies to thisdevice. I found a few steel rings at the localhardware store and then soldered wires to them,as shown in Figure 6-6, to make a good pickupfor the subject’s palms. The goal is to affix theprobes to your subject in such a way that theymake good contact with the skin but do not allowthe subject to change the pressure on the probes,which would cause a false readout. By placingthe rings on the subject’s palms as he or sheholds the hands palms up, you get a goodconnection without allowing the subject to grip ormanipulate the pressure between the metal andthe skin. If your subject has particularly dryhands, you can try placing the rings further up hisor her arms or use elastic to apply a fixed amountof pressure to the probes.

For such a sparsely populated circuit board,there are sure a lot of wires coming from it. Theanalog meter, power switch, battery, probes, andvariable resistor are all connected to thefunctional circuit shown in Figure 6-7, ready to

be installed in some type of cabinet. I alsodecided to connect my probe leads through a 1⁄8stereo jack so that I could create multiple probesets to allow the use of variously shaped probes.You also could connect multiple probes to yoursubject as long as they are the same on each sideof the body. On a real polygraph machine, manyprobes are connected to the subject for moreaccurate results.

There are two ways you can mount the analogmeter in your project box: behind a square holeor over the top of the lid with only the “can”stuck through the lid. Making a square hole thatlooks good requires a bit of patience as well asthe notching tool shown in Figure 6-8. To use anotching tool, trace the area to be cut out, andthen drill a hole in each corner large enough toinsert the tool’s cutting blade. The notching toolallows you to “nibble” out small square bitesfrom thin metal or plastic cabinets to createsquare or straight-edge holes. An easier way tomount an analog meter is just to cut a hole large

83

Project 6. Lie Detector

Figure 6-6 Making probes for the subject’s hands.

Page 99: Mind Performance Projects for the Evil Genius

84

Project 6. Lie Detector

Figure 6-7 The circuit ready to be installed into a cabinet.

Figure 6-8 A notching tool is great for cutting square holes.

Page 100: Mind Performance Projects for the Evil Genius

enough for the mechanical body part to fitthrough the lid, and let the display area cover thehole. This method is simple, but then you see thenondisplay area under the meter, which does notlook as professional. Since the plastic cabinet Iplanned to use was much too thick for thenotching tool, I chose the easy way out!

Like Agent Mulder from the X-Files once said,“The truth is out there.” And with your new liedetector, you can cut through the deception andmisinformation. After a bit of hole drilling, thecompleted lie detector shown in Figure 6-9 wasready for action. Of course, with my analogmeter reading “Fake, Truth, or Lies,” it isobviously more of a party gag than a tool I intend to use to interrogate my “enemy spies.”You actually could combine this device with

some of the other biofeedback devices shownearlier in this chapter to create a much morecomprehensive lie-detection system, but you alsowill require the knowledge needed to decode allthe feedback received from your subject. The artof using a polygraph is so controversial that somecountries do not even consider it a valid test, andoften those with knowledge of how the deviceworks can learn to fool the tester.

I’m sure that you will find some usefulapplication of your simple lie-detector unit andhave some fun at the same time. If you make theunit look “real” enough, then it might be just aseffective at “extracting” the truth as its bigbrother, the polygraph machine. Sometimes therisk of having a lie exposed is enough! In SectionTwo we will explore the dreaming world.

85

Project 6. Lie Detector

Figure 6-9 Ready to uncover the truth (or lies)!

Page 101: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 102: Mind Performance Projects for the Evil Genius

The Dreaming World

Section Two

This section explores the other half of your life that unfolds when the lights are outand you are in that strange place called dreamland. You might think that a dream is

something that we have no control over, but this is not the case, as will be shown withsome of the devices presented here that will allow you to link your sleeping mind withyour conscious mind. Imagine being able to enter a world where there are no limits orrules and where even the laws of physics are as elastic as the strange and wondrousatmosphere that surrounds you. Having conscious control over our dream world issomething we are all capable of with a little training and help from the electronic world.So get ready to become an “oneironaut” and travel through your dream world, paintingthe scenery at will and allowing your wildest fantasies to unfurl because this section isall about connecting with the other half of your life.

Page 103: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 104: Mind Performance Projects for the Evil Genius

White noise can be best described as a hissingsound that an FM radio makes when tuned to aplace on the dial where there is no station orstatic. White noise is a smooth hiss consisting ofall audio frequencies played back at randomsimultaneously, which is why it has nodiscernible tone. White-noise generators havemany uses, some of which include the testing ofaudio equipment, random-number generation indigital circuits, jamming audio bugs, and manymedical uses that we will be able to test andexperiment with using our simple device.

White noise is known for its calming effects,which is why many people find it easier to sleepwith a fan running or some other source ofrandom noise similar to white noise. Oceanwaves, trickling water, and wind through trees area few other examples of white noise, althoughthey are not as steady as the white noise that willcome from our home-built device. Because yourears cannot “lock” onto any specific frequenciesor patterns in white noise, the device has theeffect of shutting off your ears to distractingnoises, just as being outside in the middle of afresh snowfall on a bright day will give you snowblindness. Sensory deprivation using white noiseeven has been used as an interrogation aid totemporarily confuse subjects before questioning.

White noise is also used as a treatment fortinnitus and hyperacusis by distracting a patient’shearing so that it always hears something yet atthe same time really hears nothing. Maybe youwill want to try white noise as a sleep aid in yournoisy apartment, or perhaps you want your nexthacker gathering to be completely secure so youwant to flood your windows with white noise todefeat the laser-bounce eavesdropper. Whateveryour plans may be, this extremely easy-to-buildwhite-noise generator will fit the bill and evencan be made as a dual-channel stereo system.

The white-noise generator schematic shown inFigure 7-1 is so simple that you might think thereis something missing, but the unit works verywell and exploits the fact that transistors generaterandom noise when reversed biased. The reverse-biased emitter-to-base junction of Q1 is fed into a1-� audio amplifier integrated circuit (LM386)so that it can power a speaker or a set ofheadphones. Because many transistors will actdifferently in this application, I have added a100K variable resistor (VR1) to allow for some“tweaking” of the white noise for best results.You can use practically any small-signal NPNtransistor in this circuit, and I have found thecommonly available 2N3904 to give great results.Another variable resistor (VR2) controls the level

White-Noise Generator

Project Seven

89

Page 105: Mind Performance Projects for the Evil Genius

of noise reaching the audio amplifier so that youcan adjust the level to suit your needs. Eventhough the LM386 audio amplifier is just a small8-pin intergrated circuit (IC), it actually can driveany size speaker you like and is probably morethan loud enough to fill a room full of cleanwhite noise.

For a very relaxing white-noise generator thatwill seem to send noise in all directions, you canbuild the stereo version shown in Figure 7-2simply by doubling up the original version and sending the outputs to a pair of stereoheadphones, speakers, or the line inputs on your audio amplifier. Because there are twoindependent noise generators running, the soundwill seem to come from all directions, whichworks amazingly well for audio-deprivation

experiments where the subject is wearingheadphones or is placed directly between the twospeakers.

If you do plan to build the stereo version, try tokeep all parts the same make and value so thatthe sound is even on both channels. Since sometransistors may behave slightly differently in thiscircuit, they should both be exactly the same. Tosimplify the stereo circuit a bit further, you couldreplace the LM386 with a stereo amplifier IC toreduce the parts count a bit. If you plan onfeeding the output directly to a line input on anamplifier, then you actually can eliminate theentire amplifier section and simply feed theoutput from the center tap of VR2 directly toyour amplifier’s input.

90

Project 7. White-Noise Generator

Figure 7-1 White-noise generator schematic.

Page 106: Mind Performance Projects for the Evil Genius

Figure 7-3 shows what white noise looks likeon an oscilloscope or computer input. Since whitenoise is comprised of every possible frequency atthe same time, there is no discernible pattern ortone that can be detected, which is why yourmind finds it so relaxing to listen to. White-noisegenerators like this are often used in digitalmachines that need to create some kind of chaosfor a random output. Digital encryption andlottery machines are prime examples of usingwhite noise as a source for random information

because digital circuits cannot generate trulyrandom sequences that never repeat.

The simple circuit can be built on a solderlessbreadboard (Figure 7-5) in a few minutes. As soonas you power up the circuit, a nice clean hissshould be heard from the speaker if everything isworking well. If your noise sounds more like acrackling or spitting oscillator, then try movingVR1 to tweak the sound a little bit. If your noiseis still not smooth and crackle-free, just drop inanother transistor, and listen to what you get. The

91

Project 7. White-Noise Generator

Figure 7-2 Stereo white-noise generator schematic.

Page 107: Mind Performance Projects for the Evil Genius

92

Project 7. White-Noise Generator

Figure 7-3 White noise is a random wave.

Figure 7-4 Breadboarding the white-noise generator.

Page 108: Mind Performance Projects for the Evil Genius

optimal white noise is a very clean hiss much likea radio with no station or the sound of air leakingout of a tire. Since the LM386 audio amplifier ishappy on any voltage from 9 to 18 V, you mightwant to try a 9-V battery for the absolute cleanestpossible output. A dirty power supply will addhum into the circuit.

If you are planning to use headphones, turndown the volume control (VR2) at first becausethe output of the audio amp can be very loud. Ifyou find the output to be much too loud, removecapacitor C2, and that will change the gain on theLM386 from 200 to only 20, making the outputmuch quieter.

The perf-board version of the white-noisegenerator shown in Figure 7-5 is extremely small,so it can be installed into just about any cabinet.If you are happy with the “flavor” of white noiseafter adjusting VR1, then you simply can measurethe impedance when it is set correctly and replaceit with a fixed resistor to simplify the circuit even

further. I decided to leave the tweakingadjustment because it worked somewhat like asingle-band equalizer to adjust the sharpness ofthe white noise.

On a single 9-V battery, the white-noisegenerator will run all day, although you alsocould use a 9- or 12-V direct-currebt (dc) adapterfor batteryless operation if needed. The 4-inch-diameter speaker shown in Figure 7-5 was finefor a small room, but for a larger room or a morebassy sound, you probably would want to use alarger speaker or one already mounted inside acabinet. A 10-in speaker in a cabinet will makethe white noise much richer and more like windrather than a hissing radio.

The stereo version of the white-noise generatorshown in Figure 7-6 is great for relaxing ormessing around with auditory-deprivationexperiments. This version has dual noisegenerators, and both audio amplifiers havecapacitor C2 removed so that the output is not too

93

Project 7. White-Noise Generator

Figure 7-5 White-noise generator on a perf board.

Page 109: Mind Performance Projects for the Evil Genius

loud for the headphones. To connect this unit to astereo amplifier for big-room sound, you just needa 1⁄8-inch stereo-to-RCA-jack adapter so that it canbe fed into the line input of any stereo system.

The cabinet-mounted system shown in Figure7-7 is great for filling a room with rich, bassywhite noise that sounds more natural than whatcomes from a smaller speaker. Because of the fullrange the quality speaker allows, all the tones arerepresented rather than just the higher, “hissy”frequencies. This version of the white-noisegenerator is great for use as a sleeping aid orwhen you want to work in a noisy environmentwithout being distracted by background noise.

There are many experiments you can do withwhite noise, so I will leave you to your own “evilgenius” devices to have fun with this project now.Some ideas for design might be the addition of avoltage sweep circuit to simulate ocean waves orperhaps the addition of some type of audioequalizer or filter to shape the white noise intopink or brown noise. Next up, we will dive intothe world of lucid dreaming.

94

Project 7. White-Noise Generator

Figure 7-6 Head-mounted stereo version.

Figure 7-7 A larger version with more bassresponse.

Page 110: Mind Performance Projects for the Evil Genius

Imagine being able to immerse yourself in aworld where you can do whatever you likewithout consequence and also have the ability toalter the very laws of physics and controleverything you survey. This may sound like animpossible movie scenario, much like TheMatrix, or a future prediction as to how virtualreality one day may be able to “jack” directlyinto our consciousness, but let me assure you thatthis utopian world can be yours right now withoutinstalling any plugs on the back of your neck!Lucid dreaming is an unlikely mix of wakingreality and a vivid dream, a dream in which youactually can control your surroundings whileaware of the dream yet at the same timeexperience your dreamscape as if it were the real thing.

The scientific community has been studyingand documenting the lucid-dream state since theearly 1900s, and the term lucid dreaming wasfirst used by the Dutch psychiatrist Frederik VanEeden. Of course, the mainstream scientificcommunity doubted the very existence of luciddreaming for many decades because it seemedhighly unlikely that a person actually could beconscious and dreaming at the same time. Thosewho are “natural” lucid dreamers, of course,knew otherwise, but how do you prove that yourexperiences in the “other world” are true lucid

dreams? It’s much like trying to prove that thereis an afterlife because to be in that state meanssevering all ties to the real world.

In 1978, internationally renowned psychologistKeith Hearne found a way to create a bridgebetween the lucid dreamer and the real world inan interesting experiment using a polygraph tomeasure eye movements. The idea was that onentering a lucid state, the dreamer was able toremember to move his or her eyes back and forth 8 or 10 times in the dream. Knowing thatevery part of the body with the exception of oureyes becomes paralyzed during sleep, Hearne was able to prove that the lucid dreamer wasindeed conscious and able to take control whilein a true dream state, as measured by anelectroencephalograph (EEG), which measuresbrain wave activity. While doing thisgroundbreaking experiment, Hearne alsodetermined that a lucid dream occurs during therapid-eye-movement (REM) state of sleep. Healso discovered that a lucid state occurs mostoften in the first 30 minutes of the last stage ofREM sleep (normally in the early-morninghours). This newly discovered information wasvery important and set the stage to furtherunderstand lucid dreaming and direct many moreexperiments on the subject.

Introduction to Lucid Dreaming

Project Eight

95

Page 111: Mind Performance Projects for the Evil Genius

96

Project 8. Introduction to Lucid Dreaming

Knowing when a lucid dream is likely to occuralong the typical sleep stages makes it easier toperform experiments in which the subject is toldto signal the outside world or in which theexperiment involves attempting to induce a lucid-dream state on the subject. The most importantand obvious signal that we have is the REM cyclethat occurs four or five times during a typicalnight of sleep. Because a lucid dream is mostlikely to occur during the last REM cycle, we canexploit this information and create variousdevices designed to detect this REM period bywatching the subject’s eyelids and then sendsome type of signal to the dreamer that it is timeto become lucid. Of course, there is more to itthan this, so let’s have a look at what happensduring a typical night of sleep in our gray matter.

There are five stages of sleep, eachcorresponding to a change in brain wave patterns. Brain wave patterns are measure by an ultrasensitive amplifier known as anelectroencephalograph (EEG). These brain wavesshow our current state of awareness and changein five typical steps during a night of sleep.Figure 8-1 shows the stages of sleep as well asthe occurrence of rapid-eye movements (REMs)through each stage.

The five stages of sleep are shown in Figure 8-2, with REM sleep being the fifth stage,

occurring four to five times during a typical 8-hour sleep cycle. REM sleep in adults typicallyaccounts for about 90 to 120 minutes of a night’ssleep during an 8-hour period. REM periods areusually quite short at the beginning of the night,with the final one lasting the longest, where mostlucid dreams also occur. Body temperature, heartrate, and breathing are quite irregular duringREM sleep, which is another method of detectionthat can be used to trigger lucid-dream hardware.Of course, the most obvious method is to monitoreyelid movements because this is the most directindication that a dreamer is experiencing REMsleep. During the various sleep stages, the brainfrequencies change quite dramatically (as shownby an EEG), corresponding to different states ofawareness. Figure 8-2 shows the various brainwaves and their frequencies for each stage ofsleep.

Notice in Figure 8-2 how the brain waves andtheir frequencies change during the five cycles ofsleep. Alpha waves are the dominant brain waveswhile a person is awake and relaxed, which iswhy they are also present during the initialtransition between restfulness and stage 1 sleep.As a person drifts deeper into stage 1 sleep, thetawaves become the dominant brain waves. Thesewaves also are associated with a trance-like stateor are present when a person is doing some

Figure 8-1 REM frequency during the sleep stages.

Page 112: Mind Performance Projects for the Evil Genius

repetitive task where very little thinking isinvolved. Daydreaming or driving for longdistances through a barren landscape most likelywould put a person’s brain into the theta-wavestate. Moving into stage 2, theta waves becomedominant and begin to spike and descend atrandom intervals. The third stage of sleep isconsidered the onset of deep sleep because thetawaves and slower delta waves take over, andwave amplitude is at its highest. Stage 3 of thesleep cycle is where extreme nightmares,bedwetting, or talking out loud occur. Stage 4sleep is the deepest sleep, with brain waves attheir lowest frequency, and this stage happensright before the onset of REM sleep. In stage 4sleep, more than half the waves are delta waves.In the REM stage of sleep, brain waves becomebeta waves, which are much the same as when aperson is alert or working at some task. Betawaves are produced because the brain is alert anddreaming, yet the entire body is paralyzed withthe exception of the eyes. It is thought thatwithout this beta-sleep paralysis, the body mighttry to act out the dream. It is the REM stage ofsleep we are most interested in because this iswhere you will fall into a lucid dream once youlearn to do so.

If you are one of those people who has neverexperienced a fully lucid dream or don’t think

you dream very often, don’t worry; anyone canlearn to lucid dream, and it’s likely that yousimply forget your dreams as you wake up.Dream recall is the first key to opening the doorto the land of lucid dreaming and involvesnothing more than keeping a notepad or voicerecorder handy so that you can make a short notethe second you open your eyes. Have you everhad what you thought was a dreamless night onlyto have a dream recall triggered by somethingyou saw in the real world that related to thedream? Without that trigger, you would havetotally forgotten the dream, but with onlysomething as simple as a visual or auditory cue,you get a total recall. The brain places dreammemories in that space that is easily washedaway because there really is no point in filling upyour memory with random information. I canassure you that if you wake up and write downeven one word pertaining to a dream, you willrecall many of the details when you look at yournote later on. Often, you won’t even rememberwriting in your dream notepad because the brainis in a state that allows memory to slip away in ahurry. A fully lucid dream usually will notdisappear from your memory like a typicalrandom or semilucid dream because waking upfrom your adventure leaves you feeling energizedand excited.

97

Project 8. Introduction to Lucid Dreaming

Figure 8-2 Brain waves during the sleep stages.

Page 113: Mind Performance Projects for the Evil Genius

Regular sleep patterns also increase thelikelihood of a lucid dream because you can use adual alarm system to wake yourself an hourbefore your final wake-up time and then driftback to sleep thinking about how much you wantto have a lucid dream. This simple technique,along with some of the projects presented later inthis chapter, really can increase the number oflucid dreams you have once you learn to dealwith them.

Much like riding a bicycle for the first time,your first lucid-dream encounter probably will beshort and send you crashing into the land ofwakefulness. The instant you realize that you canhave total control, you may wake up because ofthe excitement, or you may not “trust” yourdream world enough and scare yourself awake. Iremember this happening when I first startedstudying lucid dreaming and was constantlytrying to fly. The first few times I became aware,I woke right up feeling a huge sense ofaccomplishment and excitement, but that, ofcourse, killed the dream right away. Once Ilearned to calm down and “get with the program,”I often would try things like jumping into the airor changing my surroundings, which also causeda fast awakening. Because your subconsciousknows that flying through the air without wingsor breathing underwater is something thatobviously would be dangerous, your untrainedlucid-dreaming mind often makes you feel unsureof the experience and causes an abrupt end toyour adventure. In time, these things also can beovercome.

One of the great lucid-dream researchers of our time, Stephen LaBerge, a Ph.D. inpsychophysiology, has written many good bookson the subject and has come up with many usefultechniques and even devices that can be used toenhance your lucid-dreaming experience. If youwould like to expand your knowledge on thesubject of lucid dreaming, just Google his name,and you will find more than enough informationon his research, books, and inventions, some ofwhich gave me ideas for a few of the projects in

this chapter. Along with much groundbreakingresearch on lucid dreaming, LaBerge has comeup with some very simple techniques forenhancing the chance of a lucid dream, as well as ways to prolong the experience.

One of LaBerge’s best-known methods forenhancing the chance of a lucid dream is call theMILD technique, which stands for mnemonicinduction of lucid dreaming and is basically away of reminding yourself to have a lucid dream.This is done by waking yourself before yournormal wake-up time and becoming fully alert bywalking around for a few minutes, remindingyourself that you are now going back to a luciddream. You then crawl back into bed, thinkingabout the dream you plan to have or recalling theone you were having just as you woke. You mustwill yourself to go back into a dream and becomelucid. Surprisingly, this system may work betterthan most of the electronic devices used toattempt a lucid-dream induction, and it requiresonly a clock with two alarms or a pair of alarmclocks.

Another simple approach that will help to“train” your brain to recognize a dreaming stateis by testing reality. Now, this may seem crazy,but often a dreamer simply will forget that it isnot normal to be traveling through space in a shipmade of cardboard boxes, or the dreamer simplywill accept the fact that the dog now talks anddrives a motorcycle. By testing reality while youare awake, you get into a pattern that will followyou into the dream world, and when it does, youwill begin to realize that reality is bent. Realitytesting may be as simple as holding up your handevery few hours to count your fingers becauseoften you cannot do this in a dream or there arean odd number of fingers. You also may askyourself routinely, “Is this a dream?” during theday because if you do this in an actual dream,your mind will notice things that don’t belong.The key to reality testing is repetition, so I haveincluded in this chapter a simple reality tester thatwill send you a reminder once every hour or so toperform a simple reality test. When you get used

98

Project 8. Introduction to Lucid Dreaming

Page 114: Mind Performance Projects for the Evil Genius

to the device, it will begin to appear in yourdreams and could be the key to realizing you arein the “other world.”

Some of the other techniques that will beexplored as projects in this chapter involvepresenting some external stimulus to the dreamereither at opportune times based on sleep patternsor via feedback directly from the body. Usingaudio to direct a dream is interesting becauseyour mind is often aware of what you hear whiledreaming, and if you have ever fallen asleepwhile watching a movie, you might have had theexperience of remembering a dream that had todo with whatever you were listening to at thetime. Mixed with lucid dreaming, this approachcan become very interesting, especially if youcreate some type of audio dreamscape and useyour own voice to “coach” your dreaming selfinto a new lucid-dream world. One of the projectsin this chapter also will respond to movements ofyour eyelids, so you can use this feedback inconjunction with a clock to determine when youare in the last REM stage of sleep before wakingbecause this is the opportune time to introducesome type of audio or visual cue to help trigger alucid dream.

Well, that’s enough hype about lucid dreamingfor now! Honestly, who wouldn’t want to have avirtual reality without limits to control everynight (or at least once in a while)? No computergame or thrill-seeking adventure could evercompare to a lucid dream because there aredangers, moral issues, and of course, the veryfabric of reality to contend with. When you wakeup from a full-blown lucid dream, it won’t feelthe same as when you wake up from a typicalstrange dream and just think, “Huh?” Your lucid-dream experience will seem so real at the timethat when you finally open your eyes, it willseem like it really happened, and you willremember the experience much like anyincredible event in your life. Chances are that youwon’t be able do lucid dreaming often, so don’tworry; it’s not like you are going to get addictedto the sleeping world and leave your waking lifebehind!

Now let’s dig into the electronics junk box andput our “evil genius” minds to work so that wecan master the other half of our lives—the dreamworld.

99

Project 8. Introduction to Lucid Dreaming

Page 115: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 116: Mind Performance Projects for the Evil Genius

Now here is a device you probably thought youwould never need—a little box that helps you todetermine if you are awake or dreaming. Thismay sound like a completely useless gadget, butwhen it comes to your lucid-dream arsenal, this isactually a very useful tool that can greatlyincrease your chances and the frequency at whichyou might have a lucid dream. By itself, thedevice serves no real function besides being asimple timer that reminds you to practice one ofthe best-known techniques used to aid in luciddreaming. Reality testing on a regular basisbecomes a habit that is often transferred into yourdreaming world, where, of course, reality is muchdifferent from that of the waking world. Whenyou ask yourself, “Is this real?” in a dream, oftenyou realize that you are in fact dreaming and thencan will yourself into a fully lucid state. Thissystem only works if practiced regularly, so thislittle timer helps you to get into the habit oftesting your current state of reality in order tobring this habit into your dream world.

The reality tester is a covert device that worksmuch like a pager, so you can carry it at all times without having to explain your “weirdness”to those around you. Since the reality testersimply vibrates every hour or so, you cancontinuously test your state of consciousnesswithout interrupting your day. Eventually, you

will begin to do this in your dreams, and whenyou look around and ask yourself, “Is this the realworld?” you will often realize that things are justtoo strange to be real and then can become lucid.A tried-and-true method of reality testing is tosimply count your fingers because often in adream there will be too many, too few, or yousimply will not be able to do it at all. Readingsome text is also a good method of reality testingbecause the dream world often will returnscrambled text or something that looks more likeancient hieroglyphics. In a dream, some thingswill just be plain ridiculous, such as a purple skyor the fact that you are eating your breakfast on apirate ship made of Lego blocks. In this case,there is no doubt you are dreaming, but you maynot even question these oddities unless you arereminded to do so by the reality tester. Once youget in the habit of realizing your shift in reality,you can begin to take control over your dreamworld and rearrange it as you see fit.

The reality test can be made to vibrate covertly,or it can be adapted to make an audio tone (orboth if you like). The main schematic for thereality tester is shown in Figure 9-1 with a smalldc motor used as a vibration device.

The 555 timer (IC1) is wired as an adjustableoscillator that sends its pulses to a 74HC4040 14-bit binary counter (IC2) so that the pulse time

Waking-Reality Tester

Project Nine

101

Page 117: Mind Performance Projects for the Evil Genius

can be divided by one of the following values: 2,4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, or4096. Using the 4040 to divide the pulse timemakes it much easier to set up a timer based onminutes or hours because the 555 timer is notvery good at outputting long delays. In theschematic, R5 and D1 are used only during setupso that you can use a clock or stopwatch to countthe timer pulses and then adjust VR1 to get thelight-emitting diode (LED) to flash at about onceper second. Once you have a 1-second flash rate,just choose one of the outputs from the 4040counter to set the interval at which the realitytester will buzz you. In the schematic shown inFigure 9-1, I have chosen pin 1 of the 4040counter, which is marked 4096, so my realitytester will alert me about once every hour if I set

the 555 timer to a pulse rate of about 1 second.To calculate your final time, use the formula

4096/60 (seconds)/60 (minutes) = 1.13 hours

Transistor Q1 is being used as a switch to turnon a motor that operates as a vibration devicebecause it has an unbalanced counterweight on itsshaft (more on this later). Switch SW1 is apushbutton switch that forces you to reset the unitto acknowledge the fact that it is time to test yourreality. The reality tester also can be made tooutput an audio tone by removing the motor, Q1,and R3 and replacing them with the circuit shownin Figure 9-2. As you can see, this circuit is muchlike the 555 timer clock oscillator in the mainschematic except that it oscillates at a higherfrequency and then sends its output into a piezobuzzer.

102

Project 9. Waking-Reality Tester

Figure 9-1 Reality-tester schematic with vibration motor.

Page 118: Mind Performance Projects for the Evil Genius

You could have both the vibrating motor andaudio at the same time or add a switch to change between audio and vibrate modes. Having both modes of operation might be goodbecause it is more convenient to use the audioalert mode when working alone at a desk and lessembarrassing to use the covert buzz mode whenout and about. When you pull a beeping home-built gadget out of your pocket at dinner and tryto explain to people that it helps you keep trackof your current reality, that might get you somevery strange looks!

Now let’s work on the mechanical part of theproject that will create a vibration very similar toa cell phone or pager. Figure 9-3 shows a numberof small dc motors that can be used to create avibration unit, as well as a few that are actuallytaken from pagers and cell phone. The two smallmotors shown at the bottom left of the figure areactual vibration motors, as you can see by theunbalanced counterweights already attached totheir output shafts.

Don’t worry about tracking down a pagermotor because it is extremely easy to make thesame kind of thing with any small dc motor and a

soldering iron. All you need is a small dc motor(the smaller, the better) and a blob of solder stuckto the end that will cause the motor to vibrate asit spins. These motors can be found in all kindsof kids’ toys, CD-ROM or DVD players, videocameras, electric shavers, and many other smallappliances. Don’t worry about the voltage of themotor, just that it spins up when you place it onyour 3- or 6-V battery. Even a motor rated for 24V probably will spin fast enough on 3 V to createa vibration, but you really don’t need a hugemotor because the device should be small enoughto fit in your pocket when completed. To add anunbalanced counterweight to your motor’s shaft,just heat up a blob of solder, as shown in Figure9-4, and then dip the motor shaft into it and holdit there until the solder solidifies.

As the solder blob cools, try to keep the motorshaft perfectly still so that the blob stays tight onthe shaft. When the solder has cooled, add powerto your motor and see how it vibrates. Chancesare good that the solder blob will not be balancedperfectly on the shaft and that there will be a lotof vibration as the motor spins. Another methodof making a counterweight is to find a gear or

103

Project 9. Waking-Reality Tester

Figure 9-2 Reality tester audio output modification.

Page 119: Mind Performance Projects for the Evil Genius

104

Project 9. Waking-Reality Tester

Figure 9-3 Small dc motors that can make vibrations.

Figure 9-4 Adding an unbalanced weight to the motor.

Page 120: Mind Performance Projects for the Evil Genius

wheel that fits onto the shaft and file one sideaway. You will need to solder wires to the powerpins on your motor, as shown in Figure 9-5, sothat you can connect it to your breadboard andthen to your completed circuit.

The breadboarded circuit is shown in Figure 9-6,and you can get a perspective on how small myvibration motor really is compared with the otherparts. The 3-V lithium battery will power the 5-Vlogic chip and timer without any problem and giveplenty of juice to the motor to make it vibrate.

The circuit should be built first on a solderlessbreadboard so that you can adjust the timerproperly using the temporary flashing LED(shown by the arrows in Figure 9-6). By adjustingthe variable resistor (VR1), you can set the flashrate to about once per second and then “tap” intothe 4040 counter to set the overall delay betweenreminders. Just take the divider number (shownon the pins of the 4040 counter in Figure 9-1)and divide that number by 3600 to get theapproximate value in hours between reminders.Once you are satisfied with the time betweenreminders, you can remove R5 and the LED sothat the LED doesn’t waste battery power. Youalso can measure the resistance across thevariable resistor once it is removed from yourcircuit and then replace it with a fixed-valueresistor of the same value. Once the circuit isworking properly, the components can betransferred to a small perf board for installationinto a portable cabinet.

As shown in Figure 9-7, I also added an on/offswitch to the system so that battery power could

105

Project 9. Waking-Reality Tester

Figure 9-5 Motor with counterweight attached.

Figure 9-6 Testing the circuit on a breadboard.

Page 121: Mind Performance Projects for the Evil Genius

be conserved when not busy testing reality. Nowall you have to do is find the smallest possiblecabinet for your reality tester, and you can begintraining your mind to regularly question yourcurrent reality. I found a plastic film containerthat was just perfect to fit the small battery,motor, and circuit board inside, and it fits nicelyin a pocket without becoming too annoying.Figure 9-8 shows the tight fit of all thecomponents into the film container, with justenough room for the reset button out the top.

Before I jammed the works into the filmcontainer, I wrapped the circuit board with tapeso that the battery case and on/off switch wouldnot short out against the component pins. This isnot shown in Figure 9-8 because it looked like amess, but you should consider wrapping yourperf board in tape if it is to be jammed into asmall container such as this. I also decided toplace the on/off switch in the container because Idid not want it turned off accidentally when I wascarrying the unit around. The reset switch is not aproblem because it only works once the buzzer or

vibration has already begun. Now you have thelengthy process of testing the unit with it fullyassembled. It is painful to wait for the entirecycle, so find something to do and then flip theswitch, keeping track of the time you turned onthe unit. If you were shooting for an hour delay,then your buzzer or vibration should beginsomewhere close to that time, give or take 15 minutes for timer inaccuracies.

The completed reality tester is shown in Figure9-9, ready to carry around. Of course, I do notrecommend that you attempt to bring this deviceon a plane with you because it surely looks likesomething dangerous, and trying to explain itspurpose to security folks might make you looklike a crazy person! Every time you are alerted bythe reality tester, press the reset button and thenask yourself, “Is this a dream?” Look around andtry to find some text to read, or hold out yourhand and count your fingers. In the dreamingworld, text almost always will be unreadable, andyour fingers will not add up correctly or just lookstrange somehow. It may take a week or more of

106

Project 9. Waking-Reality Tester

Figure 9-7 A completed circuit on a perf board.

Page 122: Mind Performance Projects for the Evil Genius

107

Project 9. Waking-Reality Tester

Figure 9-8 Everything fits into a small film container.

Figure 9-9 The reality tester ready for action.

Page 123: Mind Performance Projects for the Evil Genius

constant reality checking before this habit spillsover into your dreams, but once it does, it will beeasy to trigger a lucid-dream state by realizingthat you are actually dreaming. You also canexpect a few misfires as well as you get excitedand wake up too quickly at the prospect ofactually controlling the dream. Like all thingsworthwhile, lucid dreaming is an art that must bepracticed to be fully appreciated.

Once you’ve managed to learn the art ofrealizing that you are dreaming, you might wantto try some other experiments on your sleepingbrain. The next project will help you to “direct”your dreams by audio suggestions presented atopportune times during your sleep cycle. Somethings that you might want to try are sleeplearning, subliminal suggestions, movierecordings, random sounds, and motivationalmaterial.

108

Project 9. Waking-Reality Tester

Page 124: Mind Performance Projects for the Evil Genius

Have you ever fallen asleep while watching amovie, only to awaken a short time later andrecall a dream that had something to do withwhat you were watching? How about waking upearly because of some neighborhood distraction,only to realize that you were dreaming aboutsomething that was making a very similar sound?Much like a waking mind can react to subliminalmessages, the dreaming mind also can beinfluenced by the senses, sometimes to a greaterdegree. To exploit this fact, we will build a devicethat will send you an audio message at theopportune time during your REM sleep phase(about an hour before you wake). This is the timewhen you are most likely to enter a lucid dreamand the best time to remember a dream or makenotes for later recall.

The idea behind this device is quite simple. Ahacked alarm clock is modified to trigger sometype of audio player that will send you aprerecorded audio file to help you enter a luciddream or simply “direct” your dreamscape insome direction. There is no direct feedback fromthe body in this version of the device, but sincewe know that the last hour of sleep is usually themost important for dream recall and luciddreaming, the trigger is simply set to an hourbefore your real wake-up time. You can thenprerecord 20 to 40 minutes of audio for playback

into a pillow speaker and let your mind wander inthe direction of the audio clip. Maybe you wantto learn Spanish while you sleep? How aboutrecording your favorite movie and trying to liveout the action? Maybe you just want to recordyourself speaking about how tonight you willenter a lucid dream? Chances are the audio willaffect your dream, although it may do so in waysyou did not expect.

When I first experimented with this device, Ifound that the audio certainly did affect mydreams, but sometimes in ways I was notexpecting. I once recorded the unmistakablesounds of a car race, thinking that I would wakefrom a dream where I was sitting behind thewheel of an Indy car. When I did wake and haddream recall, I remember that the dream wasabout some weird tiny flying robot, and the carengine sounds actually were the sounds of thelittle wings flapping as the robots flew past myears. Although this was not what I expected, itcertainly had an effect on my dreams. I also triedmy own voice talking to me like some guru abouthow I was entering a lucid dream, and thisworked a few times. On other occasions, I haddreams about making the actual audio file!

The dream director is just an amplified switchthat locks down a relay when there is a smallchange in voltage at the input. The input typically

Audio Dream Director

Project Ten

109

Page 125: Mind Performance Projects for the Evil Genius

110

Project 10. Audio Dream Director

is the output buzzer from an alarm clock. Therelay switch then is connected to the play buttonon some type of audio playback device such as anMP3 player, handheld audio recorder, or even aCD player. Since the actual alarm speaker orbuzzer is removed from the hacked clock, you donot wake, and the audio file begins to playthrough a pillow speaker under your head. Usingany computer sound program, you can compileyour audio file to slowly ramp up the volume sothat you are not awakened suddenly by the sound.If all goes well, your dreaming mind will driftinto a dreamscape influenced by the audio file.Because you may remember making the file orhave your voice dubbed in to remind you that thisis a lucid dream, chances are good that somethinginteresting will happen.

Figure 10-1 shows how simple the relay-triggerpart of the dream director really is. IC1 is an ORgate connected in such a way that its own outputfeeds back into its input and latches it in the ONposition once triggered by an external voltage

change from your alarm system. The output thenis fed into transistor Q1 to drive the relay coil andclose the contacts. Using a relay isolates yourdevice from the rest of the circuit and makes iteasy to hack just about any audio player with aplay button that will start the audio playing. Therelay also adds complete isolation from the alarmclock, although I still would recommend that youonly use battery-powered devices when “jacking”yourself up at night to your hacked gadgets. Justthink about lightning storms, and you will realizewhy not being plugged into the wall socket atnight is a good idea.

You can run the circuit on from 3 to 6 V, andjust about any relay with a voltage rating from 5 to 12 V will work. Even some relays rated at 24 V seemed to latch just fine on my systemwhen I was running it on only 3 V. The best wayto find a suitable relay is to try activating it withwhatever power source you intend to use here.You do not need a large relay because current isvery minimal, and your relay needs only a single

Figure 10-1 The dream director schematic.

Page 126: Mind Performance Projects for the Evil Genius

pole with a pair of normally open contacts. Someof the relays I tested on my 5-V battery areshown in Figure 10-2, so I chose the smallestone, which was taken from an old modem cardand rated for 5 V.

This circuit is so simple that you may not evenneed to test it on a breadboard, but it is certainlyeasier to make changes this way in casesomething does not work the way you want it to.Figure 10-3 shows the relay driver ready fortesting once I rip the buzzer from my alarm clockand feed it into the logic gate. The reason thecircuit latched the relay closed is because onceyour alarm clock starts feeding the input, it willdo so intermittently, which may cause some audioplayers simply to start playing the same audio fileover and over again. By latching the relay, theplay signal is sent to your audio device only once.

The completed relay driver is shown built on asmall perf board in Figure 10-4. Notice the 5-Vregulator installed in the center of the board sothat I can run the driver from a 9-V battery. This

7805 regulator is shown in Figure 2-8 and willoutput a perfect 5 V from a supply of 9 to 12 V.Of course, 3 to 6 V would have been just fine forthe logic chip, but 9 V most likely would cook itin a hurry, so the regulator is necessary. When therelay driver is working, any small change in theinput voltage will cause the relay to close and notopen until the power is removed. To test theboard, just connect a 1.5- or 3-V battery to theinput wires and listen for the relay to close.

The alarm clock that will trigger the relayboard can be just about any type that has a digitalalarm connected to a speaker or buzzer with twowires. Figure 10-5 shows two of the clocks Itested, and both worked perfectly with the relayboard after removing their buzzer output wiresand feeding them to the relay-board input. Abattery-operated clock is certainly morepreferable than one that will connect your sleeplaboratory to the power lines, so take this intoconsideration when looking for a clock to hack.

111

Project 10. Audio Dream Director

Figure 10-2 Some relays that will work with this circuit.

Page 127: Mind Performance Projects for the Evil Genius

112

Project 10. Audio Dream Director

Figure 10-3 Testing the relay driver on a breadboard.

Figure 10-4 Relay drive board ready for installation.

Page 128: Mind Performance Projects for the Evil Genius

To trigger the relay board, there needs to be asmall voltage change at the input of the logic gate,and this is taken from the output of the alarmclock. You need to identify the speaker, buzzer, orpiezo element and remove the two wires from itso that you can install some type of output jackonto the alarm clock’s cabinet. Since you don’t

want the alarm to wake you up, the buzzer mustbe completely removed from the circuit so thatany alarm sounds will be fed silently directly intoyour relay-board trigger input. Figure 10-6 showsthe piezo element found inside the small alarmclock that I pulled apart for this experiment. Thetwo arrows point to the alarm output wires, and

113

Project 10. Audio Dream Director

Figure 10-5 Choosing an alarm clock to drive the relay board.

Figure 10-6 Identifying the alarm output wires.

Page 129: Mind Performance Projects for the Evil Genius

there is a positive (red) and negative (black) wirein this unit, which is important because the inputto the gate should be a positive-going pulse. Don’tworry if your wires are the same color and there isno clear indication as to which one is positivebecause you can just try them both ways until youhear the relay close when the alarm is going off.

Once you have identified the alarm outputwires, connect them to some kind of jack that canbe installed in the alarm clock cabinet so that youcan plug your relay board or some otherexperiment into your modified alarm system.Figure 10-7 shows the 1⁄8-inch mono jack Idecided to use for this device, keeping in mindthe positive wire going to the center pin on thejack. Again, if you are unsure about the polarity,just guess, and then reverse the wires if the relayfails to close when the alarm is going off.Another idea for testing is to remove the originalalarm buzzer or speaker so that you can plug it

back into the newly installed output jack. Thisgives you the ability to hear the alarm for testingpurposes or use the clock normally when notexperimenting with it.

The newly modified “silent alarm” system isshown in Figure 10-8 with the alarm output jackinstalled in the side of the cabinet. This little hackis great for a variety of experiments that mightrequire an accurate timer with an output capable of driving a digital circuit or relay into action. By using this alarm set to trigger your dreamexperiments an hour before your real alarm sounds,you are almost guaranteed to be in the last stage ofREM sleep, where lucid dreaming is most likely tooccur. Also shown in the figure is the matchingmale 1⁄8-inch mono plug that will transfer the alarmvoltage into the relay-board trigger input. Now youneed to install your relay-board trigger in a cabinetor attempt to jam it into the alarm clock cabinetand leach power from the clock.

114

Project 10. Audio Dream Director

Figure 10-7 Adding an alarm output jack.

Page 130: Mind Performance Projects for the Evil Genius

I actually had room in my alarm clock for therelay board and found a 12-V dc output from thepower supply, so I could have installed everythingright in the clock and fed the 12-V supply intothe 5-V regulator in the relay board. Of course,

this makes the unit unavailable for otherexperimentation, so I opted for the typical “blackbox” installation shown in Figure 10-9, makingsure that there was also room for a 9-V battery. Ialso added an LED to show that the unit was on

115

Project 10. Audio Dream Director

Figure 10-8 A universal “silent alarm” for your projects.

Figure 10-9 Installing the relay board in a cabinet.

Page 131: Mind Performance Projects for the Evil Genius

and a switch to turn it off when not in use.Because the device is on all night, I used a high-value resistor to keep the LED as dim as possibleto reduce drain on the battery. A 47K resistormade the LED just barely visible in a dark room.

Figure 10-10 shows the completed relay boardand modified alarm clock ready to trigger justabout any device through the relay. Because therelay’s mechanical contacts carry no voltage andare completely isolated from the rest of thecircuit, you are protected somewhat from thealternating-current (ac) supply if you decide touse a plug-in clock, and your external devices arealso safe from the circuit if it were to fail becausethe relay is nothing but a mechanical switch. TheRCA-style jack on the top of the box is the directconnection to the relay contact switch so that Ican plug devices into the box. I wanted adifferent jack than the one used to input the alarmso that I wouldn’t accidentally mix them up andpossibly harm the external devices I plan to pluginto the unit.

With your alarm feeding the relay board, allyou need to do is connect the relay switch to the

play button of some audio device so that it willstart playing your prerecorded dream messageswhen you are in REM sleep. You can hackpractically any audio device that will start playingby pressing a single button, so inexpensivepersonal audio recorders are perfect for the job. Iwill show you how to hack a digital recorder suchas the one shown in Figure 10-11, as well as theold-style mechanical tape-based units that arealso quite easy to find and modify. Whenchoosing an audio player, just make sure that itwill stay on and respond to a single button pressto begin playing your message. Some units have asleep mode, but often this can be turned off as anoption. If your unit will not respond to a singleplay button, then the device will not work withyour relay board. Mechanical tape players alwayswill work because the relay board will control thevoltage to the motor while the play button isstuck in the play position. MP3 players usuallywork as long as they start with a single buttonpress. Usually, the cheaper and larger the unit, thebetter it will be for hacking.

116

Project 10. Audio Dream Director

Figure 10-10 Alarm clock and relay board ready to use.

Page 132: Mind Performance Projects for the Evil Genius

To connect the audio device to your relayboard, all you need to do is open the case, findthe play-button points, and add two wires back toyour relay contacts. Polarity is not importantbecause the relay acts exactly like the originalswitch on the audio device, and if you have room,you can feed the wires out of the case and noteven interfere with the operation of the playbutton. Figure 10-12 shows how I was able to tap

into the play button and sneak the thin wireoutside the unit without messing up the originalplay-button functionality. If you are hacking avery small MP3 player, then you might want tohave a magnifying glass handy and use thesmallest wire you can find because the contactpoints will be very small. If you don’t care aboutusing the audio device normally, then you canmake an ugly hack if necessary, but remember

117

Project 10. Audio Dream Director

Figure 10-11 A digital voice recorder is perfect for this project.

Figure 10-12 Hacking into the play button.

Page 133: Mind Performance Projects for the Evil Genius

that the device will have to be somewhatoperational to get your messages into thememory.

Mechanical tape players are very easy to hackand are always guaranteed to work with the relayboard because the drive-motor connection will besevered and routed through the relay switch.Open the unit and identify the motor, as shownby the arrow in Figure 10-13. The motor willhave only two wires coming from it, and youonly need to cut one of them and then feed a pairof wires from each end back to the relay switch.Now you can press play on the recorder andnothing will happen until your relay closes andstarts the motor spinning—it’s an easy hack! Ifthere is a jack on your recorder with the label“REM” on it, then you are in luck because that’sexactly what this jack does: It breaks theconnection to the motor so that you can just finda compatible plug and send that directly to yourrelay switch. Mechanical recorders are nicebecause they can be found at many storesrelatively cheaply and are always easy to hack.

Sound quality is not important here, so youprobably can use the same tape over and overagain without any problems.

Figure 10-14 shows the completed hack done tothe mechanical tape player in order to feed themotor output back into the relay board. I also tookthis opportunity to add a connection from theoriginal speaker out to another jack so that I coulduse a pillow speaker rather than placing the deviceunder my pillow directly. This modificationreduces the risk of pressing stop or some otherbutton during sleep. Most players already have aheadphone jack, so you only have to make theaudio-output modification if there is noheadphone or external speaker plug on your unit.

Once your relay board is triggering your audiodevice, you are almost ready to experiment withaudio dream induction. The completed unit isshown in Figure 10-15, ready with my favoritemovie scenes to influence my dreams. The onlyquestion left is, How do you get the audio to yourears in a comfortable way without waking

118

Project 10. Audio Dream Director

Figure 10-13 Hacking a mechanical tape player.

Page 134: Mind Performance Projects for the Evil Genius

119

Project 10. Audio Dream Director

Figure 10-14 Motor output wires added to the recorder.

Figure 10-15 The dream director ready for use.

Page 135: Mind Performance Projects for the Evil Genius

yourself up? Headphones are the obvious firstchoice and ensure that your odd experiments arenot forced on anyone else in the room with you,but personally, I can’t sleep with headphonesstuck to my head, especially when sleeping onmy side. If your audio device has a built-inspeaker, you could place it directly under yourpillow, but most devices do not have that feature,and then you run the risk of pressing buttonswhile you are asleep. A pillow speaker is veryeasy to make.

Pillow speakers can be purchased, but that’snot my style, so I will show you how to make onethat will work perfectly with this and any otheraudio experiment you might want to try. You canfind a small speaker like the one shown in Figure10-16 in most small radios, audio toys, or even apair of old headphones. All you need to do is finda small container to fit it into and then solder aheadphone jack to the speaker so that it can beplugged into the headphone jack on your audioplayer. I found a deodorant container that fit thespeaker perfectly, so that is what I used.

The completed pillow speaker is shown inFigure 10-17 and also includes a switch thateither can be used to shut off the speaker or canbe fed back to some other project that requiresuser feedback. I did not have to make holes in thecabinet for the speaker because it was loudenough just as it was, and it does not take muchsound at all at night when your head is right overthe speaker. Another simple method for making apillow speaker is to just take one side of a largeheadphone system and remove the strap part.

Now you are ready to dive into your favoritemovie while you sleep or talk yourself into alucid dream. The completed rig is shown inFigure 10-18, and it looks more like somethingfrom an anarchist’s briefcase than something thatbelongs in a sleep laboratory! Oh well, just don’tpack this device in your luggage when going onvacation, and you will be okay. What you plan torecord is your business, but here are a few tips toget the best results without waking yourself up.

120

Project 10. Audio Dream Director

Figure 10-16 Making a simple pillow speaker.

Page 136: Mind Performance Projects for the Evil Genius

If your audio starts suddenly, it will likelywake you up, especially if your audio file is somefast-paced action scene from your favorite movie.Practically any audio editing software can be

used to create a ramp, or volume fade-in, overtime so that your audio file starts at zero volumeand increases gradually in level over a period of aminute or two. Figure 10-19 shows an old version

121

Project 10. Audio Dream Director

Figure 10-17 The completed pillow speaker.

Figure 10-18 The completed audio dream director.

Page 137: Mind Performance Projects for the Evil Genius

122

Project 10. Audio Dream Director

of Sony Sound Forge applying the “ramp in”filter to a recording of Neo fighting one of theAgents in The Matrix. Now the audio file comesin slowly so that it will not wake me from mysleep when the director triggers playback.

I hope that you have fun with this project; Iknow I did. The audio dream director can be apowerful tool for manipulating your dreamscapeor even inducing a lucid dream if used properly.Try your favorite movie scenes or even overdub

your own voice telling you to have a lucid dreamlike some kind of guru. How about sleep learningor self-help content? The possibilities are endless,and as long as you trigger the audio in your laststage of REM sleep and practice proper dreamrecall, you are guaranteed to see some resultswith this device. Of course, the dreaming mind isa strange animal, so don’t be surprised it thatMatrix fight scene induces a dream about youwatching TV rather than being in the movie!

Figure 10-19 Editing your audio for a gradual volume ramp.

Page 138: Mind Performance Projects for the Evil Genius

This project will detail the creation of what manyconsider to be the Holy Grail of lucid-dreamhardware. By combining a circuit that monitorseyelid movements with a microcontroller, youend up with a fully self-contained lucid-dreammask or goggles that can detect your REM stageof sleep and send signals to you in the form offlashing lights or trigger any external device suchas the audio system shown in the precedingsection. By basing the trigger on actual rapid-eyemovements, you are guaranteed to get your lucid-dream signals when you need them. These lucid-dream masks, or “dream goggles” as they aresometimes called, have been available for yearsand were made popular by Stephen LaBerge withhis NovaDreamer product.

Our version of the lucid-dream mask will bepresented using two different methods ofdetecting rapid-eye movements directly from theuser’s eyelids. The “classic” version will workmuch the same way that the commercial productsdo—using an analog amplifier fed by the outputof an infrared transmitter and receiver pair todetect small changes in voltage as the dreamer’seyelids move back and forth. Another method,using a tiny accelerometer IC, actually will detectthe eyelid movements directly, which makes thedevice so much easier to align and get workingthe first time. I have been experimenting with this

alternate dream-mask design for several yearsnow and find it to be more forgiving and accuratethan the infrared REM-detection method, evenwhen compared with some commercial units. Of course, you may have reasons to preferexperimenting with the classic system, so bothversions will be fully detailed in this project.

In both versions of the dream mask, the output from either the infrared phototransistor or the accelerometer will be fed into amicroprocessor for detection so that the signalcan be further processed and handled by the user IO code. When 20 or more REM sleepmovements have been detected from the sensor,the microprocessor will go into signal mode and begin flashing a visible LED 100 times sothat the dreamer can learn to become aware while dreaming and enter a lucid dream. Themicroprocessor also aids in setup mode, allowingthe user to fine-tune the eyelid sensor system byusing instant feedback while wearing the mask orgoggles. A false-trigger pushbutton is also addedso that the unit can be reset if it goes off while heor she is still awake.

This project is presented in two parts because itdoes require a bit of adjustment and testing to getit set up and working perfectly. The REM-detection mask and related circuit will be builtfirst and tested so that you can decide on which

Light-Sensing Lucid-Dream Mask

Project Eleven

123

Page 139: Mind Performance Projects for the Evil Genius

microcontroller to work with or even choose to feed the output directly into a computer formore control and ease of programming. Themicrocontroller part of this project will bepresented next with included source code writtenin Basic for easy porting to any microcontrolleror language. The completed unit will function aswell as (or possibly better than) some of thecommercially available dream masks, and it willcost you under $20 to build if you already haveaccess to a microcontroller programmer. If youhave never worked with microcontrollers such asAVR, PIC, or Basic Stamp, then don’t worry; thehobby is inexpensive, easy to learn, and will beexplained in more detail in the next part of thisproject.

Are you ready to become an oneironaut, onewho travels in dreams? If so, then you will enjoythis project because I have found it to be the mosteffective way to train yourself to have a luciddream.

The classic version of the REM-detection unituses an invisible infrared LED (LED1) to shinelight on the user’s eyelid so that the reflection can

be picked up by a matching phototransistor (PT1)and sent to an amplifier as a changing ormodulated voltage. The schematic for this versionis shown in Figure 11-1. Invisible light must beused because you don’t want to have visible lightshone into your eyes all night long. The outputfrom the phototransistor (PT1) is fed into theinput of IC1, the ML358 dual op amp. Op ampsare great for designing high-gain amplifiers andfilters, and because the LM358 contains two opamps, we will be using one as a filter to get rid ofnoise and the other to greatly amplify the voltagefrom the phototransistor. The filter is of the low-pass type, which means that a lot of noiseinduced by ac devices and rf interference will beeliminated so that there will be less noise in theamplified signal. The movement of your eyelidsis very slow (1 to 4 Hz), whereas ac hum andother electrical noise will be at a much higherfrequency (30 Hz or greater).

The variable resistor (VR1) is used to set theoffset of the amplifier so that the signal can beadjusted to compensate for differences in manythings, such as ambient light, placement of the

124

Project 11. Light-Sensing Lucid-Dream Mask

Figure 11-1 REM-detection device schematic with phototransistor.

Page 140: Mind Performance Projects for the Evil Genius

mask on your face, and even the shape of varioususers’ faces. The idea is to set up the system sothat slight movements detected on the eyelidsreturn a larger change in voltage so that themicroprocessor or computer analog-to-digitalconverter has an easier time with the raw data.This adjustment of VR1 is critical to operation ofthe unit and can be quite quirky to get right, so aprecision variable resistor is best used because itallows for a lot of fine-tuning.

To aid in the setup of the device, Q1, R6, andLED2 allow a visual indication of the feedbackfrom the amplifier. When you have the detectorset up perfectly, the visible LED will flickerslightly as you move your eyelids slightly, anindication of a good change in voltage from theamplifier and filter. Once you are happy with theoperation of the unit, Q1, R6, and LED2 can beomitted from the final design because themicroprocessor code also will contain a testroutine to help you set up the device in real use.

The entire system is designed to run on 3 V dc,so you can power it for several nights on a pair ofrechargeable AA or AAA batteries. Also, dcoperation keeps unwanted noise from the circuitand isolates your melon from the ac power linesat night. This is good because an electrical stormwhile you are sleeping could be bad news if yourdwelling has a direct strike. I highly recommendthat you first build this system on a solderlessbreadboard because it can be finicky to set up thefirst time, especially if you decide to use one ofthe many other op amps available. The LM358 isjust a generic op amp that can run from a singlevoltage supply, but there are many available thatwould work just fine and possibly give betterresults. Experimentation is always the goal of thisbook, so don’t be afraid to wander into your ownterritory and try something different.

The infrared LED and phototransistor pairbecomes the heart of this unit, and there are manyoptions available that will work perfectly onceyou set up the proper distance and reflectionsspot. The only requirement is that the infraredLED and the phototransistor work at the same

wavelength, which will be between 850 and 1050nm for infrared light. Infrared LEDs from old TV remote controls will work perfectly, andpractically any infrared phototransistor will havethe correct bandwidth, so it should not be hard tofind a pair that work together. RadioShack andmany electronics hobby stores will sell them inpairs, and they will look much like the pairshown at the top right of Figure 11-2. The threeblack-boxed units across the center of the figureare called position detectors and contain both theinfrared LED and the matching phototransistor inone enclosure. The position detectors work welland are a bit easier to align because they arealready set up at the correct angles, but be awarethat some of these have a digital output and maynot work well in this design. The large unit to theleft of the figure has the part number QRB1113or QRB1114 and was found to work quite well inthis design. The unit in the center right of thefigure is designed so that an object placedbetween the two walls will break the beam, andthis unit can be hacked apart to reveal the smallmatched pair, as shown in the bottom of thefigure. These beam-breaker units are verycommon in printers and photocopiers. By usingtrial and error, you should have no problemselecting the best matched pair from your junkbox.

The breadboarded circuit is shown in Figure11-3, where I use my finger to test the multitudeof infrared phototransistor and LED pairs I foundin my junk box. The matched pair in this figurewas taken from an ear clip heart rate monitorsensor I found on an old exercise bike computer,and it worked very well. Also notice the precisiontrimpot variable resistor used for VR1. Theseprecision units allow for a very fine control overthe entire scale, and they make setup of theamplifier much easier. Another thing to note isthat ambient light will have a huge effect on theworkings of this circuit, so it is best to set it up ina dark room. Sunlight and many room lightingsystems also will contain infrared light, so thephototransistor could act much differently in a

125

Project 11. Light-Sensing Lucid-Dream Mask

Page 141: Mind Performance Projects for the Evil Genius

126

Project 11. Light-Sensing Lucid-Dream Mask

Figure 11-2 Trying various infrared detectors.

Figure 11-3 Testing the infrared-detector response.

Page 142: Mind Performance Projects for the Evil Genius

lighted room, requiring more setup. Try to pointthe phototransistor and LED at an angle so thatthey meet at a point that is about 1 in away. Thiswill be approximately the distance from youreyelid to the matched pair once the unit is builtinto some type of goggle or mask housing.

Most of these do-it-yourself (DIY) dreammasks are built into small swim goggles likethose shown in the lower part of Figure 11-4, but I found a ski mask to be so much morecomfortable when I was wearing it for extendedperiods. You want the mounting system to be asloose as possible on your face yet secure enoughthat it does not shift as you move around in bed.Swim goggles are certainly secure, but the strapseems to be too tight, and the rubber eyepiecesare not really designed for comfort as much asthey are for creating a watertight seal. If youreplace the rubber head strap with some lighterelastic and drill holes in the goggle casings, theyare not too bad, but the ski mask is a much better

solution and will feel a lot more comfortable andsecure. Using a ski mask also gives you a bit ofroom to mount the battery pack and electronicsso that you can make a self-contained unit ratherthan having wires in your bed.

If you are a junk collector like I am, then youprobably have a bunch of infrared beam-breaker-type sensors in your junk pile like the one shownin Figure 11-5. These small units can be brokenapart to release the phototransistor and matchingLED by carefully prying open the case using asmall knife. Before you start hacking, look at thecase so that you can identify each component,which will have either an arrow pointing from the LED to the phototransistor or markings thatread “AK” (anode, cathode) and “CE” (collector,emitter). If there are no markings at all on theshell, you can just guess by trying eachcomponent one way or the other until you getsome response. This will not fry the parts becausethe voltage and current are very low in the circuit.

127

Project 11. Light-Sensing Lucid-Dream Mask

Figure 11-4 Selecting a comfortable mounting system.

Page 143: Mind Performance Projects for the Evil Genius

I decided to use the tiny phototransistor andLED that I hacked from the sensor shown inFigure 11-5 because they worked very well.There were no markings on the case, so it took awhile to figure out by trial and error that thedarker unit was the receiver and the lighter unitwas the transmitter. Figure 11-6 shows thematched pair mounted to a bottle cap using somedouble-sided tape to hold them in place. I alsohad to cut a bit of the black plastic case out andplace it between the two components to keep thebeam from reflecting directly from one to theother rather than bouncing off my eyelid first.The small sensor shown on the right in the figureis one of the all-in-one position sensors and isbasically the same thing as my bottle-cap hackbut ready to be used. You can find these all-in-one units at any electronics supplier by searchingfor optical position sensors or distance sensors.

After testing various optical-sensorconfigurations and deciding that the bottle-caphack was the best one, I placed the componentson a small perf board so that the system could beconnected to my ski mask for further testing.Figure 11-7 shows the small perf board with theprogrammed microcontroller (discussed in thelast section of this chapter) ready for operation. Itis a good idea to get the analog part of thisproject working before you move on to themicrocontroller or computer interfacing because

this is the area that will take the most effort to getworking properly. I tested my ski mask with theoptical sensor while the circuit was still on thebreadboard before getting to this stage in thedesign. If you have an oscilloscope handy, feedthe infrared LED with a small 1.5-V watchbattery, and then plug the output from thephototransistor into your oscilloscope so that youcan see the analog results directly while you wearyour face mask and move your eyes back andforth (one closed eye). This will give you a directreading of the responsiveness of your opticalsensor’s output. Some careful alignment might benecessary depending on the beam width and fieldof view of each of the components.

The proximity and angle of the phototransistorand infrared LED are very important for optimalresponse and may take quite a bit of fine-tuningto get working properly. If you are using a self-contained photo sensor, then only the distancefrom the edge to your eyelid will be important,but if you are using a separate phototransistor andLED, then both the distance and angle willmatter. Figure 11-8 shows my hacked bottle-capsensor placed inside the ski mask lens at theapproximate position where my eye will be. I puton the mask and drew a mark on the lens whilelooking in the mirror so that I could find thisposition. A line was drawn around the cap so thatthe lens could be cut out using a routing bit on aDremel tool. I could have just glued the cap

128

Project 11. Light-Sensing Lucid-Dream Mask

Figure 11-5 Hacking a photo sensor into itsmatched pair.

Figure 11-6 Positioning the photo-sensorcomponents.

Page 144: Mind Performance Projects for the Evil Genius

129

Project 11. Light-Sensing Lucid-Dream Mask

Figure 11-7 Placing the circuit on a perf board.

Figure 11-8 Finding the optimal sensor position.

Page 145: Mind Performance Projects for the Evil Genius

directly to the inside of the lens, but it was a bittall, and by cutting a hole in the lens, I had somecontrol over the angle if I decided it needed to beadjusted later.

With the bottle-cap sensor installed in a holethrough the ski mask lens (Figure 11-9), it waseasy to set the distance as well as the angle sothat an optimal response could be received fromthe infrared light reflecting off the user’s eyelid.Again, this was done in a dark room whilelooking at the indicator LED on the breadboardcircuit and moving my eyes back and forth untilthe LED gave the greatest response. If you find itannoying to look through one eye in the dark andtweak the variable resistor, then find a humanhelper to wear the mask as you fine-tune thesystem. Most likely the adjustment will work forall your test subjects because all human faceshave the same basic geometry. Once you have thesystem mounted to your goggles or mask andworking properly, you can go ahead and mount

your components on a more permanent home forinstallation onto the mask or into some small box.

The completed optical-based REM-detectionsystem is shown mounted to the ski mask inFigure 11-10. I split the batteries up to balancethe weight on the mask and placed the circuitboard in the center for easy access to the resetbutton in case of false triggering. The maskcertainly was comfortable and worked well in all positions except for face down, of course. I decided to keep the lens clear rather than paintit black so that I could get up at night and movearound without having to remove the mask andthen go through the microcontroller testprocedure each time. Adding the circuit boardinto a box would have made the unit more robust,but since a project is never complete, I decided to leave the board out for easy access when itcame time to add or modify the circuit. Alsonotice the visible LED on the side opposite thesensor unit. Again, it’s placed directly in front of

130

Project 11. Light-Sensing Lucid-Dream Mask

Figure 11-9 Inserting the cap through the lens hole.

Page 146: Mind Performance Projects for the Evil Genius

my eye for optimal brightness. The indicatorLED will be discussed in the last section of thischapter when dealing with the microcontrollerand programming. You also might notice thatthere is no on/off switch on my dream mask. This is so because I usually recharge the batteriesafter each use and just let the unit run all night,which is usually how I use the system. If yourplan is to wake an hour before your normalwakeup time and then use the mask, a powerswitch would be handy.

Once your dream mask has passed all yourtests, it’s time to become an oneironaut and makethe journey to your other world. As you can seein Figure 11-11, the lucid-dream mask is morethan just a powerful tool; it is also a coolHalloween prop or “steam punk” accessory!Besides alignment and initial testing (discussed inthe last section of this chapter), the only otherconcern is sleeping with your mask strapped toyour face. I found the ski mask comfortable, andsince I normally sleep on my back, wearing it tobed was not a problem. Where I initially had

some difficulties was being too excited to fallasleep easily owing to the possibility of an easylucid-dream journey. It actually took a few nightsof going to bed wearing the mask to end up witha good night’s sleep because I ended up removingit to actually fall asleep. On the first full nightwith the mask, I woke right away when the LEDstarted flashing—again too eager to see results. I ended up enhancing the microcontroller code to hold back detection until 6 hours after startingthe unit (discussed later) so that I would not beawakened from an early REM stage. After several attempts and adjustments, I found that themask does indeed fulfill its purpose as long asyou can remember to “see the signs” in the dreamworld. These issues will be discussed at the endof Section Two when you complete themicrocontroller part of this project.

Now let’s look at an alternative to the infraredlight-sensing system that uses an analogaccelerometer IC to detect actual eyelidmovements.

131

Project 11. Light-Sensing Lucid-Dream Mask

Figure 11-10 The completed infrared dream mask.

Page 147: Mind Performance Projects for the Evil Genius

132

Project 11. Light-Sensing Lucid-Dream Mask

Figure 11-11 Another oneironaut ready for takeoff!

Page 148: Mind Performance Projects for the Evil Genius

This version of the lucid-dream mask project will replace the infrared light sensor with anactual motion sensor that can detect the smallestchange in velocity. I came up with this systemafter finding the infrared version to be a bitquirky when it came to getting proper alignment.Even the commercially available units sometimescan be finicky when it comes to moving aroundin bed or having ambient light enter thephototransistor, so I wanted to try an alternativemethod of detecting eyelid movements. By usingan inexpensive tin IC called an accelerometer,I was able to place the unit directly on my eyelid and feed its output directly into themicroprocessor, bypassing all analog circuitryand making the unit completely impervious toambient light and all electrical noise. It soundsuncomfortable to have something in contact withyour eyelid, but the sensor is so small andlightweight that it feels no different from how thecloth on the sleep mask originally felt, so it is notan issue. The good news is that this system is fareasier to set up and get working properly becausethe only data sent to the microcontroller areactual eyelid movements, and changes in thesubject’s position do not cause the system to failowing to alignment changes.

An accelerometer is a tiny IC that can detectthe slightest change in direction, and

accelerometers are used in everything from self-balancing scooters (e.g., Segway) to impactsensors in vehicles to activate airbags. Theseamazing devices are so sensitive that I was ableto connect one to a microcontroller and actuallydigitize my voice just by talking near the unit asit dangled from a wire on my breadboard! Yes, itactually converted the vibrations from the soundinto digital data in real time. So you can imaginethat detecting the movement on your eyelidwould be a very easy chore for such a sensitivedevice. These little accelerometers are also veryinexpensive now and can be purchased frommany electronics distributors.

Figure 12-1 shows the accelerometer (the tinyblock on the left) I decided to use for this project,the ADXL 202E, and my analog device. This $10part actually has two accelerometers to detect x- and y-axis movement, but I will be using onechannel because it was all that was needed. Youcan even find three-axis accelerometers for thesame price, and if you get creative with yourmicrocontroller code, you could filter out side-to-side movements, making your eyelid detectorextremely robust to any stray head movements.The strip of even smaller accelerometers on theright in the figure holds three-axis units I plan toexperiment with later as I get more complex withmy microcontroller coding. I even have found

Motion-Sensing Lucid-Dream Mask

Project Twelve

133

Page 149: Mind Performance Projects for the Evil Genius

these ICs to be sensitive enough to detect mypulse when placed in the optimal spot on myneck!

It really does not matter which brand or styleof accelerometer you choose as long as it has apulse-width-modulation (PWM) output so that itcan be measured by your microcontroller as adigital signal. Pulse-width modulation is verysimple: A series of pulses is sent out of the deviceat a constant rate, but the duration (duty cycle) ofthe high pulse is proportional to the detectedmotion of the device. For instance, if no motionis detected, the pulse may stay high for 1 ms andthen drop back low for another millisecond. Thiswould mean that pulses are sent every 2 ms(while they are using my device). Now, if motionis detected, the pulse may stay high for only halfa millisecond and then drop back low after 1.5ms, indicating that a small change in motion hasbeen detected. Notice that the total pulse time isstill exactly 2 ms, but the duty cycle or high timehas been changed.

This PWM scheme is very easy to measure in a microcontroller because you simply wait for the rising edge of the pulse and then start arunning counter until the output drops back downto zero. It becomes even easier in my systembecause I don’t care about the actual value of thereading, just that it has changed from the lastreading, so the code is very simple. Operation ofthe microcontroller code will be explained in thenext section, so let’s just figure out how to get theaccelerometer set up to detect eyelid movementsfor now.

Although the ADXL is larger than many of theaccelerometers available, it still seems dwarfedby the other semiconductors on my breadboard(Figure 12-2). I did not include a schematicbecause there really is not much to show; theaccelerometer basically feeds its output directlyto the microcontroller. The two resistors and thecapacitor connected to the accelerometer are usedto set the filter and response time to 2 ms as perthe datasheet. Your accelerometer likely will havedifferent methods for setup, but not to worry,

134

Project 12. Motion-Sensing Lucid-Dream Mask

Figure 12-1 A very tiny and sensitive accelerometer IC.

Page 150: Mind Performance Projects for the Evil Genius

because the microcontroller code is veryforgiving; all it does is compare the PWM signalcoming out of the accelerometer. Much faster orslower sampling rates will work just fine becauseit is change, not time, we are comparing.

It is best to start on a breadboard and includethe programmed microcontroller so that you canmake sure you have soldered the wires correctlyon the tiny accelerometer package. If you haveyet to work on the microcontroller part of thisproject, then you can just feed the output into anoscilloscope and watch the waveform change asyou tap on the body of the accelerometer.Another trick I use to check if these things arefunctioning is to connect a piezo buzzer directlyto the output pin and listen to the digital nosechange as I tap on the device. An ugly hack, I know, but it does work! Once you havedetermined that there is indeed a signal spewingfrom the accelerometer, you can proceed tomount it on a small perf board along with the fewneeded semiconductors that make it function. The goal is to have only three wires coming from

the accelerometer unit: power, ground, and output signal.

To keep the accelerometer unit as light aspossible, I decided to cut a small bit of perf boardto fit into a plastic bottle cap, as shown in Figure12-3. In this way, I could add a bit of felt to thecap and just rest it on my eyelid for movementdetection. This worked very well and did noteven require a sleep mask when sleeping on myback because the cap just stayed there. There aremany ways you could mount the accelerometer,including just a bit of heat shrink with the thinwires coming from the device. The wires should be thin and flexible as well because youdo not want to hinder the movement of theaccelerometer unit as your eyes begin to moveback and forth. The other bottle cap shown in thefigure will be used to carry the visible LED sothat my sleep-mask installation has basically thesame thing on both sides.

It took a bit of fine work to get the tinyaccelerometer soldered down to the small

135

Project 12. Motion-Sensing Lucid-Dream Mask

Figure 12-2 Testing the accelerometer on a breadboard.

Page 151: Mind Performance Projects for the Evil Genius

breadboard, as shown in Figure 12-4, but with alittle patience, surface-mounted devices are not asbad to work with as you might think. Even afterinstalling the two timing resistors and filtercapacitor, there was plenty of room left over inthe bottle cap. Maybe if you are a real wiz with asoldering gun, you could even include a surface-

mounted microcontroller and 3-V button batteryto make the entire device self-contained in aspace no larger than a bottle cap! I opted for theeasy way out and stayed with a dual inlinepackage (DIP) microcontroller for now. Noticethat there are only three tiny wires coming fromthe cap: power, ground, and output signal.Remember, you want the accelerometer to be aslight as possible so that its range of movement is not restricted in any way and so that it does not need to put any pressure on your eyelid whenin use.

The completed circuit, including themicrocontroller, accelerometer unit, and visibleLED, can be built as shown in Figure 12-5, readyfor a new home in a sleep mask or to be used asis. If you sleep on your back and do not have ahabit of tossing around all night, then you maynot even need to install the components on amask because the small accelerometer and LEDunits can just be placed directly over your eyelidsif you place the circuit board remotely in a small

136

Project 12. Motion-Sensing Lucid-Dream Mask

Figure 12-3 Cutting a small perf board to fit thebottle cap.

Figure 12-4 Accelerometer and components in a bottle cap.

Page 152: Mind Performance Projects for the Evil Genius

box. Since this version of the REM-detectionsystem is completely oblivious to ambient light,you do not have to shield the sensor or worryabout nearby electrical devices that might inducenoise into the circuit. I actually prefer using thedevice remotely, with the two caps resting on myeyelids, but I will show how a cloth sleepingmask also can be used for those who may sleepsideways or move around a bit at night.

Even if you decide to use the device without amask or a face strap, you will need to add themicrocontroller, batteries, and test switch in sometype of case, as shown in Figure 12-6. Besidesthe microcontroller and LED-driver transistor,there is not much else to the control board, so itshould fit in a small box along with the two AAor AAA batteries, an on/off switch, and thetest/reset pushbutton. Since operation of the unitonly requires turning it on and then pressing thetest button to ensure that the sensor is working,you will never have to look at the box, so it canbe placed remotely so that it is easily accessible

while you are relaxed and “wearing” theaccelerometer and LED units.

If your battery pack and black box are smallenough, you can mount the system directly to acloth face mask to create a self-contained unit, asshown in Figure 12-7. The cap with theaccelerometer is on the right side of the figure,and the visible LED is on the left. Notice that Iam using the accelerometer cap top down and theLED cap open-end down. This makes the visibleLED brighter and allows the accelerometer tomove easily as my eyes are moving. I later addedsome felt pads to both caps, which helped to keepthem in place when I was sleeping on my sideusing the mask setup. As with all home-builtprojects, a little trial and error (hacking) probablywill be needed on your part to find out whatworks best for you.

The control box is shown on the front of thecloth sleeping mask in Figure 12-8, ready to beused for some serious lucid-dream trainingmissions. I found this version of the REM-

137

Project 12. Motion-Sensing Lucid-Dream Mask

Figure 12-5 Accelerometer, microcontroller, and visible LED.

Page 153: Mind Performance Projects for the Evil Genius

138

Project 12. Motion-Sensing Lucid-Dream Mask

Figure 12-6 Installing the microprocessor unit in a box.

Figure 12-7 Installing the hardware onto the sleep mask.

Page 154: Mind Performance Projects for the Evil Genius

detection system to be much more robust andeasier to set up than the infrared versionpresented earlier, and it has been a great tool forfurther exploring the dreaming world. No matterwhich unit you decide to build (how aboutmerging both of them together), you will need tomove on to the next step and program the small

microcontroller to sort out the raw data from the sensor and control the visible flashing LED. If you have never considered addingmicrocontrollers to your arsenal of electronicsknow-how, then trust me, it is worth it and willopen up doors you never thought possible. Nextwe will build the lucid-dream mask controller.

139

Project 12. Motion-Sensing Lucid-Dream Mask

Figure 12-8 The controller can also be installed on the mask.

Page 155: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 156: Mind Performance Projects for the Evil Genius

Now that you have a working REM-detectionsystem based on either the photo sensor or theaccelerometer, you will need a way to create aresponse from the data received. Using somefancy analog circuitry and a few digital counters,you probably could rig up a system that countedpulses from the detected eyelid movements andthen triggered a flashing LED, but this wouldbecome a very quirky system with a large numberof components. The lucid-dream-mask controllerneeds to perform a number of different operationsto make your lucid-dream mask functional andeasy to use.

First, the controller needs to either detect thedifference in the analog signal from thephototransistor, or it needs to measure the change in PWM from the accelerometer. This job would require a lot of finicky analog circuitryto get working properly, but any small 8-bitmicrocontroller can do this job and not evenbreak a sweat. After the detection phase, thecontroller must begin to count changes in order toavoid triggering the visible LED each time theuser moves his or her eyes. A few movementsmay not indicate REM sleep, so the controllerneeds to look for continuous eye movements,which is another simple task for anymicrocontroller. In my version, I just count 20eye movements. Once the controller has decided

that the user is in REM sleep, the visible LEDmust be flashed a number of times (100 in mycase) so that the user can look for this signal inhis or her dreams. Often the signal will besomething related to flashing light in the dream,so it takes a bit of practice and conditioning torecognize the signal.

Another task for the controller is to createsome type of test procedure so that the user canverify operation of the unit and to reset thecounter if a false trigger happens owing toaccidental waking eye movements or simplybecause of waking up from REM sleep. In theversion of the Basic code presented here, thecontroller does both functions from a singlepushbutton so that it is very easy to use thesystem in the dark. If a false detection happens,the user simply presses the button, and thecontroller resets the system to start over. If theuser holds the button down for 5 seconds, thecontroller puts the system into test mode and willflash the visible LED instantly every time therehas been sensor detection. In this way, the usercan verify that the system is indeed responding toeye movements. To exit test mode, the user holdsthe button down for another 5 seconds, and thesystem once again resets and starts working inREM-detection mode.

Lucid-Dream-Mask Controller

Project Thirteen

141

Page 157: Mind Performance Projects for the Evil Genius

142

Project 13. Lucid-Dream-Mask Controller

The source code is extremely simple and waswritten in Basic so that it can be ported easily toany other microcontroller or any other language.Before we dig into the source code, let’s look athow simple the schematic for the lucid-dream-mask controller really is.

Although the schematic shown in Figure 13-1is amazingly simple, the unit has a great deal offunctionality, even with the extremely simplebasic program that lives inside the chip. TheAtmega88 from Atmel is an inexpensive 8-bitmicrocontroller that offers 23 IO pins, 8Kflushable program memory, 1K SRAM, 20-MHzoperation, a bunch of onboard peripherals such asan analog-to-digital converter and serial port, anda cluster of hardware timers. Of course, this ispretty standard for many of the low-end, low-cost8-bit microcontrollers offered by various othercompanies such as Microchip as well. Becausethe controller program is kept to a minimum andwritten in Basic, you could adapt easily it to just

about any low-end 8-bit microcontroller or even aBasic Stamp module from Parallax, Inc.

If you have never heard of an 8-bitmicrocontroller before reading this book, then thinkof it as a blank IC that costs you only five bucksand can be programmed to do anything imaginablefrom emulating a simple logic circuit to playingvideo games on your TV. No kidding! I have madesingle microcontrollers play music, record sound,control huge robots, log computer keystrokes, andeven emulate entire retro 8-bit computer systems.Since the magic happens in your code, it will feellike the entire world is under your control once youfeel the magic of the microcontroller. There arethousands of various microcontrollers available,some of them having as few as 8 pins and a fewkilobytes of program storage, whereas others havehundreds of pins and megabytes of onboardmemory. Our little Atmega88 is considered asmaller microcontroller, but it is still overkill for thesimple program presented here.

Figure 13-1 Lucid-dream-mask controller schematic.

Page 158: Mind Performance Projects for the Evil Genius

143

Project 13. Lucid-Dream-Mask Controller

Each brand of microcontroller has its ownunique instruction set of assembly language, andas you progress into the hobby, you will usuallyend up programming in assembly so that you cancreate the smallest, fastest, and most efficientcode possible. Of course, high-level languagessuch as C and Basic are much easier to start withand are good for rapid prototyping because youusually can get your program working in a fewhours unless it is a real monster. For this reason, Ichose Basic because it is so easy to understandthat you probably could make modifications evenif you have never written a program in your life.Basic is also available for most of the majorbrands of microcontrollers, and the language isvery similar among the different varieties.

Now back to the schematic. The Atmega88 runsfine on just 3 V and only needs an external crystalto start working once your program is compiledand loaded into the internal Flash memory. XT1 isa 4-MHz quartz-crystal resonator and was chosenonly because it is a common value and I hadmany of them in my junk box. The Atmega88actually offers an internal 8-MHz clock source, sothe crystal is not even necessary, but I have a lotof source code designed to work at 4 MHz, andthe internal clock is not always the most accurateclock source.

Pin 15 is configured as an output and will drivethe transistor that switches on the visible LED(LED3) that will try to signal the dreamer tobecome lucid. You also can try using the resistordirectly from the microcontroller’s output pinthrough a 150-W resistor because it may not needto be all that bright since your eyes are alreadyadjusted to the darkness. I found that the systemworked best if the LED was so bright that it wasalmost too bright when trying out test mode. Thetest LED (LED4) and resistor R9 are used onlywhile breadboarding the system, so they can beomitted from the final design. LED4 will flashevery time a change in input data has beendetected. Also, test mode does the same thing.Pin 16 is set to be an input and tied low so thatthe pushbutton switch (SW1) can be detected as

the pin goes high. This button controls reset aswell as test mode by holding it down for 5seconds. Pin 17 has been set up for use as anauxiliary trigger in case you want to activatesome other external device during REMdetection. The audio dream director presentedearlier in this section would work well here. Andof course, pin 18 is the input pin that will readthe PWM or voltage changes from the REM-detection system. When using the infraredphototransistor, the input is fed to the onboardanalog-to-digital converter, and when using theaccelerometer, the pin is just a digital input pinused to measure the pulse-width time. This iswhy two versions of the code are presented.

Programming a microcontroller is as easy aspressing the “program” button—well, as long asyour program works, because we all know therule “garbage in, garbage out” when it comes toprogramming. I work with both PicMicro andAtmel microcontrollers and consider both to beequal when taking into account such things asprice, support, speed, and ease of use. Of course,PIC versus AVR is like Ford versus Chevy, so Idon’t plan to go there! Both platforms have goodC and Basic compilers available, and theassembly-language instruction set is very easy tounderstand. In this project I chose the Atmega88from Atmel because it was inexpensive, fast, hadmore than enough IO pins, and my programmer,the STK500 (right side of Figure 13-2), allowsfor programming directly in circuit or on thebreadboard. My PIC programmer requires me toplace the chip in its onboard socket, so this is lessconvenient when trying out a lot of small codechanges.

No matter which microcontroller brand youwave the flag for, you will need a programmerthat can support the device you plan to use. Mostcommercial programmers will support many orall of the devices in a certain microcontrollerfamily, and this is true with both the STK500 andthe PicStart Plus programmers that I often use.There are also many low-end or home-brewprogrammers available, but be aware that support

Page 159: Mind Performance Projects for the Evil Genius

may not be as good, and you may find that theymay support only a limited number ofmicrocontrollers. The STK500 shown in Figure13-2 is probably my favorite programming boardbecause it lets me program almost all the 8-bitAVR family, and I can do it right on thebreadboard or directly in circuit. Being able toquickly alter lines of code and see the resultsright away, in my opinion, is a far more usefuldebugging process than using a software-baseddebugger.

Figure 13-3 shows the Atmega88 in mybreadboard ready to be programmed. The fourwires coming in from the left go back to theSTK500 programming board, which is connectedto the serial port on my computer. To program thechip, I just press the “compile and program”button on the Basic compiler, and away it goesinto the Flash memory of the microcontroller.Once in the microcontroller’s memory, a programis there forever, although you can make as manychanges as you like. To program a PicMicrodevice, I have to remove the chip from my

breadboard and place it in the programmer’sonboard socket, a process that is fine as long asyou don’t plan on making a lot of changes toyour code. Of course, there are in-circuitprogrammers available for PicMicro devices aswell, but I have not used them myself.

Although I work mainly with assembly thesedays, I must admit that you can get a lot done ina very short time using Basic, and Bascom AVRis a really nicely done compiler with a rich set ofcommands and support for most 8-bit AVRdevices. Figure 13-4 shows the Bascom AVR setto compile the lucid-dream-mask controllerprogram in the Atmega88 device. Of course,when optimal speed and code size matter,assembly will kick Basic and C right out thedoor. For rapid prototyping and experimentation,it’s hard to beat the ease and speed at which aprogram can be created using a high-levellanguage. Since our dream-mask program is onlyreading a simple input and then running acounter, speed and code size are of no concern,so Basic is a good choice.

144

Project 13. Lucid-Dream-Mask Controller

Figure 13-2 Programming the AVR in circuit.

Page 160: Mind Performance Projects for the Evil Genius

Now let’s look through both versions of theprogram code so that you can see what happensinside the microcontroller. We will start with theinfrared phototransistor–based version firstbecause it was presented first in this section.Also, since much of the code is the same in bothversions, this one will be explained in moredetail.

Have a read through the complete Basic sourcecode of Listing 13-1 provided in the appendix sothat you can get an idea of what the code isdoing. If you are an experienced programmer,then this trivial code is probably something youcould write in 15 minutes from scratch, but if youhave never written a program in your life, not to

145

Project 13. Lucid-Dream-Mask Controller

Figure 13-3 Connecting the in-circuit programminglines.

Figure 13-4 Using Bascom AVR to compile my program code.

Page 161: Mind Performance Projects for the Evil Genius

146

Project 13. Lucid-Dream-Mask Controller

worry because Basic is called that for a reasonand is easy to understand. The lines in theprogram listing that start with an apostrophe arecomments, and I will explain the code in blocksafter each comment.

The code following this comment is required totell Bascom that we are going to target theAtmega88 device and that our clock will be anexternal crystal resonator running at 4 MHz.Telling the compiler your clock speed becomesimportant when using commands that deal withtiming-sensitive routines such as serialtransmission or analog-to-digital readings.Defining the device also helps the compiler togenerate user errors that have to do with IO pins.In this way, you can’t accidentally try to togglean IO pin that does not exist on the actual device.

Basic uses variables, which are letters or wordsused to hold values. I like to use single letterssuch as A, B, and C for simple programs like thisone, but when you are working on a large,complex program, use of more descriptivevariable names is recommended. TIMER2 andREDLED1, for example, are descriptive variablenames that make a lot more sense in a huge blockof code. Variables also are defined as the numberof bits they are to contain, so in our code, “A”

and “B” are 16-bit “words,” which can contain avalue of between 0 and 65535. Variable “C” is aninteger that can range in value from –32768 to+32767. Variables “D” and “E” will only containvalues from 0 to 255, so they are bytes. Althoughyou could just define all variables using largerdata types, this is a waste of memory space andwill slow down your code.

The “Start Adc” command tells the compiler toinclude the code necessary to set up and initiatethe onboard analog-to-digital converter on theAtmega88. This will allow us to read in an analogvoltage and convert it into a value in order to testthe state of the phototransistor on the dreammask.

Everything from here on is going to happencontinually until the word “Loop” is reached,which causes program execution to start againwhere it first encountered the word “Do.” This iscalled an endless loop because it never stopsunless forced to by another command or an error.

This command reads the analog-to-digitalconverter (ADC) on pin 5 of the Atmega88 intovariable “A,” which is where the output from thephototransistor is connected. Since the ADC

' DEFINE TARGET = MEGA88 @ 4MHZ

$regfile = "M88def.dat"

$crystal = 4000000

' DEFINE VARIABLES

Dim A As Word

Dim B As Word

Dim C As Integer

Dim D As Byte

Dim E As Byte

' START ADC RUNNING

Start Adc

' READ ADC VALUE

A = Getadc(5)

' ********** MAIN LOOP **********

Main:

Do

Page 162: Mind Performance Projects for the Evil Genius

returns a 10-bit reading, values can range from 0to 1024, which is why variable “A” needed to bea “Word,” not a byte.

These next two lines compare the current ADC reading “A” with the last known reading“B” by subtracting them. The “Abs(C)” command changes the value in “C” to an absolutenonnegative value, so we get the difference onlyas a whole number, not a negative number, if “B”is greater than “A.”

This line checks to see if the value in variable“C” is greater than 2. If it is, then all codefollowing the “Then” statement will be executed.If it is not, then the program will skip ahead untilif find a line the reads “End If.” In this way, thecounter processing code to follow will not rununless the reading on the ADC has changed by avalue of at least three out of a possible 1024values. Thus, if you want to reduce the sensitivityof your dream mask, just increase this number.

If there is an LED connected to pin 14 (Portb.0)of the Atmega88, it will blink for 200 ms once achange of greater than 2 has been detected fromthe ADC. The “Waitms” command simply delayscode execution for any number of milliseconds, sothe LED goes on for 200 ms and then goes offand waits for another 200 ms. Writing a 1 to aport sends VCC to the port, whereas writing a 0 tothe port clears it to ground.

“D” is a variable that will hold a counter thatcounts the number of times the ADC has detecteda change. Since we don’t want the dream masksignaling us every time we twitch an eye, we usea counter to keep track of eyelid detections sothat we can wait until they are happeningnonstop.

This block of code will execute only if thecounter variable “D” reaches 20 so that we canbasically filter out any spurious eye movements.

147

Project 13. Lucid-Dream-Mask Controller

' GET ADC CHANGE SINCE LAST

C = A - B

C = Abs(c)

' DETECT EYELID MOVEMENT

If C > 2 Then

' COUNT EYELID REM SIGNALS

D = D + 1

' FLASH TEST LED

Portb.0 = 1

Waitms 200

Portb.0 = 0

Waitms 200

' FLASH GOGGLE LED 100 TIMES AFTER20 REM SIGNALS

If D = 20 Then

Portb.3 = 1

For B = 1 To 100

Portb.1 = 1

Gosub Button

Waitms 400

Portb.1 = 0

Gosub Button

Waitms 400

Next

Page 163: Mind Performance Projects for the Evil Genius

148

Project 13. Lucid-Dream-Mask Controller

Once “D” reaches 20 counts, pin 15 (Portb.3) isturned on and off 100 times at a rate of 800 ms.Pin 15 is connected to the base of the LED divertransistor, so this will switch it on or off. Duringeach LED flash, the “Gosub Button” commandjumps to the button-handling routine just to makesure that we are not trying to reset the device incase this was a false detection owing to eyetwitching or an accidental wake-up from REMsleep. If you find that there are too many falsedetections, then just increase the number 20 tosomething higher. Also notice that “Portb.3=1”sets pin 17 to VCC, which is an auxiliary outputin case you want to connect some other device tothe unit.

After flashing the indicator LED in the dreammask 100 times, the program simply resets thevariables, turns off the auxiliary pin, and thenstarts over again from the beginning. If you haveanother REM episode, the program will againdetect it and flash the indicator LED in yourdream mask. The two “End If” lines close off theprevious two “Then” statements.

This line simply makes the variable “B” takeon the last value of the ADC so that when a newvalue is read for “A,” it then can be comparedwith the old value to see if it is different.

Again, the program calls the button-handlingroutine in case the user is pressing the reset/testbutton. “Loop” then sends the program back tothe “Do” statement so that the entire loop cancontinuously run.

This is the start of the button-press routine, andthe first line checks to see if the button is actuallypressed by reading pin 16 (Pinb.2); otherwise, itjust returns back to the calling line.

If there was a button press, some of thevariables are cleared, and “B” is set to 100, whichwill cause the LED flashing counter to end if itwas running, once the button-handling routine isover.

' RESET AND START OVER

Portb.3 = 0

D = 0

End If

End If

' RESET LAST ADC VALUE

B = A

' CHECK FOR BUTTON PRESS

Gosub Button

Loop

End

' ******** BUTTON PRESS ********

Button:

If Pinb.2 = 0 Then Return

' RESET SYSTEM

D = 0

B = 100

E = 0

' ENTER TEST MODE

While Pinb.2 = 1

Waitms 20

E = E + 1

Page 164: Mind Performance Projects for the Evil Genius

Because things happen in megahertz in amicrocontroller, we need to use counters anddelays to compute seconds. Variable “E”increments as the user holds down thepushbutton, and then the code delays for 20 ms.If the user holds the button down long enough for“E” to count up to 200, then the program assumestest mode because about 5 seconds have elapsed.The routine then jumps to the “Setup” label in thecode to run setup mode. If the button was notheld for at least 5 seconds, then the routine justends and returns back to where it was called.

This is the beginning of setup/test mode, and itis another endless loop.

Again, the program reads and compares thecurrent ADC value “A” against the last knownvalue “B” to see if there was a change of greaterthan 2 of 1024 values.

If an ADC comparison exceeds a value of 2,then this code block flashes the visible LED sothat the user can see the results directly as he orshe keeps his or her eyes closed and moves themback and forth. In this way, you can tell if thesystem is functioning properly or not in real time.

This block of code is much like the block ofcode that was used to enter setup mode. Thistime, if the user holds down the pushbutton for 5 seconds, the program exits setup mode andreturns to the main loop to go back to normaloperation.

Now you can see why Basic is great for rapidprototyping; the language is almost pure Englishand is so easy to work with. The completeaccelerometer version of this code, shown in

149

Project 13. Lucid-Dream-Mask Controller

If E = 200 Then

E = 0

Portb.0 = 1

Goto Setup

End If

Wend

Return

' ********* SETUP MODE *********

Setup:

Do

' GET ADC VALUE

A = Getadc(5)

C = A - B

C = Abs(c)

If C > 2 Then

' SETUP MODE LED FLASH

Portb.1 = 1

Waitms 50

Portb.1 = 0

Waitms 100

End If

B = A

' EXIT SETUP MODE

While Pinb.2 = 1

Waitms 10

E = E + 1

If E = 200 Then

Portb.0 = 0

E = 0

Goto Main

End If

Wend

Loop

Page 165: Mind Performance Projects for the Evil Genius

Listing 13-2 and provided in the appendix, isvery similar, and since there are only a fewchanges, I will just post the differences andexplain them.

Since there are no analog voltages to deal with,the ADC is not used this time, so the obviousdifference will be the exclusion of “Start Adc” inthe code.

Instead of reading the ADC value, we read pin5 as a digital input, but measure how long it takesfor it to go from high (VCC) to low (GND) andthen back to high again. The “Pulsein” commanddoes this for us automatically. This length isstored in the variable “A” just like the ADCreading was in the preceding version of the code.Because of this, most of the code can be reusedbecause we really don’t care what the value is butonly that it has changed since the last reading.

Of course, in setup mode, we also have toremove the ADC reading and replace it with the“Pulsesin” command, but other than that, the twoversions of the code are exactly the same.

There is a lot of room for further improvementsto this code and plenty of program space as wellas IO pins left on that microcontroller, so getcreative and add your own neat features andoptions. A much better REM-detection routinewould include a timeout counter so that ratherthan just counting eyelid movements, the counterresets after a few seconds if eyelid movementsstop. This would greatly reduce false detectionsfrom erroneous movements or eye twitches. Youalso could add a sound-alert system right into themicroprocessor using one or more of the outputpins to make beeps or complex noises or evenplay sound digitized from an external EEPROMmemory. The possibilities for modifications andimprovements are endless, but I only had somuch space to add code to this book, so the“bells and whistles” are up to you.

There is also an option to use a microcontrollerfor this project that will allow you to collect thedata into your PC for processing and analysis.There are many external ADC devices such as theone shown in Figure 13-5 that will read in ananalog value and then transmit it to your PCthrough the serial or USB port.

The unit shown in Figure 13-5 is the Pico ADCfrom Picotech, and it is a very accurate andinexpensive ADC that can be used with theincluded data logger or in your own programs.Drivers for this ADC are even included for VisualBasic, so you can write a program almost exactlythe same as the Atmega88 program to test yourdream mask. Of course, with a computer, youhave to run wires from the mask, but you open upa whole new bag of possibilities by using yourPC to trigger your dreaming mind. You could addsound files or connect LEDs, buzzers, or eventactile feedback hardware to your body for somevery interesting experiments. Of course, you willnow be plugged into the ac system, so again, therisk of a lightning hit or power surge is always

150

Project 13. Lucid-Dream-Mask Controller

' ********** MAIN LOOP **********

Main:

Do

' READ ADXL202 VALUE

Pulsein A , Pinc , 5 , 0

' ********* SETUP MODE *********

Setup:

Do

' GET ADXL VALUE

Pulsein A , Pinc , 5 , 0

C = A - B

C = Abs(c)

If C > 2 Then

Page 166: Mind Performance Projects for the Evil Genius

151

Project 13. Lucid-Dream-Mask Controller

there. There are many rf modules available thatcan transmit and receive data for short distances,so you might want to consider that option if youdecide to use your PC in your “sleep laboratory”at night.

Now you have a powerful tool to aid you inyour lucid-dreaming journeys, so have funexperimenting with it, and remember that thedream mask alone may not be enough to induce alucid dream. You need to practice proper dream-recall techniques and train yourself to do a realitytest anytime you see a bright light or flashinglight source in the real world. These could be carsignal lights, a video game screen, room lightsgoing on and off, and the like. Once you begin toautomatically ask yourself, “Am I dreaming?”each time you see a bright or flashing light, youeventually will begin to do the same in REMsleep as the mask flashes its visible LED for you.The instant you realize that you are indeeddreaming, you can become an oneironaut andtake control of your dream world!

Remember the waking reality tester presentedearlier in this chapter? Well, why not remove thevibrating motor and modify it to flash a brightLED instead? The unit then could be placed nearyour workstation and help you get into theroutine of seeing the flashing light signs, as wellas remind you to question your reality at thesame time.

There are many more techniques you can useto help your dreaming mind into a lucid state, sohave fun, be patient, and dig around on theInternet for more information if you enjoy thissubject; there is a lot of great information outthere. Maybe I will see you in a dream someday.Oh wait, that’s an entirely different “fringescience” for another time! In Section Three wewill go on an inward journey using meditation,clairvoyance, hypnosis, and color-therapydevices.

Figure 13-5 An external ADC for your PC.

Page 167: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 168: Mind Performance Projects for the Evil Genius

This section explores the amazing biological computer that we all carry around withus, our brain! Unlike the art of hacking a computer, you can’t simply jack a few

wires onto the CPU or alter the program code that makes us who we are, well at leastnot in any safe manner, so we will explore a few interesting methods that will allow usto “talk” to parts of the brain associated with varying levels of consciousness. Plugging ajack into the back of your spine in order to enter a large virtual world like Neo did in theMatrix is something that will certainly be a reality some day, but for now we must workwith the simple, nonevasive tools we have available, and become pioneers in thisinteresting field. Who knows, maybe one day you will be the one to develop thetechnology that will allow us to project our consciousness into a virtual world! Ofcourse, we have to start with the basics, so get out your soldering iron, and let’s havesome fun!

An Inward Journey

Section Three

Page 169: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 170: Mind Performance Projects for the Evil Genius

In the 1930s, Wolfgang Metzger, a Germanpsychologist, found that if the eyes are deprivedof any focal point or depth of field, the brainbasically “disconnects” from the visual system,causing a drastic change in our mental state. The word Ganzfeld is German for “completefield” and has been the subject of muchinvestigation into meditation, hypnosis, and evenparapsychology, which includes telepathy. Somereports suggest that the use of a Ganzfeld effectdevice can bring about the same mental state asachieved by those who have practiced meditationfor years.

The Ganzfeld effect is also the same effectreported by those who have experienced snow blindness, which often leads to strangehallucinations and a general altered state ofconsciousness. Some of the most profoundresearch into the Ganzfeld effect was in the area of telepathy, where it has been shown thatusing a Ganzfeld device can greatly enhance the probability of a successful telepathictransmission. In these experiments, a “receiver” isoften in a secluded room using a Ganzfeld device(such as the one that will be presented here) andis allowed to relax for some time so that sensorydeprivation occurs. The “sender” then mentallyfocuses on some random image and attempts tosend it telepathically to the receiver. Typically,

the average “hit rate” of such an experimentwould be around 25 percent, but by using theGanzfeld device, this rate was shown to be over35 percent much of the time, even by someresearches who do not consider telepathy to bepossible.

Since the Ganzfeld device is such a simplecontraption to build, why not conduct your own telepathy experiments, or just use the device to send yourself into an altered state ofconsciousness somewhere between waking realityand the dream world? All you will need for partsare a few Ping-Pong balls and a handful of redlight-emitting diodes (LEDs) to build this simpleproject.

The main component you will require is not asophisticated IC or a hard-to-find semiconductor,but just a pair of ordinary white Ping-Pong balls.Most of the research into the Ganzfeld effect wasdone using Ping-Pong ball halves placed over thesubject’s eyes and a red-light source to createeven lighting. The goal is to completely removeall points of reference from the subject’s field ofview so that the eyes cannot focus on anything,not even a change in brightness or color, which iswhy a light is usually used. In most of theexperiments, red light is used, but since the Ping-Pong balls are flat white on the inside, you canilluminate them with any color light, or just find

The Ganzfeld Effect

Project Fourteen

155

Page 171: Mind Performance Projects for the Evil Genius

a comfortable chair outdoors and use sunlight forillumination.

As for the Ping-Pong balls, there is nothingspecial about them, but you will need to find a setwith a logo on only one side, as shown in Figure14-1, so that you can cut them in half and use thefeatureless halves.

There will be an equator along thecircumference of the Ping-Pong ball dividing thelogo side from the blank side. Cut a slit on thelogo side as shown in Figure 14-2 using a steakknife or razor knife just large enough to insert thetip of a small pair of scissors. The smaller thescissors, the better because the plastic is very thin

156

Project 14. The Ganzfeld Effect Figure 14-1 Ping-Pong balls with a logo on only one side.

Figure 14-2 Cut a slit on the logo side of the equator.

Page 172: Mind Performance Projects for the Evil Genius

and brittle, so you will want to make small cutsalong the edge of the seam to cut the ball evenly.

Try to make small cuts using only the scissor’stip as you work your way around the equator, asshown in Figure 14-3. This will help to avoid thesharp sawblade edges that happen if the cutbecomes misaligned. You also could cut aroundthe ball with a Dremel tool if you have the tinygrinder disk attachment.

Try placing the ball halves over your eyes tosee how they fit. I found there to be a tiny gapnear the sides of my head where the edges didnot conform to the shape of my face, and thiswould greatly reduce the effectiveness of thesensory-deprivation experiments. The goal is tosee nothing that you can focus on, so you mayhave to cut a small slice out of each side of theball halves as shown in Figure 14-4 to help keepout any stray light or viewable edges.

I cut a bit out of the nonusable ball half just tosee what shape would work best for conformingto my face and then used a marker to trace it ontothe good halves so that they could be cut. Asshown in Figure 14-4, this required taking an arc

about half an inch into each edge so that the ballhalves made a better seal with my face. You mayfind that this is not necessary, but you shouldn’thave to press down on the balls to create a goodfit because this would hamper your ability torelax during the experimentation.

The schematic shown in Figure 14-5 is a guidethat you can use to figure out how to run multipleLEDs from a single 9-V battery without the needof a regulator. All you have to do is divide yoursource voltage (9 V in this case) by the ratedvoltage of your LEDs (2.3 V in my case). Thus,since 9 divided by 2.3 is 3.9, I can safely run fourLEDs in series, which will give each one 2.25 V.It’s always better to be slightly lower than therated maximum than slightly higher if you wantyour LEDs to enjoy a long, healthy life. Noticethat for each series arm, I have four LEDs alsowired in parallel. You can have as many LEDs asyou want in parallel as long as your power sourcecan handle the current draw. To sum up, then,series wiring divides the voltage by the numberof LEDs in series, and parallel wiring increasescurrent draw by the number of LEDs in parallel.In my configuration, I used four LEDs in series

157

Project 14. The Ganzfeld Effect

Figure 14-3 Cutting the ball along the seam.

Page 173: Mind Performance Projects for the Evil Genius

with four parallel legs so that there were eightLEDs for each eye—16 in total.

The series and parallel LED configurations areshown on the breadboard in Figure 14-6 as I

tested the brightness using a 9-V battery.Remember, when adding LEDs in series, it’s bestto end up under the maximum voltage thanslightly over because many LEDs cannot tolerateovervoltage. Also, you may need fewer than eightLEDs for each eye if you can find a morediffused lens style. The ones I used were theultrabright type and were highly focused to anarrow field of view, which is why they requiredfurther diffusing to avoid hot spots.

If your LEDs are highly focused and verybright, then they may cast hot spots and shadowson your eyepieces when in use. The best way tofind this out is to just light them up and placethem about 4 to 6 in above your eyes while youwear the Ganzfeld eyepieces. You want a brightlight source, but not one that will create spots thatyou can focus on. To filter out the hot spots, justcut up another pair of Ping-Pong balls and placethem a few inches above the LED cluster todiffuse the light. Figure 14-7 shows the diffuserin action, and although the figure shows obviouslight and dark areas, these were not visible whilewearing the eyepieces and are mainly due to theway the camera took the photograph. White

158

Project 14. The Ganzfeld Effect

Figure 14-4 Shaping the ball halves to conform to your face.

Figure 14-5 Parallel and series LED wiring.

Page 174: Mind Performance Projects for the Evil Genius

159

Project 14. The Ganzfeld Effect

Figure 14-6 Testing the parallel and series LED hookups.

Figure 14-7 Diffusing the LEDs to avoid hot spots.

Page 175: Mind Performance Projects for the Evil Genius

160

Project 14. The Ganzfeld Effect

Styrofoam and even a sheet of white paper alsowill work well as an LED diffuser.

Once you have figured out how many LEDs youwill need, they can be mounted to a bit of perfboard for later installation into a mounting tube ofsome type. Figure 14-8 shows my dual LEDclusters after following the same wiring scheme

used on the breadboard when testing them. In caseyou do not already know, LED polarity can beidentified either by the longer lead (positive) or bythe flat part on the housing (negative). This cancome in handy if you have cut the leads short andfind that one or more of your LEDs fail to light upwhen power is applied.

Since I wanted to be able to place the two LEDlighting units over my head in various positionsas I wore the Ganzfeld eyepieces, some type ofhousing was needed that could attach to a tripodfor easy adjustment. I found a bit of PVC tubing,as shown in Figure 14-9, to fit the Ping-Pong ballhalves perfectly, and two lengths were cut at thecorrect focal length for optimal light diffusion. At5 in long, the LED light hits the inside of thePing-Pong ball diffuser at an optimal angle sothat no hot spots were present when pointing thelight over the Ganzfeld eyepieces.

As shown in Figure 14-10, both the ball halvesand the LED clusters were secured to the PVC

Figure 14-8 Soldering the LED clusters to a perfboard.

Figure 14-9 Making housing for the components.

Page 176: Mind Performance Projects for the Evil Genius

tube using a hot-glue gun. A hot-glue gun is oneof those “must have” tools for every electronicshobbyist and will create not only a secure bondbut also one that can be broken if needed.Remember to drill any holes you need for wiringor other mounting hardware into the PVC tubingbefore you glue everything together. BesidesPVC tubing, practically anything can be used toposition the diffuser over the LED clusters.Cardboard tubes, plastic boxes, or even an oldshampoo bottle washed out and dried thoroughlywould work just fine for this job.

To make a simple mounting system that wouldattach to a tripod for easy adjustment, I cut a 2-ftlength of PVC tubing as shown in Figure 14-11so the two LED units could be mounted on eitherside. The diameter of the PVC tube was perfectto allow the distance between the two LED unitsto be the optimal distance for my eyes. Using atripod to position the light source made it easy tofind a comfortable place to use the Ganzfeldsystem without worrying about setting up thehardware. The tripod allows height adjustmentsfrom 2 ft to over 6 ft off the ground.

The completed light source is shown mountedto a camera tripod in Figure 14-12, ready to usewith the Ganzfeld eyepieces. For extendedperiods of use, you may find it more convenientto use a 9-V direct-current (dc) adapter packrather than the battery because multiple LEDscan become power-hungry, especially the high-brightness types. I found that a fully charged 9-Vbattery would run my lighting system for aboutan hour before it began to fade, so that was okayfor short experiments where I did not plan to getinto any really deep altered states. If you intendto really “go deep,” then you most likely willhave to switch to a dc adapter.

Considering that there is not much in the wayof hardware to this project, it really does havesome profound effects on a person’s state ofconsciousness. Figure 14-13 is unfortunatelylacking in color, so you cannot see that the redglow from the LED lighting system was very rich as I attempted to reach higher levels ofconsciousness. If you are interested in meditationor hypnosis, then the Ganzfeld device can be apowerful aid in reaching a trancelike state.

161

Project 14. The Ganzfeld Effect

Figure 14-10 A hot-glue gun is an essential tool.

Page 177: Mind Performance Projects for the Evil Genius

162

Project 14. The Ganzfeld Effect

Figure 14-11 Adding a support tube for tripod mounting.

Figure 14-12 The completed tripod-mounted light source.

Page 178: Mind Performance Projects for the Evil Genius

Maybe you want to experiment with telekinesisor PSI, attempting to recreate some of the well-known experiments done using hardware almostidentical to what you have just built. How abouttrying some remote-viewing experiments? Aremote viewer is a person under a trancelike statewho can see a remote location as if viewing itthrough some type of invisible camera link. Thismay sound far out to you, but there must besomething to it because the U.S. and Russian

military have invested millions into remote-viewing research, often performing experimentswith Ganzfeld devices. Further reading on themilitary’s research can be found by searching forthe StarGate Project on the Internet.

Well, I do hope that you enjoy your alteredstates, and if you discover some untapped powerby accident, be sure to let me know. Oh, anddon’t use your new psychic tools and powers foranything too devious!

163

Project 14. The Ganzfeld Effect

Figure 14-13 Getting lost in a sensory-deprivation experiment.

Page 179: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 180: Mind Performance Projects for the Evil Genius

Depending on our mental state, our brain isconstantly oscillating at various frequency ranges.These oscillations, or brain waves, occur whennumerous groups of neurons become coherent intheir electrical activity. Alpha wave is the namegiven to the range of brain-wave oscillations thatfall between 7 and 12 Hz (cycles per second).Alpha waves are also known as Berger’s waves inmemory of Hans Berger, who made the firstknown electroencephalographic (EEG) recordingof a human subject.

Alpha waves are present when we are in arelaxed state, often with our eyes closed, andbring about a heightened feeling of well-being.Interestingly, the earth’s resonant frequency (alsoknown as the Schumann resonance) happens tofall within the alpha-wave frequency range at7.83 Hz. Some people have speculated that ourminds would be “in tune” with the earth at thisfrequency.

The device presented here will let you coverthe entire alpha-wave frequency range so that youcan find your “magic” frequency when trying torelax or meditate. The purpose of the alphameditation goggles is to coax your brain intosynchronicity with the alpha-wave frequency ofthe flashing LEDs in order to reach a veryrelaxed state in a short time.

Please note that flashing lights (and videogames) have been known to trigger epilepticseizures in a very small percentage of thepopulation who have a rare form of epilepsy thatseems to respond to external visual stimulus.Although extremely rare and only a risk to thosewho are known to have epilepsy or have not yetbeen diagnosed, it is worth noting this precautionbefore you build and use any device with brightflashing lights.

The schematic shown in Figure 15-1 will pulsethe two or more LEDs that will be mounted toyour goggles or mask. The 555 timer IC isworking as an oscillator or pulse generator withits rate controllable via variable resistor VR1. Youalso can adjust the brightness of the LEDs bymoving variable resistor VR2 to control thevoltage to transistor Q1, which drives the LEDs.The working range of the oscillator can reachwell below and well above the alpha-wavefrequency, so you even could experiment with theother brain-wave groups as well, although alphawaves are the ones that are most useful inmeditation and relaxation.

The schematic is very simple, but it is always agood idea to try things out on your solderlessbreadboard before warming up the soldering iron.Figure 15-2 shows the oscillator running on abreadboard and powering two LEDs. I found that

Alpha Meditation Goggles

Project Fifteen

165

Page 181: Mind Performance Projects for the Evil Genius

166

Project 15. Alpha Meditation Goggles

Figure 15-1 The alpha meditation device schematic.

Figure 15-2 Building the circuit on a breadboard.

Page 182: Mind Performance Projects for the Evil Genius

six LEDs (three for each eye) were best with theones I was using because they could be set at alower brightness level and cover more area thatway. You will have to experiment with yourLEDs, but do make sure that they are all the samemake and model so that one side is not brighterthan the other. The circuit is designed to run at 3 V to make battery power easy, but the 555 timerIC would be happy all the way up to 12 V. Foroperation above 3 V, you certainly would need toadd resistors (150 � or more) in series with yourLEDs in order to reduce the current.

Since the oscillator has no readout, you willneed to use a frequency counter or oscilloscope toset the frequency into the alpha-wave rangebetween 7 and 12 Hz at least once before use.You could just set your oscillator for 10 Hz,which is basically in the center range orexperiment with the completed goggles and findyour preferred frequency or the one that makesyou feel most relaxed. For me, 10 Hz seemed towork just fine, but if you want the ability toadjust this at any time, then just make VR1

accessible as a control when you build the circuitinto a cabinet. You also can feed an extra pair ofwires out of pin 3 of the 555 timer and ground sothat your frequency counter always can beconnected when you want to know the actualworking frequency. Figure 15-3 shows my circuitoscillating at 10 Hz, as reported by my basicmultimeter.

There are many ways to get the light over youreyes, and using an old ski mask or a pair of swimgoggles is a good method. The alpha meditationsystem is not intended for long-term use, but youstill will want a setup that is comfortable and hasproper air circulation, so the goggle straps arebest replaced by loose elastic and should havesmall holes drilled in them to let the air flowfreely. I decided on using the small swim gogglesshown in Figure 15-4, and the straps were so longthat they were easy to adjust loosely. You alsomay have to experiment with the type andnumber of LEDs that work best over your eyes sothat you can achieve maximum light withouthaving the light source be so bright that it is

167

Project 15. Alpha Meditation Goggles

Figure 15-3 Finding your magic frequency.

Page 183: Mind Performance Projects for the Evil Genius

uncomfortable. Your eyes should feel saturatedwith light, but not so much that it feels like acamera flash going off in front of your face. Ifound that three LEDs in each eye were good,and I still had room to turn up the brightnessadjustment, if needed. A hot-glue gun is a handytool that can be used to mount almost anything toanything else, so that is how I intended to securethe LEDs to the goggle lens.

The number of LEDs, brightness, and color allwill have an effect on the way the light isdelivered through your closed eyes and the lens(if there is one) on your mounting system. RedLEDs will transmit more light through yourclosed eyelids than any other color because youreyelids act like a red filter when closed. Anycolor will certainly work, but red seems leastdistracting and natural, and since color therapy isnot part of this project, red seems like the mostlogical choice. Figure 15-5 shows the two smallthree-LED clusters made by soldering the threeLEDs in parallel to a small bit of perf board. Inthis circuit, all LEDs are in parallel, and you can

have as few as two or as many as your transistorcan source current to. As you exceed your drivertransistor’s capacities, the LEDs will become lessbright, and overheating of the transistor couldoccur. Of course, you could just use moretransistors to drive more LEDs, but be aware thatthis also will shorten the life span of a batterycharge.

Using the hot-glue gun, the LED clusters areaffixed to the center of the goggle’s lenses, asshown in Figure 15-6. Some goggles may nothave their lens centers over your eyes’ centers, sosome testing may need to be done first. If you puton the goggles and look into a mirror, you canmake a mark where the exact center for your eyeswill be and use that as a guide. A nice side effectof using the hot glue is that it creates a bit of adiffuser to help spread out the light evenly whenusing high-brightness and highly focused LEDs.This diffusing effect can be exploited further byfirst melting a blob of glue over the lens beforegluing the LED clusters down, further adding tothe diffusing effect.

168

Project 15. Alpha Meditation Goggles

Figure 15-4 Choosing LEDs and a mounting system.

Page 184: Mind Performance Projects for the Evil Genius

I decided to add a jack to the goggles, asshown in Figure 15-7, so that they could be usedfor other experimentation and connected to anydevice capable of driving them. A 1⁄8-inch monoheadphone-style jack simply was soldered rightto the small perf board, and a matching male plugwas added to the end of the wire coming from theoscillator unit.

The small circuit board, battery pack, switch,and variable resistor are mounted into a morepermanent home, as shown in Figure 15-8. Idecided to leave my system set for 10 Hz, sothere is only one cabinet-mounted variable

resistor, the one that controls LED brightness. Asmall trimpot variable resistor is added to theboard and preset to the desired frequency beforeplacing all the parts in the enclosure. If you planto experiment with frequency adjustment, thenjust add a second cabinet-mounted variableresistor.

With your alpha meditation goggles ready foruse (Figure 15-9), find a quiet and comfortableplace to lie down and reach the height of Zen!Okay, it may take you a bit of practice andpatience to reach that level of meditation, butsynchronizing your brain waves into the alphastate will surely help you along the way. If youare planning to use the system in a dark room,then let your eyes adjust for about 15 minutesbefore using the goggles so that you can set the brightness for your already-adjusted eyes. The light should be bright enough to feel“mesmerizing” but not so bright that it feelsuncomfortable in any way.

Looking like the cover of some cheesy sci-fimovie, Figure 15-10 demonstrates how our mind-hacking projects can be entertaining not only tothe user but also to the onlookers! Flooded in a

169

Project 15. Alpha Meditation Goggles

Figure 15-5 Choosing LED color and quantity.

Figure 15-6 Mounting the LEDs to the goggles.

Page 185: Mind Performance Projects for the Evil Genius

170

Project 15. Alpha Meditation Goggles

Figure 15-7 Wiring the LEDs for external access.

Figure 15-8 Putting together the oscillator unit.

Page 186: Mind Performance Projects for the Evil Genius

flickering pool of red light, I relax and drift into astate that feels much like a land between wakingreality and sleep, using the device to power napduring the day. The alpha meditation gogglescertainly do help when it comes to feelingrelaxed, and there is a definite feeling ofrelaxation after a bit of use.

Some other experiments you might want to trywith this device include the addition of sound to

the output, using two oscillators to drive each eyeindependently, or the addition of some type ofalternating color to the light source. Sound pulsescan be added simply by placing a set ofheadphones onto the output of the LED drivertransistor through a 1K resistor. Each time theLED pulses, a beat will be heard in theheadphones. In the next project, we willtranscend further to test our clairvoyanceabilities.

171

Project 15. Alpha Meditation Goggles

Figure 15-9 The completed alpha meditation goggles.

Figure 15-10 “Jacked” into a more relaxing state.

Page 187: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 188: Mind Performance Projects for the Evil Genius

Clairvoyance Tester

Project Sixteen

173

Some of us know at least one person who claimsto have some clairvoyance or an uncanny abilityto predict future events. Being of the “believenothing without proof” discipline, I decided tobuild a simple box that would allow my all-powerful psychic contacts to prove their worth or,as it seems more often, disprove their abilities!The word clairvoyance comes from seventeenth-century French and means clair = “clear” andvoyance = “visibility.” Those who are clairvoyantare said to possess some extrasensory ability tosee future events or visions before they actuallyoccur. To date, there has been no undisputableproof that anyone possesses this ability, and thepractice is not normally accepted by the generalscientific community.

This device allows your subject to use his orher amazing powers to “visualize” a numberbetween 0 and 9, enter it on an LED readout, andthen press a button to generate a completelyrandom result on another LED readout. If thesubject gets a match, then a third LED readoutadds a 1 to the current score. If the subject’sscore is already zero, then he or she just stays atzero score. Since there is a 1 in 10 chance thatthe subject’s guess will be correct, it is unlikelythat his or her score will be anything other thanzero or stay above a few points for any length oftime. If your subject is truly clairvoyant, then

surely this basic test will be easy for him or her,and the score should remain well above 3 after afew minutes of testing. Of course, this is almostimpossible, and anyone who can score anythingabove 1 on a regular basis is a truly amazingpsychic with unreal abilities.

The schematic for the clairvoyance tester,shown in Figure 16-1, does appear to have a lotof connections, and this is mainly due to thetriple seven-segment LED displays used to showthe guess, the result, and the score readouts.There are not enough pins on the small Atmega88microcontroller to connect all three LED displaysat once, so the three transistors (Q1, Q2, and Q3)switch between the three displays at such a fastrate that they all seem to be on at the same time.This time-sharing trick is how most LED displayswork when there are hundreds or thousands ofLEDs to control and only a limited number ofconnecting wires. There really is no limit to howmany seven-segment LEDs you can connect aslong as you have sufficient drive current andmicroprocessor speed and can spare the extra IOpin for each common connection. Other than theLED-display circuitry, the only other part of thiscircuit is the 4-MHz crystal resonator and the twopushbutton switches that allow the subject toselect a number and then run the randomizer.

Page 189: Mind Performance Projects for the Evil Genius

The seven-segment LED is a very common andinexpensive display that you are already familiarwith because it is used in everything from yourdigital clock to the panel of your microwaveoven. There are actually eight segments if youinclude the decimal point, but we don’t use it inthis application. These displays come as eitherstand-alone blocks or chained blocks containingmore than a single digit. Some LED displayseven have alphanumeric capabilities or multipledots so that they can make any characterimaginable. Figure 16-2 shows some of the LEDdisplays that I found in my junk box whenlooking for three identical digits for this project.LED displays are either common cathode orcommon anode, which means that either thepositive connections or the negative connectionsall go to a common point. It really does notmatter which type you use as long as you installthem in your circuit so that current is flowing inthe proper direction. The ones I am using have

part number HDSP-5501 and are basic greendisplays with a common anode, so the positiveconnections on all internal diodes are tiedtogether.

To use a common-cathode LED display in thiscircuit, you would have to tie the driver transistoremitters to ground and connect the commoncathode to the collector instead. Other than that,it is only for aesthetic purposes that all LEDdisplays should be the same.

There are a lot more wires to connect in thisproject, so a breadboard prototype is important toensure that the display shows the expectedresults, not some random hieroglyphics.

Figure 16-3 shows the schematic up andrunning with the triple-LED display reading“662,” the results of over 2 minutes ofclairvoyance testing. The first digit is my guess,and the second digit is the result of the random-number generator. The third digit is my score,

174

Project 16. Clairvoyance Tester

Figure 16-1 The clairvoyance tester schematic.

Page 190: Mind Performance Projects for the Evil Genius

175

Project 16. Clairvoyance Tester

Figure 16-2 Various segmented LED displays.

Figure 16-3 Breadboarding the clairvoyance tester.

Page 191: Mind Performance Projects for the Evil Genius

176

Project 16. Clairvoyance Tester

which is usually 0 for the most part, so I thoughtI should grab a photograph of the unit. On thenext two guesses, my score dropped back downto 0, so my belief that lotteries are a completewaste of time and money still holds strong.Notice the bank of seven current-limitingresistors to the left of the LED displays and thedriver transistors to the right. Ninety percent ofthe wiring and hardware is just for the LEDdisplays. I am also using a 7805 regulator to dropthe 9-V battery down to 5 V, although theAtmega88 also would run fine from only 3 Vsupplied by a pair of AA batteries. As you lowerthe voltage, you may need to alter the value ofthe current-limiting resistors if your LED displayis not bright enough. For 3-V operation, 500 �may be a better value than 1K.

If you have a bunch of LED displays andcannot locate a datasheet, then there is a simpleway to figure out the connections to all pins. Youwill need a 5-V supply to your breadboard, a 1Kresistor, and a few wires. Start by connecting the

first pin to the resistor and then to VCC. Nowtake a wire from GND and try all other points tosee if you get any segment to light up. If not,place the resistor to GND and the wire to VCCand then try again on all points. Keep movingalong all the pins until you find the common pinand its polarity.

To keep the cabinet size to a minimum, I brokethe circuit into two parts: the LED display perfboard and the microcontroller perf board, asshown in Figure 16-4. Once all the wires wereadded, I was able to fold the two perf boardstogether like a stack to reduce the amount ofspace needed inside the small black box. The topof the box will have a square cut to fit the LEDdisplay by cutting over a line using a very sharprazor knife. A notching tool is also great forcutting out square holes for displays and otherthings in a plastic or thin-metal box. With anotching tool, you just drill a hole at each cornerand then nibble your way across a line, takingone small bite at a time.

Figure 16-4 Deciding on a cabinet and board layout.

Page 192: Mind Performance Projects for the Evil Genius

177

Project 16. Clairvoyance Tester

The completed clairvoyance tester is shown inFigure 16-5 displaying what is probably myhighest score since building the unit. My originalguess was a 7, and I just pressed the “randomize”button three times, and by chance, it resulted in a7 each time. The odds of this happening are thesame as matching any number three times in arow and quite rare. It would be the same asthrowing a 10-sided die three times in a row andguessing the result each time before throwing. Ifa normal “nonclairvoyant” person were to usethis device all day long, the score would remainat 0 most of the time, with the odd spike up to 3or even 4 while “fluking out” once in a while. Ifyou can find a person who keeps his or her scoreabove 0 consistently, then please tell him or herto get ahold of me immediately because I willhave a lot of work for him or her to do, such aschoosing lottery numbers and reading the stockmarket. Anyone capable of beating the oddscertainly will be living a life of luxury and fame!

Now let’s look through the Basic source codethat will be compiled into the Atmega88microprocessor. There is also more informationregarding microcontrollers and programminglanguages in Section Two with the project called “Lucid-Dream-Mask Controller” in casethis is your first attempt at programming amicrocontroller. I will step through each block ofthe program code, which is shown in Listing 16-1.

Have a read through the complete Basic sourcecode of Listing 16-1 provided in the appendix sothat you can get an idea of what the code isdoing. If you are an experienced programmer,then this trivial code is probably something youcould write in 15 minutes from scratch, but if youhave never written a program in your life, not toworry because Basic is called that for a reasonand is easy to understand. The lines in theprogram listing that start with an apostrophe arecomments, and I will explain the code in blocksafter each comment.

Figure 16-5 Showing off my “impossible” score!

Page 193: Mind Performance Projects for the Evil Genius

The code following this comment is required to tell Bascom that we are going to target theAtmega88 device and that our clock will be anexternal crystal resonator running at 4 MHz.Telling the compiler your clock speed becomesimportant when using commands that deal with timing-sensitive routines such as serialtransmission or analog-to-digital readings.Defining the device also helps the compiler togenerate user errors that have to do withinput/output (IO) pins. In this way, you can’taccidentally try to toggle an IO pin that does notexist on the actual device. Critical timing is notan issue in this program, but speeds over 8 MHzmay make it difficult to press the buttons withoutadding to the delays.

This block of code sets up the pins that willconnect to the LED display (outputs) and to thetwo pushbuttons (inputs). You can change thesearound any way you like, but the way they arenow makes wiring a lot easier because there issome order to the IO pins.

Basic uses variables, which are letters or wordsused to hold values. I like to use single letterssuch as A, B, and C for simple programs such asthis one, but when you are working on a large,complex program, the use of more descriptivevariable names is recommended. “TIMER2” and“REDLED1,” for example, would be descriptivevariable names that make a lot more sense in ahuge block of code. Variables are also defined asthe number of bits they are to contain, so in ourcode, “A” and “B” are 16-bit “Words,” which cancontain a value between 0 and 65535. Variable“C” is an integer that can range in value from–32768 to +32767. Variables “D” and “E” willonly contain values from 0 to 255, so they arebytes. Although you could just define allvariables using larger data types, this is a wasteof memory space and will slow down your code.Also notice the odd variable name “___rseed”;this is a reserved name and has special meaningto Bascom. When you place a value in“___rseed,” you mix up the random-numbergenerator, which is important when dealing withsoftware-generated random numbers. By seedingthe random-number generator, you ensure that the

178

Project 16. Clairvoyance Tester

' DEFINE TARGET = MEGA88 @ 4MHZ

$regfile = "M88def.dat"

$crystal = 4000000

' CONFIGURE IO PORTS

Config Portd.0 = Output

Config Portd.1 = Output

Config Portd.2 = Output

Config Portd.3 = Output

Config Portd.4 = Output

Config Portd.6 = Output

Config Portd.7 = Output

Config Portb.3 = Output

Config Portb.4 = Output

Config Portb.5 = Output

Config Portb.1 = Input

Config Portb.2 = Input

' DEFINE VARIABLES

Dim ___rseed As Word

Dim Led(10) As Byte

Dim A As Byte

Dim B As Byte

Dim C As Byte

Dim D As Byte

Dim E As Byte

Dim F As Byte

Page 194: Mind Performance Projects for the Evil Genius

sequence will be random each time the programis run. Without this seeding, the same sequencesof numbers would be generated each time youpowered up the microcontroller. Although thisrandom-number generation is still not purelyrandom, it is certainly good enough for thisapplication.

This block of code sets up an array of 10values for the variable “LED.” Although this mayseem confusing at first, the values correspond towhich of the seven segments will be lit to displaya particular number. To make this a little moreconfusing, the value in parentheses is actually 1higher than the represented numerical value, andto light a segment, we want a low bit, not a highbit. Thus the value of “Led(9) = 0” says that todisplay the decimal number “8,” we want all bitsto be off. This means that all segments light up,and an “8” will be displayed. It can be a bit of achore computing these values by adding port bits,but after you have done it once for your segment,the hard work is completed.

Everything from here on will happencontinually until the word “Loop” is reached,which causes program execution to start againwhere it first encountered the word “Do.” This iscalled an endless loop because it never stopsunless forced to by another command or an error.

Here, we simply check to see if the user haspressed the “Randomize” button, which starts theroutine that flips through a bunch of numbers likea casino slot machine. Since the button inputs aretied to VCC through the 10K resistors, a value of0 means that a button is depressed. If a button ispressed, the code will jump to the “Roller”subroutine, which is discussed later.

This code block checks to see if the user pressedthe button that changes his or her “guess” numberand then increments the variable “A,” which isused to hold the number. If the value of “A” goesbeyond 9, then it is reset to 0 because the displaycan only draw single digits. Since microcontrollersare working in millions of instructions per second,this routine also does something called switchdebouncing so that the microsecond state between

179

Project 16. Clairvoyance Tester

' DEFINE LED DIGITS

Led(1) = 8

Led(2) = 187

Led(3) = 97

Led(4) = 49

Led(5) = 178

Led(6) = 52

Led(7) = 4

Led(8) = 185

Led(9) = 0

Led(10) = 48

' ********** MAIN LOOP **********

Main:

Do

' PRESSED RANDOMIZE BUTTON

If Pinb.1 = 0 Then

Gosub Roller

End If

' CHANGE GUESS BUTTON

If Pinb.2 = 0 Then

A = A + 1

If A = 10 Then A = 0

While Pinb.2 = 0

Gosub Ledshow

Wend

End If

Page 195: Mind Performance Projects for the Evil Genius

180

Project 16. Clairvoyance Tester

switch contact and noncontact is not read asmultiple presses. To debounce the switch, the codesimply calls the “Ledshow” routine as long as theuser is still holding the button down, whichactually creates a bit of a delay and avoids falsecontact readings. Anyone working withmicrocontrollers and switches is definitely familiarwith switch debouncing.

Here, the random-number generator getsanother seed number, which is just a rollingcounter, made of the word variable “___rseed.”This ensures that there is no way you will everlearn to read a pattern in the random-numbergenerator so that no one can trick this device.

Since the three LED displays need to berefreshed one at a time on the shared bus, thisroutine is called here each time the programloops, which is indefinitely. The “Ledshow”routine (discussed soon) ensures that somethingis always shown in the three LED displays.

The “Loop” command causes programexecution to jump back to the main routine wherethe command “Do” was encountered. This is theend of the infinite loop, and all other commandsbeyond here must be called by either “Goto” or“Gosub” commands.

This is the routine that displays a digit on eachof the three LED displays. A little trick calledpersistence of vision is used here to switchbetween displays so fast that your eyes think thatthey are all on at the same time. As you can see,only one bit of the three “Portb” pins is on at asingle time, and then the variables “A,” “B,” and“C” are sent to the display for only 2 ms each.Because 2 ms is so fast, it appears that eachdisplay is on all the time, and the seven-segmentlines can be shared, saving valuable IO overhead.Since Bascom array variables start at 1, not 0, theline “D = A + 1” adds one to the array pointer sothat the value in “Led(d)” is the same as thedecimal value we want. This conversion justmakes it easier to understand the code, especiallywhen trying to compute the segment bits from

' RANDOM SEED COUNTER

___rseed = ___rseed + 1

' DISPLAY DATA ON LEDS

Gosub Ledshow

' RESTART MAIN LOOP

Loop

End

' ****** LED DISPLAY ROUTINE ******

Ledshow:

Portb.5 = 1

Portb.4 = 0

Portb.3 = 0

D = A + 1

Portd = Led(d)

Waitms 2

Portb.5 = 0

Portb.4 = 1

Portb.3 = 0

D = B + 1

Portd = Led(d)

Waitms 2

Portb.5 = 0

Portb.4 = 0

Portb.3 = 1

D = C + 1

Portd = Led(d)

Waitms 2

Return

Page 196: Mind Performance Projects for the Evil Genius

scratch the first time. Once all three displays havebeen lighted for 2 ms each, this routine just“returns” to where it was originally called.

This is the routine that starts the slot-machine-style random-number generator that will displaythe random digit on the second LED display. Theline “For E = 1 To 50” indicates that the randomnumber will “roll” past 50 times, making a moreinteresting display, as if the device were actuallyrolling a die or spinning the mechanics in a slotmachine. Each time, the “Ledshow” routine iscalled another 10 times just to slow the display ofrandom numbers down enough to actually seethem go by.

After 50 random numbers flip past on thesecond LED display, this next block of code thenchecks to see if the “guess” displayed on the firstLED matches the latest random number displayedon the second LED. If there is a match (“If A =B”), the score variable “C” is incremented byone. If there is no match and the score is abovezero, it is decremented by one. The line “If C =255 Then C = 0” checks to make sure that thescore variable never goes below zero because avalue of 255 means that the byte variable haswrapped.

So this is how the Basic code works. A lot canbe accomplished in a very few lines using Basic,and since microcontrollers work at nanosecondspeeds, you have a lot of power at your fingertips.

Now you can weed out the false psychics fromthose who possess real clairvoyant powers! It hasbeen suggested that under the effect of theGanzfeld device presented earlier, extrasensoryperception (ESP) and clairvoyance may increasefor certain people, so this might be an interestingexperiment to try. Have your subject guess anumber, and then enter it on the clairvoyancetester for him or her, each time letting themachine keep score while the subject meditates.Maybe you want to train your ESP so that youcan get the upper hand next time you play a dicegame? All you have to do is alter the codeslightly so that it displays only the digits 1 to 6,and your clairvoyance tester is now a dice-rollsimulator. It even would make a great decisionmaker or electronic dice roller for game night!

Have fun weeding out your false wizards andpsychics with this project. If you do findsomeone to be especially clairvoyant, then pleasetell them to get in contact with me for a jobinterview immediately. My phone number is . . .wait, let them guess it! Next, we will try our handat hypnosis.

181

Project 16. Clairvoyance Tester

' ***** RANDOM ROLL ROUTINE *****

Roller:

' RANDOMIZE RESULT

For E = 1 To 50

B = Rnd(10)

For F = 1 To 10

Gosub Ledshow

Next

Next

' ADJUST SCORE

If A = B Then

C = C + 1

Else

C = C - 1

End If

If C = 255 Then C = 0

Return

Page 197: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 198: Mind Performance Projects for the Evil Genius

When I began to research hypnosis in order tocome up with a nice single-paragraph descriptionof what it is all about, I discovered that there iscurrently a huge amount of controversy as towhat the definition of hypnosis really is. Somepeople say that it is a trancelike sleep, whereasothers say the exact opposite, claiming that it ismore of a heightened conscious state. So ratherthan wave the flag and take sides, I will justconcentrate on the methods and devices used tohelp a hypnotist bring his or her subject underhypnosis and present an easy-to-build visualhypnosis aid that you can use to learn the artyourself.

Obviously, hypnosis is a very powerful toolthat can be used to help us with our innerproblems, break us from long-time habits, delveinto the subconscious, and unlock the mind inways not possible without it. Hypnosis, like allskills, can be learned by anyone willing to readthe literature, and you can even practice onyourself, exploring self-hypnosis. Of course, it ishighly unlikely that you will have your friendsunder your complete control by speaking the“secret phrase,” nor will you learn to mass-hypnotize a group of people into running aroundbarking like dogs because this is the stuff ofmovies and rehearsed magic!

This device will replace the classic pendulum,or “swinging watch,” that is so often shown inmovie scenes involving hypnosis. Often taken tothe extreme, the patient simply will fall into atrance as the doctor lets his or her watch swingback and forth in front of the patient’s eyes. Thisscenario is highly unlikely, but the use of afixation point to keep the mind focused duringhypnosis is a viable method of induction. Insteadof a swinging object, this device simulates aback-and-forth motion using six bright LEDs,allowing it to be used in a low-light room or inthe dark.

As shown in the schematic (Figure 17-1), thesix high-brightness LEDs are actually connectedto the 10 output lines of the 74HC4017 decadecounter (IC2). Since the goal is a back-and-forthmotion much like a swinging pendulum, thesequence counts as follows: 1, 2, 3, 4, 5, 6, 5, 4,3, 2 and then repeats, which is why we need 10sequential lines and six LEDs. The 4017 isclocked by the 555 timer (IC1), which can haveits rate controlled by adjusting the variableresistor (VR1). The range of speed is quite large,so you can create a nice, slow back-and-forthlight sequence or have the LEDs moving so fastthat they almost seem to flicker. The 10 diodesconnected to the outputs of the 4017 block

Visual Hypnosis Aid

Project Seventeen

183

Page 199: Mind Performance Projects for the Evil Genius

current from feeding back into the output pinswhen counting back over the last four digits toreverse the sequence. The resistors connected inseries with the LEDs are there to limit the currentdraw and can be replaced with a lower value ifyou want your LEDs to give off more light. Thereis a limit to how much current the 4017 cansource and how much your LEDs are going totolerate, so the values presented here are a goodstart. If, for some reason, you want extremelybright LEDs, you will have to drive them with atransistor rather than taking current directly fromthe outputs of the decade counter.

The visual hypnosis aid device is shownworking on the solderless breadboard in Figure17-2. The circuit is quite simple to build andtolerant of supply voltages from 3 to 12 V,although you may have to adjust the current-limiting resistors to set the optimal brightness foryour LEDs. The high-brightness type of LEDs

work best for this device, and they will allow youto project the light onto a wall or screen for easierviewing, as will be shown later. Color is totallyup to you, and there are many ultrabright LEDsavailable in all colors and white. A single 9-Vbattery is used to supply power because this wasthe most convenient setup.

The circuit was transferred from thebreadboard to a small perf board, as shown inFigure 17-3, after deciding on what type of LEDswould work best. This LED sequencer is a coolgadget that can be used for all kinds of displaypurposes, such as electronic props, computer casemods, or anything that would look better with alittle light show. If you want to use more that sixLEDs, you can double them up in parallel, but inthe end, you still will only have 10 steps and mayend up needing a driver transistor for each step tohandle the extra current.

184

Project 17. Visual Hypnosis Aid

Figure 17-1 Visual hypnosis aid schematic.

Page 200: Mind Performance Projects for the Evil Genius

185

Project 17. Visual Hypnosis Aid

Figure 17-2 Breadboarding the circuit to test the LEDs.

Figure 17-3 The LED sequencer circuit ready to run.

Page 201: Mind Performance Projects for the Evil Genius

There are numerous configurations this devicecan take, and it really depends on how you wantto deliver the light to your subject’s eyes. Thedistance between each LED and the focal rangeof the LEDs will affect how far away the unit canbe from your subject. I found that a spacing of nomore than 1 in between the LEDs was fine, andanything beyond that began to ruin the smoothback-and-forth effect of the unit. To place theLEDs at a greater distance apart so that thedevice will work when it is placed farther fromyour subject, you will need some type ofdiffusing lens to spread out and smooth the beamfrom the high-brightness LEDs. Figure 17-4shows the all-in-one configuration I used for myvisual hypnosis aid. The spacing between LEDsis about 1 in.

Although the single boxed unit worked well ina dark room if placed about 2 ft from my eyes, Iwanted the ability to experiment on more thanone subject at a time, so I came up with a simplemethod that would expand the size of the displayby projecting the light onto a diffuser screen. This

setup allowed viewing of the hypnosis aid from amuch greater distance and by many people at thesame time. Depending on the brightness and focallength of your LEDs, you may be able to projectthem several inches or even several feet. Tryaiming your device at a light-colored wall in adark room to see what you get. My LEDs had theability to project their light on a wall almost 4 ftaway, so my goal of a 10-in screen certainly waswithin reach. Figure 17-5 shows how I made abasic frame for a white-paper screen by bendinga coat hanger with a pair of pliers.

To project the light evenly to the screen in frontof the LEDs, I had to drill the mounting holes abit larger and then angle them slightly in oppositedirections, starting from the center two LEDs. Ahot-glue gun was used to hold the LEDs in placeso that they would beam outward, as shown inFigure 17-6, while projecting to the paperdiffuser screen. I also mounted the cabinet on atripod so that it could be positioned easily in aroom at any height and angle for easy viewing.

186

Project 17. Visual Hypnosis Aid

Figure 17-4 Completed visual hypnosis aid unit.

Page 202: Mind Performance Projects for the Evil Genius

187

Project 17. Visual Hypnosis Aid

Figure 17-5 A simple frame for a diffuser screen.

Figure 17-6 Diffuser screen lit by the LEDs.

Page 203: Mind Performance Projects for the Evil Genius

Now all you have to do is a little reading onhypnosis techniques and find someone willing tofall under your newfound powers. Hypnosis isreally all about trust and belief, so don’t expectmuch of a result from those who think theycannot by hypnotized because chances are theycan’t. You can always dig into self-hypnosis andnever have to look for a willing participant! Someexperiments you might want to try include setting

the sequencer to a frequency in the alpha-waveband, changing the LED colors, or even taking aline out of one of the 4017 pins and feeding anexternal device to produce synchronized sound ormore light. Have fun with this device, and if youmanage to acquire hypnotic powers like Reveen,remember to be nice to your “zombies”!

188

Project 17. Visual Hypnosis Aid

Page 204: Mind Performance Projects for the Evil Genius

Color therapy, also known as chromatherapy andcolorology, is the process of balancing one’s bodyand mind using color and light. As with manyalternative medicines, color therapy is believed tobe viable by some and is cast into the pit ofpseudoscience by others. Color therapy has veryold roots that go back thousands of years to theancient Egyptians, who used giant solariums andcolored-glass filter lenses to change the color ofsunlight. On a more modern note, in the early1920s, Swiss psychotherapist Max Luscherdeveloped a well-known test using color thatmeasures a person’s psychophysical state basedon the subject’s color choices.

The power for color to evoke certain moodsand responses is certainly undeniable, andadvertisers have known this for decades. Haveyou ever noticed how many restaurant chainschoose orange and yellow? How about financialinstitutes or other organizations that want yourtrust? They prefer to draw their presence in blueor magenta. There are reasons for many of thecommon color choices. The following is just asmall sampling of colors and their acceptedmeanings.

Red says, “Look out!” Obviously, it screamsout danger and commands attention. War,strength, love, desire, and passion are just someof the emotions that red represents. For this

reason, red is the perfect color for warning signs,emergency vehicles, or anything else that needsto command attention. Did you know that peoplewho own red sports cars pay more for theirinsurance? They are considered thrill seekersbecause of their color choices.

Orange is a happy color. Being a combinationof red and yellow, it stands out, but in a way thatdoes not say, “Look out!” Happiness, stimulation,and contentment are a few of the emotionsassociated with orange. Orange is the perfectcolor for a fast-food chain because it impliesinstant happiness. Orange also has been known toevoke feelings of hunger because it is alsoassociated with citrus and good food.

Yellow is the color of the sun, so it has awarming effect and evokes feelings of happinessand joy. Energy, well-being, cheerfulness, andintellect are some concepts that work well withthe color yellow.

Blue is the color of the sky and often isassociated with trust, stability, loyalty, confidence,and strength. Blue is used to represent financialinstitutions or any organization that wants toconvey its trustworthiness. Blue is also related totranquility, peace, and serenity. Blue is alsoconsidered a masculine color, especially thedarker shades. Blue also has the opposite effectthat orange does when it comes to our appetites,

Color-Therapy Device

Project Eighteen

189

Page 205: Mind Performance Projects for the Evil Genius

so there are not many fast-food chains using blueas the main color in their logos.

There are so many more examples of the linkbetween color and emotion that they probablywould double the size of this book. The realquestion is, Can color be used as a tool to healthe mind and change our mental state?

Using the simple device presented here, youcan make your own decisions about color therapyby performing your own experimentation. Usingonly two LEDs and a few variable resistors, youwill be able to generate any color that nature cangenerate in a controlled fashion.

An RGB LED is really just three separateLEDs in one small package. By placing the tinylight-emitting chips on one small base, youactually can mix the three colors together toproduce any possible color because an RGB LEDcontains a red, green, and blue LED. By adding avariable resistor to each color, you can vary theintensity of each primary color and createmillions of different colors exactly the same way

your computer monitor and television can. Youcan use an actual RGB LED or just find a set ofred, green, and blue LEDs with the same style oflens and use them to mix colors. Figure 18-1shows some of the possibilities I found in myjunk box, along with a $2 color candle thatactually contained an RGB LED inside. Thediscount-store color candle actually was the sameprice as the bare RGB LED and even came with abattery, so it pays to scrounge around the dollarstores for parts once and in a while.

An RGB LED looks like any ordinary LEDexcept that it will have four leads, not just two.There will be a common cathode or anode as wellas the three separate color leads. LEDs that havethree leads are only two-color LEDS. The insideof the dollar-store candle is shown in Figure 18-2,which reveals a typical clear-lens RGB LED thatis often sold for more than a dollar at anelectronics supply store. If you are shoppingaround for new RGB LEDS, try to find one withan opaque casing rather than the clear typebecause the clear LEDs need some kind of

190

Project 18. Color-Therapy Device

Figure 18-1 A few different types of RGB LEDs.

Page 206: Mind Performance Projects for the Evil Genius

diffuser to better mix the colors. Since there areactually three separate LEDs inside an RGBLED, there will be three distinct beams emittedwhen all the LEDs are lighted. Diffusing thethree LEDs makes the color mixing look muchmore convincing.

Another quirky thing about RGB LEDs is thateach color will have completely different currentand voltage requirements. Often the red LED willhave a much lower rated voltage and be made ofa different material than the green and blueLEDs. Since I decided to use the new store-bought RGB LEDs (bottom right of Figure 18-1),

I had a proper datasheet, which helped whenchoosing the current-limiting resistors. In mydevice, the red LED was rated for a maximum of2.5 V, whereas the green and blue LEDs had amaximum rating of 3.5 V. Testing this with asingle 1.5-V battery, it was obvious that the redLED was much too bright at the same voltage asthe green and blue LEDs. For this reason, thecurrent-limiting resistor on the red LED shown inthe schematic (Figure 18-3) is three times thevalue of its green and blue counterparts. Bytuning the current-limiting resistors to each LED,you then can control the brightness using threeidentical variable resistors so that they operate ina linear fashion when making up the endlesscolor possibilities. If all variable resistors are setto the same rotation, you will have some value ofwhite. Changing them to random positions willcreate every color possible.

The three current-limiting resistors shown in theschematic may not be the best values for yourRGB LED, so you may need to experiment a bit toget white out of your LEDs with all variableresistors turned up full. To play it safe, start with1K current-limiting resistors, and then look at thedatasheet for your LED. Red likely will have amuch lower operating voltage, so you can addresistors in series like I did until all three colorsseem to be the same brightness level (Figure 18-4).

191

Project 18. Color-Therapy Device

Figure 18-2 Inside the dollar-store candle.

Figure 18-3 Connecting the LEDs to a single power source.

Page 207: Mind Performance Projects for the Evil Genius

Place a piece of paper over the LED to create asimple diffusion screen when checking the levelsso that you can see a better color mix. If all colorsare outputting the same level of brightness, youshould see white.

Figure 18-5 shows the three small LEDscontained under the clear LED casing, which iswhy three separate beams will be emitted fromthe device. I am not sure why they are made likethis because it really defeats the entire purpose ofhaving an RGB LED, but there are ways we cansolve the problem and get a much better colormix. A simple way to diffuse your LED is to justsand down the casing until it is so rough that youcan’t see through it anymore. If you are luckyenough to find an RGB LED in a milky whitecasing, then you will not have this problem,although these seem hard to find for some strangereason. The good news is that you can make aperfect diffuser for your eyes using some Ping-Pong balls, as was done earlier in this section.

By placing half of a Ping-Pong ball or a pieceof white Styrofoam over the LED, you can reallydiffuse the three beams a lot better. Without thediffusing screen, it is almost impossible to seethat the colors are mixing, but by placing thePing-Pong ball half over the LED (Figure 18-6),a much better mixing of colors can be had. Whenthe camera took the photograph, it was still easyto see the three separate beams, although thecolor mixing was quite good when viewed byeye. For even more diffusion, some white foam orpaper slices can be placed inside the Ping-Pongball half to further scatter the light, although thiswill cost you in brightness.

If you plan to deliver the LED light to youreyes using a mask or some type of goggles, then aperfect diffuser tube can be made out of a pair offilm canisters and a pair of cut-in-half Ping-Pongballs. Place the Ping-Pong ball into the open endof the film canister, as shown in Figure 18-7, sothat the nonlogo side will be used. Trace aroundthe top of the canister so that you can cut out asegment of the ball that will fit perfectly back into

192

Project 18. Color-Therapy Device

Figure 18-4 Testing the brightness of the LEDs on a breadboard.

Page 208: Mind Performance Projects for the Evil Genius

193

Project 18. Color-Therapy Device

Figure 18-5 You can see the three small LEDs inside.

Figure 18-6 Better diffusion of the three colored beams.

Page 209: Mind Performance Projects for the Evil Genius

the canister. A pair of scissors with a sharp tip isbest for cutting the balls to avoid cracking thebrittle shell as you cut along your line.

The two Ping-Pong ball segments are affixed tothe open ends of the film canisters by hot gluingthem around the edges, as shown in Figure 18-8.If you find that your LED works best with a bitof white Styrofoam in front of the ball half, thendon’t forget to stuff it into the canister before youglue in the ball segments.

Since you won’t be wearing the goggles forextended periods, a pair of inexpensive swimgoggles will work just fine for this project onceyou loosen the straps so that they are not tootight. If you can’t find clear plastic goggles, thenyou will have to use a Dremel tool or solderingiron to cut or melt out the front lens so that thecolor of the light is not affected. My lenses wereclear and I also painted the inside using a blackmarker to block out any ambient light that mayenter from the sides. Figure 18-9 shows thediffuser tubes glued to the front of the goggles, aswell as the RGB LED stuck into a hole at theother end. This configuration worked very wellbecause the length of the film canister was almostperfect for the focal length of the LEDs. Thethree beams came very close together over thePing-Pong ball surface, which made for a goodmixing of colors.

The RGB LEDs also were hot glued to the filmcanisters once the leads were trimmed and thewires installed. If you plan to use the goggles onanother person or with some other type of LEDdriver, then you also might consider using aremovable plug to connect the goggles to thecontrol box. I just used a 6-ft length of four-

194

Project 18. Color-Therapy Device

Figure 18-7 Making a diffuser tube for the goggles.

Figure 18-8 Gluing the ball halves to the canisters.

Page 210: Mind Performance Projects for the Evil Genius

conductor wire to connect between the box andthe goggles because I was only using the color-therapy device on myself. Eventually, you run outof victims, I mean subjects, as your friends get toknow your strange “mad scientist” side!

The control box is just your three variableresistors, current-limiting resistors, and batterypack placed in a box, as shown in Figure 18-11.Although you probably don’t have to label thecontrols, it does help when you are not thesubject and are experimenting with your subject’s

195

Project 18. Color-Therapy Device

Figure 18-9 Diffuser tubes glued to the goggles.

Figure 18-10 The completed color-therapy goggles.

Page 211: Mind Performance Projects for the Evil Genius

reactions to the various colors. Since the circuitwill slowly drain the batteries even if the LEDsare turned right down, an on/off switch will benecessary. With a pair of AA batteries, this devicewill run for many days because the LEDs usevery little current. Another modification youmight want to consider is an input on the side ofthe control box to connect some external deviceto the LEDs. Some of the devices presentedearlier, such as the alpha meditation goggles andthe visual hypnosis aid, could be modified todrive the color-therapy goggles with little work.

Operating the color-therapy device is easy.Simply strap the goggles to your head (Figure 18-12), and play with the dials until you feelgreat. You need to have your eyes open for thecolor device to work because your eyelids are redand will only pass red light. I actually found thata few minutes of bright yellow each day didwonders to help beat those winter blues I oftenget when it’s –40°F outside and dark beforesuppertime. Even if you don’t believe in thewhole balanced mind and body aspect ofchromatherapy, there is no doubt that coloredlight will affect your moods, and this device has

some real merits. I tried the orange-lightexperiment to see if it would affect my hunger,but I cannot honestly say if it worked because thethought of eating was already in my mind when Idialed up the orange color.

For a nonbiased experiment on the variouscolors and their known responses, try the deviceon a willing subject who has no clue about whichcolors are for which emotions. If you search for“color therapy” or “chromatherapy” on theInternet, you will find many sites that link amultitude of colors to various emotionalresponses. Have fun, and enjoy the rainbow!

196

Project 18. Color-Therapy Device

Figure 18-11 The completed color-therapy control box.

Figure 18-12 Ah, yellow . . . a cure for the winterblues!

Page 212: Mind Performance Projects for the Evil Genius

This interesting device is based on research doneby Professor Heinrich Wilhelm Dove in 1839.Dove discovered an effect called binaural beatsin which the brain will hear a “beat” whenpresented with two slightly different independentaudio frequencies into each ear. This effect issimilar to what is heard when one tunes up aninstrument while using another sound source as areference. That unmistakable “wong, wong,wong, wong” sound as a guitar player tunes up astring is another example of the “beat” that canbe heard as two sound waves go in and out ofphase with each other. In the brain, somethingmore interesting happens if we are fed the twoslightly differing frequencies into each ear. It iscalled brain-wave entrainment.

Brain-wave entrainment also was the focus of a previous project in this chapter, the alphameditation goggles, although it is said that byusing binaural beats, the brain entrainment effectis much stronger. The general theory is that theresulting frequency of the binaural beat will coax the two brain hemispheres to becomesynchronized over time. By setting the oscillatorsso that their phase difference is somewherebetween 10 and 15 Hz, your brain willsubconsciously hear the alpha frequency andeventually fall into sync with it. The actualfrequency of the oscillators is much higher than

the resulting binaural beat, often in the range ofhundreds of hertz.

For example, if you wanted to entrain yourbrain to the frequency of 10 Hz, you could set theright-ear frequency to 315 Hz and the left-earfrequency to 325 Hz, resulting in a binaural-beatfrequency of 10 Hz. The various frequencies ofthe brain are named delta, theta, alpha, beta, andgamma. They have the frequencies and effects onconsciousness as follows.

Delta waves are frequencies less than 4 Hz.This means that there are only four cycles persecond, so this is a very low frequency. When themind is in the deepest stage of sleep, where thereare no dreams and the body is fully paralyzed,delta waves are prominent. It is probably notmuch use trying to entrain your brain to thisfrequency because you would have to traverse theother states of consciousness to reach this level.

Theta waves occur between 4 and 7 Hz,overlapping into the lower end of alpha waves.When your brain is running at the theta frequency,you are likely either dreaming or in a state of verydeep mediation. If you entrain your brain to thetheta state, the result likely will be that you fallasleep.

Alpha waves fall between 7 and 15 Hz.Entraining the brain to the alpha frequency is

Synchro Brain Machine

Project Nineteen

197

Page 213: Mind Performance Projects for the Evil Genius

usually the goal of entrainment because itprovides a person with pure relaxation withoutfalling asleep. At the lower end of the alpha scale,a person is just starting to cross the line betweendeep relaxation and sleep, so this is an interestingfrequency to experiment with. At the higher endof the alpha range, a person is fully conscious butfeeling very relaxed, so reaching this state a fewtimes a day can be a real benefit to the mind.

Beta waves occur between 15 and 40 Hz. Thisis the state of mind we are in while working orthinking. Your brain probably is working on somepart of the beta frequency range right now as youread this book, and it is the most common state ofmind during the day. Trying to entrain the brainto this frequency might not be much use becauseyou are probably already working on beta wavesif you are getting ideas about doing theseexperiments!

Gamma waves are the frequencies that occurabove 40 Hz. If your brain is in the gamma state,then you are really working your gray matterbecause this state of mind includes fear, difficultproblem solving, anxiety, and many other highermental activities. You might want to entrain yourbrain to the gamma frequency when trying towork out a very complex problem or right beforesome type of test that will push your mentalabilities to their limits. The gamma state iscertainly not a relaxing state, but it does have its uses.

One extremely interesting and rare state ofmind is called hypnagogic sleep paralysis, whichis an almost accidental state of sleep andconsciousness at the same time. If you have everbeen through a sleep-paralysis episode, then youknow what I mean when I say the experience canbe terrifying, especially if you have no idea whatis going on. You open your eyes, but your bodyfails to respond, although you have completecontrol over your eyes. Many people experiencesleep paralysis a few times during their lives,often just after falling asleep during the day froma needed nap. If you look up “sleep paralysis” onthe Internet, you will see that it is often related to

what people think are out-of-body experiences(OBEs), demonic possessions, and many otherpsychic phenomena.

I have had several controlled sleep-paralysisepisodes now and find the state of mind to beextremely interesting, almost like the “extremesport” version of sleep research! If you knowwhat to expect, the hallucinations and pureweightlessness feeling can be quite a wild ride. Ifound that using the synchro brain machine oreven the alpha meditation goggles set to the 6-Hzrange while trying to sleep during a quietafternoon was a good way to trigger a sleep-paralysis episode. Having no caffeine that day orother stimulants and being a bit on the tired sidealso were factors that improved the chances ofreaching this rare and almost mystical state. Finda quiet, comfortable place to lie on your back,and just try to clear your mind while using thebrain entrainment system. I must warn you,though, before you consider trying to purposelyput yourself in a hypnagogic state, read as muchas you can on sleep paralysis and lucid dreamingso that you know what you are about toencounter. Going through a session of sleepparalysis may be the strangest, scariest, and mostbizarre state of mind you have ever encountered,so be prepared! Okay, enough talk—let’s soldersome wires now!

The synchro brain machine is a pair ofindependently tunable audio oscillators that feedtheir outputs into the right and left sides of astereo headphone worn by the user. There are afew examples of commercial units available thathave many nice features included, such as adigital frequency readout, multiple waveforms,and even the ability to add white noise or mix thebinaural beat frequencies with some type ofexternal audio source. This extremely “barebones” version of the device actually will domost of this as well, although you will need touse your multimeter to see the digital frequencydisplay and some external audio source such asan MP3 player to mix in your music ormeditation media.

198

Project 19. Synchro Brain Machine

Page 214: Mind Performance Projects for the Evil Genius

Figure 19-1 shows the synchro brain machineschematic, and the two oscillators made from thetwo 555 timers (IC1 and IC2) can be seen clearly.The third IC (IC3) is an LM358 op amp that isworking as a simple comparator that will flash anLED each time the two audio frequencies crosseach other or become synchronous for a shortperiod. The resulting LED flash rate will be thesame binaural beat that your brain will hear when presented with the two different audiofrequencies. Each oscillator output is fed into theright and left sides of a stereo headphone jackand to an optional jack that will allow you tomonitor the frequency of each oscillator channel.To change the two oscillator frequencies, you justturn the variable resistors (VR1 and VR2) tosome frequency that is comfortable to listen to. It is the resulting binaural-beat frequency thatcounts, not the initial oscillator frequencies.

The breadboarded synchro brain machinecircuit is shown in Figure 19-2, running on a pairof AA batteries. By using AA or even AAAbatteries, you could build the entire unit into aheadphone casing or some very small box thatcould be affixed directly to the headphones,making a very portable device. I preferred theexternal box version so that I could have thefrequency adjustment controls near my handwhile relaxed. When you first power up the unit,the indicator LED probably will be steady untilyou tune both variable resistors to the exact samespot. When your oscillators are only slightly outof phase, you will see the LED flash very slowlyor several times per second. Listening to theoutput and tuning the controls as if you weretuning a guitar is another way to get theoscillators close to phase. As soon as you havethem outputting similar frequencies, you will hear

199

Project 19. Synchro Brain Machine

Figure 19-1 The synchro brain machine schematic.

Page 215: Mind Performance Projects for the Evil Genius

that “wong, wong, wong, wong” sound that I wasreferring to earlier. This is the binaural beat.

From my research into binaural beats, it seemsthat frequencies between 200 and 400 Hz areused most commonly because they are easy tolisten to compared with the very high or lowfrequencies. There is plenty of range in theoscillators to go well beyond or below 300 Hz, soyou can experiment with the frequencies you aremost comfortable with. Figure 19-3 shows thereadout on my basic multimeter, indicating thatthe left channel is set to 316 Hz. I have the rightchannel set to 306 Hz, which places the binaural-beat frequency at 10 Hz, right into the alpha-wave range.

If you built the circuit on a small enough pieceof perf board and use a pair of AAA batteries oreven a camera battery, you might be able to cramthe works inside a large set of headphones,making a nice all-in-one device. I wanted to addanother stereo jack to the unit so that I couldeasily attach my frequency counter or input anexternal audio source into the sound stream. Thus

I opted for the conventional black-box enclosureshown in Figure 19-4. Having the remotelylocated frequency control also was convenientwhen I was relaxing so I did not have to movemy arms to adjust the controls. I became so usedto the alpha frequencies I so often used that Icould set them without actually needing thedigital readout. This is the same skill a musicianuses when picking out a certain note or key.

Figure 19-5 shows my completed synchro brainmachine—the true source of my magical powersand psychic abilities! If you find the output of thedevice to be too loud or too quiet, then changethe values of R3 and R4 or replace them with apair of 1K variable resistors so that you can setthe volume to a level that you find mostcomfortable. If you plan to use the same basicfrequencies most of the time, then you even couldreplace the frequency-control variable resistorswith smaller potentiometers or have multiplepreset banks of potentiometers and a selectswitch to instantly choose a “program” that youhave preset. I preferred to simply listen to the

200

Project 19. Synchro Brain Machine

Figure 19-2 The synchro brain machine circuit.

Page 216: Mind Performance Projects for the Evil Genius

201

Project 19. Synchro Brain Machine

Figure 19-3 Displaying the frequency on a multimeter.

Figure 19-4 Boxing up the synchro brain machine circuit.

Page 217: Mind Performance Projects for the Evil Genius

202

Project 19. Synchro Brain Machine

output and set the controls to a base frequencyand beat frequency that felt right at the time.Some frequencies will just seem to feel right afteryou work with the device for some time. Maybethe brain learns to crave certain states much theway your mind craves certain tastes when thebody requires refueling.

Before you start experimenting with thisdevice, do a little Internet research on “binauralbeats” and “brain entrainment” so that you willunderstand the way the brain responds to thistechnology and how you can use it to yourbenefit. As with all things in the public domain,you will have to toss away the far ends of thedebate and look to the middle to learn anythinguseful. On one end of the scale, I have read that

brain entrainment is the path to completeenlightenment and psychic powers, and on theend, I have read reports of brain entrainmentbeing the most dangerous thing on earth. As atrue scientist, I will leave you to make your owndecisions based on actual research!

Some interesting modifications you might wantto consider include the addition of a lightstimulus such as the goggles presented in thealpha meditation section or the color-therapydevice. How about adding white noise or mixingthe binaural beats with some meditation or lucid-dream training media? There are so many waysyou can enhance this unit, so enjoy the journey,but be prepared for the unexpected!

Figure 19-5 The completed synchro brain machine.

Page 218: Mind Performance Projects for the Evil Genius

The electronics hobby is both entertaining andmind expanding, much like many of the devicespresented in this book. With only a handful ofinexpensive semiconductors and a breadboard,you can hack together just about any type ofdevice in your “evil genius” workshop in a fewevenings. Sure, there will be “bugs” and even theodd puff of smoke as you try out new designs,but as with all things, practice and patience willbring results.

Many of the projects presented here can bemixed and matched together to create entirelynew devices, and there is always room formodifications and improvements, so feel free tolet out your “crazy ideas” and try out newdesigns. When you want to further research acertain aspect of biofeedback or electronicdesign, the Internet is the ultimate source for freeand comprehensive information, and there aremany forums and user groups that you canbecome a part of.

When “plugging” yourself into any home-builtdevice, remember to consider the safety aspectsof your design, especially if there is a connectionbetween the hardware and some other appliance,such as a computer or an external power supply.It is also a good idea to have a clean bill of healthfrom your doctor before subjecting yourself toany type of sound- or light-pulsing device toreduce the risk of accidentally inducing healthissues such as an epileptic seizure. Although therisk of harm is extremely remote when messingaround with low-power projects running from asingle battery, safety first is always a good rule tofollow.

Have fun, and don’t be afraid to take your ideasfrom the drawing board to the circuit board. Youjust never know what you might invent bythinking outside the box!

Conclusion

203

Page 219: Mind Performance Projects for the Evil Genius

This page intentionally left blank

Page 220: Mind Performance Projects for the Evil Genius

Listing 3-1 Body temperature monitor source code

' DEFINE TARGET = MEGA88 @ 4MHZ$regfile = "M88def.dat"$crystal = 4000000

' CONFIGURE IO PORTSConfig Scl = Portb.2Config Sda = Portb.1Config Portd.0 = OutputConfig Portd.1 = OutputConfig Portd.2 = OutputConfig Portd.3 = OutputConfig Portd.4 = OutputConfig Portd.6 = OutputConfig Portd.7 = OutputConfig Portb.3 = OutputConfig Portb.4 = Output

' DEFINE VARIABLESDim Led(10) As ByteDim Msb As ByteDim Lsb As ByteDim A As ByteDim B As ByteDim C As Byte

Code Listings

Appendix

205

Page 221: Mind Performance Projects for the Evil Genius

' DEFINE LED DIGITSLed(1) = 8Led(2) = 187Led(3) = 97Led(4) = 49Led(5) = 178Led(6) = 52Led(7) = 4Led(8) = 185Led(9) = 0Led(10) = 48

' ********** MAIN LOOP **********Main:Do

' READ DS1621 TEMPERATUREI2cstartI2cwbyte &H90I2cwbyte &HEEI2cstopI2cstartI2cwbyte &H90I2cwbyte &HAAI2cstopI2cstartI2cwbyte &H91I2crbyte Msb , AckI2crbyte Lsb , NackI2cstop

' DISPLAY DATA ON LEDSA = Msb Mod 10B = Msb \ 10Gosub Ledshow

' RESTART MAIN LOOPLoopEnd

' ********** LED DISPLAY ROUTINE **********Ledshow:Portb.4 = 0Portb.3 = 1C = A + 1Portd = Led(c)

206

Code Listings

Page 222: Mind Performance Projects for the Evil Genius

Waitms 2Portb.4 = 1Portb.3 = 0C = B + 1Portd = Led(c)Waitms 2Return

Listing 5-1 The heart rate monitor Basic program

' DEFINE TARGET = MEGA88 @ 4MHZ$regfile = "M88def.dat"$crystal = 4000000

' CONFIGURE IO PORTSConfig Portd.0 = OutputConfig Portd.1 = OutputConfig Portd.2 = OutputConfig Portd.3 = OutputConfig Portd.4 = OutputConfig Portd.6 = OutputConfig Portd.7 = OutputConfig Portb.3 = OutputConfig Portb.4 = OutputConfig Portb.5 = OutputConfig Portb.2 = Output

' DEFINE VARIABLESDim Led(10) As ByteDim A As ByteDim B As ByteDim C As ByteDim D As WordDim E As WordDim F As IntegerDim G As WordDim H As WordDim J As IntegerDim K As Integer

Dim X As Byte

' DEFINE LED DIGITSLed(1) = 8

207

Code Listings

Page 223: Mind Performance Projects for the Evil Genius

Led(2) = 187Led(3) = 97Led(4) = 49Led(5) = 178Led(6) = 52Led(7) = 4Led(8) = 185Led(9) = 0Led(10) = 48

' SET DEFAULT HEART RATEK = 60

' START ADC RUNNINGStart Adc

' ********** MAIN LOOP **********Main:Do

' READ ADC VALUED = Getadc(0)

' GET ADC CHANGE SINCE LASTF = D - EF = Abs(f)E = D

' test bench 1 second = 164 clk'X = X + 1'F = 0'If X = 200 Then'X = 0'F = 10'End If

' HEART BEAT FILTERIf G > 0 Then G = G - 1If F > 4 And G = 0 Then G = 40

' HEART BEAT LED FLASHERIf G = 1 Then Portb.2 = 0If G = 20 Then Portb.2 = 1

' CALCULATE HEART RATE PER MINUTEH = H + 1

208

Code Listings

Page 224: Mind Performance Projects for the Evil Genius

If G = 1 ThenJ = 9840 / HH = 0End If

' SLOWLY ADJUST RUNNING AVERAGEIf G = 1 ThenIf K > J Then K = K - 1If K < J Then K = K + 1End If

' DISPLAY DATA ON LEDSIf K > 99 ThenC = K Mod 10B = K \ 10B = B Mod 10A = K \ 100End IfIf K < 100 ThenC = K Mod 10B = K \ 10A = 0End IfIf K < 10 ThenC = KB = 0A = 0End IfGosub Ledshow

' RESTART MAIN LOOPLoopEnd

' ********** LED DISPLAY ROUTINE **********Ledshow:Portb.5 = 1Portb.4 = 0Portb.3 = 0D = A + 1Portd = Led(d)Waitms 2Portb.5 = 0Portb.4 = 1Portb.3 = 0D = B + 1

209

Code Listings

Page 225: Mind Performance Projects for the Evil Genius

Portd = Led(d)Waitms 2Portb.5 = 0Portb.4 = 0Portb.3 = 1D = C + 1Portd = Led(d)Waitms 2Return

Listing 13-1 Optical sensor-based program code

' ********** DREAM MASK PHOTOTRANSISTOR VERSION **********' DEFINE TARGET = MEGA88 @ 4MHZ$regfile = "M88def.dat"$crystal = 4000000

' CONFIGURE IO PORTSConfig Portb.0 = OutputConfig Portb.1 = OutputConfig Portb.2 = InputConfig Portb.3 = Output

' DEFINE VARIABLESDim A As WordDim B As WordDim C As IntegerDim D As ByteDim E As Byte

' START ADC RUNNINGStart Adc

' ********** MAIN LOOP **********Main:Do

' READ ADC VALUEA = Getadc(5)

' GET ADC CHANGE SINCE LASTC = A - BC = Abs(c)

210

Code Listings

Page 226: Mind Performance Projects for the Evil Genius

' DETECT EYELID MOVEMENTIf C > 2 Then

' FLASH TEST LEDPortb.0 = 1Waitms 200Portb.0 = 0Waitms 200

' COUNT EYELID REM SIGNALSD = D + 1

' FLASH GOGGLE LED 100 TIMES AFTER 20 REM SIGNALSIf D = 20 ThenPortb.3 = 1For B = 1 To 100Portb.1 = 1Gosub ButtonWaitms 400Portb.1 = 0Gosub ButtonWaitms 400Next

' RESET AND START OVERPortb.3 = 0D = 0End IfEnd If

' RESET LAST ADC VALUEB = A

' CHECK FOR BUTTON PRESSGosub Button

LoopEnd

' ********** BUTTON PRESS **********Button:If Pinb.2 = 0 Then Return

' RESET SYSTEMD = 0B = 100

211

Code Listings

Page 227: Mind Performance Projects for the Evil Genius

E = 0

' ENTER TEST MODEWhile Pinb.2 = 1Waitms 20E = E + 1If E = 200 ThenE = 0Portb.0 = 1Goto SetupEnd IfWend

Return

' ********** SETUP MODE **********Setup:Do

' GET ADC VALUEA = Getadc(5)C = A - BC = Abs(c)If C > 2 Then

' SETUP MODE LED FLASHPortb.1 = 1Waitms 50Portb.1 = 0Waitms 100End IfB = A

' EXIT SETUP MODEWhile Pinb.2 = 1Waitms 10E = E + 1If E = 200 ThenPortb.0 = 0E = 0Goto MainEnd IfWend

Loop

212

Code Listings

Page 228: Mind Performance Projects for the Evil Genius

Listing 13-2 Accelerometer sensor–based program code

' ********** DREAM MASK ADXL202 VERSION **********' DEFINE TARGET = MEGA88 @ 4MHZ$regfile = "M88def.dat"$crystal = 4000000

' CONFIGURE IO PORTSConfig Portb.0 = OutputConfig Portb.1 = OutputConfig Portb.2 = InputConfig Portb.3 = Output

' DEFINE VARIABLESDim A As IntegerDim B As IntegerDim C As IntegerDim D As ByteDim E As Byte

' ********** MAIN LOOP **********Main:Do

' READ ADXL202 VALUEPulsein A , Pinc , 5 , 0

' GET ADXL CHANGE SINCE LASTC = A - BC = Abs(c)

' DETECT EYELID MOVEMENTIf C > 2 Then

' FLASH TEST LEDPortb.0 = 1Waitms 200Portb.0 = 0Waitms 200

' COUNT EYELID REM SIGNALSD = D + 1

' FLASH GOGGLE LED 100 TIMES AFTER 20 REM SIGNALS

213

Code Listings

Page 229: Mind Performance Projects for the Evil Genius

If D = 20 ThenPortb.3 = 1For B = 1 To 100Portb.1 = 1Gosub ButtonWaitms 400Portb.1 = 0Gosub ButtonWaitms 400Next

' RESET AND START OVERPortb.3 = 0D = 0End IfEnd If

' RESET LAST ADXL VALUEB = A

' CHECK FOR BUTTON PRESSGosub Button

LoopEnd

' ********** BUTTON PRESS **********Button:If Pinb.2 = 0 Then Return

' RESET SYSTEMD = 0B = 100E = 0

' ENTER TEST MODEWhile Pinb.2 = 1Waitms 20E = E + 1If E = 200 ThenE = 0Portb.0 = 1Goto SetupEnd IfWend

214

Code Listings

Page 230: Mind Performance Projects for the Evil Genius

Return

' ********** SETUP MODE **********Setup:Do

' GET ADXL VALUEPulsein A , Pinc , 5 , 0C = A - BC = Abs(c)If C > 2 Then

' SETUP MODE LED FLASHPortb.1 = 1Waitms 50Portb.1 = 0Waitms 100End IfB = A

' EXIT SETUP MODEWhile Pinb.2 = 1Waitms 10E = E + 1If E = 200 ThenPortb.0 = 0E = 0Goto MainEnd IfWend

Loop

Listing 16-1 The clairvoyance tester Basic source code

' DEFINE TARGET = MEGA88 @ 4MHZ$regfile = "M88def.dat"$crystal = 4000000

' CONFIGURE IO PORTSConfig Portd.0 = OutputConfig Portd.1 = OutputConfig Portd.2 = OutputConfig Portd.3 = Output

215

Code Listings

Page 231: Mind Performance Projects for the Evil Genius

Config Portd.4 = OutputConfig Portd.6 = OutputConfig Portd.7 = OutputConfig Portb.3 = OutputConfig Portb.4 = OutputConfig Portb.5 = OutputConfig Portb.1 = InputConfig Portb.2 = Input

' DEFINE VARIABLESDim ___rseed As WordDim Led(10) As ByteDim A As ByteDim B As ByteDim C As ByteDim D As ByteDim E As ByteDim F As Byte

' DEFINE LED DIGITSLed(1) = 8Led(2) = 187Led(3) = 97Led(4) = 49Led(5) = 178Led(6) = 52Led(7) = 4Led(8) = 185Led(9) = 0Led(10) = 48

' ********** MAIN LOOP **********Main:Do

' PRESSED RANDOMIZE BUTTONIf Pinb.1 = 0 ThenGosub RollerEnd If

' CHANGE GUESS BUTTONIf Pinb.2 = 0 ThenA = A + 1If A = 10 Then A = 0While Pinb.2 = 0Gosub Ledshow

216

Code Listings

Page 232: Mind Performance Projects for the Evil Genius

WendEnd If

' RANDOM SEED COUNTER___rseed = ___rseed + 1

' DISPLAY DATA ON LEDSGosub Ledshow

' RESTART MAIN LOOPLoopEnd

' ********** LED DISPLAY ROUTINE **********Ledshow:Portb.5 = 1Portb.4 = 0Portb.3 = 0D = A + 1Portd = Led(d)Waitms 2Portb.5 = 0Portb.4 = 1Portb.3 = 0D = B + 1Portd = Led(d)Waitms 2Portb.5 = 0Portb.4 = 0Portb.3 = 1D = C + 1Portd = Led(d)Waitms 2Return

' ********** RANDOM ROLL ROUTINE **********Roller:

' RANDOMIZE RESULTFor E = 1 To 50B = Rnd(10)For F = 1 To 10Gosub LedshowNextNext

217

Code Listings

Page 233: Mind Performance Projects for the Evil Genius

' ADJUST SCOREIf A = B ThenC = C + 1ElseC = C - 1End IfIf C = 255 Then C = 0Return

218

Code Listings

Page 234: Mind Performance Projects for the Evil Genius

ac (alternating current), 5accelerometers

light-sensing lucid-dream mask, 123, 131lucid-dream-mask controller, 141, 143,

149–150motion-sensing lucid-dream mask, 133–137

ADC (analog-to-digital converter), 75–76,146–151

alarm clockaudio dream director, 109–116dual system, 98hacked, 109

alarmsdigital, 111dual, 98silent, 114, 115water flood, 39

alpha meditation goggles, 165–171alpha waves, 96, 165, 167, 197–198altered consciousness. See also meditation; sleep

Ganzfeld effect, 155hallucinations, 155, 198hypnosis aid, 183–188synchro brain machine, 197–202

alternating current (ac), 5amplifiers, 59, 61–62, 64analog meters, 79–81, 83analog-to-digital converter (ADC), 75–76,

146–151

Atmega88 microcontroller, 124, 142–150, 173,176

audio. See soundaudio deprivation, 90audio dream director, 109–122audio oscillators, 31–39, 198audio recorders, 97, 110, 116–119audio recording software, 62–64AVR microcontrollers, 21, 124, 143–145

Bascom AVR, 55–58, 72, 144–146, 178base, 17Basic language

body temperature monitor, 55–58clairvoyance tester, 177–181heart rate monitor, 72–78light-sensing lucid-dream mask, 124lucid-dream-mask controller, 141, 142,

143–150variables, 56, 74, 146, 178, 180

Basic Stamp microprocessors, 124, 142batteries, 12–13Berger, Hans, 165Berger’s waves, 165beta waves, 97, 197, 198binaural beats, 197–202biofeedback circuit, 44biofeedback device, 31–39blindness, snow, 155

Index

219

Page 235: Mind Performance Projects for the Evil Genius

body probesbiofeedback device, 33–39heart rate monitor, 65lie detector, 71, 81–83

body responses. See also human bodyalpha waves, 96, 165, 167, 197–198beta waves, 97, 197, 198brain wave activity, 95–97, 165–169delta waves, 97, 197gamma waves, 198heart rate, 65–78lie detector, 79–85, 95during sleep, 96–97theta waves, 96, 97, 197

body temperature monitor, 51–58brain waves

activity, 95–97, 165–169alpha, 96, 165, 167, 197–198beta, 97, 197, 198binaural beats, 197–202delta, 97, 197gamma, 198heart rate, 65–78lie detector, 79–85, 95during sleep, 96–97theta, 96, 97, 197

brain-wave entrainment, 197–198, 202brain-wave oscillations, 165breadboard, 1–6, 26, 32–34breadboard circuits, 4, 6, 7, 43breadboard wires, 2–5breathing rate, 59buzzers, piezo

biofeedback device, 32motion-sensing lucid-dream mask, 135reaction speedometer, 43, 44, 49waking-reality tester, 101–106

C language, 143, 144cabinet-mounted variable resistors, 169capacitors, 4, 5, 12–15Category 5 (Cat5) wiring, 3–5ceramic capacitors, 5chromatherapy, 189–196circuit boards, 6–8

clairvoyance, 173clairvoyance tester, 173–181clock, alarm, 202code. See also Basic language

C language, 143, 144data types, 74, 146, 178debugging, 24, 25, 66, 76, 144variables, 56, 74, 146, 178, 180

collector, 17color

effect on mood/emotion, 189–190, 196intensity of, 190LED displays, 168, 169, 188, 190–196meanings of, 189–190mixing, 190–192RGB, 190–194

color therapy, 189–196colorology, 189–196color-therapy device, 189–196comparators, 199consciousness, altered. See also meditation; sleep

Ganzfeld effect, 155–163hallucinations, 155, 198hypnosis aid, 183–188synchro brain machine, 197–202

countersalpha meditation goggles, 167frequency, 167heart rate monitor, 76lucid-dream mask controller, 141, 147–148,

150motion-sensing lucid-dream mask, 134reaction speedometer, 41, 44running, 76, 134timeout, 156waking-reality tester, 101–102, 105

crosstalk, 5, 6crystal resonator, 173, 178

data types, 74, 146, 178datasheets, 16, 18, 19–20debugging, 24, 25, 66, 76, 144decoupling capacitors, 5delta waves, 97, 197demonic possessions, 198

220

Index

Page 236: Mind Performance Projects for the Evil Genius

diffused light, 158–161, 168, 186–195diffuser screen, 186–187diffuser tube, 192, 194, 195digital recorder, 97, 110, 116–119diodes, 15–16DIP (dual inline package) microcontroller, 136Dove, Heinrich Wilhelm, 197dream director, 109–122dream goggles, 123–139dream monitoring, 89–151. See also lucid

dreaming; sleep monitoring/aidsaudio dream director, 109–122heart rate, 65, 70, 78light-sensing lucid-dream mask, 123–132lucid-dream-mask controller, 141–151motion-sensing lucid-dream mask, 133–139NovaDreamer product, 123waking-reality tester, 101–108white noise generator, 89–94

dream recall, 97, 109dreams. See also sleep

directing content of, 109–122heart rate during, 65, 70, 78lucid. See lucid dreamingmonitoring. See dream monitoring“oneironaut,” 87, 124, 131, 132, 151overview, 87reality testing, 98–99, 101–108REM state, 95–97, 99, 114, 116triggers, 97

driver transistor, 184dual inline package (DIP) microcontroller, 136

earth resonant frequency, 165eavesdropping, prevention of, 89EDR (electrodermal response), 31–39EEG (electroencephalograph), 95, 96, 165EEPROM memory, 150electret microphone, 59–62electrodermal response (EDR), 31–39electroencephalograph (EEG), 95, 96, 165electronic building blocks, 6–9E-meter, 31emitters, 17, 52, 174endless loops, 57, 75, 77, 146, 179

epilepsy, 165epileptic seizures, 165eyelid movements

dreaming and, 96, 99light-sensing lucid-dream mask, 123–132lucid-dream-mask controller, 141–151motion-sensing lucid-dream mask,

133–139

farads, 14finger probes, 35–37. See also body probesflashing lights, 165frequency counters, 22, 167, 200. See also

countersfrequency meter, 37–39frequency range, 165full-wave rectifiers, 15

galvanic skin response (GSR), 31–39gamma state, 198gamma waves, 198Ganzfeld device, 155–163Ganzfeld effect, 155–163glue gun, 160–161GND (ground), 2, 150, 176goggles

alpha meditation, 165–171color-therapy device, 192, 194–196dream, 123–139swim, 127, 167, 194synchro brain machine, 202

ground (GND), 2, 150, 176GSR (galvanic skin response), 31–39

hallucinations, 155, 198headphone jack, 118, 120headphones

alpha meditation goggles, 169, 171audio dream director, 118, 120reaction speedometer, 49synchro brain machine, 198, 199, 200white noise generator, 89, 90, 93–94

Hearne, Keith, 95heart rate, 29, 65–78, 96heart rate monitor, 65–78

221

Index

Page 237: Mind Performance Projects for the Evil Genius

heat sinks, 16help, obtaining, 20–21hot-glue gun, 160–161, 168Hubbard, L. Ron, 31Hubbard electrometer, 31human body. See also body responses

biofeedback device, 31–39body temperature monitor, 51–58heart rate, 29, 65–78, 96lie detector, 79–85, 95probes. See body probesreaction speedometer, 41–49respiratory monitor, 59–64temperature, 51–58

human mindalpha meditation goggles, 165–171brain waves. See brain wavesGanzfeld effect, 155–163hallucinations, 155, 198hypnosis, 183–188meditation. See meditationmental states. See mental statespsychic phenomena, 198synchro brain machine, 197–202telepathy. See telepathy

hypnagogic sleep paralysis, 198hypnagogic state, 198hypnosis, 183, 188hypnosis aid, 183–188

ICs (integrated circuits), 2, 24, 25, 33infinite loops, 57, 75, 77, 146, 179infrared detectors, 125, 126infrared LEDs, 124–131infrared phototransistors, 123, 124–128, 141–147input/output (I/O) pins, 51integrated circuits (ICs), 2, 24, 25, 33

LaBerge, Stephen, 98, 123LDR (light-dependent resistor), 65–72, 75LED clusters, 160–161, 168LED diffuser, 160LED displays

alpha meditation goggles, 165, 167–171body temperature monitor, 51–52, 56–58

brightness levels, 184, 192clairvoyance tester, 173–181color, 168, 169, 188, 190–196common anode, 52, 174common cathode, 52, 174diffusing, 191, 192–195diodes, 15–16examples of, 174, 175heart rate monitor, 65–71, 74–77hypnosis aid, 183–188infrared, 124–131light-sensing lucid-dream mask, 124–131pin connections, 176reaction speedometer, 41–46, 49RGB LEDs, 190–194seven-segment, 51–52, 76, 78, 173testing, 143, 147, 184

LED flash rate, 102, 199LED polarity, 160LED sequencer, 184LED sequencer circuit, 185lie detector, 79–85, 95light

diffusion, 158–161, 168, 186–195flashing, 165projecting on screen, 186–187

light-dependent resistor (LDR), 65–72, 75light-emitting diodes. See LED entrieslight-sensing lucid-dream mask, 123–132loops, endless, 57, 75, 77, 146, 179lucid dreaming

audio dream director, 109–122controlling, 141–151described, 95dream recall, 97, 109increasing instances of, 97–99introduction to, 95–99light-sensing lucid-dream mask, 123–132MILD technique, 98motion-sensing lucid-dream mask, 133–139“oneironaut,” 87, 124, 131, 132, 151polygraphs, 95reality testing, 98–99, 101–108

lucid-dream-mask controller, 141–151Luscher, Max, 189

222

Index

Page 238: Mind Performance Projects for the Evil Genius

manuals, 19–20meditation. See also altered consciousness

alpha meditation goggles, 165–171Ganzfeld effect, 155–163synchro brain machine, 197–202

mental states. See also human mindbrain waves and, 165color and, 189–190, 196Ganzfeld effect, 155–163hallucinations, 155, 198hypnagogic state, 198

Metzger, Wolfgang, 1554-MHz crystal resonator, 173, 178microcontrollers

Atmega88, 124, 142–150, 173, 176AVR, 21, 124, 143–145body temperature monitor, 51–53, 58clairvoyance tester, 173, 176–181considerations, 22, 25dual inline package, 136heart rate monitor, 65, 66, 68, 72, 74–78light-sensing lucid-dream mask, 123–124, 128,

130, 131lucid-dream-mask controller, 141, 142–150PicMicro, 124, 143, 144respiratory monitor, 64

microphones, 59–62microprocessors, 55, 123, 124, 133, 138, 142MILD technique, 98mind, human

alpha meditation goggles, 165–171brain waves. See brain wavesGanzfeld effect, 155–163hallucinations, 155, 198hypnosis, 183–188meditation. See meditationmental states. See mental statespsychic phenomena, 198synchro brain machine, 197–202telepathy. See telepathy

mono jack, 114motion-sensing lucid-dream mask, 133–139motor reaction time, measuring, 41–49motors

audio dream director, 116, 118–119

as buzzers, 103–106waking reality tester, 102–106

MP3 decoders, 25MP3 players, 110, 116, 117, 198multimeters, 39, 201

nadir, 51noise. See also sound

capacitive, 5, 6eliminating with filters, 124, 125REM-detection routines and, 150white, 89–94, 198, 202

notching tool, 83–85, 176NovaDreamer product, 123NPN transistors, 17–18, 19, 33numbers, random, 178–179, 180

OBEs (out-of-body experiences), 198“oneironaut,” 87, 124, 131, 132, 151op amps, 59, 66–67, 124, 125, 199optical sensors, 72, 76, 128, 129, 146oscillators

alpha meditation goggles, 165, 167, 169–171audio, 31–39, 198synchro brain machine, 197, 198–200

oscilloscope, 76, 167out-of-body experiences (OBEs), 198output jack, 113, 114

pager motors, 103PCBs (printed-circuit boards), 2, 7, 8, 27, 28pendulum, 183perf board, 17, 26, 33–34, 44, 45persistence of vision, 58, 77, 180PGR (psychogalvanic reflex), 31–39photo sensors, 128, 141phototransistors, 123, 124–128, 141–147PicMicro microcontrollers, 124, 143, 144PicStart Plus, 143piezo buzzers

biofeedback device, 32motion-sensing lucid-dream mask, 135reaction speedometer, 43, 44, 49waking-reality tester, 101–106

pillow speakers, 109, 110, 120–121

223

Index

Page 239: Mind Performance Projects for the Evil Genius

PNP transistors, 17–18polarity, 13, 14, 61, 114, 160polygraph, 79–85, 95position detectors, 125, 126potentiometers, 11, 71–72, 200power (VCC), 2, 150, 176preamplifiers, 59, 61–62, 64printed-circuit boards (PCBs), 2, 7, 8, 27, 28probes, finger/body

biofeedback device, 33–39heart rate monitor, 65lie detector, 71, 81–83

programmingBasic. See Basic languageC language, 143, 144data types, 74, 146, 178debugging, 24, 25, 66, 76, 144variables, 56, 74, 146, 178, 180

psychic phenomenademonic possession, 198out-of-body experiences, 198telepathy. See telepathy

psychogalvanic reflex (PGR), 31–39pulse rate, 65, 66–72, 76pulse-width-modulation (PWM), 134, 135, 141,

143PWM (pulse-width-modulation), 134, 135, 141,

143

radio frequency (rf), 5ramp, volume, 121–122random numbers, 178–181“Randomize” button, 176, 179randomizer, 173random-number generator, 89, 178–181rapid-eye-movement. See REMreaction speedometer, 41–49reality testing, 98–99, 101–108recorders, audio, 97, 110, 116–119regulator schematic, 46, 47relay board, 113–116, 118relay driver, 111, 112REM (rapid-eye-movement) state

audio dream director, 114, 116, 122light-sensing lucid-dream mask, 123–132

lucid dreaming and, 95–97, 99lucid-dream-mask controller, 141–151

remote viewers, 163resistors, 4, 5, 7, 9–12resonant frequency, 165respiratory monitor, 59–64respiratory rate, 59rf (radio frequency), 5RGB LEDs, 190–194

Schumann resonance, 165Scientology, 31SCR (skin conductance response), 31–39screen, diffuser, 186–187seeding, 178–179sensory deprivation, 89, 155–163silent alarm, 114, 115skin conductance response (SCR), 31–39sleep. See also dreams

brain waves during, 96–97eyelid movements, 96hypnagogic sleep paralysis, 198stages of sleep, 95–97

sleep monitoring/aidswaking-reality tester, 101–108white noise generator, 89–94

sleep paralysis, 198snow blindness, 155solder sucker, 7, 8solderless breadboard, 1, 2, 26Sony Sound Forge, 121–122sound. See also audio entries

headphones. See headphonesnoise. See noisespeakers. See speakerstape recorders, 97, 110, 116–119triggering, 41–45

Sound Forge, 121–122source code. See codespeakers

audio dream director, 109–114, 118–121biofeedback device, 31, 32–33, 37, 39pillow, 109, 110, 120–121reaction speedometer, 44white noise generator, 89–94

224

Index

Page 240: Mind Performance Projects for the Evil Genius

speedometer, reaction, 41–49stereo white noise, 90, 91, 93–94STK500 programming board, 143, 144swim goggles, 127, 167, 194switch debouncing, 179–180switches, 18, 43–46, 49synchro brain machine, 197–202

tape recorders, 97, 110, 116–119telepathy

clairvoyance tester, 173–181Ganzfeld effect, 155–163“receivers,” 155remote viewers, 163“senders,” 155

temperature, body, 51–58temperature sensors, 51theta waves, 197timeout counters, 156. See also counterstimer

reaction speedometer, 41, 43, 44waking-reality tester, 101–102, 105, 106

tools, 21–25trancelike state. See meditationtransistor, transistor logic (TTL), 66transistors, 16–19, 33trimpot variable resistor, 125, 169tripod, 161, 163TTL (transistor, transistor logic), 66

5-V regulator schematic, 46, 47Van Eeden, Frederik, 95variable resistor (VR1)

alpha meditation goggles, 165, 169cabinet-mounted, 169color-therapy device, 190, 191, 195heartbeat monitor, 69, 71–72light-sensing lucid-dream mask, 124–125,

130synchro brain machine, 199, 200trimpot, 125, 169visual hypnosis aid, 183–184

variable resistor (VR1), 41variables, 56, 74, 146, 178, 180VCC (power), 2, 150, 176vibration devices

biofeedback device, 32motion-sensing lucid-dream mask, 135reaction speedometer, 43, 44, 49waking-reality tester, 101–106

visual hypnosis aid, 183–188volume ramp, 121–122VR1. See variable resistor

waking-reality tester, 101–108white noise, 89–94, 198, 202white noise generator, 89–94wire, breadboard, 2–5

225

Index