How to Hack EEG Toys With Arduino

158,857

419

79

Posted in TechnologyScience

Introduction: How to Hack EEG Toys With Arduino

About: I'm a full stack web developer focusing on security and privacy.

i had heard a few years back about the ability of hooking up toy EEGs so you can interface them with your computer. 

I was reminded of this for a project i wanted to do for a class (instructable coming soon ;-)), and i also found a "Star Wars force trainer" on amazon for 30 bucks. 

Here is the simple step by step instructions on how to turn a force trainer into a working EEG you can see with your computer. 

special thanks to frontier nerds for the initial code and the hack of a similar toy. 


Step 1: What You'll Need

- Arduino, any kind will do
- Star Wars Force Trainer toy
- A computer running processing and the arduino development enviroment
- solid core wire
- basic soldering supplies

Step 2: Modding the Force Trainer

After you're done messing with the force trainer (its a pretty cool toy), open it up.

You'll be looking for two spots, the ground and a pin labeled "t". make sure the solder doesn't get on any other pins and solder two wires, one from the ground and one from the t pin.

Once that is done, drill a small hold in the force trainer case and feed the wires through. 


Step 3: Programming the Arduino

Next you want to program the arduino. This code will take the data from the force trainer and spit out some pretty numbers. We will go over what the numbers mean in a later step.

Here is the code: Arduino Brain Library

Install that library and load the serial out example, verify you are getting data from the serial monitor. 

Now you are ready to combine the arduino and the force trainer. 

Step 4: Hooking Up to the Arduino

Next, its time to wire the arduino up to the force trainer. Take the wire from ground and wire it to GND on the ardunio, and take the "t" pin wire and plug it into pin 0 (or RX)

I used some zip ties to keep the arduino attached to the top of the force trainer.

Step 5: Visualizing the Data

Got it all hooked up? seeing a bunch of numbers? you're doing well. Now get processing running to visualize your data. 

Download this set of code and install it: http://github.com/kitschpatrol/Processing-Brain-Grapher/zipball/master
you'll also need this library to run the processing code: http://www.sojamo.de/libraries/controlP5/

Once that is running on your computer, you should see a graph pop up. Hook up your arduino to the computer and you should see some pretty graphs! (see picture)

The force trainer gives you 11 values in this order:
Connection quality, Attention, Meditation, Delta, Theta, Low Alpha, High Alpha, Low Beta, High Beta, Low Gamma and High Gamma. 

At first the attention and mediation values will be zero, but once it gets warmed up they will start bouncing around. Try concentrating on things to get the attention up. See what doing different tasks do to get the levels up or down. 

Step 6: Next Steps

Now you have a bunch of data you can work with to make your own projects. For me its going to take a bit of time understand the values in such a way so i can hook things up. The possibilites from here are endless. brain controlled pianos? Telepathic tweeting?

I'd love to see your projects from this set up. If you have any suggestions, post them in the comments!

Share

Recommendations

  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Spotless Contest

    Spotless Contest
  • Trash to Treasure

    Trash to Treasure
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

79 Comments

I have made all the connection as per the advice. And also loaded the code to the Arduino UNO, but im not getting any data on Serial monitor...!. please HELP urgent.

I have a HUGE problem ..i can't receive data....i connected the Transmit pin on the receiver pin on the arduino....and the ground from battery to ground....i load the code but nothing happen...Any ideas?

user

Amazing!

i have problem to download software,can somebody explain to me how to do it?

a mouse control would be awesome

Seeing you stare at the computer screen while wearing it makes me wonder if you could scroll with it. That would be awesome.

1 reply

That would be an awesome use of brain power. DARPA (Defense Advanced Research Projects Agency) has done research on thought control between military hardware (fighter jets) and pilots may actually include surgical intervention. Implants of sensors to control flight and or weapons.

I'm reminded of the Clint Eastwood movie FireFox, has thought control weapons systems, but he has to THINK in Russian! Excellent movie, regardless of of the reality of the state of the art of "thought control weapons systems!"

https://youtu.be/sYh9_QmNwRA

Hi instead of Arduino I will use a HC-06 Bluetooth module that would connect directly to the computer via a bluetooth mini-usb dongle connected with HC-06. But my question is how then can I use the brain grapher in processing in order to read the data from the headset to the computer? I saw an article about OSC that it's possible to use OSC readings in processing. But I don't know what should I modify in the codes to make it work with the brain graph.pde. Any advice? THx

I guess some people are getting errors because they hooked up the RX and TX pins of the arduino to the 't' and GND while uploading the program to the arduino

I got this error

Arduino: 1.6.6 (Mac OS X), Board: "Arduino/Genuino Uno"

Multiple libraries were found for "Brain.h"

Used: /Users/lucascoding/Documents/Arduino/libraries/Brain

Not used: /Users/lucascoding/Documents/Arduino/libraries/Brain-master

Sketch uses 4,686 bytes (14%) of program storage space. Maximum is 32,256 bytes.

Global variables use 748 bytes (36%) of dynamic memory, leaving 1,300 bytes for local variables. Maximum is 2,048 bytes.

avrdude: ser_open(): can't open device "/dev/cu.usbmodem1a21": No such file or directory

ioctl("TIOCMGET"): Inappropriate ioctl for device

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

there is a new fangled eeg called emotiv, they have a great ted talk. You might be able to create specific patterns by visualizing something. if this creates a repeatable brainwave state you could use that frequency pattern to trigger certain commands. Thats how Emotiv does it anyway. they also have an algorithm to flatten out the folds in the brain. This is because everyone's folds are different...

Fantastic work, awesome processing scripts. I'm trying to write my own, slowly getting there.

1 reply

I hear you wavelet, i'm in the same boat.

my brother is a handicap he dosn't do any thenk but he now wathe we toking about and he anderstand move his ayes pleas need help contacte me

gimail or google+: karimmariami12@gmail.com

my email : amine_1997_aout@hotmail.com

AHHHHHHHH THE BRAIN TEST ARDUINO EXAMPLE SAYS


BrainTest:9: error: 'Brain' does not name a type
BrainTest.pde: In function 'void loop()':
BrainTest:26: error: 'brain' was not declared in this scope
BrainTest:34: error: 'brain' was not declared in this scope

2 replies

make sure you have the brian library declared

Hello, i am also getting the same error. did your error resolve?

After browsing through the frontier nerds' post, I noticed the comparisons between the force trainer (seen in this instructable) and the mindflex. The article mentions that while the mindflex has EEG Power Band Values, the force trainer does not. What exactly does that mean? Which one would you recommend? If they're the same I'd go with the force trainer ($30 cheaper on amazon), but again I'm not really sure what the differences are in terms of features and things we can tap into. Thank you in advance! Can't wait to try this instructable out this summer!

Screen Shot 2013-04-21 at 1.27.31 AM.png
2 replies

The Frontier Nerds post has some great information, but they do say you can't get full raw EEG data from the MindFlex. I have managed to do this by making some extra changes to the TGAM1 board that is inside the headset. Basically, you will see a port called B1 on the board, and there is a 10K resistor connecting this to GND. If you remove this and replace it with a 10K resistor to VCC then you get full EEG data at 57600 baud, rather than just the summary values at 9600 baud that you get normally.

Could you elaberate more on where it is? I can't find B1 for the life of me.