Introduction: Control Any Gadgets With Your Brain! (Neurofeedback With Arduino Microcontroller)

Picture of Control Any Gadgets With Your Brain! (Neurofeedback With Arduino Microcontroller)
You've Seen many cool gadgets on news like, controlling robot.
I've been pretty shaken up with that one. So after some 6 months of research, I made my own!
All the parts cost me less then 100$! Thats cool isn't it?


- 1 MindFlex - 50$ <= Got mine from EBay!
- 1 Arduino Microcontroller <= Visit the official Aruino Site Here!
- Some Wires <= Duh! I got it from my old mashed up computer...
- A Personal Computer <= Everyone has it. Right?
- Some time

Software & Files:

- Arduino GUI <= Download Right Here!
- Arduino Brain Example Code <= Download at the bottom!


- Soldering Iron <= You'll need it.
- Hot Glue gun <= Not REALLY needed, but we have to secure wires right?
- Drill <= Not really needed, its used to make a hole so wire can go through the case
- Other tools (Pliers, Wire Cutters, Wire Strippers, etc.) <= This will help ya!

Well, Thats about it! Lets move on!

Step 1: Prepare Your Arduino Software!

Picture of Prepare Your Arduino Software!
First, Make sure your arduino is connected to your computer with USB connector and
the Arduino GUI is installed.
I will assume that you already had experiance with uploading code into your arduino. If not, Check This guide!

When thats done, Open up the downloaded 'Brain' folder and click'Examples'. Then you will see 2 folders
For now, We will use the program 'BrainSerialOut'. So open the folder and Double-Click the
'BrainSerialOut.pde' file and upload it into your Arduino.

Thats all the software you will need!! :D

Helpful Notes: The 'Brain.cpp' and 'Brain.h' is a library for this program. Make sure the
'BrainSerialOut.pde' file is in the same folder with 'Brain.cpp' and 'Brain.h' or else it wont work.

Step 2: Time for Hardware Hacking!! - Opening Your Headset

Picture of Time for Hardware Hacking!! - Opening Your Headset
OK! Time for Hardware Hacking!!!! >:D

To hack our victim (aka Mindflex Headset), We need to open it. Well, Go get your screwdriver and start opening!

Step 3: Soldering Some Wires

Picture of Soldering Some Wires
Now our headset is opened, Examine your circuitboard and find the label named ' T '.
The ' T ' stands for Transmit. Which is the pin that sends us information.
There will be a little solder glob below the label ' T '. Solder a wire to the glob (look up for pictures!)

Once your done, solder a another wire to the ground solder glob(See picture for details).

You will have total 2 wires soldered total! Lets move on!

Step 4: Connecting Wires to the Arduino

Picture of Connecting Wires to the Arduino
To get acess to our Headset here, what you'll need to do is to connect the wires that are coming
from the headset to the correct pin of our Arduino.

So what pin? Connect the wire that we connected to the ' T ' blob earlier to the Arduino pin RX,
and for the other wire, connect it to the Arduino Ground (I'll say it again, check out the pictures above)

Tips: The Arduino pin 'RX' stands for Receiver, which receives data from the headset.

Thats all! :D

Step 5: Test Em' Out!

Picture of Test Em' Out!
So lets test this out!
First, connect the arduino to your computer with your USB cable. Then open up the Arduino GUI
and click the Serial Monitor (The logo thats has box with a lollipop sticking out on the top).

Attach your headset (Make sure you have batteries) and you will see bunch of data spitting out.
If it have numbers somthing like this:
0, 634, 5344, 5334, 78934, 6544, 63434, 9834, 3574, 30564, 67534

Then you have a good connection!

Step 6: Finishing It Up.

Picture of Finishing It Up.
Once we checked its working, Lets now finish this gadget up!
I drilled a small hole in the case so the wires can go through.
Also, I used some hot glue gun to secure wires and attatch the Arduino to the headset.

The final gadget with some finishing touches are shown above.

Step 7: Understanding the Data!

Picture of Understanding the Data!
Now lets examine the data this thing is spitting out!
The long number this spits out can be breaked down into this:

=> signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma

If you dont know what is gamma or alpha or you think this is toooo hard, check out the
wiki about brain signals here! (Also check the picture above)

Now lets make our Real-Life-Application(Well, sort of)!

Step 8: Our First Real-Life-Application (Sort Of)

Picture of Our First Real-Life-Application (Sort Of)
Now lets get in more deeply! How about creating a 'Attention Analyzer'??

Open up the 'Brain' folder, navigate to 'Examples' folder. And this time, goto the 'BrainTest' folder and click the 'BrainTest.pde'.
Now upload it to your arduino!

So what does it do? Well, If the person's (who is wearing the headset ) attention goes up, the blinking of the LED goes faster.
(Mentioning about the LEDs, The LED that blinks is built-in to the Arduino so you dont have to worry about adding a LED.)
The picture shoes Arduino's built in LED that will blink in this experiment.

Step 9: So What Now?

So what now?

The title says that you can control anything with this gadget. Well, controlling a gadget can be break down into these steps:

Determine what brain data you will need => Examine the data by putting the headset on and thinking it => Get the data range
=> Write a Code => Make a circuit that turns the circuit ON/OFF with transisters => Connect the gdaget

I suggest that these steps can be performed by who has atleast 5 years of electronic experiance.
Brain data management to control any gadget is not easy as you think.

But for all the remaining people out there, There is some cool example programs all around the internet!
Like this cool Analyzer Program (Download Below) <- You may need to install the controlP5 library (Search Google)

Thanks for taking your time reading this instructables! God Bess!


minaF2 (author)2015-11-20

Here's the same issue

The mindflex only sends 26 signal strength and zero attn and med values... sometimes even 51... never drops to zero and no usable signal.., I've tried to connect the arduino to a laptop running off batteries , used a water/salt as a conductive solution, used a link from the arduino GND to my body .. always the same , never got a signal strength less than 26 , so i'll really appreciate any suggestion or even a clarification to what can be the issue and how to fix .

SuhasS12 (author)minaF22017-11-17

even i experienced the same....but i solved it by checking the voltage across T pin and gnd!.....if it varies from 3 to 2 then it is sendind the values to the computer and if not it isnt sending any data! To get that voltage just short T pin & any other adjacent pins which has 3.25 v for about 10 seconds. This worked for me....hope the same with you! :)

ChristianB139 (author)2017-10-04

Awesome project.. just a couple of simple things that would have helped me getting it working quicker... 1) Find & replace "WProgram" with " Arduino" in scripts 2) make sure the rx input is unplugged when loading the code.

AdeebR1 (author)2016-05-03

Hey which Arduino micro-controller did you used??

ancymathai (author)2015-12-14

Good project but,not at all working your code full of errors.
Not getting response for the comments.......

Kidhacker (author)ancymathai2016-04-14

the libraries call for a driver in the arduino called Wprogram.h and Wprogram.cpp

just change the Wprogram to Arduino so it should look like this Arduino.h and Arduino.cpp

Neiljams (author)2016-03-23

This instructable is one of many of the same hack and is only for graphical visualization. Technically one could control a device using the wired hack but one would still need to connect the gadget to the robot. Oh ya if you controlled a robot where is that part. Some people are abke to follow directions pretty well

borsaci06 (author)2015-11-20

Never worked for me... My mindflex only sends 26 power signal and zero attn and med values... sometimes even 51... never drops to zero and no usable signal... :) cecked out everything from Google but with no luck... any ideas?

PrashanF (author)borsaci062016-01-22

That could probably be due to the mains filter configuration (power line noise). I've had the same problem (I got 51 and even 80), but once I configured the notch filter frequency jumper to 50Hz. It worked like a charm. It depends on the region. Also unplug any device connected to mains, as this would induce power line noise.

borsaci06 (author)PrashanF2016-01-22

yeah.. you are right... the problem is with mains voltage noise... I changed my setup... I used bluetooth to send brain data from ThinkGear and it worked like a charm... :)

Kidhacker (author)2016-01-11

and to kchugh

you should be able to control something with ac power with a relay and the power source can come literally from a power cord

Kidhacker (author)2016-01-11

I was able to take this project and make a vex robot run forwards or backwards depending on how calm you are

