Beyond the alarm threshold
Industrial motors are among the most failure-prone components in manufacturing environments. Thermal stress causes insulation breakdown, bearing seizure, and catastrophic failure — often with no warning. This project builds a Motor Thermal Digital Twin that maintains a continuous model of the motor's thermal behaviour, classifies every reading with machine learning, controls a cooling fan automatically, and estimates time-to-failure before the motor gets there.
Edge-to-cloud, layer by layer
The system follows a layered architecture with five clearly separated concerns. The key design decision: reactive and predictive AI run in completely independent containers. A crash in the predictive service cannot affect fan control logic that keeps the motor safe.
Four algorithms, one interface
All four algorithms share an identical two-function contract — load_model() and classify(temperature, window). Switching is a single commented import line and a container rebuild.
Know before it happens
The predictive service estimates whether the warning threshold will be crossed within the next few minutes, based on a sliding buffer of the last 30 readings (60 seconds of history). It publishes a continuous risk score from 0 to 1 and an estimated time-to-warning.
The risk score crosses 0.5 approximately 30–60 seconds before the temperature reaches the 85 °C warning threshold — giving operators time to slow a production line, dispatch a technician, or increase monitoring frequency before the reactive alarm fires.
→ LSTM(64 units)
→ Dropout(0.2)
→ Dense(32, ReLU)
→ Dense(1, sigmoid) → risk probability 0–1
Trained on 50,000 synthetic sequences · tflite-runtime inference (~5 MB) · Target AUC-ROC ≥ 0.95
Five topics, clear ownership
Raw sensor readings stay local. Only processed alerts are forwarded to the cloud SCADA broker — reducing bandwidth and avoiding off-site leakage of operational data.
| Topic | Publisher | Purpose |
|---|---|---|
| sensors/group10/motorTemp/data | ESP32 / simulator | Raw temperature every 2 s — local only |
| alerts/group10/motorTemp/status | python-edge | Anomaly status + score → local & cloud SCADA |
| control/group10/motorTemp/fan | python-edge / Node-RED | Fan relay ON/OFF command to ESP32 |
| control/group10/motorTemp/mode | Node-RED | AUTO / MANUAL switch (retained message) |
| predict/group10/motorTemp/risk | python-predict | Risk score 0–1 + ETA minutes |
One command to run everything
The entire stack — broker, edge AI, predictive service, historian, and dashboards — starts with a single command. No manual configuration needed.
Group 10
Department of Computer Engineering · University of Peradeniya · CO326, 2026