Predictive maintenance starts with a simple question: does the machine still behave like it normally does?
For this tutorial, we built a complete motion anomaly detection system using an Arduino UNO Q, an Arduino Modulino Movement and Edge Impulse.
The demo uses a repeatable hand movement to represent normal machine behaviour. When that motion changes significantly, the system detects the anomaly, updates the UNO Q LED matrix and records the incident.
The complete prototype took roughly half a day to build.
Step 1: Capture motion data
The sensor used in the project is the Arduino Modulino Movement.
Its LSM6DSOXTR inertial measurement unit provides three-axis acceleration and three-axis gyroscope data. This project only uses the accelerometer.
In a production predictive maintenance system, the sensor would be fixed to the machine being monitored. Normal vibration or movement would then provide the baseline dataset.
For the demo, a repeatable waving motion acts as that healthy operating state.
Around two minutes of normal accelerometer data were collected, together with a smaller test dataset containing both normal and abnormal motion.
Step 2: Send the data to Edge Impulse
Sensor readings are captured on the STM32 side of the UNO Q.
Arduino Bridge transfers those values to the Python application running on the Qualcomm processor. A small App Lab application then sends each recorded sample into Edge Impulse through its API.
The recording window was set to approximately two seconds.
This made it possible to build the complete dataset directly using the same hardware that would later run the inference application.
The dataset was divided approximately 75:25 between training and testing.
Step 3: Extract vibration features
Raw acceleration values are useful, but vibration monitoring usually benefits from analysing the behaviour of the signal in the frequency domain.
The Edge Impulse impulse therefore uses its Spectral Analysis processing block.
The project samples the accelerometer at 62.5 Hz and processes two-second windows.
Spectral Analysis extracts statistical and frequency-domain features from the accelerometer signal. These include measurements such as root mean square, skewness, kurtosis and Fast Fourier Transform data.
This converts the raw waveform into a set of features that can be used by the anomaly detection model.
Step 4: Train the anomaly detector
The project uses a Gaussian Mixture Model for anomaly detection.
Unlike a conventional classifier, the objective is not to identify several known machine states.
The model learns the distribution of normal operating data.
During inference, new sensor data is compared against that learned distribution. Samples that differ sufficiently from normal behaviour receive a higher anomaly score.
This approach suits predictive maintenance because collecting healthy machine data is usually straightforward. Capturing representative examples of every possible mechanical fault can be considerably harder.
The model was therefore trained using the normal operating dataset, while anomalous motion was reserved for testing.
Step 5: Test the model
After training, the model was run against unseen test samples.
Each sample receives an anomaly score. A configurable threshold determines whether that sample should be treated as normal or anomalous.
The small test dataset used in this prototype produced good separation between the repeatable healthy movement and the deliberately irregular movements.
A production deployment would need substantially more validation.
That means collecting data across normal operating variation, different loads, environmental conditions, sensor mounting positions and representative faults.
Step 6: Build the App Lab application
With the model working, the next stage was building the application around it.
The video uses Agentic Mode, introduced with Arduino App Lab 0.10.
Instead of manually creating every file and interface, the application requirements were described to the agent in natural language.
The requested functionality included:
- Live accelerometer graphs
- Anomaly inference
- Adjustable detection thresholds
- Incident logging
- Pause and resume control
- CSV export
- UNO Q LED matrix alerts
The agent could inspect the existing workspace, including the earlier data-upload application, create and edit project files, run the application and check for errors.
Arduino App Lab Bricks handled common application functions, including the AI model integration.
The trained Edge Impulse model was then selected directly within the relevant AI Brick.
Step 7: Run the system locally
The finished application runs on the UNO Q.
During normal movement, accelerometer data is plotted in the web interface and the system remains in its healthy state.
When the movement changes significantly, the anomaly score crosses the configured threshold.
The application then records the incident and triggers the LED matrix through the STM32 microcontroller.
When normal movement resumes, the system returns to its normal operating state.
Detected events can also be exported as a CSV file for later processing or analysis.
Moving from demo to machine monitoring
The hand movement is only a repeatable test input.
For a real predictive maintenance deployment, the Modulino Movement could instead be mounted to a pump, motor, fan, tool or other piece of rotating equipment.
The development process would remain broadly the same:
Collect healthy vibration data. Build the signal-processing pipeline. Train the anomaly detector. Test it against realistic operating conditions. Set an appropriate threshold. Deploy the model locally.
Additional outputs could then replace the LED matrix. The application could trigger a buzzer, stop equipment, publish an alert or send the event into a wider industrial monitoring system.
The key result from this prototype is the workflow.
A sensor, a compact edge computer, an anomaly model and an application layer can be developed together quickly enough to make predictive maintenance practical at prototype scale.
If you’d like to win an UNO Q for yourself, register here: https://form.jotform.com/262436259891367
Comments are closed.
Comments
No comments yet