Arduino Neurosky brain wave (EEG) library

Users of the Neurosky EEG brainwave sensor devices will be glad to learn that there’s an Arduino library for reading data. “Brain is an Arduino Library for parsing data from Neurosky-based EEG headsets. Tested units include the Star Wars Force Trainer and Mattel MindFlex.

It’s designed to make it simple to send out an ASCII string of comma-separated values over serial, or to access processed brain wave information directly in your Arduino sketch. See the examples for code demonstrating each use case.”

Instructions for the hardware-end of this hack are available from FrontierNerds. The library code is posted on GitHub.

Join the Conversation


  1. We hacked a mindflex too, but we stuck a bluetooth serial module inside and that’s it. Wireless control, no hassle and not having your head potentially connected to mains earth.

  2. AOA,
    I want to make thought control robot, mean if i think forward robot will move forward if i think left robot will move left, i want to know that the interface of mindflex with arduino will work for my project which i want to do???
    inform me on my email:

  3. +Abdul It’s not that simple, the EEG can give you only info on electrical signals (and some precalculated frequency data of those signals, but you could do the frequency calculations yourself too). It cannot know what you are thinking, some of the frequencies might correlate with emotions (relaxed, stressed) and one can with practise effect some of the frequencies but this is not magic or mind reading.

  4. In addition, a neat processing sketch is included which illustrates the alpha, beta, gamma, and other wave types associated with brain activity as a morphing ball of changing size and color. This offers a nice visual sense of what the Neurosky is actually reading.

  5. Hi Dear Thank you so much for your information. I want to know one more thing. I have Neurosky Mindwave Headset. and also ThinkGear Bluetooth. can you guide me how to connect headset with arduino using this bluetooth? i searched on google some of they used different bluetooth devices. and mentioned the AT commands applied on bluetooth. I want to know that why we want to apply AT commands on bluetooth? and if we apply AT commands after some time if i power off arduino, and when i power on arduino again i need to apply AT commands? thank you so much.

  6. +Abdul: “it depends”, some modules will automatically try to re-establish previous connection without any AT-commands, many others do not. “When in doubt, read the datasheet”, but unless you know for sure you need to initialize the connection mode parameters via AT-commands only once, better to assume you need to do it every time the Arduino boots (that’s what the setup() function is there for anyway…).

  7. Thank you so much for you kindness. You are really help me. Dear can i use the bluetooth that are used to connect Mindwave with laptop? or I need to connect the other modules that are used to interface with arduino. I mean this iogear Bluetooth it require to install driver in laptop, but we can not install driver in arduino, so i think i need to use other blluetooth modules like HC-05 with arduino, am I right?

  8. The “driver” is just a way for multiple applications to get data from same (BlueTooth) serial port, the driver controls the serial port, parses the data and passes the parsed info to applications. The Arduino Brain Library does on arduino what the driver does on the laptop. The Arduino can use a bluetooth module to connect directly to the thinkgear.

  9. Sorry, I have no experience on those BT modules (or that particular neurosky product), you need to go to your local hackerspace or similar for hands-on help.

    Or start with first understanding the bluetooth module, how to use with arduino to communicate with your laptop for example. Then make an Arduino sketch that will show you the data coming in to the BT serial port when you have it connect to the Mindwave, now that you’re certain you’re actually receiving data you can add the brain library for parsing the data.

    You need to read the product datasheet for mindwave to know the correct bluetooth communication settings, the arduino must talk to the bluetooth module at least as fast (but know that “baud rate” is actually something completely different on BT and USB serial links than on oldskool modems and UARTs)

    As you can see there are a lot of details… Which is why you need either experience, experienced help or a lot of time and patience to learn so you get the experience you didn’t have.

  10. I have the mind flex hacked and the Arduino sketch burned into an uno but the processing brain sketch is full of compile errors. any suggestions on how to debug this code? I haven’t actually seen anyone else ask this question which sort of irritates me since I’m having such a big problem with it. any help will be greatly appreciated

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.