Coder Social home page Coder Social logo

polycortex / mindpong Goto Github PK

View Code? Open in Web Editor NEW
31.0 9.0 2.0 1.49 MB

EEG multiplayer game using Muse headbands

Home Page: https://youtu.be/YJV732hR0gU

License: MIT License

C++ 7.13% Python 92.16% CSS 0.70%
eeg muse-headband neurotech arduino muse-headset

mindpong's Introduction

MindPong

MindPong is a fantastic EEG multiplayer game requiring two Muse headbands and an arduino board. The goal is to move a ball by controlling a fan with your brain. The more you are focused, the more the fan rotates. We are interested in beta waves in order to establish how much you are focused. It relies entirely on the pyMuse library. It is mainly used as a mean to popularize EEG technologies and neurosciences to the public. Visit the MindPong wiki for a detailed description of MindPong related projects and ongoing developments (https://github.com/PolyCortex/MindPong/wiki).

Game

To play a game of Mindpong, we'll need two players and an operator. The role of the players are to answers the randomly generated math questions and to relax when it is asked. The role of the operator is to start a game, to control the flow of the game and to ask the players to relax when he wants to.

The Mindpong interface displays three sections:

  • A play tab where the game takes place.
  • An analysis tab that features eeg signal graphics and spectrograms.
  • A settings tab to setup the communication.

Interface of Mindpong

Figure 1: Play section of the mindpong app.

The goal of the game is to compare the EEG activity when a subject is doing calculation v.s. when the subject is relaxing. To do so, the application generates random math questions and feature a relaxing mode.

Hardware setup

Figure 2 : rough idea of our hardware setup

The necessary setup is a ping pong ball in a transparent plastic tube with two fans at the edges of the tube. They are connected to an Arduino Uno which is linked to a computer which then receives the signal from two Muse headbands via bluetooth. We use Muse Direct to obtain beta waves from the headbands.

Electrical circuits

We use two independent circuits to make the game work. The first one allows the arduino to control the fans and the second one allows the microcontroller to raise a cute little flag for the winner.

Fan control circuit

The circuit makes it possible to use a PWM to control the fans' speed. To do so, a transistor (N-MOSFET) blocks and enables the 12V current to flow to the fans. We are using a flyback diode to provide a path to dissipate energy stored by the motor inductance.

Fan Circuit

We need two of this circuit to power the two fans.

Laser and laser receiver circuit

The flags circuit is really simple. It is composed of three components for each of the two flags: a laser emitter, a laser receiver and a servomotor with the flag affixed to it. They are all linked to the arduino's GPIOs (digital pins) and powered by the 5V output of the arduino. The software reproduces the following behavior: when the laser emitter loses the light signal (the ball passes over it), the flag is raised.

Installation

You will need a few tools to get started with Muse headset and pyMuse:

Don't hesitate to go on Muse Developer website for additionnal information.

Installation of dependencies

Simply use pip in order to install all of the project's dependencies.

pip install -r requirements.txt

Pip should install all requirements, including:

Getting started

To run mindpong.py on Windows

  1. Connect your two Muse headsets with your computer by bluetooth

  2. Start Muse Direct and set an OSC UDP output for player one and player two:

One headband needs to output his eeg relative data by OSC UDP on port 5001 (Player One)

Figure 2 : output setup for player one

The other headband needs to output his eeg relative data by OSC UDP on port 5002 (Player Two)

Figure 3 : output setup for player two

  1. Start ./mindpong.py in a terminal:

python ./mindpong.py

  1. Press play.

mindpong's People

Contributors

benjamindeleener avatar carlos0404 avatar cktanguay avatar cnzakimuena avatar conorato avatar gregoirepare avatar louispopo avatar monssaftoukal avatar williamharvey97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.