A complete Electromyography (EMG) acquisition and monitoring system featuring custom hardware design, high-speed signal conditioning, microcontroller firmware, and real-time visualization tools.
This project provides an end-to-end solution for capturing and analyzing EMG signals. It includes:
- Analog Front-End: A custom PCB designed with INA333 instrumentation amplifiers and LMP770x op-amps for precise signal conditioning.
- High-Speed Acquisition: An Adafruit M0 (SAMD21) microcontroller sampling at 25 kSPS (40µs interval).
- Wireless Transmission: Real-time data streaming via UDP over WiFi.
- Software Suite: A Python-based PC application for real-time visualization, digital filtering (Notch, Bandpass), and data recording.
e:\Projects\EMG-Capture-and-Visualization\
├── 01 Simulations/ # Circuit simulations and Python signal processing demos
│ ├── LT Spice/ # LTSpice models (INA333, etc.) and behavioral simulations
│ └── Dataset/ # Test datasets
├── 02 Hardware/ # Hardware design files
│ └── PCB/ # Altium Designer Schematics (.SchDoc) and PCB Layouts (.PcbDoc)
├── 03 firmware/ # Microcontroller code and PC software
│ ├── adafruitM0/ # Arduino sketch for the Adafruit M0 Feather
│ └── Python/ # Real-time visualization application (PyQt6)
│ ├── app.py # Main GUI Application
│ └── EMG_game.py # Flappy Bird Game
├── 04 3D Design/ # 3D models for enclosures and mechanical parts
└── 05 media/ # Project images and demos
- Precision Amplification: Uses INA333 for low-noise instrumentation amplification.
- Signal Conditioning: Analog filtering and gain stages tailored for EMG signals.
- Custom PCB: Professionally designed using Altium Designer.
- Wearable Design:
Left: Final PCB Design | Right: Device attached to arm for data capture
- High Sampling Rate: Optimized ADC register settings for 25kHz sampling.
- Efficient Transmission: Packs 256 samples into binary UDP packets for low-latency wireless streaming.
- Differential Reading: Performs on-chip differential ADC readings (A1 - A2).
The system includes a powerful Python-based GUI (app.py) for real-time analysis.
- Real-Time Oscilloscope: Smooth visualization using
PyQtGraphandPyQt6. - Digital Signal Processing:
- Notch Filter: Removes 50Hz/100Hz/150Hz mains hum.
- Bandpass Filter: Configurable Butterworth filter (e.g., 25Hz - 150Hz).
- Data Recording: Save captured sessions to CSV for offline analysis.
Real-time EMG data visualization in the GUI
To demonstrate Human-Computer Interaction (HCI) capabilities, the project includes a game controlled by muscle activity (EMG_game.py).
- Control Scheme: Muscle contractions (EMG signal crossing a threshold) trigger the bird to jump.
- Visual Feedback: Real-time EMG signal envelope is displayed at the bottom of the game window.
- Engaging Interaction: A fun and interactive way to visualize bio-potential signals and their control applications.
Flappy Bird game controlled by EMG signals
Check out the system in action:
demo.mp4
- Hardware: Assembled PCB, Adafruit M0 Feather (WiFi).
- Software: Python 3.x, Arduino IDE.
- Open
03 firmware/adafruitM0/adafruitM0.inoin Arduino IDE. - Install the WiFi101 library.
- Update the
ssid,pass, andremoteIp(your PC's IP address) in the code. - Upload to the Adafruit M0 board.
Install the required Python libraries:
pip install numpy scipy pyqt6 pyqtgraph pygameNavigate to the Python directory and run the application:
cd "03 firmware/Python"
python app.py- Enter the Port (default: 8888).
- Click CONNECT to start streaming.
- Use the checkboxes to enable Mains Hum removal or Bandpass filtering.
- Click START CAPTURE to record data to a CSV file.
To try the game demo:
cd "03 firmware/Python"
python EMG_game.py- Flex your muscle to make the bird jump!
- Adjust gain with Up/Down arrow keys if needed.
The 01 Simulations folder contains:
- LTSpice: Run
INA_behavioral.ascto simulate the analog front-end behavior. - Python Demo: Run
GUI.pyin01 Simulations/LT Spice/to see a simulation of noise addition and filtering on pre-recorded data.
This project is licensed under the MIT License - see the LICENSE file for details.

