How to Hack EEG Toys With Arduino

183K462105

Intro: How to Hack EEG Toys With Arduino

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!

88 Comments

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/

uhhmmmm can you tell me what did you do to the 1.5v input from T pin which arduino can not directly use it as high input ?
How should I connect the code to my Force Trainer II? Sorry I'm a beginner
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.
for me i was using a modded force trainer II and after changing 9700 in the serial.begin(9700) I just changed it to 57600 so it would instead read serial.begin(57600)

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

Thanks - helped a little bit but my program still doesn't run

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?

I have the exact same problem. Did you ever manage to solve it?

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'm going down the same route, since the Force Trainer 2 has bluetooth integrated into it.

Although long term, I will likely integrate to some intermediate layer, such as an Arduino so I can control devices with it, in the short term, I want to first look at the data being collected, and then possibly work up an application to aid in maintaining the desired brainwave state. And that's a lot easier to do on my desktop than it is with an arduino.

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?

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.

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

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.

More Comments