Tutorial
ConnectionDiagram
If you have an IO expansion shield, you can simply insert the PM2.5 sensor adapter onto it, and
you can use the serial to monitor the data.
pm2.5 laser dust
If you have no IO expansion shield, you can follow the wiring diagram to do wiring.
pm2.5 laser dust connecting uno
SampleCode
NOTE: This code can only be verified in ArduinoIDE 1.6.x or above.
//******************************
//*Abstract: Read value of PM1,PM2.5 and PM10 of air quality
//
//*VersionV3.1
//*AuthorZuyang @ HUST
//*Modified by Cain for Arduino Hardware Serial port compatib
ility
//*DateMarch.25.2016
//******************************
#include <Arduino.h>
#define LENG 31 //0x42 + 31 bytes equal to 32 bytes
unsigned char buf[LENG];
int PM01Value=0; //define PM1.0 value of the air dete
ctor module
int PM2_5Value=0; //define PM2.5 value of the air dete
ctor module
int PM10Value=0; //define PM10 value of the air detect
or module
void setup()
{
Serial.begin(9600); //use serial0
Serial.setTimeout(1500); //set the Timeout to 1500ms, lon
ger than the data transmission periodic time of the sensor
}
void loop()
{
if(Serial.find(0x42)){ //start to read when detect 0x42
Serial.readBytes(buf,LENG);
if(buf[0] == 0x4d){
if(checkValue(buf,LENG)){
PM01Value=transmitPM01(buf); //count PM1.0 value of th
e air detector module
PM2_5Value=transmitPM2_5(buf);//count PM2.5 value of t
he air detector module
PM10Value=transmitPM10(buf);
/
/count PM10 value of the
air detector module
}
}
}
static unsigned long OledTimer=millis();
if (millis() - OledTimer >=1000)
{
OledTimer=millis();
Serial.print("PM1.0: ");
Serial.print(PM01Value);
Serial.println(" ug/m3");
Serial.print("PM2.5: ");
Serial.print(PM2_5Value);
Serial.println(" ug/m3");
Serial.print("PM1 0: ");
Serial.print(PM10Value);
Serial.println(" ug/m3");
Serial.println();
}

SEN0177

Mfr. #:
Manufacturer:
DFRobot
Description:
Multiple Function Sensor Development Tools PM2.5 Sensor Module Laser Sensing
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet