|
1 | 1 | ---
|
2 |
| -title: 'Machine Learning for Motor Anomaly Detection with Nicla Sense ME & Opta™' |
| 2 | +title: 'ML for Motor Anomaly Detection with Nicla Sense ME & Opta™' |
3 | 3 | difficulty: advanced
|
4 | 4 | description: "This application note explains how to detect motor anomalies by analyzing vibration patterns using the Arduino Nicla Sense ME, machine learning tools on the Edge Impulse platform, and the Arduino Opta™. The process begins with the Nicla Sense ME capturing vibration data from the motor and transmitting it to the Opta™ via Bluetooth BLE. The Opta™ then forwards the collected data to the Edge Impulse platform, where a machine learning model is created and trained to identify anomalies in motor behavior. Once trained, the model is deployed back to the Opta™, enabling it to perform real-time motor monitoring and predictive maintenance in industrial environments."
|
5 | 5 | tags:
|
@@ -191,7 +191,7 @@ BLECharacteristic sensorCharacteristic(deviceServiceCharacteristicUuid, BLERead
|
191 | 191 | const long interval = 100; // Interval of 100ms between data transmissions
|
192 | 192 | ```
|
193 | 193 |
|
194 |
| -The code below represents the second part of the Nicla Sense ME code and is responsible for initializing the system components necessary for its functionality. This includes setting up Serial communication, initializing the sensor system (BHY2) to access the onboard accelerometer, and configuring Bluetooth® Low Energy (BLE) communication for data transmission. |
| 194 | +The code bellow represents the second part of the Nicla Sense ME code and is responsible for initializing the system components necessary for its functionality. This includes setting up Serial communication, initializing the sensor system (BHY2) to access the onboard accelerometer, and configuring Bluetooth® Low Energy (BLE) communication for data transmission. |
195 | 195 |
|
196 | 196 | Using the `ArduinoBLE` and `Arduino_BHY2` libraries, the code prepares the Nicla Sense ME to act as a BLE peripheral device. It initializes the BHY2 sensor system and the accelerometer to collect vibration data. Bluetooth functionality is then configured with a BLE service (`niclaService`) and a characteristic (`sensorCharacteristic`) that enable a central device, such as the Opta™, to connect and interact with the Nicla Sense ME. The BLE device name is set to `Nicla` making it easily recognizable during device discovery.
|
197 | 197 |
|
@@ -235,7 +235,7 @@ void setup() {
|
235 | 235 | }
|
236 | 236 | ```
|
237 | 237 |
|
238 |
| -The code below represents the main loop of the Nicla Sense ME program and is responsible for managing the continuous operation of the system. This includes monitoring for Bluetooth® Low Energy (BLE) connections, retrieving data from the onboard accelerometer, and transmitting the data to a connected central device. |
| 238 | +The code bellow represents the main loop of the Nicla Sense ME program and is responsible for managing the continuous operation of the system. This includes monitoring for Bluetooth® Low Energy (BLE) connections, retrieving data from the onboard accelerometer, and transmitting the data to a connected central device. |
239 | 239 |
|
240 | 240 | The program ensures that the Nicla Sense ME can maintain a BLE connection with a central device, such as the Opta™. It continuously checks if a central device is connected. Once a connection is established, the program enters a loop to regularly retrieve accelerometer data, update sensor values, and transmit the motion data to the connected device.
|
241 | 241 |
|
@@ -295,9 +295,9 @@ void loop() {
|
295 | 295 | }
|
296 | 296 | ```
|
297 | 297 |
|
298 |
| -### Opta™ Code |
| 298 | +### Opta™ Code |
299 | 299 |
|
300 |
| - |
| 300 | + |
301 | 301 |
|
302 | 302 | This code demonstrates the configuration of the Opta™ as a central Bluetooth Low Energy (BLE) device, designed to connect to the Nicla Sense ME, which functions as a BLE peripheral. The program scans for BLE devices advertising a specific service UUID, connects to the first matching peripheral, and retrieves accelerometer data from its X, Y, and Z axes. The data is transmitted in real-time using a BLE characteristic.
|
303 | 303 |
|
@@ -414,7 +414,7 @@ void loop() {
|
414 | 414 | ```
|
415 | 415 | With both codes running — the Nicla Sense ME code functioning as a peripheral, sending accelerometer data via BLE, and the Opta™ code acting as a central device, receiving this data via BLE and transmitting the readings to the computer via serial communication over a USB connection — you need a computer with internet access to forward the data to the Edge Impulse platform. To do this, run the command `edge-impulse-data-forwarder` in the terminal. Once the program is running and the necessary configurations are selected, the computer will forward the data to the Edge Impulse platform. You can then access your project under the `Data Acquisition` tab to start collecting data samples. For more information, refer to the official [Edge Impulse documentation](https://docs.edgeimpulse.com/docs/tools/edge-impulse-cli/cli-data-forwarder).
|
416 | 416 |
|
417 |
| -### Opta™ Deployment Code |
| 417 | +### Opta™ Deployment Code |
418 | 418 |
|
419 | 419 | 
|
420 | 420 |
|
@@ -614,7 +614,7 @@ bool connectToPeripheral() {
|
614 | 614 |
|
615 | 615 | ## Full Motor Anomaly Detection Example
|
616 | 616 |
|
617 |
| -All the necessary files to replicate this application notes can be found below: |
| 617 | +All the necessary files to replicate this application notes can be found bellow: |
618 | 618 |
|
619 | 619 | - You can download a compressed file containing all the necessary codes [here](assets/Nicla_Opta_ML_Vibration_Anomaly_Detection.zip). This file contains the following codes: Nicla Sense ME Firmware, Opta™ Firmware, and Opta™ Deployment Firmware.
|
620 | 620 | - **Nicla Sense ME Firmware:** This code configures the Nicla Sense ME as a BLE peripheral to collect vibration data from the motor and transmit it wirelessly via Bluetooth® Low Energy (BLE).
|
|
0 commit comments