Dust Sensor - PMS 5003/6003/7003

Find any time to play with this dust sensor yet?

Some. It’s more complex than I expected it to be (and time has been more limited) - the byte-stuffing is a novel twist. I’m able to talk to it (initialize via UART) but it’s nowhere near library-form yet. But it’s coming along.

1 Like

Some progress is better than no progress :grinning:

I just figured the library would work like all the others.

Yeah, no. The Plantower device is relatively simple: power it on and enable it via pin and read, read, read.

The Sensirion device is a lot more complicated: special framing bytes, byte-stuffing to compensate for the special framing bytes, init, enable, clean, configure, read, write, etc. And I haven’t even looked at the I2C mode yet (though I suspect it’ll be similar enough).

That said, it’s an interesting project and I’m working on it in my spare time from all my other projects.


Mine is sitting here until you have some working code or I find another simplified working library for this thing :wink:

I am looking forward to being able to measure, Temp, Humidity, Voc, Co2, & Dust Particle levels at the same time considering I use it in a shop where CNC & Laser cutting machines are used and the particle levels are always changing.

Hi folks,

I have been using both SPS30 and PMS5003.

Here is a screenshot of the output.

The above values are using an ESP32 and not particle board, but I found this forum interesting so posting my doubts here.

My doubt is regarding the standard(CF = 1) vs environmental values from PMS5003. Till now I haven’t been able to find out the difference between these two. Could anyone guide me to some literature I can read about their differences?

Also, SPS30’s PM2.5 value is more close to PMS5003’s environmental PM2.5 value than it’s standard PM2.5 value. That makes me believe that environmental values are more useful than the standard values.

Please correct me if I am wrong.

1 Like

@kadyan Can you post the code you have running on the ESP? So we can see if we can get it working on the Particle devices?

I trust the accuracy of SPS30 for the simple fact that all there other sensors I have tried from them have been very accurate and I would assume the SPS30 is closer to reality than the other sensor your using.

1 Like

I thought I would add my two cents for anyone looking for code on using a photon and a plantower PMS 5003. I gained a lot of ideas from this posts so thank you to all who contributed. Here is my code that includes temp and humidity.

I am currently trying to build a solar powered one using an electron. Let me know if any one has already built that. Thanks

This tread will teach ya about solar on the Electron or Boron.

I’ve been curious about the CF vs SAT readings as well. Best I’ve been able to find is on this page: https://aqicn.org/sensor/pms5003-7003/ which breaks it down to:
cf1<30 ⇒ sat = cf1
cf1>100 ⇒ sat = cf1 * 2/3
cf1 in ∈ [30;100] ⇒ sat = 30 + cf1 * (cf1-30)/70 * 2/3

Keep in mind this is only for the PM2.5 size. My personal testing has confirmed the relationship holds for all 3 types but the thresholds are slightly different. I didn’t find any case where they diverge thus reading both had no real value to me. I was thinking of using it as a backup checksum but it didn’t help. Occasionally my sensor gets ‘stuck’ around a moderately high value regardless of the actual air quality and I have to power cycle the device to get it to read correctly again. It’s not a constant value either, it moves around a bit as if it were real. Perhaps that’s why the PurpleAir devices, which use PMS5003 sensors, actually put two of them in each device. I’ve ordered a 2nd sensor to explore other ways to detect when the readings get screwy.

I saw this on the Arduino forum and figured I would share since it may be helpful.

And this from another forum.

Hello @Fragma,

Thanks for the info. I have read that article, but I am still confused regarding what CF and SAT represents and how they differ physically from each other?

Also, which one should we use for outdoor/indoor monitoring?


I wasn’t able to figure out any further info other than the SAT value is the one we should be using. The data sheet says CF is only used in the factory.


Finally found a library for the SPS30 Dust Sensor :wink:

Nice. Looking forward to learn how that sensor perform.

That’s certainly one solution - but I see that it’s GPL. What I’ve been working on is Apache licensed so it won’t contaminate your whole project as GPL would.

Edit: And yes, I’ve been working on it for a while now. What I have already works with Serial but I haven’t delved into the I2C side yet. I can post what I have to Github sometime soon if there’s interest, but it’s in flux.

The guy said he is talking with Sensorion about the I2C issues now to get some things fixed with that.

It’s the most fully featured library I have come across so far so I’m giving it a go.

Share your code when you can.

I wasn’t aware of any I2C issues - I just haven’t implemented that.

Got it working finally with the help of the library creator.

He will update the GitHub library for others who want to use it with Particle Devices.


Wow… that’s great news @RWB.
I tried my best to get the library to compile on WebIDE yesterday, but it was over my head.