A Full-Featured Open Source Smart Health Band Project
Features • Quick Start • Hardware • Development • Contributing
中文 | English
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.
This project is suitable for embedded system learners, electronics enthusiasts, and engineers interested in wearable device development.
- 🫀 Heart Rate Monitoring - Based on MAX30102 sensor using Photoplethysmography (PPG)
- 🩸 Blood Oxygen Detection - Real-time SpO2 monitoring
- 🌡️ Temperature Measurement - Accurate body temperature monitoring
- 🚶 Smart Pedometer - Step counting algorithm based on ADXL345 3-axis accelerometer
- 🚨 Fall Detection - Intelligent fall recognition and alarm system
- 📱 Wireless Connection - Connect to mobile APP via ESP8266-01S module
- 📺 Real-time Display - OLED screen displays health data in real-time
- 🔔 Audio Alarm - Buzzer alerts for abnormal conditions
- ⚡ Low Power Design - Optimized power management for extended battery life
- 🔄 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
| Component | Model | Quantity | Description |
|---|---|---|---|
| MCU | STM32F103C8T6 | 1 | ARM Cortex-M3, 72MHz |
| Heart Rate & SpO2 Sensor | MAX30102 | 1 | IIC Interface |
| Accelerometer | ADXL345 | 1 | 3-axis accelerometer |
| Display | OLED 128×64 | 1 | SSD1306 driver |
| WiFi Module | ESP8266-01S | 1 | Wireless communication |
| 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
- IDE: Keil uVision5 (v5.29 or higher recommended)
- Compiler: ARM-MDK V5.06+
- Download Tool: STM32 ST-LINK Utility or J-Link
- Serial Tool: Any serial debugging assistant (Baud rate 115200)
- STM32F10x Standard Peripheral Library (included in the project)
-
Clone the Project
git clone https://github.com/YourUsername/STM32-Health-Band.git cd STM32-Health-Band -
Open Project
- Open
1、代码/USER/Template.uvprojxwith Keil uVision5
- Open
-
Compile Project
- Click
Project→Build Targetor pressF7 - Ensure no errors or warnings
- Click
-
Flash Program
- Connect ST-Link to STM32 development board
- Click
Flash→Downloador pressF8
-
Install APP
- Transfer
4、APP/发布版_手环APP.apkto Android phone - Install APK file (allow installation from unknown sources)
- Transfer
-
Connect Device
- The band will automatically create a WiFi hotspot after power-on
- Connect phone to device WiFi:
- SSID:
WIFI/ Password:123456789 - Or SSID:
www/ Password:12345678
- SSID:
-
View Data
- Open the mobile APP to view real-time health data
┌─────────────────────────────────────────────────┐
│ STM32F103C8T6 Main Controller │
│ (ARM Cortex-M3, 72MHz) │
└─────────────────────────────────────────────────┘
│ │ │ │
┌────┴───┐ ┌──┴───┐ ┌──┴───┐ ┌──┴────┐
│MAX30102│ │ADXL345│ │ OLED │ │ESP8266│
│HR & SpO2│ │Accel. │ │Display│ │ WiFi │
└────────┘ └───────┘ └──────┘ └───────┘
| STM32 Pin | Connected Device | Function |
|---|---|---|
| PB8, PB9 | MAX30102 | IIC (SCL, SDA) |
| PA4, PA5 | ADXL345 | IIC (SCL, SDA) |
| PB6, PB7 | OLED | IIC (SCL, SDA) |
| PA9, PA10 | ESP8266 | UART (TX, RX) |
| PB5 | MAX30102 | Interrupt Input |
| PC13 | Buzzer | GPIO Output |
For complete hardware specifications, see HARDWARE.md
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
Peak detection algorithm analyzes PPG signals from MAX30102 sensor to calculate heart rate:
- Signal preprocessing and filtering
- Peak detection and recognition
- Heart rate calculation (based on RR-Interval)
Based on the absorption ratio of red and infrared light:
R = (AC_Red / DC_Red) / (AC_IR / DC_IR)
SpO2 = 110 - 25 × R
Based on 3-axis acceleration data:
Total_G = √(X² + Y² + Z²)
Fall Detection: Total_G > 3g or Total_G < 0.5g
For detailed development documentation, refer to DEVELOPMENT.md
| 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 |
| WiFi Range | Indoor 10-15 meters |
| Display Refresh Rate | 10Hz |
| Data Acquisition Cycle | 100ms |
We welcome all forms of contributions! Whether it's reporting bugs, suggesting new features, or submitting code improvements.
- Fork this repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For detailed contribution guidelines, see CONTRIBUTING.md
- Function naming: lowercase + underscore
sensor_init() - Variable naming: lowercase + underscore
sensor_data - Macro definition: uppercase + underscore
MAX_BUFFER_SIZE - Comments: Use Doxygen style comments
This project is licensed under the MIT License - see the LICENSE file for details.
You are free to:
- ✅ Commercial use
- ✅ Modification
- ✅ Distribution
- ✅ Private use
With the requirement:
- 📋 Include license and copyright notice
謝懿Shine - Project Creator and Main Maintainer
Thanks to the following open source projects and resources:
- STM32 Standard Peripheral Library
- Keil MDK-ARM
- Reference code provided by MAX30102 and ADXL345 sensor manufacturers
- All developers who contributed to this project
- 📧 Issues: Submit Issue
- 💬 Discussions: Join Discussion
- ✨ Initial release
- ✅ Implemented heart rate, SpO2, and temperature detection
- ✅ Added pedometer and fall detection features
- ✅ Completed WiFi data transmission
- ✅ Developed companion Android APP
- 📝 Improved project documentation
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