How I Played The Chrome Dino Game With My Brain Signals

This past week I’ve been hard at work on one of the most fun projects I’ve ever had. I used a Brain-Computer Interface to play the Chrome Dino game with my Electromyography (EMG) signals.

The Background

Brain-Computer Interfaces (BCI) are devices that enable us to communicate with computers using our brains. A specific type of BCI known as an electroencephalogram (EEG) is a non-invasive approach to BCI which uses metal disks (electrodes) to detect the electrical gradients from your brain between at least 2 different electrodes.

Different EEGs have different capabilities, and can collect different types of biosensing data:

  1. Electroencephalography (also EEG…): Brain data
  2. Electromyography (EMG): Muscle data
  3. Electrocardiography (ECG) : Heart data
OpenBCI Ganglion Board

The BCI that I used for my project was the OpenBCI Ganglion Board. It’s capable of detecting all 3 types of biosensing data and was perfect for my needs. I needed something that could detect when I flex my muscles so that I can get that dino to jump from my brain signals.

The Ganglion was perfect for me since it could detect EEG, EMG, and ECG data which would be perfect for future projects. For this project, all I needed was the EMG data from my forearm.

The Setup

OpenBCI GUI

The Ganglion is somewhat similar to an Arduino. There’s a small blue board where you connect various cables and electrodes to it to get your preferred data.

In order to get EMG data from my forearm, I had to attach sticky electrodes to my arm (which hurt like hell when you take them off) to detect when my muscles are flexing.

The Process

This took way too long

Even though I got my EMG data visualized, it means nothing if I can’t turn that into some meaningful output. After doing some digging on the OpenBCI docs, I saw that OpenBCI uses the Brainflow library to program their hardware.

Admittedly, it took way too long to build that. But overall, it was a great learning experience where my perseverance was tested as I watched the sun go down as I coded. After I got the program to work, and the dinosaur jumped everytime I flexed, I was fucking hyped; But too tired to celebrate properly.

The Result

Skip to 1:57 for demo

I recorded the entire process from start to finish for your enjoyment! As someone who has been learning about BCIs for a long time, it felt super cool to finally get my hands dirty with a fun yet simple project. Expect more from me soon!

ahnaafkhan.com

Hey! If you made it all the way down here I just want to say thank you for reading! If you enjoyed the article, clap it up and contact me on Twitter, Linkedin, or ahnaafk@gmail.com. Check out my website too while you’re at it.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store