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/06.nicla/boards/nicla-sense-env/tutorials/environmental-monitor-application-note/content.md
+3-46Lines changed: 3 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -630,7 +630,7 @@ Please, begin by creating a new Thing in your Arduino Cloud with the following v
630
630
- cloudO3
631
631
- cloudAQI
632
632
633
-
All of the variables must be **`float`** type, have **`Read & Write`** permission and a **`On Change`** update policy.
633
+
All of the variables must be **`float`** type, have **`Read Only`** permission and a **`On Change`** update policy.
634
634
635
635
The complete example sketch is shown below.
636
636
@@ -760,51 +760,6 @@ void readSensors() {
760
760
Serial.println("- ERROR: One or more sensors are disabled.");
761
761
}
762
762
}
763
-
764
-
/**
765
-
Function called when cloudTemperature variable changes.
766
-
This function can be used to respond to changes in temperature values
767
-
from the Arduino Cloud dashboard.
768
-
*/
769
-
void onCloudTemperatureChange() {
770
-
// Add your code here to act upon temperature changes
771
-
}
772
-
773
-
/**
774
-
Function called when cloudHumidity variable changes.
775
-
This function can be used to respond to changes in humidity values
776
-
from the Arduino Cloud dashboard.
777
-
*/
778
-
void onCloudHumidityChange() {
779
-
// Add your code here to act upon humidity changes
780
-
}
781
-
782
-
/**
783
-
Function called when cloudNO2 variable changes.
784
-
This function can be used to respond to changes in NO₂ values
785
-
from the Arduino Cloud dashboard.
786
-
*/
787
-
void onCloudNO2Change() {
788
-
// Add your code here to act upon NO₂ changes
789
-
}
790
-
791
-
/**
792
-
Function called when cloudO3 variable changes.
793
-
This function can be used to respond to changes in O₃ values
794
-
from the Arduino Cloud dashboard.
795
-
*/
796
-
void onCloudO3Change() {
797
-
// Add your code here to act upon O₃ changes
798
-
}
799
-
800
-
/**
801
-
Function called when cloudAQI variable changes.
802
-
This function can be used to respond to changes in AQI values
803
-
from the Arduino Cloud dashboard.
804
-
*/
805
-
void onCloudAQIChange() {
806
-
// Add your code here to act upon AQI changes
807
-
}
808
763
```
809
764
810
765
The following sections will help you to understand the main parts of the example sketch shown before, which can be divided into the following:
@@ -950,6 +905,8 @@ In the code snippet shown before:
950
905
- The RGB LED changes color based on the AQI value. Green for good air quality, yellow for moderate, and red for unhealthy levels.
951
906
- The cloud variables (`cloudTemperature`, `cloudHumidity`, `cloudNO2`, `cloudO3`, and `cloudAQI`) are updated with the latest sensor readings and sent to Arduino Cloud for remote monitoring.
952
907
908
+
The complete cloud example sketch can be downloaded [here](assets/cloud_air_quality_monitor.zip).
909
+
953
910
## Conclusions
954
911
955
912
In this application note, we explored how to integrate a Portenta C33 board with a Nicla Sense Env board to monitor environmental data, such as temperature, humidity, NO₂, O₃, and AQI. We demonstrated also how Arduino Cloud allows for easy remote monitoring and real-time visualization of this data.
0 commit comments