Skip to the content
2 layers115 × 94 mmECE445L Lab7, the printed circuit board in 3D

Inspired by the game Just Dance, a DIY Embedded System to classify user gestures and simulate 2-player gameplay

Size
115 × 94 mm
Copper layers
2
Thickness
1.6 mm
Parts
18
Nets
77
Pads
100
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 9.0 (file 20241229)
Created
10 Oct 2026
Updated
10 Oct 2026

Overview

ECE445L Lab7 is an open-source printed circuit board by andyMath7745, from the andyMath7745/JustDance-TinyML-Embedded repository on GitHub. It is a 2-layer board of 115 × 94 mm with 18 parts on 77 nets.

It is built around the EK-TM4C123GXL and IRLD024PBF. Its parts include 5 switches, 3 ICs, 2 capacitors, 1 resistor and 1 diode. It belongs with the ESP8266 boards of this library.

Main components

2

README

README.md

TinyML Embedded Gesture Classifier

I built this project as a real-time embedded gesture-recognition system with a custom PCB using TM4C123 microcontrollers, LSM6DSOX IMUs, ESP8266 wireless communication, and fixed-point TinyML inference.

Custom PCB and handheld controller modules used in the embedded gesture classification system

The system captures motion from handheld controller modules, segments raw IMU data into meaningful gesture windows, extracts engineered features, runs lightweight classifiers directly on-device, and streams results to a central hub and host display. The full pipeline runs on embedded hardware rather than relying on a PC for inference.


Overview

My goal with this project was to design a complete embedded system capable of classifying human motion under tight hardware constraints.

Each controller:

  • samples a 6-axis IMU in real time
  • performs filtering and calibration
  • segments motion into gesture windows
  • extracts a compact feature vector
  • classifies gestures using rule-based logic and TinyML models

A central hub coordinates timing, aggregates controller outputs over ESP8266, and forwards results to a PC over UART for visualization.


Key Features

  • Real-time gesture classification on TM4C123 microcontrollers
  • LSM6DSOX accelerometer/gyroscope integration over I2C
  • Deterministic scheduling using a free-running hardware timer
  • Fixed 5-second calibration stage for bias stabilization
  • Tunable motion segmentation engine
  • 32-feature embedded feature extraction pipeline
  • Fixed-point TinyML inference (no floating point at runtime)
  • Hybrid detection: neural networks + rule-based scoring
  • ESP8266 wireless communication between modules
  • UART protocol for structured output (SEG and DETECT)
  • EEPROM-backed configuration persistence
  • Multi-module embedded architecture (controllers + hub + host)

System Architecture

text
Controller Modules (TM4C + IMU)
    ↓
Sensor processing + segmentation
    ↓
Feature extraction (32 features)
    ↓
TinyML / rule-based classification
    ↓
ESP8266 wireless messages
    ↓
Central Hub (TM4C)
    ↓
UART output
    ↓
Host PC (Python visualization/logging)

A key design decision I made was to keep all classification on the embedded controllers. The PC is only used for visualization and logging, not inference.


Repository Structure

text
sw/
  sw_Player1_Controller/   → Controller firmware
  sw_Player2_Controller/   → Second controller firmware
  sw_Audio/                → Central hub firmware
  sw_Display/              → Python host interface

hw/                        → KiCad hardware design files
Resources/                 → Datasheets and references

Main Entry Points

  • sw_Player1_Controller/src/Lab1.c
  • sw_Player2_Controller/sw/src/Lab1.c
  • sw_Audio/sw/src_latest/Lab5.c

Embedded Gesture Pipeline

Each controller runs a full embedded ML pipeline:

text
IMU read
→ axis remap
→ filtering
→ calibration
→ segmentation
→ feature extraction
→ classification
→ output

IMU Processing

I read accelerometer and gyroscope data over I2C and remap axes into a consistent real-world coordinate system:

text
IRL X = sensor Y  
IRL Y = sensor Z  
IRL Z = sensor X  

Calibration

At startup, I run a strict 5000 ms calibration phase using timer-based scheduling. This avoids drift and ensures stable baseline values for bias and gravity compensation.


Real-Time Scheduling

I use Timer0A as a free-running hardware timer and schedule all sampling relative to time instead of loop delays. This keeps behavior deterministic even with UART output or I2C latency.


Motion Segmentation

I designed a segmentation engine that detects meaningful motion using:

  • energy thresholds
  • quiet-window detection
  • min/max segment sizes
  • cooldown timing

Each gesture can override segmentation parameters, which makes the system flexible across very different motion types.


Feature Extraction

For each segment, I compute 32 engineered features describing motion shape and intensity.

Examples include:

  • duration and sample count
  • vertical displacement and total travel
  • cross-body movement
  • oscillation and slope changes
  • total acceleration and gyro energy
  • peak timing and normalized feature ratios
  • spin characteristics
  • energy per sample

Instead of feeding raw time-series data into a large model, I compress each gesture into a compact feature vector to stay within embedded constraints.


TinyML Inference

I implemented small neural networks directly in firmware using fixed-point math.

Typical structure:

text
16 inputs → 3 hidden (ReLU) → 1 output

All weights, biases, and normalization parameters are stored as scaled integers. This avoids floating-point overhead and keeps inference fast and deterministic.

Some gestures use ML models, while others use rule-based scoring depending on how well they can be defined analytically.


Output Protocol

The system outputs structured UART messages:

Feature Data

text
SEG,<MOVE>,<32 values>

Final Detection

text
DETECT,<MOVE>,<score>

I use SEG for debugging/training and DETECT as the final classification output.


Cumulative Scoring

