Examples

AIR Quality monitoring using RoboFuse IoT platform

65 views 0

Motivation

Air quality is one of the aspects of life that we overlook in our daily routine because we start from the premise that everything is ok! We become very aware of when air quality affects our health. Sensitive people such as children, people with heart disease, and other respiratory illnesses are more likely to notice these dangerous situations.

Air quality varies significantly even in a small region, as pollution can build up around industrial or overcrowded areas. So it’s essential to keep an eye on what’s going on nearby. To learn more about AQI (Air Quality Index) and the state of air quality in cities across Europe, visit this link.

The air quality can be monitored using an IoT device that captures the data using various sensors, and then stores the data in RoboFuse Cloud for further analysis.

There are different types of hardware equipment you can use to measure multiple important air quality parameters: PM2.5, atmospheric pressure, temperature, humidity, CO2, and low levels of volatile organic compounds (VOCs).

 

 

RoboFuse DIY Device

If you want to use DIY equipment, you can use the following instructions.

You will need a microcontroller (based on ESP32) and sensors. You can use ESP32-EVB from https://www.olimex.com/Products/IoT/ESP32/ESP32-EVB/open-source-hardware as the mainboard and MOD-ENV https://www.olimex.com/Products/Modules/Sensors/MOD-ENV/open-source-hardware to measure atmospheric pressure, temperature, humidity, CO2, and low level of VOC typically found in indoor spaces.

DIY – Air Quality RoboFuse Device

 

Measured parameters

PM2.5

Particles in the air with a diameter of about 2.5 microns

Particles are the most harmful forms of air pollution, which are a complex mixture of microscopic particles and drops of liquid. These particles enter the alveoli of the lungs causing inflammation and poisoning.

Rules

LAW no. 104 of June 15, 2011 / Particles in suspension – PM10

Limit values:

– 50 ug / m3 – daily limit value for the protection of human health

– 40 ug / m3 – annual limit value for the protection of human health

LAW no. 104 of June 15, 2011 / Suspended particles – PM2.5

Target value:

– 25 ug / m3 – annual target value

Limit values:

– 25 ug / m3 – the annual limit value to be reached by 1 January 2015

– 20 ug / m3 – the annual limit value to be reached by 1 January 2020- 25 ug / m3 – annual target value

Limit values:

– 25 ug / m3 – the annual limit value to be reached by 1 January 2015

– 20 ug / m3 – the annual limit value to be reached by 1 January 2020

CO2

Carbon monoxide is a colorless, odorless, tasteless gas that forms both naturally and anthropogenically. It’s generated primarily by the incomplete combustion of fossil fuels.

It is a toxic gas, in high concentrations being lethal (at concentrations of about 100 mg / m3) by reducing the ability to transport oxygen in the blood, with consequences on the respiratory and cardiovascular systems.

LAW no. 104 of June 15, 2011 / Carbon monoxide – CO

Limit values: 10 mg / m3 – limit value for the protection of human health (maximum daily average of 8 hours)

VOC and Ozon

Volatile organic compounds, or VOCs, are organic emissions from many products used every day, like laundry detergent, detergents, air fresheners, paint, and so forth. They can cause headaches, eye irritations, skin reactions, and dizziness.

The oxidizing gas ozone is very reactive, with a stifling odor. In the soil, ozone is a component of “photochemical smog”, which is caused by reactions between nitrogen oxides and volatile organic compounds.  It concentrates in the stratosphere and protects against life-threatening UV radiation. The concentration of ozone in the soil causes respiratory tract irritation and eye irritation. High concentrations of ozone can reduce respiratory function.

LAW no. 104 of June 15, 2011 / Ozone – O3

Alert threshold – 240 ug / m3 – the average per 1 h

Target values:

– 120 ug / m3 – target value for the protection of human health (maximum daily average of 8 hours)

– 18,000 ug / m3 x h (AOT40) – target value for vegetation protection (mediation period: May – July)

Long-term goal

– 120 ug / m3 – long-term goal for the protection of human health (maximum daily average of 8 hours in a calendar year)

– 6000 ug / m3 x h (AOT40) – long-term goal for vegetation protection (mediation period: May-July)

Setting up the device

Once the hardware is assembled, in the case of DIY, it is necessary to install firmware and possible configurations within the platform. Each device has a unique serial-identifier number that must be defined when the firmware is installed.

Firmware

Besides the hardware, you’ll need to build and flash the firmware. Take the sources from the firmware repository and open robofuse.ino in either Arduino IDE or Sloeber. Before building the firmware, you’ll need to decide on the device id. The id should be unique to your Robofuse instance. In the sources, the default value is “0000000000000000000000000000” (defined in robofuse_core.h). You should change that to something unique to be used immediately after the firmware is flashed.  If the device keeps the default value it can be updated anytime by connecting it to a serial port and sending a / command with the new device id.

Once the firmware is built, you will have to connect the device to a PC using USB and write the firmware using a flash tool (platform-specific, you’ll need to check the instructions from your board manufacturer or Espressif). For Linux, you can use the flash.sh script from repo (it’s a wrapper around esptool.py with default values filled in).

After the firmware is flashed you can restart the device. If you connect using an ethernet (wired) cable it will try to take an IP. If you want to use WiFi just wait 15 seconds. It will set up a WiFi network with SSID ROBOFUSE-%4%5%6 where %4,%5, and %6 are the last 3 bytes from the MAC address. The password is RF%6x%4XTF%3XSB0 where %3, %4, %6 are the bytes 3, 4, and 6 from the mac address. Connect to 10.10.10.10 from a mobile device or computer and set up a new connection to your network (AP).

Settings

When the device is initialized, it connects to the “Activated” cloud service, from where it receives the connection data and other details.

More details can be found in the documentation: https://docs.robofuse.com/documentation/interfacing-device/activate-asset/

The data from the sensors are processed according to the parameters defined in the values:

– “sensors_reading_frq”: – sensor reading frequency

– “log_freq”: 5, – frequency of data transmission in the cloud

– “protocol”: “MQTT / wot”, – the protocol used – MQTT or WoT

If you are using a RoboFuse server on another domain, a firmware change is required.

Setting up the cloud solution

Register on Robofuse.com if you have not already and login.

Go to Application and Create a new application, let’s assume that PIOT2021 is your created application.

As soon as you open the app, you will need to navigate to RoboFuse / Asset where you will need to add your device. To do this, you will need the serial number generated when you installed the firmware.

Let’s assume that the device ID is: Ru9iHh8QSKEJvXvytq9Ws1iq0nU1

You need to “Add New”, then just complete the definition of the device.

More details about device management:

https://docs.robofuse.com/documentation/robofuse-control-panel/asset-management/

Once you complete, Save.

Now navigate to the structure tab and add the desired settings, as shown below.

{ 
"device_settings": {
"device_time_zone": "Europe.Bucharest",
"sensors_reading_frq": 4,
"log_freq": 60,
"protocol": "wot"
},
"gateway": {
}
}

Probably you do not know what sensors IDs you’re attaching to the device. After activation on the “gateway” field, an array of all sensors will automatically appear.

For easy processing at “protocol” keep the “wot” instead of “MQTT”. If you need to use MQTT then additional configuration steps are needed – follow instructions: https://docs.robofuse.com/documentation/robofuse-control-panel/message-queue/

Save again and if you selected “wot” you are ready to start your device and acquire data.

Check your data

Now you can check if data arrived on the RoboFuse cloud.
A fast method is to use the api.robofuse.com / “measurement_devices_summary” and “/measurement_devices” endpoint.

The Swagger interface is available at: api.robofuse.com

Was this helpful?

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close