2019.09.21(pm): How to use fine dust sensor PMS7003

I post in almost two months. Today’s topic is the PMS7003, a fine dust sensor. Let’s take a look at the contents of the datasheet.

PMS7003 is a kind of digital and universal particle concentration sensor, which can be used to obtain the number of suspended particles in the air, i.e. the concentration of particles, and output them in the form of digital interface. This sensor can be inserted into variable instruments related to the concentration of suspended particles in the air or other environmental improvement equipments to provide correct concentration data in time.

Working Principle

Laser scattering principle is used for such sensor. And it produces scattering by using laser to radiate suspending particles in the air, then collect scattering light in a certain degree, and finally obtain the curve of scattering light change with time. In the end, equivalent particle diameter and the number of particles with different diameter per unit volume can be calculated by microprocessor based on MIE theory.

Sensor Specification

Pin map

Notice

pms7003 adapter에 대한 이미지 검색결과

The PMS7003 requires a dedicated adapter, but it is recommended that you purchase additional ones. You can also pull the line yourself, which can be inconvenient.

Circuit

The GND of the adapter is connected to the GND pin of the Arduino, and the VCC is connected to the 5 pin. Connect TX to pin 2 and RX to pin 3.

I will upload the schematic later.

Code

#include <SoftwareSerial.h>

SoftwareSerial test(2, 3);

void setup() 
{ 
  Serial.begin(115200);  
  test.begin(9600);
}

void loop() 
{
  static int First=0;
  static int pm_add[3][5]={0,};
  static int pm_old[3]={0,};
  int chksum=0,res=0;;
  unsigned char pms[32]={0,};
  
  if(test.available()>=32)
  {
    for(int j=0; j<32 ; j++)
    {
      pms[j]=test.read();
      if(j<30)
        chksum+=pms[j];
    }
    if(pms[30] != (unsigned char)(chksum>>8) 
        || pms[31]!= (unsigned char)(chksum) )
        {
          return res;
        }
    if(pms[0]!=0x42 || pms[1]!=0x4d )
      return res;

  Serial.print("Dust raw data debugging :  ");
  Serial.print("0.1ug/m3:");
  Serial.print(pms[10]);
  Serial.print(pms[11]);
  Serial.print("  ");
  Serial.print("2.5ug/m3:");
  Serial.print(pms[12]);
  Serial.print(pms[13]);
  Serial.print("  ");
  Serial.print("10ug/m3:");
  Serial.print(pms[14]);
  Serial.println(pms[15]);
  } 
}

Then you can see the sensor data appear on the serial monitor.

Kinds of fine dust

관련 이미지

The table below shows the level of fine dust. If you look at the level of fine dust in my room, you can see that I definitely enjoy very clean air level.

fine dust level에 대한 이미지 검색결과


Comments

3 responses to “2019.09.21(pm): How to use fine dust sensor PMS7003”

  1. It’s very interesting and helpful. Thx!

    1. I appreciate your comment! 🙂

  2. I just want to tell you that I am beginner to weblog and actually enjoyed your web-site. Likely I’m want to bookmark your blog post . You surely come with outstanding articles. Cheers for sharing your web page.

Leave a Reply