GitHub Repo for the Project
https://github.com/HajjSalad/Embedded-Predictive-Maintenance
Overview
-
A multi-node embedded predictive maintenance system that monitors industrial machine sensors, detects anomalies in real-time, and streams telemetry to the cloud via a gateway node.
-
Built on three sensor nodes - STM32F446RE, nRF52840, and ESP32-WROOM-32 - running identical Zephyr RTOS firmware, each communicating with an ESP32 gateway over UART (STM32 + ESP32 nodes) or BLE (nRF52 node).
[Image here]
The system is built across these components:
- Zephyr Setup Guide: development environment and toolchain configuration
- Machine and Sensor Modelling: C++ OOP with Factory Method and Object Pool patterns
- Multithreaded Pipeline: five-thread producer-consumer architecture with priority scheduling
- Synchronization Primitives: mutex, message queue, and semaphore-based coordination
- Anomaly Detection: statistical threshold detection with event-driven alerting
- UART Transport: binary protocol with CRC16 for STM32 and ESP32 sensor nodes
- BLE Transport: GATT-based wireless telemetry for nRF52 sensor node
- CI/CD Pipeline: automated multi-board builds with hardware-in-the-loop testing
Components
1. Main Entry Point
File: main.c
- Entry point of the whole system
- One-time initialization:
- Run C++ demo
- Create machine and register sensors
- Spawn application threads