You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/07.opta/opta-family/opta/tutorials/18.smart-compressor-app-note/content.md
+14-10
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ hardware:
17
17
18
18
Upgrade your industrial compressor with smart capabilities and connect it to the Arduino Cloud for advanced condition monitoring using the Opta™ micro PLC.
19
19
20
-

20
+

21
21
22
22
This affordable solution provides real-time remote data access, behavioral diagnostics, predictive maintenance, and efficient device management. It helps you maximize uptime, lower operational costs, and extend the lifespan of your equipment.
23
23
@@ -33,7 +33,7 @@ The goal of this application note is to showcase the capabilities of Opta PLC in
33
33
34
34
## Hardware and Software Requirements
35
35
36
-

36
+

37
37
38
38
### Hardware Requirements
39
39
@@ -45,14 +45,14 @@ The goal of this application note is to showcase the capabilities of Opta PLC in
-[Arduino IDE 2](https://www.arduino.cc/en/software) or [Arduino Cloud Editor](https://create.arduino.cc/editor)
55
-
- The [Compressor Monitor sketches for Opta and Nicla Sense ME]()
55
+
- The [Compressor Monitor sketches for Opta and Nicla Sense ME](assets/Opta_Nicla_Codes.zip)
56
56
- The [Arduino Create Agent](https://cloud.arduino.cc/download-agent/) to provision the Opta WiFi on the Arduino Cloud.
57
57
- The [**Arduino Cloud**](https://cloud.arduino.cc/). If you do not have an account, you can create one for free inside [**cloud.arduino.cc**](https://cloud.arduino.cc/home/?get-started=true).
58
58
@@ -130,9 +130,9 @@ Let's go through some important code sections to make this application fully ope
130
130
131
131
-`ArduinoBLE.h` enables support for Bluetooth® Low Energy (BLE) communication. Install it by searching for it in the Library Manager.
132
132
-`Ethernet.h` enables Ethernet support for Modbus TCP communication.
133
-
-`ArduinoModbus.h` and `ArduinoRS485.h` manage the Modbus TCP protocol. Search for them in the Library Manager to install them.
134
-
-`ArduinoIoTCloud.h` enables Arduino Cloud integration. Search for it in the Library Manager to install it.
135
-
-`Arduino_ConnectionHandler.h` manages the board's internet connectivity. Search for it in the Library Manager to install it.
133
+
-`ArduinoModbus.h` and `ArduinoRS485.h` manage the Modbus TCP protocol. Search for **ArduinoModbus** and **ArduinoRS485** in the Library Manager to install them.
134
+
-`ArduinoIoTCloud.h` enables Arduino Cloud integration. Search for **ArduinoIoTCloud** in the Library Manager to install it.
135
+
-`Arduino_ConnectionHandler.h` manages the board's internet connectivity. Search for **Arduino_ConnectionHandler** in the Library Manager to install it.
136
136
137
137
There is a header included in the project code for the Arduino Cloud configuration:
138
138
@@ -222,6 +222,7 @@ void setup() {
222
222
EthernetInit();
223
223
}
224
224
```
225
+
225
226
In the `loop()` function, the Wi-Fi® and BLE connections and sensor readings are continuously verified.
226
227
227
228
```arduino
@@ -294,6 +295,7 @@ To convert the Opta's ADC raw readings into voltage, the following method can be
294
295
```arduino
295
296
Voltage = analogRead(<Input>) * (3.3 / 4095.0) / 0.30337;
296
297
```
298
+
297
299
***The formula above is derived from Opta's analog input frontend circuit.***
298
300
299
301
```arduino
@@ -369,6 +371,7 @@ void ModbusSend() {
369
371
}
370
372
}
371
373
```
374
+
372
375
There are other functions in the main code listed below:
373
376
374
377
-`EthernetInit()`: Initializes the Ethernet connection for Modbus TCP communication.
@@ -379,13 +382,14 @@ There are other functions in the main code listed below:
379
382
***You can download the complete code from [here](assets/Opta_Nicla_Codes.zip).***
380
383
381
384
### Nicla Sense ME Code
385
+
382
386
You can download the code for the Nicla Sense ME [here](assets/Opta_Nicla_Codes.zip).
383
387
384
388
Let's go through some important code sections to make this application fully operational, starting with the required libraries:
385
389
386
390
-`Nicla_System.h` adds support for the Nicla core and extended functionalities for power management.
387
-
-`ArduinoBLE.h` enables support for Bluetooth® Low Energy (BLE) communication. Install it by searching for it in the Library Manager.
388
-
-`Arduino_BHY2.h` provides the APIs for Nicla Sense ME board sensors.
391
+
-`ArduinoBLE.h` enables support for Bluetooth® Low Energy (BLE) communication. Install it by searching for **ArduinoBLE** in the Library Manager.
392
+
-`Arduino_BHY2.h` provides the APIs for Nicla Sense ME board sensors. Search for **Arduino_BHY2** in the Library Manager to install it.
389
393
390
394
Initial settings are defined by specifying accelerometer samples, sampling frequency, sensor object, and time control variables.
391
395
@@ -415,7 +419,7 @@ unsigned long microseconds;
415
419
long previousMillis = 0; // last time the vibration level was checked, in ms
416
420
```
417
421
418
-
The Bluetooth® Low Energy services and characteristics are standardized for this specific application. The service is defined as `Immediate alert (1802)`, ideal for notifying anomalous vibration events, and an `alert level characteristic (2A06)`. These have specific and standardized Bluetooth® Low Energy UUIDs.
422
+
The Bluetooth® Low Energy services and characteristics are standardized for this specific application. The service is defined as `Immediate Alert (1802)`, ideal for notifying anomalous vibration events, and an `Alert Level Characteristic (2A06)`. These have specific and standardized Bluetooth® Low Energy UUIDs.
419
423
420
424
In the `setup()` function, the different board peripherals are initialized, including:
0 commit comments