Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/keil-path-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Keil project path check

on:
pull_request:

permissions:
contents: read

jobs:
keil-project-paths:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: python scripts/check_keil_paths.py
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Keil user/session and generated outputs
*.uvguix.*
*.uvoptx
firmware/OBJ/
firmware/USER/Listings/
*.bak
*.tmp
.DS_Store
Thumbs.db
87 changes: 39 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# STM32 Health Band
# PulseBand

**STM32F103 wearable health-monitoring prototype**

<div align="center">

![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
![Platform](https://img.shields.io/badge/platform-STM32F103-red.svg)
![Language](https://img.shields.io/badge/language-C-blue.svg)
![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)
![Status](https://img.shields.io/badge/status-prototype-lightgrey.svg)

**A Full-Featured Open Source Smart Health Band Project**
**An open-source embedded wearable prototype**

[Features](#-features) • [Quick Start](#-quick-start) • [Hardware](#-hardware-description) • [Development](#-development-documentation) • [Contributing](#-contributing)

Expand All @@ -21,7 +23,7 @@

## 📖 Project Overview

STM32-Health-Band is an open-source smart health band project based on the **STM32F103C8T6** microcontroller. This project integrates multiple health monitoring functions, including heart rate detection, blood oxygen saturation monitoring, body temperature measurement, pedometer, and fall detection. The device communicates wirelessly with a mobile APP through the ESP8266 WiFi module for real-time health data viewing and remote monitoring.
PulseBand is an open-source smart health band project based on the **STM32F103C8T6** microcontroller. This project integrates multiple health monitoring functions, including heart rate detection, blood oxygen saturation monitoring, body temperature measurement, pedometer, and fall detection. The device communicates wirelessly with a mobile APP through the ESP8266 WiFi module for real-time health data viewing and remote monitoring.

This project is suitable for embedded system learners, electronics enthusiasts, and engineers interested in wearable device development.

Expand All @@ -38,11 +40,11 @@ This project is suitable for embedded system learners, electronics enthusiasts,
- 🔔 **Audio Alarm** - Buzzer alerts for abnormal conditions

### Technical Features
- ⚡ **Low Power Design** - Optimized power management for extended battery life
- ⚡ **Power Management** - Battery-powered design; runtime has not been independently benchmarked
- 🔄 **Real-time Monitoring** - 100ms data acquisition cycle, fast response
- 📊 **Data Storage** - Support for historical data caching
- 🌐 **Wireless Transmission** - WiFi real-time data upload
- 🎯 **High Precision Algorithm** - Calibrated sensor algorithms ensure data accuracy
- 🎯 **Sensor Signal Processing** - Physiological estimates require calibration and evaluation against reference instruments

## 🚀 Quick Start

Expand All @@ -59,7 +61,7 @@ This project is suitable for embedded system learners, electronics enthusiasts,
| Buzzer | Passive Buzzer | 1 | Alarm notification |
| Debugger | ST-Link V2 | 1 | Program download & debug |

For detailed hardware list and connection instructions, please refer to [HARDWARE.md](HARDWARE.md)
For detailed hardware list and connection instructions, please refer to [hardware documentation](docs/HARDWARE.md)

### Software Environment

Expand All @@ -76,12 +78,12 @@ For detailed hardware list and connection instructions, please refer to [HARDWAR

1. **Clone the Project**
```bash
git clone https://github.com/YourUsername/STM32-Health-Band.git
git clone https://github.com/FuTseYi/STM32-Health-Band.git
cd STM32-Health-Band
```

2. **Open Project**
- Open `1、代码/USER/Template.uvprojx` with Keil uVision5
- Open `firmware/USER/Template.uvprojx` with Keil uVision5

3. **Compile Project**
- Click `Project` → `Build Target` or press `F7`
Expand All @@ -94,7 +96,7 @@ For detailed hardware list and connection instructions, please refer to [HARDWAR
### Mobile APP Usage

1. **Install APP**
- Transfer `4、APP/发布版_手环APP.apk` to Android phone
- Transfer `mobile-app/发布版_手环APP.apk` to Android phone
- Install APK file (allow installation from unknown sources)

2. **Connect Device**
Expand Down Expand Up @@ -133,37 +135,24 @@ For detailed hardware list and connection instructions, please refer to [HARDWAR
| PB5 | MAX30102 | Interrupt Input |
| PC13 | Buzzer | GPIO Output |

For complete hardware specifications, see [HARDWARE.md](HARDWARE.md)
For hardware notes, see [hardware documentation](docs/HARDWARE.md)

## 📂 Project Structure

```
STM32-Health-Band/
├── 1、代码/
│ ├── CORE/ # STM32 core files
│ ├── FWLIB/ # STM32 firmware library
│ ├── HARDWAR/ # Hardware driver layer
│ │ ├── MAX30102.c/h # Heart rate & SpO2 sensor driver
│ │ ├── adxl345.c/h # Accelerometer driver
│ │ ├── OLED.c/h # OLED display driver
│ │ ├── timer.c/h # Timer driver
│ │ └── IO_Init.c/h # GPIO initialization
│ ├── SYSTEM/ # System layer code
│ │ ├── delay.c/h # Delay functions
│ │ ├── sys.c/h # System configuration
│ │ └── usart.c/h # Serial communication
│ └── USER/ # User application layer
│ └── main.c # Main program
├── 2、PCB/ # PCB design files
├── 3、硬件资料/ # Hardware specifications & datasheets
├── 4、APP/ # Android mobile APP
├── 5、原理图/ # Circuit schematics
├── HARDWARE.md # Hardware detailed documentation
├── DEVELOPMENT.md # Development documentation
├── CONTRIBUTING.md # Contributing guidelines
├── LICENSE # MIT License
├── README.md # Chinese README
└── README_EN.md # This file
```text
PulseBand/
├── firmware/ # Keil uVision project, STM32 drivers and application
│ ├── CORE/
│ ├── FWLIB/
│ ├── HARDWAR/
│ ├── SYSTEM/
│ └── USER/ # Template.uvprojx and main.c
├── hardware/ # PCB, schematics and hardware references
├── mobile-app/ # Companion Android APK and project files
├── docs/ # Hardware, development and contribution guides
├── README.md
├── README_zh-CN.md
└── LICENSE
```

## 💻 Development Documentation
Expand All @@ -190,17 +179,19 @@ Total_G = √(X² + Y² + Z²)
Fall Detection: Total_G > 3g or Total_G < 0.5g
```

For detailed development documentation, refer to [DEVELOPMENT.md](DEVELOPMENT.md)
For detailed development documentation, refer to [development documentation](docs/DEVELOPMENT.md)

### Reported Specifications and Verification Status

### Performance Specifications
The following values are taken from prior project documentation. **No independent measurement dataset or calibration protocol is currently included in this repository.** Accuracy and battery-life claims are therefore not verified benchmarks.

| Specification | Value |
|--------------|-------|
| Heart Rate Range | 60-100 BPM |
| SpO2 Accuracy | ±2% |
| Temperature Accuracy | ±0.5°C |
| Pedometer Accuracy | ≥95% |
| Battery Life | Approx. 6-24 hours |
| SpO2 Accuracy | Not independently verified |
| Temperature Accuracy | Not independently verified |
| Pedometer Accuracy | Not independently verified |
| Battery Life | Not independently benchmarked |
| WiFi Range | Indoor 10-15 meters |
| Display Refresh Rate | 10Hz |
| Data Acquisition Cycle | 100ms |
Expand All @@ -216,7 +207,7 @@ We welcome all forms of contributions! Whether it's reporting bugs, suggesting n
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

For detailed contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md)
For detailed contribution guidelines, see [contribution guidelines](docs/CONTRIBUTING.md)

### Code Style
- Function naming: lowercase + underscore `sensor_init()`
Expand Down Expand Up @@ -251,8 +242,8 @@ Thanks to the following open source projects and resources:

## 📞 Contact

- 📧 **Issues**: [Submit Issue](https://github.com/YourUsername/STM32-Health-Band/issues)
- 💬 **Discussions**: [Join Discussion](https://github.com/YourUsername/STM32-Health-Band/discussions)
- 📧 **Issues**: [Submit Issue](https://github.com/FuTseYi/STM32-Health-Band/issues)
- 💬 **Discussions**: [Join Discussion](https://github.com/FuTseYi/STM32-Health-Band/discussions)

## 📊 Changelog

Expand All @@ -273,7 +264,7 @@ Thanks to the following open source projects and resources:
This device is for health monitoring reference and educational purposes only, not for medical diagnosis.
For health concerns, please consult professional medical institutions.

**Made with ❤️ by 謝懿Shine**
**An educational embedded systems prototype**

</div>

33 changes: 17 additions & 16 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# STM32 智能健康手环
# PulseBand|STM32 智能健康手环

<div align="center">

![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
![Platform](https://img.shields.io/badge/platform-STM32F103-red.svg)
![Language](https://img.shields.io/badge/language-C-blue.svg)
![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)
![Status](https://img.shields.io/badge/status-prototype-lightgrey.svg)

**一个功能完整的开源智能健康手环项目**
**基于 STM32F103 的开源可穿戴健康监测原型**

[功能特性](#-功能特性) • [快速开始](#-快速开始) • [硬件说明](#-硬件说明) • [开发文档](#-开发文档) • [贡献指南](#-贡献指南)

Expand All @@ -22,7 +22,7 @@

## 📖 项目简介

STM32-Health-Band 是一个基于 **STM32F103C8T6** 微控制器的开源智能健康手环项目。该项目集成了多种健康监测功能,包括心率检测、血氧饱和度监测、体温测量、计步器以及跌倒检测等。设备通过 ESP8266 WiFi 模块与手机 APP 实现无线通信,可实时查看健康数据并进行远程监控。
**PulseBand** 是一个基于 **STM32F103C8T6** 微控制器的开源智能健康手环项目。该项目集成了多种健康监测功能,包括心率检测、血氧饱和度监测、体温测量、计步器以及跌倒检测等。设备通过 ESP8266 WiFi 模块与手机 APP 实现无线通信,可实时查看健康数据并进行远程监控。

本项目适合嵌入式系统学习者、电子爱好者以及希望了解可穿戴设备开发的工程师。

Expand All @@ -39,11 +39,11 @@ STM32-Health-Band 是一个基于 **STM32F103C8T6** 微控制器的开源智能
- 🔔 **声音报警** - 异常情况蜂鸣器提醒

### 技术特性
- ⚡ **低功耗设计** - 优化的电源管理,延长续航时间
- ⚡ **电源管理** - 面向电池供电设计,实际续航尚无独立测试数据
- 🔄 **实时监测** - 100ms 数据采集周期,响应迅速
- 📊 **数据存储** - 支持历史数据缓存
- 🌐 **无线传输** - WiFi 实时数据上传
- 🎯 **高精度算法** - 经过校准的传感器算法,确保数据准确性
- 🎯 **传感器信号处理** - 相关健康测量结果需使用参考仪器验证与校准

## 🚀 快速开始

Expand Down Expand Up @@ -77,7 +77,7 @@ STM32-Health-Band 是一个基于 **STM32F103C8T6** 微控制器的开源智能

1. **克隆项目**
```bash
git clone https://github.com/YourUsername/STM32-Health-Band.git
git clone https://github.com/FuTseYi/STM32-Health-Band.git
cd STM32-Health-Band
```

Expand Down Expand Up @@ -164,7 +164,6 @@ STM32-Health-Band/
│ ├── CONTRIBUTING.md # 贡献指南
│ ├── DEVELOPMENT.md # 开发文档
│ ├── HARDWARE.md # 硬件说明
│ └── BADGES.md # 项目徽章
├── LICENSE # MIT 许可证
├── README.md # 英文 README
└── README_zh-CN.md # 中文 README
Expand Down Expand Up @@ -196,15 +195,17 @@ Total_G = √(X² + Y² + Z²)

详细开发文档请参考 [开发文档](docs/DEVELOPMENT.md)

### 性能指标
### 规格与验证状态

以下部分数值沿用项目早期文档。仓库当前未提供独立测试数据集或完整校准流程,**不应将精度与续航数值视为已验证的性能指标**。

| 指标 | 规格 |
|------|------|
| 心率检测范围 | 60-100 BPM |
| 血氧检测精度 | ±2% |
| 温度检测精度 | ±0.5°C |
| 计步精度 | ≥95% |
| 电池续航 | 约 6-24 小时 |
| 血氧检测精度 | 尚无独立验证结果 |
| 温度检测精度 | 尚无独立验证结果 |
| 计步精度 | 尚无独立验证结果 |
| 电池续航 | 尚无完整续航测试数据 |
| WiFi 传输距离 | 室内 10-15 米 |
| 显示更新频率 | 10Hz |
| 数据采集周期 | 100ms |
Expand Down Expand Up @@ -255,8 +256,8 @@ Total_G = √(X² + Y² + Z²)

## 📞 联系方式

- 📧 **Issues**: [提交 Issue](https://github.com/YourUsername/STM32-Health-Band/issues)
- 💬 **Discussions**: [参与讨论](https://github.com/YourUsername/STM32-Health-Band/discussions)
- 📧 **Issues**: [提交 Issue](https://github.com/FuTseYi/STM32-Health-Band/issues)
- 💬 **Discussions**: [参与讨论](https://github.com/FuTseYi/STM32-Health-Band/discussions)

## 📊 更新日志

Expand All @@ -277,6 +278,6 @@ Total_G = √(X² + Y² + Z²)
本设备仅用于健康监测参考和学习研究,不可用于医疗诊断。
如有健康问题,请咨询专业医疗机构。

**Made with ❤️ by 謝懿Shine**
**用于学习与研究的嵌入式原型项目**

</div>
21 changes: 21 additions & 0 deletions docs/REPOSITORY-STRUCTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# PulseBand — Repository structure

This file documents the **actual source layout** and highlights why the Keil project has not been reorganized blindly.

| Directory | Contents |
| --- | --- |
| `firmware/USER/` | Keil `Template.uvprojx`, MCU application and startup configuration |
| `firmware/CORE/` | Startup code and core support |
| `firmware/FWLIB/` | STM32F10x standard peripheral library |
| `firmware/HARDWAR/` | Sensor and peripheral drivers (MAX30102, ADXL345, OLED and others) |
| `firmware/SYSTEM/` | Board/system support code |
| `firmware/OBJ/` | Existing tracked Keil build outputs; ignored for new files |
| `hardware/` | PCB designs, circuit files and reference materials |
| `mobile-app/` | Android application release and project assets |
| `docs/` | Hardware, development and contribution guides |

Open `firmware/USER/Template.uvprojx` using Keil µVision. Its project settings reference relative source directories; changing firmware folder names can break the build. Firmware paths therefore remain untouched pending a build verification.

The `.gitignore` prevents *new* Keil machine-specific files and build products from being tracked, but does **not** delete already committed files. Existing outputs can be cleaned separately after comparing them with release assets.

This educational prototype is **not a medical diagnostic device**; listed sensor/accuracy claims should be independently validated before clinical use.
41 changes: 41 additions & 0 deletions scripts/check_keil_paths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""Check relative paths referenced by the checked-in Keil uVision project.

This is not a firmware compile: it only catches broken source/includes paths
before committing a directory reorganization.
"""
from pathlib import Path
from xml.etree import ElementTree as ET

project_file = Path(__file__).resolve().parents[1] / "firmware" / "USER" / "Template.uvprojx"
root = ET.parse(project_file).getroot()
missing = []
sources = 0
includes = 0

for node in root.iter("FilePath"):
if not node.text or not node.text.strip():
continue
sources += 1
relative_path = node.text.strip().replace("\\", "/")
resolved = project_file.parent / relative_path
if not resolved.is_file():
missing.append(f"source: {relative_path}")

for node in root.iter("IncludePath"):
if not node.text or not node.text.strip():
continue
for raw_path in node.text.split(";"):
raw_path = raw_path.strip()
if not raw_path:
continue
includes += 1
relative_path = raw_path.replace("\\", "/")
if "$" in relative_path or "%" in relative_path:
continue # toolchain-provided variable path
if not (project_file.parent / relative_path).is_dir():
missing.append(f"include: {relative_path}")

print(f"Keil project references: {sources} sources, {includes} include paths")
if missing:
raise SystemExit("Missing referenced paths:\n" + "\n".join(missing))
print("All relative Keil source and include paths exist.")
Loading