Implementing AI Predictive Maintenance for IoT Devices in a Mobile App
Predictive maintenance is the difference between "the pump broke, production is down" and "in 2 weeks the bearing will fail, schedule replacement." ML models trained on vibration data, motor current, and temperature detect degradation long before failure. A mobile app is the interface where engineers see forecasts, receive maintenance tasks, and confirm completion.
Forecasting Models: What Actually Works
Classical approach for rotating equipment (pumps, compressors, motors):
- Vibration RMS from accelerometer — increase indicates imbalance or bearing wear
- FFT Spectrum — characteristic defect frequencies (BPFI, BPFO, BSF, FTF by bearing geometry)
- Winding temperature — degradation trend when insulation fails
- Motor current (MCSA — Motor Current Signature Analysis) — harmonic changes with mechanical defects
Models: Isolation Forest or LSTM Autoencoder for anomaly detection on time series, XGBoost or LightGBM for defect classification, Survival Analysis (Weibull regression) for Remaining Useful Life (RUL) estimation.
Training happens server-side (Python, scikit-learn, PyTorch). The compiled model is either exported as REST API or deployed locally on the device.
Local Inference: TFLite and Core ML
For unreliable connections (industrial sites) — model on device.
// Android: TFLite model RUL prediction
class RULPredictor(context: Context) {
private val interpreter: Interpreter
init {
val model = loadModelFromAssets(context, "rul_model.tflite")
val options = Interpreter.Options().apply {
addDelegate(NnApiDelegate()) // hardware acceleration
setNumThreads(2)
}
interpreter = Interpreter(model, options)
}
fun predictRUL(sensorFeatures: FloatArray): PredictionResult {
// Input tensor: [1, 24] — 24 features (time series statistics)
val inputBuffer = ByteBuffer.allocateDirect(4 * sensorFeatures.size)
.order(ByteOrder.nativeOrder())
sensorFeatures.forEach { inputBuffer.putFloat(it) }
// Output tensor: [1, 2] — [rul_days, confidence]
val outputBuffer = Array(1) { FloatArray(2) }
interpreter.run(inputBuffer, outputBuffer)
return PredictionResult(
rulDays = outputBuffer[0][0].toInt(),
confidence = outputBuffer[0][1]
)
}
}
Feature engineering before inference: calculate statistics (mean, std, RMS, peak, crest factor, kurtosis, skewness) from raw time series over a sliding window. Done on device in real-time.
On iOS — Core ML with .mlpackage format. Conversion from scikit-learn via coremltools.convert(). MLModel Pipeline: StandardScaler + XGBClassifier converts to a single Core ML graph.
Device Card and Forecast
Home screen shows equipment list with health color indicators. Tap to open device card:
- Health Score (0–100) — aggregated health indicator
- RUL — remaining resource forecast in days/hours with confidence interval
- Active anomalies — with description: "Abnormally high vibration on X axis, typical of rotor imbalance"
- Trends — key parameter graphs for 7/30/90 days with trend arrows
- Service history — last service date and what was done
Push notification on Health Score drop: "Pump CN-2, Building 5: vibration increased 40% in 24 hours. RUL reduced to 12 days." Priority push via FCM PRIORITY_HIGH — not lost in Doze Mode.
Work Order Integration
A forecast without action is useless. When RUL threshold is reached, automatically create a maintenance ticket in CMMS (Computerized Maintenance Management System): SAP PM, IBM Maximo, Infor EAM, 1C:TOiR.
Mobile app lets mechanics: accept Work Order, scan QR on equipment for location confirmation, record work performed and parts replaced, close WO with signature.
After service: reset run counters, update baseline for the model.
Developing AI predictive maintenance on top of existing IoT app: 6–10 weeks (without ML development). Full cycle including ML models, mobile app, and CMMS integration: 4–6 months. Pricing is calculated individually.







