Giter VIP home page Giter VIP logo

low-cost-eeg-based-bci's Introduction

Low Cost EEG Based Brain Computer Interface

The project uses a live EEG from the user to control a simplified keyboard using steady state visually evoked potentials.

On start-up, the user should stare at one of the checker boxes to record a baseline EEG. Once the checkerboxes start flashing, the user can start making selections. There are five flashing checkerboxes, each flashing at a different frequency. Each box also has some comma separated options above them, which can be selected By the user looking and concentrating on it. The box will be highlighted and the options sub-divided between the checker boxes. This repeats until a single option is selected. If the option is a letter/number it will be displayed in the text box.

The SSVEP BCI is not reliable right now

In the circuit folder is a ltspice schematic for a single channel EEG measuring circuit which is measured by a Nucleo F303K8. The values are sent to the brain-computer interface which processes the data.

A video overview of the circuit can be seen below

IMAGE ALT TEXT HERE

A simple Alpha wave BCI can be found in the Alpha BCI folder and a video demonstrating can be seen below

IMAGE ALT TEXT HERE

This was my final year project for my Electrical/Electronic Engineering Degree

Getting Started

  1. Build the circuit as shown in the circuit schematic

  2. Import and build the Nucleo code to whichever ARM compatible IDE you wish. I used SW4STM32.

  3. Flash it to the Nucleo

  4. Run eegBCI.py, you may need to change the serial port in this file.

  5. See that the EEGScope window is receiving data.

  6. If it is, you can close the windows and connect up the electrodes.

The following instructions are for connecting the measurement electrodes between 0z and the right/left mastoid and the Driven right leg (DRL) to the left/right mastoid

  1. Connect an EEG cup electrode to the positive electrode lead (instructions for making the Low-Cost EEG cup electrodes I used can be found in the Electrodes Folder)
  2. Connect an ECG electrode to the negative electrode and DRL lead
  3. Remove the pads from the ECG pad electrodes and place one behind either ear (mastoid)
  4. (Optional) Apply Abrasive gel to Oz (I used Nuprep), this may improve signal quality
  5. Fill the electrode cup up with conductive gel (I used Signa Electrode Gel)
  6. Place the electrode cup on Oz and put on a swimming cap to hold it in place
  7. Start eegBCI.py and follow the instructions on screen

Prerequisites

The BCI uses Python3 and all of the dependencies are listed in requirments.txt in the BCI folder. Run "pip install -r requirements.txt" within the folder

Nucleo code was created with STM32CubeMX and edited in SW4STM32 but can be imported into other ARM based IDE

Theory

The thesis documenting the design and testing of the project can be found in the Thesis folder

Contributing

TODO

Authors

License

This project is licensed under the Apache 2 License - see the LICENSE.md file for details

Acknowledgements

  • Dr Ted Burke for supervising the project and providing endless help and ideas

Disclaimer

The designs for the EEG hardware and software shown in this repository have not been tested to comply with any medical device standards such as IEC 601. Therefore, any user which builds or uses the designs from this repository does so at their own risk.

As of writing, the BCI designs in this repository are not very reliable so the software/hardware should not be modified to control dangerous machinery or provide a valid means of communication.

low-cost-eeg-based-bci's People

Contributors

ronanb96 avatar zabop 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

low-cost-eeg-based-bci's Issues

Question on EEG chip

Fascinating project. Trying to recreate your circuit. What chip are you using for the EEG?

Thank you,

Questions about /dev/ttyUSB0

As I understand it, the input value '/dev/ttyUSB0' pertaining to the USB-TTL device is specific for LINUX distributions, which would be the value in case for a WINDOWS distribution?

BZX84C3V6L

Even after copying and pasting whats in the lib the LTspice gave "Can't find the model "BZX84C3V6L" "

eegScope update problem

I'm having problems with eegScope.py. Running it with a test signal from a function generator, the correct frequency and waveform is shown. The scroll rate of the raw signal is however only half the speed of the expected. i.e. when 2 seconds have elapsed, the graph has only scrolled 1 second (going by the markings on the graph). This results in the data on the screen being delayed compared to the current signal, with this delay accumulating over time. The FFT plot follows the raw data, i.e. it's also delayed.

I've tried changing 'Fs' in the and other parameters in the Python program, but it either doesn't help or breaks the code. I've also tried with different sample rates on the microcontroller. I've verified that the microcontroller sends data at the correct rate and that the packets are up-to-date.

Thinking it could be a problem with precessing time, I also tried removing the FFT plot and all the FFT calculations, but the result was the same.

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.