Repo of the winter EEG project by the Club d'Intelligence Artificielle of Laval University. The goal of this project is to interpret EEG signals in order to transform them into realtime game inputs.
Le projet supporte 16 canaux EEG avec Cyton + Daisy :
- Enregistrement :
main_annotation.pyutiliseCYTON_DAISY_BOARD - Training :
data_handler.pycharge 16 canaux (compatibilité 8ch avec padding) - Inference :
model_inference.pyetmain_inference.pyutilisent 16 canaux - CSV : Noms d'électrodes 10-20 (FP1, FP2, F7, F8, FZ, CZ, O1, O2, F3, F4, T3, T4, T5, T6, P3, P4)
Prérequis : Module Daisy branché sur Cyton, 8 électrodes supplémentaires, réentraîner le modèle avec données 16 canaux.
Repo is tested for python 3.12.8
- Install the Git CLI
- Clone the FLapEEG_v1 repo with this command :
git clone git@github.com:cia-ulaval/FlagEEG_v1.git(If it doesn't work, you need to setup an SSH key on your GitHub account) - Install conda
- Inside the repo you cloned, run this command to build the required environment :
This
conda env create -f env.ymlenv.ymlenvironment was tailored to be compatible with all systems including Windows, Linux and MacOs (but was only tested with Windows and Linux) - Activate the environement to have all the required dependencies:
You should now be good to go to launch the wanted scripts!
conda activate cia_flapeeg
1. Install the OpenBCI GUI : download
This is the official OpenBCI support user interface to allow streaming and seeing data from the EEG. Please download it and follow the installation instructions.
Important for Linux users : For Linux users only, there is a necessary hardware step, to make in order to allow the necessary permissions for your USB ports. Go look at the tutorial of the fix. The fix is in the section : Linux Users: Serial Port Permissions
For lazy bones, essentially you need to open permissions to usb ports for uses. In my case, on my Ubuntu machine this was the command that fixed it :
sudo usermod -aG dialout $USER
Then reboot.
- Connect the Daisy dongle to your USB port
- Run the OpenBCI GUI on your computer and start a streaming session : CYTON -> Serial (from Dongle)
To help connect your python scripts and the EEG helmet, OpenBCI provides us with a SDK : Brainflow. Go read the docs to learn how python and the EEG interacts.
Important : the Dongle's switch should be on the GPIO_6 and NOT the RESET switch
- Run this command in a terminal :
./OpenBCI_GUI - Or you could look inside the
OpenBCI_GUIfolder, right click and run theOpenBCI_GUIscript as a program :
- In the OpenBCI GUI, you need to the session :
CYTON (live) -> Serial (from Dongle) -> AUTO-CONNECT:
- You should have this inferface :

- Second option : open a console or a code editor like
Visual Studio Codeand open this project :EEG_flappy_bird- Then open a terminal
- Then activate the base conda environement :
conda activate - Then acivate the cia_flapeeg environement :
conda activate cia_flapeeg - Then launc the script :
python main.py
- Second option : open a console or a code editor like
Visual Studio Codeand open this project :FlapEEG_interface_v1- Then open a terminal
- Then activate the base conda environement :
conda activate - Then acivate the cia_flapeeg environement :
conda activate cia_flapeeg - Then cd inside the good directory to run the script :
cd src/data_streamer - Then launc the script :
python lsl_streamer.py
- To register the keyboard presses, you need to focus back the mouse on the game window. So click back on the window.
-
Setup the environment : How to get started with the environment
-
Connect the EEG with the dongle
-
Start the pipeline :
python main_annotation.py -
Select the target folder where all the
.csvfiles are exported : -
Write the name that your exported
.csvfile will take :⚠️ Important:- Do NOT write `.csv` in the name, the extension is automatically added. - The new data recorded is appended to the end of the document inputed. So if you want to have separate files for different recording session, change the name of the input. -
Start recording with the Record button. A window is supposed to show up to help you annotate your EEG data. Please blink when the FlappyBrain shows up.
-
Stop recording with the red Stop button.







