Skip to the content
2 layersECG, the printed circuit board in 3D

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

Copper layers
2
Thickness
1.6 mm
Parts
23
Nets
20
Pads
69
Tracks, vias
155, 0
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
31 Aug 2026
Updated
1 Sep 2026

Overview

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.

Main components

1

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

23
QtyValueFootprintReferences
9RResistor_THT:R_Axial_DIN0411_L9.9mm_D3.6mm_P20.32mm_HorizontalR1, R2, R3, R4, R5, R6, R7, R8, R9
4C_SmallCapacitor_THT:C_Disc_D4.3mm_W1.9mm_P5.00mmC2, C3, C4, C6
2C_PolarizedCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC1, C5
12N3904Package_TO_SOT_THT:TO-92_InlineQ1
1AD620Package_DIP:DIP-8_W7.62mm_LongPadsU2
1AudioJack3Connector_Audio:Jack_3.5mm_CUI_SJ1-3513N_HorizontalJ1
1BuzzerBuzzer_Beeper:Buzzer_12x9.5RM7.6BZ1
1LM7805_TO220Package_TO_SOT_THT:TO-220-3_VerticalU5
1R_PotentiometerPotentiometer_THT:Potentiometer_Bourns_3296W_VerticalRV1
1Screw_Terminal_01x03TerminalBlock:TerminalBlock_Altech_AK300-3_P5.00mmJ2
1TL084Package_DIP:DIP-14_W7.62mmU4

More from JuanIDK201/emg-deeplearning-bci-controller

1
  • 2 layers209.5 × 204.7 mmEMG, the printed circuit board in 3D

    EMG

    JuanIDK201/emg-deeplearning-bci-controller

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

    144 partsMIT

Similar boards

  • 2 layers97.7 × 58 mmBluepill function generator, the printed circuit board in 3D

    Bluepill function generator

    BojanSof/BluePillWaveGen

    DDS function generator build around STM32 BluePill board

    41 parts35
  • 2 layers61 × 61 mmStm32-rfid clone, the printed circuit board in 3D

    Stm32-rfid clone

    joeferner/stm32-rfid-clone

    STM32 RFID Reader / Writer

    112 parts16
  • 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 layers105 × 65 mmOsc 3340, the printed circuit board in 3D

    Osc 3340

    petegaggs/MIDI-to-CV

    arduino based MIDI to CV converter

    81 parts9MIT
  • 2 layers78 × 108 mmEuclid+ Main Board, the printed circuit board in 3D

    Euclid+ Main Board

    m0xpd/EUCLIDplus

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

    131 parts7CC-BY-SA-4.0
  • 2 layers450 × 160 mmSquale, the printed circuit board in 3D

    Squale

    jfdelnero/Apollo_7_Squale

    Apollo 7 Squale computer dev tools

    219 parts6
  • 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 layers99.1 × 66 mmAgatSpeechBoard, the printed circuit board in 3D

    AgatSpeechBoard

    sintech/AgatSpeechBoard

    КР1803ВЖ1 (TMS5100) based speech synthesizer for Agat computer

    31 parts5MIT

Questions

What parts does the ECG use?

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.

Where can I download the ECG 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_ecg/ECG.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 ECG 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).