Skip to main content
Created By: Mukesh Sankhla Public Project Links: https://studio.edgeimpulse.com/public/1087509/live GitHub Repo: https://github.com/MukeshSankhla/Edge-Link This article is an excerpt from the original Edge-Link tutorial that you can read complete in Arduino Project Hub made by Mukesh Sankhla.

Introduction

Industrial machines don’t become obsolete just because technology moves forward. Factory floors are already full of PLCs, controllers, and sensors that have been running reliably for years, quietly generating production data that never leaves the machine. That data is valuable, but it’s often locked behind proprietary protocols and isolated industrial networks, out of reach of the cloud, IoT, and AI tools that could actually put it to use. The Edge Link project have been created to change that.
Built on the Arduino UNO Q, Edge Link is an industrial PLC/controller gateway and edge AI platform that connects existing machines, no replacement required, to modern data and AI infrastructure. It talks to a broad range of industrial controllers and interfaces, including Modbus, RS-485, and other common industrial protocols, meeting legacy equipment exactly where it is. But Edge Link doesn’t stop at moving data around. It combines data acquisition, industrial connectivity, edge computing, and machine learning in a single system at the machine level. Rather than streaming raw sensor data to the cloud for every decision, it processes data locally and runs multiple ML models directly at the edge, cutting latency, reducing bandwidth use, and keeping critical monitoring alive even when the cloud connection isn’t. To put Edge Link through its paces, this tutorial builds and tests it against a simulated Digital LED Bulb Production Line - multiple manufacturing stations running under realistic operating conditions. We’ll pull machine data from the process, structure it at the edge, and use it to build station-specific predictive maintenance models. Those models are trained in Edge Impulse and deployed in parallel on the Arduino UNO Q, so several stations can be watched simultaneously for early signs of wear or failure, all inferencing happening on-device. Underneath it all is a proper IoT/IIoT architecture built on MQTT and a Unified Namespace (UNS). Station and machine data flow through MQTT into a structured UNS, creating a single, consistent data layer that dashboards, analytics platforms, and cloud services can all draw from. The result is a working example of what’s possible without a rip-and-replace: existing machines connected, understood, and made smarter with AI using the equipment already on the floor. Edge Link turns legacy industrial connectivity into an intelligent edge.

Edge Impulse ML Models

Now let’s come to the Edge Impulse ML models running on the Arduino UNO Q. The Edge Link application package already contains six pre-trained Edge Impulse models, one for each production-line station:
  • pm_st1.eim — Station 1
  • pm_st2.eim — Station 2
  • pm_st3.eim — Station 3
  • pm_st4.eim — Station 4
  • pm_st5.eim — Station 5
  • pm_e1.eim — Overall/production-line model

How the Predictive Maintenance Models Work?

Each model is designed for a specific part of the production line and expects a particular set of input features. For example, Station 1 – PCB Assembly uses the pm_st1.eim model. The model monitors parameters such as:
These inputs represent different aspects of the Station 1 equipment, including mechanical vibration, reflow oven temperatures, conveyor motor current, and pick-and-place vacuum.

Model Outputs

The Station 1 model can classify the machine condition into states such as:
For example, the model configuration contains representative input presets for normal, warning, and fault conditions. These allow the simulator to generate different machine-health conditions and provide the corresponding feature values to the model.

Real-Time Inference on the Arduino UNO Q

The important part is that the ML inference is performed locally on the Arduino UNO Q. The PLC Simulator continuously generates the machine data and sends the formatted data to the Edge Link. The Edge Link identifies the station and extracts the required features for that station’s model. For example:

PLC Simulator

→ Station 1 sensor data → Edge Link → pm_st1.eim → Arduino UNO Q → Predictive-maintenance inference → Machine-health result This happens in milliseconds, allowing the system to continuously monitor the health of the production equipment without sending every inference request to the cloud. So instead of having a single ML model monitoring the entire factory, we have station-specific predictive-maintenance models running as part of the Edge AI pipeline. This is where the MCU + MPU architecture of the Arduino UNO Q becomes particularly useful. We are not simply collecting data and forwarding it to the cloud. We are continuously processing machine data at the edge and performing predictive maintenance inference locally. The cloud can still be used for historical data, visualization, analytics, and long-term monitoring, while the UNO Q provides the low-latency Edge AI layer.

Training Custom AI Models in Edge Impulse

Now that we have seen how the pre-trained Edge Impulse models work, let’s look at how we can build our own predictive-maintenance models using Edge Impulse. The first requirement for training an ML model is a large and representative dataset. Since we don’t have access to a real production line, we can use our PLC Simulator to generate realistic simulated machine data. The PLC Simulator includes a dedicated Edge Impulse Data Generator directly inside the SCADA web application. One hour of simulated production generates 36,000 samples at 10 Hz in less than 0.2 seconds, giving us a very fast way to generate large datasets without having to wait for a real production line to operate for hours. The generated dataset is imported into Edge Impulse via the CSV Wizard (Data Acquisition > CSV Wizard > Upload CSV), configured as time-series data with a timestamp column in elapsed milliseconds and the machine-health condition selected from the label column, with a sample length of 2000 ms.

