Fun With MindFlex

For this valentines day, my wife got me a MindFlex from Mattel. I have been wanting one of these since they have been on the market. It is a really interesting game where you control a foam ball with your mind. The ball will rise with the more focused you are. Letting your mind wonder and as Morphius likes to say “free your mind”, the ball will lower.

MindFlex doesn’t read your thoughts, rather it picks up on level of activity. There has been fuss about the legitimacy of how this thing works. The popular video of it being placed on a foam head with a damp cloth gives readings. If you would do the same with a medical grade EEG, you would receive random values.

MindFlex uses a NeuroSky chip to compute the brain data. You can have 8 channels of raw wave activity:

Along with connection quality, and the proprietary attention and meditation values.

Inspired by Eric Mika’s post, I set out to replicate and extend his project. He wrote a library to get the data using an Arduino. He also wrote graphic software to aid in the visuals of the activity in your mind.  Eric go’s into better detail about the data the chip gives off. He has a video about the hardware hack, and it is very informative.

Basically, you need a shared ground and a wire extending the Tx pin for the NeuroSky chip circuit. Using images from this teardown of the MindFlex I point out which pins they are. This is in the left pod of the headset:

Ground
Tx Pin

I have affixed the Arduino to the headset using Velcro, opposed to zip ties. Also I have noticed it is better for the usb port to be facing the back of the head when you wear it. This keeps the cords away from your face. Here are some pictures of the finished mod:

Top View
Front View
My Inspector Mazy, she aproves.

After copying the BrainLibrary into the Arduinos lib, I loaded the BrainSerialOut example that came with the library, I immediately  got python reading from the COM port. The data comes as a string containing 11 values: signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma.

When the signal strength is at 0 it is at its strongest. The next two values are the ones I am interested in. If the signal strength isn’t strong enough, you will not get the attention or meditative values.

The next step on my list was to make this data available to what ever can handle sockets like Blender, Android, Iphone, and I think Flash can even handle sockets.

I wrote a server in Python2.6 to forward the data to any connection. It takes the headset a few seconds to give good data. I have also noticed, the connection signal can be finicky.

import serial, sys, socket

s = serial.Serial('COM8')

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('',1002))

while 1:
 sock.listen(5)
 conn, addr = sock.accept()
 while 1:
     try:
         sread = s.readline()
         conn.send(sread)
     except:
         print "connection at %s lost" % addr
         break

Next was to write a quick game using my new toy. I chose PyGame because it was easy to get going quickly. I plan to switch to 3d when I have the time for it. The game uses the attention value to light a match. There is also a bar on the left side representing the activity in the users mind. Future work includes snuffing the flame with meditative values.

11 thoughts on “Fun With MindFlex

  1. im having a problem with the signal strength. it begins to fluctuate only when i reset the mindflex for 4 seconds…. then consistantly stays at 200…on or off my head.

    any suggestions?

    1. Check all batteries, reposition the headset, or clean the nodes.

      Some people have a really hard time getting the signal strength, my wife couldn’t hold a steady signal either.
      Have other people try it and see what kind of results they get.

    1. I haven’t tried. But in the image labeled “Ground”, there is a small module that looks like the radio for the wireless. You might be able to figure out something there.

  2. hey there. you seem VERY knowledgeable about this game. If you can help, I’d appreciate it. We just bought this for our daughter for Christmas. She was SO excited. We went to go play and the headset will not calibrate when she has it on. It does w/my husband. I have yet to try myself, but I’m afraid it’ll work and she’ll be even more bummed out that it doesn’t work for only her–it’s her gift! She’s SO disapointed and we’ve jiggled, and adjusted and switched on and off. Not sure what else we can try.
    Any suggestions??

    1. You can try to clean the pads on the headset and also where they will be placed with alcohol. Make sure fresh batteries are in the base and headset.

      As a last resort you can put it on someone it works on, then put it on her. I’ve noticed at times mine wouldn’t work until I wore it a little bit. It was selective with my wife too.

      The only downside is it’s not “guaranteed” to work with anyone. Just make sure her mind is engaged while trying it out.

      That’s about the best advice I can give. You can try the StarWars Force Trainer also. Not sure if made by Mattel, but they both us NeuroSky chips so it’s authentic EEG.

      Good luck.

  3. sir
    When doing project with mindflex headset i faced problem in getting the data at serial monitor after soldering .I have used ground connection from the near the T pin …
    It is the project shown here : http://frontiernerds.com/brain-hack
    when it is time to start getting data in serial monitor it just shows nothing…
    i double checked the connections i soldered and everything is good…
    the code is this :

    // Arduino Brain Library – Brain Serial Test

    // Description: Grabs brain data from the serial RX pin and sends CSV out over the TX pin (Half duplex.)
    // More info: https://github.com/kitschpatrol/Arduino-Brain-Library
    // Author: Eric Mika, 2010 revised in 2014

    #include

    // Set up the brain parser, pass it the hardware serial object you want to listen on.
    Brain brain(Serial);

    void setup() {
    // Start the hardware serial.
    Serial.begin(9600);
    }

    void loop() {
    // Expect packets about once per second.
    // The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format:
    // “signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma”

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

    I used Roboduino–arduino-1.0.1

    Please help in solving this issue.

Leave a Reply