How to Hack EEG Toys With Arduino

160,799

424

81

Published

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

  • Creative Misuse Contest

    Creative Misuse Contest
  • Clocks Contest

    Clocks Contest
  • Water Contest

    Water Contest

81 Discussions

Thanks for the instructable!

I have a Force Trainer II, I've done the soldering and uploaded the code to the Arduino, connected the T pin to the RX(0) Arduino pin and the battery ground cable to the Arduino ground. Still, I don't get any updates on the serial interface - readCSV() always returns 200,0,0 and readErrors() is empty.

How is the neural circuit supposed to be powered? Does the Arduino USB power suffice? Or is the 1.5 AAA battery still required? Do I have to connect the positive battery cable to the Arduino 3.3V or 5V power supply?

Very nice writeup! Thanks!

We had trouble with the software you suggested, and re-wrote it to use the Arduino Serial Plotter (which is now built into the Arduino IDE). The Star Wars Force Trainer II also used a faster 57600 baud link, and that may be part of why there are difficulties with the library code you suggested (if you don't go to all trouble to do "cooperative multitasking," the way we did in our re-write). Looking at the graph you show above, it sure looks like you were hitting some of these problems, causing *all* the graphs to periodically drop to zero <oops>, so you *might* want to give the code below a try.

I can see from the comments that some folks *tried* to run at 9600 baud, and that just won't work no matter what (at least with Force Trainer like the one we purchased). We also added buttons to select which band you wish to graph/watch, which makes for a cute display. (a tiny edit to the startup code in the rewrite can change the default, if you really want to see all the graphs at the same time, and you don't want to bother hooking up the 10 pushbutton switches).

If other folks want to take a look, visit: https://github.com/JimRoskind/NeuroskyHacking/

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?

0
user
T0BY

1 year ago

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...

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

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