Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 3.08 KB

README.md

File metadata and controls

36 lines (26 loc) · 3.08 KB

Teegawhat?

The TGAM1 is an EEG board manufactured by a company called NeuroSky. As far as I can tell, it's difficult (albeit not impossible, for those investigative enough) to buy the thing directly. But then they've been famously used by Mattel in a ca. 2010 game called MindFlex, where you "control" a little foam ball with your thoughts. The headsets can be converted into simple, but cheap 1-channel EEG devices.

A number of websites and projects exist that have done so or are providing instructions. The ones I'm aware of are:

So why?

Because all those projects use Arduinos, some with a cable, some with BlueTooth. I wanted more freedom than that and had an ESP8266 lying around. So to make good use of its WiFi connection, this project uses MQTT to extract the raw EEG data and publish it to a message broker. There's also the option to output the full data (pre-calculated EEG power bands as well as what NeuroSky call "eSense") as CSV, again via MQTT, or via serial.

And how?

Check out the links above, they have many pretty pictures! You may want to try getting the TGAM1 into 57.6k Baud mode with serial commands first. For me that didn't work (it seems that's easier to do with a firmware 1.7 device, but mine has 1.6) so I ended up setting transmission speed in hardware. There's also some documentation about that in the source. So read the source, Leia.

As for the firmware, first copy src/config_example.h to config.h and make changes as you see fit. Then you'll want to install PlatformIO and then run pio run -t upload.

Once the device is sending messages, tty2csv (requires Ruby and the serialport gem; cd script/ruby; bundle install) can be used to write the received data to disk or mqttplot (requires Python 3.6 and the matplotlib and paho-mqtt packages; cd script/python; pipfile install) can be used to watch the EEG signal scroll by. There is another script using MATLAB, but that could use some love. PRs for all three of these very welcome, but I'll also happily accept examples / visualisation scripts / etc. for other languages.

Screenshot of matplotlib-based Graph