Arduino library for SDS011 dust sensor
Switch branches/tags
Clone or download
ricki-z Merge pull request #18 from misan/master
Added support for ESP32 architecture
Latest commit a6db03b Nov 23, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Fix weird error in Windows' Arduino IDE Nov 23, 2018
.gitignore Merge branch 'master' of Jul 1, 2018
LICENSE Create LICENSE Jun 18, 2017 Update Nov 23, 2018
SDS011.cpp Fix for ESP32 Nov 21, 2018
SDS011.h Fix for ESP32 Nov 21, 2018 Fix for ESP32 Nov 21, 2018


Arduino library for dust Sensor SDS011 (Nova Fitness Co.,Ltd)
This library uses SoftSerial or HardwareSerial to connect to the SDS011.


  • Define SDS object: i.e. SDS011 mySDS;

  • Start object: void begin(pinRX,pinTX); i.e. mySDS.begin(pinRX,pinTX);

  • Read values: int read(float *p25, float *p10); i.e. error = mySDS(&pm25,&pm10);

Reads the PM2.5 and PM10 values, return code is 0, if new values were read, and 1 if there were no new values.

Alternative with HardwareSerial

  • SDS object can also be initialized with a Serial object as parameter
SDS011 mySDS;

HardwareSerial objects need to be defined if using ESP32