The Brain Machine
Read this article in MAKE:
10: Home Electronics, Page 88.
To get MAKE, subscribe or purchase single volumes.
Get altered states of consciousness with this microcontroller-driven sound and light device.
By Mitch Altman
Photos by Sam Murphy
Illustrations by Timmy Kucynda
Brain Machine Online
Click to download
Weekend Projects Video from the MAKE:Blog
Links
- Brain Machine Kit in the Maker Shed Store
- MAKE:Blog Video Podcast
See an interview with Mitch Altman and watch Bre Pettis make and use a Brain Machine. - AVR Freaks
- Monroe Institute
- The Anna Wise Center
- MiniPOV3
- Mouser Electronics
- POV Kit
Make: Noise — Discuss this article
You must be logged in to post a talkback.[ Display main threads only] [ Newest First]
Showing messages 1 through 250 of 464.
Next Page ![]()
- question about capacitors
You must be logged in to reply.
Hi ! looks like a cool experiment! I might give it a try...
I see that in the magazine the capacitors values are 1uF and that in the schematic that you put online at :
http://makezine.com/images/10/SLMschematic.pdf
they seem to be .1uF ...
what would be best to use ?
also does "bipolar capacitors" stand for regular electrolytic capacitors or is it something special that I don't know about ?
thanx good job for the article!Posted by phil.savard on May 17, 2007 at 10:15:10 Pacific Time
- question about capacitors
You must be logged in to reply.
Bipolar=two poles, which would also mean electrolytic capacitors since they have two polesPosted by buchacho on May 19, 2007 at 23:06:07 Pacific Time
- question about capacitors
You must be logged in to reply.
the schematic has info on how the RC combo creates a low-pass filter. It's important to preserve the cutoff frequency of the filter. The values that yield the 160Hz cutoff are 1000 Ohm and 1 uF. If you use 0.1 uF you'll end up with a cutoff of 1600Hz; you won't have a sine-like wave any more.Posted by theroz on May 22, 2007 at 19:02:04 Pacific Time
- question about capacitors
You must be logged in to reply.
the schematic has info on how the RC combo creates a low-pass filter. It's important to preserve the cutoff frequency of the filter. The values that yield the 160Hz cutoff are 1000 Ohm and 1 uF. If you use 0.1 uF you'll end up with a cutoff of 1600Hz; you won't have a sine-like wave any more.Posted by theroz on May 22, 2007 at 19:02:58 Pacific Time
- question about capacitors
You must be logged in to reply.
The capacitor isn't really required, but it helps make the audio a bit less harsh by rounding out the square-waves into something closer to sine-waves. If you don't have these capacitors, you can just leave them out (though it is nicer with them in).
1.0 microfarad is the correct value. They don't really need to be bi-polar, but if you use regular electrolytic capacitors then you need to be sure to solder the negative lead to the negative trace of the MiniPOV board (which is at the edge of the board).
Mitch.
Posted by maltman23 on May 30, 2007 at 16:42:35 Pacific Time
- SLM with miniPOV2?
You must be logged in to reply.
I have a miniPOV2 (which programs via the parallel port) that I am trying to make into an SLM, but I am running into problems with writing the slm.hex file to the chip.
In the makefile, I have changed the fourth line to:
AVRDUDE_PORT = lpt1
and I have a feeling that I should be changing the previous line
AVRDUDE_PROGRAMMER = dasa
to something else, but I don't know what. It seems that dasa is a programmer that utilizes the serial port, and I assume we are using it because we are writing to ROM on the chip? but beyond that I don't rally understand.
Suffice it to say, I am newb.
All of the source code for miniPOV2 from ladyada.net works fine, including her makefile. I have created slm.hex using her makefile, but still get errors when writing it to the chip.
Does anyone have any ideas about this? Or can we get code that works with miniPOV2?
thanksPosted by tenax8 on May 17, 2007 at 10:15:34 Pacific Time
- minipov2 fixed
You must be logged in to reply.
Wouldn't you know it, ten minutes after I post, I get it fixed.
Change
AVRDUDE_PROGRAMMER = dasa
to
AVRDUDE_PROGRAMMER = dt006
change port to
AVRDUDE_PORT = lpt1
and in default target add slm.hex
all: begin gccversion \
minipov.hex all_leds.hex alt_leds.hex mypov.hex test_leds.hex \
largeimage.hex slm.hex\
finished end
this is all in the makefile supplied by Mr. Altman.
Now my MiniPOV2 is an SLM!
Posted by tenax8 on May 17, 2007 at 10:37:33 Pacific Time
- minipov2 fixed
You must be logged in to reply.
I'm glad you got it working. Thanks for posting how you did it.
Mitch.
Posted by maltman23 on May 30, 2007 at 17:21:07 Pacific Time
- Applications for Lucid Dreaming
You must be logged in to reply.
Hi Mitch,
I am an administrator at www.dreamviews.com/community. We are a lucid dreaming site and discussion often turns to brainwave entrainment, especially in regards to meditation and programming your mind to have lucid dreams. I invite you and all the readers of this magazine to visit us. I will also be posting a topic with a link to this article.
Mitch, have you ever given thought to developing a device similar to the Nova Dreamer?
Regards,
SeekerPosted by Seeker_dreamviews on May 18, 2007 at 09:44:00 Pacific Time
- Applications for Lucid Dreaming
You must be logged in to reply.
Hi Seeker,
Thanks for pointing me to your website, as well as the Nova Dreamer. I wasn't aware of either before.
I am currently working on a more complex Brain Machine. This one can output 4 brainwave frequencies at once (on both sound and light), and vary the amplitude of each independently. The Brain Machine I wrote about for the MAKE article seems to work really well for lots of people, but this more complex one shows even more promise with my friends who have volunteered to be guinea pigs.
I am currently building an EEG so that I can experiment with tweaking the various values of the more complex Brain Machine. I'm excited to get values that work on the most people.
I'm gearing this towards helping people sleep, since so many people have trouble sleeping in our crazy modern world.
If I can get values that work well, then adding a feedback mechanism to the Brain Machine would be fun for trying out lucid dreaming, as well as other bio-feedback experiments.
Mitch.
Posted by maltman23 on May 30, 2007 at 17:19:55 Pacific Time
- Applications for Lucid Dreaming
You must be logged in to reply.
Mitch,
Thanks a lot to you, for an additional device to fiddle with my brain!
I'm using the openEEG for my meditation, very invaluable. So thought I can contribute something here.
I have took some snapshots of my brainwave while using your SLM device. Wonderful result! It works!!
I hosted my images at my blogs at
http://induraj.blogspot.com/
I've planned to take a detailed time orientated screenshots along with SLM frequency tables, so it would be easy to compare the images with SLM's frequency table.
Thanks again. I'll post my next snaps with including Delta, Theta, Alpha and Beta.
-Aru
Posted by induraj on March 23, 2008 at 20:51:06 Pacific Time
- Applications for Lucid Dreaming
You must be logged in to reply.
Mitch,
Thanks a lot to you, for an additional device to fiddle with my brain!
I'm using the openEEG for my meditation, very invaluable. So thought I can contribute something here.
I have took some snapshots of my brainwave while using your SLM device. Wonderful result! It works!!
I hosted my images at my blogs at
http://induraj.blogspot.com/
I've planned to take a detailed time orientated screenshots along with SLM frequency tables, so it would be easy to compare the images with SLM's frequency table.
Thanks again. I'll post my next snaps with including Delta, Theta, Alpha and Beta.
-Aru
Posted by induraj on March 23, 2008 at 20:51:57 Pacific Time
- Applications for Lucid Dreaming
You must be logged in to reply.
Hi Aru,
That is way cool! Thank you for posting your results. I am very curious to see if your Theta and Delta also correlate with the Brain Machine sequence.
I also built the OpenEEG. What you have done is exactly what I would like to do with my OpenEEG. But I haven't had any luck getting electrodes to work (I couldn't get Pedro's active electrodes to work, and haven't had time to make any others yet).
If you wouldn't mind answering some questions for me, I'd appreciate it. What are you using for electrodes? Where do you place them on your head to get your measurements? Also, what software are you using?
Best regards,
Mitch.
Posted by maltman23 on March 26, 2008 at 19:59:43 Pacific Time
- Applications for Lucid Dreaming
You must be logged in to reply.
Hi Mitch,
I apologize for the delayed response! I was on a long vacation. Ive updated my blogs with OpenEEG box I build along with DIY passive electrode and cables/connecters etc.
I was using eval version of BioExplorer, I think I might go back to BrainBay which is equally powerful software.
The image that you saw in my blogs are taken with BioExplorer software and the electrode placement location where F3 to O3 (right hemisphere).
Currently, Im tingeing with an opensource game Super Tux Kart so that you can use the game for Biofeedback.
Thanks,
-Aru
Posted by induraj on April 25, 2008 at 10:21:11 Pacific Time
- Applications for Lucid Dreaming
You must be logged in to reply.
Hi Aru,
I hope you had a good vacation. I just got back from China, myself (to manufacture ready-made versions of the Brain Machine, and also to make TV-B-Gone Pro SHP, and also to enjoy my travels. :)
Thanks for the info. I'll be trying my OpenEEG with passive electrodes soon.
Please let me know the results if you try and correlate the timing of your brainwaves with the timing of the Brain Machine while your wearing it hooked up to the OpenEEG. I am way curious to see if there is a correlation.
Cheers,
Mitch.
Posted by maltman23 on April 29, 2008 at 06:33:08 Pacific Time
- Entrainment?
You must be logged in to reply.
I searched this but didn't see much credible evidence on the subject. Has anyone tried this device or one similar to achieve altered brain states?Posted by buchacho on May 18, 2007 at 16:58:25 Pacific Time
- Entrainment?
You must be logged in to reply.
Unless you are sensitive to blinking lights, why not try it out and see how it works for you? At the Maker Faire several hundred people tried out the Brain Machines I had at my workshop. Most people had a great time with it, almost everyone enjoyed the hallucinations. Lots of people sat through the entire 14-minute meditation sequence and said that it worked great for them.
This is only anecdotal, but it's way promising.
I am in the process of building an EEG so that I can conduct my own double-blind experiments. I'm using the plans from OpenEEG:
http://openeeg.sourceforge.net/doc/
Some folks from Roboexotic.org were at the Maker Faire with one of their cocktail-mixing robots, complete with brainwave input using the OpenEEG (to determine the perfect ration of vermouth to gin for your state of mind!). After the Faire we hooked the EEG up to me while I was using the MAKE Brain Machine I built, and there was a very definite correlation between the amplitude of Alpha waves my brain produced when the Brain Machine was outputting Alpha waves on the LEDs and headphones.
Mitch.
Posted by maltman23 on May 30, 2007 at 17:03:10 Pacific Time
- A Brain Wave Machine in 2 minutes
You must be logged in to reply.
The article says that the audio part alone can entrain the brain. I don't have a mini POV kit but I do have a computer so why not using it to generate the binaural beats.
I don't know whether the thing really induces hallucinations or not but here's a quick way for you guys with a Mac to check:
Audio ToolBox is a audio function generator for the Machintosh that can do the job required here. It can be downloaded
here as a trial version.
The really cool thing about it is that it can be controlled via AppleScript. You can write a script to generate the sequence of binaural beats.
I've posted a script here. It is a very simple sequence and my first Apple Script so... please be indulgent!
Posted by LeGazier on May 26, 2007 at 20:56:34 Pacific Time
- A Brain Wave Machine in 2 minutes
You must be logged in to reply.
You might want to check this little app out as well. I've been using it for a while now:
http://uazu.net/sbagen/Posted by TentacleJoe on May 30, 2007 at 16:33:24 Pacific Time
- A Brain Wave Machine in 2 minutes
You must be logged in to reply.
You will not have visual hallucinations with only the audio, but you will be able to entrain your brain to an audio sequence without the blinking lights.
If you are not sensitive to blinking lights, please check out using it with them, since the visual hallucinations you see are fascinating!
If you would like to build a Brain Machine without buying a MiniPOV kit, here is a link to a sight that gives the plans for building a Brain Machine by connecting LEDs and headphone speakers on a parallel port, complete with software and schematic:
http://www.hackcanada.com/homegrown/wetware/brainwave/
Mitch.
Posted by maltman23 on May 30, 2007 at 16:52:17 Pacific Time
- Other scripts or effects?
You must be logged in to reply.
ANyone know of any other scripts or effectst that would be compatible with this device (and a place to get the c files?)Posted by chembro84 on May 29, 2007 at 16:36:55 Pacific Time
- wire wrap?
You must be logged in to reply.
This will be my first attempt at projects like this, and im just trying to clarify what the Kynar wire is. From what i can gather, its just a 30 gauge wire that you connect things with, right?Posted by darkarchives on May 29, 2007 at 17:37:16 Pacific Time
- wire wrap?
You must be logged in to reply.
You are correct. Kynar wire is a fancy name for wire-wrap wire. It is not necessary to use wire-wrap wire for this project, so feel free to use any kind of hook-up wire you like.
I like wire-wrap wire because unlike most hook-up wire, the insulation doesn't deform or shrink when it is heated up by the solder iron, making it easier to avoid inadvertent shorts on the circuit board.
The down side of wire-wrap wire is that it is expensive. But if you are going to be making other electronic projects, it is well worth the investment, as a couple of spools of this stuff could last you many years.
Mitch.
Posted by maltman23 on May 30, 2007 at 16:47:09 Pacific Time
- Example audio done in ChucK
You must be logged in to reply.
The computer music folks at Princeton created a language called ChucK (http://chuck.cs.princeton.edu/) that does realtime synthesis and many other things. They have downloadable binaries if you want to try it out.
Binaural beats are easy to create by setting one channel to a base frequency, and the other channel to the base frequency plus X Hz, where X is the frequency corresponding to various brain waves (2.2, 6, 11.1, 14.4 are used). In code:
// Define left and right oscillators
SinOsc sl => dac.left;
SinOsc sr => dac.right;
0.75 => sl.gain;
0.75 => sr.gain;
// Define beat frequencies (in Hz)
2.2 => float delta;
6.0 => float theta;
11.1 => float alpha;
14.4 => float beta;
// Base tone: A
440.0 => float baseFreq;
// Define a shortcut function to set frequencies
fun void brainwave(float offset, dur length)
{
baseFreq => sr.freq;
baseFreq + offset => sl.freq;
length => now;
}
// Basic meditation sequence
brainwave(beta, 60::second);
brainwave(alpha, 10::second);
// continue per article's docs...
The code above worked fine on my mac.Posted by AustinMTB on May 29, 2007 at 22:50:03 Pacific Time
- Low-Tech Version of Brain Machine
You must be logged in to reply.
Back in 1959, rtist Brion Gysin and scientist Ian Sommerville created a similar flicker device they dubbed the "Dreamachine". It is simply a large cardboard tube with pattered holes cut into it, attached to a phonograph turntable and a light bulb hanging inside of it. You set the turntable at 78 RPM, turn on the light (the only light in the room), and sit in front of it with your eyes closed. The flashing lights will trigger your optic nerves. According to Gysin, instrumental music will help the effect, but vocal music will interfere since your brain will be trying to understand the lyrics. Wikipedia has a good article on the Dreamachine, as well as a number of related links:
http://en.wikipedia.org/wiki/Dreamachine
For those with no access to a turntable that spins at 78 RPM, 45 RPM plans are available:
http://www.permuted.org.uk/dmpdown.htmPosted by unidyne on June 02, 2007 at 11:23:10 Pacific Time
- 30 awg wire
You must be logged in to reply.
I just got back from radio shack where i found everything i needed except the 30 awg wire. They had 3 awg magnet wire and i bought it, but i don't think it's the right stuff. Can i use this, or should i just get lower awg wire?
Thanks,
SethPosted by ice19berg on June 04, 2007 at 15:22:37 Pacific Time
- 30 awg wire
You must be logged in to reply.
Any hook-up wire is fine to use. Other people have used wire from phone cable, stripping wires off of ribbon cables, 24 gauge wire, etc. Feel free to scrounge and use what you have (the electrons won't know the difference).
I like using wire-wrap wire because it is thin and flexible and the insulation doesn't melt and deform when you heat it up while soldering. The down-side of wire-wrap wire is that it is kind of expensive. But if you are going to be building other electronics projects in the future, getting some wire-wrap wire (also known as Kynar) is a decent investment. I'm still using the rolls I bought about 5 years ago (and I do lots! of projects).
Mitch.
Posted by maltman23 on June 04, 2007 at 15:29:19 Pacific Time
- Correction
You must be logged in to reply.
Sorry, that should be 30 awg magnet wire.Posted by ice19berg on June 04, 2007 at 15:35:34 Pacific Time
- Correction
You must be logged in to reply.
I wouldn't recommend using magnet wire for use as hook-up wire. It has a lacquer-like crust as insulation which is a pain to strip off. It is easy to scratch the insulation, which makes it pretty easy to unintentionally short out other electronic parts. I would recommend using solid or stranded wire with some sort of plastic insulation, with a gauge between 24 and 30. As I stated elsewhere, my favorite is 30 gauge wire-wrap wire (which is solid). But many other types of wire can be used.
Mitch.
Posted by maltman23 on June 05, 2007 at 00:49:32 Pacific Time
- Correction
You must be logged in to reply.
I think magnet wire is not insulated, except for that enamel. If so, that might cause you a problem. You're going to need more insulation than that provides. Look for 30 AWG wire with plastic insulation on it.
BTW, I had some problems with the wire breaking at solder connections. Seems okay now, though, with lots of RTV adhesive providing strain relief.Posted by Replicant on June 07, 2007 at 18:44:39 Pacific Time
- Correction
You must be logged in to reply.
I think magnet wire is not insulated, except for that enamel. If so, that might cause you a problem. You're going to need more insulation than that provides. Look for 30 AWG wire with plastic insulation on it.
BTW, I had some problems with the wire breaking at solder connections. Seems okay now, though, with lots of RTV adhesive providing strain relief.Posted by Replicant on June 07, 2007 at 18:44:55 Pacific Time
- Error on compiling-Mac
You must be logged in to reply.
I've got the miniPOV working and accepting miniPOV programs with no problem, but when I try to compile and send the slm firmware I get the following errors:
Compiling: slm.c
avr-gcc -c -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-adhlns=slm.lst -mmcu=attiny2313 -std=gnu99 slm.c -o slm.o
slm.c:127:58: error: invalid suffix "b0000001" on integer constant
slm.c:139:14: error: invalid suffix "b00000011" on integer constant
slm.c:141:14: error: invalid suffix "b11111100" on integer constant
slm.c:229:12: error: invalid suffix "b01000010" on integer constant
slm.c:233:12: error: invalid suffix "b00000100" on integer constant
slm.c:246:12: error: invalid suffix "b01000000" on integer constant
slm.c:250:12: error: invalid suffix "b00001001" on integer constant
slm.c:255:12: error: invalid suffix "b00000000" on integer constant
slm.c:270:13: error: invalid suffix "b11111000" on integer constant
slm.c:271:13: error: invalid suffix "b11111000" on integer constant
slm.c:272:12: error: invalid suffix "b00100000" on integer constant
slm.c:273:12: error: invalid suffix "b00010000" on integer constant
make: *** [slm.o] Error 1
I'm running Mac OS 10.4.9. Any ideas? I've edited the makefile to my specs and like I said, there are no errors compiling and sending any of the miniPOV programs.Posted by TheCheatOSX on June 05, 2007 at 19:39:24 Pacific Time
- Error on compiling-Mac
You must be logged in to reply.
Ran into this. Some versions of the compiler don't have the binary constant patch applied.
See some of the minipov .c files for the "B8" and HEX functions, cut/paste that section into the slm.c. Then change all the 0bXXXXXXXX into B8(XXXXXXXX).
Posted by edwinh on June 06, 2007 at 06:28:21 Pacific Time
- Error on compiling-Mac
You must be logged in to reply.
Thanks for that.
I wondered why Limor didn't use the straight-ahead binary constants.
Mitch.
Posted by maltman23 on June 07, 2007 at 02:20:01 Pacific Time
- Error on compiling-Mac
You must be logged in to reply.
Ran into this. Some versions of the compiler don't have the binary constant patch applied.
See some of the minipov .c files for the "B8" and HEX functions, cut/paste that section into the slm.c. Then change all the 0bXXXXXXXX into B8(XXXXXXXX).
Posted by edwinh on June 06, 2007 at 06:28:39 Pacific Time
- Error on compiling-Mac
You must be logged in to reply.
This worked perfectly. Thanks! Now if I just knew what any of it means... total AVR n00b but I'm having fun! Thanks Mitch for the project!Posted by TheCheatOSX on June 06, 2007 at 06:56:48 Pacific Time
- Error on compiling-Mac
You must be logged in to reply.
I'm glad you're having fun. :)
Binary numbers are also fun!
0bXXXXXXXX represents a binary number to most C compilers. Given that some compilers don't have knowledge of this, the "B8" function can be used in its place.
Binary is really simple, 'cause all you need to be able to do is count from zero to one. As with our "regular" counting (which is base 10), when you hit the max in one column, you change it to a "0", and then add one to the next column over to the left. So, "00" is zero, "01" is one, "10" is two, "11" is three. Cool, yes? Just keep going for 8 columns (which is 8 "bits", which is what the AVR uses, as well as many microcontrollers) and you can count from zero to two hundred fifty five. Or, when sent to an output port with 8 LEDs attached, the binary number can represent which of these LEDs are turned on. Make sense?
Mitch.
Posted by maltman23 on June 07, 2007 at 02:31:02 Pacific Time
- Error on compiling-Mac
You must be logged in to reply.
Got everything assembled and working last night and gave it a try. Wow. I was a little skeptical until the first frequency change and I was sucked into this spiraling checkerboard. Very cool. The sound volume was a little loud with earbuds. I found a pair of regular headphone and they worked much better. They also have a inline volume switch so that worked out nice. I brought the SLM into work this morning and everyone is getting a kick out of it.
I put up a completed pic in the Make Flickr pool: http://www.flickr.com/photos/92321539@N00/535459341/Posted by TheCheatOSX on June 08, 2007 at 08:21:28 Pacific Time
- Compiling/Loading Trouble MAC OS X
You must be logged in to reply.
Can you help?? : (
I did the "change 0bxxxxxxxx to B8(xxxxxxxx)"
thing which seemed to get me a step further along. Now I get this error:
make program-slm
avrdude -p attiny2313 -P PL2303-2B1 -c dasa -U flash:w:slm.hex
PL2303-2B1: No such file or directory
avrdude done. Thank you.
make: *** [program-slm] Error 1
Now, if I look in the slm directory, the "slm.hex" file as well as a "slm.ls" have been created, but I still get that error.
This is my first ever attempt at programming so please excuse my ignorance.
Thanks!
Eliot
Posted by eulett on June 12, 2007 at 19:12:30 Pacific Time
- Compiling/Loading Trouble MAC OS X
You must be logged in to reply.
Hi Eliot,
I'm not up on programming AVR chips on using MacOS. I hope someone else can give some insight here. In the meantime, there are two websites where you can look where there is info available. One is Ladyada's website:
http://ladyada.net/make/minipov3/software.html
The other is AVR Freaks, a user forum of people all over the world who love answering questions about using AVR micros -- and they answer questions 24/7! The site is very friendly to newbies and pros, and everyone in between. Give it a try:
http://www.avrfreaks.net/
Mitch.
Posted by maltman23 on June 13, 2007 at 00:09:55 Pacific Time
- Compiling/Loading Trouble MAC OS X
You must be logged in to reply.
Thanks Mitch! I'll give them a look.Posted by eulett on June 13, 2007 at 20:02:34 Pacific Time
- Compiling/Loading Trouble MAC OS X
You must be logged in to reply.
Looks like it can't find your port. Make sure you have "/dev/PL2303-2B1" in your make file for the AVRDUDE_PORT. I forgot the "/dev/" part the first time I edited the make file and I think I got your error.Posted by TheCheatOSX on June 13, 2007 at 11:22:45 Pacific Time
- Compiling/Loading Trouble MAC OS X
You must be logged in to reply.
Thanks TheCheatOSX! Got it now, everything is Groooovvvyyyy!
E.Posted by eulett on June 16, 2007 at 16:23:49 Pacific Time
- couple questions
You must be logged in to reply.
Most of the way built... need to finish last assembly bits. 2 questions:
1. Any thought to being able to change batteries? wire ties and silicone make it kinda hard with the arrangement shown in the magazine, at least it looks that way. I glued the battery lid vertically onto the side of the glasses, with the screw exposed above the top.. I think it might work and allow the battery part to detach. We'll see.
2. Seems rather loud from the hookup-test-drive, even with some largish headphones not ear-buds. Any ideas on quieting it a bit without messing up the RC cutoff?
Posted by edwinh on June 05, 2007 at 23:14:41 Pacific Time
- couple questions
You must be logged in to reply.
Yeah, the batteries are not easy to replace with the battery pack positioned as in the photos in the article. Sorry about that! Funny that you're the first person to think about that. Doing as you say sounds like it would work. You could also try gluing the battery pack on to the temple of the glasses with the switch facing the glasses (instead of facing out), and with the switch sticking forward of the lenses. This way the top of the battery pack could slide off, through the cable-ties.
As for a volume control for the audio, you could add one if you like. You could do this using a potentiometer("pot," for short). I think that a 1K ohm dual-ganged audio pot would work well (one pot for each ear, with one shaft that controls both of them). Unsolder the two wires that go from the board to the headphone jack (but leave the ground for the headphone jack connected). Pots have three terminals: two on either end, and one in the middle. Here's what to do for each speaker: the terminal on one end of the pot goes to ground, the terminal on the other end goes to the board where the wire from the headphone jack used to go, and the middle terminal goes to the wire to the headphone jack. Here is a link to a schematic diagram:
http://www.tvbgone.com/volctrl.htm
You can get a dual-gang audio pot from an old junk audio amp, or buy it new for about $3. Here is one from Mouser:
http://www.mouser.com/search/ProductDetail.aspx?R=RV24BF-10-15R1-A1Kvirtualkey14860000virtualkey313-2420F-1K
Mitch.
Posted by maltman23 on June 07, 2007 at 02:16:55 Pacific Time
- couple questions
You must be logged in to reply.
All done. Very strange feeling after a few minutes in.... Need to try it a few more times. Changes I did:
Volume - tried a few mini pots but it seemed too bulky. Just added some 1k resistors in each path and the volume is more to my liking now. YMMV. Also modified the code to use 200.32Hz as a base and changed the others accordingly, it seemed less frantic to my brain.
Battery arrangement works for changing 'em out... I just silconed to the temple part vertically, no ties. Sturdy enough.
Used some felt to put some padding for the graphics as well as darken things.
Also used some black marker on the very tips of the LED's so now the light diffuses around the LED sides a bit rather than 2 superbright points.
Thanks Mitch, was a fun intro to AVR's too. And I hope it helps me relax and clear my head :)
Here's a small picture of my completed slm...
Posted by edwinh on June 07, 2007 at 22:23:01 Pacific Time
- couple questions
You must be logged in to reply.
hehe,
I installed my battery pack and microcontroller in a small project box and ran a small control tether to the glasses. For me this kept the glasses light weight and allowed me to put the controller on my belt kind of like a walkman. Just open the box, remove the one screw to the batt pack and yer done. The only real down side is that now i have a cable and a box to keep up with but i think for future changes/expansions the project box will prove more than handy at housing additional controls etc.Posted by whc83 on June 24, 2007 at 21:21:24 Pacific Time
- Wow
You must be logged in to reply.
Just finished and tried it out. A little loud, but not painfully so. I'm not sure my brain waves changed much, but it was quite a light show! I was surprised at all the colors and patterns that my eyes & brain produced from two flashing LEDs. Just about every color you can imagine.
After I got it put together, I realized that changing batteries may be a bit of a problem. I guess I 'll have to cut the cable ties and maybe leave the battery cover off after installing new ones, so that I can just slip batteries under the cable ties in the future. Has anyone tried that?
Posted by Replicant on June 07, 2007 at 12:35:37 Pacific Time
- enviroment for windows
You must be logged in to reply.
Hi, in instructions, inc Ladyada, there's no mention of recomended tools for windows. hehe.. you both just jump from download samples then 'make' (o; I did manage to find a setup of gnu tools but it wont compile. Can you insert a link to a recommended download?
thanksPosted by radiorental on June 09, 2007 at 15:29:07 Pacific Time
- enviroment for windows
You must be logged in to reply.
The ladyada site has a link to the software on her Software page:
http://ladyada.net/make/minipov3/software.html
Here you will see where to download and install everything for Windows (pretty much all flavors), Linux & Unix, and MacOS X.
Please note that if you are using Windows, the software you will download is called WinAVR. Ladyada says that the latest version of WinAVR software has some problems, so please don't use the latest version of the software (20070525). I have been using the 20060421 version, but evidently the 20070122 version works well also.
Mitch.Posted by maltman23 on June 09, 2007 at 16:18:46 Pacific Time
- enviroment for windows
You must be logged in to reply.
Thanks Mitch, followed the instructions to the letter, AVRdude doesnt bring compiling abilities in to the DOS prompt.
Now working through the OSX install. More problems (o;
Also, in the kit I just received, there were 8 100K resistors. Not the 56K? as in the instructions. Dont know if this is an rev in the design or a slip up in packaging. One of the LEDs, the 4th actually, is not as bright as the rest.
Will try sourcing the part specified in the instruction on Monday. This 20 min project is turning in to quite the PITA to get running! (o;
Its a learning exercise - thanks for checking in and following up - appreciated - pauricPosted by radiorental on June 09, 2007 at 19:22:56 Pacific Time
- enviroment for windows
You must be logged in to reply.
After installing WinAVR you should be able to do everything you need to do from the Command Prompt window, including compiling and programming the chip.
What exactly happens when you type "make slm.hex"? Feel free to copy and paste the output.
Regarding the resistors: I guess it is possible that Ladyada made a mistake in putting your kit together. But are you sure you have 100k resistors? There should be no 56k resistors in the kit. The kit should come with eight 47k resistors (yellow - violet - orange - gold) and three 4.7k resistors (yellow - violet - red - gold), and no other resistors.
I have only tried programming the AVR chips with Windows, so I'm afraid I can't be of much help with MacOS or Linux/Unix. I hope someone else can give suggestions if you have questions with MacOS.
Don't fret, we will get your brain hopping to your Brain Machine!
Mitch.
Posted by maltman23 on June 10, 2007 at 01:59:45 Pacific Time
- enviroment for windows
You must be logged in to reply.
Mitch, I could not get the environment working of OSX at the weekend. However, good news: I'm a tool!! I downloaded the latest windows avrdude and no the Jan '07 version as instructed by ladyada.
I now have the make command.. but I left the kit at home (o;
thanks, looking forward to getting this running... and getting some peaceful sleep.
Question: Do you think it would be possible to fire the other spare LEDs as periphery in the glasses. Maybe have them 'transition' to the next stage for the main center LEDs. Do you even think thats worth looking in to?Posted by radiorental on June 11, 2007 at 10:21:43 Pacific Time
- enviroment for windows
You must be logged in to reply.
That is kinda strange that the latest released version doesn't work well. I'm glad you got it going with the release from January.
Thanks for the question with your ideas. I'll answer your question in a new thread (please see above).
Mitch.
Posted by maltman23 on June 11, 2007 at 12:12:30 Pacific Time
- enviroment for windows
You must be logged in to reply.
Mitch, I could not get the environment working of OSX at the weekend. However, good news: I'm a tool!! I downloaded the latest windows avrdude and no the Jan '07 version as instructed by ladyada.
I now have the make command.. but I left the kit at home (o;
thanks, looking forward to getting this running... and getting some peaceful sleep.
Question: Do you think it would be possible to fire the other spare LEDs as periphery in the glasses. Maybe have them 'transition' to the next stage for the main center LEDs. Do you even think thats worth looking in to?Posted by radiorental on June 11, 2007 at 10:22:18 Pacific Time
- Using more LEDs
You must be logged in to reply.
>Question: Do you think it would be
>possible to fire the other spare LEDs as
>periphery in the glasses. Maybe have them
>'transition' to the next stage for the
>main center LEDs. Do you even think thats
>worth looking in to?
>
>Posted by radiorental on June 11, 2007 at
>10:21:43 Pacific Time
Yes, this is worth looking into.
Brains emit frequencies across a spectrum, from down to almost DC, up to about 100Hz. Not only that, but they emit varying amplitudes at these frequencies continuously, all at once.
The Brain Machine in this article simplifies things tremendously by only emits one brainwave frequency at a time, and the amplitude is either totally on or totally off. I am amazed at how well this works on almost everyone whose tried the ones I've built. And by now more than 1000 people have tried it.
But it can be even more effective if we model brainwave sequences closer to what the brain actually does when it goes from one state to another and all of the states in between (such as awake to meditation, awake to sleep, etc).
Adding more LEDs would allow emitting more than one brainwave frequency at a time. That makes it easier for your brain to entrain to the various frequencies. The trade-off is that this makes the firmware more complex. (I decided to make the firmware as simple as possible for this project so that it was easier to hack for people just starting out with microcontrollers).
I am currently working on a much more complex version of this Brain Machine. It has 4 LEDs, one for each brainwave type. I am actually using 4 different colored LEDs. The brightness of each LED can be adjusted independently by the firmware. So I can program the Brain Machine to vary the amplitude of each brainwave frequency over time throughout the sequence it produces. This more closely models what goes on in a person's brain. I am also doing something similar with the sound: instead of one pitch, I am using 4 pitches to create a musical chord, with one pitch per brainwave type, with the volume of each being independently adjustable by the firmware. I am finding that separating out the 4 brainwave types into 4 different colored LEDs and 4 different pitches makes this more complex Brain Machine extremely effective for peoples' brains to entrain to.
To study this further, I am building an EEG (an instrument for measuring brainwave frequencies and amplitudes), which will allow me to experiment with all this more rigorously. For those interested in building their own EEG, here is a online community that is working on an open source one that works really well:
http://openeeg.sourceforge.net/
Mitch.
Posted by maltman23 on June 11, 2007 at 12:50:28 Pacific Time
- Using more LEDs
You must be logged in to reply.
I'd like to BUY a Brain Machine. I have had the parts for months, but haven't had time to make it. Anyone interested in a sale?
Thanks, LeePosted by capelee on March 17, 2008 at 08:10:58 Pacific Time
- Program cd
You must be logged in to reply.
I finished soldering, and the lights flashed, but I'm having trouble programming it. When I type cd and hit enter it says "The system cannot find the path specified". I have tried changing the directory to other things and I keep getting the same message. Do you have any idea what the problem may be?
Posted by ice19berg on June 14, 2007 at 18:13:40 Pacific Time
- Program cd
You must be logged in to reply.
Here's a little primer on command prompt commands. I use Windows for this, so I'll be giving examples in it.
If you open a Command Prompt window, you will see a black box with a prompt that looks something like this:
C:\Documents and Settings\Mitch>
This line shows where you are looking at in your hard drive. In our case, we want to be looking in the "slm" directory, and not at "C:\Documents and Settings\Mitch". This is where the "CD" command comes in.
CD directoryname
Change Directory. It changes the directory you're looking at. A directory is a folder that files are stored in.
In our case, we want to look at a directory called "slm". But before we can look at it, we have to create it.
MD directoryname
Make Directory. It makes (creates) a directory that you can then move some files into. In our case, we want to create a directory called "slm", so you type in the following commands:
cd\
md slm
The "cd\" command looks at the lowest level of your hard drive. Then, "md slm" creates a directory called "slm".
After creating the "slm" directory, if you then type:
cd slm
you will be pointed to the "slm" directory, and will see this in the Command Prompt window:
C:\slm>
This is useful if you have some files in the "slm" directory. In our case we want two files in the "slm" directory. How do you get the files there?
The MAKE website has a file called "slm.zip". This zip file is a compressed version of two source files that we need:
slm.c
makefile
Use software such as WinZip to extract the two files from the "slm.zip" file. You can tell the software where to extract the files to. Or, you can just take note of where it extracts the two files and then move them yourself after extraction.
To move the files to the "slm" directory, you can use Windows Explorer, or you can use commands from the command prompt window.
MOV filename
Move file. This moves a file from one directory on your hard drive to another. Let's say that the files we want are in a directory called "mitch" and we want to move them to the "slm" directory that we created. This is what you type in the Command Prompt window:
mov \mitch\slm.c \slm
mov \mitch\makefile \slm
DIR
Directory command. This will list all of the files in a folder. Type in the following after moving the files to the "slm" directory:
cd \slm
dir
You will see something like the following in the Command Prompt window:
Volume in drive C is FRED
Volume Serial Number is 5804-253D
Directory of C:\slm
06/15/2007 10:53a <DIR> .
06/15/2007 10:53a <DIR> ..
04/08/2007 10:28a 88 makefile
09/10/2003 12:36a 79 slm.c
2 File(s) 167 bytes
2 Dir(s) 2,301,190,144 bytes free
Now you can proceed with programming the AVR chip as described in the article.
I hope that helps.
Mitch.
Posted by maltman23 on June 15, 2007 at 10:55:36 Pacific Time
- Got it working
You must be logged in to reply.
I received the MiniPOV kit and the extra parts from Mouser, and got my SLM built. It works great.
At first I tried programming it on my Mac + Keyspan USB serial. Regardless of delay given to avrdude, it will not work. I'll look into this as this is my preferred platform. I next tried the January 2007 WinAVR package on a my windows box, and that worked.
The only odd thing is that when it runs the full sequence and the cpu is put into sleep mode, it will not restart at the next power toggle. I have to connect +V to pin 10 to reset, then it runs fine. If the power is toggled while the code is running, it restarts normally. FWIW, my chip is the attiny2313V-10PU. Anybody else have this problem?
Mitch, thanks for putting this project together!
-Brent
P.s. My kit came with 100 Ohm resistors, since a poster below said theirs came with 100k Ohm. 100 Ohm is given in some kits, according to ladyada.net.Posted by AustinMTB on June 14, 2007 at 18:24:16 Pacific Time
- Got it working
You must be logged in to reply.
Hi Brent,
I assume that the 100 ohm resistors are replacing the eight 47 ohm resistors for the red LEDs. This will make the LEDs less bright. That isn't really a problem.
I can't think of any reason why the AVR doesn't reset itself when you power it down and then power it up. The AVR has a built-in Power-On-Reset circuit that is supposed to do this. One thing that you can try:
After the brainwave sequence completes
turn off the power
wait 2 seconds
turn on the power
The added 2 second delay may help.
Mitch.
Posted by maltman23 on June 15, 2007 at 11:02:39 Pacific Time
- Got it working
You must be logged in to reply.
Sure enough, waiting several seconds after the program ends to power it back up works.
I also have it working on OS X now, through a PL2303-based serial adapter ($15 at Fry's), with the osx-pl2303 open source driver. Using a PC with onboard serial is superior, however.
Thanks again, Mitch, it's all working fine, and the light shows are quite interesting.Posted by AustinMTB on June 15, 2007 at 18:56:26 Pacific Time
- Got it working
You must be logged in to reply.
Hi AustinMTB,
It may be helpful to others using MacOS if you would describe what you did to get things working on your Mac setup. Could you?
Thanks,
Mitch.
Posted by maltman23 on June 16, 2007 at 01:43:53 Pacific Time
- Got it working
You must be logged in to reply.
Sure, but I didn't do anything different than the excellent directions on ladyada.net's software page.
Once I had the tools built and installed, the only software issue was the lack of support for "0b00101010" notation in the compiler. This discussion page here described the modifications required to use the B8() macros instead. After changing the slm.c file, slm.hex built fine.
I found that programming the chip on a Windows PC was vastly quicker than on a Mac because of how much slower the USB-Serial adapter is. On Windows with WinAVR, writing the flash is near-instantaneous. On the mac, it took 15-20 minutes, but it worked OK.
I could not get my Keyspan USA-19HS adapter to work at all. It seemed most PL2303-based adapters were sub-$20, so I picked up the cheapest one I could find at the local electronics shop (Fry's) for $15, and got lucky.
So that's basically it. A big thank-you to the Maker community for posting info and helping.Posted by AustinMTB on June 16, 2007 at 18:25:47 Pacific Time
- The IC...
You must be logged in to reply.
I bought two minipov3 kits, one for practice and the other to build the slm. I successfully completed soldering both kits and then promptly mangled the pins on one of the integrated circuits as I was putting it in its socket. As I straightened out the pins, some of them broke off! I was wondering if I specifically need ladyada's IC with its preprogrammed info or will a "blank" replacement IC of the same type work with your firmware?Posted by evenmadderdawg on June 16, 2007 at 10:40:04 Pacific Time
- The IC...
You must be logged in to reply.
Hi evenmadderdawg,
2 chips -- how frustrating.
First, I'll say a bit about pins on new ICs. New ICs usually come with the pins bent outward a little bit, making them difficult to press into their sockets. Before placing ICs into a socket it is best to make sure that all of the pins are pointed straight down so that all of the pins on the left side of the chip are parallel to all of the pins on the right side. To do this I usually place the chip on its side on a table and gently press down, then turn the chip over on its other side and do the same. It takes a bit of a knack, but once you do it a few times it gets easy.
Note that it is not required that you have the Atmel chip in a socket, but you can solder the chip directly into the PCB. There are a few disadvantages to doing this, however:
- You can burn out the chip by heating it up too much with the solder iron.
- If you make a mistake (such as soldering it in backwards) it is difficult to unsolder the chip from the board to replace it.
- If the chip burns out (which is unlikely) it is difficult to unsolder the chip from the board to replace it.
OK, to answer your question:
You do not need to start with a pre-programmed chip from Ladyada. You can buy an Atmel ATtiny2313V-10PU from Mouser or Digikey, or anywhere else that sells them (they are popular chips).
If you have a new chip you must burn the fuses to set the chip up correctly for programming your firmware. (I mentioned this on the blog for the video, but I'll restate it here.) To burn the fuses, if you are using Windows (it is similar for Mac and Linux/Unix), type in the following command line from a Command Prompt window:
make burn-fuse
with the chip in the socket in the completed PCB, while the MiniPOV is connected to the serial port and with the battery pack switch powered on. Then your chip is ready for programming.
And then you'll be up and running!
Mitch.
Posted by maltman23 on June 16, 2007 at 11:52:35 Pacific Time
- soldering, great!! Programming, eh...
You must be logged in to reply.
Hi Mitch,
Things were moving along great until I got to the programming part. My command window doesn't seem to like the word "make". It says "not recognized as an internal or external command". What am I doing wrong?
jimPosted by jvanis65 on June 16, 2007 at 13:24:21 Pacific Time
- soldering, great!! Programming, eh...
You must be logged in to reply.
Hi Jim,
Are you using Windows? If so, did you download and install the January-2007 WinAVR, as instructed on the Ladyada website? Please make sure you did not download the latest version of WinAVR, as it does not work. When you install WinAVR it should let Windows know about "make."
Mitch.
Posted by maltman23 on June 16, 2007 at 23:49:19 Pacific Time
- soldering, great!! Programming, eh...
You must be logged in to reply.
yes got it to work and sound works great, now to make the glasses...thanks.
jimPosted by jvanis65 on June 18, 2007 at 15:00:05 Pacific Time
- More programming troubles.
You must be logged in to reply.
Posted by cdxnolan on June 18, 2007 at 13:26:27 Pacific Time
- More programming troubles.
You must be logged in to reply.
I'm pretty sure I have everything soldered correctly, but the programming instructions are just plain bad... i hooked up the headphone jack and no sound comes through. the red lights still do the VVVVV pattern though... can i get a step by step from someone?Posted by cdxnolan on June 18, 2007 at 13:28:46 Pacific Time
- More programming troubles.
You must be logged in to reply.
fixed it :DPosted by cdxnolan on June 18, 2007 at 22:15:36 Pacific Time
- compiling?
You must be logged in to reply.
so i was doing well. i got most of the kinks worked out, but im down to downloading the slm program onto it. i dont seem to have slm.hex, although i do have slm.c. where do i find it/how do i make it?Posted by sonicboom16 on June 18, 2007 at 13:34:30 Pacific Time
- compiling?
You must be logged in to reply.
I seemed to have that same problem too, I didn't have an slm.hex program to delete, but if you go ahead and run the "make" command everything proceeds according to the instructions in the magazine.
jimPosted by jvanis65 on June 18, 2007 at 15:08:38 Pacific Time
- compiling?
You must be logged in to reply.
The "slm.hex" file is created by the processes that happen when you type:
make slm.hex
The "slm.hex" file is what actually gets programmed into the Atmel chip when you type:
make program-slm
Mitch.
Posted by maltman23 on June 19, 2007 at 00:52:50 Pacific Time
- chnage the tone/pitch?
You must be logged in to reply.
Hello,
Can anyone give quick easy instructions for changing the pitch of the binaural tones?
The default tones are too high pitch and loud to be relaxing. I built my goggles last week and have been using them daily, and my only complaint is the sound is just too darn loud.
ThanksPosted by jeffthrow on June 20, 2007 at 15:09:10 Pacific Time
- chnage the tone/pitch?
You must be logged in to reply.
Changing the pitch is pretty easy. But you'll need to do some math.
Look in the "slm.c" file with a simple text editor. Scroll down to the "main" function and see the line that says:
OCR0A = 38; // to output 400.641Hz on OC0A (PB2, pin 14)
This sets the base frequency. You'll want to change the value of OCR0A to suit your tastes. Use the equation given in the comment a few lines above that. For example, if you desire 200Hz base frequency, OCR0A should be set to 77 (instead of 38) to get an output frequency of 200.321Hz.
Now you'll need to change all four of the offset frequencies. This is done in the "do_brainwave_element" function. Use the equation given in the comment above the function and for each section of "do_brainwave_element", change the value of OCR1A to be offset by the brainwave frequency for that section. For example, the frequency for Beta is 14.4Hz, so with a base frequency of 200.321Hz, the offset for Beta should be:
200.321Hz + 14.4Hz = 214.721Hz
To get that frequency, set OCR1A in the Beta section to 18630 (instead of 9714) to get an output frequency of 214.696Hz.
Do a similar calculation to change the offset frequency for each of the other three brainwave sections in "do_brainwave_element".
That's all there is to it.
To change the volume, there is a bit of discussion in other questions, below.
I hope that helps.
Mitch.
Posted by maltman23 on June 22, 2007 at 11:23:56 Pacific Time
- WinAvr software
You must be logged in to reply.
Mitch,
1. I think I soldered everything right. When I turn on the power the lights light up one after another - not all at once. Is that right?
2. I can't find the link to download WinAVR from the ladyada website - I've looked everywhere - can you, please, post a link?
I appreciate all the help (its my first "soldering/programming" project - so nothing seems easy :)
Bill.
Posted by wmindel on June 22, 2007 at 09:08:19 Pacific Time
- WinAvr software
You must be logged in to reply.
Hi Bill,
1) It's possible that your kit came with the wrong firmware pre-programmed into the AVR chip. There is some test firmware that does what you explained: lighting up each LED with all the rest off, then lighting up the next LED with all the rest off, etc., and then repeating. Is that was yours does? If so, then we can assume that you have soldered everything together OK.
2) The page on the Ladyada website for downloading the programming software is:
http://ladyada.net/make/minipov3/software.html
On this page are links to the required software for your favorite Operating System. WinAVR is the one to get for Windows. Scroll down a little to where it says "Windows" and you'll see the link. But please be sure to NOT download the latest version, since it is reported to not work -- the version that works is the January 2007 release.
I hope that gets you going.
Mitch.
Posted by maltman23 on June 22, 2007 at 11:31:17 Pacific Time
- Volume control
You must be logged in to reply.
Suggestion: for someone that is bothered by a loud volume try putting the headset against the hard boney area above/behind the ear. The audiologist does this during a hearing test.
I built the miniPOV and the USB charger some months ago but never got around to programming the POV. Real life. Priority interupts. Now I feel re-inspired.
My problem is that I'm a little more than half deaf. Volume control will most likely be required. I read all of the current posts so I have your fix for that.
I was thinking about cannabalizing a $1 store or old radio for parts but I haven't had a lot of luck with desoldering so I'll probably just buy the parts.
This could work well for power naps. Power down, sleep 10-20 mins, power up. Or is going thru the sequence enough without the sleep?
Thanks for an inexpensive and fun project. Sounds like one could save money on LSD, sleep aids, uppers, downers, antidepressants, shrinks, etc. with the SLM. I'm kidding about the LSD.Posted by sasha916 on June 22, 2007 at 11:14:47 Pacific Time
- Volume control
You must be logged in to reply.
I found a cheap set of headphones with a built in inline volume control.. works great.. for like $7
Posted by whc83 on June 30, 2007 at 18:07:24 Pacific Time
- Running make program-mypov
You must be logged in to reply.
when I execute "make program-mypov" I get the following error message:
avrdude -p attiny2313 -P com1 -c dasa -U flash:w:mypov.hex
error at ..\slm\avrdude.comf:370 unrecognized character: "u"
make: *** [program-mypov] Error 1
any ideas?
thanks,
bill.Posted by wmindel on June 22, 2007 at 18:21:28 Pacific Time
- Running make program-mypov
You must be logged in to reply.
Hi bill,
Did you do this command first?
make mypov.hex
What happened when you executed it?
Are you executing the "make" commands from a Command Prompt window with the prompt pointed to the correct directory with the "mypov.c" file? (I.e., did you download the source code to a known directory, such as "slm" and then do a "cd" command to point to it?)
Mitch.
Posted by maltman23 on June 24, 2007 at 01:40:04 Pacific Time
- Running make program-mypov
You must be logged in to reply.
Mitch,
Thanks for the reply. As it turns out, I have a bunch of problems.
1. I've just noticed that the unit works intermittently - most of the time, when I flip the switch the lights go on (one after another), but sometimes nothing - I suppose I should take apart the power supply to see what might be wrong, right?
2. I also noticed that when I run "make mypov.hex", in the middle of 'seemingly normal" message, there is a:
In file included from mypov.c:3:
c:/winvr-20070525/bin/..avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
when I'd comment out the 3rd line (signal.h), the message went away; but I am not sure whether I should've done that.
Finally, yes, I follow (or at least I think I follow) the instructions in the magazine:
1. turned off the battery pack, plugged the MiniPOV into the serial port, switched it on (the lights don't go on - should they?)
2. switched to the command prompt, switched directory, "del mypov.hex" "make mypov.hex" (with all the messages from above) and then run into the problems with "make program-mypov".
It almost seems like I am missing one (maybe two) simple step...
Thanks for your help.
Bill.Posted by wmindel on June 24, 2007 at 05:06:53 Pacific Time
- Running make program-mypov
You must be logged in to reply.
It is bothering me that you are not getting the expected behavior when you turn on power to the hardware. I am thinking that you probably have a hardware problem. Especially since it is only doing something intermittently.
1. If your unit works intermittently, then you have a problem with the hardware. The first step is to make sure that all of your solder connections are good. There are two kinds of bad solder connections:
- "Cold" solder joints, meaning that the solder didn't flow nicely around the lead of the electronic part and the pad on the PCB. You can fix these by heating the solder connection up with a solder iron, being sure to touch the solder iron tip to both the component lead and the PCB pad. Hold the solder iron in this position for about 1 second. You may want to do this for every solder joint on your PCB, just in case (but especially for the 20 pins on the microcontroller socket).
- "Solder bridge," meaning some excess solder is shorting out two places on the PCB that should not be shorted together. Bridges are not always easy to find. Inspect your PCB carefully and see make sure that solder only exists on it where the is a pad.
There are other things that can go wrong, too.
- If you have a volt-meter (a good investment -- you can buy a cheap one for about $10 at Radio Shack or Jameco, and other places), you can measure the power supply voltage at the microcontroller chip between power and ground (pins 20 and 10 in our case) -- make sure it is close to 3v with the switch turned on.
- Inspect the components to make sure that all polarized components (i.e., ones where it matters which way they are inserted) are inserted correctly into the PCB. In this project, the polarized components are the diodes D1, D2, D3 and the LEDs LED1, LED2, LED3, LED4. The microcontroller can also be inserted backwards -- if you do this with the power on the chip will heat up to the point where it will probably burn itself up. I have, however, made this mistake on a few boards, myself, and in only one case out of 5 has the chip burned out -- on the other 4 I turned off the power, reversed the chip, and it worked fine.
2. Please ignore the warning message you get when you do the
make mypov.hex
command. I think you are fine if you comment out that line from the source file, but it is probably best to keep it in.
Programming:
1. When you plug the board into the serial connector and turn on the power, you may or may not see LEDs light up. Unfortunately, there is no visual indication that things are working or not at this point.
2. When you type
make mypov.hex
this creates the "mypov.hex" file for programming the microcontroller in the next step. If you have that file in your directory, then your software is probably installed correctly, and you are doing things correctly up to that point.
If your hardware is working, and if you have a "mypov.hex" file in the "slm" directory, and you follow the instructions in the article, when you type the next step
make program-mypov
then, in the Command Prompt window, you should see the software find the chip, erase the chip, program the chip, and verify the program in the chip.
If things still are not working after you verify that the hardware is working is uninstall WinAVR and reinstall it (to make sure one of the files was not somehow accidentally corrupted).
Mitch,
Posted by maltman23 on June 24, 2007 at 10:06:24 Pacific Time
- Capacitor
You must be logged in to reply.
Is there a replacement 1uf capacitor for the brain machine? Mouser is back ordered until september.Posted by TVinU on June 25, 2007 at 15:03:09 Pacific Time
- Capacitor
You must be logged in to reply.
You can use the bipolar 1uF cap they sell at Radio Shack:
http://www.radioshack.com/product/index.jsp?productId=2062378
Or, you can use any 1uF capacitor. If you use a polarized cap, be sure to connect the negative side of the cap to ground (the ground holes for the LEDs are the ones at the edge of the PCB). Usually, the negative side of a polarized cap is marked with a bar. Here is a cheap polarized 1uF cap they sell at Mouser:
http://www.mouser.com/search/ProductDetail.aspx?R=USR1H010MDDvirtualkey64700000virtualkey647-USR1H010MDD
Mitch.
Posted by maltman23 on June 25, 2007 at 15:13:37 Pacific Time
- V2
You must be logged in to reply.
Let me start off with THANKS, what a great product. I'm planning to build several pairs and taking them to burning man for people to play with.
I made one of these with a few small difficulties* that I worked thru. I'm now on V2 and I've got a few small difficulties that I haven't yet worked thru. V2 has 3 leds in 3 colors per eye. I wired the leds into the 5-8 sockets and modified the program as follows:
In the function blink_leds I changed
for (int i=0; i<(duration/(onTime+offTime)); i++) {
PORTB |= 0b00000011; // turn on LEDs at PB0, PB1
delay_one_tenth_ms(onTime); // for onTime
PORTB &= 0b11111100; // turn off LEDs at PB0, PB1
delay_one_tenth_ms(offTime); // for offTime
-----------
to
for (int i=0; i<(duration/(3*(onTime+offTime))); i++) {
PORTB |= 0b00000011; // turn on LEDs at PB0, PB1
delay_one_tenth_ms(onTime); // for onTime
PORTB &= 0b11111100; // turn off LEDs at PB0, PB1
delay_one_tenth_ms(offTime); // for offTime
PORTB |= 0b00110000; // turn on LEDs at PB0, PB1
delay_one_tenth_ms(onTime); // for onTime
PORTB &= 0b11001111; // turn off LEDs at PB0, PB1
delay_one_tenth_ms(offTime); // for offTime
PORTB |= 0b11000000; // turn on LEDs at PB0, PB1
delay_one_tenth_ms(onTime); // for onTime
PORTB &= 0b00111111; // turn off LEDs at PB0, PB1
delay_one_tenth_ms(offTime); // for offTime
}
-----------------
Problem 1: The blue LED (on sockets 7-8) doesn't light up. I tinkered with the program, I think I've addressed it correctly. I think the LEDs have a different resistance than the others so I'll experiment with putting different levels of resistance in those sockets this evening. Suggestions welcome. I'm using Radio Shack super bright blue LEDs.
Problem 2: No sound. I had originally wired the battery in backwards and the chip got pretty hot. Is it likely I burned it out? The solders all look clean, I'll check them again. I'm using the radio shack bipolar 1Mf capacitors which are a little awkward - the wiring comes off the ends and it's a little bulky. Suggestions?
-----------
*here are issues I encountered on my V1 in case it's helpful to anyone else building.
1. Wired the "original" LEDs into sockets 5-8 instead of 1-4 b/c I'd read it wrong which was which.
2. Wired the battery pack backwards. Symptom - nothing works and the chip gets hot.
3. I had a struggle getting the AvrDude software loaded. In hindsight,I don't think I rtfm'd at ladyada.com. I read "download and install" and went out to google to find Avrdude, etc. I think this could be clearer, but fault primarily mine.
4. I did glue the battery pack with the switch facing inboard with the hope that when I need to replace batteries I can get the case cover off without snipping the cable ties. Worst case, I snip the cable ties and redo them, but the glue is fine.
5. I find the volume a little too loud in the earphones. I think the easy solution is to get a pair of earphones with built in volume control, used to be pretty cheap ones you could get that way. I think it intensifies the effect with the volume up and I get interesting aural afterimages.
-----
I'm also planning to experiment with another project in Make 10. I want to take the "dice" project, add in a variable capacitor to be able to adjust the timing up and down, and wire it up to 3 LEDs per eye or a 3 way LED. I saw something like this at Maker Faire 1.0 and it made really trippy visuals although I don't think it's going to manipulate your brainwaves.
(sorry for the long note)Posted by Swampdog on June 26, 2007 at 10:23:12 Pacific Time
- V2
You must be logged in to reply.
Hi Swampdog,
Your code for turning 3 LEDs at each eye on and off looks good. You can simplify it, if you like, as follows:
for (int i=0; i<(duration/(3*(onTime+offTime))); i++) {
PORTB |= 0b11110011; // turn on LEDs at PB0, PB1, PB4, PB5, PB6, PB7
delay_one_tenth_ms(onTime); // for onTime
PORTB &= 0b00001100; // turn off LEDs at PB0, PB1, PB4, PB5, PB6, PB7
delay_one_tenth_ms(offTime); // for offTime
}
The problem you are having with the Blue LED is probably due to the higher Forward Voltage required to light up the Blue LED. Blue LEDs often require more voltage than other colors. See if you can find one with a Vf of less than 3v. Also, try using a much smaller series resistor for it than the others (or, maybe even try no resistor at all -- but be careful not to keep it lit up too long without blinking it, or it could burn it out).
Changing the code the way you did should not have effected the sound. So, it is possible that you burned out the chip when you hooked power up backwards. While doing the workshop at the Maker Faire, teaching people how to build these, I managed to connect power up backwards on 4 chips. One of them burned out, but the other 3 worked fine. For yours, my guess is that the chip is working, and you have another problem, since if the chip works at all, it probably all works.
As for the caps with the wires coming out the ends (this is called "axial", whereas the ones from Mouser I suggested, with the leads both coming off the bottom, are called "radial"): I would recommend mounting the cap vertically, with the bottom lead facing downward, and then bend the upward lead down along the side. This is the way they used to stuff resistors into PCBs in those small, handheld transistor radios in the '60s.
Happy making!
Mitch.
Posted by maltman23 on June 26, 2007 at 16:54:20 Pacific Time
- SLM Programming
You must be logged in to reply.
Hey Mitch,
Great machine! Took a few tries but I finally got my SLM programmed and running. I had started out having built the Brainwave machine using the lpt port with 8 leds and ran connected to a computer.. The advantage of that one is it was easy to program on the fly . but yours are portable..:) I am still trying to make sense of how to program these controllers to do what you want and was wondering if you had any other slm code written other than what was provided with the slm? Like maybe from wake to deep sleep, or just something to restful..I have fallen aslepp with the SLM on but everytime it ends i am wide awake again
Thanks BillPosted by whc83 on June 30, 2007 at 18:04:16 Pacific Time
- I appreciate the article
You must be logged in to reply.
Hi Mitch - Thank you for contributing this project. I ordered the mouser.com parts and am getting my 7 year old son interested in this project. We are going to have a lot fun. Thanks again. StephenPosted by stephenhobbs on June 26, 2007 at 17:39:35 Pacific Time
- Doh!
You must be logged in to reply.
So I go back to see if maybe I've got a solder bridge or a short that's keeping the sound from working. I'm examining the board with a magnifying glass. Finally I notice - I never put the 1K resistors in pads 5 & 6. That'll do it, that right there, yup, you betcha. Now I just need to figure out how to make the blue leds light up.
Posted by Swampdog on June 26, 2007 at 18:10:18 Pacific Time
- Triple LED goggles
You must be logged in to reply.
aren't looking like a success. As I'd feared, the color doesn't have an impact thru the eyelid, and the spacing of the LEDs as I did it (about 3/4" apart) diminishes the cycle impact - it's not a strong enough repeated impact on the optic nerve.
So I wouldn't recommend the experiment.Posted by Swampdog on June 27, 2007 at 11:10:40 Pacific Time
- Triple LED goggles
You must be logged in to reply.
Hi MaruatCircleStudiox,
Great gift idea. :)
I hope your cat didn't learn to respect electricity the hard way in the process of chewing the solder iron's cord!
Having a decent solder iron isn't necessary, but if you and/or your husband are planning on doing more electronics projects, then having a decent one is well worth the investment.
The main difference between the el-cheapo solder irons and a decent one is temperature control. They'll also have a handle that doesn't get too hot while holding it, and they'll have the ability to change tips. You'll also want one with a holder to place it while not in use, as well as a sponge for cleaning the tip (which you should do before every solder connection). (Fancier solder irons have other bells and whistles, such as adjustable temperature, but there is no need for this for our purposes.)
Lots of solder irons fit the bill, and people have their favorites. Mine is made by Weller, and I use a thin conical tip. I just took a look at the Jameco catalog, and see that there is a Weller solder iron station for $47:
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&pa=146595&productId=146595
It comes with a screwdriver tip, which is fine. If you want a conical tip (which I like), it is available for an extra $5:
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&pa=146624&productId=146624
Happy soldering!
Mitch.
Posted by maltman23 on July 03, 2007 at 18:32:55 Pacific Time
- Lame Question
You must be logged in to reply.
Hi, my husband fell in love with the idea of this project and I am trying to surprise him with the whole kit before he gets to it. My main question is about soldering irons. The one he has got chwed up by my cat and I would like to get him a new one. It was one of those cheapy ones from the hardware store and he mentioned he wants to get a more appropiate one for electronics. Any suggestions? would like to spend less that $70
Thanks!!Posted by MaruatCircleStudiox on July 02, 2007 at 15:02:34 Pacific Time
- Lame Question
You must be logged in to reply.
Hi MaruatCircleStudiox,
Great gift idea. :)
I hope your cat didn't learn to respect electricity the hard way in the process of chewing the solder iron's cord!
Having a decent solder iron isn't necessary, but if you and/or your husband are planning on doing more electronics projects, then having a decent one is well worth the investment.
The main difference between the el-cheapo solder irons and a decent one is temperature control. They'll also have a handle that doesn't get too hot while holding it, and they'll have the ability to change tips. You'll also want one with a holder to place it while not in use, as well as a sponge for cleaning the tip (which you should do before every solder connection). (Fancier solder irons have other bells and whistles, such as adjustable temperature, but there is no need for this for our purposes.)
Lots of solder irons fit the bill, and people have their favorites. Mine is made by Weller, and I use a thin conical tip. I just took a look at the Jameco catalog, and see that there is a Weller solder iron station for $47:
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&pa=146595&productId=146595
It comes with a screwdriver tip, which is fine. If you want a conical tip (which I like), it is available for an extra $5:
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&pa=146624&productId=146624
Happy soldering!
Mitch.
Posted by maltman23 on July 03, 2007 at 18:33:58 Pacific Time
- Lame Question
You must be logged in to reply.
I see that the links to the Jameco website that I gave got cut off. To see the solder iron and tip, go to
http://www.jameco.com/
and then do a search for Jameco Catalog Part #:
146595 for the $47 solder iron
146624 for the $5 conical tip.
Mitch.
Posted by maltman23 on July 03, 2007 at 18:37:16 Pacific Time
- Re: SLM Programming sequences
You must be logged in to reply.
> Hey Mitch,
> Great machine! Took a few tries but I finally got my SLM programmed and
> running. I had started out having built the Brainwave machine using the
> lpt port with 8 leds and ran connected to a computer.. The advantage of
> that one is it was easy to program on the fly . but yours are
> portable..:) I am still trying to make sense of how to program these
> controllers to do what you want and was wondering if you had any other
> slm code written other than what was provided with the slm? Like maybe
> from wake to deep sleep, or just something to restful..I have fallen
> aslepp with the SLM on but everytime it ends i am wide awake again
>
> Thanks Bill
>
> Posted by whc83 on June 30, 2007 at 18:04:16 Pacific Time
Hi Bill,
I have been working on sequences for waking up and for going to sleep, and for going back to sleep (when you wake up in the middle of the night). I don't have those sequences ready to give out yet, but I can tell you a bit about each.
But first I'll say that you can try your own sequences. Feel free to play around with the sequence given in the SLM firmware. For instance, you can truncate the meditation sequence. The meditation sequence brings you from being awake, to very relaxed, hanging out there awhile, and then back up again feeling fabulous. If you delete all of the brainwaveElements after the way-relaxed elements, then you are left feeling very (very!) relaxed. I have tried this out on my sister-in-law, who is not a very good sleeper, and it worked great for her (I actually just had her try it out just before going to bed, wearing the glasses only for 7 minutes, rather than the full 14 minutes, taking the glasses off during the way-relaxed part of the sequence).
To truncate the meditation sequence to stop after becoming way relaxed, delete all of the lines after the last Delta brainwaveElement, but be sure to leave the last brainwaveElement of " '0', 0 ", which tells the firmware to turn off the microcontroller. It might be better for sleeping, though, if you add in several more Theta and Delta brainwaveElements added before turning it off.
Going into meditation is somewhat similar to going to sleep, but it is not the same. Meditation requires that you keep some beta stimulated so that you do not fall asleep. The idea of meditation is to stimulate your subconscious mind as well as your deeper unconscious mind while being awake enough to experience it. For sleep, on the other hand, turning off your conscious mind is important, so you want to eventually fade out all Beta. So, start with Beta, then start fading it out while increasing Alpha, then fade Theta in while fading Alpha out. Then pulse some Delta while having mostly Theta. End the sequence with an extended play of Theta. You should be able to find some places on the web where the sleep sequence is well documented.
To wake up, you start out with some Beta, but lots of Alpha, and a little Theta. Then fade out the Theta while fading the Beta in some. Then fade out Alpha while fading in Beta, ending with just Beta.
Going back to sleep after waking up is not so easy for lots of people. My experience is that if you bring people more fully awake, then they will fall asleep much more easily. So, what I have done is do a short wakeup sequence, bringing the person to a "known good state" (so to speak), and then do a sleep sequence. I have found that this works really well for most people.
I hope that gets your creative juices flowing.
Mitch.
Posted by maltman23 on July 03, 2007 at 18:20:17 Pacific Time
- Re: SLM Programming sequences
You must be logged in to reply.
Cool.. Thanks.. finally figured that part out and just removing the back to awake sequence and adding extra delta and theta worked pretty great!I was asleep in no time. If i could fade it out to the off position that would be eggcellent:)
Next question; Now that I feel more confident with replacing data on this thing, is this module capable of only doing one program, or can it run multiple programs?
If not, i suppose i would build several units pre programmed with different routines an use a selector switch to determine which routine would run?
Lastly, is slm capable of making white or pink noise, especially to form the binaural beats? I think that would really be a little easier on the ears to focus on. I did find an headset with inline volume control which helped alot.
Thanks
Bill
Would the same apply to the number of leds it runs?
Posted by whc83 on July 06, 2007 at 23:15:00 Pacific Time
- Re: SLM Programming sequences
You must be logged in to reply.
Hi Bill,
I'm glad you got it going, and that it is helping you sleep.
With some added hardware and updated firmware, you can certainly come up with ways to make the SLM capable of more than one sequence. For example, you could connect a momentary-push-button switch to two of the microcontroller's pins (where pushing the button makes the pin go Low). Then in the firmware:
- add another brainwaveTab with a second sequence
- the two pins with the push-button switches are set as inputs
- at the beginning of the main function, write a loop that waits for one of the two inputs to go Low -- depending on which input goes Low, play one of two different brainwaveTables.
I'll let you do the actual coding, OK?
Making the audio fade out at the end is trickier to do. This SLM project for MAKE is designed to be fun and easy-to-make, but still work well. With more hardware and more complex firmware, a lot more is possible. I am working on a version that is much more pleasing to use, and even more effective. It uses more LEDs (four colors, one for each brainwave type), and has four tones (one for each brainwave type) that smoothly fade in and out (and the sound comes from samples of different musical instruments). I am accomplishing the sound using Pulse Width Modulation (PWM). Describing that is more than I have space for in this blog. But I'll be talking about it at the Chaos Computer Camp 2007 in Berlin in August, and will be glad to talk to you about it if you ask me there. :) I'll be posting more info on it on my Cornfield Electronics website afterwards.
Pink-noise is nice sound, and it easily masks the brainwave frequencies, which aren't so pleasing. Making pink-noise, and just about any other different kind of sound, can be done using PWM, as well as other methods, such as wave-table-lookup. But, again, these methods would take too much space to describe here in this blog.
I hope that whets your appetite for more experimenting.
Mitch.
Posted by maltman23 on July 07, 2007 at 12:32:57 Pacific Time
- Re: SLM Programming sequences
You must be logged in to reply.
lol.. I think I will just play with the section you first mentioned.. I am almost down with that.. as is easy enough to do with out much effort or understanding. The other stuff may take a while to soak up and understand enought to delve into at this point.. But soon.:)
Thanks again for the help.. I am glad you are so involved with this.
Thanks
BillPosted by whc83 on July 08, 2007 at 00:12:57 Pacific Time
- SLM Timing
You must be logged in to reply.
I have my kit up and running, but the timing is off. Comparing to your timing chart, my timing is consistently a multiple of 7 (e.g. 60 seconds lasts 420 sec, 10 sec lasts 70, etc). I built from kit and am programming w/ the USBtiny kit using AVRDUDE. Do you have a fix? Thanks.Posted by zzag on July 07, 2007 at 10:51:43 Pacific Time
- SLM Timing
You must be logged in to reply.
Hi zzag,
My guess is that the oscillator in the microcontroller is running at the wrong frequency. When you listen to the tones in the headphones, are the tones a very low frequency? If you are using the firmware without any modification, and if the oscillator is running at the correct frequency, the tones should be somewhat close to a middle-"A" note on a piano (or other musical instruments). If the tone is very low, then that indicates that your oscillator is too slow. You may be able to fix that by burning the microcontroller's "fuses." They are supposed to be pre-burned for you, but why don't you try burning them again, and then re-programming the SLM firmware?
Here's how to burn the fuses:
If you are using Windows (it is similar for Mac and Linux/Unix), type in the following command line from a Command Prompt window:
make burn-fuse
while the MiniPOV is connected to the serial port and with the battery pack switch powered on. Then you're ready for programming.
I hope that helps. If not, please give me more details on what you see and hear on your SLM.
Mitch.
Posted by maltman23 on July 07, 2007 at 12:42:18 Pacific Time
- SLM Timing
You must be logged in to reply.
Yep, that was it. Don't know how it to messed up, but you fixed it. And yes, it was a low frequency before. With this correct setup I don't go into seizures during the delta. Thanks Mitch!Posted by zzag on July 07, 2007 at 13:14:24 Pacific Time
- SLM Timing
You must be logged in to reply.
I've experienced a similar problem when programming a SLM via the Atmel AVR-ISP mkII programmer. To make AVR-GCC happy, I changed "for (int i=0;..." to "int i;" followed by "for (i=0;..." The first time I programmed the ATtiny2313, everything was extremely slow, but that was because the fuse setting for dividing the internal clock by eight was enabled. I unchecked that box (keeping the other fuses set for 8-MHz internal RC clock) and reprogrammed the 2313, and the sound was correct, but the LEDs flashed at one-seventh the correct rate. I merely changed the "DelayCount=87" magic number to "DelayCount=13," which causes some loss of resolution and accuracy as compared to the original version. Any ideas what causes this slow-delay-loop problem even when the timers are running correctly?Posted by /. on November 19, 2007 at 14:30:27 Pacific Time
- SLM Timing
You must be logged in to reply.
If you are hearing about 400Hz in each ear (with one ear having a slightly higher pitch than the other), then the microcontroller's clock is running at the correct rate (and the timers run off of the micro's clock). The sound works off of the timers. The rate of the LED blinking, however, is determined from the "delay_one_tenth_ms" function. This function requires that DelayCount=87 (otherwise the length of delay will not be 0.1 millisecond times its argument. Since you changed DelayCount to 13, and since 13 is about 1/7th of 87, that would account for the wrong LED blink-rate.
What are you trying to accomplish by changing DelayCount? There is probably another way to do it without affecting the LED blink-rate or the pitch of the sound.
Mitch.
Posted by maltman23 on November 19, 2007 at 15:14:52 Pacific Time
- SLM Timing
You must be logged in to reply.
Sorry, Mitch, let me rephrase that. My SLM started out super slow (both lights and sound). That's when I realized the "divide internal RC clock by eight" fuse was enabled. So I unchecked that box in AVR Studio 4 and solved THAT problem.
Then, the sound was at the proper ~400 Hz binaural beat frequencies, but the LEDs were flashing at around 2.25 Hz (during the first 60-second Beta brainwave element). Looking at the code, it appeared the easiest way to change the LED rate without changing the sound frequencies would be to change the "DelayCount=87," so I changed it to "DelayCount=11," which yielded a Beta flash rate of about 17.25 Hz. I then changed it to "DelayCount=13," which yielded a Beta flash rate of about 14.95 Hz. I just changed it to "DelayCount=14," but haven't had a chance to see how close to 14.4 Hz it will be.
For some reason, if I keep Delay Count set to 87, my RC oscillator rate is the correct 8 MHz (and undivided), my timers are running at the correct rates to produce ~400 Hz sound, but blink_LEDs seems to be running about one-seventh as fast as it is supposed to, and all I changed in the code was declaring "int i;" before the "for" loop to keep AVR-GCC happy, as AVR-GCC had complained that "for (int i=0;..." can only be used in c99 mode.Posted by /. on November 20, 2007 at 08:52:19 Pacific Time
- SLM Timing
You must be logged in to reply.
Wow, I never heard of that happening before. Maybe your micro's fuses are programmed in a funny way? If you try this out (using avrdude in a command window):
make burn-fuse
that might fix things.
On the other hand, your compiler might be doing something different than the gcc compiler. What compiler are you using? What is C99 mode? gcc is an optimizing compiler, and in order to trick the compiler into not optimizing the delay loop away into oblivion I added a statement to toggle an unused PortD output pin (that's what that PIND statement is for in the delay loop). Declaring DelayCount as volatile is probably a better way to do it, but the PortD thing worked, so I left it that way. Maybe your compiler is optimizing differently? I'm really making stabs here.
Mitch.
Posted by maltman23 on November 20, 2007 at 11:12:44 Pacific Time
- SLM Timing
You must be logged in to reply.
Mitch,
I'm using AVR-GCC from WinAVR inside of AVR Studio 4, and using the AVR-ISP mkII for programming. Thus, it should be the same GCC as everyone else is using, as I downloaded it according to ladyada.net's POV3 instructions. C99 is supposedly some C language standard from 1999 that supports declarations of variables inside "for" loops, as supposedly C++ does as well. Since I didn't know how to get AVR-GCC to support the "for (int i=0;..." syntax, I just added a new line with "int i;" immediately preceding the line with "for (i=0;...." Since I understand avrdude to work via the serial interface, and I simply ran vcc, gnd, reset, sck, mosi, and miso to a 6-pin header for the AVR-ISP programmer and omitted the RS-232 connector and its associated resistors and zener diodes, I don't know that I could use avrdude and make burn-fuse to reset my fuse settings. However, AVR Studio 4 allows all fuse settings to be programmed. So, if I knew what all of the fuse settings are supposed to be and what the object code (.hex file) is supposed to be, I could figure out why I'm not getting the same results. Is the slm.hex file available anywhere online? Also, are the fuse settings obtained via make burn-fuse listed somewhere?Posted by /. on November 20, 2007 at 15:36:01 Pacific Time
- SLM Timing
You must be logged in to reply.
If you are using WinAVR, I'm not sure why you needed to change anything to make the firmware compile, since I used WinAVR to develop the firmware. It should understand defining an integer inside of a for loop. But this is probably not very important, since this particular for loop has nothing to do with timing. It is odd, though, that your compiler complained when my WinAVR gcc compiler was fine with it.
I've only been programming using avrdude through the serial port. But programming using AVR Studio should work well. To find out what the fuses should be, take a look inside of the makefile that I zipped together with the "slm.c" file. Search for "fuse" and you'll see that the Fuse Low Byte is burned with 0xe4. The ATtiny2313 datasheet for the ATtiny2313 gives the pin definitions for the Fuse Low Byte, and 0xe4 means:
- do not divide the clock by 8 (CKDIV8=1)
- do not output the clock to the CKOUT pin (CKOUT=1)
- maximum delay to startup upon reset (SUT=10)
- the clock source is the internal oscillator, set to 8MHz (CKSEL=0100)
The Fuse High Byte should be fine by default. But if you changed it, it should be 0xdf:
- DWEN=1
- EESAVE=1
- SPIEN=0
- WDTON=1
- BODLEVL2=1
- BODLEVL1=1
- BODLEVL0=1
- RSTDISBL=1
The hex file wasn't online, but I added it to my website so that you can download it. I'd be curious if your hardware will work if you use it:
slm.hex file .
If changing the fuses didn't make things work as expected, please try this hex file and see if that changes anything. And please let me know how it goes.
BTW, I created a version of the firmware that has an audio base frequency of 200Hz instead of 400Hz. I did this because most people find the lower frequency more comfortable. It is available on my href="http://www.CornfieldElectronics.com"> Cornfield Electronics website (click on the "maker faire" button).
I put the href="http://www.tvbgone.com/mfaire/slm/hex200/slm.hex">
hex file for this on my website too.
Mitch.
Posted by maltman23 on November 21, 2007 at 15:44:01 Pacific Time
- SLM Timing
You must be logged in to reply.
Mitch,
Thanks for all your help. The idiosyncracies seem to stem from the Makefile, which differs from the Makefile that AVR Studio 4 creates by default (if I allow it to). The compiler's problem with defining the integer variable in the "for" loop (as being c99 syntax when the compiler is not in the c99 mode) is solved by including "CFLAGS += -std=gnu99" in the Makefile (as it is in ladyada's Makefile), thereby placing the compiler in the c99 mode.
However, that alone didn't fix my timing problems. I was able to fix my timing problems by using ladyada's Makefile instead of having AVR Studio 4 create its own. I haven't studied the Makefiles in detail, so I don't know what the critical differences are. It's hard to imagine what in AVR Studio 4's Makefile would apparently slow the ATtiny2313 down by a factor of seven.
I had my fuses set to 0xE4 even with the AVR Studio 4 Makefile, so that wasn't the source of my problems.
Thanks for posting the slm.hex file. It works on mine. Perhaps I'll do a file comparison and/or disassemblies of the two .hex files and see what the actual object code differences are.
I also implemented both the 200 Hz and 400 Hz versions. I looked at the ATtiny2313's outputs on a digital storage oscilloscope (DSO) and saw that, even with the ladyada Makefile, the LED flashing rate was about 13.5% too high and both the left and right audio frequencies were about 1.5% too high. I assume the 1.5% error results from clock frequency error of the internal RC oscillator. I don't know the source of the 13.5% LED error. I changed the DelayCount=87 to DelayCount=99 to compensate for the 13.5% error. To compensate for the audio error, I measured the base (left) frequency, then set the OCR1A values based on (((8 MHz * clock error)/(base freq. + beat freq.))/2)-1. The values I ended up with were (for 400 Hz/200 Hz) as follows:
Beta 9640/18641
Alpha 9717/18929
Theta 9837/19392
Delta 9929/19752
where clock error = 1.01088 and base freq. = 405/202.5.
With those values, everything looks right on target on the DSO. Thanks again for helping me solve my SLM timing problems. If I find out more about the source of the Makefile idiosyncracies, the .hex file differences, or the source of the clock errors, I'll post updated information.Posted by /. on November 23, 2007 at 14:30:13 Pacific Time
- SLM Timing
You must be logged in to reply.
I bet the difference in timing is due to the command line options for the compiler being different in the makefile from ladyada and the one from AVR Studio -- probably the AVR Studio one didn't have the optimizing turned on, making the delay loop a lot longer.
The 1.5% error is insignificant as far as brainwave entrainment goes (and it probably is from the internal oscillator being 1.5% off from 8.00MHz). 13.5%, however, is pretty big. I'm not sure why the blinking lights would be so far off. But it is cool that you got things going well. :)
Please do post if you find out more about why the LED blink rate is off.
Mitch.
Posted by maltman23 on November 23, 2007 at 21:38:02 Pacific Time
- A couple of construction tips
You must be logged in to reply.
Hi Mitch. Great project. I have a tip that should make step 2e easier. I have alot of experience soldering but soldering the Kynar wire on the pads in step 2e looked a bit tricky. So I after step 2b I left the capacitor leads in place and when I got to step 2e I bent the end of the Kynar wire into small hooks and attached them to the capacitor leads, pushed them down against the pads and then soldered them. This made it alot easier to ensure the wire was in place during the soldering.
One other thing tip - I wasn't exactly sure what to buy for the silicone adhesive - until I looked very carefully at the photo of the parts and noticed that it's aquarium sealant. The finding a small tube of it was a snap.Posted by cyber_alchemist on July 08, 2007 at 19:38:40 Pacific Time
- A couple of construction tips
You must be logged in to reply.
Hi cyber_alchemist,
Thanks much for your tips.
Soldering can be done in many different ways, and it's a matter of personal taste what works best for anyone. I like your suggestion for step 2e. Some people may find it easier to solder wires as you described. Others may find it easier to heat up the solder already on the pad, place the tinned wire in the solder, and hold still a few seconds until the solder hardens. I encourage people to experiment, and see what works best for you.
Thanks for pointing out more about the silicone adhesive. As well as aquarium sealant, the silicone adhesive may also be better known as bathtub caulk. They come in many colors, as well as clear.
Mitch.
Posted by maltman23 on July 08, 2007 at 19:51:13 Pacific Time
You must be logged in to reply.
I finally got the controller programmed and all of the connections straightened out, but I haven't been able to find any of the 30 guage wire. Is it OK if I use 28 guage wire that is not wrapped? Or are there any other solutions that anyone has? Thanks.Posted by chennate on July 10, 2007 at 14:32:09 Pacific Time
- 30 gauge wire
You must be logged in to reply.
Hi chennate,
Feel free to use any kind of wire. Please do a search for the word "kynar" further down this blog page, and you'll see some discussion about the advantages and disadvantages of using 30-gauge wire-wrap wire.
If you do want to use 30-gauge wire, it is available at many places, including:
Mouser:
http://www.mouser.com
and do a search for:
801-R30
Radio Shack:
http://www.radioshack.com
and do a search for:
kynar
Mitch.
Posted by maltman23 on July 10, 2007 at 23:39:11 Pacific Time
- Programming
You must be logged in to reply.
Having trouble installing slm programming.
I am using xp and opened the command prompt.
Is this where to use the slm program.
What else is there to do?
tvPosted by TVinU on July 14, 2007 at 12:31:48 Pacific Time
- Programming
You must be logged in to reply.
Can you be more specific about the problems you are having? What have you tried, and what happened?
Before proceeding with the programming, however, you need to know that the hardware is working. Did you get the MiniPOV hardware to work? I mean, did the 4 LEDs blink when you powered it on?
Once the hardware is working, you'll then need to download and install WinAVR (for Windows). Did you download and install WinAVR? If so, then following the instructions from the article should get you going.
The Command Prompt window is the correct place to type in the programming commands.
If you need it, here are the instructions from Ladyada's website for downloading and installing WinAVR for Windows:
http://ladyada.net/make/minipov3/software.html
The easy-to-follow, step-by-step instructions here are excellent! (There are instructions here for MacOS and Linux/Unix as well.)
Please feel free to ask more questions if you're still having problems.
Mitch.
Posted by maltman23 on July 14, 2007 at 19:53:59 Pacific Time
- Problems with my Audio
You must be logged in to reply.
Hello,
This is an amazing project, but i am unable to get the audio to work. I have connected everything as described, but have run into a road block with the audio. I burned the fuses as i read someone else had audio issues, but it still will not work. I am quite proficient with soldering, and there are no bridges and I believe that everything is connected properly, but obviously it is not since i get no audio. Any help would be really appreciated. Thank youPosted by tehCaptin on July 15, 2007 at 11:46:52 Pacific Time
- Problems with my Audio
You must be logged in to reply.
Hi tehCaptin (or should it be theCaptin?),
I'll be happy to help get you going. We'll need to debug your circuit. Debugging can seem somewhat daunting at first, but after you figure it out, it feel real good. :)
First I'll need some more info to help you debug. Are you following the procedure in the article (I would recommend doing that)? If so, did you test the MiniPOV after you soldered all of the parts (with the exception of LED1-4 and R5-6) onto the PC Board? Did the 4 stuffed LEDs light up? Did you then program the MiniPOV with the VVVVV pattern? Did that work when you waved it back and forth? I take it you soldered in the two 1uF caps and two 1K resistors and the headphone jack, right? If these are in correctly, then after programming in the SLM firmware, when you power up you should see the two LEDs for the eyes pulsing, and with headphones plugged into the jack you should hear a slightly different tone in each ear. Were you able to successfully program the SLM firmware? If so, when you power up do you see the two eye LEDs pulse?
Answer the above, and we'll take it from there. It may also be helpful, if you have the ability, to take nice, clear (not blurry) photos of the top and bottom of your board, and send me a link to where I (and everyone else) can see them.
Mitch.
Posted by maltman23 on July 15, 2007 at 13:11:08 Pacific Time
- Problems with my Audio
You must be logged in to reply.
Mitch,
Thank you so much for your fast response. I have fixed the issue with the audio. I failed to run the
make program-slm
before, I thought i had done that but apparently not.
I have another question though.
I was reading further down about how to lower the frequency of the sounds, I understand where the changes need to take place in the code, but i do not understand how to get the proper numbers. ie beta was 9520 and if you set cr0a to 77 then it is 18436. If anyone could help me understand the math involved I would be greatful, I am sorry if this is a stupid question, as the other post was a waste of your time.
thank youPosted by tehCaptin2 on July 15, 2007 at 15:35:14 Pacific Time
- Problems with my Audio
You must be logged in to reply.
i have no idea why it posted that so many times i am sorry, please delete.Posted by tehCaptin2 on July 15, 2007 at 15:41:16 Pacific Time
- Problems with my Audio
You must be logged in to reply.
You bet -- I removed the duplicates. Sorry for the inconvenience!Posted by terrie on July 16, 2007 at 09:52:59 Pacific Time
- Problems with my Audio
You must be logged in to reply.
Mitch,
Thank you so much for your fast response. I have fixed the issue with the audio. I failed to run the
make program-slm
before, I thought i had done that but apparently not.
I have another question though.
I was reading further down about how to lower the frequency of the sounds, I understand where the changes need to take place in the code, but i do not understand how to get the proper numbers. ie beta was 9520 and if you set cr0a to 77 then it is 18436. If anyone could help me understand the math involved I would be greatful, I am sorry if this is a stupid question, as the other post was a waste of your time.
thank youPosted by tehCaptin2 on July 15, 2007 at 15:36:39 Pacific Time
- Changing audio frequencies
You must be logged in to reply.
In the firmware there is a line in the main function that has two misprints:
// OCR0A = value for Beta, Alpha, Theta, or Delta (i.e., 9520, 9714, 9836, or 9928)
The line should read:
// OCR1A = value for Beta, Alpha, Theta, or Delta (i.e., 9637, 9714, 9836, or 9928)
That line is only a comment, so it won't make any difference in the way the firmware functions.
The comment refers to the values for setting up Timer1 to output the correct offset frequency for each of the four brainwave types. These values assume a base frequency of 400.641Hz, generated by Timer0 (by setting up OCR0A, in main).
If you look at the do_brainwave_element function (the one above main you will see where OCR1A is set to the values for each brainwave type.
If you want to change the audio to be a lower frequency, you'll need to change the base frequency by setting up OCR0A to a higher number (in main, and you'll need to change the offset frequencies by changing the values for OCR1A to higher values for each brainwave type (in do_brainwave_element).
The equations for doing so are given in the comments in the firmware (in both main and do_brainwave_element):
F = Fclk / (2 * Prescale * (1 + OCR0A) ) = 400.641Hz
Output frequency = Fclk / (2 * Prescale * (1 + OCR1A) )
For both of the above equations,
Fclk = 8,000,000
For OCR0A
Prescale = 256
For OCR1A
Prescale = 1
Given a desired output frequency, you should be able to solve for the proper value of OCR0A (base frequency), and the four values for OCR1A (four offset frequencies for each brainwave type).
For your convenience, here are the offset frequencies for each of the four brainwave types:
Beta 14.4Hz
Alpha 11.1Hz
Theta 6.0Hz
Delta 2.2Hz
More info is given in the extensive firmware documentation I wrote up, which you can get by clicking on the "SLM Documentation" link, above the photo of the trippy glasses.
I hope that gets you going.
Mitch.
Posted by maltman23 on July 15, 2007 at 16:19:13 Pacific Time
- Problems with my Audio
You must be logged in to reply.
sorry for another question but does anyone know what kind of zener diode this uses? i would like to build another pov but would like to make it myslef and do not know which specific zener diode is used. thank youPosted by tehCaptin2 on July 15, 2007 at 16:06:20 Pacific Time
- Problems with my Audio
You must be logged in to reply.
The part number for the zener diodes is kind of hard to read, but it is actually printed on the diodes. In the kit I just opened, the zeners are 1N5231. But looking through some Ladyada's postings on the user forum on her website, she says that any zener diode between 3.6v and 5.1v is fine. 1N5231 is 5.1v.Posted by maltman23 on July 15, 2007 at 17:39:22 Pacific Time
- adding some abient sounds?
You must be logged in to reply.
Mitch,
I cannot tell you how much I love this project, I would like to add some sound in with the brainwaves, like rain falling.
I am fairly new to the whole microprocessor programming so if this is stupid i am sorry. I would like to have a small audio track loop like 3 seconds (or so) of rain falling to play with the brainwaves. Is this possible? I am not opposed to using a separate microcontroller and then adding in two small speakers in the headset that is connected to the SLM. So essentially I would like to have one playing a small rain loop and then the SLM doing its thing. any help or suggestions, or even telling me "that is not the right way to do that" would be great. Thanks for your time and response, in advance.
Posted by tehCaptin2 on July 16, 2007 at 09:09:46 Pacific Time
- adding some abient sounds?
You must be logged in to reply.
I have found software that aids in converting wav files to 1bit format so it can be stored and played on a pic or atmel, here it is incase anyone else is interested in this as i am.
http://www.romanblack.com/picsound.htmPosted by tehCaptin2 on July 16, 2007 at 14:45:15 Pacific Time
- adding some abient sounds?
You must be logged in to reply.
Cool! You have been researching while I was typing my last response...
The link you gave is one way (a really good, simple way) of having a micro play back a sound recorded in memory. You can do this with a separate micro, or you can have the same micro do both the SLM and the added audio. Doing SLM and audio at once is trickier for a beginner (I haven't used the new Propeller chip, by parallax, yet, but it might be ideal for this, since it has several totally independent micros all in one chip -- and each one can be programmed to do a different task.) (In the more complex version of SLM that I am currently working on, I am generating brainwave audio mixed in with other audio, using one Zilog micro that runs at 20MHZ, that has PWM timers, and also has a bunch of high-powered instructions, such as multiply, that execute in one machine cycle.)
If you use a separate micro to generate the audio, then it becomes an audio player, and to mix its sound in with the SLM you can add the simple audio mixer that I described in my previous response.
Mitch.
Posted by maltman23 on July 16, 2007 at 15:04:00 Pacific Time
- adding some abient sounds?
You must be logged in to reply.
Mitch,
since i am still fairly green with this subject I will more than likely just program a seperate chip. The propeller chips do look amazing i almost placed an order for some this afternoon when ordering other items.
Are you plannig on releaseing another "how to" simmilar to this one for your more complex brainwave machine? and if not is it possible for me to give you my email address in a more private way as to create a communication so i know when your new SLM is finished and posibly how to get/buy the plans and firmware from you, for personal use only.Posted by tehCaptin2 on July 16, 2007 at 18:40:43 Pacific Time
- adding some abient sounds?
You must be logged in to reply.
I wasn't planning on writing another article about my more complex brain machine.
If you'd like to keep informed with what I'm up to, I have a newsletter that you can sign up for on the TV-B-Gone website:
http://www.tvbgone.com/cfe_tvbg_buy.tvbg.php
click on the link at the right that says:
"Join our e-mail list!"
If you would like to email me, please write to:
info AT tvbgone DOT com
Mitch.
Posted by maltman23 on July 16, 2007 at 20:27:06 Pacific Time
- adding some abient sounds?
You must be logged in to reply.
Adding ambient sounds is a great idea! Thing is, though -- it isn't so easy to do (which is why I didn't add it with this project). But I will suggest a pretty easy way to add audio. Read on...
Brainwave frequencies aren't very musical, so it would be nice to mask the binaural beats with other more pleasing sounds. Rain or waves work really well for this since they consist mostly of pink noise, which is well known for being both pleasing and good for masking even very loud nasty noises (for example, pink noise is often used in noisy factories to make the environment better for employees).
Using a microcontroller to generate sound is done all of the time. Unfortunately, I don't have enough space here to talk about exactly how to do it. If you want to do some research, I'll just say enough to get you going. There are two main ways that you can go: One is to write firmware that actually calculates the pink noise using an equation. The other way is to have a short digital recording of a rainstorm (or waves) stored in memory, and have the micro repeat the short sequence repeatedly. Either way you'll need a Low Pass Filter at the output (somewhat similar to the simple one that the SLM uses, made with a capacitor and resistor, to smooth out the square waves into something more sinusoidal). The latter takes up more memory, but it is usually nicer, since straight pink noise is less interesting and less pleasing than rain or waves.
Rather than the above, more challenging approach, how about an easier alternative? You can use an MP3 player (or any kind of audio player) and mix the audio from it into each speaker. There is no need to add more speakers, since you can mix the sound directly into the existing headphones. To do this you will need to add a simple, passive audio mixer to the SLM, as well as another headphone jack that will go to the output of your audio player -- we'll call this "Audio In". The headphone jack has 3 pins (just like the headphone jack already on the SLM): 1 is ground, and the other two are the left and right audio (and for this project, it doesn't matter which is right and which is left). Connect the Audio In ground pin to the SLM circuit ground, and connect a 1K ohm resistor between one of the audio pins of the Audio In jack and one of the headphone jack audio pins. And connect another 1K ohm resistor between the other audio pin of the Audio In jack and the other headphone jack audio pin. That's it. Then you should hear whatever is played on your audio player mixed into the audio from the SLM.
Try experimenting with different audio, and see what helps you meditate better. If you try out different brainwave sequences (like a Wakeup sequence), you may find that mixing in different audio helps better (punk rock, or other dance music of choice, works great for this, though it's best to start with something soothing, and then slowly add in the more energetic music as the brainwaves go more towards Beta).
Enjoy,
Mitch.
Posted by maltman23 on July 16, 2007 at 14:48:31 Pacific Time
- adding some abient sounds?
You must be logged in to reply.
Mitch,
Thank you that is exactly what i would like to do is add a few seconds of audio to a chip. I was thinking 2-3seconds of rain and 2seconds of thunder and then write a program to loop the rain track and randomly 1-3 times per 5min throw in the thunder track. Do you think that using the software in the link is the best way to record audio to a the Atmel Microcontroller. Also do you think it is possible to utilize the chip already being used in the SLM or would a new board have to be made then splice in the audio you described? I am sorry for all the questions I am just facinated by this and have been for many years and am so excited that you have created this amazing project for so many to enjoy.Posted by tehCaptin2 on July 16, 2007 at 18:07:43 Pacific Time
- adding some abient sounds?
You must be logged in to reply.
The BTc software from Roman Black looks like a quick way to convert a short .WAV file on Windows into a form that can easily be played back in a micro. Since you're a beginner, I'd recommend doing the audio-player as a separate project (rather than combining it on the same micro as the SLM). You'll need a microcontroller, an external flash memory to store the audio info, and a resistor and capacitor for a Low Pass Filter. Then you'll need to write firmware to output the audio bits to an output pin at your sample rate. Once you have the audio going you can mix it into the SLM audio as I described earlier. This blog isn't an appropriate place to get into any more detail about the audio player project. But it is a fun project, and I hope what I've been able to get you a good start.
Mitch.
Posted by maltman23 on July 16, 2007 at 20:02:33 Pacific Time
- SLM folder&programming
You must be logged in to reply.
Mitch,
I am still not getting something in step 1e.
I got the hardware to work the led's to light after changing the serial cable from a belkin to the one recommended from newegg.
I got the vvvvv to light but not from an slm directory,from ladaynet instructions. Now can't get to change to the slm programming.
Where does the slm folder go or what do I need to do?Posted by TVinU on July 18, 2007 at 04:58:41 Pacific Time
- SLM folder&programming
You must be logged in to reply.
Yesssssss.
Got it. ThanksPosted by TVinU on July 18, 2007 at 16:44:25 Pacific Time
- SLM folder&programming
You must be logged in to reply.
So, you got it working? Are you having fun hallucinating?
Mitch.
Posted by maltman23 on July 19, 2007 at 00:43:06 Pacific Time
- SLM folder&programming
You must be logged in to reply.
Yes got it working and lots of fun to use.
It was a really good project to make.
Can't wait to see what you have next!Posted by TVinU on July 19, 2007 at 09:41:48 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
I just finished my first try at the machine. What a great project!
My soldering experience is very limited (and comes from the era of "the bigger the blob, the better the job"), so I was pretty nervous about soldering such fine connections. But, I guess I got pretty lucky because it worked the very first try with no problems at all.
I did make a few design choices that made it come out looking pretty nice. For one, I chose a project enclosure so that I wouldn't have a circuit board stuck to the side of my glasses. The enclosure helps a lot: I drilled a 1/4" hole where I was able to properly mount the headset jack, and I cut another tiny hole for the LED and battery pack wires to come through and used some of the silicone on the inside for strain relief. A square hole cut into the front allows the 9-pin connector to come out just far enough to allow a cable connection. (I did make the mistake of choosing an enclosure that wasn't tall enough to accomodate the capacitors that I'd already soldered onto the board, so I had to drill a couple holes in the top where they stick out a tiny bit (almost flush with the top surface). Next time, I'll try to find smaller capacitors or I'll mount them horizontally.
Next, insteadof using sunglasses, I used a pair of safety glasses - the kind you're supposed to use when around power tools. This has a couple good benefits: The plastic is thicker, so the LED's mount much more securely. A 13/64" drill bit made holes that the LEDs practically snap into, so no glue was needed on the outside. Another benefit to the safety glasses is that they have a lot of clearance on the inside - so I drilled a tiny hole at the top of the frame abve each LED and routed the wires inside. I drilled another into the sides where the arms meet the face of the glasses, and used that for routing all the wires. The result is that there are very few visible wires so it looks very pro.
I mounted the enclosure on one side and the battery pack on the other (with the switch pointing inward so that the batteries can be changed without removing the pack. I used the silicon to mount the enclosure and battery pack to the glasses (another benefit to using safety glasses: The sides are huge and have lots of gluing surface).
One question: Where would I connect a potentiometer to provide a volume control without dimming the lights? The enclosure has enough room to mount a little knob, and I think that would be a great feature so that volume-controlled headphones become unnecessary.
If you can't tell already, I had a blast with this project. I plan on making several of them. I'd REALLY love to be able to have five or six different programs selectable by a switch, but I'm thinking that would require three chips and lots more wiring. I might instead just make a collection of different machines, each dedicated to a single program. (1. The current meditation, 2.get to sleep, 3.increase alertness, 4.relax, 5.stimulate lucid dreaming.)
Thanks for such a great project!
WaynePosted by WayneZ on July 18, 2007 at 19:48:36 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Hi Wayne,
Thanks for the fine suggestions on making you SLM look more pro. Would you be able to take some photos and put them online, and reply with links so that we can all see what you did?
Lots of people who have never soldered at all have built this project, so it's not surprising to me that you were able to make yours work first time, given your past soldering experience (even if it is big-blob). All the same, it feels nice when it works first time, doesn't it?
Regarding adding volume controls:
Do a search on this webpage for "potentiometer" -- and you'll find your answer. You can either use one double-pot, or, since you have plenty of room, use one regular pot on each side of your glasses.
If you are comfortable playing with firmware, why not go ahead and put multiple sequences in one SLM? You'll need to add switches, and program the micro to look at the switches, and play a different brainwaveTab (or, a different part of one brainwaveTab) depending on how the switch reads out. And if you're not feeling all that comfortable changing the firmware, this would be a wonderful project to start becoming comfortable.
Please let me know how it goes.0
Mitch.
Posted by maltman23 on July 19, 2007 at 00:41:08 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Happy to! Here's a dozen or so pictures on Flickr: http://www.flickr.com/gp/9277058@N08/782Yjy
I've never done any assembly programming at all. I read the paragraph in the article about changing the frequencies, and that seems simple enough. Actually changing the functionality of the program and getting it to read a switch and act accordingly sounds WAY over my head. (I've been a programmer for years, but I've never touched anything the low level. I'm more of a PHP and Perl man.)
It would be cool to mount a four position DIP switch and use it to select up to 16 programs, but I wouldn't even know where to begin.
As for the pot, in the name of simplicity, could it be just a single pot on the ground wire from the jack - or is that too late in the circuit?
Posted by WayneZ on July 19, 2007 at 12:09:39 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Thanks for the photos! The pictures are a bit blurry, but they're good enough to see what you did. Your glasses look really nice!!
(Not all cameras can focus on objects closer than 2 or 3 feet.)
If you can do program in PHP and Pearl, then programming a micro to read a switch should be a fun challenge. :) It is a basic firmware task, and if you can get a micro to do that, then you can become a firmware geek! I'll just say enough here to get you going, if you're interested in trying it out:
Each pin of the micro can be programmed via the DDRB register to be input or output (in the "slm.c" file, you can see that I set all 8 PortB pins to outputs by setting all DDRB bits to 1). You'll want to set the corresponding bit of the DDRB register to 0 to make that bit an input. For example:
DDRD = 0b00001111;
makes pins 2, 3, 6, and 7 of the micro to be inputs (these are the pins for Port D pins 0, 1, 2, and 3, respectively).
To see if an input pin is High or Low, you just do a read of the port register. For example:
Foo = PORTD;
will get all 8 bits of Port D into the variable Foo.
Then mask out the bit you want. For example:
Foo = Foo & 0b0000001;
will zero out all bits of Foo except the lowest bit, bit 0, so if Foo is now equal to 0, PD0 was low when you read it, otherwise it was high.
The hardware is pretty simple:
Each switch has two contacts. Connect one to ground, and the other to one of the Port D pins of the micro. (The micro has built in pull-up resistors, so the pin is high is the switch is off, and the pin is low if the switch is on, connecting the pin to ground.)
As for the pot for the volume control:
using a single pot in the way you suggest should work fine; disconnect the ground wire from the headphone jack, and connect the pot between the ground contact on the headphone jack and ground. I'd suggest using an audio taper pot with a value of 1K or greater.
Mitch.
Posted by maltman23 on July 20, 2007 at 11:40:48 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Interesting...
So, as I look at the PCB with the completed project, I see that the four LEDs directly stuffed onto the board connect to pins 16, 17, 18, and 19 (PB4, PB5, PB6, and PB7, respectively), through resistors. And they seem to not be used for anything.
If I understand your directions, that means I could eliminate those four LEDs and those four resistors and put a four-position DIP switch unit there instead, giving me 16 possible switch combinations.
To set those pins as inputs I would issue:
DDRB = 0b11110000;
To read them I could do something like:
switch = PORTB;
switch1 = Foo & 0b0001000;
switch2 = Foo & 0b0010000;
switch3 = Foo & 0b0100000;
switch4 = Foo & 0b1000000;
Then, an if statement with 15 elses is all I would need to maintain 16 different brainwave tables.
Is this all correct? If so, I need to go get me a dip switch! :)
WPosted by WayneZ on July 20, 2007 at 15:52:46 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
You are very close.
Even though the 4 LEDs aren't being used, two of these pins are used for programming the micro. So, rather than use these 4 pins, why not use 4 pins from PortD, instead, none of which are used for anything?
When using the DDRD register, writing a 1 to a bit makes that pin an output, and writing a 0 to a bit makes it an input. If you use PD0, PD1, PD2, and PD3 (which are physically pins 2, 3, 6, and 7 on the chip), then you would write
DDRD = 0b11110000
to make them inputs. Then, to grab the info from the DIP switch:
switch = PORTD;
switch1 = switch & 0b0000001;
switch2 = switch & 0b0000010;
switch3 = switch & 0b0000100;
switch4 = switch & 0b0001000;
You can use a whole bunch of IF statements, but why not make use of the CASE statement? It will make your code easier to read if you do.
To find out more about the CASE statement (or any other aspect of C), you can do a search on google for
"c language tutorial case statement"
and you'll see some really good C tutorials. One I like is from the original authors of the C language, Brian Kernighan (along with Dennis Ritchie).
Go out and buy your dip switch, and have at it!
Mitch.
Posted by maltman23 on July 20, 2007 at 16:10:03 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Ah, of course. I didn't look at the traces on the PCB and made the silly assumption that all the pins on the chip went somewhere on the board. Now that I look at it, I can see my error.
And that's great news: It means I can actually add the switches to my existing circuit without changing anything else.
Radio Shack didn't have a four-position dip switch, so I ended up buying three mountable flip switches. (They only had three in an acceptable style.) Three gives me the number I really wanted in the first place anyway, and now it'll be easier to switch program parameters anyway.
I'll let you know how it goes.Posted by WayneZ on July 21, 2007 at 10:39:04 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
I've got my switches hooked up, and the program is compiling fine, but something is still not right.
Before adding the switches, the machine was rock-solid - it worked every time I turned it on. Now, sometimes it kind of works and sometimes it doens't work at all.
In order to be able to test the switches, I made four brainwave tables - each with just a single brainwave. One goes for four seconds and then turns off, one goes for eight, one goes for 15, and one goes for 30. (I decided to only use two switches for the tables and I'll use the third to select a higher or lower frequency set.)
The problem is that when I turn it on, it usually (2 out of 3 times) does nothing. The rest of the time, it runs for 4 seconds regardless of switch positions.
I've checked all the soldering and everything looks fine.
My main suspicion now is that a seemingly-logical shortcut that I took might be causing the problem. Rather than wire each of the three switches to ground individually, I ran a wire between all three of them and then connected the center one to ground. (Ground, in this case, was the ground terminal of LED1.) That should work, I think, but I thought I'd ask you about it since it seems the only likely culprit.
Any thoughts?
Posted by WayneZ on July 21, 2007 at 19:37:55 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
I should mention that I also reloaded the original slm program and tested, and it's still rock-solid there. This is definitely something going wrong with the switch-related changes.Posted by WayneZ on July 21, 2007 at 19:47:02 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
If it works well with the original code and with the DIP switches soldered in, then you definitely have a firmware problem. Strange that it behaves differently sometimes...
Hooking up the grounds as you described is no problem -- as long as one side of each switch goes to ground, we're fine with the grounds. Be sure you actually connected them to ground, though, and not to a pad with some other function. The ground for all of the LEDs are the pads on the edge of the PCB.
Debugging firmware is the fun part! Here is one approach. Since you know that things work with the original SLM firmware, start with that. Then add a little bit of new code at a time, compiling and programming each time. For instance, start out by adding only one line of firmware (to the main function, just under the 3rd line of initialization):
DDRD = 0b00000000;
(Let's keep all of the pins as inputs.)
Then compile and program the chip, and see if it works. The addition of this line should have no effect on the SLM.
If that was successful, then, add code to read two switches (just under the initialization lines in the main function):
switch = PORTD;
switch1 = switch & 0b0000001;
switch2 = switch & 0b0000010;
Compile and program and make sure it still works. Hopefully there is still no effect on the SLM.
Now let's add some debugging code to see if we're really reading the switches! Add the following code to the main function (just under your last lines of added code):
if (switch1) PORTB |= 0b00010000; // turn on LED at PB4
else PORTB &= 0b11101111; // turn off LED at PB4
if (switch2) PORTB |= 0b00100000; // turn on LED at PB5
else PORTB &= 0b11011111; // turn off LED at PB5
And comment out the rest of the main code (by putting
/*
just under the line of code you just added, and putting
*/
just before the last section of code in main (i.e., just above the line that says "Shut down everything..."
Now compile and program the micro with the above changes. With the power off, set the switches to both off, and when you turn the power on, all of the LEDs that are on the PCBs should remain off.
Turn off the power, and turn on switch1, and when you turn on the power, the LED closest to the serial port connector should light up.
Repeat the above, but with both switch1 and switch2 turned on, and when you turn on the power you should see two LEDs light up. Cool, eh?
So, now you're reading switches.
Now add one other brainwave sequence to the code, but leave the code as above, otherwise. Can you still read the switches? If so, add the other 3 brainwave sequences, one at a time, compiling and programming the micro each time. If you're able to read the switches each time you power up, then you're now set to do a different sequence depending on the settings of your switches.
If the code broke at any one of the above steps, now you know which part of your code is making things mess up, and therefore, you know where to look to debug that part of code.
That's enough to get you going. Let me know how it goes...
Mitch.
Posted by maltman23 on July 21, 2007 at 20:42:40 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Mitch, I really appreciate the amazing support you're providing here and I hope I'm not being too much of a pest.
It just doesn't seem able to read the switches. I did as you suggested and started over with the original file. Once I added the code to turn the LEDs on or off by switch position it just doesn't work. (I commented out the rest of the main program.)
When I first added the code, it complained about the variables not being declared. So I gave each of them an int type. Here's what I've added:
(After the first 3 lines of initialization)
DDRD = 0b00000000;
(After the rest of the initialization)
int swtch = PORTD;
int swtch1 = swtch & 0b0000001;
int swtch2 = swtch & 0b0000010;
if (swtch1) PORTB |= 0b00010000; // turn on LED at PB4
else PORTB &= 0b11101111; // turn off LED at PB4
if (swtch2) PORTB |= 0b00100000; // turn on LED at PB5
else PORTB &= 0b11011111; // turn off LED at PB5
The rest of main is commented out (other, of course, than the end '}' ).
Regardless of switch position, nothing lights up.
I took a continuity tester to the circuit and verified that the switches are working. I put the test leads on ground and right on each physical chip pin that has a switch. In each case the switch controlled continuity. So the circuit's gotta be good. Right?
I also noticed that the statements "int swtch1 = swtch & 0b0000001;" and "
int swtch2 = swtch & 0b0000010;" only had 7 digits after the 'b'. In case that was a typo, I tried using 0b00000001 and 0b00000010, but that didn't do anything either.
I feel like I'm so close on this, but I just can't quite figure it out.
Posted by WayneZ on July 21, 2007 at 22:23:46 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Hey Wayne,
You are close. But let's take this off line. Can you email me your email address? Please email your email address to:
info@TVBGone.com
and we can take it from there...
Mitch.
Posted by maltman23 on July 21, 2007 at 22:36:38 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
I'd really love to find out more about adding switches to make multiple SLM programs available in the firmware. Is there anyway you can continue this conversation on this board again?
Now to share a little bit:
I happen to be in neurofeedback therapy for my ADHD symptoms (doing very well after a few months) and I made this project because I figured either I can use this to help my brain or at least get "high."
So far, I've really enjoyed it. I've been using the meditation sequence for relaxation and modified the firmware to use lower tones (base frequency = 200.321) and linear transitions (search this page for "linearSlope").
After talking with my doctor, he spoke with his associates who are experts in the field of entrainment and he recommended that I entrain my Beta waves and told me to build a program using the following frequencies: 10 Hz, 15 Hz, 13 Hz. I made an Excel sheet to do the math and reprogrammed the firmware to run a 15-minute program--equal times at each of the three frequencies and the transitions between them.
Right now, I'm trying to work off this discussion so I can add a hardware switch and store my Beta training and meditation on the SLM at the same time.
I'd love to hear what you guys have figured out so far.
Thanks.Posted by zgoldberg on August 14, 2007 at 12:31:48 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Please see up above, where I'll post some code that works for adding switches to the Brain Machine (the columns get too narrow to read code after these many responses on this blog).
Mitch.
Posted by maltman23 on August 17, 2007 at 15:08:42 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Your doctor's advice goes along with what I've read about ADHD -- you need to avoid the lower frequencies, and focus on the higher frequencies. Please let us all know how it works (or not) for you by posting again.
Thanks,
Mitch.
Posted by maltman23 on August 17, 2007 at 15:10:52 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Looking back on what I wrote here, see that I contradicted myself, which makes things very confusing. Sorry about that!
Here is the (unambiguously) correct way to set a PORTD pin as an input: set the corresponding bit of the DDRD register to 0 to make that bit in PORTD an input. For example:
DDRD = 0b11110000;
makes PD0, PD1, PD2, and PD3 inputs (that corresponds to pins 2, 3, 6, and 7 of the micro, respectively). (PORTB works the same way, but it uses DDRB to control the direction of its pins.)
To activate the micro's internal pullup resistor for a pin, set the corresponding pin in PORTD to a 1 (after setting up the pins as inputs with the DDRD register). For example, to activate the pullups for PD0, PD1, PD2, and PD3, do the following (after setting the DDRD register):
PORTD = 0b00001111
Mitch.
Posted by maltman23 on July 22, 2007 at 15:08:55 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Your mods look really nice but as I was looking at it, it reminded me of some sort of mp3 player. So I thought, If you extended a lot of the wires so that the project box and the battery pack went down to your pocket, used small ear buds that would sit on the glasses (think Oakley "Thump"), wraped the wires up with the headphone wires, and shrink tubed the major cable at different intervals. This would look so awesome, I think I may do this to mine so that I don't have to wear heavy glasses buy light weight glasses with one wire that would contain the headphone wires and the two LED's power lines.Posted by dannydutton on August 02, 2007 at 18:57:31 Pacific Time
- Up and running - a few mods
You must be logged in to reply.
Your mods look really nice but as I was looking at it, it reminded me of some sort of mp3 player. So I thought, If you extended a lot of the wires so that the project box and the battery pack went down to your pocket, used small ear buds that would sit on the glasses (think Oakley "Thump"), wraped the wires up with the headphone wires, and shrink tubed the major cable at different intervals. This would look so awesome, I think I may do this to mine so that I don't have to wear heavy glasses buy light weight glasses with one wire that would contain the headphone wires and the two LED's power lines.Posted by dannydutton on August 02, 2007 at 18:59:49 Pacific Time
- SLM for sleep!
You must be logged in to reply.
Hi Mitch,
First off, thank you so much for this great project. Im hoping to put your inventiveness to good use for some friends and I, but I was hoping you could help me.
Id done some research on sleep patterns in the past and learned that our sleep cycles proceed in phases (essentially from alpha waves, to theta, to delta, back to theta, then beta for REM and the cycle repeats starting with the first theta portion.) I also remembered reading that even when we take a fifteen minute power nap, our brain spends a little bit of time in each phase (even though a typical sleep cycle lasts approximately ninety minutes.)
In short, I was hoping to use the SLM to reproduce our natural sleep cycles in a much shorter timeframe and run experiments on a short and long-term basis. Imagine getting in several sleep cycles in the amount of time it would normally take to get through one!
I began by altering your code as seen below. This is the only portion of the code I changed (although ultimately Ill need to alter the frequencies to take into account spindles and k-complexes.)
} const brainwaveTab[] PROGMEM = {
{ 'a', 2700000 },
{ 't', 2700000 },
{ 'd', 1575000 },
{ 't', 2700000 },
{ 'b', 1575000 },
{ 't', 2700000 },
{ 'd', 1575000 },
{ 't', 2700000 },
{ 'b', 1575000 },
{ 't', 600000 },
{ '0', 0 }
};
Now, Ive saved this c-file as hsleep1 and when I run make hsleep1.hex there doesnt appear to be a problem. However, things get crazy when I try to run make program-hsleep1.
********************************
C:\slm>make program-hsleep1
avrdude p attiny2313 -: com1 -c dasa U flash:w:
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.59s
avrdude: Device signature = 0x1e910a
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the D option.
avrdude: erasing chip
avrdude: reading input file // I think is where it crashes
avrdude: error opening : No such file or directory
avrdude: input file auto detected as invalid format
avrdude: cant open input file : No such file or directory
avrdude: write to file failed
avrdude: safemode: Fuses OK
avrdude done. Thank you.
make: *** [program-hsleep1] Error 1
******************************
If anyone out there could give me some ideas on how to correct whatevers going on, Id greatly appreciate it. Thanks again Mitch for the awesome project.
Robert
Posted by PCSA on July 19, 2007 at 13:54:54 Pacific Time
- SLM for sleep!
You must be logged in to reply.
Hi Robert,
This technology can certainly be used to create a sleep sequence. Me and lots of friends and acquaintances have been volunteering to be guinea pigs for my sleep sequences on the more complex version of the Brain Machine I'm working on. I've been focusing on getting people to sleep, or back to sleep (after waking up, and then having trouble going back to sleep). For these two sequences, I only bring people to the beginning of a deep sleep cycle, and then let their brain do the rest. But it should be possible to create a good sequence for a "power nap."
For the short sequence that you gave as an example, I would recommend adding about a minute of Beta before getting into lower brainwave frequencies. One rule that is good to follow is that you want to start the brainwave frequencies at the state where the user is at, and then guide them to where they want to go.
Your firmware will compile and program well if you rename it "slm.c" instead of "hsleep1.c" If you really want to rename the file, you'll need to add a line to the makefile (that came zipped up with the "slm.c" file). Open the makefile with a text editor and look for the line that says:
program-slm: slm.hex
Underneath that line add the following:
program-hsleep1: hsleep1.hex
and save it. Then you should be able to program fine by typing into the Command Prompt window:
make program-hsleep1
Please let me know how that works for you. And let me know how the Power Nap sequence works.
Mitch.
Posted by maltman23 on July 20, 2007 at 12:24:53 Pacific Time
- RE: SLM for sleep
You must be logged in to reply.
@ Robert (PCSA)
Regarding your difficulty in getting the compiled program to write to the chip...
You have to modify the Makefile. Open it with a text editor, and a few lines down you should see
# Default target.
all: begin gccversion \
minipov.hex all_leds.hex alt_leds.hex mypov.hex test_leds.hex \
largeimage.hex slm.hex lowslm.hex\
finished end
# Program the device w/various programs
program-minipov: minipov.hex
program-all_leds: all_leds.hex
program-test_leds: test_leds.hex
program-alt_leds: alt_leds.hex
program-mypov: mypov.hex
program-test_sensor: test_sensor.hex
program-largeimage: largeimage.hex
program-makefair: makefair.hex
program-slm: slm.hex
program-lowslm: lowslm.hex
You have to add your program names in these two places, I believe. For example, I wrote a program called lowslm.c to lower the audio frequencies by an octave, so I had to let the Makefile know to look for it.
Hope this helps!Posted by tenax8 on July 20, 2007 at 13:10:57 Pacific Time
- RE: SLM for sleep
You must be logged in to reply.
Thanks tenax8!
It works like a charm now. I really appreciate the help.
RobertPosted by PCSA on July 24, 2007 at 07:45:28 Pacific Time
- RE: SLM for sleep
You must be logged in to reply.
Thanks tenax8!
It works like a charm now. I really appreciate the help.
RobertPosted by PCSA on July 24, 2007 at 07:45:46 Pacific Time
- RE: SLM for sleep
You must be logged in to reply.
Thanks tenax8!
It works like a charm now. I really appreciate the help.
RobertPosted by PCSA on July 24, 2007 at 07:47:15 Pacific Time
- delay sequence
You must be logged in to reply.
I got it working! now I want to program so there is a five hour delay and then begins to stimulate beta waves (put it on before you go to sleep so it kicks in right in the middle of REM phase of sleep). How do I program a new sequence where the leds remain off? I tried but I can only make a delay which the leds remain on.
heres what I put into the slm.c folder:
else if (brainChr == 'n') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b00010000;
// Nothing
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 9928; // T1 generates 0.0Hz, for a binaural beat of 0.0Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 0.0ms, offTime = 0.0ms --> 0.0Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 0, 0 );
return; // Nothing
}Posted by chennate on July 21, 2007 at 19:50:02 Pacific Time
- delay sequence
You must be logged in to reply.
Hi chennate,
Cool idea! So, you want to have is a fake kind of brainwave type called "n". That should work just fine.
All you have to do in the "n" section is wait the specified length of time:
else if (brainChr == 'n') {
delay_one_tenth_ms(pgm_read_dword(&brainwaveTab[index].bwDuration));
return; // Null (simply delay)
}
That should get you lucid dreaming in no time. :)
The reason the LEDs were on the way you had it coded is because the blink_LEDs function was blinking the LEDs (even though you gave it 0 as the delay times, it was turning the LEDs on and off at a very fast pace, still making them both light up).
Mitch.
Posted by maltman23 on July 21, 2007 at 21:04:02 Pacific Time
- delay sequence
You must be logged in to reply.
That was exactly the solution! Works perfectly now. Thanks for the excellent project and great advice.Posted by chennate on July 22, 2007 at 10:20:29 Pacific Time
- delay sequence
You must be logged in to reply.
That was exactly the solution! Works perfectly now. Thanks for the excellent project and great advice.Posted by chennate on July 22, 2007 at 10:20:50 Pacific Time
- delay sequence
You must be logged in to reply.
It works! Thanks for the great project and excellent help.Posted by chennate on July 22, 2007 at 10:22:42 Pacific Time
- delay sequence
You must be logged in to reply.
sorry about the 3x reply.Posted by chennate on July 22, 2007 at 18:43:11 Pacific Time
- help on programming the slr
You must be logged in to reply.
hello
I am trying to program the slr, and I cannot get the slr.hex to be created. I get this message, can anyone help me?
irongus
C:\My Documents\slm>make slm.hex
Compiling: slm.c
avr-gcc -c -I. -g -Os -funsigned-char -funsigned-bitfields -f
pack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000 -Wa,-ad
hlns=slm.lst -mmcu=attiny2313 -std=gnu99 slm.c -o slm.o
avr-gcc: _spawnv: No such file or directory
MAKE.EXE: *** [slm.o] Error 1
Posted by irongus on July 24, 2007 at 16:06:00 Pacific Time
- help on programming the slr
You must be logged in to reply.
sorry, i meant slm, i have been thinking alot about cameras today.
Posted by irongus on July 24, 2007 at 16:30:29 Pacific Time
- help on programming the slr
You must be logged in to reply.
Hi irongus,
Did you follow all of the instructions for installing WinAVR on Ladyada's website? If you are using the latest version of WinAVR you will need to copy a DLL file manually (because of a known bug in the latest WinAVR installer). Very easy to follow instructions are given on Ladyada's site:
http://ladyada.net/make/minipov3/software.html
You'll be following the instructions for Windows.
Also, before programming the SLM code, please try to change the MiniPOV firmware to display VVVV, as instructed in the article. It will be easier to debug if we go one step at a time. Successfully completing this step is important, since it tells you that your hardware is built correctly.
I hope this gets you going.
Mitch.
Posted by maltman23 on July 24, 2007 at 17:01:54 Pacific Time
- help on programming the slr
You must be logged in to reply.
thanks. I tried using the newest programming software and could not get it to work, but when i installed the older version, one version back from the lastest version, i was able to program it with the instructions from the magazine. I suspect there might be a bug in the latest version of the programming software, where you should have the previous version installed before you install the latest one. As it is, i got the machine programmed and it is working great, though my kids think i look like a borg when i am wearing them. thanks for your help.
irongusPosted by irongus on August 07, 2007 at 10:50:12 Pacific Time
- help on programming the slr
You must be logged in to reply.
thanks. but i found that if i used the previous version of the programing software for the chip, i had no problems. it is a great machine.Posted by irongus on August 07, 2007 at 11:15:17 Pacific Time
- Mouser out of phone jacks
You must be logged in to reply.
Looking up the phone jack at Mouser, part #161-3402 shows that 161-3402 is listed as obsolete (ie, unavailable), though it is the 7.79mm jack, not the 3.5mm listed in the article. #161-3402-E is the 3.5mm version, but it is listed as out of stock until mid August. My question is - where could I find a replacement for this? Can I just rip out any old 3.5mm headphone jack off an old walkman or somesuch, or can I potentially get this through RS?Posted by aenikolopov on July 27, 2007 at 17:21:44 Pacific Time
- Mouser out of phone jacks
You must be logged in to reply.
You can use any stereo headphone jack that fits your headphones.
Here is another choice from Mouer that is currently in stock:
Mouser part # 161-3153-E
The reason the part I chose is now obsolete is because I inadvertantly chose a part that is non-RoHS compliant part. Europe now requires that all electronics have no heavy metals in them, such as lead, and the entire industry is conforming, which is a good thing, but the older parts with lead are now obsolete. Sorry about that.
Like I said, you can use any stereo headphone jack that fits your headphones. They sell them at Radio Shack, Jameco, Digikey, Mouser, and many other places.
Mitch.
Posted by maltman23 on July 28, 2007 at 12:49:37 Pacific Time
- Mouser out of phone jacks
You must be logged in to reply.
I found the exact parts on Digi-Key and the headphone jack also.Posted by dannydutton on August 05, 2007 at 06:19:19 Pacific Time
- LED's
You must be logged in to reply.
What effect (if any) would there be if you used a different color LED (say blue).Posted by KimoK on July 29, 2007 at 03:50:15 Pacific Time
- LED's
You must be logged in to reply.
You can use other colors for the LEDs. I encourage you to play around. Experiment -- see what happens!
Please search on this page for the word "blue" and you'll see some comments I made earlier on the subject. Also, do a search for the word "color" on this page to see more comments.
Mitch.
Posted by maltman23 on July 29, 2007 at 15:57:39 Pacific Time
- LED's
You must be logged in to reply.
I made my unit with red leds because I heard they would penetrate the eye lids better. But, the funning thing is, they started off red , then went to green and then a bright white and also an absolutely beautiful shade of blue.
I don't think it matters what color they are, you are going to see lots of color changes.
:-)Posted by MovieMaker on August 05, 2007 at 20:53:23 Pacific Time
- Changed the program
You must be logged in to reply.
Hi,
I changed the program to make smooth linear transitions between the frequencies.
BrainwaveElement:
struct brainwaveElement {
char bwType; // 'a' for Alpha, 'b' for Beta, 't' for Theta, or 'd' for Delta ('0' signifies last entry in table
unsigned long int bwDuration; // Duration of this Brainwave Type (divide by 10,000 to get seconds)
} const brainwaveTab[] PROGMEM = {
{ 'b', 600000 },
{ 'z', 800000 },
{ 'a', 600000 },
{ 'r', 800000 },
{ 't', 300000 },
{ 'm', 900000 },
{ 'd', 100000 },
{ 'n', 900000 },
{ 't', 300000 },
{ 's', 800000 },
{ 'a', 600000 },
{ 'x', 800000 },
{ 'b', 600000 },
{ '0', 0 }
};
Add this procedure after the blink_LEDs procedure:
/*
Function to slowly decrease or increase frequency over a period of time
*/
void linearSlope(unsigned long int duration, unsigned long int startAudio, unsigned long int endAudio, unsigned long int startLed, unsigned long int endLed) {
unsigned long int countDown=duration;
unsigned long int audioFrequency=startAudio;
unsigned long int ledPeriod=startLed;
while (countDown>0)
{
OCR1A=audioFrequency;
PORTB |= 0b00000011; // turn on LEDs at PB0, PB1
delay_one_tenth_ms(ledPeriod); // for onTime
PORTB &= 0b11111100; // turn off LEDs at PB0, PB1
delay_one_tenth_ms(ledPeriod); // for offTime
//recalculate values
if (countDown<2*ledPeriod)
{
countDown=0;
break;
}
else
{
countDown-=2*ledPeriod;
}
if (endAudio>startAudio)
{
audioFrequency=((duration-countDown)*(endAudio-startAudio))/duration+startAudio;
ledPeriod=((duration-countDown)*(endLed-startLed))/duration+startLed;
}
else
{
audioFrequency=startAudio-((duration-countDown)*(startAudio-endAudio))/duration;
ledPeriod=startLed-((duration-countDown)*(startLed-endLed))/duration;
}
}
}
After void do_brainwave_element(int index) {
char brainChr = pgm_read_byte(&brainwaveTab[index].bwType);
Add this
if (brainChr == 'z') //b->a
{
linearSlope( pgm_read_dword(&brainwaveTab[index].bwDuration),9637,9714,347,450);
}
if (brainChr == 'x') //a->b
{
linearSlope( pgm_read_dword(&brainwaveTab[index].bwDuration),9714,9637,450,347);
}
if (brainChr == 'r') //a->t
{
linearSlope( pgm_read_dword(&brainwaveTab[index].bwDuration),9714,9836,450,835);
}
if (brainChr == 's') //t->a
{
linearSlope( pgm_read_dword(&brainwaveTab[index].bwDuration),9836,9714,835,450);
}
if (brainChr == 'm') //t->d
{
linearSlope( pgm_read_dword(&brainwaveTab[index].bwDuration),9836,9928,835,2253);
}
if (brainChr == 'n') //d->t
{
linearSlope( pgm_read_dword(&brainwaveTab[index].bwDuration),9928,9836,2253,835);
}
Enjoy
Posted by Bleupomme on July 29, 2007 at 12:23:54 Pacific Time
- Changed the program
You must be logged in to reply.
Nice mod! Thanks for posting it, Bleupomme.
Have you had a chance to play around with it using your glissando for the frequency changes? What differences do you perceive? Do you find it more effective?
Well over 1000 people have now tried my personal Brain Machine (the one that I built to write the MAKE article), and one common comment I get from people is that they really like the quick transition from Beta to Alpha waves that happens after the first 60 seconds (they don't really know that's what actually happens, but it's at the 60-second mark that they comment about). Most people hallucinate beautiful patterns within just a few seconds, but when that first switch from Beta to Alpha happens, most peoples' hallucinations really take off.
Does that happen with the smooth transition from Beta to Alpha, as well?
I'll try out your code and see how it works for me.
Thanks again!
Mitch.
Posted by maltman23 on July 29, 2007 at 16:07:48 Pacific Time
- Changed the program
You must be logged in to reply.
I think I have to play with the brainwaveTab[] a little more. The theta and delta stages are too long I think, too much delta is a bit disturbing.
I have to say I had a lot of fun with the brain machine, but I don't really know if it works for me as a therapeutic device :) .
This mod I made was a quick hack, sorry I did not add more comments. If I have time I will rewrite it to permit also different frequencies.Posted by Bleupomme on July 30, 2007 at 00:40:47 Pacific Time
- How to change unit for Lucid Dreaming
You must be logged in to reply.
Hi Mitch,
Your unit looks Fantastic. I would like to build one. But, my need is to LUCID DREAM. It is almost the same technology. What resistors, capacitors, diodes, etc. do I have to change in order to do this? Or do I justl have to change to C program? Any help would be apreciated.
yhmmc@yahoo.com is my email address.
Posted by MovieMaker on August 01, 2007 at 08:15:41 Pacific Time
- How to change unit for Lucid Dreaming
You must be logged in to reply.
To use the Brain Machine to help with lucid dreaming, there is no need to change the hardware at all! You'll probably want to change the firmware to start making some sound and light after a few hours, when you think you'll be dreaming, so it can give you a reminder to do something in your dream. Please do a search on this page for "dream" and you will see another person's firmware modifications for lucid dreaming.
Happy dreaming!
Mitch.
Posted by maltman23 on August 01, 2007 at 13:23:52 Pacific Time
- How to change unit for Lucid Dreaming
You must be logged in to reply.
Thanks Mitch, for the Fast Reply. I am a Technician But I have never worked with this type of stuff. I expect it will be a lot of fun. I wanted to work with project IMPScope from heathkit. But, when I ordered the scope, it was discontinued. (OOps, I gave my age away)Posted by MovieMaker on August 01, 2007 at 14:49:58 Pacific Time
- Using 24 guage Kynar wire?
You must be logged in to reply.
So, my local Radio Shack only has 24 guage and lower Kynar (wire wrap) wire. Can I use this or does it have to be 30 guage? I'd order over the internet but unforunately I need it tomorrow.Posted by aenikolopov on August 01, 2007 at 12:35:15 Pacific Time
- Using 24 guage Kynar wire?
You must be logged in to reply.
You can use any wire you like -- it won't make any difference in the operation. Please do a search for "wire" on this page, and you'll see some comments about using different kinds of wires.
Best of luck with the project!
Mitch.
Posted by maltman23 on August 01, 2007 at 13:20:42 Pacific Time
- What voltage is VCC ???
You must be logged in to reply.
I have looked hi and lo and do not see the kind of voltage. I am assumming either 3,6, or 9. But it would be nice to know in order to make the battery holder.
:-)Posted by MovieMaker on August 01, 2007 at 17:23:56 Pacific Time
- What voltage is VCC ???
You must be logged in to reply.
The MiniPOV kit comes with a battery holder that fits two AA batteries. The Vcc is 3 volts.
Mitch.
Posted by maltman23 on August 01, 2007 at 19:07:04 Pacific Time
- What voltage is VCC ???
You must be logged in to reply.
Thanks! :-)Posted by MovieMaker on August 01, 2007 at 19:24:35 Pacific Time
- Side LEDs?
You must be logged in to reply.
What do the LEDs on the side of the glasses exactly do? Do they light up as well or are the just a waste of solder and time?Posted by dannydutton on August 02, 2007 at 19:01:25 Pacific Time
- Side LEDs?
You must be logged in to reply.
The 4 LEDs on the PCB are for testing and debugging. When you first solder the parts to the PC Board, how do you know that the thing works?
With these 4 LEDs soldered in, when you turn on the power for the first time, if you soldered in everything correctly, the 4 LEDs will light up with half of the programmed image in the MiniPOV. Then you can program in a VVVVV image into the microcontroller to see that the programming circuitry on the PCB works well, and to see that you can successfully use the software tools that you downloaded.
If you are experienced at building microcontroller projects, and feel confident, then go ahead and leave the 4 LEDs out. Experienced as I am, I found it useful to use them when I first hacked the MiniPOV into a Brain Machine, 'cause I like testing things after each step as I go along.
Mitch.
Posted by maltman23 on August 02, 2007 at 19:49:52 Pacific Time
- Mitch, Help with capacitors,Please!
You must be logged in to reply.
Hi Mitch,
I thought I was going to have to wait two or three weeks before I got my POV3. It was going to KILL me, but guess what??? The next day, it arrived in the mail. That day was today. I had previously purchased two 1uf caps. But, they were way to big to put on the unit because they had leads in oposite directions. Anyway I did find two 470 caps. A little small ,but I installed them. Now my lights are blink in sequence and it sounds a little like a heart beat through the headsets. I haven't programmed anything yet. My question is: should I just remove those caps from the circuit all together? and is it normal for that sound to be so low (barely audible? A prompt reply would be apreciated because I am fixing to seal everything in place.
Thanks for your help in the past. and Thanks in Advance for this.
:-)Posted by MovieMaker on August 04, 2007 at 18:53:04 Pacific Time
- Mitch, Help with capacitors,Please!
You must be logged in to reply.
Hi Mitch,
I thought I was going to have to wait two or three weeks before I got my POV3. It was going to KILL me, but guess what??? The next day, it arrived in the mail. That day was today. I had previously purchased two 1uf caps. But, they were way to big to put on the unit because they had leads in oposite directions. Anyway I did find two 470 caps. A little small ,but I installed them. Now my lights are blink in sequence and it sounds a little like a heart beat through the headsets. I haven't programmed anything yet. My question is: should I just remove those caps from the circuit all together? and is it normal for that sound to be so low (barely audible? A prompt reply would be apreciated because I am fixing to seal everything in place.
Thanks for your help in the past. and Thanks in Advance for this.
:-)Posted by MovieMaker on August 04, 2007 at 18:53:06 Pacific Time
- Mitch, Help with capacitors,Please!
You must be logged in to reply.
Sorry about the double post. I did not do this on purpose.
Posted by MovieMaker on August 04, 2007 at 18:55:12 Pacific Time
- Mitch, Help with capacitors,Please!
You must be logged in to reply.
I finally took both caps out of the circuit. My only concern is that the audio is really low. But, maybe after I program it , it will be fine. I have it all sealed and stuff. It looks neat!Posted by MovieMaker on August 04, 2007 at 19:46:40 Pacific Time
- Mitch, Help with capacitors,Please!
You must be logged in to reply.
Oh, I forgot to mention that the unit is pulsing going from one LED to another about once a second with no programming. Is this normal? It will be Sunday P.M. before I have time to work on it again. I am please so far. God Bless You for comming up with stuff like this and sharing with everyday people. It was enjoyable to work with the kit.
Posted by MovieMaker on August 04, 2007 at 19:49:31 Pacific Time
- Programming?
You must be logged in to reply.
In he magazine, you tell us to change the array in mypov.c by adding 1's on the first six lines (blue box on the side). WHen you say "pattern", do I just do the first six lines:
B8(10000000)
B8(01000000)
B8(00100000)
B8(00010000)
B8(00100000)
B8(01000000)
B8(00000000)
B8(00000000)
B8(00000000)
Or do I continue them something like this:
B8(10000000)
B8(01000000)
B8(00100000)
B8(00010000)
B8(00100000)
B8(01000000)
B8(10000000)
B8(01000000)
B8(00100000)
Can you please help me? Everything else is very well explained but this (or maybe its obvious and Im just an idiot...).Posted by dannydutton on August 05, 2007 at 05:07:17 Pacific Time
- Programming?
You must be logged in to reply.
Someone correct me if I am wrong, but that image array is just to test if your POV is working properly, it doesn't matter what you put into the file at all, just so long as you know the device is working before you proceed.Posted by chennate on August 05, 2007 at 13:06:05 Pacific Time
- Programming?
You must be logged in to reply.
You are correct. The V pattern is a test to be sure that your MiniPOV is working correctly, and to see that you have the free software dowloaded and installed correctly, to be sure that you can program the microcontroller well.
The pattern that I recommended in the article is one that is eaily recognizable, so that is a good one to use. It is one occurance of a "V", that takes up the 4 LEDs that you installed on the PCB. If things are working well, then you will see VVVVVV when you wave your MiniPOV back and forth.
To do this, replace the image table with the following:
const static int image[] = {
B8(10000000),
B8(01000000),
B8(00100000),
B8(00010000),
B8(00100000),
B8(01000000)
};
It's cool that you were able to find the parts at Digikey. Mouser, Jameco, and Digikey are my 3 favorite places for parts.
Mitch.
Posted by maltman23 on August 06, 2007 at 05:01:33 Pacific Time
- Programming?
You must be logged in to reply.
To test the "VVVVV" pattern, you need to wave the POV very fast back and forth, otherwise they blink so rapidly that they all loklike they are just continually on. It took me a long time to get that; I downloaded the software twice and felt like an idiot after having reprogrammed the chip numerous times to no avail.
Good luck!Posted by chennate on August 06, 2007 at 16:10:03 Pacific Time
- Finally got things a goin'
You must be logged in to reply.
Well, I ditched the stupid RadioShack Usb2Serial cable (Expensive!), and finally programmed the chip.
I understand now, from reading your other posts that the capacitors are for making the squarewave smooth into a sign wave for easier listening.
My only concern now is the unit was supposed to be programmed for about 14 minutes and my wife guessed it at about 10 minutes. I have to get a stop watch on that.
I had only one session so far, I had all kinds of colors and stuff. I did not see any shapes yet. But, it was relaxing and enjoyable.
I salute you, Mitch for a Job Well Done!
:-)Posted by MovieMaker on August 05, 2007 at 20:46:34 Pacific Time
- Finally got things a goin'
You must be logged in to reply.
Hey,
Sorry for the delay in responding to you -- I have been traveling, on my way to an outdoor hackers conference near Berlin (Chaos Communications Camp),
http://events.ccc.de
where I'll be giving a presentation, and a workshop on the Brain Machine. It should be way fun!
I'm glad you go your Machine going!
You can use the 1uF caps with leads on either end (these are called "axial"): install them verically, with the bottom lead in the pad below it on the PCB, and with the top lead bent down, along the side of the cap, and into the other pad. Make sense?
Most people see lots of colors besides red! Even though your eyes are only seeing blinking red lights, your brain is telling you that you are seeing colors and patterns like crazy. This is what your brain can do. :) Cool, yes?
Don't worry about the exact length of time of the sequence. Now that you know how to program the Brain Machine, you can make the sequence longer or shorter to suit your desires.
Enjoy,
Mitch.
Posted by maltman23 on August 06, 2007 at 04:48:24 Pacific Time
- Glue
You must be logged in to reply.
Is it possible to use hot glue instead of the Silicone Glue you said to use in the article? Because I got everything working and I not sure.
Did anyone else get a piece of double-side foam tape in thier kit? Can i use that instead?Posted by dannydutton on August 08, 2007 at 06:34:42 Pacific Time
- A few BETTER mods
You must be logged in to reply.
I got mine built. I started building it the way it was in the article but I relized that the side of my glasses were to big. So I did some mods.
1. Took off the Board and battery pack from glasses.
2. Extended LED power cords so I could put device in my pocket.
3. I put pieces of shrink tubing on the big four-wire cable ( for LEDs) and the cables for the head phones (Permanent now instead of using different head phones).
4. I will put the board and battery pack inside a project box for the sake of making everything look pretty.
I did run into 30 mins worth of trouble because there was a short that I should have checked for first but instead 29 mins fiddle-fartin' with a damn resistor trying to figure out what was the issue. But everything is good now.
Im afraid to take this out in public, I may get arrested for suspected terrorism...Posted by dannydutton on August 08, 2007 at 17:44:30 Pacific Time
- A few BETTER mods
You must be logged in to reply.
I'll post some pics tomarrow of mine.Posted by dannydutton on August 08, 2007 at 17:46:00 Pacific Time
- A few BETTER mods
You must be logged in to reply.
I used HOT Glue on mine because I could not wait overnight to test the units.
Look forward to seeing your pix. I want to make more units and improve mine also. (Not that mitch's design was bad.) It is just the Gemini in me.
:-)Posted by MovieMaker on August 09, 2007 at 06:23:38 Pacific Time
- A few BETTER mods
You must be logged in to reply.
I used HOT Glue on mine because I could not wait overnight to test the units.
Look forward to seeing your pix. I want to make more units and improve mine also. (Not that mitch's design was bad.) It is just the Gemini in me.
:-)Posted by MovieMaker on August 09, 2007 at 06:23:42 Pacific Time
- Let us all Post our Experiences USING the glasses!
You must be logged in to reply.
It is so hard not to post twice. Sorry!
Hey Guys, now that over a thousand people have used Mitch's Glasses, why not use This Thread to post what happened when we put them on and how we have enjoyed them.
I will go first.
When I first put them on, I did not see any shapes, only colors. But, they were beautiful colors and at one point it looked like an undersea scene. The same thing happed for about six sessions. After that, for some reason, I did not see any colors anymore , it was just dark. I opened my eyes to see if the LEDs were not working and they were working fine. I was wondering if this is normal. Does a person get de-sythisized to this? I changed the battery to a fresh battery and moved the LEDs so they where closer to my eyes, but same thing. Go Fish!!! But, even though I don't see the colors, I still get the benefit from wearing them. I also pulled them back away from my eyes and saw a little bit of the colors. But, they always relax me and make me feel good to wear them.
I was thinking of making another pair or pairs using different plans on the chipset. And, making the glasses more comfortable. You tell me how. I think placing the battery and board away from the glasses is a good idea. I even thought of a headband to keep glasses on might be a good idea. I intend to LUCID dream with this setup. But, I thought I would use this program the way it is until I get comfortable programming for a different setup.
Hats off to Mitch Everyone! for introducing us to a new concept!
I am going to try to click the mouse only once now so as not to double post.
:-)Posted by MovieMaker on August 09, 2007 at 06:34:47 Pacific Time
- Let us all Post our Experiences USING the glasses!
You must be logged in to reply.
Just so everyone knows, MovieMaker posted to the Ladyada forum that the reason that he stopped experiencing the hallucination effects from his Brain Machine was that the felt he used on the nose-piece of the glasses (to make them more comfortable to wear) raised the LEDs so they no longer pointed at his eyes. (MovieMaker, please correct me if I'm wrong.)
Mitch.
Posted by maltman23 on August 18, 2007 at 06:54:53 Pacific Time
- Let us all Post our Experiences USING the glasses!
You must be logged in to reply.
That is correct. When I lowered the LEDs back down to the place were they were in front of my eyes, everything went back to normal and worked better.
P.S. I can't wait for you to come out with your multi-Wave model. Yeah!!!Posted by MovieMaker on August 18, 2007 at 14:38:22 Pacific Time
- Let us all Post our Experiences USING the glasses!
You must be logged in to reply.
Hi MovieMaker, good idea! I hope more people post their experiences using the device.
I met Mitch at Maker Faire in Austin last weekend and got the kit from him (Thanks Mitch!)
I finished assembling it last night (my first PCB soldering project went without a hitch). Still have some work to make it prettier, and the battery pack is pretty heavy for the glasses, I may relocate.
Anyway, I've run the program twice now. No serious hallucinations, but I did see some very nice colors and geometric patterns. Colors are predominantly red and blue, with some white and less definable colors.
The coolest part is when the program changes from one mode to another. The geometric pattern switches and becomes very distinct on the change, then gradually melds into a less-identifiable pattern.
Patterns include: circular vibration/ripple effect, infinite tube with checkerboard walls, infinite square tube, and giant X pulsing red and blue.
Each mode seems to consistently associate with one of those patterns for me (I think they're beta, alpha, theta, delta, in order).
What else have you guys seen?Posted by xand3r on October 23, 2007 at 07:43:12 Pacific Time
- Let us all Post our Experiences USING the glasses!
You must be logged in to reply.
Hi xand3r,
You're very welcome.
I'm not sure what you consider serious hallucinations, but if you were seeing infinite tubes I'd say you were hallucinating pretty nicely! :)
BTW, the sequence for the meditation in the firmware that I wrote can be seen in the table at the beginning of the file that you can download from the makezine website:
SLM Firmware
Feel free to check it out, change it, play with it, and trip out to your own sequences.
Best,
Mitch.
Posted by maltman23 on October 24, 2007 at 14:50:27 Pacific Time
- compiling problems
You must be logged in to reply.
I got the minipov put together last night. Played around with it for about an hour and started to work on putting the slm firmware on. I ran into a problem with the binary notation and fixed that as per instructed. There was also a problem with the fact that my avrlibs did not have the function sleep_cpu(), i replaced this with the function sleep_mode() and it programmed fine. Tonight i plan on wiring up the headphones and place the eye led's. I will keep all updated on how well it works. I am working on ubuntu 6.06, gcc 4.0, with a keyspan usa-19hs usb/serial converter. Great project mitch. I have had tons of fun so far. My first intro to microcontrollers.Posted by krazylink on August 10, 2007 at 12:17:59 Pacific Time
You must be logged in to reply.
I was wondering how critical it is to have the freqs. for the lights and sound running at say 14.2hz as opposed to just 14hz? I am writing your sequence into an arduino sketch and it can make all the difference in the world efficiency wise using a "byte" instead of a "float"Posted by greyskale on August 10, 2007 at 17:08:09 Pacific Time
- arduino sketch
You must be logged in to reply.
Hi, please can you tell me if you were succesfull with your arduino sketch???Can you share with your sketch please??? Thanks!!!Posted by ionash on August 16, 2007 at 08:33:01 Pacific Time
- arduino sketch
You must be logged in to reply.
hello... although I'm still working on the audio portion of the sketch, the timing for the LEDs is spot on as far as I can tell. I tried it out and did get some very interesting patterns etc. however I did not have a plain jane LED on hand and used a blue... I don't recommend this as it's a bit harsh on the eyes (even closed). I will post my sketch on the arduino forum in a few days or so.Posted by greyskale on August 21, 2007 at 15:53:06 Pacific Time
You must be logged in to reply.
Please go ahead and try it with integer values for frequencies. The values I chose are not the only ones that will work. Part of how I chose the values was determined by the actual frequency you get when using integers for values in the hardware timers in the ATtiny2313 microcontroller. Brains output a continuous spectrum of frequencies, and the four brainwave types come from dividing the spectrum up into four bands. So, if you choose 14.0Hz, that should work OK, since that is also (along with 14.4Hz) in the band for Beta. Play around with values, and see what works and what doesn't for you. If you can, please post your results so we can all learn from your experience. That's the cool thing about open source. :)
Mitch.
Posted by maltman23 on August 17, 2007 at 15:05:07 Pacific Time
- Homebrew machine advice
You must be logged in to reply.
I'm trying to build my own machine like this from a PIC 18F452 that will allow for brain entrainment, as well as lucid dreaming. Its going well (when I have time to work on it at least), but I wanted to ask about the pre-programmed sequence on this brain machine.
I see that you toggle between multiple brain wave types instead of going directly from one to the other. I understand the reason for doing this, but is it wholly necessary? Can I achieve the same effects by simple going from say, Beta for 5 minutes directly to the next level down with no transitions?
Mainly I'm curious to reduce my code :PPosted by H4T on August 16, 2007 at 11:32:25 Pacific Time
- Homebrew machine advice
You must be logged in to reply.
From my experimenting I have found that it is more effective if you go back and forth between frequencies. What I would really like, for example, is to slowly decrease the amplitude of the Beta at the beginning, while slowly increasing the amplitude of the Alpha. But since this simple Brain Machine can only create one brainwave frequency at a time, and we have no ability to change the amplitude (it is always full on), going back and forth for varying lengths is an OK enough way to accomplish the "fades". Also, if you do Beta for 5 minutes, say, and then Alpha for a long while, then Theta, if you don't keep stimulating at Beta and Alpha occasionally, you may find yourself falling asleep (without Beta to keep you awake).
That said, go ahead and experiment. See what happens for you. And please post your results here so we can all learn from your work (play).
Mitch.
Posted by maltman23 on August 17, 2007 at 15:28:04 Pacific Time
You must be logged in to reply.
Hello Everyone,
Greetings from Berlin. Sorry for the delay in responses to questions over the last two weeks. I've been at the Chaos Communications Camp in Berlin, which is a fantastic outdoor hackers conference. I had a great time!
About 800 people tried out the Brain Machine at the Camp, and most people really loved it. Check out some photos, if you like:
http://www.flickr.com/photos/maltman23/sets/72157601504498401/
40 people built their own Brain Machine at the workshop that I held (and 10 people built open source TV-B-Gones, which is an upcoming article in MAKE Magazine). It was a very common thing to see people around Camp wearing bizarre glasses with blinking red lights before their eyes. The presentation I gave about the Brain Machine was very popular and well received. Here is some French press on the event:
http://www.lexpress.fr/info/quotidien/reportage-photo/default.asp?id=459241
Check out the photo on the lower left corner. :)
I'll be answering questions on this site again over the next few days as I have time.
Best,
Mitch.
Posted by maltman23 on August 17, 2007 at 05:31:40 Pacific Time
- Adding switches to control the Brain Machine
You must be logged in to reply.
For those interested in adding switches to their Brain Machine, here is some firmware that I wrote that will read switches added to D1 (pin 3) and D2 (pin 6) of the microcontroller.
DDRD = 0b11111001; // Set PD1 and PD2 as inputs
PORTD = 0b00000110; // Activate pull-up resistors on PD1 and PD2
while(1) {
// turn on LED at PB6 if PD1 is High, else turn off LED at PB6
if (bit_is_set(PIND, 0)) PORTB |= 0b01000000;
else PORTB &= 0b10111111;
// turn on LED at PB7 if PD2 is High, else turn off LED at PB7
if (bit_is_set(PIND, 1)) PORTB |= 0b10000000;
else PORTB &= 0b01111111;
}
The switches should be connected between the PortD pins and ground, so that when the switch is closed, the pin is grounded (and when the switch is open the pin will be high because of the internal pull-up resistors that we activated).
You can modify the above code to make the Brain Machine start do different sequences, turn it off quickly, or whatever you like.
Mitch.
Posted by maltman23 on August 17, 2007 at 15:21:50 Pacific Time
- Adding switches to control the Brain Machine
You must be logged in to reply.
Hi Mitch,
thanks for that code. I am not very good im programming (microcontrollers) (rather in english language ;-)). I wonder how it would be possible to add some buttons to the brain machine to choose the program before starting. I want to have 3 programs on my brain machine. So how to connect buttons and make the code for it? Im very glad for some more hints!! best wishes, microPosted by bmicro on March 22, 2009 at 12:28:49 Pacific Time
- Adding switches to control the Brain Machine
You must be logged in to reply.
I can't say a whole lot more than has been said (since I'm on a deadline for getting the new version of TV-B-Gone out!), but if you can read a switch, and if you have three tables of brainwave sequences instead of one, then the firmware can pick which of the three brainwave sequence tables to use depending on which button you press. Make sense? This part of the firmware is really just C language -- there are ways in C to choose a section of code based on the value of an input. So, do some poking around on the web, and you'll find ways of doing what you like. Happy sequencing...Posted by maltman23 on March 22, 2009 at 12:41:30 Pacific Time
- Adding switches to control the Brain Machine
You must be logged in to reply.
Thanks a lot. I'll do some research and when i am ready ill post my results. Its the fastest response to a post i had in my life ;-) thx. microPosted by bmicro on March 22, 2009 at 12:58:24 Pacific Time
- Stepping Down Frequencies
You must be logged in to reply.
I found a piece of software called BrainWave Generator that slowly fades from higher frequencies to lower ones seamlessly. I wanted to recreate this effect using my brainwave machine, so I copied the code defining each frequency and created intermediate frequencies, so that instead of jumping back and forth, it gradually stepped to a lower frequency, and then back up.
However, when I ran the make program-myslm, there was an error. I'm guessing I don't understand the programming well enough, and there is probably something I need to define somewhere in order to make this work.
Here is what the section I edited looks like:
"
void do_brainwave_element(int index) {
char brainChr = pgm_read_byte(&brainwaveTab[index].bwType);
if (brainChr == 'b') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b10000000;
// Beta
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 18628; // T1 generates 214.719Hz, for a binaural beat of 14.4Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 34.7ms, offTime = 34.7ms --> 14.4Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 347, 347 );
return; // Beta
}
else if (brainChr == 'l') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b01000000;
// Alpha
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 18768; // T1 generates 213.117Hz, for a binaural beat of 12.8Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 45.1ms, offTime = 45.0ms --> 11.1Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 451, 450 );
return; // Alpha
}
else if (brainChr == 'a') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b01000000;
// Alpha
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 18919; // T1 generates 211.416Hz, for a binaural beat of 11.1Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 45.1ms, offTime = 45.0ms --> 11.1Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 451, 450 );
return; // Alpha
}
else if (brainChr == 'c') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b01000000;
// Alpha
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 19145; // T1 generates 208.921Hz, for a binaural beat of 8.6Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 45.1ms, offTime = 45.0ms --> 11.1Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 451, 450 );
return; // Alpha
}
else if (brainChr == 'k') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b01000000;
// Alpha
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 19293; // T1 generates 207.318Hz, for a binaural beat of 7.0Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 45.1ms, offTime = 45.0ms --> 11.1Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 451, 450 );
return; // Alpha
}
else if (brainChr == 't') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b00100000;
// Theta
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 19386; // T1 generates 206.324Hz, for a binaural beat of 6.0Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 83.5ms, offTime = 83.5ms --> 6.0Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 835, 835 );
return; // Theta
}
else if (brainChr == 'i') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b01000000;
// Alpha
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 19567; // T1 generates 204.415Hz, for a binaural beat of 4.1Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 45.1ms, offTime = 45.0ms --> 11.1Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 451, 450 );
return; // Alpha
}
else if (brainChr == 'e') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b01000000;
// Alpha
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 19672; // T1 generates 203.324Hz, for a binaural beat of 3Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 45.1ms, offTime = 45.0ms --> 11.1Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 451, 450 );
return; // Alpha
}
else if (brainChr == 'd') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b00010000;
// Delta
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 19750; // T1 generates 202.521Hz, for a binaural beat of 2.2Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 225.3ms, offTime = 225.3ms --> 2.2Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 2253, 2253 );
return; // Delta
}
else if (brainChr == 's') {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b01000000;
// Alpha
// start Timer 1 with the correct Offset Frequency for a binaural beat for the Brainwave Type
// to Right ear speaker through output OC1A (PB3, pin 15)
OCR1A = 19868; // T1 generates 201.319Hz, for a binaural beat of 1Hz
// delay for the time specified in the table while blinking the LEDs at the correct rate
// onTime = 45.1ms, offTime = 45.0ms --> 11.1Hz
blink_LEDs( pgm_read_dword(&brainwaveTab[index].bwDuration), 451, 450 );
return; // Alpha
}
// this should never be executed, since we catch the end of table in the main loop
else {
// PORTB &= 0b00001100; // (for debugging purposes only -- commented out for SLM)
// PORTB |= 0b00000010;
return; // end of table
}
}
"
Then in the meditation part i had it go like this:
"
char bwType; // 'a' for Alpha, 'b' for Beta, 't' for Theta, or 'd' for Delta ('0' signifies last entry in table
unsigned long int bwDuration; // Duration of this Brainwave Type (divide by 10,000 to get seconds)
} const brainwaveTab[] PROGMEM = {
{ 'b', 30000 },
{ 'l', 30000 },
{ 'a', 30000 },
{ 'c', 30000 },
{ 'k', 30000 },
{ 't', 30000 },
{ 'i', 30000 },
{ 'e', 30000 },
{ 'd', 30000 },
{ 's', 30000 },
{ 's', 30000 },
{ 'd', 30000 },
{ 'e', 30000 },
{ 'i', 30000 },
{ 't', 30000 },
{ 'k', 30000 },
{ 'c', 30000 },
{ 'a', 30000 },
{ 'l', 30000 },
{ 'b', 30000 },
{ '0', 0 }
};
"
Please help!Posted by zythe84 on August 20, 2007 at 12:05:34 Pacific Time
- Stepping Down Frequencies
You must be logged in to reply.
I'm not sure it will be as easy as a cut and paste to do what you want. A simple way of doing it would be to interpolate the LED flash freq when there are "x" amount of ms left before the next wave type.
I think something like:
if("timer" < 50){
"current freq" += "next freq" / "rate of change";
}
Posted by greyskale on August 21, 2007 at 17:45:00 Pacific Time
- Stepping Down Frequencies
You must be logged in to reply.
Hi zythe84,
I don't see anything obvious that would give you any compiler errors. Could you copy the output from your command window that shows the errors you're getting?
Your approach will give a smoother transition from one brainwave to another. The approach that greyskale suggested will be even smoother.
I'll be interested to hear from you (once you get your code working) how well it works for you.
One thing to keep in mind is that a sequence (meditation, for example) is more than going from Beta to Delta. Brains output a complete spectrum of frequencies, from Delta up through Gamma (though I've only been using up to Beta). To go from awake to deep meditation requires that Beta, Alpha, Theta, and Delta are stimulated throughout the sequence. Otherwise, when you reach Delta (with no Beta or Alpha or Theta stimulation) you will tend to fall asleep. A deep meditation is a combination of all four brainwave frequencies. Same goes for most states.
That said, there is nothing wrong with smoothly going from Beta to Delta and then up again. Play around and experiemnt. And please let everyone know how it goes.
Mitch.
Posted by maltman23 on August 24, 2007 at 08:56:12 Pacific Time
- Awesome BrainMachine
You must be logged in to reply.
Cool ass...just built the "brainmachine" I saw some cool stuff. It really does work. Not quite like trippin but saw some really cool colors/patterns....and it changes up.
Worth the effort to buy/build.Posted by thecybologist on August 20, 2007 at 22:30:49 Pacific Time
- troble unzipping and text editor
You must be logged in to reply.
I cant figure out how to unzip the files. Am I to open the slm or make file. I tried to open it with win zip. I dont know where to find or what to do with the text editor. Please help me.
ThankyouPosted by atnekn on September 05, 2007 at 19:33:37 Pacific Time
- troble unzipping and text editor
You must be logged in to reply.
Hello atnekn,
Sounds like you are on the right path.
If you are new to making things with microcontrollers then some of these may seem a bit scary. But please don't fret, as many hundreds of people have successfully built this project who have never played with any electronics ever before! You can do it too. :) And I'm here to help.
If you are using Windows, then WinZip is a good program to open zip files. What happens when you try to open the zip file?
What step are you on where you want to use the text editor? Is it the step where you are changing the MiniPOV pattern to a bunch of "V"s?
You can use Notepad or Worpad as a text editor. These come with Windows and are under:
Start -> Programs -> Accessories
If this is not enough info to get you going, please write again with more details, and what step you are on in the MAKE article.
Mitch.
Posted by maltman23 on September 05, 2007 at 21:53:13 Pacific Time
- Wire Gauge
You must be logged in to reply.
The first brain machine I built seems to have a short in it (which is nearly impossible for me to find after glueing the stereo jack on top of several connections.) I think that somewhere along the lines of stripping the 30 gauge Kynar wire, I must have put a kink in one of the wires that shouldn't be there. I am about to build my second brain machine and was wondering if I could use a heavier gauge wire (I have speaker wire that I believe is 24-gauge). Will this affect the machine? Is there anything other can Kynar wire that I can use to make the machine a bit more sturdy?
Thanks,
Zythe84Posted by zythe84 on September 08, 2007 at 09:33:43 Pacific Time
- Wire Gauge
You must be logged in to reply.
Nevermind! Sorry! Found the answer to my own question below... oops!Posted by zythe84 on September 08, 2007 at 09:36:50 Pacific Time
- Wire Gauge
You must be logged in to reply.
I'm glad you got things going.
For the record, I find Kynar wire easy to use, but it's a matter of personal taste. Any wire is fine to use in this project. Please do a search on this page for "wire" and you'll see some discussion about this.
Mitch.
Posted by maltman23 on September 08, 2007 at 12:44:57 Pacific Time
- Wire Gauge
You must be logged in to reply.
Nevermind! Sorry! Found the answer to my own question below... oops!Posted by zythe84 on September 08, 2007 at 09:36:56 Pacific Time
- Alternate caps/status LEDs?
You must be logged in to reply.
Hey Mitch, thanks for a great project. I heard about this from 2600, and it got me to dust off my soldering iron and do my first PCB project ever. I built the miniPOV a few days ago and finished off the Brain Machine tonight.
I have 2 questions.
1) I wasn't able to readily find 1uF caps, so instead I used the closest I could find, 2.2 uF caps. It seems to work, but if anything the tones are a bit loud and harsh - would this be related to not using 1uF capacitors?
2)I don't know C nor microcontrollers so I'm blindly asking this - since the 4 LEDs from the miniPOV setup are left on the board, it seems these could be used to indicate which routine the machine is in, a, b, t, or d. I don't know what the usefulness of this would be except perhaps of interest to an observer. I'll try to figure this out on my own, if possible. But if I'm barking up the wrong tree, please let me know :)
Thanks again. Cool stuff.
Posted by OblivionRatula on September 10, 2007 at 19:43:44 Pacific Time
- Alternate caps/status LEDs?
You must be logged in to reply.
Hi by OblivionRatula,
I am happy to be part of the cause for you to start making things again. :)
The raw sound for this project is just square waves, as they come out of the microcontroller. The 1uF caps, along with the 1k resistors form a Low Pass Filter to round off the harsh corners of the square waves. Yet it still doesn't make the sound wonderful. Using a 2.2uF cap will actually reduce the volume because it cuts off even more of the corners of the square waves. If the sound is too loud, then you can either build a volume control (do a search for "volume" on this page and you'll find some discussion on this), or just slip the headphones a little bit off of your ears.
Using the 4 extra LEDs on the PCB is a fine idea. It shouldn't be difficult to program this. You can look in the firmware to see how to turn LEDs on and off. Check out the blink_LEDs function and you'll see these two lines:
PORTB |= 0b00000011; // turn on LEDs at PB0, PB1
PORTB &= 0b11111100; // turn off LEDs at PB0, PB1
Can you generalize from these two lines to see how to turn individual LEDs on and off?
The 4 extra LEDs are on PB7, PB6, PB5 and PB4 (the top 4 bits of Port B).
So, go ahead and try out some firmware programming! You can't hurt anything by doing something "wrong" in the firmware. You can always re-program the working firmware and you're back to where you started from.
Happy experimenting!
Mitch.
Posted by maltman23 on September 10, 2007 at 20:25:01 Pacific Time
- Alternate caps/status LEDs?
You must be logged in to reply.
Thank Mitch, I'd missed your reply when I posted mine. I have since realized that you had the code I needed in there already in your commented out debugging lines. Not very bright of me to notice beforehand, but at least I learned something from the exercise.
I expect I'll be putting in a volume control. With e ear buds I'm using, it's just a bit too loud - even if the caps I'm using brought it down some. One thing I noticed is that the page referenced elsewhere in these comments has a broken IMG link: http://www.tvbgone.com/volctrl.htm Can you please make that schematic available again?
One last thing (for now). One thing I have noticed each time I've used the brain machine is that it makes my tinnitus very noticeable. After four years, I think, of constant ringing in my ears, I'm pretty good at tuning it out, but something about the tones in the SLM really bring it to the fore. I'm going to experiment with some alternate base frequencies and see if that helps, because it really does distract from the experience. I wonder if anyone else has experienced this.
Thanks again for the instruction and more importantly the inspiration.
Posted by OblivionRatula on September 11, 2007 at 08:41:10 Pacific Time
- Alternate caps/status LEDs?
You must be logged in to reply.
Thanks for pointing out the broken link on the volume control schematic. Sorry about that. Try it again -- it should be OK now. If you have trouble finding a stereo pot, you can use two single ones.
Regarding your tinnitus: I think that your suggestion about changing the base frequency should help. If you choose a base frequency that is not related to the ringing frequencies in your ears (not near the frequency, and not a musical interval of the frequency), then I hope that it will not interfere with your tinnitus. Please let me know what you find out.
Mitch.
Posted by maltman23 on September 11, 2007 at 13:56:36 Pacific Time
- Alternate caps/status LEDs?
You must be logged in to reply.
Mitch, just a follow-up - I did try a lower base frequency and at the very least it's less grating on my ears, but the tinnitus still interplays with the tones and beats. I'm going to look around some more to see if another freq. is even better but I seem to be on the right track.Posted by OblivionRatula on September 20, 2007 at 19:30:05 Pacific Time
- Alternate caps/status LEDs?
You must be logged in to reply.
Cool. I hope you can find a frequency that works well for you.
Do you know the frequency (or frequencies) of the ringing from your tinnitus? For most people the ringing is a particular frequency (or particular frequencies).
You can find the frequency (or each frequency) by sweeping slowly through frequencies from very low to very high, and noting where you hear the beat frequencies slow down to a stop.
To create the sweep of frequencies, you can use audio editing software such as CoolEdit. Or, you can program the sweep by hacking the firmware for the Brain Machine.
Once you know the frequency (or frequencies) of your tinnitus, then you know exactly which frequencies to avoid. (You should also avoid multiples of these frequencies).
Mitch.
Posted by maltman23 on September 20, 2007 at 20:24:37 Pacific Time
- Alternate caps/status LEDs?
You must be logged in to reply.
I figured out the answer to Question #2 on my own. Got it working. Cool.Posted by OblivionRatula on September 10, 2007 at 20:42:37 Pacific Time
- Audio question
You must be logged in to reply.
Hi!
Great project. I completed it as soon as I got the mini POV kit. One issue though: The audio does not seem to vary in pitch. I couldn't find the exact caps that you used, so I used a 1uf Tantalum polarized cap from Radio Shack. I got no errors in any step of the process, I made sure that they were wired up correctly, and I hear a tone out of each ear. But there does not seem to be any modulation in pitch. any ideas?Posted by spudtech on September 20, 2007 at 20:52:27 Pacific Time
- Audio question
You must be logged in to reply.
Hi spudtech,
The cap you used should be fine.
Were you able to program the microcontroller with the SLM.c firmware (without using the -F option in the command line)?
If you were able to program the microcontroller, are the two LEDs for the eyes blinking at the correct rate (60 seconds for Beta rate of 14Hz, followed by 10 seconds for Alpha rate of 11Hz, etc.)?
If the LEDs are blinking at the correct rates, then my guess is that the audio is doing the correct thing, but it's just not what you are expecting. One of the ears stays constant at about 400Hz, and the other ear changes pitch when the LEDs change the rate that they blink (60 seconds of about 414Hz for Beta, followed by 411Hz for Alpha, etc.) If this is not happening, then try checking the wiring from the MiniPOV kit to the headphone jack. Look carefully at the photo and be sure everything is just as shown there.
I hope that helps. Please let me know how it goes.
Mitch.
Posted by maltman23 on September 20, 2007 at 21:01:54 Pacific Time
- Audio question
You must be logged in to reply.
Thanks for the quick reply!
The LEDs do change and the wiring is correct. I have the two audio wires going to the positive leads of the two caps and the ground is going to the cap lead closest to the edge of the board, which is traced into the ground for the rest of the LEDs. Does right vs. left matter when wiring up the speaker leads to the caps?
Thanks!Posted by spudtech on September 20, 2007 at 21:09:46 Pacific Time
- Audio question
You must be logged in to reply.
As I wrote in the article, it doesn't matter which channel is left and which is right.
You hooked up the caps correctly.
Do you hear different pitches out of each ear? If not, can you tell me approximately what frequency you hear (or what note on a piano keyboard or guitar)?
Mitch.
Posted by maltman23 on September 20, 2007 at 21:14:21 Pacific Time
- LEDs don't light
You must be logged in to reply.
I have a problem with the LEDs in the glasses not lighting.
I desoldered the leads and connected them right at the terminals for the battery leads and they light - so I know the LED are OK and the wires are properly connected to the LED itself, but when they're soldered at the LED pad 1 & 2 they will not light.
After checking my joints I decided that the capacitors may be the problem.
My invoice from Mouser says these are 50v 1uF 5x11 Bi-Polar Aluminum Electrolytic Capacitors.
I'm no electronics tech but my research tells me the Bi-polar caps have no polarity requirement but electrolytic caps do.
So could I have them stuffed backwards or does my problem lie elsewhere... and where might that be?
The first steps went flawlessly and Ladyada's firmware compiled, loaded and ran (the VVVVV's) right off the bat.
I'm stumped - anyone have a clue?
TFYTPosted by Wyrd on October 18, 2007 at 05:50:27 Pacific Time
- LEDs don't light
You must be logged in to reply.
Hi TFYT,
The capacitors are bipolar, as it says in the article, meaning they can be put into the pads in either direction. However, the capacitors are only for the sound, and won't effect the lights.
If you were able to program the microcontroller with the VVVVV pattern, then you have almost everything working!
In order to get the lights for the Brain Machine to light up, you first have to program in the SLM (Brain Machine) firmware. Did you do that? If so, do you get any sound from the headphones? If so, then there must be a problem with the connections to the LEDs. Did you stuff (insert and solder) R7 and R8 into the PCB? Please double check your solder connections with R7, R8, and the wires for the two LEDs. Be sure that the LEDs are connected correctly -- unlike the biploar capacitors, it does matter which way you connect LEDs to a circuit (if they are in backwards, they will not light).
Also, please be careful when you connect an LED to power. If you connect it directly to a battery with no series resistor (which limits the current that can flow through the LED), you can burn out the LED. It is possible you may have burned out the LEDs by connecting them directly to the battery. Please test them again by connecting them to the battey-pack again, but with one of the extra resistors in series with one of the leads (the MiniPOV kit comes with eight resistors, of which you only stuff six -- the value of these eight resistors is either 47 or 100 ohm). If the LEDs won't light any more, then you can replace them with the two unused LEDs that came with the MiniPOV Kit.
I hope that gets you going.
Cheers,
Mitch.
Posted by maltman23 on October 18, 2007 at 08:03:42 Pacific Time
- LEDs don't light
You must be logged in to reply.
Hi Mitch,
Thanks for the great project - I'm looking forward to actually using it rather than building and troubleshooting - LOL
I was able to get the chip programmed with the slm firmware and upon disconnecting from the computer and turning it back on only the 4 LEDs on the board light.
I could hear a clicking noise as I plugged in the headphones but no other noise.
I do have the resistors in R7 & R8 and the polarity is correct for the wiring going to the LEDs in the glasses.
The leads to the mounted LEDs aren't connected to the board right now - I'm just using a spare LED to check to see if there's juice at the LED pads 1 & 2 but so far no luck - or pads 3 & 4 also for that matter.
To test the pads at LED 1, 2 3 & 4, I touched one of the extra LEDs to the terminal (making sure the correct poles were touching the correct sides of the terminals) and they don't light - but if I touch them to the last four pads (5,6,7 & 8) they do light.
To test the LEDS in the glasses, I just now touched the leads to the back of the board at pad 3 and they lit - so I got lucky there and didn't burn them out.
This is my first project in 30 years or so - it was nice that everything worked in the first phase, it's been fun and I'm looking forward to some mods when I build the next one.
Thanks For Your Time
Curt
Posted by Wyrd on October 18, 2007 at 08:36:21 Pacific Time
|
Showing messages 1 through 250 of 464. Next Page |
Join the conversation -- every MAKE article has an online page that includes a place for discussion. We've made these RSS and Atom feeds to help you watch the discussions: subscribe.
Explore More in Make Magazine
Search the pages of MAKE
Raves for MAKE!
“Now we've got geek DIY (do it yourself) porn. Just as would-be Emerils pore over lushly illustrated cookbooks with recipes involving hard-to-find morels and complicated instructions for roux, Tom Swift wanna-bes are devouring MAKE.”
— Steven Levy, Newsweek
“...O'Reilly Media recently launched what has already become the bible of this new movement, a magazine called MAKE.”
— Daniel Roth, FORTUNE
“If you're the type who views the warnings not to pry open your computer as more a challenge than admonition, MAKE is for you.”
— Rolling Stone
“One of the most innovative magazines I've seen in a long time.”
— Steve Riggio, CEO Barnes & Noble
“The kind of magazine that would impress MacGyver”
— Marcus Chan, San Francisco Chronicle






