Skip to content

How to use SDS011 as a mobile PM sensor

MagTun edited this page Aug 17, 2019 · 9 revisions

Important: when you use your sensor as a mobile sensor, if you allow on the configuration page (on the IP address) to send the data to Luftdaten.info, you should mark your sensor as an Indoor sensor at my.luftdaten.info. Otherwise the "static" location info might be used by people that want to work with the data from Luftdaten. Indoor sensors should normally be filtered out by them.

How to easily go around with your PM sensor: turn it into a small cube that fits into a small box!

To use your sensor as a mobile, it's a good idea to pack the NodeMCU and the sensor into a small cube size. Here is one way of doing it using PCB standoff spacer column:

You can then make a box for it. Here is a simple one made with cardboard:

How to get the PM data

Option 1: with a screen

● You can simply output the sensor data on a screen.

● You need to choose the one you have among the 4 screens given in the configuration:

● You also need to connect the screen to the NodeMCU:

Screen NodeMCU
VCC -> Pin 3V3
GND -> Pin GND
SCL -> Pin D4 (GPIO2)
SDA -> Pin D3 (GPIO0)

Inconvenient:

  • The screen display many different information in a loop (Wifi network, name of Sensor, temp...) so you will need to wait for the loop to complete to get your PM value
  • If there is no wifi network to which the NodeMCU can connect, it will first goes in "access point mode". By default, it will stay 10 minutes in this mode before starting to measure the PM value. The time spent in Access point mode can be set to a lower value in Configuration > "Duration router mode" (but under some circonstance, if you set a value too low, it can result in unwanted situation: cf this issue)

You need:

  • an SDS011 and a NodeMCU with the Luftdaten firmware installed
  • a way to power the sensor (ex: battery, USB charger...)

Option 2: read the sensor with your Android device using a USB cable

How it works: The SDS011 is connected via a USB cable adapter to an Android device and the data are retrieved in an app.

Advantages:

  • live measurement
  • no NodeMCU
  • the Android device powers the sensor via USB so no need for an external battery or a USB charger

Inconvenient:

  • the sensor is always switched on and there is no interval between the measurements ― ⚠ this significantly reduces the sensor life span ⚠― but you can simply plug the USB cable for a couple of seconds to get a reading and then unplug it
  • it doesn't save the data

You need:

Steps:

  • Download the MobileFeinstaub.apk, transfer it on your Android, an install.
  • Connect together the SDS011, the data cable, the USB key, the Micro-USB-to USB Adapter, your Android
  • Open MobileFeinstaub app. If needed allow the USB connection

Option 3: read the sensor data using a device with a wifi hotspot (no internet connection required)

How that work: The SDS011 is connected to a NodeMCU with the Luftdaten software installed and the data are sent to a phone via it Wifi hotspot (a connection to the internet isn't required unless you want to save the PM values).

Advantages:

  • intervals between measurement (this saves the lifespan of the sensor)

Inconvenient:

  • you need a way to power the sensor: USB charger or battery

In brief: first you create a hotspot on your phone. When the NodeMCU starts, it looks for a Wifi connection, if it can't connect to a Wifi, the NodeMCU creates its own hotspot. With your smartphone, you connect to this hotspot which allows you to change the settings of the network it should connect. When you restart the NodeMCU, it will connect to the network (in this case your phone hotspot). Then you get the PM values via the web page generated by the NodeMCU.

You need:

  • an SDS011 and a NodeMCU with the Luftdaten firmware installed
  • a device with Wifi hotspot capacity (ex: a smartphone, a tablet, a laptop...)
  • a way to power the sensor (ex: battery, USB charger...)

Steps:

  • On your device, create a hotspot. Copy the name and the password. Do not switch the hotspot ON yet
    • On Windows 10 you can create a hotspot by going Settings > Network & Internet > Mobile hotspot
    • On Android, go to Settings > Wireless & Networks > More > Tethering & portable hotspot

If you can access your sensor via its IP address(ex: you sensor is already connected to your Home wifi):
- Go to the configuration page (it should be something like http://192.168.1.15/config)
- Change the name and the password under "WiFi Settings" to your hotspot name and password

If you don't know your sensor IP:
- If your sensor is connected to a Wifi, switch the wifi off, or change the wifi password or take the sensor out the range of the wifi
- Restart your NodeMCU (by unplugging/re-plugging it or pressing the "reset" button). The NodeMCU will create a hotspot (it switch to "access point mode")
- On your device (smartphone, laptop...), go to the list of available Wifi and click on "Feinstaubsensor-ID", - On your device, open a browser and go to the URL 192.168.4.1
- Enter your hotspot name and password and click "save and restart", wait 30 secs.

  • Unplug your NodeMCU, switch on your hotspot, plug the NodeMCU and wait 30 sec.
  • To see if the NodeMCU is connected to your hotspot:
  • On your device, open a browser, enter the IP address of your sensor: you should see the home page of Luftdaten where you can get the PM values by clicking on "Current Data" (the data and the HTML formating are generated by the NodeMCU)
  • If you have an internet connection on your device (ex: 3G/4G/5G), the measurement will be transmitted to Madavi (and Luftdaten map if you registered) and the other APIs you added (like OpenSenseMap). If there is no connection, the measurements will be only displayed but not saved.

Seiten

Dokumentation

Protokolle

for more, see Protokolle

Clone this wiki locally