Local-first anomaly isolation and 3D telemetry spatial mapping for Industry 4.0.
MotorSafe is an enterprise-grade, edge-native predictive maintenance ecosystem designed to prevent catastrophic industrial motor failures. By synchronizing and fusing three high-frequency telemetry streams—Voltage (power quality), Current (torque load), and Vibration (mechanical health)—the local unsupervised Machine Learning model (Isolation Forest) cross-verifies anomalies in real-time, eliminating false positives and predicting mechanical degradation days in advance.
MotorSafe decouples data acquisition, ingestion, and 3D spatial telemetry visualization into a robust wireless Publish/Subscribe topology:
flowchart TD
subgraph Edge Nodes [Industrial Hardware Nodes]
A["ACS712 (Current Sensor)"] & B["ZMPT101B (Voltage Sensor)"] & C["MPU6050 (Vibration Accel)"] -->|Analog / I2C| D["ESP8266 Gateway / Publisher"]
end
D -->|MQTT Over WiFi JSON| E["Mosquitto MQTT Broker (factory/+/telemetry)"]
subgraph Diagnostic Core [Central Analytical Server]
E -->|Instant Telemetry Sync| F["Python / central_server.py"]
F -->|Real-Time Inference| G["Isolation Forest (Unsupervised ML)"]
F -->|Data Historian| H[("Local CSV Logging (public/motor_parameters.csv)")]
end
subgraph Control Room [3D Spatial Frontend]
H -->|High-Frequency Playback Feed| I["React 3D Command Dashboard"]
I -->|React Three Fiber (R3F)| J["3D Digital Twin Spatial Factory Map"]
end
G -->|Triage & Emergency Alerts| I
- Tri-Modal Sensor Fusion: Correlates power stability, current draws, and physical acoustics to prevent expensive, false-positive factory shutdowns caused by simple mechanical bumps.
- Unsupervised Anomaly Isolation: Employs an edge-optimized Isolation Forest algorithm that learns the unique, healthy signature of each motor on-the-fly, completely bypassing the need for manual training labels or historic failure logs.
- 3D React Three Fiber (R3F) Digital Twin: Renders a gorgeous, zero-latency blueprint factory grid. Anomaly states (>70% confidence) trigger real-time Red visual pulses and dynamic spin accelerations directly on the failing 3D motor node.
- Decoupled MQTT Scalability: Add or remove dozens of physical motor nodes instantly. The Mosquitto MQTT broker routes incoming telemetry seamlessly without requiring a single central codebase alteration.
Telemetry Ingestion (Current + Voltage + Vibration)
│
├──► [High Vibration] + [Steady Current] ==► External Mechanical Noise (Filter & Ignore)
├──► [High Current] + [Low Voltage] ==► Grid Sag / Brownout Warning (Log System State)
└──► [High Current] + [High Vibration] ==► MOTOR FAULT / TRIP TRIGGER (Emergency Shutdown)
- Low Computational Footprint: Engineered to run optimally on standard edge industrial computers (e.g., dual-core MacBook Air 2017 i5, 8GB RAM).
- Memory Footprint: Central Python server runs on <50MB RAM with zero external heavy ML framework dependencies (e.g., TensorFlow, PyTorch).
- Zero-GPU Rendering: React 3D Digital Twin uses highly optimized WebGL shaders and lightweight R3F meshes, maintaining a solid 60 FPS on standard integrated graphics.
Ensure you have Python 3.8+ installed, then run the simulation and data generation script:
# Install Python analytical dependencies
pip install streamlit pandas numpy scipy scikit-learn pyserial plotly
# Generate mock physical telemetry data
python generate_motor_data.pyMove to the project root, install packages, and spin up the Vite development server:
# Install Node packages
npm install
# Start Vite React Dashboard
npm run devStart Mosquitto locally to route real MQTT data packets from physical ESP8266 controllers:
# Debian / Ubuntu
sudo apt install mosquitto mosquitto-clients -y
sudo systemctl start mosquitto
# Publish test JSON payload to verify connection
mosquitto_pub -h localhost -t "factory/motor1/telemetry" -m '{"voltage": 220, "current": 4.2, "vibration": 0.08}'- Blueprint Factory Floor: Minimalist off-black canvas styled specifically to minimize eye fatigue for factory control room operators.
- Triage Automation Panel: Failing motors are automatically isolated and pushed to the top of the operator queue for rapid physical inspection.
- Historian Exporting: Download entire filtered, raw sensor-fusion datasets instantly back to CSV format for post-mortem analysis.
Distributed under the MIT License. See LICENSE for details.