Skip to content

Connection of other sensors

Brenda Nyokabi Bucha edited this page Oct 9, 2019 · 2 revisions

The fine dust sensor firmware supports a whole range of other hardware in addition to the SDS011 and the DHT22. Transducers (sensors) and displays can be connected via the I2C bus.
A description I2C bus is at Wikipedia: https://en.wikipedia.org/wiki/I%C2%B2C

Connected devices must first be activated via the configuration page of the sensor!

General to the I2C

The I2C bus is a 4-wire bus for serial bidirectional communication. In addition to VCC (supply voltage) and GND (ground), two lines will be used for communication. The data is transmitted on the SDA line, the SCL power determines the clock rate and thus the speed of the transmission. All 4 lines are connected to all devices on the bus. Each device on the bus has its own address and can be addressed directly by the master (our nodeMCU). The fine dust sensor firmware supports multiple devices on one bus. All lines to the respective sensors are simply plugged together. So all GND, all SCA and all SCL are to be put together. When power is to be considered whether the hardware requires 3.3V or 5V!
At the fine dust sensor, the I2C bus is available at the following pins:

  • SDA -> Pin D3 (GPIO0)
  • SCL -> Pin D4 (GPIO2)
  • GND -> Pin GND

In addition, for most bus devices also VCC with 3.3V. An exception is the display LCD1602 as I2C version with required 5V.


I2C: BME280 (BMP180, BMP280)

BME280: temperature, rel. Humidity and air pressure
BMP180, BMP280: temperature and air pressure

Soldering necessary!
These sensors are typically supplied mounted on a small board. There is a pin header. To connect connecting cables, the 4 cables must be soldered directly to the board. If the Dumont cable is to be used as with the connection of sensor DHT22 or SDS011, the pin strip can be soldered to the board. (Picture follows)


I2C: HTU21D

Temperature, rel. humidity


I2C: OLED display with 128x64 pixels

A small display for direct display of the measured values ​​as well as status display


I2C: LCD display 1602 as I2C version!

An LCD display 1602 can also be connected as an I2C version to display measured values. Please note the addressing!


OneWire: DS18B20

As an alternative to the intended DHT22 sensor, the temperature sensor DS18B20 can also be used. A simultaneous use of both sensors is not intended!
The DS18B20 is a widely used temperature sensor. It is connected with 3 wires: VCC, GND, DATA. The common version is in a waterproof case with 80-100cm long cable. As a result, the temperature sensor can also be exposed to environmental influences. This sensor has no humidity measurement in contrast to the DHT22.

  • GND -> GND
  • VCC -> VCC 3.3V
  • DATA -> PIN 7 (GPIO 13)   The DS18B20 is usually shipped with bare cable ends. It may be necessary to perform soldering work.

Serial: GPS NEO6M

For the mobile operation of a particulate matter sensor the connection of a GPS module is possible. The firmware supports the popular cheap GPS module NEO6M with a serial port. To do this, the following serial port is used at nodeMCU:

At the air tube pin D5 is defined as RX and pin D6 as TX. For serial connections, RX and TX (receive and transmit) are cross-linked. So a page sending (TX) connected to receiving (RX) of the partner.

  • Pin D5: RX -> To TX from the GPS

  • Pin D6: TX -> To RX from the GPS

  • GND -> GND

  • Note VCC power supply! Typically 3.3V

Unlike the other sensors, the serial port needs to be continually polled. As a result, the GPS data is immediately displayed on the values ​​page and at each retrieval of data are constantly updated. The data of the other sensors are just all 145 seconds (default) to ensure adequate life of the SDS011.


Alternative particulate matter sensors: PMS1003, PMS5003, PMS6003, PMS7003 and PMS3003

Also supported are these sensors.


By now the following Sensors are supported:

  • SDS011   via SoftSerial
  • Plantower PMS1003 to PMS7003   via SoftSerial