Introduction: Suave-Looking Brain Machine
Mitch Altman's Brain Machine is an old maker favorite. I came across it back in Makezine volume 10 and didn't think much of it, but when I reread that issue last month it struck me as an interesting device and a fun experiment. The only problem I have with Mr. Altman's original design is its appearance; while the psychedelic safety-glasses and exposed PCB are fine for Burning Man or summer camp projects, I want to give it to a friend who would appreciate something a bit more subtle.
My Brain Machine uses a pair of mirrored sunglasses to mask the LEDs and normal ear buds for the aural stimulation. The LEDs are glued to the inside of the glasses and connected to a length of audio cable that runs along one of the temples, over the operator's ear and plugs into the controller next to the headphones via a 1/8" stereo jack. The controller is a simple black enclosure with a power switch on one end and two output jacks on the other.
Just keep in mind that flashing lights can cause seizures in some people, so when sharing your brain machine with friends just make sure they're aware of what it is before they try it out so they can make an informed decision.
If you are prone to seizures yourself but you're interested in this device don't necessarily give up on it! I don't know much about seizures so I can't offer any advice but if you want to try the brain machine out talk with your doctor and see if you can work out a way to try it safely, or see if you can modify it to work with your own body. If you do modify the Brain Machine to work better for you in any way please let me know; I'd love to hear about it (Mr. Altman probably would like to hear as well, but I don't know how to get in touch with him).
Step 1: Background: Sound and Light Machines
The Brain Machine is a simple, homemade "Sound and Light Machine." An SLM is a device to aid meditation by synchronizing your brain activity to external stimuli...flashing lights and pulsing sounds. The synchronization occurs through a principle called "entrainment"; light and audio are pulsed at frequencies associated with different levels of brain activity and your brain "locks on to" (or "trains on") the external stimulation.
You can read about the different levels of brain activity here on Wikipedia. When you first turn on the brain machine it generates output in the beta frequency range and works its way down to a meditative theta frequency. After keeping you there for a few minutes it speeds back up to bring you back to a wakeful state. The whole cycle takes 14 minutes and you can read more about it on the Makezine blog. That blog post describes how to build the basic Brain Machine and is the guide I used to build mine so this instructable will focus on the changes I made to make my Brain Machine look less outrageous.
As a side note, when reading about Theremins I heard of a phenomenon called locking that causes pendulums or electronic oscillators to lock to the same frequency when they start out running at similar enough frequencies. I don't know how related entrainment is, but it's an interesting similarity even if the principles are mostly unrelated.
Step 2: Tools and Parts
- Soldering Iron
- Desoldering tool (if you're prone to change your mind or make mistakes)
- Wire Cutters/strippers
- Small clamps
- Small hobbyists saw or Dremel-type rotary tool
- 1/4" general-purpose drill bit
- 3/4" spade bit
- Computer with Serial port (or USB/serial converter)
- MiniPOV version 3 Kit (AdaFruit $18)
- 1kΩ resistor x 2 (Radio Shack, $1 for pack of 5)
- 1μF capacitor x 2 (Radio Shack, $1.5 each)
- 4"x2"x1" Project Enclosure (Radio Shack, $3)
- 1/8" Stereo headphones jack x 2 (Radio Shack, $3 for pack of 2)
- 6' Stereo audio cable with 1/8" stereo plug at each end (Radio Shack $9)
- SPST switch (I used a fairly large "rocker" style switch from Radio Shack; $3)
- 3V button cell lithium batteries (Radio Shack $7 for pack of 3)
- Sunglasses (Gas station, $9)
- Headphones (not tied to the project, so I just used the ear buds I use to listen to music)
- Heat shrink tubing
- Glue (hot-melt or otherwise)
- Electricians tape
Step 3: Build the MiniPOV
Lady Ada has the official instructions for building the MiniPOV on her web site, here. The MiniPOV is a wonderful little kit using the ATTiny microcontroller to control some LEDs (or whatever other output you can dream up) and it's very hacker-friendly. They even included solder pads for a sensor that the POV design doesn't use just so you could extend it!
The instructions for building the Brain Machine say to follow the instructions for the MiniPOV kit except leave off R5, R6, and LEDs 1-4...we'll be replacing the 100Ω resistors with our beefier 1kΩ versions and moving LEDs 1 and 2 off the board onto our glasses. We also are replacing LEDs 3 and 4 with our capacitors and headphones.
The MiniPOV should work just fine with the 4 LEDs missing, so go ahead and test it out (and play with it) after you finish building it and before you program it with the Brain Machine software so that you know it works. Once you're done and you've programmed the Brain Machine software into the chip go ahead and remove the DB9 connector; you won't need it again if you're going to keep this as a Brain Machine and it'll just take up space.
Step 4: Perforate Your Case
The project enclosure I got from Radio Shack was a 4" x 2" x 1" ABS shell. The first step is to cut holes in the short ends for the power switch and output jacks.
First find the center of one end and mark it with a center punch. Use a 3/4" spade bit to drill out a hole for the power switch (well, if you're using the same switch I got...if you're using a different switch use an appropriately-sized drill bit). When measuring keep in mind that you have to leave room for the nut that secures the switch to the side of the case...if you don't you'll have a bear of a time trimming down the nut and trying to get the switch seated properly.
Next flip the case over and mark out two spots on the other end of the case for the two headphones jacks. Make sure that the jacks will be unobstructed inside the case and that you leave enough room between the holes for the jacks to fit comfortably next to each other. The 1/8" jacks that I used fit perfectly through a 1/4" hole.
If you're using the same enclosure I did you've noticed by now that nothing fits quite right because of those darn ribs running up the sides. Fear not, for step 5 addresses this concern.
Step 5: Carve Out Your Niche
Those little ribs running up the sides of the case are pretty irritating and prevent the switch and jacks from seating properly. I have a little saw blade for my X-Acto knife that I used to cut away the ribs from the side of the case, but that was tedious and cramped. A Dremel or similar high-speed rotary tool would probably have been the right tool for this job but I got my Dremel for Christmas this year...and this project was a Christmas present for a friend! Poor timing, I suppose.
Once you've gotten rid of the ribs you can attach the jacks to the side of the case and marvel at how slick they look. Once you're done with that turn your attention to the other side. You'll probably want to remove the ribs there as well so the nut that holds the switch on can seat firmly against the side of the case, but even once you do that you'll still face 2 problems.
First, the nut itself is probably sticking up past the rim of the enclosure, so you'll want to shave that down flush with the top.
Second that nut will be getting in the way of the the enclosure's lid. You'll have to cut a notch out of the lip that runs around the edge of the lid so it closes properly.
Now it's time to move on to the glasses.
Step 6: Pimp Your Shades
We want this to draw as few strange looks as possible, remember? That means finding some sunglasses that don't look incredibly out of place and then modifying them as subtly as possible to suit our needs.
Mr. Altman uses a pair of safety glasses and drills holes in front of his pupils to seat the LEDs in, and this is a very simple and secure way to do it. Unfortunately it's pretty weird looking so I opted to do some extra work to hid the wires and LEDs entirely behind the lenses of my mirrored sunglasses.
First cut down the plastic case around the LEDs so they have a nice flat surface for the glue to bond against the lenses. This also keeps the size down to prevent them from pressing against your eyes.
Next put the glasses on and mark where your pupils stare when you're relaxing your vision. It's a bit tricky but the exact placement doesn't matter too much. Once you're happy with your placement glue the LEDs to the inside of your glasses right where you marked the lenses. Because the LEDs share a common ground we're going to be bridging their cathodes with a short length of wire; I recommend cutting and placing your LEDs so that the cathodes are each closest to your nose so it's easy to bridge them.
Depending on the glue you use you may have to clamp the LEDs in place while you wait for it to dry, so do that and set the glasses aside for the moment; it's time to split out the cable.
Cut the 6' audio cable exactly in half and squirrel one half away for another project. Trim back the insulator from the raw end of the remaining half and strip the two insulated wires inside. Those will be your "hot" wires and the uninsulated wire will be your ground. Solder 8" lengths of black wire to all three (the exact length doesn't matter since you'll want to trim them to fit) and be careful to remember which one is the ground; I tied an overhand knot near the end to mark it.
Insulate the three junctions from one another with heat-shrink tubing or electricians tape and then wrap the whole thing in another piece of heat-shrink or tape.
Grab your glasses back up and place the join at the end of one of the glasses' temples, right where it hooks over your ear. Lay the wires along the temple and then wrap the whole temple with electricians tape to secure the wires to the glasses and disguise them. It's not a perfect solution but it's pretty good and keeps everything secure and fairly inconspicuous.
Now you just need to solder the ground wire to the cathode of the near LED and the two hot wires to the LEDs' anodes and you're done with your glasses!
Step 7: Bring It All Together
Now you just need to connect everything together and you'll have your very own Suave-Looking Brain Machine. First step is to solder wires to the power switch and stereo jacks in the case. Be careful to figure out which prong on the stereo jack is ground and which are the hot channels.
Solder the two channels for one of the jacks to the anode pads for LEDs 1 and 2 (this jack will be for your glasses) and the two channels for the other jack to the anode pads of LEDs 3 and 4. They'll have to share these pads with your 1μF capacitors. This jack will be for your headphones. Solder the ground wires from both jacks to the cathode pads for LEDs 1 and 2; all the LEDs on the MiniPOV share a common ground so it doesn't matter where they go.
Solder one of the wires from the power switch onto one of the battery pads on the PCB and the other to the appropriate side of your button-cell battery. Solder a wire from the other side of the battery directly to the other pad on the PCB. NOTE: Soldering directly on the battery makes it very hot so be careful not to burn your fingers. It also may well damage the battery, so you may wish to use tape or a legitimate battery holder for this.
That's it! Close the case up and you're done!
Step 8: Try It Out
Test to make sure that everything works; if you plug your headphones into the correct jack and turn the machine on you should hear a loud tone from each channel; the tones are slightly different in order to create beats at about 14Hz. If you plug your headphones into the wrong jack you'll hear a harsh popping or clicking noise at about 14Hz from each channel.
The same thing applies to the glasses; if you plug them into the correct jack you'll see them blinking at about 14Hz but the wrong jack will yield a "constant" dim glow; you're effectively pumping a 400Hz PWM signal into the LEDs with a 50% duty cycle so they'll probably look about half as bright as they should.
There is a little bit of bleed between the headphones and the LEDs in mine and I suspect this is an artifact of using a common ground for both, but I could be wrong. In any case it's not particularly distracting, but if anyone has ideas for a simple way to block or filter this cross-talk leave them in the comments; I'd be very interested to hear. The same goes for any other comments or suggestions!
As far as future work is concerned, I've had a couple of ideas:
Change the software to descend slowly through its frequency range instead of in steps. I don't know how this would work out, but I feel like doing a slow sweep down and then back up would help your brain remain trained to the device rather than having to retrain on each stage. I could be completely wrong, but it's worth a try. It probably shouldn't be very hard to write a script that generates the output array to store on the microcontroller.
Add a button and some extra software to let you switch between different "programs" without having to reprogram the chip. I take the subway in to work; the subway ride is 30 minutes long and my breaks are 15 min long. If I were to use a brain machine to help meditate on my way to the office and when I'm on break I think it might be very nice to be able to have a 28 minute long program as well as Mr. Altman's 14 minute program.
The MiniPOV kit has a handy spot for a "sensor" so it probably wouldn't be difficult to put two different programs in the microcontroller and support switching between them with the touch of a button. The only question is whether the attiny has enough memory on board to store both programs (and what tricks you could use to save space if not!).