PlayMG is an Electromyography (EMG)-based project leveraging the Bioamp EXG Pill to map forearm muscle activity to computer keyboard inputs. By detecting muscle contractions and finger movements through EMG signals, specific gestures can trigger keyboard actions, such as pressing the Spacebar.
- Real-time processing of EMG signals to detect forearm muscle activity and finger movements.
- Gesture-to-key mapping for seamless interaction (e.g., clenching a fist to press Spacebar).
- Advanced signal processing techniques, including band-pass filtering, envelope detection, and peak analysis.
- Easily customizable gesture-to-key mappings.
- Connect the Bioamp EXG Pill to the Arduino to capture analog signals corresponding to different muscle movements and finger gestures.
- Upload the provided Arduino sketch to enable communication between the Arduino and the computer.
- EMG signals are filtered using a band-pass filter to remove noise.
- Filtered signals are then enveloped to further reduce noise.
- Envelopes are parameterized and muscle contractions are detected with high certainty.
- Processed EMG signals are analyzed to recognize specific gestures, which are then mapped to keyboard inputs.
| Gesture | Keyboard Key |
|---|---|
| Left Fist Clenching | Left Input |
| Right Fist Clenching | Right Input |
-
Detecting Highs and Lows in Envelope Peaks
- Fine-tuned filter parameters and adjusted peak detection thresholds.
-
Hardware Misconfigurations
- Corrected Arduino pin connections and verified channel assignments (e.g., wrong channel initially used).
-
Asynchronous Channel Processing
- Optimized the script to handle all five EMG channels efficiently.
-
Processing Delays
- Reduced signal processing runtime for near-instantaneous feedback.
-
Initial Signal Spikes
- Ignored early noise to avoid false positives during system initialization.
-
Muscle Contraction Detection
- Achieved real-time responsiveness by improving the detection algorithm.
serial: Communicates with the Arduino for real-time data acquisition.time: Handles time-based sampling and delays.matplotlib: Visualizes raw, filtered, and processed EMG data.numpy: Performs numerical computations and array manipulations.asyncio: Supports asynchronous signal processing tasks.scipy: Provides filtering and peak detection tools.
- Standard C libraries for serial communication.