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
+71-65Lines changed: 71 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: 'Environmental Monitoring with the Nicla Sense Env'
3
-
description: "This application note describes how to implement an outdoor air quality monitor with the Nicla Sense Env."
3
+
description: "This application note describes how to implement a simple outdoor air quality monitor with the Arduino® Nicla Sense Env."
4
4
difficulty: intermediate
5
5
compatible-products: [nicla-sense-env]
6
6
tags:
@@ -19,69 +19,79 @@ software:
19
19
- IoT-Cloud
20
20
---
21
21
22
+

23
+
22
24
## Introduction
23
25
24
-
Air pollution is a growing concern in urban and industrial areas due to the harmful effects of airborne pollutants such as nitrogen dioxide (NO2), ozone (O3) and airborne particulate matter (PM) on human health and the environment. This application note presents the development of an outdoor air quality monitor using the Portenta C33 and the Nicla Sense Env. The outdoor air quality monitor provides real-time data on temperature, humidity, concentrations of NO2 and O3, and the outdoor air quality index (AQI), making it suitable for use in urban areas, industrial zones, or environmental research.
26
+
Air pollution is a growing concern in urban and industrial areas due to the harmful effects of airborne pollutants such as nitrogen dioxide (NO₂) and ozone (O₃) on human health and the environment. This application note describes how to build a basic outdoor air quality monitor using the Arduino® Portenta C33 and the Nicla Sense Env board.
27
+
28
+
The outdoor air quality monitor provides real-time data on temperature (°C), humidity (%), concentrations of NO₂ (ppb) and O₃ (ppb), as well as the outdoor air quality index (AQI). It is suitable for deployment in urban areas, industrial zones or environmental research.
25
29
26
30
## Goals
27
31
28
32
The main goals of this application note are as follows:
29
33
30
-
- Develop a simple outdoor air quality monitor that provides real-time data on temperature, humidity, and pollutants such as nitrogen dioxide (NO2) and ozone (O3).
31
-
- Collect accurate readings of NO2, O3 and the outdoor air quality index (AQI) to assess overall outdoor air quality.
32
-
- Display real-time data from the Nicla Sense Env on the Arduino IDE Serial Monitor for immediate data observation and analysis.
33
-
-Establish a connection to the Arduino Cloud to enable remote monitoring and data analysis of the collected outdoor air quality data.
34
+
- Develop and implement a simple outdoor air quality monitor that provides real-time data on temperature, humidity, and pollutants such as nitrogen dioxide (NO₂) and ozone (O₃).
35
+
- Collect real-time data on NO₂, O₃ and the outdoor air quality index (AQI) to evaluate outdoor air conditions.
36
+
- Display live readings from the Nicla Sense Env board using the Arduino IDE Serial Monitor for immediate analysis.
37
+
-Enable remote monitoring and analysis by connecting the monitor to the Arduino Cloud.
-[Arduino IDE 1.8.10+](https://www.arduino.cc/en/software), [Arduino IDE 2.0+](https://www.arduino.cc/en/software), or [Arduino Cloud Editor](https://create.arduino.cc/editor).
47
-
- For the Wi-Fi® connectivity feature of Portenta C33, we will use the [Arduino Cloud](https://create.arduino.cc/iot/things). If you do not have an account, create one for free [here](https://cloud.arduino.cc/).
50
+
-[Arduino IDE 2.0+](https://www.arduino.cc/en/software) or [Arduino Web Editor](https://create.arduino.cc/editor)
-[Arduino Renesas Portenta Boards core](https://github.com/arduino/ArduinoCore-renesas) (required to work with the Portenta C33 board)
53
+
54
+
***The Nicla Sense Env board is not intended as a standalone device but as a shield of another Portenta, MKR, or Nano family board. In this application note, we will use the Portenta C33 as the main board and the Nicla Sense Env board as a shield.***
48
55
49
56
## Hardware Setup Overview
50
57
51
-
The electrical connections of the proposed outdoor air quality monitor are shown in the diagram below:
58
+
The electrical connections for the outdoor air quality monitor are outlined in the diagram below:
59
+
60
+
This diagram shows how the components are connected. The Portenta C33 serves as the host board or primary controller, while the Nicla Sense Env board (the host board or shield) collects temperature, humidity, and outdoor air quality data.
52
61
53
-
The diagram illustrates the connection of all the monitor's components. The Portenta C33 is the monitor's main controller; the Nicla Sense Env board provides temperature, humidity, and outdoor air quality data.
The Nicla Sense Env is connected to the Portenta C33 via ESLOV. The monitor has one main voltage bus (+5 VDC from the Portenta C33) that powers the Nicla Sense Env, the Portenta C33 is powered through its onboard USB-C port for testing purposes.
64
+
65
+
The Nicla Sense Env board connects to the Portenta C33 using the ESLOV interface. The monitor operates with a single power supply bus (+5 VDC from the Portenta C33), which powers the Nicla Sense Env. For testing purposes, the Portenta C33 is powered via its onboard USB-C port.
56
66
57
67
## Understanding Outdoor Air Quality
58
68
59
-
Air pollution is not just a problem in urban areas; rural environments also face significant risks from pollutants like nitrogen dioxide (NO2) and ozone (O3). These gases pose serious health risks, especially for vulnerable populations. NO2, produced by combustion engines and industrial processes, can travel far beyond urban centers. O3, formed by atmospheric chemical reactions, affects urban and rural regions, especially during warmer seasons of the year.
69
+
Air pollution is not just a problem in urban areas; rural environments also face significant risks from pollutants like nitrogen dioxide (NO₂) and ozone (O₃). These gases pose serious health risks, especially for vulnerable populations. NO₂, produced by combustion engines and industrial processes, can travel far beyond urban centers. O₃, formed by atmospheric chemical reactions, affects urban and rural regions, especially during warmer seasons of the year.
60
70
61
71
Real-time monitoring is critical in urban and rural settings to manage exposure to these pollutants properly. Air quality tracking and monitoring helps individuals and communities to proactively reduce health risks.
62
72
63
73
### The Role of Sensors in Air Quality Monitoring
64
74
65
-
This application note uses modern and state of the art sensors to provide accurate, real-time measurements of various pollutants. The Nicla Sense Env board offers an interesting solution for monitoring outdoor air quality.
75
+
This application note uses advanced sensors to provide accurate, real-time measurements of various pollutants. The Nicla Sense Env board offers a versatile solution for outdoor air quality monitoring.
66
76
67
-
-**NO2 Sensor**: Detects nitrogen dioxide, a harmful gas released by vehicles and industrial activities.
68
-
-**O3 Sensor**: Measures ozone, a gas that forms in the atmosphere through reactions between pollutants and sunlight, contributing to respiratory problems.
69
-
-**Outdoor Air Quality Index (AQI)**: The AQI simplifies the interpretation of air quality by combining data from multiple pollutants (PM, NO2, O3) into a single value.
77
+
-**NO₂ Sensor**: Detects nitrogen dioxide, a harmful gas released by vehicles and industrial activities.
78
+
-**O₃ Sensor**: Measures ozone, a gas that forms in the atmosphere through reactions between pollutants and sunlight, contributing to respiratory problems.
79
+
-**Outdoor Air Quality Index (AQI)**: The outdoor AQI simplifies the interpretation of air quality by combining data from multiple pollutants (NO₂ and O₃) into a single value.
70
80
71
-
The AQI index is based on a scale that ranges from 0 to 500, where:
81
+
The AQI scale ranges from 0 to 500, with the following classifications:
72
82
73
-
- 0-50 indicates good air quality.
74
-
- 51-100 is moderate.
75
-
- 101-150 is unhealthy for sensitive groups.
76
-
- 151-200 is unhealthy for everyone.
77
-
- 201-300 is very unhealthy.
78
-
- 301-500 signals hazardous conditions.
83
+
- 0-50: Good air quality.
84
+
- 51-100: Moderate air quality.
85
+
- 101-150: Unhealthy for sensitive groups.
86
+
- 151-200: Unhealthy for everyone.
87
+
- 201-300: Very unhealthy.
88
+
- 301-500: Hazardous conditions.
79
89
80
-
The AQI makes it easy to understand how outdoor air quality might affect public health, particularly when pollutant levels rise to unhealthy levels.
90
+
The AQI makes it easy to understand how outdoor air quality affects public health, particularly when pollutant levels reach unhealthy or hazardous thresholds.
81
91
82
-
Monitoring NO2, O3, and AQI in real-time allows for immediate responses when air quality worsens. This is especially important in rural areas with less visible air quality issues. The data collected can be sent to platforms like Arduino Cloud, enabling remote monitoring and long-term trend analysis, improving public awareness and policy decisions.
92
+
Monitoring NO₂, O₃, and AQI in real-time allows for immediate responses when air quality worsens. This is especially important in rural areas with less visible air quality issues. The data collected can be sent to platforms like Arduino Cloud, enabling remote monitoring and long-term trend analysis, improving public awareness and policy decisions.
83
93
84
-
## Environmental Monitor Example Sketch
94
+
## Simple Environmental Monitor Example Sketch
85
95
86
96
Now that we have covered the hardware components of our environmental monitor and how they are interconnected, let's study the software that brings this monitor to life. The example sketch in the following section manages data collection from the Nicla Sense Env board and the PMS7003 sensor connected to the Portenta C33 board, allowing us to monitor real-time environmental data such as temperature, humidity, outdoor air quality, and particulate matter concentrations.
87
97
@@ -97,7 +107,7 @@ The complete example sketch is shown below.
97
107
from the Nicla Sense Env connected to the Portenta C33 board.
98
108
The data is reported to the Arduino IDE's Serial Monitor every 10 seconds.
99
109
100
-
@version 1.0 01/09/24
110
+
@version 1.1 06/10/24
101
111
@author Arduino Product Experience Team
102
112
*/
103
113
@@ -108,10 +118,8 @@ The complete example sketch is shown below.
108
118
static const uint32_t READ_INTERVAL = 10000;
109
119
uint32_t lastReadTime = 0;
110
120
111
-
// Sensor objects for Nicla Sense Env data (using pointers)
121
+
// Sensor object for Nicla Sense Env data
112
122
NiclaSenseEnv device;
113
-
TemperatureHumiditySensor* tempHumSensor;
114
-
OutdoorAirQualitySensor* airQualitySensor;
115
123
116
124
/**
117
125
Initializes the sensors and serial communication.
@@ -124,18 +132,14 @@ void setup() {
124
132
Serial.begin(115200);
125
133
126
134
// Wait for Serial to be ready with a timeout of 5 seconds
// Check if both temperature/humidity and air quality sensors are enabled
287
-
if (tempHumSensor->enabled() && airQualitySensor->enabled()) {
293
+
if (tempHumSensor.enabled() && airQualitySensor.enabled()) {
288
294
// Read data from the Nicla Sense Env sensors
289
-
float temperature = tempHumSensor->temperature();
290
-
float humidity = tempHumSensor->humidity();
291
-
float NO2 = airQualitySensor->NO2();
292
-
float O3 = airQualitySensor->O3();
293
-
int airQualityIndex = airQualitySensor->airQualityIndex();
295
+
float temperature = tempHumSensor.temperature();
296
+
float humidity = tempHumSensor.humidity();
297
+
float NO2 = airQualitySensor.NO2();
298
+
float O3 = airQualitySensor.O3();
299
+
int airQualityIndex = airQualitySensor.airQualityIndex();
294
300
295
301
// Print all sensor data in a single line, with AQI at the end
296
302
Serial.print("- Temperature: ");
@@ -313,7 +319,7 @@ void displayAllData() {
313
319
In the code snippet shown before:
314
320
315
321
- The function first checks that the temperature/humidity sensor and the air quality sensor are enabled.
316
-
- The function retrieves temperature, humidity, gas concentrations (NO2 and O3), and the air quality index (AQI) from the Nicla Sense Env board.
322
+
- The function retrieves temperature, humidity, gas concentrations (NO₂ and O₃), and the air quality index (AQI) from the Nicla Sense Env board.
317
323
- Finally, the data is printed in a single line on the IDE's Serial Monitor, with the AQI displayed at the end.
318
324
319
325
### Complete Example Sketch
@@ -322,13 +328,13 @@ The complete example sketch can be downloaded here.
322
328
323
329
## Conclusions
324
330
325
-
The development of this outdoor air quality monitor demonstrates the effectiveness of using affordable and accessible sensors to measure key environmental parameters in real-time. Integrating the Nicla Sense Env with the Portenta C33 allows the system to track temperature, humidity, NO2, and O3 levels. The ability to monitor these pollutants, combined with the outdoor AQI, provides valuable insights for understanding air quality in urban and rural areas. Furthermore, the system's connection to the Arduino Cloud allows for remote monitoring and analysis, making it versatile for various applications, from personal use to environmental research.
331
+
The development of this outdoor air quality monitor demonstrates the effectiveness of using affordable and accessible sensors to measure key environmental parameters in real-time. Integrating the Nicla Sense Env with the Portenta C33 allows the system to track temperature, humidity, NO₂, and O3 levels. The ability to monitor these pollutants, combined with the outdoor AQI, provides valuable insights for understanding air quality in urban and rural areas. Furthermore, the system's connection to the Arduino Cloud allows for remote monitoring and analysis, making it versatile for various applications, from personal use to environmental research.
326
332
327
333
## Next Steps
328
334
329
335
Several improvements can be considered to extend the functionality of the outdoor air quality monitor:
330
336
331
-
- Add more sensors to the monitor to measure pollutants such as carbon monoxide (CO) or sulfur dioxide (SO2).
337
+
- Add more sensors to the monitor to measure pollutants such as carbon monoxide (CO) or sulfur dioxide (SO₂).
332
338
- Improve the monitor's energy efficiency for long-term deployment in remote or outdoor environments.
333
339
- Build a custom dashboard on Arduino Cloud to visualize trends over time and allow for more detailed analysis of air quality data.
334
340
- Implement an alert system that notifies users when pollutant levels exceed safe thresholds.
0 commit comments