I live and work in the suburbs of Bucharest, Romania, one of the most polluted cities in Romania (https://www.airvisual.com/romania/bucuresti/bucharest). Things have gotten so bad that currently, Romania is in infringement procedure, triggered by the European Commission. The reason: exceeding, for several years, the limit values of the harmful substances present in the air. Sulfur dioxide, nitrogen dioxide, suspended particulate matter are all way above the limits for long periods.
And what the government does? It cheats! Air quality monitoring stations were placed in the parks, or they have been shielded by Thuja shrubs, creating a microclimate where the measurements are way lower than in the surrounding areas. Most stations on the official air quality map on http://www.calitateaer.ro/public/home-page/?__locale=en show “insufficient data.” An excellent way to ignore the air quality issue.
So, what can one do? A DIY air quality measuring station! Like many other citizen science projects the measurements won’t have any legal effects, and the authorities will probably ignore them. Still, they can help in developing awareness regarding air quality issues. Maybe they will have an impact on making personal decisions to limit exposure to highly polluted air.
Air quality is a big issue, and air quality indices take a lot of variables into account. Building a DIY station that measures all the parameters required to compute AQI is an expensive and challenging task.
There remains the possibility to make sensor nodes that measure a limited number of environmental factors. The sensors to measure PM10 and PM2.5 particulate matter are relatively cheap. Temperature and humidity sensors are also affordable. Add an ESP8266 board, and the whole sensor node will come with a price tag below 100 euro.
Looks familiar? I have just described a luftdaten.info sensor node, a project that was born in OK Lab Stuttgart – part of the Code for Germany program of the Open Knowledge Foundation Germany. Nowadays, there are thousands of luftdaten.info nodes, with new sensors being added every day.
Not surprisingly, most of the sensor nodes are located in Germany. Bulgaria also has a well-represented sensor network. Sadly, Romania is almost blank – a few sensors in Bucharest (including mine), two sensors in Odorheiu Secuiesc, one sensor in Brasov, one in Sibiu and another near Oradea. Too few to make a difference, but it’s a start.
If you are interested in building your sensor node, you should know that it is deceptively simple to assemble. Just follow the instructions on the luftdaten.info page, and you can have the sensor up and running in less than an hour. As such, this won’t be the typical blog post you see here, with code, schematics, etc.
Instead, it is more about my personal experience with building a luftdaten.info node, and some thoughts after I kept the sensor on for a few months.
Building a luftdaten.info node
The first (obvious) step is to gather the required parts:
- ESP8266 module, with USB supply.
- NodeMCU and LoLin modules are fine. ESP8266 Thing modules from Sparkfun don’t work. I don’t know why.
- Enclosure. One can use the plumbing parts as described in the assembling instructions. If you want something fancy, you can 3D print the enclosure, using one of the models in the German FAQ (go to 3D-DRUCK…). I used an enclosure with a transparent lid, with some air vents installed.
Flashing the firmware
Once you have all the parts, the second step is to flash the luftdaten.info firmware. When I started to write this blog post, I have noticed that assembling instructions have changed a bit over time. In particular, nowadays there’s a dedicated tool for flashing of the ESP8266, and things have become more straightforward with it. The instructions for using the new firmware flasher are at https://github.com/opendata-stuttgart/airrohr-firmware-flasher
After flashing, in the lower area of the firmware flasher window, you should see a message “Sensor ID: 1234567”. Write down that number; you will need it later.
An alternate way of flashing firmware:
One can download the latest firmware from https://www.madavi.de/sensor/update/data/ and then use https://github.com/nodemcu/nodemcu-flasher/archive/master.zip to flash the firmware.
Assembling the node
Assembly is so simple that it doesn’t require any supplementary explanations. Just follow the assembling instruction on the luftdaten.info website. English language instructions are at https://luftdaten.info/en/construction-manual/
If you wish to go with other sensors such as the BMP280 or BME280, or if you wish to add an LCD with I2C interface, connect them using the following pins:
- VCC -> Pin 3V3
- GND -> Pin GND
- SCL -> Pin D4 (GPIO2)
- SDA -> Pin D3 (GPIO0)
Don’t forget to change the sensor’s configuration to match the hardware. Restart the sensor once the configuration is completed.
A side note: the FAQ section (in German only) tells us that once registered to luftdaten.info, the configuration of the sensors cannot be changed anymore. Any new or changed component must still be registered with luftdaten.info. So, please read the FAQ section if you do some changes to the hardware. Google Translate can help you :).
Configuring the node
Configure the WiFi: connect your computer/smartphone to the AP feinstaubsensor-<sensorID> and open up http://192.168.4.1/ in a browser. Configure the sensor as described in the construction manual (https://luftdaten.info/en/construction-manual/) on luftdaten.info website.
Once configured, you can access the sensor on your local network by going to http://feinstaubsensor-<sensorID>.local (it might not work on some older operating systems).
You can configure your sensor node to send data to other services, too. In particular, you can send data to openSenseMap. You will need to create an account with openSenseMap.org, and then you will have to create a new senseBox. Choose luftdaten.info as your senseBox model, and select the corresponding configuration from the dropdown list. You can also read my blog regarding logging of H2S data to openSenseMap for more details.
Other possible data integrations are with your own API, or with Influx.db. There is also the possibility to log CSV data, but I’m not going to explore it.
Register the node to the luftdaten.info network
Finally, one more step: open up https://meine.luftdaten.info/ and create a new account (if you don’t have one already) You can manage multiple sensors from the same account.
Once registered to the network, you can manage the sensor from this page. You can mark it as inactive if the sensor goes offline for a long period of time. You can change its geographical location. You can transfer the sensor to another person’s account.
That’s it. Now you can relax and watch the gathered data on the map.
Some other things
- The sensor consumes about 1W, or 8.76 kWh / year.
- Sensor life is estimated at about 4.5 years. This is based on the 8000 hours lifespan of SDS011, and on the fact that the sensor runs for only 20 seconds for every transmit interval of 150 seconds.
- There is the possibility to integrate the sensor with other intelligent house products, such as https://homebridge.io/ or https://www.home-assistant.io/. You will find instructions on how to do this in the German FAQ.
- There is a WordPress plugin to show the sensor data; I don’t like it.