Skip to the content
2 layers209.5 × 204.7 mmEMG, the printed circuit board in 3D

Biomedical EMG/ECG Acquisition Circuit, Keras Deep Learning Classifier, and Wireless Robotic Actuation

Size
209.5 × 204.7 mm
Copper layers
2
Thickness
1.6 mm
Parts
144
Nets
31
Pads
376
Tracks, vias
1,088, 0
Pours
4
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
31 Aug 2026
Updated
1 Sep 2026

Overview

EMG 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 of 209.5 × 204.7 mm with 144 parts on 31 nets, routed with 1,088 tracks and 0 vias.

It is built around the TL082 and TL084. Its parts include 48 resistors, 24 capacitors, 12 ICs, 8 diodes and 8 connectors.

Main components

2

README

README.md

EMG Deep Learning BCI Controller

Biomedical EMG/ECG Acquisition Circuit, Keras Deep Learning Classifier, and Wireless Robotic Actuation

Python TensorFlow Keras CustomTkinter ESP32 KiCad License: MIT


Overview

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.

mermaid
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"]

Key Features

  • Custom Biomedical Hardware (KiCad):
    • High CMRR instrumentation amplifier stage (INA128 / AD620 architecture).
    • Multi-stage active bandpass filter (20 Hz - 500 Hz EMG bandwidth) and 60 Hz twin-T notch filter.
    • Precision precision half-wave rectifier and low-pass envelope detector.
    • Separate dedicated PCB designs for EMG and ECG (Electrocardiography).
  • Embedded Telemetry & Network Discovery:
    • High-frequency dual-channel ADC sampling on ESP32.
    • Zero-configuration networking (mDNS Zeroconf) and low-latency WebSocket communication.
  • Deep Learning Classification (Keras / TensorFlow):
    • Feature extraction in both time domain (RMS, peak envelope) and frequency domain (FFT fundamental frequency, 2nd, 3rd, and 4th harmonic magnitudes).
    • Trained Deep Neural Network (modelo_emg.keras, modelo_emg_con_pin.keras) classifying muscle activation states in 50 ms sliding inference windows.
  • Modern Desktop UI & Robotic Control:
    • Dark-mode operator dashboard built with CustomTkinter.
    • Real-time voltage waveform plots, connection status monitor, and live prediction display.
    • Wireless control of differential mobile robot chassis (ESP32-Carrito).

Technology Stack

ComponentTechnologies
AI & SoftwarePython 3.9+, TensorFlow 2.x, Keras, CustomTkinter, NumPy, Pandas, SciPy, Zeroconf, WebSocket-Client
Firmware & IoTESP32, Arduino C++, FreeRTOS, WebSockets Server, mDNS
Electronics (EDA)KiCad (EMG/ECG Schematic & 2-Layer PCB Layout, Gerber exports)

Repository Structure

text
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.md

Installation & Usage

1. Setup Environment

bash
git 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.txt

2. Launching the EMG Controller & Motor Interface

bash
python src/gui/emg_controller_motor_app.py

Author

Juan Garzón
Biomedical & Embedded Systems Engineer


License

This project is licensed under the MIT License - see the LICENSE file for details.

Parts

