Skip to the content
PCBKitNew board
2 layers96.8 × 93.5 mmHar shield, the printed circuit board in 3D

bash # 1. 环境准备 git clone https://github.com/kkawo/har-project.git cd har-project pip install -r requirements.txt

Size
96.8 × 93.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
10
Nets
47
Pads
69
Tracks, vias
103, 13
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
15 Jun 2026
Updated
26 Jun 2026

Overview

Har shield is an open-source printed circuit board by kkawo, from the kkawo/har-project repository on GitHub. It is a 2-layer board of 96.8 × 93.5 mm with 10 parts on 47 nets, routed with 103 tracks and 13 vias.

Its parts include 4 connectors, 3 resistors, 2 capacitors and 1 diode.

README

README.md

HAR Project — 可穿戴人体活动识别系统

基于惯性/磁传感器的人体活动模式识别系统设计与实现。

福建理工大学 智能科学与技术 | 《模式识别与统计学习》专周实训
孔子瑜(算法与工程)、李宝平(数据采集与固件) | 导师:郑积仕


项目概述

从 PCB 设计→传感器标定→数据采集→特征工程→分类器对比→严格评估的 全链路 HAR 工程实践。

硬件: ESP32-S3 + MPU6050 (Acc+Gyro) + HMC5883L (Mag) → 9通道 @50Hz
活动: 7类(静坐/站立/步行/跑步/上楼/下楼/跌倒)
数据: 2被试, 566滑动窗口 (2.56s, 50%重叠)
特征: 292维(时域14+频域10/轴, 模长, 跨轴复合)
模型: 13种分类器 LOSO 系统对比
最佳: kNN (k=3,distance) + 多数表决 L=7 → Accuracy 59.5%


项目结构

text
har-project/
├── src/                    # 算法源码 (3,681行 Python)
│   ├── utils.py            #    常量与路径配置
│   ├── preprocess.py       # D3 信号预处理与窗口化
│   ├── features.py         # D4 294维特征提取
│   ├── feature_selection.py # D5 特征选择与降维
│   ├── classifiers_baseline.py # D6 基线分类器
│   ├── models_advanced.py  # D7 高级模型与调参
│   ├── evaluation.py       # D8 模型评估
│   └── d9_advanced_exploration.py # D9 进阶探索
├── data/                   # 数据资产
│   ├── raw/real/S01-S02/   # 真实数据 (14 CSV, 566窗口)
│   ├── windowed/           # 窗口化数据集
│   └── features/           # 特征矩阵
├── calib/                  # 传感器标定参数
├── firmware/               # ESP32 MicroPython 固件
├── pcb/                    # KiCad PCB 设计文件
├── reports/                # 报告与图表 (19+ PNG)
├── docs/                   # 项目文档
├── 10.D1-10.D9/            # 各阶段交付物
├── 项目深度说明.md          # 完整项目手册
└── HANDOVER.md             # 交接文档

核心结果

模型性能排名 (LOSO)

排名模型AccuracyMacro F1
1kNN (k=3,distance) + MV L=70.5950.569
2kNN (k=3,distance)0.5640.527
3HMM Viterbi0.5830.550
4LogisticRegression0.5250.490
5MLP (128,64)0.5070.472
6RBF_SVM0.4720.430
7RandomForest0.4240.386

各类别 Recall

类别Recall主要问题
walk1.000—
upstairs0.935↔ downstairs
stand0.674↔ sit
run0.565↔ walk, upstairs
fall0.500↔ run
downstairs0.446↔ upstairs
sit0.000↔ stand (跨被试特征偏移)

统计检验

  • McNemar: kNN vs RBF_SVM p < 0.0001 (显著)
  • Bootstrap 95% CI: [0.512, 0.594]
  • 聚类: KMeans+PCA ARI=0.364, NMI=0.516

一键复现

bash
# 1. 环境准备
git clone https://github.com/kkawo/har-project.git
cd har-project
pip install -r requirements.txt

# 2. 确认真实数据就绪
ls data/raw/real/S01/   # 应有 7 个 CSV
ls data/raw/real/S02/   # 应有 7 个 CSV