Generate the Dataset from the PLC Simulator

The PLC Simulator includes a dedicated Edge Impulse Data Generator directly inside the SCADA web application. Open the PLC Simulator SCADA interface and select Edge Impulse Data Generator
Here we can generate datasets for the different production stations.
  • Select the station/model dataset you want to generate.
  • Enter the required simulation run duration.
  • Click Generate.
The simulator will generate the corresponding machine and predictive-maintenance data and export it as a CSV file. One of the useful features of this generator is how quickly it can create large datasets. 1 hour of simulated production generates 36, 000 samples at 10 Hz in less than 0.2 seconds. This gives us a very fast way to generate large datasets without having to wait for a real production line to operate for hours. For this example, I generated and downloaded the Overall Line Predictive Maintenance dataset as a CSV file.

Create an Edge Impulse Project

Now let’s import this dataset into Edge Impulse. Go to the Edge Impulse Studio, sign in with your account, and create a new project.
Once the project is created, we can begin importing our generated dataset.

Import the CSV Using CSV Wizard

Inside the Edge Impulse project, go to Data Acquisition.
Select: CSV Wizard tab and then upload CSV
Select the CSV file that we generated from the PLC Simulator and click Upload.
Edge Impulse will analyze the structure of the CSV file.
Review the detected configuration and click: Looks Good,Next.

Configure the Time-Series Data

Edge Impulse will now ask how the CSV data is structured. For our predictive-maintenance dataset, select:
  • Is this time-series data?
  • Yes, this is time-series data (either raw sensor data, or processed features)
Next, configure the data format:
  • How is your time-series data formatted?
  • Select: Each row contains a reading, and sensor values are columns.
This tells Edge Impulse that each row represents one measurement and that the different sensor/features are stored in separate columns. Next, Edge Impulse asks about the data format:
  • Do you have a timestamp or time elapsed column?
  • Select: Yes
Then configure the timestamp type as:
  • What type of data is in your timestamp column?
  • Select: Time elapsed in milliseconds
Click: Great, let’s look at your values Edge Impulse will now display the detected values and allow us to verify that the imported data looks correct.
Next, Edge Impulse asks whether the dataset contains a label.
  • Select: Do you have a column that contains the label (the value you want to predict)? Yes
  • Select the column: label
This is important because the label column contains the machine-health condition that we want the model to learn to identify. Click Next.
We now need to define the sample length and how much time should be included in each ML sample. For this example, set: Limit to: 2000 ms This means each training sample will contain a 2-second time window of sensor data. Next, configure the handling of labels:
  • How should we deal with multiple labels in a sample?
  • Select: The sample should have multiple labels
Click: Finish wizard Edge Impulse will now create the appropriate data configuration for the dataset.

Upload the Dataset

After completing the CSV Wizard, click: Upload some data
Select the same CSV file that was generated by the PLC Simulator. Keep the configurations consistent with what we selected in the CSV Wizard and click: Upload data Edge Impulse will now process the CSV and create the individual samples from our time-series dataset.
We can now use this dataset to create the Impulse, configure the processing blocks, extract useful features, train the model, and evaluate how well it can identify different machine-health conditions.

Create the Impulse

Now let’s create the Impulse for our predictive-maintenance model.
  • Go to Create Impulse
  • Set the Window size to 2000 ms.
  • Set the Window increase (stride) to 2000 ms.
  • Under Processing block, select Spectral Analysis.
  • Under Learning block, select Classification and Anomaly Detection (K-Means).
  • Click Save Impulse.
Now that the Impulse has been created, we can generate the features from our dataset.

Generate Spectral Features

Go to Spectral Features.
Here, Edge Impulse shows the extracted features for each data point. The Feature Explorer helps us visualize how the different classes are distributed based on these features. Once you are satisfied with the feature configuration, click: Save parameters Next, go to Generate Features.
Under Normalize features, select: Normalize using the standard scaling method Then click: Generate features Edge Impulse will process all the samples in our dataset and generate the corresponding features. These generated features will now be used for the next step: training our Classification and Anomaly Detection models.

Train the Classification Model

Now go to the Classification page. Change the learning rate to 0.01, other settings at their default values and click: Save & Train
Edge Impulse will now use the generated features and train the classification model. Once training is complete, we can review the accuracy, confusion matrix, and model performance. It is important to remember that a high accuracy score alone does not necessarily mean the model is good. We should also look at the confusion matrix, F1 score, precision, recall, and the separation of classes in the Data Explorer.

Example 1 - Overall Line Model

The first result shows an 86.2% validation accuracy with a loss of 0.38. The model performs very well on some classes:
  • fault_utility_breakdown → 100%
  • normal_plant_health → 100%
  • warning_line_power_surge → 70.8%