Robotic2001 (author)2015-10-04

I habe a question can I control a hexapod with

Robotic2001 (author)Robotic20012015-10-04

Can I control a hexapod with SG90 servos with the MindFlex and how i didn't understand how you connect the robot with the MindFlex.
Could you pls explain me this pls.

kchugh (author)2015-04-26


I wanted to ask some questions

1)can I control an AC motor from this gadget

2)from where can we get the power source

momensuperstar1 (author)2015-03-14


renxinhe (author)2015-02-15

Is there a way to increase the sample rate of the packets? Maybe like one packet every 10 ms?

zsteinberg (author)2014-07-06

Anybody have a pre written code that controls a gadget they could share, or would be willing to help?

StrangeDos (author)2013-10-09

Would it be possible to get the baseline reading from anywhere else other than the ears? Those ear clips do look kind of dorky.
My idea is to 3D print a cooler looking headset for the Mindflex pcb and sensors. More like the Force Trainer headset (which I couldn't get my hands on so I went for the Mindflex instead).

The Force Trainer seems to get the baseline readings from behind the ears. The Mindwave seems to omit one of the ear clips at least.

sourav639 (author)2013-05-24

can we use the mindflex headset used here instead of mindwave headset as used in this- ---

codegamc (author)sourav6392013-09-22

you can use any of the headsets, ive done it with 2, and my friend used a third. they all have T, but the data is just calibrated a little different so the values arent identical, but still totally unerstandable from one to another. that said, i dont know how the code compares for the mindflex data. try it, the y are cheaper too, no?

supermitch (author)2013-02-04

I already said, I'm getting a bunch of error messages. I noticed now though, there are only error messages for the libraries (Brain.h and Brain.cpp) and not the actual program (BrainSerialOut.pde) . It's fine but I need the libraries to work!

supermitch (author)2013-02-03

your file isn't working. I got about a bazillion error messages when I tried verifying the sketch. and I do have the BrainSerialOut, Brain.cpp, and Brain.h documents in the same file.

supermitch (author)2013-02-03

and by the way, you should use spell-check. I am using this for the 3d printer contest.

supermitch (author)2013-02-03

pretty good. could use some work for less experienced hobbyists, but I can figure this stuff out. way better than other crap on instructables about neuroscience. overall, ***.

nerd7473 (author)2012-11-15


Bionic Chandru (author)2012-03-28

Hello I science your project is very nice Atlast we can see only led blinking and how can i add any object to O/P port and how can i control it?, Exaple how to connect fan in which port in arduino.

TylerBerzzz (author)2012-03-25

Hey man, that was a great instructable! I'm thinking about doing it but im completely unfamilliar with arduinos, yet i really would like to control electronics with my mind. I believe that you'd have to program the arduino specifically to what device you are trying to control and i have no idea how to do that. All im experienced in is programming on RobotC :/ you should make another instructable on you controlling something with your mind

smiffyjoebob (author)2012-02-20

I am looking for a way to make and use a BCI like this to control 'Hot Keys' for videogames (ex 1-0 on the top of the keyboard). Would this project work for that/would I need some more programs to make it work? could you point me in the right direction?

mysterion (author)2011-12-21

What an amazing project, your research paid off.
Technology like this is the next generation
Cheers and Thanks for the great read!

magicthegathering (author)2011-10-24

Thanks. How about a video?

I hope you liked it!
I was thinking about that too. But I dont know :P

robot797 (author)2011-10-22

were can i get a cheap sensor?

iScience (author)robot7972011-10-23

I got mine from Ebay for 50$. The MindFlex comes with the whole bunch of Game consoles as a kit which makes it more expensive (since we are only going to
need a EEG headset). I think there is some store out there that sells the EEG headset alone.

Cheers! And thanks for taking time to read this instructable!

iScience (author)2011-10-21

If you need any help, comment!!! Ill love to help!!!

About This Instructable




Bio: I love SCIENCE. The world of knowledge. If you are reading this, You TOO will love SCIENCE
More by iScience:How to Send Data by Light: Fiber Optics [Updated]Control any gadgets with your Brain! (Neurofeedback with Arduino Microcontroller)
Add instructable to: