Overview
An EMG-controlled prosthetic arm that classifies hand gestures in real time using TinyML models deployed on an ESP32. The full pipeline spans signal acquisition, dataset labeling, model training, and on-device inference, driving a custom 7-DOF 3D-printed arm.
The Problem
Reading intent from muscle activity is noisy and time-sensitive: the surface EMG signal is a faint, drifting waveform, and any usable control has to sample it cleanly, decide which gesture is happening, and actuate, all fast enough to feel responsive. Rather than stream raw signals to a laptop for inference, I built the whole loop, from sampling to classification, to run offline on the ESP32.
What I Did
Signal acquisition pipeline
DMA-driven non-blocking ADC sampling at 1 kHz runs alongside an asynchronous USB transfer task. Muscle-onset detection labels the signals, and datasets are stored in HDF5 for training.
TinyML gesture classification
Trained LDA and MLP models on EMG signal features with scikit-learn and TensorFlow, reaching 82% accuracy across 5 hand gestures. Both models are quantized and run offline on-device.
Custom 7-DOF arm
Built a 7-DOF arm with custom 3D-printed CAD shims to reduce servo stress, driving each joint from the classified gesture.
Modified servo feedback
Modified a bicep servo for continuous rotation by repurposing its internal potentiometer as an elbow-angle feedback sensor, enabling screw-driven actuation.
Demo
The complete loop: live sEMG classification driving the arm's actuation in real time.
Proportional control: bicep activation level drives the joint continuously, rather than switching between discrete classified gestures.
Walkthrough of the GUI for signal acquisition, gesture labeling, and model training.
The model classifying hand gestures live from the sEMG signal.
Range-of-motion test with the joints driven by manual button presses, not EMG yet.
Gallery



Results
- 82% accuracy across 5 hand gestures, with quantized models running fully offline on the ESP32.
- A complete pipeline from
1 kHzDMA signal acquisition through on-device TinyML inference to a custom 7-DOF actuated arm. - Honest limitation: accuracy holds for the trained gesture set and sensor placement; electrode drift and new users still require recalibration.
