Introduction: Airduino: Mobile Air Quality Monitor

About: student Howest MCT

Welcome to my project, Airduino.
My name is Robbe Breens. I am studying multimedia and communication technology at Howest in Kortrijk, Belgium. At the end of the second semester, we have to make an IoT device, which is a great way to bring all the previously acquired development skills together to create something useful. My project is a mobile air quality monitor called Airduino. It measures the particle matter concentration in the air and then calculates the AQI (Air Quality Index). This AQI can be used to determine the health risks, that are caused by the measured concentration of particle matter in the air, and the measures that should be taken by local governments to protect their citizens against these health risks.

It is also important to note that the device is mobile. Currently, there are thousands of static air quality monitoring devices all across Europe. They have a massive downside to them because they cannot be relocated once the product is online. A mobile device enables measurement of the air quality in multiple locations, and even while moving (google street view style). It also supports other features, identifying small local air quality problems (like a poorly ventilated street) for example. Providing so much value in a small package is what makes this project exciting.

I used an Arduino MKR GSM1400 for this project. It is an official Arduino board with a u-blox module that enables 3G cellular communication. Airduino can push gathered data to a server at any time and from anywhere. Also, a GPS module allows the device to locate itself and geolocate the measurements.

To measure the PM (particle matter) concentration, I used an optical sensor setup. The sensor and a beam of light sit at an angle to each other. As particles pass in front of the light, some light is reflected towards the sensor. The sensor registers a pulse for as long as the particle reflects light to the sensor. If the air is moving at a consistent speed, the length of this pulse allows us to estimate the particle’s diameter. These kinds of sensors offer a pretty cheap way to measure PM. It is also important to note that I measure two different types of PM; Particle matter which has a smaller diameter than 10 µm (PM10), and with a smaller diameter than 2.5 µm (PM2,5). The reason they are distinguished is that as particle matter becomes smaller, the health risks become bigger. Smaller particles will penetrate the lungs deeper, which can cause more damage. A high concentration of PM2,5 will, therefore, require more or different measures than with a high level of PM10.

I will show you step-by-step how I created this device in this Instructables post

Step 1: Collecting the Parts

First things first, we have to make sure that we have all the parts required to create this project. Below you can find a list of all the components that I used. You can also download a more detailed list of all the components below this step.

In total I spent around €250 on these parts. It is certainly not the cheapest project.

Step 2: Creating the Circuit

I designed a PCB (printed circuit board) for this project in eagle. You can download the kerber files (files that gives instructions to the machine that will build the PCB) below this step. You can then send these files to a PCB manufacturer. I highly recommend JLCPCB. When you get your boards you can easily solder the components to them using the above electrical schematic.

Step 3: Importing the Database

Now it is time to create the sql database where we will save the measured data.

I will add a sql dump below this step. You will have to install mysql on the Raspberry pi and then import the dump.
This will create the database, users and tables for you.

You can do this using a mysql client. I highly recommend MYSQL Workbench. The link will help you install mysql and import the sql dump.

Step 4: Installing the Code

You can find the code on my github or download the file attached to this step.

You will have to:

  • install apache on the raspberry pi and put the frontend files into the root folder. The interface will then be accesible on your local network.
  • Install all the python packages that are imported into the backend app. You will then be able to run the backend code with your main python interpreter or a virtual one.
  • Port forward the 5000 port of your raspberry pi so that the arduino can communicate with the backend.
  • Upload the arduino code to the arduinos. Make sure you change the Ip adresses and the network operator info of your SIM-card.

Step 5: Building the Case

For the case, the most important thing is that it allows for a good airflow through the device. This is obviously needed to ensure that the measurements made in the device are representable for the air outside the device. Because the device is meant to be used outside, it also has to be rain proof.

To do this I made air holes at the bottom of the case. The air holes are also seperated in a different compartment from the electronics. This makes it so the water has to go up (which it can't) to reach the electronics. I guarded the holes for the arduinos USB port with rubber. So that it seals itself when they are not used.