Laser Dust PM2.5 + PM10 Air Quality Sensor
The Laser PM2.5 Sensor is a new generation of laser dust detection sensor, which is used for continuous and real-time detection of dust in the air.

Different from the pumping dust detection sensor, the HM-3301 innovatively uses fan blades to drive air, and the air flowing through the detection chamber is used as a test sample to perform real-time and continuous test on dust of different particle sizes in the air.

This module is suitable for dust detectors, intelligent air purifiers, intelligent air conditioners, intelligent ventilation fans, air quality testing, haze meters, environmental monitoring and relative products and applications

Features
~ High sensitivity on dust particles of 0.3 μm or greater
~ Real-time & continuous detection of dust concentration in the air
~ Based on laser light scattering technology, readings are accurate, stable, and consistent
~ Low noise
~ Ultra-low power consumption

Specifications
Operating Voltage 3.3V / 5V
Operating temperature -10~60℃
Operating humidity 10%~90%RH (non-condensing)
Particle size 3 channels-- 2.5µm, 5µm, 10µm
Range
(PM2.5 standard value) 1~500µg/ m3 (Effective range)
1000 µg/ m3 (Maximum range)
Resolution Concentration: 1µg/ m3
Counting concentration: 1s/0.1L
Stability time 30 seconds after power-on
Interface I2C
I2C address 0x40

Typical applications
Air purifier / air conditioner
Air quality testing equipment
Industrial PM value analysis
Dust and smoke detection and analysis
Real-time PM2.5, PM10, TSP detector
Multichannel particle counter
Environmental testing equipment

desc1

Working Principle
The HM-3301 Dust Sensor is based on the advanced Mie scattering theory. When light passes through particles with quantity same as or larger than wavelength of the light, it will produce light scattering. The scattered light is concentrated to a highly sensitive photodiode, which is then amplified and analyzed by a circuit. With specific mathematical model and algorithm, the count concentration and mass concentration of the dust particles is obtained.

The HM-3301 dust sensor is composed of main components such as a fan, an infrared laser source, a condensing mirror, a photosensitive tube, a signal amplifying circuit and a signal sorting circuit.

desc2

Connections 
Arduino Sensor
GND GND
5V or 3.3V VCC
SDA SDA
SCL SCL

#include "Seeed_HM330X.h"

#ifdef  ARDUINO_SAMD_VARIANT_COMPLIANCE
  #define SERIAL SerialUSB
#else
  #define SERIAL Serial
#endif


HM330X sensor;
u8 buf[30];


const char *str[]={"sensor num: ","PM1.0 concentration(CF=1,Standard particulate matter,unit:ug/m3): ",
                    "PM2.5 concentration(CF=1,Standard particulate matter,unit:ug/m3): ",
                    "PM10 concentration(CF=1,Standard particulate matter,unit:ug/m3): ",
                    "PM1.0 concentration(Atmospheric environment,unit:ug/m3): ",
                    "PM2.5 concentration(Atmospheric environment,unit:ug/m3): ",
                    "PM10 concentration(Atmospheric environment,unit:ug/m3): ",
                    };

err_t print_result(const char* str,u16 value)
{
    if(NULL==str)
        return ERROR_PARAM;
    SERIAL.print(str);
    SERIAL.println(value);
    return NO_ERROR;
}

/*parse buf with 29 u8-data*/
err_t parse_result(u8 *data)
{
    u16 value=0;
    err_t NO_ERROR;
    if(NULL==data)
        return ERROR_PARAM;
    for(int i=1;i<8;i++)
    {
         value = (u16)data[i*2]<<8|data[i*2+1];
         print_result(str[i-1],value);

    }
}