However, there is confusion between some warning classes. For example, warning_air_compressor_drop is frequently classified as warning_line_power_surge. This tells us that the features generated for these two conditions are relatively similar, so the model has difficulty separating them. The other metrics are:
  • AUC: 0.92
  • Weighted Precision: 0.82
  • Weighted Recall: 0.86
  • Weighted F1: 0.83
The F1 score of 0.83 gives us a better overall indication than accuracy alone because it considers both precision and recall.

Example 2 - Station 4 Classification

The second screenshot is the Station 4 classification model. This model performs significantly better:
  • Validation Accuracy: 98.7%
  • Loss: 0.03
The confusion matrix shows that:
  • fault_pressure_drop → 100%
  • fault_vacuum_fail → 100%
  • normal_health → 100%
  • warning_pneumatic_leak → 94.9%
  • warning_vacuum_pump_wear → 89.1%
The overall metrics are also excellent:
  • AUC: 1.00
  • Weighted Precision: 0.99
  • Weighted Recall: 0.99
  • Weighted F1: 0.99
The model is also extremely lightweight for Edge deployment:
  • Inference time: 1 ms
  • Peak RAM: 1.4 KB
  • Flash usage: 15.3 KB
This is particularly interesting for our project because it shows that a model can achieve very fast inference while requiring very little memory, making it suitable for running directly on the edge.

Why Do We Get Different Results?

  • The two models don’t necessarily have the same difficulty.
  • Different stations have different sensor characteristics and different fault conditions. Some conditions produce very distinctive patterns, while others may look very similar.
  • For example, if two fault conditions produce almost identical vibration, temperature, current, or pressure patterns, the model will have a harder time distinguishing them.
  • This is why dataset quality and feature selection are extremely important.

Let’s Experiment to Get Better Results

  • Instead of simply accepting the first training result, we should experiment with the model configuration.
  • There is no single configuration that is guaranteed to give the best result for every dataset.
  • Try changing one parameter at a time and retrain the model.
Things to experiment with:
Learning Rate
We used: 0.01 Try different values and compare the results. For example:
A learning rate that is too high can make training unstable, while one that is too low can make training slower or fail to learn effectively.
Window Size
We currently use:
The correct window depends on how quickly the machine condition changes. For vibration or rapidly changing signals, a shorter window may work better. For slower temperature or pressure changes, a longer window may capture more useful information.
Window Stride
We currently use: 2000 ms Experiment with smaller strides if you want more overlapping training samples. For example:
A smaller stride creates more overlapping windows, although it also increases the number of samples and can introduce highly similar samples.
Spectral Analysis Parameters
  • Don’t assume the default spectral configuration is always optimal.
  • Experiment with the spectral feature configuration and observe the Feature Explorer.
  • The goal is to get good separation between different machine-health classes.
  • If two classes are heavily overlapping in the Feature Explorer, that is a sign that we may need better features or better data.
Most Important: Improve the Dataset
In my opinion, dataset quality is more important than simply tuning the learning rate. For every machine condition, try to generate enough representative data.
The model should not learn one very specific sensor pattern and assume that it always represents a particular fault. It should learn the underlying machine condition.

Train the Anomaly Detection Model

Now let’s configure the Anomaly Detection model.
  • Go to the Anomaly Detection section.
  • Click Select suggested axes.
  • Edge Impulse will automatically select the most suitable axes/features for the model.
  • Click Save & Train.
Edge Impulse will now train the K-Means anomaly detection model using the selected features. Once training is complete, we can review the anomaly detection results and see how well the model identifies normal behavior versus unusual or abnormal conditions. The Anomaly Explorer shows how the test data compares with the normal training data.
  • The blue points/regions represent the training data and learned normal clusters.
  • The orange points represent the test data.
  • The selected axes are line_active_power_kw and line_ambient_temp_c with their extracted features.
  • Points that stay close to the learned clusters are considered normal.
  • Points that fall far outside the learned clusters can be identified as anomalies.
The Anomaly Score and Average Axis Distance below the graph provide numerical information about how far the test data is from the learned normal behavior. In our case, the test data is largely within the learned regions, showing that it follows the expected pattern.

Deploy the Model to Arduino UNO Q

  • Go to the Deployment page in Edge Impulse.
  • Under Deployment Target, select Arduino UNO Q.
  • Click Build.
Edge Impulse will now compile the trained model into a deployment package optimized for the Arduino UNO Q. Once the Build process is complete, Edge Impulse automatically downloads the generated .eim model file, which can then be copied into the appropriate Arduino UNO Q / Edge Link application folder and configured for real-time Edge AI/ML inference directly on the UNO Q. Arduino’s current App Lab workflow also supports deploying custom Edge Impulse models to the UNO Q, with the model becoming available to the relevant AI brick after deployment.

The Edge Impulse models used in this project

Conclusion

You can train multiple specialized ML models, deploy them to the Arduino UNO Q, and run the intelligence locally at the edge rather than sending every piece of data to the cloud. Read the complete tutorial, including hardware build instructions, enclosure design, PLC simulator setup, and full step-by-step Edge Impulse training walkthrough, on GitHub or on Arduino Project Hub.