Instead of classifying every segment independently, I accumulate scores across a gesture window and only output a final detection after enough evidence is collected.

This significantly reduces noise and false positives.


Central Hub

The hub is another TM4C system that:

  • synchronizes controller start timing
  • receives wireless data from controllers
  • forwards results over UART
  • manages timing-sensitive coordination

Host Interface

I wrote a Python interface using:

  • pyserial for communication
  • tkinter for UI
  • opencv / Pillow for visualization

This layer is purely for monitoring—the embedded system performs all classification.


Hardware

This system is built on:

  • TM4C123 microcontrollers
  • LSM6DSOX IMUs
  • ESP8266 modules
  • DAC/audio hardware (hub side)
  • custom KiCad-designed boards
  • custom designed and 3D-printed controller housing

All hardware files are included in the hw/ directory.


Why This Project Matters

This project combines:

  • real-time embedded systems
  • IMU signal processing
  • motion segmentation
  • feature engineering
  • TinyML on constrained hardware
  • wireless embedded communication

The most important aspect is that the entire ML pipeline runs on-device, making it a true embedded TinyML system rather than a PC-based demo.


Future Improvements

  • Modularize controller firmware
  • Formalize ML training/export pipeline
  • Add evaluation metrics (accuracy, confusion matrix)
  • Improve host visualization tools
  • Add hardware/system diagrams

Status

This is a working embedded system prototype with real-time gesture classification, multi-device coordination, and on-device ML inference. The core pipeline is fully implemented and functional on embedded hardware.

Parts

18
QtyValueFootprintReferences
4~ECE445L:MountingHole_4_40H1, H2, H3, H4
1100nFECE445L:C_Axial_200milC1
110kECE445L:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR1
11N914Diode_THT:D_5W_P12.70mm_HorizontalD1
14.7uFECE445L:CP_Radial_Tantal200milC2
1Adafruit ST7735RECE445L:adafruit_st7735r2U2
1DOWNECE445L:SW_PUSH_6mmSW2
1EK-TM4C123GXLECE445L:ti_EKTM4C123GXLU1
1ESP8266-01/ESP-01ECE445L:ESP8266_FemaleConnectorU3
1IRLD024PBFECE445L:DIP920W60P254L490H457Q4NQ1
1LEFTECE445L:SW_PUSH_6mmSW3
1MODEECE445L:SW_PUSH_6mmSW5
1RIGHTECE445L:SW_PUSH_6mmSW4
1SpeakerECE445L:PinHeader_1x02_P2.54mm_VerticalLS1
1UPECE445L:SW_PUSH_6mmSW1

More from andyMath7745/JustDance-TinyML-Embedded

1
  • 2 layers128.3 × 129.5 mmECE445L RSLK V2, the printed circuit board in 3D

    ECE445L RSLK V2

    andyMath7745/JustDance-TinyML-Embedded

    Inspired by the game Just Dance, a DIY Embedded System to classify user gestures and simulate 2-player gameplay

    71 parts

Similar boards

  • 2 layers126 × 97.2 mmECE445L Starter, the printed circuit board in 3D

    ECE445L Starter

    samienr/ECE445L-final

    Public copy of our Embedded Systems Design Lab final project

    39 parts
  • 2 layers115 × 94 mmECE445L Lab7, the printed circuit board in 3D

    ECE445L Lab7

    Andres-Wearden/Lab10

    The typical explanation for the repo structure. Lab specific instructions can be found further below.

    18 parts
  • 2 layers115 × 94 mmECE445L Starter, the printed circuit board in 3D

    ECE445L Starter

    AndrewYin04/VR-Goggles-Embedded-Lab

    The typical explanation for the repo structure. Lab specific instructions can be found further below.

    20 parts
  • 2 layers115 × 94 mmBaseline project, the printed circuit board in 3D

    Baseline project

    K0-p/Garfield-Wheel

    HID-compliant game controller with embedded button mapping firmware and gyroscope controls

    17 parts
  • 2 layers71.1 × 54.6 mmHawkeye driver, the printed circuit board in 3D

    Hawkeye driver

    evanmayer/hotspot

    Code for driving a cable-driven parallel robot for mapping beams on surfaces.

    30 parts2MIT
  • 2 layers114.4 × 88.9 mmECE445L Lab7, the printed circuit board in 3D

    ECE445L Lab7

    aidanaalund/ece-445l-final-project

    My final mechatronics project from the Spring 2025 Embedded Systems Design Lab course. Taught by Dr. Jonathan Valvano. Team was Aidan Aalund, Alexa Aguilar Izquierdo, Paul Schnoebelen, Eric Zang, and Brian Ahn.

    56 parts
  • 2 layers115 × 94 mmECE445L Lab7, the printed circuit board in 3D

    ECE445L Lab7

    tanai-prathapam/lab8_445L_personal

    The hw folder should contain your schematic and board files for your PCB or circuits. In later labs, you will be creating schematics for your circuit in EAGLE. A setup tutorial can be found here.

    38 parts

Questions

How big is the ECE445L Lab7 PCB?

It measures 115 × 94 mm and has 2 copper layers, 1.6 mm thick.

What parts does the ECE445L Lab7 use?

18 parts, built around the EK-TM4C123GXL and IRLD024PBF. 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 ECE445L Lab7 KiCad files?

From the andyMath7745/JustDance-TinyML-Embedded repository on GitHub, at the commit this page was made from: the board is hw/ECE445L_Lab7/ECE445L_Lab7.kicad_pcb and its schematic hw/ECE319K_Starter/ECE319K_Starter.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the ECE445L Lab7 design in my own project?

Its repository states no licence, so its author keeps all rights: ask andyMath7745 before reusing the design.