err_t parse_result_value(u8 *data)
{
    if(NULL==data)
        return ERROR_PARAM;
    for(int i=0;i<28;i++)
    {
        SERIAL.print(data[i],HEX);
        SERIAL.print("  ");
        if((0==(i)%5)||(0==i))
        {
            SERIAL.println(" ");
        }
    }
    u8 sum=0;
    for(int i=0;i<28;i++)
    {
        sum+=data[i];
    }
    if(sum!=data[28])
    {
        SERIAL.println("wrong checkSum!!!!");
    }
    SERIAL.println(" ");
    SERIAL.println(" ");
    return NO_ERROR;
}


/*30s*/
void setup()
{
    SERIAL.begin(115200);
    delay(100);
    SERIAL.println("Serial start");
    if(sensor.init())
    {
        SERIAL.println("HM330X init failed!!!");
        while(1);
    }

}



void loop()
{
    if(sensor.read_sensor_value(buf,29))
    {
        SERIAL.println("HM330X read result failed!!!");
    }
    parse_result_value(buf);
    parse_result(buf);
    SERIAL.println(" ");
    SERIAL.println(" ");
    SERIAL.println(" ");
    delay(5000);
}

Output:

Serial start
0   
FF  0  0  0  2D   
0  3F  0  45  0   
22  0  32  0  3B   
0  0  0  0  0   
0  0  0  0  0   
0  0   

sensor num: 0
PM1.0 concentration(CF=1,Standard particulate matter,unit:ug/m3): 45
PM2.5 concentration(CF=1,Standard particulate matter,unit:ug/m3): 63
PM10 concentration(CF=1,Standard particulate matter,unit:ug/m3): 69
PM1.0 concentration(Atmospheric environment,unit:ug/m3): 34
PM2.5 concentration(Atmospheric environment,unit:ug/m3): 50
PM10 concentration(Atmospheric environment,unit:ug/m3): 59


PM1 + PM2.5 + PM10 Air Quality Sensor

This is a laser dust sensor is a digital universal particle concentration sensor,it can be used to obtain the number of suspended particulate matter in a unit volume of air within 0.3 to 10 microns, i.e the concentration of particulate matter, and output with digital interface The Air Quality sensors can be embedded in a variety of concentrations of environment-related instruments suspended particulate matter in the air, to provide timely and accurate concentration data.

How it works?
And pm2.5 sensor uses a laser scattering theory. And, the scattering of laser irradiation in the air suspended particles, while collecting the scattered light at a specific angle, to obtain the scattering intensity versus with time curve. The function of the time domain and frequency domain by the Fourier transform, and then through a series of complex algorithms to obtain the number of particles in the equivalent particle size and volume units of different size. :

desc1

Specification
Operating voltage: 4.95 ~ 5.05V
Maximum electric current: 120mA
Measuring pm diameter: 0.3-1.0, 1.0-2.5, 2.5-10(um)
Measuring pm range: 0~500 ug/m3
Standby current: ≤200 uA
Response time: ≤10 s
Operating temperature range: -20 ~ 50C
Operating humidity range: 0 ~ 99% RH
Maximum size: 65 × 42 × 23 (mm)
MTBF: >= 5 years
Quick response
Standard serial input word output
Second-order multi-point calibration curve
The minimum size of 0.3 micron resolution

Power supply quality requirements:

Voltage ripple: less than 100mV.
The power supply voltage stability: 4.95 ~ 5.05V.
Power supply: more than 1W (5V@200mA).
The upper and lower electric voltage surge is less than 50% of the system power supply voltage.

desc2
Pin 1 VCC Positive Power
Pin 2 GND Negative Power
Pin 3 SET Mode setting (More hereof later)
Pin 4 RXD Receive serial port pin (3.3V level)
Pin 5 TXD Transferring serial port pin (3.3V level)
Pin 6 RESET Reset
Pin 7/ 8 NC NUll

* SET: * SET = 1, the module works in continuous sampling mode, it will upload the sample data after the end of each sampling. (The sampling response time is 1S) SET = 0, the module enters a low-power standby mode RESET: leave it empty is OK.

desc4

 //*The RX pin on the sensor connects to pin 10 on the Arduino
 //*The TX pin on the sensor connects to pin 11 on the Arduino