# 3. 全链路运行 (约5分钟)
python src/preprocess.py && \
python src/features.py && \
python src/feature_selection.py && \
python src/classifiers_baseline.py && \
python src/models_advanced.py && \
python src/evaluation.py && \
python src/d9_advanced_exploration.py

# 4. 生成答辩PPT
python src/d10_generate_ppt.py

# 5. 查看结果
ls reports/d9_*.png                    # D9 进阶探索图表
ls reports/d8_*.png                    # D8 评估图表
cat reports/d9_exploration_summary.json # 数值结果

技术栈

  • Python ≥ 3.10 | NumPy, SciPy, Pandas
  • scikit-learn ≥ 1.3 | Matplotlib, seaborn
  • hmmlearn ≥ 0.3.0 | TensorFlow ≥ 2.13
  • KiCad (PCB) | MicroPython (ESP32固件)

关键文档

文档说明
项目深度说明完整的项目手册,包含架构、数据流、决策、结果
HANDOVER新会话接手检查清单
项目状态当前进度与 Open Issues
答辩问答库25+ 答辩常见问题与答案
最终报告课程论文 (5000+字)
AI使用记录AI 协作开发记录

团队

角色成员
数据采集与固件李宝平
算法与工程孔子瑜

参考文献

  1. 张学工.《模式识别》(第四版). 清华大学出版社
  2. 李航.《统计学习方法》(第二版). 清华大学出版社
  3. Bulling, A., et al. "A Tutorial on Human Activity Recognition Using Body-worn Inertial Sensors." ACM Computing Surveys, 2014.
  4. Anguita, D., et al. "A Public Domain Dataset for Human Activity Recognition Using Smartphones." ESANN, 2013.

Parts

10
QtyValueFootprintReferences
2Conn_01x22Connector_PinHeader_2.54mm:PinHeader_1x22_P2.54mm_VerticalJ1, J2
1100nFCapacitor_SMD:C_0805_2012MetricC2
1220Resistor_SMD:R_0805_2012MetricR3
14.7kResistor_SMD:R_0805_2012MetricR2
1CCapacitor_SMD:C_0805_2012MetricC1
1Conn_01x05Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_VerticalJ104
1Conn_01x08Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalJ103
1LEDLED_SMD:LED_0805_2012MetricD1
1RResistor_SMD:R_0805_2012MetricR1

Questions

How big is the Har shield PCB?

It measures 96.8 × 93.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Har shield use?

10 parts. 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 Har shield KiCad files?

From the kkawo/har-project repository on GitHub, at the commit this page was made from: the board is pcb/har-shield/har-shield.kicad_pcb and its schematic 10.D1/har-shield.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Har shield design in my own project?

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

Similar boards

  • 2 layers57 × 55.2 mmLogicAnalyzer, the printed circuit board in 3D

    LogicAnalyzer

    gusmanb/logicanalyzer

    24 channel, 100Msps logic analyzer hardware and software

    10 parts5.1kGPL-3.0
  • 2 layers32.2 × 15.4 mmProtector, the printed circuit board in 3D

    Protector

    byrantech/laptop

    anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

    10 parts4.3kMIT
  • 2 layers26 × 18 mmConn, the printed circuit board in 3D

    Conn

    yaqwsx/KiKit

    Automation tools for KiCAD

    10 parts2.1kMIT
  • 2 layers44.3 × 30.5 mmLime2-SATA RevA, the printed circuit board in 3D

    Lime2-SATA RevA

    OLIMEX/OLINUXINO

    OLINUXINO is Open Source / Open Hardware, low cost from EUR 24 Linux Industrial grade Single Board Computer capable to operate -25+85C

    10 parts1.5k
  • 2 layers17.8 × 43.2 mmNano Adapter, the printed circuit board in 3D

    Nano Adapter

    VoronDesign/Voron-Hardware

    Cool Hardware designed by the Voron Design group

    10 parts1.1kGPL-3.0
  • 2 layers53.9 × 23.2 mmBuffer, the printed circuit board in 3D

    Buffer

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    10 parts1kGPL-3.0