The stationary particle matter sensor

Unfortunately the website of luftdaten.info is in German, but they are working on an english translation.
I will provide this translation here as a courtesy.

This sensor is inteded to hang outside your house and continously measure the air quality there. It will send it’s data to the map of luftdaten.info.

What you have to buy:

NodeMCU ESP8266, CPU/WLAN
SDS011 Particle matter sensor
DHT22, Temperature & Humidity (optional)
Du Pont Cable
USB Cabel z.B: flach 2m Micro-USB
– USB power supply (you can use an old phone charger)
– you need a 6mm plastic hose
– Marley Silent HT Bogen or other housing, but it should not make a chimney effect.
If you want a diffrent case you find instructions here.

(The links on this website will direct you to AliExpress in China. This is where you will get the items very cheaply but you will have to wait about 6 weeks for delivery. If you order one piece you stay below the 22 Euros import tax.
However the NodeMCU has no CE sign. So you can also order it from these vendors in the eU: Elektor Verlag odr EXP Tech: here)

Now for the actual building of the sensor

How to connect:
First put in the right firmware then build the sensor.

Install USB2Serial driver
To communicate with the ESP8266, it needs usb2serial driving. The chipset for NocdeMCUs is usually CH341: driver’s side (Chinese).

Linux: no installation required, chip should be directly supported (dmesg verifiable)

MacOS: for Sierrra see these successfully tested instructions: https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver

Windows: TBA (possibly manufacturer driver try, s.o.)

Raspberry Pi: try https://github.com/aperepel/raspberrypi-ch340-driver

 

Firmware

Instructions for copying
Caution: For copying to the NodeMCU, use a USB cable of no more than 1m in length.

Arduino software, install firmware

Download and install the Arduino: https://www.arduino.cc/en/Main/Software

In the settings in the Additional Board Manager URLs box, insert this URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json

Go to „Tools -> Board … -> Board Administrator“ for „esp8266“ and install „esp8266 by ESP8266 Community“

Download the firmware https://www.madavi.de/sensor/update/data/latest.bin

The firmware is updated regulary to add new functions, like new languages. There is a little box inside the firmware that says „auto updates“ you should leave this box ticked if you want to keep your sensor firmware current.

Windows

Open the command line or PowerShell under Windows

Windows: % USERPROFILE% \ AppData \ Local \ Arduino15 \ packages \ esp8266 \ tools \ esptool \ 0.4.9 \ esptool.exe -vv -cd nodemcu -cb 57600 -ca 0x00000 -cp COM11 -cf path_to_downloaded_firmwarefile (the port behind, Cp ‚must be adjusted if necessary)

For example, the appropriate port is obtained by connecting the NodeMCU to the desired port and then starting the Arduino IDE. Under, Tools -> Port ‚the available port can be seen, usually the port with the NodeMCU is quite easy to recognize. Then close the IDE again because otherwise this port is blocked.

Mac / Linux

Linux / MacOS open the terminal

Linux: ~ / .arduino15 / packages / esp8266 / tools / esptool / 0.4.9 / esptool -vd -cd nodemcu -cb 57600 -ca 0x00000 -cp /dev/cu.wchusbserial1410 -cf path_to_downloaded_firmwarefile (the port behind, -cp ‚ Must be adjusted if necessary)

MacOS: ~ / Library / Arduino15 / packages / esp8266 / tools / esptool / 0.4.9 / esptool -vd -cd nodemcu -cb 57600 -ca 0x00000 -cp /dev/cu.wchusbserial1410 -cf Path_to_downloaded_firmwarefile (the port behind, -cp ‚Must be adjusted if necessary)

If problems occur, try to execute the above command as root. Then, in the path, ~ / ‚must be replaced by the home directory.

On my mac I simply downloaded the latest bin to the download folder: ~/Library/Arduino15/packages/esp8266/tools/esptool/0.4.9/esptool -vv -cd nodemcu -cb 57600 -ca 0x00000 -cp /dev/cu.wchusbserial1410 -cf ~/Downloads/latest.bin

Mine looks like this:
~/Library/Arduino15/packages/esp8266/tools/esptool/0.4.9/esptool -vv -cd nodemcu -cb 57600 -ca 0x00000 -cp /dev/cu.wchusbserial1410 -cf /Users/sbamueller2/Downloads/latest.bin

(you should be able to just copy and paste this on the terminal application in your MacBook, but change the sbamueller2, which is the name of my harddisk to the name of your harddisk)

For example, the appropriate port is obtained by connecting the NodeMCU to the desired port and then starting the Arduino IDE. Under, Tools -> Port ‚the available port can be seen, usually the port with the NodeMCU is quite easy to recognize. Then close the IDE again because otherwise this port is blocked.

For Linux, there is a script in sensors-software / utils / flash /, which can also delete an existing configuration:  Https://github.com/opendata-stuttgart/sensors-software/tree/master/utils/flash

 

SDS011

  • SDS011 Pin 1 -> Pin D1 / GPIO5
  • SDS011 Pin 2 -> Pin D2 / GPIO4
  • SDS011 Pin 3 -> GND
  • SDS011 Pin 4 -> unused
  • SDS011 Pin 5 -> VU (NodeMCU v3) / VIN (NodeMCU v2)
  • SDS011 Pin 6 -> unused
  • SDS011 Pin 7 -> unused

DHT22

  • DHT22 Pin 1 -> Pin 3V3 (3.3V)
  • DHT22 Pin 2 -> Pin D7 (GPIO13)
  • DHT22 Pin 3 -> unused
  • DHT22 Pin 4 -> Pin GND

Configuration of the sensor

Connect the set up  to the power cable

The sensor attempts to connect to the configured WLAN access point. If this does not work, the sensor opens an access point with the name „Feinstaubsensor ID“, where ID is the chip ID (some number).

Then in the browser open the page http://192.168.4.1/ here you can configure the sensor: -> Configure

Please note: If the configuration of the sensor has worked, this page is no longer available. The wifi hot spot will be closed, this is how you notice that it worked.

Under ‚Configure‘ enter SSID and password of your own network, store

For Particle Matter sensors nothing else needs to be changed.

Reboot the sensor by clicking on the button at the bottom of the next page

 

Last steps

In order for the sensor to become a part of the network, we need some information.

Send an Email to rajko@codefor.de with the following data:

  • Your ID of the ESP8266 (NodeMCU) -> comes as number in the WLAN
  • Your address: street with house number, zip code and place -> we make your coordinates from this (will be published only rounded)
  • The environment of the station – eg height above ground, street side, high traffic, free space or the like
  • Your email address will not be published.
  • If possible an image, where the sensor hangs – will not be published.

Usually the people from Luftdaten info will put your sensor on a map within a couple of days.

 

Some hints

You will find the map with the sensor here: http://deutschland.maps.luftdaten.info/

For some english explanations of this project see my blog entry or look at this very good article in Open Source.
See the entry on my blog about this.
Or the google doc.