144
QtyValueFootprintReferences
48R_SmallResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P15.24mm_HorizontalR1, R1, R1, R1, R10, R10, R10, R10, R11, R11, R11, R11, R12, R12, R12, R12 +32
24MountingHole_PadMountingHole:MountingHole_2.2mm_M2_DIN965_PadH1, H1, H1, H1, H2, H2, H2, H2, H3, H3, H3, H3, H4, H4, H4, H4 +8
16C_SmallCapacitor_THT:C_Axial_L5.1mm_D3.1mm_P7.50mm_HorizontalC1, C1, C1, C1, C2, C2, C2, C2, C3, C3, C3, C3, C4, C4, C4, C4
81N4148Diode_THT:D_DO-35_SOD27_P7.62mm_HorizontalD1, D1, D1, D1, D2, D2, D2, D2
8C_PolarizedCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC5, C5, C5, C5, C6, C6, C6, C6
8R_PotentiometerPotentiometer_THT:Potentiometer_Bourns_3296W_VerticalRV1, RV1, RV1, RV1, RV2, RV2, RV2, RV2
4AD620Package_DIP:DIP-8_W7.62mm_LongPadsU1, U1, U1, U1
4AudioJack3Connector_Audio:Jack_3.5mm_CUI_SJ1-3513N_HorizontalJ1, J1, J1, J1
4Jumper_2_BridgedTestPoint:TestPoint_2Pads_Pitch5.08mm_Drill1.3mmJP1, JP1, JP1, JP1
4Screw_Terminal_01x03TerminalBlock_Philmore:TerminalBlock_Philmore_TB133_1x03_P5.00mm_HorizontalJ2, J2, J2, J2
4TL082Package_DIP:DIP-8_W7.62mm_LongPadsU3, U3, U3, U3
4TL084Package_DIP:DIP-14_W7.62mm_Socket_LongPadsU2, U2, U2, U2
4TestPoint_2PoleTestPoint:TestPoint_2Pads_Pitch5.08mm_Drill1.3mmTP1, TP1, TP1, TP1
4TestPoint_2PoleTestPoint:TestPoint_Bridge_Pitch5.08mm_Drill0.7mmTP2, TP2, TP2, TP2

More from JuanIDK201/emg-deeplearning-bci-controller

1
  • 2 layersECG, the printed circuit board in 3D

    ECG

    JuanIDK201/emg-deeplearning-bci-controller

    Biomedical EMG/ECG Acquisition Circuit, Keras Deep Learning Classifier, and Wireless Robotic Actuation

    23 partsMIT

Similar boards

  • 2 layers94.5 × 55 mmAdsr 1, the printed circuit board in 3D

    Adsr 1

    hermflink/3310ADSR

    Dual ADSR based on AS3310

    54 parts11GPL-3.0
  • 2 layers36.6 × 77.4 mmLicht, the printed circuit board in 3D

    Licht

    microresearch/ERD-breath

    Divinatory smoke and fire based eurorack module.

    41 parts6
  • 2 layers89.4 × 66.9 mmAcondicionador, the printed circuit board in 3D

    Acondicionador

    fmirandabonomi/pcb_antena_vlf

    # Antena VLF, Laboratorio de Telecomunicaciones FACET UNT

    37 parts2
  • 2 layers117.1 × 84.6 mmAmpli, the printed circuit board in 3D

    Ampli

    fpp3/ElectronicaAplicada2

    66 parts
  • 2 layers29.5 × 31 mmChuaCircuit, the printed circuit board in 3D

    ChuaCircuit

    Jstn1321/C.H.A.S.E.R

    CHAotic Secure Encryption for Real-time audio

    31 parts
  • 2 layers59.9 × 57 mmPCB PFC, the printed circuit board in 3D

    PCB PFC

    lpires211002/CHIDORI_Proyecto_final_de_carrera

    Repositorio de Chidori, medidor de bioimpedancia como PFC.

    48 parts
  • 2 layersSegments, the printed circuit board in 3D

    Segments

    microresearch/allcolours

    all the colours of the noise

    219 parts16
  • 2 layers68.9 × 118.5 mmDz Mixer, the printed circuit board in 3D

    Dz Mixer

    dzavalishin/hardware

    Misc smart house hardware

    105 parts3

Questions

How big is the EMG PCB?

It measures 209.5 × 204.7 mm and has 2 copper layers, 1.6 mm thick.

What parts does the EMG use?

144 parts, built around the TL082 and 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.

Where can I download the EMG KiCad files?

From the JuanIDK201/emg-deeplearning-bci-controller repository on GitHub, at the commit this page was made from: the board is hardware/kicad_emg/EMG.kicad_pcb and its schematic hardware/kicad_ecg/ECG.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the EMG design in my own project?

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).