a digital scan of a 35mm film image of a processing sketch running on an LCD
Skip to Content

How to Hack Toy EEGs

Arturo Vidich, Sofy Yuditskaya, and I needed a way to read brains for our Mental Block project last fall. After looking at the options, we decided that hacking a toy EEG would be the cheapest / fastest way to get the data we wanted. Here’s how we did it.


The Options

A non-exhaustive list of the consumer-level options for building a brain-computer interface:

  Open EEG Board
Open EEG
Force Trainer Box
Force Trainer
Mindflex Box
Mind Flex
MindSet Box
MindSet
Description Plans and software for building an EEG from scratch Levitating ball game from Uncle Milton Levitating ball game from Mattel Official headset from NeuroSky
Attention / Meditation Values No Yes Yes Yes
EEG Power Band Values Yes (roll your own FFT) No Yes Yes
Raw wave values Yes No No Yes
Cost $200+ $75 (street) $80 (street) $200

Open EEG offers a wealth of hardware schematics, notes, and free software for building your own EEG system. It’s a great project, but the trouble is that the hardware costs add up quickly, and there isn’t a plug-and-play implementation comparable to the EEG toys.

The Nerosky MindSet is a reasonable deal as well — it’s wireless, supported, and plays nicely with the company’s free developer tools.

For our purposes, though, it was still a bit spendy. Since NeuroSky supplies the EEG chip and hardware for the Force Trainer and Mind Flex toys, these options represent a cheaper (if less convenient) way to get the same data. The silicon may be the same between the three, but our tests show that each runs slightly different firmware which accounts for some variations in data output. The Force Trainer, for example, doesn’t output EEG power band values — the Mind Flex does. The MindSet, unlike the toys, also gives you access to raw wave data. However, since we’d probably end up running an FFT on the wave anyway (and that’s essentially what the EEG power bands represent), we didn’t particularly miss this data in our work with the Mind Flex.

Given all of this, I think the Mind Flex represents a sweet spot on the price / performance curve. It gives you almost all of the data the Mind Set for less than half the cost. The hack and accompanying software presented below works fine for the Force Trainer as well, but you’ll end up with less data since the EEG power values are disabled in the Force Trainer’s firmware from the factory.

Of course, the Mind Flex is supposed to be a black-box toy, not an officially supported development platform — so in order to access the actual sensor data for use in other contexts, we’ll need to make some hardware modifications and write some software to help things along. Here’s how.

But first, the inevitable caveat: Use extreme caution when working with any kind of voltage around your brain, particularly when wall power is involved. The risks are small, but to be on the safe side you should only plug the Arduino + Mind Flex combo into a laptop running on batteries alone. (My thanks to Viadd for pointing out this risk in the comments.) Also, performing the modifications outlined below means that you’ll void your warranty. If you make a mistake you could damage the unit beyond repair. The modifications aren’t easily reversible, and they may interfere with the toy’s original ball-levitating functionality.

However, I’ve confirmed that when the hack is executed properly, the toy will continue to function — and perhaps more interestingly, you can skim data from the NeuroSky chip without interfering with gameplay. In this way, we’ve confirmed that the status lights and ball-levitating fan in the Mind Flex are simply mapped to the “Attention” value coming out of the NeuroSky chip.


The Hardware

Here’s the basic layout of the Mind Flex hardware. Most of the action is in the headband, which holds the EEG hardware. A micro controller in the headband parses data from the EEG chip and sends updates wirelessly to a base station, where a fan levitates the ball and several LEDs illuminate to represent your current attention level.

Mind Flex Schematic

This schematic immediately suggests several approaches to data extraction. The most common strategy we’ve seen is to use the LEDs on the base station to get a rough sense of the current attention level. This is nice and simple, but five levels of attention just doesn’t provide the granularity we were looking for.

A quick aside: Unlike the Mind Flex, the Force Trainer has some header pins (probably for programming / testing / debugging) which seem like an ideal place to grab some data. Others have reported success with this approach. We could never get it to work.

We decided to take a higher-level approach by grabbing serial data directly from the NeuroSky EEG chip and cutting the rest of the game hardware out of the loop, leaving a schematic that looks more like this:

Mind Flex Schematic Hacked

The Hack

Parts list:

  • 1 x Mind Flex
  • 3 x AAA batteries for the headset
  • 1 x Arduino (any variety), with USB cable
  • 2 x 12” lengths of solid core hookup wire (around #22 or #24 gauge is best).
  • A PC or Mac to monitor the serial data

Software list:

The video below walks through the whole process. Detailed instructions and additional commentary follow after the video.

Step-by-step:

1. Disassembly.

Grab a screwdriver and crack open the left pod of the Mind Flex headset. (The right pod holds the batteries.)

Mind Flex internal layout



2. The T Pin.

The NeuroSky Board is the small daughterboard towards the bottom of the headset. If you look closely, you should see conveniently labeled T and R pins — these are the pins the EEG board uses to communicate serially to the microcontroller on the main board, and they’re the pins we’ll use to eavesdrop on the brain data. Solder a length of wire (carefully) to the “T” pin. Thin wire is fine, we used #24 gauge. Be careful not to short the neighboring pins.

The T PinT Pin with soldered lead




3. Common ground.

Your Arduino will want to share ground with the Mind Flex circuit. Solder another length of wire to ground — any grounding point will do, but using the large solder pad where the battery’s ground connection arrives at the board makes the job easier. A note on power: We’ve found the Mind Flex to be inordinately sensitive to power… our initial hope was to power the NeuroSky board from the Arduino’s 3.3v supply, but this proved unreliable. For now we’re sticking with the factory configuration and powering the Arduino and Mind Flex independently.

Ground lead



4. Strain relief and wire routing.

We used a dab of hot glue to act as strain relief for the new wires, and drilled a hole in the case for the two wires to poke through after the case was closed. This step is optional.

Strain reliefWire routing



5. Hook up the Arduino.

The wire from the Mind Flex’s “T” pin goes into the Arduino’s RX pin. The ground goes… to ground. You may wish to secure the Arduino to the side of the Mind Flex as a matter of convenience. (We used zip ties.)

Finished hack

That’s the extent of the hardware hack. Now on to the software. The data from the NeuroSky is not in a particularly friendly format. It’s a stream of raw bytes that will need to be parsed before they’ll make any sense. Fate is on our side: the packets coming from the Mind Flex match the structure from NeuroSky’s official Mindset documentation. (See the mindset_communications_protocol.pdf document in the Mindset developer kit if you’re interested.) You don’t need to worry about this, since I’ve written an Arduino library that makes the parsing process as painless as possible.

Essentially, the library takes the raw byte data from the NeuroSky chip, and turns it into a nice ASCII string of comma-separated values.



6. Load up the Arduino.

Download and install the Arduino Brain Library — it’s available here. Open the BrainSerialOut example and upload it to your board. (You may need to disconnect the RX pin during the upload.) The example code looks like this:

  1. #include <Brain.h>
  2.  
  3. // Set up the brain parser, pass it the hardware serial object you want to listen on.
  4. Brain brain(Serial);
  5.  
  6. void setup() {
  7.         // Start the hardware serial.
  8.         Serial.begin(9600);
  9. }
  10.  
  11. void loop() {
  12.         // Expect packets about once per second.
  13.         // The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format:
  14.         // "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma"   
  15.         if (brain.update()) {
  16.                 Serial.println(brain.readCSV());
  17.         }
  18. }



7. Test.

Turn on the Mind Flex, make sure the Arduino is plugged into your computer, and then open up the Serial Monitor. If all went well, you should see the following:

Brain library serial test

Here’s how the CSV breaks down: “signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma”

(More on what these values are supposed to mean later in the article. Also, note that if you are hacking a Force Trainer instead of a Mind Flex, you will only see the first three values — signal strength, attention, and meditation.)

If you put the unit on your head, you should see the “signal strength” value drop to 0 (confusingly, this means the connection is good), and the rest of the numbers start to fluctuate.



8. Visualize.

As exciting as the serial monitor is, you might think, “Surely there’s a more intuitive way to visualize this data!” You’re in luck: I’ve written a quick, open-source visualizer in Processing which graphs your brain activity over time (download). It’s designed to work with the BrainSerialOut Arduino code you’ve already loaded.

Download the code, and then open up the brain_grapher.pde file in Processing. With the Mind Flex plugged in via USB and powered on, go ahead and run the Processing sketch. (Just make sure the Arduino IDE’s serial monitor is closed, otherwise Processing won’t be able to read from the Mind Flex.) You may need to change the index of the serial list array in the brain_grapher.pde file, in case your Arduino is not the first serial object on your machine:

serial = new Serial(this, Serial.list()[0], 9600);

You should end up with a screen like this:

Processing visualizer test


About the data

So what, exactly, do the numbers coming in from the NeuroSky chip mean?

The Mind Flex (but not the Froce Trainer) provide eight values representing the amount of electrical activity at different frequencies. This data is heavily filtered / amplified, so where a conventional medical-grade EEG would give you absolute voltage values for each band, NeuroSky instead gives you relative measurements which aren’t easily mapped to real-world units. A run down of the frequencies involved follows, along with a grossly oversimplified summary of the associated mental states.

In addition to these power-band values, the NeuroSky chip provides a pair of proprietary, black-box data values dubbed “attention” and “mediation”. These are intended to provide an easily-grokked reduction of the brainwave data, and it’s what the Force Trainer and Mind Flex actually use to control the game state. We’re a bit skeptical of these values, since NeuroSky won’t disclose how they work, but a white paper they’ve released suggests that the values are at least statistically distinguishable from nonsense.

Here’s the company line on each value:

  • Attention:

    Indicates the intensity of a user’s level of mental “focus” or “attention”, such as that which occurs during intense concentration and directed (but stable) mental activity. Distractions, wandering thoughts, lack of focus, or anxiety may lower the Attention meter levels.

  • Meditation:

    Indicates the level of a user’s mental “calmness” or “relaxation”. Meditation is related to reduced activity by the active mental processes in the brain, and it has long been an observed effect that closing one’s eyes turns off the mental activities which process images from the eyes, so closing the eyes is often an effective method for increasing the Meditation meter level. Distractions, wandering thoughts, anxiety, agitation, and sensory stimuli may lower the Meditation meter levels.

At least that’s how it’s supposed to work. We’ve found that the degree of mental control over the signal varies from person to person. Ian Cleary, a peer of ours at ITP, used the Mind Flex in a recent project. He reports that about half of the people who tried the game were able to exercise control by consciously changing their mental state.

The most reasonable test of the device’s legitimacy would be a comparison with a medical-grade EEG. While we have not been able to test this ourselves, NeuroSky has published the results of such a comparison. Their findings suggest that the the NeuroSky chip delivers a comparable signal. Of course, NeuroSky has a significant stake in a positive outcome for this sort of test.

And there you have it. If you’d like to develop hardware or software around this data, I recommend reading the documentation that comes with the brain library for more information — or browse through the visualizer source to see how to work with the serial data. If you make something interesting using these techniques, I’d love to hear about it.

April 7 2010 at 2 PM

Viadd:

Neat. But,

I would be reticent to make electrical contact between my brain and something plugged into the wall socket. Options:
a) Use only a laptop on batteries for the computer (and hope that everybody who uses this knows to not to use it on a plugged in computer). b) Use the T line to drive an optical isolator instead of plugging it directly into the Arduino. c) See if the wireless link can be connected directly to the Neurosky chip instead of passing through the microcontroller, and you can wire in to the basestation. d) Live (or not) dangerously

But yeah.

April 9 2010 at 12 AM

Eric Mika:

Viadd, that's a very reasonable point.

Granted, you're probably in more danger crossing the street than plugging this into a 5V usb socket and risking a chain of catastrophic hardware failures, but it's absolutely worth taking the precautions you've suggested.

I'll add a note to the tutorial.

Also, using the wireless connection that's already sitting in the Mind Flex would be a great solution to this issue. However, I haven't explored this option since my original application for this hack involved a battery-powered Arduino (sans laptop) with no line-voltage power sources anywhere in the circuit.

April 9 2010 at 1 AM

Awesome! Do you think it would it be possible to tap into the base station instead? Then you wouldn't need the whole wire-hanging-off-my-head thing.

April 9 2010 at 2 AM

epokh:

Yes did some work with EEG singal processing. Always makw sure the sensors are opto-isolated from the power line. You can have a look at some schematics from here. As Ian said what about receiving from the wireless station? There's either an SPI or serial interface with the micro controller. The other solution will be to wire up an xbee on the headset in transparent mode and read the data. I don't have a mindflex so I canno try it. It will probably need a level shifter from the toy because it's 3.3 V, but still smaller than wiring an arduino,

April 9 2010 at 4 AM

Eric Mika:

Ian & Epokh: Unfortunately the data is parsed and (to my knowledge) much of it is discarded by a micro controller in the headset before it is sent over the air to the base station. If you want all the data, you need to to grab it before it reaches the micro controller or somehow circumvent this part of the circuit. (And just FYI I believe the headset uses SPI as you suggested.)

And yes, You could desolder the daughterboard from the rest of the Mind Flex circuitry and cobble together your own wireless system. (XBee would be easy enough.) I used this approach for another project I worked on where I needed several headsets to talk to each other and to a base station wirelessly. It worked fine.

The NeuroSky daughterboard receives just 3.3 volts from the main board, so that makes life even easier if you wanted to use an XBee.

I wanted the tutorial to show the simplest possible approach, but there are certainly many other possible configurations. I specifically designed the Arduino Brain library to work just fine with no connection to a laptop: Since the Arduino handles the parsing process, you have access to all of the same brain data and can do whatever you like with it, laptop or not.

April 9 2010 at 4 AM

Awesome! If I wasn't completely strapped for cash I'd instantly order me up a MindFlex and a few cheapo servos from dealextreme.com

One idea I've had is simply using the arduino to send a simple on/off IR-signal (NEC-protocol, modulated at 38KHz) whenever EEG values reach threshold levels. F.ex. high focus sends "On", high meditation sends "Off". Combined with an IR-led with a fairly narrow angle of spread and simple receivers (ATtiny+38KHz IR-demodulator) would allow me to just stare at something and turn it on or off.

