ECG Video Game
Interactive biofeedback gaming for neuroscience education
Overview
A two-player game that uses real-time ECG signals to control gameplay, making heart physiology and biofeedback concepts tangible and engaging for high school students.
Transform heart signals into an interactive gaming experience. Developed for high school neuroscience outreach, this project demonstrates how physiological data can be captured, processed, and used to control real-time applications.
Overview
This two-player game uses a Calliope Mini v3 microcontroller with an ECG sensor to capture real-time heart signals. Player 1 sets up the ECG electrodes, while Player 2 controls a character by jumping to collect hearts based on the detected heartbeat signals. The game combines hardware integration, signal processing, and interactive visualization to make neuroscience concepts tangible and engaging.
Features
- Real-time ECG monitoring: Capture and process heart signals using ECG electrodes
- Interactive gameplay: Heart signals control character actions in real-time
- Signal visualization: Live ECG data display with filtering
- Educational design: Makes physiological signals and biofeedback accessible to students
- Hardware-software integration: Demonstrates microcontroller programming and sensor interfacing
Hardware Requirements
- Calliope Mini v3: Microcontroller for signal acquisition
- ECG Board: Sensor board for capturing heart signals
- Grove Breakout Cable: Connects ECG board to Calliope Mini
- ECG Electrodes: Three electrodes for signal capture (RA, LA, LL)
How It Works
Player 1: ECG Setup
- Connect three ECG electrodes to the body (Right Arm, Left Arm, Left Leg)
- Electrodes capture electrical signals from heart activity
- Signals are transmitted via Calliope Mini to the computer
Player 2: Gameplay
- Control a character that must jump to collect hearts
- Jumping is triggered by detected heartbeats from Player 1
- Score points by collecting hearts while avoiding obstacles
- Real-time ECG signal displayed on screen
Educational Applications
High School Neuroscience Outreach:
- Introduces concepts of bioelectricity and cardiac physiology
- Demonstrates signal processing and filtering
- Shows practical applications of sensors and microcontrollers
- Engages students through interactive gameplay
Learning Outcomes:
- Understanding ECG signal characteristics
- Hardware-software integration skills
- Real-time data processing concepts
- Biofeedback and physiological monitoring
Setup and Installation
# Install Pixi package manager
winget install --id prefix-dev.pixi
# Clone repository
git clone https://github.com/ibehave-ibots/ECG-Video-Game.git
cd ECG-Video-Game
# Install dependencies
pixi install
# Run the game
pixi run game
Technical Implementation
Signal Processing:
- Signal acquisition from Calliope Mini via serial communication
- Noise filtering and baseline correction
- R-peak detection for heartbeat identification
- Event triggering for game mechanics
Game Architecture:
- Python-based game engine
- Real-time serial communication with microcontroller
- GUI for ECG visualization
- Event-driven gameplay mechanics
Biofeedback Concepts
The game demonstrates key physiological concepts:
Heart Rate Detection:
- Identifies R-peaks in ECG waveform
- Calculates inter-beat intervals (RR intervals)
- Displays real-time heart rate
Biofeedback Loop:
- Player 1’s heart activity directly controls game events
- Creates awareness of physiological state
- Demonstrates mind-body connection through gameplay
Outreach Impact
Engaging Students:
- Makes abstract neuroscience concepts concrete
- Combines gaming with physiology education
- Provides hands-on experience with research-grade sensors
- Demonstrates practical applications of STEM skills
Workshop Format:
- Small groups of 2-3 students
- 1-2 hour interactive sessions
- Guided setup followed by free play
- Discussion of physiological observations
Extension Possibilities
For Educators:
- Add difficulty levels based on heart rate ranges
- Integrate breathing exercises for heart rate control
- Compare ECG patterns between players
- Explore heart rate variability (HRV) metrics
For Students:
- Modify game mechanics to use different ECG features
- Implement additional signal processing filters
- Create multiplayer modes with competing heart signals
- Design new games controlled by physiological data