Playing Snake with my brain
This is me playing Snake using my brain.
The goal was to build a brain-computer interface using steady-state visually evoked potentials (SSVEPs). When you look at a flickering visual stimulus, your visual cortex produces activity at the corresponding frequency. By assigning different frequencies to four directional targets, I wanted to decode which one I was looking at and use it to control Snake.
I built a real-time pipeline to stream EEG from my NPG Lite over Bluetooth at 500 Hz, process the signals, and use CCA/FBCCA to classify the four directions.
Actually getting it to work was much harder than I expected.
My first calibrations failed because of intermittent electrode contact through my hair and a persistent 16.67 Hz interference signal. One of my original targets flickered at 17 Hz, so the decoder kept predicting that direction regardless of where I looked. I’m still working out where the 16.67 Hz signal comes from.
I spent hours analyzing recordings, improving signal-quality checks, adjusting electrode placement, and changing the stimulus frequencies to avoid the interference.
Eventually, I managed to get the gameplay shown in the video using real EEG. However, this was one of very few successful attempts, and the accuracy is very far from perfect.
The biggest thing I learned was how different implementing a neural decoder is from getting one to work with real hardware. Electrode contact, electrical interference, signal quality, and stimulus timing can matter just as much as the decoding algorithm itself.
Next, I plan to invest in cup electrodes with conductive paste and move from one to three occipital EEG channels. Once decoding is reliable, I can start optimizing the accuracy-latency tradeoff to make the controls more responsive.