Got loads of other ideas too, but it all comes down to this: Do you find any significant improvement in your control of your brainwaves with practice? I have the OCZ NIA and because of it's very unpolished and unintuitive software (no analog control in games, only thresholds->keypresses), I can't really use it for anything.

April 9 2010 at 5 AM

With regards to training.. Would one potentially learn to control the brainwave patterns better if one created a constant feedback loop? That is, after all, the way we learn to move our bodies and utilize our senses.

Something like mapping each of the 6 FFT'd values to a piezo or button vibrator placed on my skin?

(Sorry for posting twice)

April 9 2010 at 5 AM

epokh:

to erikmika: that's a wonderful regulated power!
Yes you are right the micro-controller filter the data for the game task.
I don't see any trouble in using an xbee series 1 or 2 at a 9600 bps, it would be harder it it was a multi channel eeg which is the things I'm working on.
I bet you cannot use the arduino 3.3 output power because the opamp on the headset drain more 50mA (believe me when you need to have a 1000x gain on a double stage amp you need far more than 50mA!)
I live in Uk but i will try to order one and see if I can patch it together with a zigbee.
For PlastBox:
without going into academic debates, yes it is being done using fMRI for patients with chronic pain. What they are trying to do is to show your brain activity on a screen and you can shape it using meditation (closed loop control).
Ehmm I have some doubt you can obtain decent an accurate closed loop control with this system because the EEG is by itself noisy, single channel, no impedance matching with your skin (you should shave and use medical grade gel) and I bet you will get a lot EM interference from your environment.
The trick is to have at least a reliability > 50% in trials otherwise is like playing roulette!

This is what I have experienced using medical grade/hobbyist EEG devices and I hope I can be proved wrong!

April 9 2010 at 8 AM

epokh:

Argh retail price in UK is more than £150, is too much for my pockets. I'll try to find a remailer in USA. I hate business!

April 9 2010 at 9 AM

Milarepa:

Guys, I love your project!
I'm a cog neuroscience grad student and have a good bit experience with the OpenEEG and can compare to the real stuff like research grade EEG, MEG & fMRI.

While I would rather like people to build up on the OpenEEG hardware, simply because it's the only thing around that's open and proven to work. I have compared it myself against commercial devices and looked especially at things that are critical if you want to get some meaningful results.
On the other hand I'm a fan of the arduino and also like to see all those mind toys popping up and it's cool that those are getting hacked. Thanks also for the library, this breaks down a very important barrier for people who want to educate themselves about this but don't have the know-how!

For PlastBox/Epokh
I have written my thesis on EEG BCI control and, while there are some working systems, the ones that work best rely on signals that are not learned but more or less automatic, like mu-rythms over motor areas that occur automatically during movement imagery or evoked/induced EEG patterns that occur automatically and differ depending on whether you present a target or a non-target letter. Learning control over the amplitude of frequency bands is not easy, not everybody seems to be able to do it and most of the stuff we know about the meaning of the relationship between frequency band power and cognitive function are rather inconclusive. Most evidence here is purely empiric.
I doubt that you can get a lot of an effect with this device. Too noisy due to insufficient shilding and bad contacts.... but I haven't tried it so, there's no knowing...

April 9 2010 at 9 AM

epokh:

Hi Milarepa, I will be interested in reading your thesis.
The learning task you are referring is used also in other projects for human-robot interaction. I know a Asimov research group in Germany playing with a YES/No task to provide the robot manipulator with human feedback. To be fair I find more accurate and practical emotional interfaces (i.e. tracking facial expressions) and in 20 years of EEG literature I didn't see anything really exciting. Here I'm referring purely on the application side not on the academic research. I remember a game company that claimed to control the player with only a brain interface, needless to say they never released that product, it was too much of a science gap!

April 9 2010 at 3 PM

Steven:

You might want to also state that you need controlP5 (http://www.sojamo.de/libraries/controlP5/) for the visualization to work. Great project. My mind flex unit is on the way. I'll let you know how it turns out. Thank you for the idea!

April 10 2010 at 2 AM

Eric Mika:

Steven: Thanks for reminding me, I just updated the text. I use controlP5 so often, I practically take its presence for granted.

Good luck with the project and let me know what you end up building.

April 10 2010 at 4 AM

Milarepa:

@epokh
Interesting, are you referring to the Tuebingen group?
I have to agree, for a researcher EEG BCI research keeps being interesting, not only because grant money is still flowing. I worked with one of the research groups that share the DARPA grant which aims towards the development of silent BCI communication & control reliable enough to be used in the field. We had an awesome time 'discovering' that this will not be feasible in the near future. (Think: 'playing customized Quake 3D & 128 channel EEG') To be fair, there is some potential in the reconstruction of imagined speech.
Applicationwise of course EEG BCIs are worlds apart from what we can do with real-time fMRI. (That's what our research group has been busy with in the last years.) Expensive and unpractical, yet awesome! We'll see soon what potential lies in fNIRS.
As for the better interfaces for games, I too see most potential in facial expression analysis in a combination with normal motor output (controller)...
While I never tested game control devices I don't expect much performance from them, since the effects they show can only stem from muscle artifacts from facial muscles and high amplitude alpha activity. This might be enough to sell a product, but is not enough to impress.
I'd be happy to send you my thesis, you can find me at http://gsr-monkey.blogspot.com/ It leads to an early little project of mine which is terribly outdated, but has my email address...

April 10 2010 at 9 AM

Tom:

I'm sorry, but can someone explain me this article? http://www.spiegel.de/spiegel/print/d-69174739.html

April 10 2010 at 1 PM

kresp0:

Thank you for sharing your work!

I'm planning to modify one of these to use during sleep and record brainwaves patterns. Why? To make a system that helps me to have lucid dreams using lights and/or sounds (reminds me that i'm dreaming) when I'm in the sleep stage #3 or when in the REM stage.

Toughts?

April 10 2010 at 4 PM

Carpa:

@Tom: The articel is about MindFlex and how MindFlex work. John-Dylan Haynes, one of the best brain researcher, worldwide, try get the secret behind the MindFlex. He came to the answer that MindFlex is just a toy. He say it works simular to what the psychologist http://de.wikipedia.org/wiki/Burrhus_Frederic_Skinner discovert in 1948. So what ever MindFlex do, its not real, maybe a random generator.

However nice work! Greets from Germany.

April 11 2010 at 6 AM

Milarepa:

@Eric
You could do a simple test for us to clarify this:
Get someone with a some robust baseline alpha activity (you will probably have that if I may guess). Let the person close her eyes and leave them closed for a few seconds until you see a difference and let her open her eyes again. You will expect systematic changes in the alpha band: Whenever eyes are opened, alpha power will decrease and stay lower then when the eyes are closed. Even though the greatest changes will be observable on the backside of the head, you will see this effect also on the site where the device is worn if the 'EEG machine' is working. If you want to go further, try visual imagination with closed eyes. I'd love to see some annotated screen-shots of eyes open/closed, some head movements, eye-blinks would be interesting, too!

@Tom/Capra
Props to JD Haynes: Talking to random 'SPIEGEL' journalists takes courage when you are in cognitive neuroscience and do consciousness related stuff. I just don't understand why the journalist bothers him with this, when they've got an excellent BCI group at the Charitè. He's a heavily cited imaging guy and works mainly multivariate analysis and fMRI. He has published some awesome stuff but I don't think he's that much into EEG...

His experiment (in the article he bridged the gap with a wet towel and with a paperclip, yet the ball moves regularly up and down) shows that there is probably still more marketing to the whole thing then real science but it's result does not unequivocally lead to the conclusion that the author of the article wants us to draw. (That the device is based on _nothing_but_ the users superstitious belief that he is in control of the ball.)
I also disagree that a BCI game had to be more expensive then the device at hand. Hey: it's an amplifier, ADC, microcontroller, RF link hooked up to a computer, what more do you need except some proper engineering and electrode gel. Qua software, I know of no EEG-BCI which would cook with anything but water. Now that the device is hacked, I'm thrilled to see what creative people will make of it.

April 11 2010 at 1 PM

Nick H:

The question of how much snake-oil this thing contains was brought up in another forum.

Someone posted this link with some papers done by the Neurosky devs:
http://developer.neurosky.com/forum/viewtopic.php?f=2&t=45

I am no neuroscientist, but after reading those papers, I don't see much cause for concern. Cheap? Perhaps. Fraudulent? Doubtful.

April 13 2010 at 4 PM

em:

@kresp0
That sounds like a very cool idea. I'm interested in lucid dreams too, and I've been trying to use binaural beats to induce them - without much luck. An EEG like this could be very helpful, by letting you track sleep stages. If you try something like that, let me know how it goes!

April 13 2010 at 7 PM

benj:

This is completely awesome! I've been planning to try something like this with my Mindflex and am happy to see others beat me to it!

Any thoughts on how one might go about taking the serial values and transforming them back into a single waveform? It probably wouldn't be very accurate compared to the raw waveform, so maybe it's a moot point.

April 13 2010 at 9 PM

Great video Eric, what kind of camera and software did you use for the editing and screen capture? I've been working on a series of arduino videos for my students and really like your method.

April 13 2010 at 9 PM

Chip:

Re: REM sleep, lucid dream induction, etc.

I was a psych major at Stanford in the early days of sleep research, some forty years ago. I remember a lecture where someone (might have been Dr. Wm. Dement, but I'm not sure) spoke about how the eyeball has an electrical potential, and how they could detect side-to-side eye movements with electrodes at the outer corner of each eye and up-down movements with a pair of electrodes on the forehead and cheek above and below the pupil of one eye. As the eye moves, the sensors detect the changing EM field. (Google "electro oculography" for more info.)

I've got minimal hobbyist electronics skills (so I could be missing something obvious) but I've always wondered why hobbyists are putting so much time and effort into messing around with DIY EEGs to detect REM sleep when EOG seems cheaper, simpler, and more direct. I haven't been able to find any information about DIYers exploring this avenue, though. So I thought I throw this out and see if anyone catches it.

April 14 2010 at 10 AM

One of the reasons you said you didn't choose the Force Trainer was because it didn't give power band outputs. I recently finished a project using the Force Trainer and you can get 2 different values that are being read. Each of those has a range from roughly 0-100. There's more detail here (check out the first comment for a sample of the output)
http://hackaday.com/2009/10/21/mind-control-via-serial-port/#more-17587

What did you mean by EEG power output? Does the MindFlex give you a more accurate reading?

April 14 2010 at 1 PM

Eric Mika:

Hunter: I've confirmed that this hack (and the accompanying code) works just fine with the Force Trainer, which is based on the same chip from NeuroSky -- in fact, we used the Force Trainer for our Mental Block project.

I think I addressed the different data coming from each unit in the chart at the top of the article: Both the Mind Flex and the Force Trainer give the two Attention and Meditation values that you described. However, the Mind Flex gives you even more data, which is why I recommend it.

The additional data -- the EEG power band values -- are basically an FFT of the raw brain wave data, which shows you the relative activity at different wavelengths (I explained this at length in the article). So, the Mind Flex doesn't necessarily give you a more accurate reading, but it does give you more data to work with. And I'm not inclined to say "no" to more data.

Also, the Mind Flex is a better candidate for major changes to the hardware layout, since the leads from the electrode and baseline sensors are soldered directly to the NeuroSky daughterboard. You could conceivably desolder the NeuroSky board from the Mind Flex main board, and integrate it into your own hardware design. In comparison, the electrode leads in the force trainer are soldered to the main board, which means you would have more desoldering work to do if you wanted to remove the NeuroSky board.

For these reasons, I recommend the Mind Flex over the Force Trainer if you're buying one specifically to hack. But if you already have a Force Trainer lying around, it will certainly work too.

April 14 2010 at 5 PM

I'm definitely not a neuroscientist - just a regular day to day web programmer hoping to find something cool to play with. My question is this - can these kind of hack devices be used (or programmed) to replace keyboards? I was following a link to the OCZ NIA and I think I'm going to order one of those to play with (as there are many users who have hacked stuff into it with an API), but they mainly relate it to a joystick rather than a keyboard. Any thoughts on this?

April 14 2010 at 5 PM

Steven:

So, I got my supplies in and wired this thing up.. ( my soldering skills are lacking ).. The program / library worked like a charm and the processing app did its thing wonderfully.

Few questions: Where should the headband be located to make sure I have a green light all the time? Can I buy your l33t soldering skills at the store? Is there a way to change the rate in which the Nerosky chip sends data?

April 15 2010 at 5 PM

Steven, I'm wondering the same thing about the headband placement. I haven't seen it read a 0 for the signal strength (indicating good reading)...

I don't think there's a way to change the rate of data being sent from the Neurosky, if there is I'd be interested in knowing. If you're getting too much data to work with, you can always read it less often (as opposed to having it send less often) or do some post-processing with the raw values to calculate averages and such.

I'm going to interface mine with some RF xmitter, thanks for the article & lib!!

April 19 2010 at 10 PM

Eric Mika:

Steven: Great to hear that it worked for you!

NeuroSky says the headband electrode should be located above your left eye. If you're having trouble getting a good signal, there are a few things you can try: Replace the AAA batteries. Try turning the headset on and off while it's on your head... and try to hold as still as possible during this process. Also, you can try cleaning the electrodes (I use isopropyl alcohol).

As for soldering, the trick I use is to bend the end if wire to be soldered into a loop. Then I tin it with a generous dab of solder so that the loop is filled. This means I don't need to apply any additional solder when attaching the wire to the pins on the NeuroSky board, which leaves both hands free to maneuver the wire and the iron.

And finally, there's no way to speed up the data output... you should expect about a packet per second. (Likely because the chip is doing a bunch of averaging and FFT work on the wave data it collects in that period.)

If you're interested in a faster data rate, you could try the official NeuroSky MindSet, which gives you access to the raw wave values, or look into Open EEG.

April 19 2010 at 10 PM

Michael:

I've got everything to work but the visulize part. I'm not familar with "Processing" so that could be the problem. I downloaded the app, and put "brain_grapher" folder in a variety of places and opened the brain_grapher.pde. The program loads, but now graph appears. Am I missing something simple?

April 20 2010 at 2 PM

Michael:

I figured it out. I just needed to change the serial.list from 0 to 1.
Sorry for the previous long post

April 20 2010 at 4 PM

Eric Mika:

Michael: Great, I'll make a note of this in the tutorial.

The warnings you were getting from ControlP5 are normal.

April 21 2010 at 6 PM

Jippie:

Hello Eric,

Thank you for this great contribution! I've been testing the SoftSerial library with an Arduino with a hard-wire connection to a BlueSMiRF Gold bluetooth dongle, remotely connected to a Mindset. When using the example code 'BrainSerialOut' the Arduino serial terminal, spits out, first a parsing error, but then a line of, what looks like, readable data, every second. Because of the error I don't know if this reliable data...I use the 57600 baud rate for the softserial, and serial connection.

all the best

Jippie

April 26 2010 at 9 AM

AbstraktBob:

There is a discount store in MPLS, Discount 70, that has the Force Trainer for $40. But now I want a Mind Flex.

April 29 2010 at 9 PM

Eric Mika:

Jippie:
If the data is parsing into a CSV without errors after the initial hiccup, then it should be reliable -- it's unlikely that the packets could parse at all if there were any dropped bytes (there's a checksum) so if you're getting the data it's probably good.

I haven't encountered this issue myself, so it's likely related to your wireless configuration. If you're particularly concerned you can send a screenshot from the Processing grapher and I can let you know if any of the numbers look ridiculous.

The baud rate shouldn't matter. (The Brain libray is hard-coded to read from the NeuroSky chip at 9600.)

AbstraktBob:
That's an amazing price for the Force Trainer. It's very interesting to me that despite using the same data in nearly the same way via the same technology, the Mindflex receives much more praise from consumers and the press than the Force Trainer does. (e.g. the Mindflex has an extra half star on Amazon, and received an award from Popular Science, etc.) Better marketing? Better timing? Better gameplay? Who knows.

May 5 2010 at 11 AM

Daniel Bas:

Hi All,

I just want to say this project is amazing first and I read it a few days after I got my arduino! I was wondering if instead of sending it to a computer over serial, I could just have it control other stuff connected to the arduino. I know it is possible because it is just reading values from the headset, and it's also being parsed on the headset. So how would I have it just send the values to a variable? In the beginning, the program has :

Brain brain(Serial);

(and later on...)
Serial.println(brain.readCSV())

---------------------------------
what would I put in place of serial for it to just send it to a variable? would I just have a string var, and then do "Brain brain (variable_name);" ? Do I need that line in the first place if it isn't interfacing with serial?

what I want to do is have, every time it updates, it makes an integer variable equal to the "attention" value being read from the headset. So I guess:

int concentration_value = byte readAttention();

Sorry if that was a long explanation for a probably simple and obvious task. Thanks,
Daniel

May 5 2010 at 2 PM

Eric Mika:

Daniel:

Yes -- the library is designed to let you skip the CSV and instead access the latest readings directly from your Arduino code. The CSV is just a convenience if you want to send the values to another program.

Check out the "BrainTest" example that's packaged with the brain library, it illustrates exactly this use case by blinking an LED on pin 13 faster or slower depending on your attention level.

(Not the most creative application... just wanted to keep it simple. It's safe to delete the Serial.println(brain.readCSV()); line from the example, it's only there for debugging.)

Take a look at the "Function Overview" section of the brain library's readme file as well, it describes all the functions in the library -- there's one to read each of the values coming out of the NeuroSky chip individually.

You still need to call Brain brain(Serial); at the start of the program to set up communication with the NeuroSky chip, even if you don't end up sending serial data out of the Arduino.

Your intended application is the main reason we bother parsing the packets on the Arduino itself instead of on a PC, so I'm happy to see this feature go to use.

Good luck and I'd love to hear what you end up building.

May 5 2010 at 2 PM

Jippie:

Hey Eric,

Thanx for the explanation. I switched from the softserial Library to the hardware serial library, and used a Arduino Mega instead. I still use the BlueSMiRF for the wireless connection. Spits out data very stable now. I already made an experimental installation with it and tested it on some visitors. Still needs some tuning but it works already:). http://besneeuwd.blogspot.com/