#include <Arduino.h>
#include <SoftwareSerial.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 detector module
int PM2_5Value=0;         //define PM2.5 value of the air detector module
int PM10Value=0;         //define PM10 value of the air detector module

SoftwareSerial PMSerial(10, 11); // RX, TX

void setup()
{
  PMSerial.begin(9600);
  PMSerial.setTimeout(1500);
  Serial.begin(9600);
}

void loop()
{
  if(PMSerial.find(0x42)){
    PMSerial.readBytes(buf,LENG);

    if(buf[0] == 0x4d){
      if(checkValue(buf,LENG)){
        PM01Value=transmitPM01(buf); //count PM1.0 value of the air detector module
        PM2_5Value=transmitPM2_5(buf);//count PM2.5 value of the 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();
    }

}
char checkValue(unsigned char *thebuf, char leng)
{
  char receiveflag=0;
  int receiveSum=0;

  for(int i=0; i<(leng-2); i++){
  receiveSum=receiveSum+thebuf[i];
  }
  receiveSum=receiveSum + 0x42;

  if(receiveSum == ((thebuf[leng-2]<<8)+thebuf[leng-1]))  //check the serial data
  {
    receiveSum = 0;
    receiveflag = 1;
  }
  return receiveflag;
}

int transmitPM01(unsigned char *thebuf)
{
  int PM01Val;
  PM01Val=((thebuf[3]<<8) + thebuf[4]); //count PM1.0 value of the air detector module
  return PM01Val;
}

//transmit PM Value to PC
int transmitPM2_5(unsigned char *thebuf)
{
  int PM2_5Val;
  PM2_5Val=((thebuf[5]<<8) + thebuf[6]);//count PM2.5 value of the air detector module
  return PM2_5Val;
  }

//transmit PM Value to PC
int transmitPM10(unsigned char *thebuf)
{
  int PM10Val;
  PM10Val=((thebuf[7]<<8) + thebuf[8]); //count PM10 value of the air detector module
  return PM10Val;
}

Expected Results
Please wait 30s for the data.

desc5



desc6


PM 2.5 + Formaldehyde + Temp + Humidity Air Quality Sensor

As a particle concentration sensor and can have used to obtain the number of suspended particles in the air by laser. The sensor can be inserted into variable instruments related to the environment parameters in the air or other environmental improvement equipments to provide correct data in time.

Features
Zero false alarm rate
Real-time response
Correct data
Minimum distinguishable particle diameter: 0.3 micrometer
High anti-interference performance because of the patent structure of
Optional direction of air inlet and outlet in order to adapt the different design
Concentration of Formaldehyde output
Temperature and Humidity output

Specification
Operating Voltage: 5.0VDC
Active Current: 100 mA
Standby Current: ≤200 uA
Interface Level: L< 0.8V@3.3V ; H> 2.7V@3.3V
Particle Range of measurement: 0.3 ~ 1.0μm; 1.0 ~ 2.5μm; 2.5 ~ 10μm
Particle Counting Efficiency: 50%@0.3μm 98%@>=0.5μm
Particle Effective Range (PM2.5 standard): 0 ~ 500μg/m
Particle Maximum Range (PM2.5 standard): >0 ~ 2000ug / m3
Particle Resolution: 1ug / m3
Particle Maximum Consistency Error (PM2.5 standard data):
±10%@100~500μg/m3
±10μg/m3@0~100μg/m3
Particle Standard Volume: 0.1 L
Formaldehyde Effective Range: 0 ~ 1 mg / m3
Formaldehyde Maximum Range: 0 ~ 2 mg / m3
Formaldehyde Resolution: 0.001
Formaldehyde Maximum Consistency Error: <± 5%
Temperature Maximum Range: -10~50 °C
Temperature Resolution: 0.1 °C
Temperature Maximum Error: ± 0.5 °C
Humidity Maximum Range: 0 ~ 99%
Humidity Resolution: 0.1%
Humidity Maximum Error: ± 2%
Default Baud rate: 9600bps
Total Response time: ≤ 10s
Operating Temperature Range: -10 ~ +60 °C
Working Humidity Range: 0~99%
MTTF: ≥ 3 years
Dimension: 50x38x21 mm / 1.97x1.50x0.83 inches
Weight: 50g

desc1

PIN1 VCC 5V
PIN2 GND GND
PIN3 SET Set pin /TTL level@3.3V ,high level or suspending is normal working status, while low level is sleeping mode.
PIN4 RXD Serial port receiving pin/TTL level@3.3V
PIN5 TXD Serial port sending pin/TTL level@3.3V
PIN6 RESET Module reset signal /TTL level@3.3V , low reset.
PIN7 NC
PIN8 NC


Sample Code

#include <SoftwareSerial.h>
SoftwareSerial Serial1(10, 11); // Software RX, TX
char col;
unsigned int PMSa = 0,FMHDSa = 0,TPSa = 0,HDSa = 0,PMSb = 0,FMHDSb = 0,TPSb = 0,HDSb = 0;
unsigned int PMS = 0,FMHDS = 0,TPS = 0,HDS = 0,CR1 = 0,CR2 = 0;
unsigned char buffer_RTT[40]={};     //Serial buffer; Received Data
char tempStr[15];
void setup()
{
  Serial.begin(115200);
  Serial1.begin(9600);

}

void loop()
{
  while(!Serial1.available());
  while(Serial1.available()>0)        //Data check: weather there is any Data in Serial1
  {
    for(int i=0;i<40;i++)
    {
      col =Serial1.read();
      buffer_RTT[i]=(char)col;
      delay(2);
    }

    Serial1.flush();

    CR1 =(buffer_RTT[38]<<8) + buffer_RTT[39];
    CR2 = 0;
    for(int i=0;i<38;i++)
      CR2 += buffer_RTT[i];
    if(CR1 == CR2)                         //Check
    {
PMSa=buffer_RTT[12];         //Read PM2.5 High 8-bit
      PMSb=buffer_RTT[13];         //Read PM2.5 Low 8-bit
      PMS=(PMSa<<8)+PMSb;          //PM2.5 value
      FMHDSa=buffer_RTT[28];         //Read Formaldehyde High 8-bit
      FMHDSb=buffer_RTT[29];         //Read Formaldehyde Low 8-bit
      FMHDS=(FMHDSa<<8)+FMHDSb;     //Formaldehyde value
      TPSa=buffer_RTT[30];          //Read Temperature High 8-bit
      TPSb=buffer_RTT[31];          //Read Temperature Low 8-bit
      TPS=(TPSa<<8)+TPSb;        //Temperature value
      HDSa=buffer_RTT[32];          //Read Humidity High 8-bit
      HDSb=buffer_RTT[33];          //Read Humidity Low 8-bit
      HDS=(HDSa<<8)+HDSb;      //Humidity value
    }
    else
    {
      PMS = 0;
      FMHDS = 0;
      TPS = 0;
      HDS = 0;
    }
  }

  Serial.println("-----------------------uart--------------------------");
  Serial.print("Temp : ");
  sprintf(tempStr,"%d%d.%d",TPS/100,(TPS/10)%10,TPS%10);
  Serial.print(tempStr);
  Serial.println(" C");              //Serial pring Temperature
  Serial.print("RH   : ");
  sprintf(tempStr,"%d%d.%d",HDS/100,(HDS/10)%10,HDS%10);
  Serial.print(tempStr);          //Serial print humidity
  Serial.println(" %");
  Serial.print("HCHO : ");
  Serial.print(FMHDS);
  Serial.println(" ug/m3");       //Serial print formaldehyde, unit: ug/m³
  Serial.print("PM2.5: ");
  Serial.print(PMS);
  Serial.println(" ug/m3");       //Serial print PM2.5, unit: ug/m³
  Serial.println();
}