Embedded Machine Learning on ESP32 for Upper-Limb Exoskeletons Based on EMG
Downloads
Stroke remains one of the primary causes of long-term disability worldwide and frequently results in persistent impairment of upper limb motor function. To support more effective and intensive rehabilitation, there is a need for wearable devices that can interpret muscle activity and autonomously assist limb movement without relying on an external computer. This study aims to design and implement an upper-limb rehabilitation exoskeleton that is driven by electromyography (EMG) signal classification using machine learning and by real-time elbow angle monitoring, with all models deployed directly on an ESP32 microcontroller. The proposed exoskeleton is built from lightweight, ergonomic 3D-printed components and operates in both unilateral and bilateral modes. Its main contributions include: (1) embedding real-time EMG classification models on the ESP32 so that the device can function independently, (2) integrating EMG-based motor control with elbow angle feedback from an MPU6050 inertial measurement unit, and (3) incorporating a load cell to estimate biceps force during training. EMG signals from the forearm flexor muscles are processed to extract statistical features such as variance (VAR), waveform length (WL), integrated EMG (IEMG), and root mean square (RMS). These features are used to train Random Forest, Decision Tree, Support Vector Machine (SVM), and XGBoost classifiers. The trained models are converted to C code using the micromlgen library for execution on the ESP32. System evaluation involved thirty male participants aged 20–25 years with body weights between 50–85 kg. All tested models achieved 100% accuracy in distinguishing relaxed versus grasping muscle contractions, while the correlation of elbow angles between unilateral and bilateral ESP32 systems reached 0.9469, indicating highly consistent motion detection. The Decision Tree model was selected for deployment due to its superior memory efficiency on the microcontroller. These results demonstrate that the developed ESP32-based exoskeleton provides a practical, efficient, and easily integrable solution for wearable stroke rehabilitation
Copyright (c) 2025 Triwiyanto Triwiyanto, Anita Miftahul Maghfiroh, Levana Forra Wakidi, Syevana Dita Musvika (Author)

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution-ShareAlikel 4.0 International (CC BY-SA 4.0) that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).