best Jippie

May 6 2010 at 5 AM

epokh:

DONE GUYS!!!!!!!!!!
Successfully connected to my Zigbee in AT mode transmitting to my host pc.
Without any intermediate arduino or additional batteries.
I will post the info on my blog.
Don't have a camera in my lab right now!
I discovered some nice things with the oscilloscopes.
Drilling some holes tomorrow to keep everything in da box!
Gghgh VICTORYYYY!

May 7 2010 at 1 PM

Eric Mika:

epokh: Sounds great -- are you grabbing bytes before or after the headset's microcontroller? Parsing on the computer? I look forward to the post!

May 7 2010 at 2 PM

I just wrote it on my blog in a rush and a very poor phone camera.
I will fix it properly on the next days. I want to 1 try to disconnect the radio module to save power but this depends on the firmware of the microcontroller that maybe will stop sending data if the radio is not present and 2 glue the zigbee inside. For some reason i want to use the API mode and do my own interface but a quicky is just to put it in AT mode and use your library over serial.

http://www.epokh.org/blog/?p=298

May 7 2010 at 7 PM

silver84:

Hello All,

First many thanks for all these precious informations.

Before, I was ready to buy quickly some Neurosky tool like Mindset or hacking a toy like Mindflex.

But I read John-Dylan Haynes about mind flex and also I am very surprised that here nobody reports something about the test suggested by Milarepa.

Sure its difficult to see Alpha wave with your eyes closed ;) but camera exits or other people can control.

Are you afraid to discover, like Hayne, that its only a toy with a random engine ?.

(Sorry, my English is very bad)

May 9 2010 at 9 AM

epokh:

You are totally right, that's why I'm using the xbee module so that I can read the power bands. That's the first test I want to do, when I manage to put all inside the helmet without wires going out.
And yes I expect to see a lot of noise. In that case you can use it as a random noise generator.
:-)

May 10 2010 at 2 AM

Anonymous:

Thanks for writing up your findings -
I recently bought a cheap Force Trainer.
Has anyone performed this hack on a Force Trainer -
i.e: wiring the arduino directly to the headset?

On the force trainer Neurosky board I can see a
cluster of 6 pins, two are "+", "-" power, to the right are 4 pins
with the letter "R" above them - any clues as to which are receive & transmit?

May 10 2010 at 11 PM

Anonymous:

oops - re above post... I found the tx pin on the Force Trainer.
the pin labels are on the reverse of the board...

May 11 2010 at 1 AM

epokh:

Some more high res pictures:
http://www.epokh.org/blog/?p=310
as you can read I need to put it on the other side.
I was such a chicken to try to close it in that way!

May 11 2010 at 4 AM

Steven:

I found my mindflex on eBay for ~25.00 AS IS ( it was missing the foam balls ).. Look at discount/outlet/scratch&dent stores online. The headset was was still in the original packaging.

Hope this information helps.

Side note: the game itself has a few nice parts in it and you can always take away some LEDs

May 11 2010 at 10 AM

Arturo:

Eric? Eric? Boy you've been busy.

May 12 2010 at 5 PM

silver84:

Humm,... have you a dream ? never anyone who does some tests :(

No one tests by shutting /opening the eyes to control Alpha waves, no one using, like John-Dylan Haynes, a plastic head... what a shame !

Take a few minutes to look at this video (its not necessary to understand German language... Hayne is not a stupid man :( ) :

http://www.spiegel.de/video/video-1044310.html

May 13 2010 at 7 AM

I'm an artist planning to use the eeg-toy hack in an art installation to make configurable art for the viewer based on brain scans. www.lauriefrick.com

I got as far as getting the Deumilanove Arduino board, and soldering the connector wires to the T and Ground on the mindflex headset. I was encouraged when I saw how different the mindflex operated for various people, meaning it's at least getting different output. But started to burn hours trying to configure things that are just a couple steps beyond my ability...but I was totally game to try to get it working...and now really want to use this.

I'll share all my data gathering and experience with you. I'm in New York next week (mostly live in Austin) -- could I get help to get the hack configured and chat a bit about connecting neuroscience and art??

Thanks a ton,
Laurie

May 13 2010 at 8 AM

epokh:

silver84,
yes I know that professor and I've been in the Max Plank BCCN institute sometimes. As I said I want to test the quality of the FFT and not of the concentration bar which is the one the toy is using. The neurosky chip is low noise bio amplifier, that is how it should be taken. Then of course the final application is not brilliant, consider also the environmental condition. A fair test should be to put the neurosky sdk or the hacked mindflex chip in a radio anechoic chamber and measure the SNR.

May 13 2010 at 11 AM

silver84:

Epok,

Yes, but the test can be very much simple, like with plastic head with wet towel from Haynes, here there is no electric isolation problem... (no need for linear optocoupler, wireless and so on) :-)

You are alone to answer, so I think people here, seam to prefer the dream to the reality and finally that its what Haynes says ;-)

So, I always dont know if the Mindset is also a dream machine as the Mindflex could be :-(

May 13 2010 at 5 PM

Eric Mika:

silver84:

I don't think Epokh is "alone to answer" -- I constructed the original post in a way that would offer answers, or at least starting-points for skeptics. I encourage you to read the white papers NeuroSky has published ( http://developer.neurosky.com/forum/viewtopic.php?f=2&t=45 ) which, if they are to be believed, demonstrate that the data is more than random noise.

May 13 2010 at 7 PM

ricky:

Hi, i tried to use this hack to control a robot for a university subject, but i couldn't get it work. I'm watching my brain waves but never receive any signal about Attention or Meditation. Later i look the serial data and those signals are always equals to zero. Anyone can help me?
I tried to replace the batteries, cleaning the sensors, adjusting the headset well as a i read in mindflex web page (with the logo above the left eye), and i don't know what more can i do.
Thanks

May 14 2010 at 1 PM

Eric Mika:

Ricky:

It sounds like you're not getting a good connection, what is the first value coming in over serial? If it's greater than 0, then you don't have a decent connection.

Did you check continuity of your ground lead?

May 14 2010 at 5 PM

silver84:

Hi Eric Mika:

As I said before, you have done a very good job here.
There is no aggression against anyone in my posts (perhaps my bad English might be not very well understood...)

I know and I have already read your 4 links, 2 of them are copyright ed by the seller of the system...

But its not about I (try to ;) )speak : I am disappointed to dont read here any test trying to prove Hayne is right or wrong.

Also I find nothing about the Haynes test in the Neurosky forums, like I dont find any reactions from Neurosky on the net about the Hayne test ?!?

You know, some days ago, few minutes before finding this link (here) I was going to buying the Mindset and now I am not sure its a good idea, its the right product.

Here in Europa, many months later, the Mindflex from Mattel is always not sell (why ?) its only possible to buy the Mindset on the Europa shop from Neurosky.

May 14 2010 at 5 PM

ricky:

I get it!! :-) I thought that my headset was broken because the signal level never was green and i can't receive Attention and Meditattion signal but I tried to put on my mothers head and after 2 minutes begin work. I thought about our diferences .. my head is quite bigger than my mum's so the headset don't fit well .. maybe my mother' skin has a better conductivity .. i tried using aloe vera gel on the three sensor (2 on ears and the third on the forehead) an .. began work!!

Thanks Eric Mica, you were in truth, was a connection problem (but i read your help late :-p )

Im going to use delta signal in combination with Arduino's IRremote library and two IR leds to make an ON/OFF switch to move forward or backward my robot using the Sony IR Protocol. Im going to have an excellent at this subject thanks to you ;-)

May 14 2010 at 6 PM

I got this up and running this evening, but I keep seeing the following error in my serial logs:

[0] "ERROR: Packet too long

Have you (or any other readers) run into this, and what does it mean?

I still seem to get data out of the device, though no-one who tried it got much of a read out of sensors other than the Attention/Meditation readings.

I also ran into some obnoxious errors with 64-bit Ubuntu and processing; I ended up copying the system copies of the rxtx library into processingdir/libraries/serial/library.

June 6 2010 at 5 AM

Getting a clear connection = move to a different 'clean' spot.

Have been having trouble getting a clean '0' connection, and no matter how much alcohol swabbing I did, couldn't maintain a green light on the brain-grapher. Read on one of the neurosky developer posts http://exceptionalpsychology.blogspot.com/2009/08/neurosky-eeg-for-masse... -- suggested to try moving to a cleaner signal spot in the room. And I instantly got a good, clear, clean signal. Good tip.

June 7 2010 at 8 AM

Hey Eric, I have it working on Windows 7.

changed the 1 to 0 in this line of code.
serial = new Serial(this, Serial.list()[0], 9600);

laurie

June 8 2010 at 10 AM

Eric Mika:

Hi Laurie. Thanks -- different computers will have different serial port assignments. "0" is usually a reasonably safe bet on the Mac, but I'm not sure that's the case on Windows.

If you're not sure which one to use, you can add the line println(Serial.list()) to the Processing sketch to see a list of each port so you can select the right one.

June 13 2010 at 1 PM

Rustichan:

Ok, I have my Mindflex and have just ordered an Arduino board. I'm relatively inexperienced with electronics, but I have some friends and family who can teach me the soldering skills and such. OUt of curiosity, can this hack toy be used with the official Neurosky product's software and games...I noticed there were a number of free downloads on Neurosky's website.

July 16 2010 at 2 AM

Mic:

I've got the same thing as Michael described except that changing the serial.ist index (I tried 0 all the way to 10) makes no difference. I still get,

"The package "controlP5" does not exist. You might be missing a library
Note that release 1.0, libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder."

The brain_grapher folder is in the Processing/libraries folder. There is no 'sketchbook' folder that I can find. After creating one and running brain_grapher.pde from it I still get the same error.

Same problem on Mac and PC... I tried with Arduino running and closed, same still.

