Mindflex is actually a game from Mattel which uses our brain frequency to move a ball through obstacles. The brain waves (EEG Signals) are captured using electrodes that are placed in the headband and these waves are processed to get the attention and meditation level, which is later fed to the base station via Bluetooth and uses to control the fans and the movement of the ball. We decided to take a higher-level approach by grabbing serial data directly from the NeuroSkyEEG chip and cutting the rest of the game hardware out of the loop, leaving a schematic that looks more like this:
Now I will show how to extract useful data from the mind flex headset.
Step 1 – Disassembly
Use a screwdriver and carefully open up the left casing of the headset, where the microcontroller and amplifiers are placed.
Step 2 – Intercepting the Transmission Line
If you carefully observe the board, we can see a microcontroller, an amplifier and a Bluetooth module. The amplifier is used for boosting up the week EEG signals which the microcontroller processes and send to the base station via Bluetooth.
If you look closely, you can see transmit pin (T) and a Receiver pin (R), which will be used for transmission. What we are going to do is connect a wire to the T pin and connect it to receiving pin Rx of Arduino. Take a piece of wire and solder one end to the T pin and connect another end to Arduino.
Step 3 – Common ground.
Connect the ground pin of Arduino to the ground pin of mind flex.
Step 4 – Securing all the Connections.
Use a hot glue gun to secure all the connections and make sure that the connections won’t be disturbed while it is being used.
Step 5 – Hook up the Arduino.
Connect another end of Mindflex to Arduino. Now it’s time to set up the software part. There is a library available for everyone to download which can convert the raw data of mind flex to human-understandable form. You can download the library from here.
Now Open BrainSerialOutexample, select your board and port, compile the code and upload it to your board.
The Output
Once the code is uploaded, open up the serial monitor. If you have done everything correctly, you will see the data being populated in the serial monitor.
About the Data
Depending upon our thoughts and state of our mind, the frequencies of our brain waves vary. Below is the classification of brain waves based on their frequencies.
• Delta (1-3Hz): sleep
• Theta (4-7Hz): relaxed, meditative
• Low Alpha (8-9Hz): eyes closed, relaxed
• High Alpha (10-12Hz)
• Low Beta (13-17Hz): alert, focused
• High Beta (18-30Hz)
• Low Gamma (31-40Hz): multi-sensory processing
• High Gamma (41-50Hz)
This Neurosky chipset outputs eight values depending upon the amount of electrical activity at different frequencies. Based on these values, neurosky calculates and outputs the value of “Attention” and “Meditation” which will be used to control the ball in the game.
• Attention level denotes the intensity of the player’s mental focus. Focusing on something or doing mental calculations can increase the concentration level and lack of concentration like wandering thoughts can decrease the attention level.
• Meditation denotes the player’s mental calmness.
Visualize
To get an awesome graphical representation of the data, you can download Processing, download the graphing code from here, and open up brain_grapher.pde in Processing. Turn on your mind flex, run the sketch, sit back and enjoy your brain waves.
What to Do Next?
I have used this to make a wheelchair that can be controlled using thoughts. Click Here to know-how. See you on the other side.