How rongyishuaige7/esp32-c3-smart-band works
This is an ESP32-C3 health-data teaching prototype: firmware samples sensors, updates the local OLED, and sends compact BLE telemetry to a Flutter Android client that scans for the project service and displays availability-aware readings. Separate branches cover optical estimates, temperature, motion, GPS availability, and the optional bench-only vibration experiment. Firmware control flow and estimator calls are visible in sampled source; app behavior and protocol capabilities are based on the README, since app implementation files were not sampled. These are uncalibrated demonstrations, not medical or safety functions.
Main entry points: main.cpp ESP32-C3 band · sensors.cpp Sensor sampling · band_ble_controller.dart Band BLE controller · scan_page.dart BLE scan
Components 18
Band firmware
- ESP32-C3 band
firmware/src/main.cpp - BLE telemetry
firmware/src/ble.cpp - OLED display
firmware/src/display.cpp - Optional vibration
firmware/src/main.cpp
Sensing and estimates
- Sensor sampling
firmware/src/sensors.cpp - Pulse detector
firmware/src/heartRate.h - SpO2 estimator
firmware/src/spo2_calc.cpp - Temperature sampling
firmware/src/sensors.cpp - Acceleration event
firmware/src/sensors.cpp - GPS availability
firmware/src/gps.cpp
Android client
- Flutter app
app/lib/main.dart - BLE scan
app/lib/pages/scan_page.dart - Band BLE controller
app/lib/band_ble_controller.dart - Band data model
app/lib/models/band_data.dart - Live readings
app/lib/pages/home_page.dart
Hardware reference
- Board and wiring
hardware/wiring.md - Parts list
hardware/BOM.csv
Other components
- Band wearer
Connections 15
- Band wearer → BLE scan: starts scan
README.md - BLE scan → Band BLE controller: uses
- Band BLE controller → ESP32-C3 band: scans and receives
README.md - Band BLE controller → Band data model: decodes
- Band data model → Live readings: supplies readings
- Live readings → Band wearer: shows status
README.md - ESP32-C3 band → Sensor sampling: samples and reads
firmware/src/main.cpp - ESP32-C3 band → GPS availability: feeds and reads status
firmware/src/main.cpp - Sensor sampling → Pulse detector: detects beats
firmware/src/sensors.cpp - Sensor sampling → SpO2 estimator: pushes samples; estimates
firmware/src/sensors.cpp - ESP32-C3 band → BLE telemetry: notifies telemetry
firmware/src/main.cpp - ESP32-C3 band → OLED display: updates readings
firmware/src/main.cpp - ESP32-C3 band → Optional vibration: optionally pulses
firmware/src/main.cpp - Band wearer → OLED display: views locally
- Board and wiring → Parts list: lists components