Is there a troubleshoot I have ignored along the way? Thanks

July 21 2010 at 2 PM

Mic:

d'oh! Don't you hate it when people jsut want to obey the instructions without thinking! Sorry about that. I looked back over the earlier paragraph telling me to install controlP5 and it now works when on my head! Worse noobs than me might need to know this. There were no traces showing until I put it on my head

Cheers, awesome work man!

July 22 2010 at 3 AM

Excellent project Eric

I've dabbled with eeg over the years but when I saw this I had to try it because it looked so straight forward - and MindFlex became available in the UK a few weeks ago.
Got the hardware sorted without any problems but having trouble with the graphing. Get the csv data from the MindFlex when using the serial monitor but when I run the grapher I get the following error:

error: variable or field 'serialEvent' declared void In function 'void setup()':
In function 'void draw()':
At global scope:
Bad error line: -3

I've tried to change line
serial = new Serial(this, Serial.list()[0], 9600);
as suggested but having no luck

Any ideas
Hopefully
Steve

July 24 2010 at 10 AM

As usual - posted too soon. I had been running via the Arduino control panel. I downloaded the Processing package from the software list above, added the graphing and IP5 folders to the library of Processing and ran the graphing from within Processing. No changes needed, it just works. Brilliant. Now to write an app to dump the csv data to file and collect data during dream sleep.

July 24 2010 at 5 PM

Rustichan:

