
EMG
JuanIDK201/emg-deeplearning-bci-controller
Biomedical EMG/ECG Acquisition Circuit, Keras Deep Learning Classifier, and Wireless Robotic Actuation

Biomedical EMG/ECG Acquisition Circuit, Keras Deep Learning Classifier, and Wireless Robotic Actuation
ECG is an open-source printed circuit board by JuanIDK201, from the JuanIDK201/emg-deeplearning-bci-controller repository on GitHub, published under the MIT licence. It is a 2-layer board with 23 parts on 20 nets, routed with 155 tracks and 0 vias.
It is built around the TL084. Its parts include 9 resistors, 6 capacitors, 3 ICs, 2 connectors and 1 transistor.
EMG Deep Learning BCI Controller is an end-to-end biomedical engineering and Human-Machine Interface (HMI / BCI) system. It acquires biological biopotential signals (Electromyography - EMG and Electrocardiography - ECG), processes and extracts spectral harmonic features, performs real-time neural network classification using TensorFlow / Keras, and wirelessly triggers robotic actuators and mobile vehicles.
The system encompasses custom analog hardware design in KiCad (instrumentation amplification, bandpass filtering, 60 Hz notch filtering, and envelope detection), ESP32 firmware streaming digitized ADC data via WebSockets and Zeroconf (mDNS), and a sleek CustomTkinter dark-mode operator console.
graph TD
A["Surface Electrodes (Ag/AgCl)"] --> B["Analog Front-End PCB (INA + Active Filters + Notch 60Hz + Envelope)"]
B --> C["ESP32 Dual-Channel ADC (12-bit, DMA/ISR Sampling)"]
C -->|"WebSockets / mDNS Zeroconf (_esp32emgdual._tcp.local)"| D["Python Desktop Host (CustomTkinter)"]
D --> E["Feature Extraction (FFT Fundamental + H2/H3/H4 Harmonics + Envelope)"]
E --> F["TensorFlow / Keras Neural Network (.keras Model)"]
F -->|"Class: Inactive / Forearm Active / Gastrocnemius Active"| G{"Intention Decision Engine"}
G -->|"Actuation Packets over Wi-Fi"| H["ESP32 Motor Driver Node / Robotic Car"]
D --> I["Real-time Signal Visualization & CSV Data Logger"]modelo_emg.keras, modelo_emg_con_pin.keras) classifying muscle activation states in 50 ms sliding inference windows.ESP32-Carrito).| Component | Technologies |
|---|---|
| AI & Software | Python 3.9+, TensorFlow 2.x, Keras, CustomTkinter, NumPy, Pandas, SciPy, Zeroconf, WebSocket-Client |
| Firmware & IoT | ESP32, Arduino C++, FreeRTOS, WebSockets Server, mDNS |
| Electronics (EDA) | KiCad (EMG/ECG Schematic & 2-Layer PCB Layout, Gerber exports) |
emg-deeplearning-bci-controller/
src/
gui/ # Desktop interfaces
emg_controller_motor_app.py # Main CustomTkinter UI + TF inference + motor control
emg_gui_app.py # Standalone monitoring GUI
emg_gui_con_pines.py # Pin-specific acquisition GUI
deep_learning/ # Neural network models and inference
inference_keras_model.py
threshold_classifier.py
modelo_emg.keras
modelo_emg_con_pin.keras
signal_processing/ # Data logging and exploration
emg_signal_logger.py
emg_data_exploration.ipynb
firmware/
esp32_emg_acquisition/ # ESP32 EMG sampling firmware (Single/Dual channel)
esp32_robotic_car/ # ESP32 motor receiver firmware
hardware/
kicad_emg/ # Complete KiCad project for EMG analog front-end
kicad_ecg/ # Complete KiCad project for ECG front-end
schematics/ # PDF electrical schematics (V2.pdf)
docs/ # Lab presentation and biomedical documentation
requirements.txt
.gitignore
LICENSE
README.mdgit clone https://github.com/JuanIDK201/emg-deeplearning-bci-controller.git
cd emg-deeplearning-bci-controller
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txtpython src/gui/emg_controller_motor_app.pyJuan Garzón
Biomedical & Embedded Systems Engineer
This project is licensed under the MIT License - see the LICENSE file for details.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 9 | R | Resistor_THT:R_Axial_DIN0411_L9.9mm_D3.6mm_P20.32mm_Horizontal | R1, R2, R3, R4, R5, R6, R7, R8, R9 |
| 4 | C_Small | Capacitor_THT:C_Disc_D4.3mm_W1.9mm_P5.00mm | C2, C3, C4, C6 |
| 2 | C_Polarized | Capacitor_THT:CP_Radial_D8.0mm_P3.50mm | C1, C5 |
| 1 | 2N3904 | Package_TO_SOT_THT:TO-92_Inline | Q1 |
| 1 | AD620 | Package_DIP:DIP-8_W7.62mm_LongPads | U2 |
| 1 | AudioJack3 | Connector_Audio:Jack_3.5mm_CUI_SJ1-3513N_Horizontal | J1 |
| 1 | Buzzer | Buzzer_Beeper:Buzzer_12x9.5RM7.6 | BZ1 |
| 1 | LM7805_TO220 | Package_TO_SOT_THT:TO-220-3_Vertical | U5 |
| 1 | R_Potentiometer | Potentiometer_THT:Potentiometer_Bourns_3296W_Vertical | RV1 |
| 1 | Screw_Terminal_01x03 | TerminalBlock:TerminalBlock_Altech_AK300-3_P5.00mm | J2 |
| 1 | TL084 | Package_DIP:DIP-14_W7.62mm | U4 |

JuanIDK201/emg-deeplearning-bci-controller
Biomedical EMG/ECG Acquisition Circuit, Keras Deep Learning Classifier, and Wireless Robotic Actuation

BojanSof/BluePillWaveGen
DDS function generator build around STM32 BluePill board




m0xpd/EUCLIDplus
EUCLID+ is a Clock Divider, Oscillator and Rhythm Sequencer for electronic music applications



sintech/AgatSpeechBoard
КР1803ВЖ1 (TMS5100) based speech synthesizer for Agat computer
23 parts, built around the TL084. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the JuanIDK201/emg-deeplearning-bci-controller repository on GitHub, at the commit this page was made from: the board is hardware/kicad_ecg/ECG.kicad_pcb and its schematic hardware/kicad_ecg/ECG.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).