EMG Acquisition & Monitoring System
STM32 firmware and a Python GUI that turn raw forearm EMG into stable RMS/MAV features at a nominal 4 kHz.
- Role
- Firmware & GUI
- Platform
- STM32F411CEU6
- Sensor
- DFRobot SEN0240
- Stack
- C · Python / Tkinter

Problem
Our team built a rehabilitation-hand system for an undergraduate thesis. It needed a dependable way to acquire surface EMG (the electrical activity of muscles), turn it into stable features, and show the whole system's state to an operator.
My part was the EMG acquisition and signal-processing subsystem, plus the full monitoring interface. Aldin focused on the stimulator and Zain on fuzzy-control design.
Approach
Firmware processes ADC samples in half/full DMA buffers, filters them and computes RMS/MAV per window, then streams telemetry over UART. The Tkinter GUI parses the serial stream, plots EMG features, monitors status and logs to CSV. Coding agents assisted the implementation, and I reviewed and tested what they produced.
Build gallery
Results
The plots are from my thesis testing. Sampling rate and window size are firmware configuration. The GUI self-test checks the parser, safety logic and logger. It does not demonstrate clinical validity, rehabilitation effectiveness or full device safety.
Lessons
- Breaking a sensor-to-screen problem into acquisition, processing, transport and display made each part testable.
- Mains interference at 50 Hz is visible in the spectrum, so the notch filter earns its place.
- Program configuration and measured results are separate claims, and I keep them separate.
- AI assistance is useful when I read and check what it produces. I disclose it.