I got it running!!! (with the help of my brother and sister's husband.) Awesome! Now, does anyone know Arduino programming to save the data to an output file? I imagine it's pretty simple, but simple is currently beyond my reach...

July 25 2010 at 2 AM

Tadaa final clean up on hardware and software.
Enjoyyyyyyyyyy.
Thanx a lot to EricMika and Spiffomatic for the software.
Now I can go to sleep.
Ehhhhhp!

August 1 2010 at 6 PM

Ops the link didn't show up again:
http://www.epokh.org/blog/?p=317

August 1 2010 at 6 PM

Skater:

Guys you've done some amazing work!! I was really looking at using two of these headsets and seeing if they produce similar results. With two mind flex units / headsets do you think the rf transmitter operates on the same frequency and would cause problems? If so is it possible to change the rf freqency of one unit? Also is there enough space to perhaps mount an xbee inside the headset with only minor modifications?

Sorry for so many questions! Thanks

August 17 2010 at 8 AM

bcook65:

Help...
made the hack to the mind flex headgear. loaded the brain_serial out to my arduino and it is sending data to the serial monitor. When I run processing and open and run the brain_grapher.pde I get the following error:

The package "controlP5" does not exist. You might be missing a library

Note that release 1.0, libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.

Ive downloaded the controlp5 .. there is no controlp5 folder unless you go into specific folders and most of the folders have that folder or file named that.. I have copies of that everywhere i can find a library to put them.. Maybe I missed something but have watched the video and read the instructions numerous times and cannot seem to find what I am doing wrong. Any suggestions??

Bcook65

September 5 2010 at 2 AM

shaiel:

Huh! I've been diagnosed with Narcolepsy, which, for those only familiar with the Hollywood version, doesn't mean randomly falling asleep mid-conversation. Narcolepsy is characterized by episodes of what are called "micro-naps," where the sufferer will lose consciousness for a few milliseconds and then wake up several times over the course of the episode. During the episode, the sufferer cannot think straight. I find it's sorta like the confusion on the verge of going to sleep or just after waking up.

EEG analysis is generally not used to diagnose or investigate narcolepsy. Instead, other symptoms are checked (usually, the time delay from NREM to REM sleep, which in normal people is 90-110 minutes, and is 0-10 in a narcoleptic). During this time, the patient's EEG levels are monitored, but only the NREM -> REM data is used.

From what I can tell, in a hospital setting like that, I'd never have a narcoleptic episode. Certain things keep me alert, including human interaction, especially when around non-friends (and also other stuff like, say, standing up). I'm not sure if this is true for others with narcolepsy, but I'm really, really curious now what my EEG levels look like during an episode. This hack would give me the opportunity to examine my EEG levels while alone.

My hope is that I can rig a device to monitor my EEG levels constantly, and inform me when I'm about to have an episode, or heck, when I'm currently having an episode. Because my brain is in an altered state during it, I can't parse the thought "Oh, I'm having an episode; I should go lie down." I don't realize until it ends what just happened. I've learned to watch for signs that one is coming, but doing that is really exhausting.

If this is possible with the brain hack, if the values are good enough and if the changes are distinctive enough (I know that's a lot of ifs...) maybe I can rig something that'll vastly improve my quality of life. I still drive, but I take significant precautions when doing so and only go short distances (30 mins or less) to minimize the risk. Between those and my meds, I'm as safe behind the wheel as any other MA driver, but I still fear having an episode. This could eliminate that fear, and possibly save my life if I do have an episode that I failed to notice was coming.

I'm not getting my hopes up, but thank you for providing the opportunity to try :)

September 10 2010 at 2 PM

Troy:

Thanks for a great project. I put it together tonight and it works great.

September 12 2010 at 9 PM

Peter:

Is the data using the arduino a valid one?

September 18 2010 at 10 PM

For those who want to save data to file, follow the link below to some instructions. Bit of a hack but it works with no programming mods or skills needed.
http://www.49days.co.uk/FileSave.html

September 19 2010 at 2 PM

Peter:

can you send me an example of the data you graph using putty steve

September 22 2010 at 9 PM

Josh:

Awesome project, I was wondering your thoughts on the difficulty for someone with no experience with circuitry/soldering to re-create the project as this would be a first for me. From the video guide it looks like a pretty straight forward procedure, but are there any tips or precautions that I should be aware of before I attempt it?
Any response asap would be greatly appreciated!

September 29 2010 at 11 AM

Josh:

Awesome project, I was wondering your thoughts on the difficulty for someone with no experience with circuitry/soldering to re-create the project as this would be a first for me. From the video guide it looks like a pretty straight forward procedure, but are there any tips or precautions that I should be aware of before I attempt it?
Any response asap would be greatly appreciated!

September 29 2010 at 11 AM

daniel:

For people interesting on lucid dreams :
Here you can see a diy for creating a lucid dream mask which detects when you are on REM :http://brindefalk.solarbotics.net/kvasar/kvasar.html

I have also readed lucid dream could be created on NREM fase,when delta wave are the predominant.I am not sure if it could be detected with some simpler as:
http://www.hackcanada.com/homegrown/wetware/brainwave/

Now about mindflex,are you tried use your modded mindflex with Mindset's demos/games on pc?
it would be great could use this device as a mindset and/or PLX XWave (the new device which would conect to iphone/ipod touch streaming the data throught audio jack.

After reading this blog and the devices website it seem they work same way and the most important :they use the same kind of data.
thanks for your hack
dani

October 1 2010 at 6 PM

Johannes:

hi,
first of all: super cool project! thumbs up!

aaand finally, I got it running. had some minor problems on the way ...

BUT I don't get any 'attention' or 'meditation' visualization, nothing happens in the first two channles.
an example of what's going on in the console:

[0] "ERROR: Packet too long
"
[0] "26"
[1] "0"
[2] "0"
[3] "1552612"
[4] "1331628"
[5] "201669"
[6] "789348"
[7] "694722"
[8] "501563"
[9] "528459"
[10] "272948

the rest seems ok. looks like the example above.
I'm new with processing, so could somebody tell me what that means?

shouts from germany! and thanks in advance if there's someone who can help

JO

October 2 2010 at 8 AM

Johannes:

ok ... must have missed the question by ricky above. read all the comments again and finally got my first two channels working. saltwater on my ears an forehead ... as easy as this. damn.

the error still occurs, though.
and no matter how hard i try ... attention is almost all the time below meditation ... hope that's no bad news concerning my brain status lol

October 2 2010 at 11 AM

Josh:

I've done the hardware hack and I'm at the point were I've connected the ardunio and mind flex but when I open the serial monitor it remains blank. I believe I loaded the brain library correctly but i did notice this extra bit of code in my script "Serial.println(brain.readErrors());" other than that its exactly the same as in the procedure. any suggestions on what im doing wrong?

October 5 2010 at 11 PM

Jay u:

Josh, check your baud rate. I was having the same issue but I got it worked when I change the rate to 9600 or 14400.

October 27 2010 at 11 AM

Jay u:

My problem is have Processing running but I have nothing happen on graph and got following WARNING:

ControlP5 0.5.4 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
27-Oct-2010 11:34:20 AM controlP5.ControlP5 checkName
WARNING: Controller with name "showGraph" already exists. overwriting reference of existing controller.
27-Oct-2010 11:34:20 AM controlP5.ControlP5 checkName
WARNING: Controller with name "GRAPH" already exists. overwriting reference of existing controller.
27-Oct-2010 11:34:20 AM controlP5.ControlP5 checkName
WARNING: Controller with name "showGraph" already exists. overwriting reference of existing controller.
27-Oct-2010 11:34:20 AM controlP5.ControlP5 checkName
WARNING: Controller with name "GRAPH" already exists. overwriting reference of existing controller.

[And so on...]

Anyone running the same issue? Thanks for anyone who could help~

October 27 2010 at 11 AM

Eric Mika:

Jay: Those warnings are normal, it just has to do with the way the code instantiates the GUI elements. If you're not seeing anything in the grapher, check the Arduino serial monitor and make sure you're getting data from the MindFlex.

October 27 2010 at 12 PM

Jay u:

Same as above few people. Post too quick!! I was misunderstanding the order of serial port. My arduino is in COM9, I keep trying:
serial = new Serial(this, Serial.list()[8], 9600); and
serial = new Serial(this, Serial.list()[9], 9600);
Neither of them works.
I figured if I have serial: COM1, COM2, COM3, COM9, COM11. I have Arduino connected @COM9, I should use:
serial = new Serial(this, Serial.list()[4], 9600);

if you have COM1, COM2, COM4...so on and you have arduino @ COM4. You should use
serial = new Serial(this, Serial.list()[3], 9600);
not
serial = new Serial(this, Serial.list()[4], 9600);

Anyway~ Great works Eric Mika and thanks for all who post any helpful info here!

October 27 2010 at 5 PM

Jay u:

LOL~ Didn't see you already replied. I have this window opened since this noon. Thanks for reply anyway! It all works great!

However, I was test on my desktop not laptop with battery. Does that really matter or serious issue? The only thing hurts me is the zip tie and headband was too tight because I got a big head. haha...

(They are not going to cause brain dead, are they?)

October 27 2010 at 5 PM

vsurducan:

Hi Eric,

As I saw the neurosky chip can be interfaced directly to the RS232 PC without using any microcontroller, however an optoisolated level converter is must.
What software do I need to compile the open source visualiser, without using Arduino?
Thank you,
Vasile

November 17 2010 at 9 AM

This is a fantastic hack, Argos are selling these Mindflex things in the UK for 59 quid at the moment (Dec 26th 2010), so I purchased this and got it working in half an hour or so , this is really useful for a project I am doing on memory - my aim is to use the data generated via your excellant Processing App to train neural nets so they can categorise my responses while hooked up....thanks very much - a clear and perfectly working hack!

December 26 2010 at 4 PM

Skater:

I've been playing around with this Mindflex hack and unfortunately I've only sometimes been able to maintain a consistent good connection. I've tried putting bigger wiring on the ground, using salt water on my electrodes and my ears and forehead and turning off other RF devices to remove radio interference (heres hoping). I can get the green light and the attention meditation values only after a couple of minutes and only for short bursts. Is there something else I can do?

January 3 2011 at 2 AM

Alex:

It seems many people are having issues with connectivity. Without a good connection you cannot get correct meditation/attention readings. Rarely, can i get my connection value below 25. What advice can you offer to ensure a good '0' reading for connection? Did you have any issues with this?

January 3 2011 at 8 PM

Mark:

This project has opened my eyes to a whole new world of interfacing.I am a bit confused about one thing though and would welcome any insight...

Whenever my skin/sweat/dead-skin/whatever results in a bad connection, all I have to do is touch the Arduino board ground (any ground [i.e. a wire to ground], but over an area [like wire coiled in a spiral/wrapped around a finger/etc, or the housing for the USB jack]).

Grounding myself, the quality goes back to 0(good) and Atten/Med values update fine. In fact I am really getting consistent behavior with eyes closed / open.. i.e. my alphas toggle, but wired enough, if I am lying down and calm, gammas seem to go as well (maybe I'm 'feeling' my vision cutting off..to get the cross-sensory read).

More interesting is that many EEGs (that I can find online, that are not wireless) have wrist bands for grounding.. here is a procedure that has one too: www.focused-technology.com/downloads/eeghook1.pdf

So why no band on the MindFlex product? does being wireless (and a floating potential, i.e. no ground connected to earth ground) really fix the issue?

Has anyone on this form (I'm looking to you epokh, *wink*), with a wireless (i.e. xbee or whatever) implementation, had the issue of poor signal quality value?

I was thinking to implement an opto-isolator, but don't know a good module. I was also thinking of how much of a load led + resistor would put on the tx line (on the nerosky card), maybe a dirty quick solution would work. I don't have a scope (the other arduino I bought a few days ago [to turn into a scope] is back-ordered / still-in-transit, LOL) so I can't analyze the floating ground relative to earth (but I suspect the hum is to blame).

Insight?
Thanks!

January 6 2011 at 10 PM

Sk8ersquare:

I'm going to try and get an opto isolator tomorrow and see if I can get better results as this does seem to be some kind of issue introduced by the hack - as ive noticed once the wires are connected into the board suddenly the headset is unable to calibrate with the main base station. Signs it is unable to establish that '0' quality connection. I'm wondering if the led load of the isolator will continue to show this issue though - I will let you all know the results.

January 9 2011 at 7 AM

George:

i saw someone complain about the price...

Neurosky gives a big university discount in usa and eu, just email sales if you're a student or teacher

January 12 2011 at 7 PM

Mark:

Sk8ersquare: Earlier ppl said that the daughter card was really sensitive to drops in it's source.. the led will likely draw current from a fet-based (i.e. CMOS) tx (because it's a tx likely->high output impedance), and could pull down the VDD a bit causing the card to act wrong (PURE GUESS)... But if i'm right, then maybe a fet hooked up strait to the batteries (i.e. right to the batteries, not after any regulator) could be used to power the optoisolator... i.e. the tx just powers the gate, with likely a common source config? maybe drain, it's been ages since i last worked on transistor models.. hahah first yr circuits..

Best of luck! my parts are in the mail, so i'm still stuck waiting... hahah.. but I made BrainPong in processing and it's hilarious.. if anyone wants it, just let me know.. It's nothing special, just uses the serial data to control the speed of the up-down scroll of your bar.. that's it, NO score/ai/2player/etc.. but the name made me laugh.. BrainPong ahahah..

January 13 2011 at 7 PM

Jade's Mom:

We bought my daughter MindFlex for Christmas, and would love to somehow turn this into a science experiment for the science fair. I read through this forum and while I think what you are doing is brilliant, it is far beyond this simple Mom. Can anyone give ideas how how to use MindFlex to measure "thoughts" and neatly wrap it up into a 10 years old 5th grade science fair experiment? Thanks so much!!!

January 15 2011 at 5 PM

qsue47:

every time i try to upload it to the board i get an error message saying brain does not name a type .. what am i doing wrong?

January 18 2011 at 5 PM

Eric Mika:

Hi everyone, thank you for your comments. I apologize for the delayed response.

@Rustichan: Saving to a log on the Arduino itself is kind of a pain, but perfectly doable with some extra hardware to interface with flash memory. This microSD Shield looks like a good start. Unless everything has to be on the Arduino, it’s going to be much easier to just use Processing to save the values to a text file. Processing makes this trivial thanks to the saveStrings function (if you want to write a log in one shot) or createWriter (if you want to keep appending data to the same log file).

@Skater: I don’t think there are interference issues, and if there are we don’t care because we’re not using the Mind Flex’s radios anyway. Wireless is definitely possible. I’ve used a pair of Mind Flex headsets transmitting wirelessly over XBee radios without any problems. Unfortunately, though, there’s not enough room in the headset to squeeze an XBee, so you’ll need to mount it on the outside. I’m sitting on some code that lets you go straight from an XBee on the headset to an XBee connected to a PC, effectively cutting the Arduino out of the picture for applications where it’s not needed… still need to clean it up and write a post. If anyone needs it now, just send me an email.

@bcook65: I don’t completely understand what you mean about there being no controlP5 folder. There’s good documentation about installing libraries on the Processing Wiki.

@shaiel: Very interesting! Any success / findings?

@Josh: The project is relatively simple, although the soldering is a bit tricky simply because there’s not much space next to the pins and you don’t want to short them. But I’d say go for it. If you don’t have an Arduino already, you could get up to speed on soldering technique and basic electronics by building one from a kit.

@daniel: Thanks, I haven’t tried any of the Mindset’s demo games. I kind of doubt they would work since I’m using my own packet format (the CSV) and Neurosky’s software is probably expecting a Bluetooth connection. (Could be ways around this…) Frankly I’m not interested enough in any of their games to bother, but let me know if you have any luck.

@Johannes: I’ve seen the “packet too long” come up now and then. I think it’s harmless since any bad packets are just discarded. The message is actually coming from the parser running on the Arduino, not from within Processing.

@Josh: Can you get any serial data at all from the Arduino? Do you have the right port selected? If basic serial troubleshooting fails, then I would check the hardware for shorts or other problems.

@vsurducan: I ported the Arduino code to Java so the brain data can be parsed straight through Processing via USB (through an RS232 converter, of course). I’ll post the code eventually, or email me if you want it now.

@Mark: Interesting, I hadn’t noticed the grounding thing before. You should already be grounded relative to the Arduino circuit thanks to the two ear clips, but maybe extra grounding will help. Regarding opto-isolator, SparkFun sells a nice module, although I haven’t tried it myself. I think it might be easier to just go wireless.

@Sk8ersquare: You might check the hardware / batteries. I’ve had no trouble simultaneously connecting to the Mind Flex base station and reading the packets through the Arduino. (That’s how I found out that the LEDs on the base station are simply mapped to the attention value.)

@George: I think they offered us 20% off. Shrug.

@Jade’s Mom: Great! If you’re not up for the soldering + arduino + code approach of the full hack, I imagine you could shape a basic science fare project around observing and writing down the number of green lights illuminated on the Mind Flex base station during different activities.

@qsue47: That means the Arduino development environment can’t find the library. Make sure you installed the library correctly and that you have the #include <Brain.h> line at the top of your Arduino sketch.

January 22 2011 at 12 AM

Shay:

I picked up the MindFlex yesterday at Walmart on clearance for $49. Don't spend $80 if you don't have to.

January 28 2011 at 10 AM

So cool! Thank you for the best how-to hack vid ever. I built the eeg using the Mindflex and it is reading great, but I am having trouble with your visualizer software. When I run the program it says that "ControlP5 does not exist, you might be missing a library". Do you know what needs to be done? I'm really excited to see this info with a visual. I am pretty new to "Processing", so forgive me if it something basic. Any help would be Awesome. Thanks

February 1 2011 at 2 PM

Eric Mika:

@Patrick: Sounds like you need to download and install the ControlP5 library: http://www.sojamo.de/libraries/controlP5/

February 1 2011 at 3 PM

Thanks Eric, got it!!!

February 1 2011 at 4 PM

Noega33:

Hi,
Gret job. I got my Mindflex last Weekend and I'm expecting my BTM-182 bluetooth module anytime soon
A) As anyone already connected the Mindflex to a PC (using the Processing Grapher) using the BTM-182 ?
B) As a small contribution to the community, please find this link that provides the TGAM1 module specification
http://wearcam.org/ece516/neurosky_eeg_brainwave_chip_and_board_tgam1.pdf

it explains how to select output data and also how to adjust notch filter to adapt to 50Hz or 60Hz environment (usefull if you bought the mindflex in the US and use it in Europe (as I'm))

February 3 2011 at 3 PM

Dan:

Great hack, been faffing about for hours now, not getting any data through. I haven't seen the Bluetooth Arduino boards mentioned so maybe this is my problem? I can upload to arduino fine, but serial monitor shows nothing. I am using BT w/ ATmega 328 so testing with usb is not an option.

If anyone has any ideas they would be much appreciated.

Thanks

February 6 2011 at 9 AM

Noega33:

Hi,
I Connected a BTM-182 (using the board described here:http://atomsoft.wordpress.com)
I was able to check the BT connection using Visual Basic 6, but I cannot make it work with Brain_Grapher (processing).
Get somthing similar to what Jay u reported:

ControlP5 0.5.4 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
27-Oct-2010 11:34:20 AM controlP5.ControlP5 checkName
WARNING: Controller with name "showGraph" already exists. overwriting reference of existing controller.
27-Oct-2010 11:34:20 AM controlP5.ControlP5 checkName
WARNING: Controller with name "GRAPH" already exists. overwriting reference of existing controller.
27-Oct-2010 11:34:20 AM controlP5.ControlP5 checkName
WARNING: Controller with name "GRAPH" already exists. overwriting reference of existing controller.

[And so on...]

*****************
I also have the graph displayed but nothing on it (the CommunicationLink is even GREEN!)

Do we need to set-up the serial to 19200?

Any suggestion?

Cheers

February 9 2011 at 6 AM

This is the best article and comment thread I have read in my life.

February 17 2011 at 4 AM

Is there any reason why you couldn't install (glue exteriorly or whatever) an RJ11 phone jack on the mindflex and clip that in to the arduino from about six feet with a similar jack? I mean we're transmitting numeric data - not analog values, so technically, it doesn't even need to be shielded, does it? It seems awkward to have a whole unprotected arduino strapped to one side of your head.

February 19 2011 at 11 PM

Also:
Does the Processing graphing .pde include real-time information?
Which leads of course to the next idea:
Also - is there an easy method to convert the saved data to .edf format?
http://www.teuniz.net/edfbrowser/
This might be useful for non-professionals who have the ResMed S9 Autoset CPAP machine so they can compare there existing .edf sleep data with relevant concurrent brain state data.

February 19 2011 at 11 PM

Eric,
I've executed your mindflex hack, and i'm getting set up for the first time with the arduino uno, and i've got a compilation error on your Brain library.

Arduino is recognized by the system and can run example apps such as Blink.

I load up your BrainSerialOut, and if i compile it i get:
"BrainSerialOut.cpp:5:19: error: Brain.h: No such file or directory"
followed by BrainSerialOut:7: error: 'Brain' does not name a type which is just because of the error above...

I have the arduino core source built and copied to: ~/Documents/Arduino/
(contains /app, /build, /core etc...), and here is where i have copied /Brain and am running the app from.

just out of curiosity, i ran
$ gcc Brain.h

which returns:
Brain.h:7:22: error: WProgram.h: No such file or directory

I do have that header file though, in the arduino source, It just seems like the compilers arent knowing to look in the right folder.

I feel like there is just a small dependency or directory structure issue that I am overlooking being brand new to this platform. I really really appreciate this article and work you've done.

Can you give me any hints at getting past this?

PS I am making a musical synthesizer in flash, for use in my various music projects. you will click with a mouse to choose various parameters... pitch, resonance, cutoff, etc.., and the mindflex will supply the modulation values for whatever your current param is, modifying some base sine/triangle/square tone.

February 26 2011 at 6 AM

Eric Mika:

@Shawn: This just means the Arduino IDE can’t find the library.

It needs to be installed to ~/Documents/Arduino/libraries/Brain

You might not have a libraries folder, in which case you will need to create it.

Why are you building Arduino from source? Why not just download the pre-compiled package?

February 26 2011 at 3 PM

YESSS thank you! we have data! data looks pretty good, too. I knew it was just a dumb directory issue. I'll keep you updated upon completion of my synthesizer! you are getting credit in the application.

February 26 2011 at 6 PM

Eric Mika:

@Dan and Noega33: Those errors are not important. You can ignore them. I’ve tested the system wirelessly with XBees and it works fine, never tried Bluetooth. I don’t see any reason why it shouldn’t work. What are you seeing in a serial monitor through the Bluetooth connection? If you’re getting data there, I would suspect it’s a matter of selecting the correct serial port in Processing (see Serial.list()). If you’re not getting data in a serial monitor, then I’d suspect the hardware configuration.

@Chris: Sure, it’s a digital signal, the Arduino could be anywhere. Probably even better from the MindFlex’s perspective if it’s not mounted on the headset.

I’m not sure about your definition of real time data. The Mind Flex sends a bundle of data every second reflecting measurements taken over the last second. It does not send any real-time wave data. But if you consider data up to one second old as “real time”, then you are getting real-time data of one kind of another front it.

I’m not familiar with edf format, but it looks like multi-channel raw wave data, which isn’t something you can get from the Mind Flex. (But I could just be misreading the format.)

February 28 2011 at 11 PM

http://kbcarte.wordpress.com/2011/03/05/fun-with-mindflex/

I used your BrainLibrary and the SerialOut example.

March 5 2011 at 8 PM

noega33:

Erik,
Thank's for the answer.
But after many hours of different tests, I droped the Processing program and I rolled my own Visual Basic 6 program.
It works perfectly
I can visualise all basic data (Signal, Meditation, attention, EEG band power, etc, etc) using an .OCX called Graphlite that I modified.
I also modified the TGAM1 board in the Mindflex to get the raw data (512 values).
The issue I have is that, when I apply a FFT to the signal, I don't get any close to the EEG power bands as computed by the module.
As anyone already tried to match the computed module values with you own FFT computation?
My configuration is:
Mindflex Headset (I modified the TGAM1 BR1 strap to get raw data, using http://wearcam.org/ece516/neurosky_eeg_brainwave_chip_and_board_tgam1.pdf

document)
BTM-182 Bluetooth module (configured at 57600 bauds)
Visual Basic 6 program running on ACER Aspire 5502WXMi

Cheers

March 8 2011 at 5 PM

Marleen:

Dear Erik,

I've got my mindflex and I am testing it with my arduino, it works great!
I only have a small problem, I still receive values when I am not wearing the mindflex, do you know what can cause this?

Thank you very much in advance!

Marleen.

March 14 2011 at 4 PM

Marleen:

Dear Erik,

I've got my mindflex and I am testing it with my arduino, it works great!
I only have a small problem, I still receive values when I am not wearing the mindflex, do you know what can cause this?

Thank you very much in advance!

Marleen.

March 14 2011 at 4 PM

kaps:

hi eric

thanks for the brilliant hack.

I soldered the t pin and the gnd pin as given in your post. Then i tried it using it with console. It worked fine for one or 2 times then it stopped working and now the arduino code is also not working with arduino.

And now the console is saying "switch on the headset" even if the headset is on. Can you suggest any way to check that if the headsets are fine or not.

March 19 2011 at 3 AM

I read the Neurosky overview document. Inspecting the waveform comparisons, it clearly involves a high-pass filter that heavily cuts off the low frequencies. This prevents the signal from drifting beyond the limits of the ADC. This is OK. The authors of the overview document attribute the extra cointents in low frequency in the comparison system to long leads, praising their own system avoiding this hurdle. They are clearly wrong. Their device clearly heavily filters out the low frequencies, which returns the signal quickly toward zero whenever it tends to drift. With eye blinks, the Neurosky system thus does not reach as high peaks and when the eye lid leaves the cornea and the signal returns toward zero, the Neurosky follows the downward change which, along with the accumulated compensating shift toward zero, results in a negative overshoot. All this is quite acceptable for EEG neurofeedback. A least one professional system does this.
The reason I wanted to describe this, is to document that the system is not pure imagination or dream, as Silver84 is inclined to believed. Eye blinks behave just as expected. The John-Dylan Haynes "demonstration" is not faulty. It conclusion is. Yes, these systems can collect noise, so the game can reflect noise. But with good contact, not just at the forehead but also at each ear, its signal will essentially be real biological signals, including artefacts from eye blinks or eye movements and from muscles (e.g., frowning). Avoiding these should leave the signal as mostlt from brain origin, i.e. bona fide EEG.

March 25 2011 at 1 PM

plumberpenguin:

noega33 mentioned the BR1 strap for raw waves which I would assume would be what the MindSet does, anyone been able to get this working, and would it provide a faster response time? One second is kind of impractical for musical purposes among other things

March 25 2011 at 5 PM

Dan Paspisil:

I have been learning a lot about EEG in school lately. I did the hack and got the values and it doesn't seem to be reading anything of significance. Alpha should consistently go up dramatically when the eyes are closed, it doesn't. I have used other single electrode systems that have easily picked this up. To boost signal I used alcohol wipes, EEG abrasive cream, and then EEG conductive paste, these all made no difference. I am not sure if I am doing something wrong. The only thing of significance I could get is that the meditation value stayed much higher when I changed the electrodes position to the back of my skull (where alpha waves would be much stronger) but Alpha values themselves did not seem to consistently change with open and closed eyes. Does anyone know of any tips or tricks to get real values out it?

March 27 2011 at 3 PM

McEEG:

I've Identified the RF modules that the MindFlex uses. They're both RF24DT-10DSUJ modules made by ELAN Microelectronics. It uses their EM198810 transceiver chip.

Google for datasheets; there appears to be one for the module, and one for the transceiver chip, but you'll also likely need the 3 application notes for the transceiver.

At this point I've no idea if the MindFlex transmits all the data seen on the EEG module of not.

Cheers.

March 28 2011 at 10 PM

puiutz777:

Hey, i'm very interested about EEG, and this toy,too. Can you tell me where i find the document Neurosky overview?Do you know what are the exactly values of the signals for the 5th levels on the console?Do you know the algoritm they use to filter the signals or the algoritm which they calculates the value of the power for the motor?

April 1 2011 at 3 AM

puiutz777:

How about controling the console with your PC?Have you tried to connect some how the PC with the console?It will be very interesting to controle the ball with your PC.How can you connect the wireless receiver on the console with PC wireless transmitter?
PS: sorry for posting twice...

April 1 2011 at 10 AM

im having some problems with the mindflex.

the hardware part is configured, but when the first number in the character set is suppose to drop to " 0 ", it continues on to 200 without any change. it seems wearing it or not doesnt show any difference in number variations.

i tried to run the processing sketch, and when i turn off then on the mindflex itself, the data is visualized for 5 seconds, then drops right out.

im not sure how to fix this signal issue. thanks ahead

April 2 2011 at 3 PM

hirotami:

thank you very much for these detailed instructions! i'm very new to arduino and am trying to scale this up for a project. our goal is to use the mindflex (actually 2 mindflexes) to make a multiplayer game in which we proportionally drive computer fans with speed controllers with a ping pong ball in the middle for an inverse-tug-of-war-esque game. i was wondering if anyone could give me suggestions on running two headbands into the same arduino and converting the string of data into an output for the speed controller, and whether or not this would require a shield.

thank you so much for your time!

April 2 2011 at 5 PM

Noega33:

In response to plumberpenguin post:

When you read raw wave values, you get 512 readings that represents 1 second of recording;
If you add processing time and tranfer time (about one more second), you get one complete set of data every 2 seconds
Bottom line, getting raw waves slows down the cycle from one set of data every second to one set of data every two seconds seconds. So it is not faster

I have posted raw data curves on Neurosky blog at:

http://developer.neurosky.com/forum/viewtopic.php?f=2&t=165

Cheers

April 5 2011 at 8 AM

hardboiledeeg:

Hey all,

I'm a PhD student working with EEG with a casual interest in hardware hacking/EEE etc. I've had one eye on the commercial EEG hacking scene for a while, and so far it seems that it would be really useful to have a source for (reasonably) expert information on the biophysical basis of the signals these types of devices are tapping. I'm planning to start a blog which aims to give a decent description of the origin of EEG signals and the problems inherent in recording them, aimed at everyone with an interest in the area, but lacking enough knowledge to break through the jargon barrier which is such a problem in the cognitive neuroscience literature.

I've only had enough time to read through a small proportion of the replies here (will go through the rest as time allows), but I'd be really interested to hear from anyone who has questions about any technical issues (if nothing else, just to gauge interest/find out what people want to know). I'd also love to hear from Milareepa and epokh if you guys are interested in contributing, as you guys seem to span the academic/hacker divide.

Get me at benseviltwin_...AT..._googlemail DOT com

April 6 2011 at 8 PM

Such a gratThe EEG’s aren’t really a fun process at all, but they do help in diagnostics! Feel free to email me anytime you want if you ever want to chat.. kind of cool.. I just clicked on a random link and find someone in Maine! , I’ve never had the pleasure of having my head bandaged like a brain surgery patient, while recording my every muscle twitch before. EEG, first developed for testing epilepsy, is most certainly not a quick method and most likely not an effective way to understand emotion in users. Firstly, the practitioner needs to understand the science behind the tool. It can be a very in-depth discipline, so it is crucial that any study is implemented by a professional researcher who is an expert in cognitive neuroscience as well as psychology. EEG is not a technique that will give the clear black and white results that the industry wants. In the analysis of data, the research must make a lot of deductions when interpreting the results. It is not a test that gives conclusive results on its own, but it can offer useful indicators of emotion, the key being the mapping of the results to particular emotions. this is very helpful information. I appreciate your work. Thanks for sharing..

April 20 2011 at 2 AM

Biiig thanks, this is really funny. At least it saved my Mindflex from the dust-death :)

April 29 2011 at 12 PM

puiutz777:

Dear BCI2000 Users,

please excuse me for posting off topic.

Prof. Kübler at Würzburg University (Germany) is offering a PhD or postdoc postion. Please find the full offer below.

Regards,
Ruben Real

__________________________________________________________________________
We are seeking a PhD-student or post-doctoral researcher interested in the development and evaluation of EEG based paradigms for the detection of consciousness in non-responsive patients.

This is an excellent opportunity to work within an international environment and to foster one?s interest in research on EEG, brain computer interfaces (BCI), and cognitive functions. The group is tightly integrated with several international research programs (e.g. Tools for Brain Computer Interfaces, www.tobi-project.org, DECODER, www.decoderproject.eu).

The appointee will have a master?s equivalent or a postgraduate degree (PhD) in Psychology, Neuroscience, Biology or a related scientific subject. Applicants from other backgrounds are also welcome and should provide documented expertise in one of these areas. Above all, a strong interest in multidisciplinary research and a willingness to travel to other labs is required. The position leaves room for developing and pursuing own ideas and paradigms.

The post can be either part- or full-time and is available as of now for a minimum duration of 2 years (extension highly probable). Salary corresponds to TVL-13.

Informal inquiries to be sent to Professor Andrea Kübler, andrea.kuebler@uni-wuerzburg.de (phone: ++49-931- 31-80179).

The University of Würzburg aims to increase the number of women in science and thus, strongly encourages qualified female scientists to apply. Applicants with disabilities will be favoured in case of equal qualification.

Details
Successful applicants will develop and evaluate EEG-based paradigms for the detection of consciousness in non-responsive patients. Paradigms have to be sensitive for different cognitive tasks and depth of information processing, ranging from simple signal detection to higher cognitive processes from which the degree of consciousness can be delineated. Paradigms must be independent of motor control and be highly sensitive. The applicant will collect data with healthy subjects and patients in rehabilitation centres around Würzburg. Research results will be disseminated in the form of conference presentations and scientific publications.

Selection Criteria
The appointee will have a master?s equivalent or a postgraduate degree (PhD) in Psychology, Neuroscience, Biology or a related scientific subject. Applicants from other backgrounds are also welcome and should provide documented expertise in one of these areas. Above all, a strong interest in multidisciplinary research is required.

The successful applicant will fulfil the following criteria

Essential skills include the ability
* to collect EEG data. Postdoctoral applicants must be able to analyze and interpret EEG data (including event-related potentials).
* to manage, manipulate and analyze datasets including behavioural data
* to conduct multivariate statistical analyses
* to search and review scientific information on EEG, consciousness and cognitive functions
* to work in a multidisciplinary team
* to work independently

The applicant should be willing to work with patients with severe disorders of consciousness, their families and caregivers.

Attributes
The applicant
* is interested in EEG, cognitive functions and disorders of consciousness
* shows an enthusiasm and conscientiousness for the work
* is willing to travel to project partners across Europe
* is able to organize own work
* is able to work in a team
_______________________________________________________________________________

--Ruben Real, Dipl.-Psych.
Professur für Interventionspsychologie am Lehrstuhl für
Psychologie I - Biologische Psychologie, Klinische Psychologie und
Psychotherapie
Marcusstr. 9-11
97070 Würzburg

office: ++49-931-31-80853
mobile: ++49-179-7500594

_______________________________________________
bci2000users mailing list
bci2000users@bciresearch.org
http://bciresearch.org/mailman/listinfo/bci2000users_bciresearch.org

May 3 2011 at 7 AM

garrett:

Just wanted to say thanks for the excellent Tutorial and accompanying code. Just got the hack working here and it only took like 30 minutes! Couldn't have done it without your breakdown as I am not an electrical engineer, just a tinkerer. Thanks again and will definitely credit your work in anything I end up using the headset for.

May 16 2011 at 3 PM

Skater:

Thanks for all this great work guys! I had a question about the notch filter. I've read through the TGAM-1 spec sheet but it was not very clear.
h__p://wearcam.org/ece516/neurosky_eeg_brainwave_chip_and_board_tgam1.pdf

What Hz setting is my notch filter on my headset set to if it looks like this (image attached):
http://dl.dropbox.com/u/24421073/IMGP0976_cropped.JPG

Can I change it easily by just a solder join or do I need to move that resistor?

Thankyou

May 26 2011 at 9 PM

noega33:

Hi Skater,
Your straps configuration is the same as the one in the TGAM1 spec document.
You are configure to operate in a 60Hz environment, if you need to reconfigure to 50Hz environment you will have to move the M strap to the other side (as I did it). In other words, after you are done, all 5 straps will be configuerd similarly (all on the same side)
You cannot just put a solder joint, the strap, is in fact a 1000 ohms resistor What I did is to use a bigger size SMC resistor to ease soldering
Good luck
noega33

May 28 2011 at 9 AM

Karan :

Guys, I am having a minor problem with this amazing project.
My serial output reads fine, except that every alternate line,
it reads
ERROR: Checksum

Can someone please tell me how to get rid of this ERROR ?
Also, I had a question. Is there a way to increase the rate at which these values are coming in ? Or are they limited by the mindflex device ?

Thanks in advance

Karan

June 8 2011 at 12 PM

Karan :

In relation to the above problem, I'm also having truoble with the
processing code. The connection goes to RED as soon as I start the mind flex,
and I cannot see the graphs.

I get some WARNINGS like -

Jun 8, 2011 12:24:07 PM controlP5.ControlP5 checkName
WARNING: Controller with name "showGraph" already exists. overwriting reference of existing controller.
Jun 8, 2011 12:24:07 PM controlP5.ControlP5 checkName
WARNING: Controller with name "GRAPH" already exists. overwriting reference of existing controller.
Jun 8, 2011 12:24:08 PM controlP5.BitFontRenderer getWidth
WARNING: You are using a character that is not supported by controlP5's BitFont-Renderer, you could use ControlFont instead (see the ControlP5controlFont example).

Has anyone encountered these warnings before?

Any way I can get rid of these ?

Please assist on the this.

Thanks guys.

June 8 2011 at 1 PM

Karan :

Guys,

I got rid of the ERROR in the arduino sketch by commenting the line
Serial.println(brain.readErrors());

But I still cannot get the Processing Sketch to work.
The data shown by the Arduino Serial Window looks fine.
I do close it before running the processing code. But still no luck.

If this might be problematic, can someone suggest any other way I can plot these data as a graph in real time using some other software ? or some other code ?

Sorry but I'm really not good at Programming, I just wanted to see
how the graphs change when I'm multitasking, or playing games, or meditating.

Thanks

Karan

June 8 2011 at 4 PM

Karan:

Guys,

Sorry for posting yet again,
But just letting you know that I am using the correct COM port in the processing sketch. Mine is COM4 which is 3rd in the list, so I use list[2] in the code.
I really don't know what is going on.
Another Question, Can we use these serial values while they are coming in?
For example, if the meditation value is too low, blink an LED, or change colors of
RGB LED based on Concentration Values ? Something like that ?

Thanks

June 9 2011 at 2 PM

Eric Mika:

@Karan, are you on Mac or WIndows or Linux? I ask because I have seen some issues on the Windows version of Processing where white space is not completely stripped from the incoming serial data, preventing the visualizer from parsing the data properly. This might be the issue.

What does the simple Processing program below print to the console? It should look basically the same as what you’re getting in the Arduino serial monitor.

  1. import processing.serial.*;
  2. Serial serial;
  3.  
  4. void setup() {
  5.   println(Serial.list());
  6.  
  7.   // change the [0] number below to match the serial
  8.   // port you’ve connected the Mind Flex to, per the
  9.   // serial list printed above
  10.   serial = new Serial(this, Serial.list()[0], 9600);   
  11.   serial.bufferUntil(10);
  12. }
  13.  
  14. void serialEvent(Serial p) {
  15.   // spit out whatever’s coming in over serial
  16.   println(p.readString());
  17. }

If this looks correct, then I don’t see why the visualizer shouldn’t work. Just make sure to set the [0] number in Serial.list()[0] to whatever works in the above sketch in the actual visualizer code.

Not sure what you mean about using the serial values while they are coming in. Once they’ve come in over the wire, they’re yours to do whatever you’d like. And sure, you could use it to blink an LED or change the color of an RGB LED. That’s the whole idea. (Although for this use case you would probably just use the Arduino code, not the Processing visualizer.)

June 11 2011 at 7 PM

Karan:

@Eric,

Thanks a lot. After much efforts, the Processing Graph is working.
Although, there is one problem still pertaining.
I cannot seem to get the connection status to be green all the time.
Most of the time it's "Yellow". The Numeric Value for the connection quality reaches at best 26 and then rises again. Because of this, the Attention and Meditation Values are most of the time sitting at 0.

Is there something I could do to ensure better connection ?
The other data graphs correctly. But Attention and Meditation are crucial.

Thanks

Karan

June 13 2011 at 11 AM

Karan:

Got It!!!

3 Things to do for a stable "0" Connection

1. Saline Water/ Alcohol Swabbing on Parts Ear lobes and forehead
2. Try testing this system in a "cleaner" (Place with little Electromagnetic Interference from other devices.)
3. Ground Yourself - Touch USB Metal Jacket or Remove Footwear.

Thank for the Great Project Eric.

Will credit you and let you know with what I end up doing with the Setup.

Karan

June 13 2011 at 1 PM

Just finished building it! Its funny, I thought I had a great idea to build this for lucid dreaming research, but after reading the comments I see just how unique of an idea that is...

Anyways, thats for the awesome work you did!

July 3 2011 at 11 AM

SpecTrum:

Cool project!
The Mindflex of the Sega Toys has the ThinkGear chip? I can do the project with him?
Thanks.

July 19 2011 at 4 PM

johnf:

Michael A. Persinger -- God helmet
www.rexresearch.com/persinger/persinger.htm
This practitioner uses "rotating magnetic field" stimulation at very low intensity, applied at the Temporal areas. Given a susceptible type of subject in a sensorily deprived blindfolded state,sensations such as ecstacy and hallucinations are produced.
The system requires EEG input to a computer which applies appropriate timed and graded pulses to DAC and solenoids. Reference is made to a subject who had been able to detect the pulses from a bedside clock--producing weird dreams.

July 21 2011 at 5 PM

Kim:

Hey guys

I'm kind of stuck at the very beginning stage of this project.
I've dragged 'BRAIN' folder into finder-document-arduino, but can't see 'BRAIN' example on arduino examples. it just comes as sketchbook, not as an example.
Does anyone could help me out with this?

arduino says, 'brain' does not name a type

BrainSerialOut.cpp:5:19: error: Brain.h: No such file or directory
BrainSerialOut:7: error: 'Brain' does not name a type
BrainSerialOut.cpp: In function 'void loop()':
BrainSerialOut:18: error: 'brain' was not declared in this scope

Thanks in advance!

Kim

July 25 2011 at 10 AM

Eric Mika:

@Kim:

You’re one folder short… the Brain folder needs to go in ~/Documents/Arduino/libraries, and then restart that Arduino IDE.

More info: http://www.arduino.cc/en/Reference/Libraries

July 25 2011 at 10 AM

Kim:

@ eric

Thanks a lot!
To import a new library, which one I should choose among the 10 standard libraries? :s

July 25 2011 at 11 AM

Kim:

@Eric

I sorted that problem out well, thanks again. and stuck with the processing error at the moment, it says 'The package 'controlP5' does not exist, you might be missing a library'

and at the bottom window of processing, it says No library found for controlP5
As of release 1.0, libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.

could you help me out with this error?
Thanks in advnace!

July 26 2011 at 6 AM

Eric Mika:

@Kim. Install the Control P5 library.

July 26 2011 at 9 AM

Kim:

@Eric

all sorted out! thanks so much, btw it is just amazing!!!!!!!!!!!!

July 28 2011 at 1 PM

Paul Klemstine:

I just mounted a Teensy Microcontroller inside my MindFlex handband. The Teensy fits perfectly inside the case, I only had to Dremel out a little hole to plug in the USB cable. The 5 volts from the Teensy powers the headband.

The Teensy code is mostly the same:

#include

HardwareSerial Uart = HardwareSerial();
Brain brain(Uart);

void setup() {
// Start the hardware serial.
Uart.begin(9600);
Serial.begin(9600);
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);
}

void loop() {
if (brain.update()) {
Serial.println(brain.readCSV());
}
}

August 4 2011 at 11 PM

Dave:

I followed the instructions in the hack and am able to log the EEG data from over the serial monitor using some relatively simple processing code. However, I'm concerned that the data I'm getting isn't accurate: while going about daily activities at work wearing the headband, all the test subjects are giving off enormous amounts of delta waves and much smaller amounts of the other wavelengths. Has anyone else been experiencing this issue? I feel like I shouldn't be generating deep sleep waves while wide awake and working on stuff...hopefully I'm not sleepwalking through my day or something!

Thanks!

August 19 2011 at 4 PM

fjord:

i got the same problem as josh. when i open the serial monitor there is no data. i checked the headset with the mindflex game and it works, so i did not destroy it.

any ideas what i can try? maybe my soldering is bad, but how would i check that? i don't have much soldering experience, but usually it works.

August 28 2011 at 7 PM

infrax:

@Eric

I am getting following errors when I try to run the visualizer:

brain_grapher:-1: error: variable or field 'serialEvent' declared void
brain_grapher:-1: error: expected `)' before 'p'
brain_grapher:0: error: 'import' does not name a type
brain_grapher:1: error: 'import' does not name a type
[...]
brain_grapher.cpp: At global scope:
brain_grapher:105: error: variable or field 'serialEvent' declared void
brain_grapher:105: error: expected `)' before 'p'

I am using Ardunio Uno and new to arduino programming. I extracted ControlP5 in the "Arduino/libraries" folder, but I get the same errors. I tried changing the index in serial = new Serial(this, Serial.list()[0], 9600); but errors remain.

Please suggest me a solution to get the visualizer running...

September 4 2011 at 4 PM

Eric Mika:

@ infrax The visualizer runs in Processing (Java), not Arduino (C++). Try running it in Processing.

September 4 2011 at 5 PM

miguelvmonroy:

I have a big question.
I could now get on my arduino board this file using USB BrainSerialOut.pde

My toy is a Star Wars force _
My toy has two wires

TOY

Red - T
Black - GND

ARDUNO
Red - RX
Black - GND

and then I turn on my toy and see the serial monitor

and the serial monitor is not any information.

My preferens in this window.
No end of line <<9600>>

http://desmond.imageshack.us/Himg263/scaled.php?server=263&filename=7316...

in this image is to find the point T as soldier and connect the RX to my arduino
and then I connect the black to any GND

http://img204.imageshack.us/img204/5175/41397702.jpg

but I do not see anything

I leave here a picture of my problem

http://img845.imageshack.us/img845/3666/81666455.jpg

September 5 2011 at 11 PM

miguelvmonroy:

I have a force trainer STAR WAR

that when I connect the headset TX and RX I put the arduino and the land of the crown to the other land arduino not read any data in the serial monitor

September 6 2011 at 6 AM

adam:

Hi,

I am researching ways for me to visualize my brain waves as part of a DJ set. The method that you have put forward here seems to be cost effective and relatively un-impeding in terms of freedom of movement, and being able to wear headphones.

Can you recommend how I might be able to turn the raw "bar-chart" style signal data into a more entertaining visualization. For example, would MaxMSP be able to interpret the data?

Thanks,
Adam

September 6 2011 at 11 AM

Eric Mika:

@adam: Sure, the data’s just CSV.

September 6 2011 at 9 PM

miguel venegas monroy:

Hi Eric Mika.

you dont undertand me ?

i have that problem.

i dont connect my toys. they dont send any DATA.

:(

September 15 2011 at 8 PM

Eric Mika:

Miguel, I can’t tell anything about the quality of the solder joints from your photos. If you’re not getting any serial data, then you’ve either fried the board, didn’t solder properly, or didn’t configure and install the Arduino software correctly.

Check your work for shorts. Try the headset with the original game to see if the board is fried. Double check the instructions.

September 15 2011 at 8 PM

Paul:

Thanks,Mr. Eric Mika, Mr. Arturo Vidich, and Ms. Sofy Yuditskaya, and everyone from the Arduino community.
This looks like great fun. This is what I have done so far.
1. Downloaded the program that a. Talks to the Arduino and b. Displays the graphs of your brain waves
2. Install the program "arduino-0022.zip"
3. Unzip and Add some files to the "libraries" folder that you just previously installed, kitschpatrol-Arduino-Brain-Library-2beb7ce , processing-1.5.1-windows.zip , controlP5.zip and also kitschpatrol-Processing-Brain-Grapher-2b821ba
On the hardware side I just stuck the wires in the Arduino holes and that seems to be working. I have serial data flowing, now. Also of note, no need for a wall wart if your using USB.

I was wondering if I can use the Mindflex version of the NeuroSky chip to interface with the Mindset software and development tools. It would be great if we could work even a hobbled version as they have over 20 games and other fun applications. Just use Mindset's "Developer Tools 2.1" with the updated "thinkgear_testapp.c" ?, No? BTW: I secured my mindflex device,(sans base) at a thrift store for $1.00. $19.98 for the Arduino, Uno, ebay.

September 26 2011 at 12 PM

appie:

This is awesome.

I have a newbie question: why do you need an Arduino for this, you are tapping a serial port connection, then feed it into an Arduino program that simply relays the data to the output which then gets read on your computer. Can't you do the exact same thing with a simple serial-to-USB connector ?

Something like this (first hit on amazon for usb serial):

http://www.amazon.com/TRENDnet-Serial-Converter-TU-S9-Blue/dp/B0007T27H8...

This is not to critique your work, I am planning to get this working and don't mind going the Arduino route if needed but I just don't understand why it can't be done without one.

September 27 2011 at 12 AM

o11o:

Hello !!!!
First of all : what an amazing website !!!
Actually been workin on EEGand BCI fora whileandI have some question about the "hacked MindFlex " :
1. Since Mindflex uses Neurosky's EEG Ship : is there any possibilty to perform Neurosky's Apps with Mindflex+ arduino ?! ( Am not sure if TGAM is thesame one used in Mindflex !!).. Ifso; please show how ?§

2. Is there any chance to get the Microcontroller Exct reference also its program ?

Actually got an Idea about using Neurosky's apps.. like to copy the source cide and so in the arduino software... but still could'nt figur out how to make it work !! :(

Thanks in Advance !!
Best Regards !!
Adam

September 27 2011 at 9 AM

Eric Mika:

@Paul: I don’t have a Mindset but I think there might be some issues getting the serial data where it needs to go. (Since the Mindset connects via bluetooth.) Still, it might be possible. I’m just not that interested in any of the software.

@appie: Sure, for other projects I have written a parser in Java and just gone straight into a laptop over serial. For the project I developed this library for, space constraints made it easier to use an Arduino instead of a laptop.

@o11o: See my response to Paul regarding Neurosky apps. I don’t think I understand question #2. Good luck with everything.

September 27 2011 at 11 AM

Paul:

Thanks, Eric, Arturo, and Sofy, I saw the “mindmaster” has published specs so I was wondering if anyone know the comparable specs of the mindflex? 2 1. EEG channels (4 electrodes) + 1 DRL electrode.
2. 0.5uVp-p resolution, ca. 1uVp-p noise, ca. 256Hz sample frequency
3. Impedance mode (5 sub-modes for checking individual electrodes)
4. Auto-calibration (4 sub modes) ; Mindflex= 1. “3” electrodes , 2. unk noise(I've seen a site that check the estimated accuracy) 3. impedance UNK 4. yes I think there is. ALSO, has anyone here tried using this hacked mindflex setup with the OpenEEG-related software?

September 28 2011 at 11 AM

o11o:

Hello again ..

the #2 Q was about the microcontrollers in the circuit ( the 1st before the radio Tr and the 2nd after the Rx radio unit - wot is extly btw ( the radio transmission -UART/Bluetooth/ nordic...) === their exct reference and their "C" programs if it is possible ?! I have one omme own but dont think it works!!!
if the transmission unit on the headset ( mindflex ) is bluetooth and IF ( wow ) the EEG ship on minflex is similar to the TGAM I think it wud work for DEFO...

Thanks in advance
Best Regards
Adam

September 28 2011 at 4 PM

Shanker Raja:

Hello,

Over the past few months I have been searching for an inexpensive EEG device to control actuators, for a high school robotic project, where I am voluntering

I came across mind flex in toys are us and subsequently your website. Thsi seems like a good place to start.

Your work is excellent and informative. My fear is the raw data may be noisy. I am thinking of using the out put from the chip to train neural networks and subsequently control the acuators. I would like your advise before starting, since you have some experience in processing EG signals in general and mind flex in particular. Also would hooking up more two or more units be helpful.

Thanking you in advance.

Raja

October 8 2011 at 2 AM

I can confirm that the Neurosky MindWave can be used with this library, although I had some minor difficulty.

The MindWave uses the same ThinkGear ASIC Module (the TGAM1) as the Mind Flex. There are some minor differences, which I puzzled out with the help of the [spec sheet](http://wearcam.org/ece516/neurosky_eeg_brainwave_chip_and_board_tgam1.pdf).

I'll spare the blow-by-blow story, but here's the technical bit: the BR0 and BR1 pads on the TGAM board set the default "mode" of the TGAM, and there are three modes:

1. 9600 Baud with Normal Output Mode
2. 1200 Baud with Normal Output Mode
3. 57.6k Baud with Normal + Raw Output Mode

I will post photos on [my flickr][] later that show the TGAM board in the MindWave if you're curious. The upshot is, the MindWave is in mode 3, and you have to set your serial communication to 57600 Baud if you want to get anything from it.

The library returns "could not parse" errors. Possibly because the MindWave is returning a 10-bit raw EEG value with code 0x80 before the "EEG powers" data? That's a first guess.

That's all I've got so far: I spent a few hours last night getting the arduino to receive serial comms, got a signal, did a fist pump, and shut it down for the night before I screwed it up.

[my flickr]: http://www.flickr.com/photos/jazzmasterson/

October 9 2011 at 10 AM

Just a quick update once I've had a little while to play and confirm:

The MindWave works great with the Brain library, and I was able to use the readAttention and other calls to control servos with the MindWave.

The only thing you need to do differently is to set serial to 57600 baud rather than 9600.

October 9 2011 at 1 PM

Eric Mika:

@Josh DiMauro Awesome, thank for the information! The bit on the BR0 ad BR1 pads is golden.

October 9 2011 at 3 PM

Paul:

I have had some fun discovering what the hacked mindflex can do. To go even deeper I have been trying to connect the hacked mindflex to some free software on the web including open source EEG and Mindset Neurosky. I can only conclude the some sort of “bridge software” is needed to connect the serial data to these various free applications.
1. Think gear connector, I was able to install it and at one point it was running in the tray. However shortly after that I could not get it to start up again.
2 tried with one(above) running, no COM after a scan and errors out as -2
3. Tried with Arduino 0022 running the example program “brainserialout” When doing so I was able to get data to show on the “serial monitor” and it identified it as COM3. I even tried without the serial monitor running.
4. Tried open source “neuroserver” COM1 error, I was not given a choice to select COM3
Any ideas on what to try next? Thanks in advance for any input.

October 10 2011 at 8 PM

Arthur:

Hey,

After a good amount of tests I keep getting more Delta waves even when I'm playing FPS games, which are the opposite of sleeping. How can assure that the waves I'm receiving there are actually Delta? Also my meditation keeps on a high level on any kind of activity and the signal is green.

Any more information about the waves would be really helpful,
Thanks in advance,
Arthur.

November 6 2011 at 5 PM

Simone:

Hi,
just an information. I'd like to connect the mindflex console to an AC adapter instead of using batteries. But what kind of adapter? For sure 6V, but what about the amperage? Any idea?
Thanks in advance,
Simone.

November 16 2011 at 7 PM

MTBiker:

Why MindFlex work so unstable without console?
I get data in processing only on 10 try (and it is not always)
My sequance of action is:
-turn on the mindflex,
-push button in processing,
and nothing display therein about 30sec... maybe I wait too little ?

When I use mindflex console, connection set usually quickly... but for my project that redundantly

Can anybody give me some advices ?

November 17 2011 at 4 AM

Hello again!

I've been working on a project using the MindWave headset. Now, the linked project uses the MindWave wireless card, which is kind of a pain. Hence why I began tinkering with a hard-wired headset, as noted above.

Anyway, I have a curious problem: it takes FOREVER for the headset to get a good signal when it's wired into the arduino. Or, you know, about 90-120 seconds, give or take a forever. The "signal strength" indicator sits at 200, and 200, and 200, and then down to about 50… and then, finally, I get a good signal.

This sounds a lot like there's capacitance somewhere, probably on the shared ground and baseline electrode. That's a total guess, though.

Has anyone else seen this? I'm trying to work out where to begin troubleshooting.

November 18 2011 at 4 PM

Mohannedino:

Dear all,

Thanks for all previous valuable information ,
I worked in C# using Serial port component ,... after uploading "Arduino Brain Library" to the board , and visualize the EEG data on "C# programmed oscilloscope" like in the main project , I could not know the unit of measurement of the values that come from Arduino !
I need to know it as the values have no commas and visualizing them on XOY coordination need this unit.

any ideas here!

Thanks and best regards,

Mohannedino

November 20 2011 at 1 PM

Joe Bob Briggs:

@Eric : If I read @Josh DiMauro's comment properly, it should be possible to set the Mind Flex into a "raw + normal" output mode? Is that true?

Also: any updates on the wireless efforts? XBee is a possibility, but I am wondering if anyone has tried a smaller RF module that can fit inside the case, to make the headset easier to wear?

November 24 2011 at 6 PM

@Joe Bob Briggs:

Technically that's true, but you'll have to solder the jumpers, and they're utterly freaking miniscule. Like, there's just NO DAMN WAY I'm going to attempt it.

If you want wireless, may I suggest just using the MindWave headset itself? It _is_ wireless out of the box. And the cost difference between the headset and the Mind Flex is minimal, especially if you add a couple of xbee radios.

My efforts above were aimed at removing the wireless link for a particular project which already has wires running two and from the headset, making the wireless link redundant.

November 25 2011 at 3 PM

Alex Hatch:

Hi all!

So I have a quick question regarding reading the serial output from the neurosky chip.
First some info - I am using an arduino, but I am doing a project connecting the arduino to a cellphone via bluetooth. I have serial working over bluetooth properly, and I've set up the headset through serial. Ideally, I want to use the SoftSerial library to read the output of the headset instead of using the hardware serial, so that I can receive and transmit through the bluetooth sensor.
Question is, how would I modify the brain library to read input from a definable software serial pin rather than the default hardware serial line?

thanks for the wonderful write up, and code and support on this project, hopefully I'll be able to use it properly soon...

November 25 2011 at 11 PM

Eric Mika:

@Alex There’s a branch of the brain library on github with support for the excellent NewSoftSerial Arduino library.

November 25 2011 at 11 PM

steve:

Hi guy's, after building this everything works except the Meditation and Attention ? These are zero (0) all the time....any ideas as to whatI'm doing wrong. I get all the power bands ok (ish) as I seem to have high delta and gamma waves at the same time?

November 28 2011 at 7 PM

Mohannedino:

Hello again,

I would like to know if anyone has any information regarding my previous question,

thanks in advance

Mohannedino

December 2 2011 at 7 AM

Vincenzo Alexander :

Hello. When I try to compile the BrainSerialOut I get this error

C:\Users\Vincenzo\Documents\Arduino\libraries\Brain/Brain.h:14: note: Brain::Brain(const Brain&)
BrainSerialOut.cpp: In function 'void loop()':
BrainSerialOut.pde:-1: error: 'class Brain' has no member named 'update'

Any idea what is going on?

December 6 2011 at 6 PM

Chris Neuner:

Thanks everyone for the informative multi-year thread. I have the project functioning properly with the arduino, midflex headset and a mac running processing. Good times.

Now, I want the arduino to map the attention value data to output PWM duty-cycle. The attention value from neurosky seems to be a convenient 0-100 which correlates nicely. Seems like this should be easy.... is it?

Can anyone point me in the right direction on what would be involved in programming. I'm a programming noob so forgive me if this is painfully obvious.

If this works, I'll have a nifty gadget to tell you all about.

thanks
Chris Neuner
NYC

December 8 2011 at 1 AM

nimrod:

alrighty, got the data coming over the serial port.

now processing is mucking around:
ControlP5 0.6.12 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
11.12.2011 16:41:54 controlP5.Textlabel printConstructorError
CRITICAL: The Textlabel constructor you are using has been deprecated, please use constructor
new Textlabel(ControlP5,String,int,int) or
new Textlabel(ControlP5,String,int,int,int,int) or
new Textlabel(ControlP5,String,int,int,int,int,int,int)
instead. The Textlabel with value 'Attention' is disabled and will not be rendered.
Exception in thread "Animation Thread" java.lang.NullPointerException
at controlP5.Textlabel.setFont(Unknown Source)
at brain_grapher$Monitor.(brain_grapher.java:497)
at brain_grapher.setup(brain_grapher.java:84)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
[0] "26"
[1] "63"
[2] "70"
[3] "2692792"
[4] "229325"
[5] "419259"
[6] "22477"
[7] "232526"
[8] "181592"
[9] "44865"
[10] "10882
"
another version issue? i hate the arduino/processing IDE, always did.

December 11 2011 at 11 AM

nimrod:

processing results above do occur in current pre alpha as well as in current stable release 1.5.1. gee. who is gonna port it? :)

well, what u can do is, just comment out the setfont attribute for new textlabel. it only occured twice for me and raised an null pointer exception. after commenting out, the graph works fine, im still trying to interpret it though ^^.

excellent job, thanks for your support.

December 11 2011 at 12 PM

J. Koomen:

Hi, great hack! I want to use the software for my emotive brainwave reader. I have floats for all the emotions, and I want to connect these to the graph. How should I replace the values?

example:

Float excitement = 99;

So I want excitement to be assigned as a bar. Can you give me and example on how to change this?

Thanks in advance.

December 11 2011 at 5 PM

Eric Mika:

@All: Arduino 1.0 includes some changes that break existing libraries. (Seems a bit aggressive of them!)

So, to anyone having trouble with “No such file or directory” and “____ does not name a type” errors from the Arduino IDE, check Github for the latest code which includes a fix.

December 17 2011 at 2 AM

Chris:

This is all very cool. I will order the uber head set form neurosky. I train CEO's and the last one simply failed due to attention. I am always wondering if something like this would create a feedback for training executives.

January 3 2012 at 5 PM

Blane Parker :

Whenever I load the code into my arduino (mega) my serial monitor is blank, and when I run the visualization software and run it, it says that that I am missing conttrolp5, where does this file go.

January 4 2012 at 5 PM

Hokurai:

Alright. Well, I have it working... Except for the visualizer. The serial monitor is reading the data fine. The processing is compiling fine with a few warnings (after downloading and placing controlp5). But when it shows up with the grapher, it's blank and stays blank. Any fix for this?

January 6 2012 at 4 PM

Eric Mika:

@Hokurai: Is Processing set to use the correct serial port?

Check my previous comment for a simple Processing serial test case, play with the index on Serial.list()[0] until you’re seeing the same thing in Processing that you’re seeing through the Arduino serial monitor.

January 6 2012 at 5 PM

Hokurai:

I was thinking the same thing with the serial port but I could not figure out how to set the serial port and I didn't see the serial monitor. I'll play around with it later.

January 6 2012 at 9 PM

Hokurai:

Alright, I got my port changed and now I'm getting a packet too long error but it is otherwise working.

January 7 2012 at 12 AM

Hokurai:

So... Yeah. Anyone seen any other tools floating about for this? I might have a few ideas on projects I can do using this.

January 7 2012 at 1 AM

urbnmnky:

Maybe I am just tired, but I am having problems getting the visualization part to work. I finally got the controlP5 library to be recognized by Processing, however, when I try to run the brain_grapher.pde example, I keep getting the error,

Cannot find a class or type named "Channel"

This occurs on line 9;

Channel[] channels = new Channel[11];

Any thoughts?

January 18 2012 at 1 AM

Eric Mika:

@urbnmnky You have the Channel.pde file? It’s showing up in a tab in Processing when you open brain_grapher.pde?

January 18 2012 at 11 AM

This is a great hack. I found a Mindflex duel (comes with 2 headsets) for $30 at target :) One headset didn't get a connection below 26, so I tried the other headset and get 0 consistently, so people with connection problems it could be the headset unfortunately :?.

What worries me now is that the values seem pretty random, I can't consciously change concentration or meditation values at all. At this point now I'm considering grabbing a Mindset or Emotiv epoch, because after getting a taste with this hack the possibilities seem awesome.

January 21 2012 at 11 PM

Eric Mika:

@Loktar: Thanks! I’d be wary of the MindSet if you’re underwhelmed with the accuracy of the Mind Flex. It probably user a very similar chipset / DSP to the Mind Flex.

I’ve never worked with the Emotiv. Interested to hear if you have better luck with it.

January 22 2012 at 8 PM

Alexandre:

Hi Eric!

Thanks so much for this!! The arduino set up has been no problem but i'm new to processing and could use some guidance ( so far I have overcome the RXTX mismatch).

Your nice sample code below showed me that [2] corresponds to the COM5 that my arduino is reading in on, but after it prints the list of [0] to [2] nothing comes in at all, you state that I should see the csv lines? I can close processing and re open arduino and verify that packets are still being received. The second window that opens from processing is just a little grey box.

Thanks for taking the time to do all of this.

Alex

import processing.serial.*;
Serial serial;

void setup() {
println(Serial.list());

// change the [0] number below to match the serial
// port you’ve connected the Mind Flex to, per the
// serial list printed above
serial = new Serial(this, Serial.list()[2], 9600);
serial.bufferUntil(10);
}

void serialEvent(Serial p) {
// spit out whatever’s coming in over serial
println(p.readString());
}

January 24 2012 at 10 PM

Marleen:

Hey!

I'm fiddling around with the Mind Flex hack and Arduino right now and I've detached the daughter board from the motherboard and connected it directly to my Arduino. Also I have completely taken apart the Mind Flex headband and I now have 3 loose sensors also connected to my Arduinoboard. Now, it's working and receiving data from the sensors but even when they're not attached I'm receiving rates going up to about 2500000 in the serial monitor of Arduino. I was wondering if it's normal rates are still coming in when the sensors are not attached to my head? My connection is fine, around 25 - 50. Also, I'm not getting any rates from meditaion and attention. I tried the salt water and aloe vera trick but they didn't work here :P

Thanks!!

January 25 2012 at 2 PM

Hey Eric,

Amazing hack! I have coupled the Mind Flex with a JPEG camera. I record brain data and images onto the same SD card. Later processing edits the images to reflect the brain state of the user when the picture was taken! Thanks so much! Check it out http://benbergphoto.blogspot.com/2012/01/braincam.html

January 29 2012 at 6 PM

Noega33:

Hi everyone,
Since my last post (April 2011...), I did additional homework and I developped an Android application to display all power bands and continuously records Alpha data to try to improve my relaxation...
The system is made of the TGAM PCB coming from the Mindflex game. the TAGAM was removed from the game and directly connected to a BTM 182 (bluetooth module).
In order to verify if I did not have to much "electric" noise, I connected all three contacts together to simulate a "zero" signal and the result was:
all power bands were at Zero, but "attention" and "meditation" signal were not zeros.
As anyone been able to understand how the attention and meditation signals are generated?
Are they generated from power ba

January 30 2012 at 5 PM

Jacob:

I had the same problem with the poor connection quality, but I resoldered the connection to ground on the headset and it worked much better. Where is the documentation about what each error means. I keep getting a Checksum error that I don't know how to fix. I get the data, but I always get an error afterwards. I am using some delays in my code if that could affect it, but I do need the delays.

February 1 2012 at 2 AM

Noega33:

Hi,
I my case I did not have any problem with the connection.
Signal quality was good and Checksum also
My question is : How come that with all three contacts (EEG, Ref and Ground) tied together, I get no signal on the power band (this is normal) but I get "good" signals for "Attention" & "Meditation".
I was expecting Zeros for "Attention" & "Meditation".
Does anyone know the relationship between power bands and "Attention" & "Meditation".?
Regards

February 2 2012 at 8 AM

Add Your Comment