Skip to content

Wearable HAR v2 — Documentation

Full-body wearable for classifying 11 construction worker activities in real time: standing/idle, walking, walking-carrying, climbing ladder, hammering, sawing, drilling, lifting, bending, crouching, and troweling.

This is a ground-up rewrite of the v1 prototype. Same hardware, same packet protocol, but with the bus-routing bug fixed, feature/model dimension mismatch resolved, missing training and dashboard pipelines implemented, and a full modular test suite (127 tests).

:material-cpu-64-bit: Hardware   |   :material-code-tags: Protocol   |   :material-flash: Flashing   |   :material-test-tube: Tests   |   :material-console: Simulation


Quick start

cd wearable_har_v2

# Install Python deps
uv venv .venv --python 3.12
uv pip install -r requirements.txt

# Run tests (no hardware needed)
.venv/bin/python -m pytest tests/ -q

# Build & flash firmware (see PlatformIO sections)
cd firmware/stm32f405 && pio run -t upload
cd firmware/kb2040       && pio run -t upload

# Train a model on synthetic data, export TorchScript
.venv/bin/python -m host.train_model --synthetic --epochs 10 --output models/model.pt

# Launch dashboard
.venv/bin/python -m streamlit run host/dashboard.py

Hardware at a glance

Part Qty Location
BNO055 9-DOF IMU 6 wrists, upper arms, chest, thigh
STM32F405 Feather Express 1 vest (primary MCU)
KB2040 (RP2040) 1 vest (co-processor)
MyoWare 2.0 Muscle Sensor 2 forearm flexor, lumbar erector
FSR 402 force sensor 4 heel/toe, both feet
Intel RealSense D435i 1 helmet (ground truth)
Adafruit BMP390 1 backordered (placeholder in packet)

Site map

  • Getting Started — hardware checklist, tools, wiring, flashing, and first data stream
  • Hardware — system architecture, sensor details, MCU layout
  • Firmware — module map, binary protocol, BMP390, debugging
  • Host — Python setup, recording, training, inference, dashboard
  • Testing — unit tests and per-sensor bring-up
  • Simulation — Wokwi projects for firmware testing without hardware