cd ../projects
Predictive-Edge — Predictive Maintenance on a Microcontroller
A TinyML system that detects bearing faults in industrial motors early and estimates remaining useful life (RUL): a 289-parameter (~1.1 KB) model that fits on an STM32H7. Capstone project.
- Stack
- Python · NumPy · scikit-learn · STM32H7 · Flask · Chart.js
Architecture
Approach
- Physics-based features: An FFT is taken of the 1 kHz vibration signal. Eight features, including harmonic ratio, spectral entropy, RMS, and peak-to-peak value, are extracted around the bearing outer-race fault frequency (BPFO = 100 Hz) and its harmonics; temperature and current are fed into the model as well.
- Model chosen by embedded constraints: Logistic Regression, Random Forest, SVM, Gradient Boosting, and MLP performed almost identically (F1 ≈ 0.99). Memory and inference cost decided the choice.
- Methodology: GridSearchCV and 5-fold cross-validation. The scaler lives inside the Pipeline, so there is no data leakage. Since the difference between (32,16) and (16,8) was within one standard deviation, the 3× smaller (16,8) was chosen.
- Embedded target: 289 parameters ≈ 1.1 KB (float32) — a tiny fraction of the STM32H7's 2 MB of Flash; int8 quantization brings it down to 289 B.
- Monitoring dashboard: Health status and remaining useful life for a fleet of 200 motors, via a Flask REST API + Chart.js.
By the numbers
| Metric | Value |
|---|---|
| F1 (synthetic data) | 0.99 |
| Parameters | 289 |
| Model size | ~1.1 KB (float32) · 289 B (int8) |
Limitations and next steps
The dataset is synthetic, generated from a physical fault model. Running the model on an actual STM32 board and validating it with real sensor data is in progress.