Playing Snake with my brain
A real-time SSVEP brain-computer interface for playing Snake with EEG.
I built a real-time brain-computer interface to play Snake 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. The pipeline streams EEG from my NPG Lite over Bluetooth at 500 Hz and uses 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 improved signal-quality checks, adjusted electrode placement, and changed the stimulus frequencies to avoid the interference.
Eventually, I got the gameplay shown in the video working with 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.
This is the video from the original post on X, shown as posted (not sped up).