Machines fail. Not suddenly in most cases, but gradually and silently. A temperature that drifts upward over days. A vibration frequency that shifts as a bearing wears. A current draw that increases as a motor degrades. None of these are catastrophic on their own. Together, with enough data and the right model, they tell you what is coming before it arrives.
Phaemos exists to reveal what machines cannot say about themselves.
The name comes from Ancient Greek. Phaen means to reveal. Mos means order or system. The tagline is: reveal before failure.
Why predictive maintenance.
Industrial equipment fails. The question is whether you find out before or after it happens.
Reactive maintenance waits for failure then repairs. Preventive maintenance follows a fixed schedule, replacing parts whether or not they need replacing. Predictive maintenance uses real sensor data to intervene only when something is genuinely wrong. The third approach is more efficient, less expensive and far more interesting to build.
The hardware layer.
Four nodes collect data simultaneously.
The ESP32 is the primary IoT gateway, consolidating 11 sensors: BME280 for temperature, humidity and pressure; MPU6050 for vibration and acceleration; INA219 for current and voltage monitoring; MLX90614 for contactless infrared surface temperature; VL53L0X for distance; MQ-2 for gas and smoke detection; AS5600 for shaft RPM via magnetic encoding; DS18B20 for contact temperature; MAX4466 microphone for acoustic level; LDR for ambient light; and FC-28 for water ingress detection. Output components include a SSD1306 OLED, a WS2812B RGB LED strip, a passive buzzer and a four-channel relay module. Consolidated JSON telemetry posts to the backend every five seconds.
The STM32 Black Pill F411CEU6 is the vibration specialist. It samples an MPU6050 at 100 Hz over I2C in bare HAL C, runs a short-window FFT and transmits the peak vibration frequency over UART to the ESP32. Bearing wear, imbalance and cavitation each produce characteristic resonant frequencies that raw acceleration values cannot distinguish. The FFT output gives the ML model a richer signal.
The Arduino Nano reads a secondary BME280, LDR and FC-28 moisture sensor and relays formatted CSV strings to the ESP32 over serial every two seconds.
The Raspberry Pi Pico 2W runs MicroPython. It reads a BME280 and LDR, displays locally on a SSD1306 OLED and posts its own telemetry payload to the API independently over Wi-Fi. It operates completely standalone from the ESP32, which means it continues logging even if the primary node fails.
The backend.
FastAPI in Python 3.11, backed by PostgreSQL 15 and Redis. On every incoming telemetry POST, the backend validates the device API key, stores the reading across a 25-field schema, evaluates all alert rules, scores the reading through the ML model and returns a 200 response in under 200 ms.
Every action writes to an immutable audit log. JWT authentication with bcrypt enforces three role levels: admin for full access, technician for creating and updating tickets and viewer for read-only access.
The ML pipeline.
The anomaly detection model is a scikit-learn Isolation Forest. Unsupervised: it requires no labelled fault data. It learns the normal operating envelope from baseline telemetry and scores each new reading from 0 to 1.
Scores above 0.7 trigger an alert and auto-generate a maintenance ticket. Scores above 0.85 attach a diagnostic recommendation string to that ticket.
The feature vector includes raw sensor values, rolling means and standard deviations over the last ten readings, total vibration magnitude and time-of-day encoding. The rolling statistics are critical. A single spike is noise. A sustained drift in the rolling mean for temperature or vibration frequency is a genuine signal worth acting on.
The dashboard.
The Next.js frontend polls the API every five seconds and renders live Recharts charts for each sensor metric. Anomalous readings are highlighted red as they arrive. Device cards show current status: online, warning, fault or offline. The ticket system lets technicians acknowledge alerts, add notes and close resolved issues.
GitHub: github.com/zaccesss/phaemos
Live: phaemos.com
Project page: isaacadjei.me/projects/phaemos
Next issue: I have one working eye and I build in engineering labs. That is what the next issue is about.
Zac
