Hands-Free Dino Jump
Play the dinosaur game using eye-blinks detected from EEG signals, without touching the keyboard.
The Challenge: Playing Games Hands-Free
This project is my final course project for COGS 189: Brain Computer Interfaces at UCSD.
What if you could play a game without touching a keyboard? What if people with motor disabilities could enjoy games through their brain signals? This project explores using eye-blinks detected from EEG signals to control the classic Dinosaur Game—no hands required.
Demo
Watch the system in action:
Motivation
We were driven by three key questions:
BCI vs. Keyboard
Is an open BCI easier or harder to use than a keyboard for gaming?
Accessibility
How can people with motor disabilities or keyboard difficulties play games?
Eyeblink Signals
How effective are eyeblinks (vs. actual brain activity) in an online BCI?
Methodology
Data Collection
We recorded EEG signals from 4 participants using an OpenBCI Cyton device, focusing on eyeblink detection:
- Electrodes: FP1 and FP2 (closest to the eyes, best for eyeblink signals)
- Trials per participant: 5 trials × 60 seconds each
-
Trial structure:
- First 30 seconds: Single blink every 5 seconds
- Last 30 seconds: Double blink every 5 seconds
- Total data: 20 trials across all participants
Signal Processing Pipeline
Offline Processing
- Data extraction - Extract FP1 & FP2 from CSV files
- Normalization - Flip inverted signals, normalize drift
- Filtering - Apply high-pass and low-pass filters
- Epoching - Divide into 5.2-second windows
- Peak detection - Mark peaks and measure amplitudes
Key Observations
- Eyeblinks show distinctive voltage drops
- Double blinks have stronger first peak
- Second blink has lower amplitude
- Clear 5-second periodicity in data
Simple Voltage Thresholding (SVT)
We distinguished single vs. double blinks using two features:
SVT Features
1. Peak Magnitude: Double blinks have stronger peaks than single blinks
2. Peak Interval: Double blinks show a high peak followed by another peak with slightly lower amplitude
Threshold: Calculated by averaging peak magnitudes for each participant
How It Works: Online BCI System
Real-Time Pipeline
- Stream data - Python LSL package receives online EEG data
- Classify - Apply SVT model to categorize signals as double-blinks or not
- Control - Pynput simulates spacebar press/release
- Jump! - Dinosaur jumps when spacebar is released
Optimal Parameters
After extensive optimization, we determined the best settings for real-time classification:
Optimal Configuration
Sampling window: 375 data points
Peak-to-peak interval: 150 data points
Result: Rapid processing + accurate classification
What We Learned
Technical Insights
- BCI data processing pipelines (OpenBCI Cyton)
- Signal processing techniques (filtering, normalization)
- Simple Voltage Thresholding algorithm
- Real-time EEG classification challenges
Limitations & Challenges
- Small sample: Only 4 participants limited generalization
- Manual parameters: Time constraints required hand-tuned thresholds
- Latency: Delay between blink and game response
- Incomplete implementation: Only jump action; duck action not implemented
Key Takeaway
While detecting the second eyeblink remains difficult, the system demonstrates the feasibility of using consumer-grade EEG and eyeblink signals for real-time game control. This opens possibilities for accessible gaming and interaction for people with motor disabilities.