Last week, I shared my excitement about exploring Edge Machine Learning with the X-NUCLEO-IKS4A1, NUCLEO-F401RE, and NanoEdgeAI Studio. 

I’m excited to share the experience of my first EdgeML application!

MEMS sensor on IKS4A1 senses motor vibrations and F401RE runs an ML model which estimates the speed range based solely on vibration data.

NanoEdgeAI Studio is an intuitive tool designed by STM to easily implement ML models for microcontrollers. 

Here’s what it enabled me to do:
1️⃣ Sensor Data Collection: NEAI Studio works with the microcontroller to log the data stream into a csv file which is used for training the ML model.

2️⃣ Model Training: Based on the data collected, NEAI Studio automatically evaluates multiple models, trains them, benchmarks them, and identifies the best fit for your data. 

3️⃣ Model Validation and Deployment: You can test various models on your host PC before deploying it to the target microcontroller. The input data stream can be stored data or a stream of fresh data from your microcontroller. You can compare between different parameters like inference time, RAM size, flash size and accuracy.
NEAI Studio then generates a lightweight, ready-to-use model library that I could integrate directly into my application on resource-constrained microcontrollers.

My Application

My final application, running on the NUCLEO-F401RE, has two modes:

🔹 Data Logger Mode: Captures and logs vibration data for training and validating the model initially.

🔹 Inference Mode: Runs the ML model generated by NanoEdgeAI Studio to predict the speed range of the DC motor based on its vibrations. 

This project shows how it is possible to bring ML to the edge, even on hardware with limited resources. The potential applications for predictive maintenance, anomaly detection, and more are immense!

Leave a Reply

Your email address will not be published. Required fields are marked *