A recent project has reminded me that I wanted to get a particulate sensor working. I’d previously purchased a cheap dust sensor but never got round to using it. Also I wasn’t confident that the data it produced would be of much use.
With that in mind I had a look for a newer sensor and found the Plantower PMS7003 on ebay for less than £20. Its a laser particulate sensor that can not only count the number of particles but can differentiate between particle sizes from 0.3 to 10 microns. The datasheet says that particle counting efficiency is 50% at 0.3um and 98% at >0.5um. While the data output by the PMS7003 does include particle counts for <0.5um, it is likely more useful to look at the standard PM1.0/2.5 & 10.0 outputs anyway so that isn’t a problem.
Looking at the datasheet and some other code examples the payload is as follow:
32 bytes in total
2 bytes with fixed content that are the start bytes. They contain 0x42 and 0x4d.
The next 2 bytes are the frame length which looks like it will always be 28 (in the default mode – payload minus start bytes and checksum bytes).
The next 6 bytes are the 3 standard PM1.0, PM2.5 & PM10.0 measurements (each being two bytes) and are measured as micro grams per meter cubed (ug/m3). The first byte is the high byte.
The next 6 bytes are 3 atmospheric concentration measurements (PM1.0, PM2.5 & PM10.0). Again, two bytes per reading.
The next 12 bytes are 6 ‘particle size per 0.1litre of air’ counts (2 bytes each). They are 0.3, 0.5, 1.0, 2.5, 5.0 & 10.0um. Each count measures particles of that size and larger. Looking at the data from the sensor they do not appear to include the count of particles over the next size.
Next we have 1 byte for version and 1 byte for error codes.
The last 2 bytes are the checksum.
The data from the sensor using a test Python script are as follows:
PMS7003 Sensor Data:
PM1.0 = 2 ug/m3
PM2.5 = 3 ug/m3
PM10 = 4 ug/m3
PM1 Atmospheric concentration = 2 ug/m3
PM2.5 Atmospheric concentration = 3 ug/m3
PM10 Atmospheric concentration = 4 ug/m3
Count: 0.3um = 384 per 0.1l
Count: 0.5um = 118 per 0.1l
Count: 1.0um = 20 per 0.1l
Count: 2.5um = 5 per 0.1l
Count: 5.0um = 2 per 0.1l
Count: 10um = 0 per 0.1l
Version = 151
Error Code = 0
Frame length = 28
With a working sensor I can now try and hook it up to an ESP8266 and expand my Raspberry Pi Node Red mqtt home environmental monitoring system.