Monday, February 3, 2014

mind flex out eeg data details

Posted by rinson
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.
Read More

serial eeg csv data form mind flex dual head set on arduino ide serial monitor

Posted by rinson
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.
Read More

Load up the Arduino with mind flex code for serial data out

Posted by rinson
Download and install the Arduino Brain Library — it’s available here. Open the BrainSerialOutexample 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
  2. // Set up the brain parser, pass it the hardware serial object you want to listen on.
  3. Brain brain(Serial);
  4. void setup() {
  5.         // Start the hardware serial.
  6.         Serial.begin(9600);
  7. }
  8. void loop() {
  9.         // Expect packets about once per second.
  10.         // The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format:
  11.         // "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma"   
  12.         if (brain.update()) {
  13.                 Serial.println(brain.readCSV());
  14.         }
  15. }
Read More

software.for The data from the NeuroSky to computer

Posted by rinson
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 themindset_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 niceASCII string of comma-separated values.
Read More

Mind Flex’s connection with Arduino.

Posted by rinson
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.)

Read More

Strain relief and wire routing.to arduino

Posted by rinson
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.

Read More

Arduino will want to share ground with the Mind Flex circuit

Posted by rinson
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.
Read More