Environmental Monitoring with Arduino Pro

The air we breathe has a direct effect on how healthy we are. Poor air quality can lead to a number of health problems, such as respiratory infections, headaches, and tiredness. It can also make asthma and allergies worse if you already have them. This is why it's important to keep an eye on the air quality in your enclosed environments, especially in our work offices, and, if necessary, take steps to improve it.
The number of employees in an office can also have a significant impact on the air quality. The greater the population, the greater the likelihood that air pollutants will be discharged. This is why environmental monitoring at corporate offices is important; it ensures that the air quality is safe for all employees.
In the past few years, the COVID-19 pandemic has prompted numerous businesses to reassess their workplace safety procedures. Air quality is among the most vital concerns.
Environmental monitoring in buildings refers to the security and privacy measures implemented to safeguard employees and office buildings from airborne toxins. This includes gathering information on air quality, temperature, and other environmental conditions. This information is then used to assess the risk of exposure to hazardous compounds and to implement measures to reduce or eliminate such hazards.
The Arduino Solution
To address the challenge, we used Arduino as an environmental monitoring system based on sensor nodes that monitor each room and send the data they collect to a gateway. The gateway can either show the data locally or send it to the cloud, where it can be used to do more calculations. Alerts can be set up at the gateway level or in the cloud based on certain thresholds that are thought to be important.Monitoring Air Quality
We chose the Arduino Nicla Sense ME for monitoring the environment because it is easy to use for analyzing motion and the environment (hence the "M" and "E" in the name). By putting brand-new Bosch Sensortec sensors on the market, it can measure rotation, acceleration, pressure, humidity, temperature, air quality, and CO2 levels.The Nicla Sense ME sensor we're most interested in is the BME688, which is the first gas sensor with artificial intelligence (AI) and high-linearity, high-accuracy pressure, humidity, and temperature sensors built in. It comes in a strong but small package that measures 3.0 x 3.0 x 0.9 mm3 and was made for mobile and connected applications where size and low power consumption are important. The gas sensor can find gases in the part per billion (ppb) range, such as carbon monoxide and hydrogen. It can also find volatile organic compounds (VOCs), volatile sulfur compounds (VSCs), and other gases.
Counting People
We chose the Arduino Nicla Vision because it has a powerful STM32H747AII6 dual Arm Cortex-M7/M4 processor, a 2MP color camera that supports tinyML, a smart six-axis motion sensor, an integrated microphone, and a distance sensor. This will help us keep track of how many people are in each room.Concerns about privacy must be taken into account when cameras are used, and for good reason. In our case, the cameras are used to run an edge model to figure out how many people are in the field of view. No actual video stream or pictures are coming out of the camera. Only the real number makes it safe and useful.
We chose the Edge Impulse platform for this because it's easy to train and deploy a model that will help us figure out how many people are in the camera's view. After the camera is set up, it doesn't need to be connected to the internet anymore. Only the number of people will be sent to the gateway.
Nicla Vision and Nicla Sense ME have the same size and PCB format, with the primary distinction being that Nicla Vision has a camera and Nicla Sense ME has a sensor array. For each, we've developed a 3D-printed container to facilitate attachment and the execution of their core responsibilities.

For the gateway, we chose the Portenta X8, a powerful, industrial-grade SOM with Linux OS preinstalled onboard and a flexible container architecture capable of running device-independent software. It has an NXP i.MX 8M Mini Cortex-A53 quad-core, up to 1.8GHz per core + 1x Cortex-M4 up to 400MHz, as well as an STMicroelectronics STM32H747 dual-core Cortex-M7 up to 480MHz and M4 32-bit Arm MCU up to 240MHz.
We selected the Portenta Max Carrier to host and power the Portenta X8 while expanding its connectivity choices and giving it with easy-to-mount options and power supply ports. We housed the devices in a wall-mountable enclosure proportional to the overall size of the hardware.
The Portenta X8 can collect data from a large number of sensor nodes via BLE, so long as they are within range and not obstructed by large walls or structures, and either store the data locally for display via the local server stack or transmit it to the cloud.

Cloud Solution IoT
Even while the Portenta X8 board is capable of storing data locally, it may also be beneficial to send data to the cloud on occasion. This may be achieved by using MQTT to transmit data from the InfluxDB database on the Portenta X8 board to the Arduino IoT Cloud. The arduino-iot-js NPM package makes it simple to configure this connection, however, the necessary procedures are not discussed in this guide. However, for illustrative purposes, the diagram below provides a quick overview of our suggested architecture for one conceivable deployment scenario in a multi-room facility.
Putting It All Together
Now, let's investigate how we could put all of this together and the hardware and software requirements for deployment. The Arduino Pro ecosystem is the most recent version of Arduino solutions that provides consumers with simple integration and scalable, secure, and professionally maintained services. Hardware requirements:- Arduino Nicla Vision
- Arduino Nicla Sense ME
- Arduino Portenta X8
- Enclosures
- Software requirements
- Arduino IDE
- OpenMV IDE
- Edge Impulse account

The Nicla Sense ME was programmed in C/C++ using the Arduino IDE because reading the sensors and sending their data over BLE can be done more quickly, and we do not need to perform intensive computations as we would with video on the Nicla Vision.

With its preinstalled Linux operating system, the Portenta X8 is fully capable of running Docker and containers with a wide variety of functions. In our scenario, we found it most beneficial to store the data in a time series database and show it locally. A pre-built container containing InfluxDB, Grafana, and Node-Red may be quickly deployed to accomplish this goal.
InfluxDB dashboard screenshot of data received from sensor nodes:

Accessing the InfluxDB interface on the Portenta X8 IP at port 8086 via a browser on a PC connected to the same WiFi network enables visualization of the dashboard (for example, http://192.168.1.199:8086/).
Here is an overview of the software stack and how a minimum deployment with one of each hardware module communicates to make the proposed solution work:

It can also be challenging to keep an eye on the environment because it takes so long for data to come in. It's important to have systems in place that can collect data quickly and effectively and make this data available to decision-makers in a timely manner. There are a lot of good reasons to use this solution. First, it lets the people in charge of the building keep an eye on each room and take steps to reduce any risks. Second, it gives a way to find out how many people are in a building, how clean the air is, what the temperature and humidity are, and other things about the environment.
With this information, you can figure out how likely it is that you will be exposed to dangerous materials and take steps to reduce or eliminate those risks. Lastly, our solution is easy to set up and can be used in any office or enclosed environment building.
Arduino creates hardware and software for physical-world interaction, and they provide service to users all around the world. Any user, from novices to experts, can find what they need in our products because of their accessibility, simplicity, and power.