/Brain-Computer-Interface

This is the code for "Why is Elon Musk Connecting Brains to the Internet?" By Siraj Raval on Youtube

Primary LanguagePython

This is the code for this video on Youtube by Siraj Raval. This is a Python library meant to work with the Emotiv headset.


CyKit 1.0 for Python 2.7.6 (Windows x86) using Emotiv EPOC headset.

FAQ
https://github.com/CymatiCorp/CyKit/blob/master/FAQ.md

Wiki (Updated Jan. 2015)
https://github.com/CymatiCorp/CyKit/wiki/EEG-CyKit-1.0-updates



OpenVIBE Setup (Updated Feb 25 2015)
https://github.com/CymatiCorp/CyKit/blob/master/Openvibe-Readme.md


Cyos (OpenViBE TCP Server - Revision 1.0 - Win32 Executable)
http://cymaticorp.com/edu/github/Cyos-0.1.0.win32.py2.7.zip

Hardware

https://github.com/CymatiCorp/CyKit/blob/master/Hardware-Readme.md

Modified Hardware
v1

v2

Questions about the project?
Contact me at warrenarea@gmail.com

Description

CyKit 1.0 is specifically for Python development in Windows to
give access to the raw data stream from the Emotiv EPOC headset.
CyKit 1.0 is an unofficial branch to the OpenYou emoKit, check it out here
https://github.com/openyou/emokit

CyKit Dependencies

  • pywinusb 0.2.9
  • pycrypto 2.6
  • gevent 1.0.1
  • greenlet 0.4.2
  • pygame 1.9.1 (Only required if you want to use render.py which shows the EEG graph)
Note: All of the necessary files, listed below as dependancies,
       are included in the \InstallFiles directory of this repository.

Direct links for Windows(x86) Dependencies

Note:  There is an alternate version of CyKit to work with Python 3.3 

See https://github.com/CymatiCorp/CyKit-Python-3.3 ( -Experimental- not heavily tested. )

Installation Instructions (Using Windows binaries)

Extract pywinusb to any folder, and copy the folder

                                   \pywinusb 
                                   
                              from folder \pywinusb-0.2.9 to
                                    
                             Drive:\Python27\Lib\site-packages
  • Install following dependancies:

gevent 1.0.1

greenlet 0.4.2

pycrypto 2.6

Install to python2.7.6 folder.

Navigate to the Python directory extracted from CyKit-master.zip

C:\Python27\Python.exe C:\Cy-master\Python\example.py

If your Emotiv USB dongle is not connected it will throw several errors ending with:

                                   AttributeError: 'Emotiv' object has no attribute 'device'

Connect the EPOC USB dongle and run again, and it should begin streaming you data.

Server Support

Added ability to stream the data to a TCP connection.
Adjust Python PATH in batch files as necessary. Type RunStream.bat

runs: Python.exe stream.py <server> <port>

mIRC Support

Added a mIRC script that will connect to the TCP server and display in a simple graph the activity of the sensors.

In Command Prompt type RunStream.bat

 (runs: Python.exe stream.py <ip> <port> )

In mIRC "Status Window" type

 /load -rs CyClient.mrc
 /load -rs CySignal.mrc

This loads scripts to the remotes. Alternatives ALT+R and load manually. then in "Status Window" type.

CyClient.mrc - Connects to the socket server and breaks large packets into smaller ones. CySignal.mrc - Receives the smaller packets and handles displaying EEG results.

 /EEG
   or Popup Menu: EEG

Updated mIRC so that it averages out the data, creating baselines for each data channel. This means, no matter what signal variance or whether the data has a positive or negative sign, the data displayed can then be placed equally from one another on seperate lines. Setting a baseline only needs to occur once per EEG run. It will do it automatically when your device is connected to the stream, but you can optionally initiate a baseline reset manually in your status pop-up window.

Credits & Original Code

Contributions by