Project history and goal
Besides food and water, the air we breathe is of utmost importance for our health. However the air we breathe is sometimes heavily polluted by fine dust particles and several toxic gases. At the long term this has a very adverse effect on our health. Some particles and gases like e.g. black carbon and NO2 cannot be detected by smelling their odor, while these substances are very toxic for the respiratory system. Hence, measuring these substances accurately at low cost would be a big relief to create awareness about the quality of the air we breathe.
In 2016 the university of Stuttgart developed a low cost fine dust meter based on the sensor SDS011 of Nova. This sensor has been chosen for its low cost and measurement accuracy. It can measure particulate matter (PM) of sizes smaller than 10 µm (PM10) and 2.5 µm (PM2.5) by using laser diffraction and optical signal processing.
This project has led to the "luftdaten.info" network to which more than 30.000 fine dust meter stations are connected in 2018 and new stations are connected every day. This network has grown to be the biggest civilian based network for measuring air quality in Western Europe. Each station consists only of three interconnected modules: the SDS011 fine dust sensor, the DHT22 temperature and humidity sensor and the Lolin NodeMCU 1.0 microboard, which contains the ESP8266 microcontroller, an USB-interface and capability to act as Wifi-station as well as Wifi-AP (access point). At first startup the meter acts as a Wifi-AP to perform an initial configuration, after which the meter transforms in a Wifi-station connected to the home network. Hence, sensor data is sent immediately via each home based Wifi-network over the internet to the central database located in Stuttgart.
However, these meter stations measure the fine dust concentration only at fixed locations. Being a frequent bike commuter among roads loaded by dense traffic, the need arose to measure the air quality whilst on the move by bike. Since traffic exhaust, especially from gasoline vehicles, not only contains fine dust but also a lot of NO2, the aim of this project is to measure fine dust (PM10 and PM2.5) as well as NO2 concentration in the air. Sensor data will not be sent directly into the cloud (being an online database server), but is written to a file on a SDcard and (optionally) can be displayed in real time to a 6-digit 7-segment display.
This mobile air quality meter is built around the Arduino Nano microboard. In its simplest and also cheapest version, the Arduino Nano is connected to a SDcard reader via the Serial Peripheral Interface (SPI), the SDS011 fine dust sensor and an Open Smart GPS-module, these latter two sending their data via the classical V24 serial protocol.
The SDcard reader, the GPS-module and the Arduino Nano are plugged into a main PCB which provides all connections between these components in a firm failsafe way, while the SDS011 sensor is connected via a 4-wire flat cable, which is always delivered with this sensor when ordered. The fine dust sensor is attached to the main board with 3 screws.
The main board also houses a DPDT-switch and a simple transistor circuit to take care for a software controlled power-down. This is necessary to prevent power loss during a write cycle to the logfile on the SDcard, which would make the file corrupt or in the worst case would render the SDcard inaccessible. After putting the switch into the off-state, an eventual ongoing write cycle is finished and a timer is started for 2 seconds. If the switch isn't put into the on-state again before timeout, a digital signature is calculated and written to the file before closing it. This signature prevents that the contents of the file can be compromised by editing its data before uploading it to a webserver.
Each time the mobile meter is switched on, a new textfile is created on the SDcard. The name of this file always starts with "log_" followed by a 3-digit sequence number. In the setup of the sketch an algorithm is present to look for the lowest free sequence number to construct a new unique logfile in order to prevent overwriting or appending data to an existing logfile. After a new file is created, the unique IDcode of the mobile meter is written as the first line in the logfile. This IDcode is essential for proper discrimination between all logfiles after these are uploaded to the webserver.
The meter can be enhanced by connecting the DHT22 temperature and humidity sensor and the NO2-sensorboard CJMCU-4541. Measuring humidity is important since extreme low (<10%) and high (>90%) relative humidity has an impact on the fine dust concentration, while temperature is mandatory for calculating the NO2-concentration in µg/m³. When these 3 sensors are present each measurement record is represented by 3 subsequent data lines in the logfile:
- first line contains the PM10, PM2.5 and NO2 concentrations in µg/m³
- second line contains the temperature in °C and relative humidity %
- third line contains the GPRMC sentence containing GPS-coordinates in NMEA-format
Optionally, a 6-digit 7-segment display can be connected to the meter for reading the collected data in real-time while driving. In order to enable this in a secure and comfortable way, the complete set is housed in a waterproof transparant housing which can be opened and closed easily in order to install and remove the SDcard and to replace exhausted batteries. To be able to display all data measured by the three sensors, 4 display modes are provided:
- mode 0 displays PM10 value (0-999) on the left and PM2.5 (0-999) on the right side
- mode 1 displays supply voltage (42-51) on the left and NO2 (0-999) on the right side
- mode 2 displays humidity (0-99) on the left and temperature (0-99) on the right side
- mode 3 display the time: hours (0-23) on the left and minutes (0-59) on the right side
The time in the last display mode is derived from the GPRMC sentences received from the GPS-module. Through these 4 display modes can be rotated by putting the switch in the off state and back to the on state again before the already mentioned 2 second timer expires. When switching to another display mode, first the mode digit is shown for a while to acknowledge the display of a new set of measured data.
Four AA-type batteries are needed to provide 5V directly to the Arduino Nano board, the GPS-module, the SDcard reader, the fine dust sensor and the NO2-sensor. The DHT22-sensor is connected to the 3.3V output of the Arduino Nano board. Batteries may be rechargeable or not. Battery voltage is constantly sampled and when it drops for the first time below 4.3V, writing to the SDcard is inhibited. After 4 readings of the supply voltage below 4.3V, the active logfile will be closed after writing the digital signature to it and software controlled power down is deactivated so that the device will be switched off immediately when putting the switch in the off position. This voltage monitoring mechanism prevents file corruption or a damaged SD-card due to battery exhaustion.
It's also possible to connect an external warning device to the mobile fine dust meter, like e.g. a flash light or a buzzer to alert the environment that the health hazard threshold of 200 µg/m³ PM10 concentration has been exceeded.
In the image below two photos have been merged showing the internal arrangement of all components on both sides of the plastic housing after it has been opened. This is the prototype of the mobile meter with the display.