Skip to content

Arduino library for SDS011 dust sensor

Notifications You must be signed in to change notification settings

sensebox/SDS011-select-serial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDS011 library selectable serialport

Arduino library for dust Sensor SDS011 (Nova Fitness Co.,Ltd) which allows to choose the serial port used to communicate with the sensor. Based on the work of ricky-z

Tested with Arduino Mega 2560 and senseBox MCU.

Usage

  • Define SDS object:
SDS011(Stream& serial);

i.e. SDS011 mySDS(Serial1);

  • Start serial communication:
Serial1.begin(9600);
  • 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.