Dust Sensor - PMS 5003/6003/7003

I won’t say it’s final, but the repos above are current (and the sensor manager project is going to be the most current for now). It ought to work with the 5003, 3003, etc. but I haven’t tested those… I think (but am not sure) that the generations of Plantower’s devices vary primarily in size, not API/interface.

In other news, DigiKey appears to carry the vexing little 1.27mm pitch connector for the PMS7003 - part #609-3754-ND (part of Amphenol’s Minitek 127 series). I’ll probably be buying a couple of these to improve upon my current soldering job (I’ve already sourced some 1.27mm pitch double-sided plated perfboard for my bench supplies).

The code mentioned in this post: Dust Sensor - PMS 5003/6003/7003
It may be possible to optimize this, but works as is and final for me… gives PM1, PM2.5 & PM10 values


Your codes look very organised and properly formatted… Nice work!

You actually soldered on to those tiny pins… You got curious right?
I would’ve just ordered the connectors and waited :blush:

The half-pitch perfboard is neither cheap nor readily available (it’s still on its way from China). I wasn’t about to wait. :smiley: (You’re rather lucky with the 5003 - it’s not hard to get a connector for that, versus the 7003 - nobody sells a breakout board or converter for that.)

I’m glad you like the code! It’s still very much a work in progress… still need to update the backend code to be more useful, and interpret the PM data more usefully as well.

In other news, Plantower has released an even smaller sensor, the A003… haven’t seen it for sale yet but it uses that same tiny connector as the 7003


Thank you…i will try it

Hi, Could you have the final arduino code for PMS 5003?
This is e-mail zcrainbow@126.com.

Hi, How about this test for the final arduino code?

Hi, the code at post #21, which is here: Dust Sensor - PMS 5003/6003/7003
is good for me. It works! Did you try it?

Thanks for your reply.
I’m sorry.
Would it be possible for these questions:

  1. For PMS 5003, I know it works that you say; but, In addition arduino,are there other?
  2. Did you try for PMS5003ST with ST? Or stm32fxxx?

Hi all.

I just received 2x PMS7003 - trying to get one hooked up to my Electron.

I have used a header to connect the PMS7003 to my breadboard, but now struggling to work out what/where I should connect to my Electron.

Here is the pin details from data sheet from PMS5003 (can’t find 7003), I’m hoping that it has the same connections.

I understand Pins 1, 2, 4, 5. But where should the others go?

A couple of other quick questions:

  • @MartyMacGyver - using your code - does one need to define pins and/or IC2 address anywhere?
  • The data sheet seems to suggest power is 5V. Is it an issue to power by 3.5V through Photon?

As you can see I’m new to electronics :smile:



There’s a pretty decent datasheet here (unlike the one I started with, this one even has a handy wiring diagram):

(Yes, it’s in Chinese but you can put the URL through Google Translate to convert the whole doc.)

I haven’t tried using 3.3V for VCC (since I can source the 5V from the Photon for the purpose of VCC< I do). I wouldn’t expect 3.3V to be enough though.

The pins aren’t in the same configuration as the 5003. Refer to the datasheet for the pin ordering, but translated:

PIN1 VCC Power is 5V
PIN2 VCC Power is 5V
PIN3 GND Power supply negative
PIN4 GND Power supply negative
PIN5 RESET Module reset signal / TTL level @ 3.3V, low reset
PIN7 RX Serial receive pin / TTL level @ 3.3V
PIN9 TX Serial transmission pin / TTL level @ 3.3V
PIN10 SET Set the pin to TTL level @ 3.3V, high or floating
Normal working state, low for the sleep state

This device is serial-only (no I2C), so when you connect it up, you use the serial pins on your Photon/Electron. Float or pull SET high to let the device run all the time, and pull RESET high unless you want to directly reset it (which I’ve yet to need to do).

5V power, ground, and serial TXD/RXD (which are at 3.3V levels per the datasheet) should be all you really need.

(Since it’s an Electron you might want to make your own code - mine would use a lot of data.)

Thanks for your guidance. Here is what I’ve done so far, but not working… :frowning: Any help diagnosing would be much appreciated:

So on the connector that came with my PMS7003, the connections are a bit different to the data sheet. Goes from 10 pins down to 8 through the connector. See below:

I’ve connected it up to my breadboard, Electron as follows. Pretend PMS7003 is connected to the generic header in diagram.

In the Fritzing above, used a header where pins 1-8 align with pins 1-8 on the PMS7003 connector (as per first photo).

I’ve then used @MartyMacGyver’s code - adding the following to try and pull SET high:

pinMode(D3, OUTPUT);
digitalWrite(D3, HIGH);

I suspect this is completely wrong, and have no idea how to pull RESET high. Tried doing a quick search but couldn’t find much on how to do this. Should pulling have been done through hardware?

Also, is there any code missing from @MartyMacGyver’s repository? I would have expected to see normal stuff like defining pins etc - like I’ve tried to do above? Am I missing something?

When viewing serial output, I’m just getting:

-- Initializing...
-- Reading PMS7003

And nothing else.



That’s my repo - it should be easier than all that.

Looks like the breakout (oh how I wish that had come with mine!) simply omits/combines the two VCC and the two Gnd pins into one each.

You likely need to only wire four things: VCC (5V), Gnd, TXD and RXD. That’s all. I suspect Set and Reset are already pulled to their appropriate states (Reset should be pulled high internally, and I think Set is internally pulled high too).

Either way, the wiring looks OK to me in terms of pulling things up to 3.3V, though you’re going to need to do the same thing for D6 (reset) you’re doing for D3 (set).

That said, I’d unplug those two for a moment and let the resistors do the work.

What’s wrong here is that I don’t see VCC for the PMS7003 going to +5V… I see it going to 3.3V. While that’s fine for the pull-ups, the VCC must be 5V as far as I know (otherwise you’ll affect the fan speed, and that’s part of the measurement pathway - not to mention it might not even power up).

On a Photon, when powered from USB, VIN will supply +5V.

On the Electron I think the only option is VUSB (and that means having a USB supply… I don’t think the LiPo won’t suffice). Only wire +5V to VCC… never the other pins or pull-ups on the PMS7003!

EDIT: Once you have the power thing sorted, you might have to reverse the TX and RX connections. I don’t recall which is which but try what you have first.

EDIT2: and by the way… where did you get these? eBay, AliExpress, somewhere else? Would be good to know. :smile:

Thanks - you’re right the fan wasn’t working at all under 3.3V - moving to 5V got the fan going for a while, but seems I killed it somehow - it’s not starting up at all now when powering it, perhaps I shorted it or something. I’ll try my second PMS7003.

From AliExpress. Cheaper than eBay and included the connector.

Thanks again. I’ll post my progress for other’s reference once I get it going.


If SET is low that would turn the fan off too:

When the sleep function is applied, be aware that the fan stops working while the fan is inactive and requires at least 30 Sec settling time, so in order to obtain accurate data, the sleep sensor working time after wake-up should not be < [?] 30 seconds.

Try giving the device VCC and GND only, and leave all the other wires completely unconnected. The fan ought to run.

If not, pull the SET line up to 3.3v (I don’t think that’s necessary but it’s worth a try too).

If that doesn’t work… maybe it really is dead. I have a hard time seeing how any of this would’ve killed it unless its power lines were reversed or something though.

As for AliExpress, did you get it from HS Electronics?

In general what was your experience like ordering from AliExpress? Did they require copies of your identification, etc.? (Long story short, AE asked for a LOT of rather strange info when I tried to order something simple a while back.)

Gave it another go. I had the connector/breakout supplied attached the wrong way around to the PMS7003 :confused:

Anway’s it is now working! Receiving frames of data through serial as per your code, Marty.

Any tips on how I can quickly convert these frames to something human readable to sense check readings?

As for AliExpress, did you get it from HS Electronics?

In general what was your experience like ordering from AliExpress? Did they require copies of your identification, etc.? (Long story short, AE asked for a LOT of rather strange info when I tried to order something simple a while back.)

Can’t recall the vendor, and info isn’t in the email. I didn’t need to provide much info - just postal address, payment info. I didn’t register an AliExpress account - I just went through checkout process as a guest.

Hi to all,

This is my first post here.
I’m starting to test the PMS7003 sensor with an Arduino. I have tried with at least 3 different softwares, and with all of them I’m getting consistent values, however looking at the readings and comparing them to the readings obtained by other Sharp dust sensors (just pm2.5), the readings from the PMS7003 appeared as multiplied by ten. Is this possible?

Here is an example from the PMS7003

PM1.0cf: 369 ug/m3
PM2.5cf: 557 ug/m3
PM1 0cf: 601 ug/m3
PM1.0am: 245 ug/m3
PM2.5am: 371 ug/m3
PM1 0am: 400 ug/m3

From the Sharp sensor PM2.5 reading is now 39.8 ug/m3

If I increase the particles in the air by burning some incense near the sensors, both increase the readings, but the PMS7003 readings always seems 10 times the value of the Sharp sensor. Does anyone have already noted this, or I’m doing anything wrong.

Which Sharp sensors are you using ? If it is a reference instrument then it would be more believable.
The PM2.5 numbers you measured with the 7003 are really high. If you were regularly breathing this air you would be in big trouble. So without knowing anything more like seeing your code, it is possible that your 7003 readings are off by a factor of 10.

OTOH if you are in Beijing or Delhi the readings are probably ok!

it is best to check with aqicn.org - where is the nearest station that reports PM 2.5/pm10 readings and compare with it.
40 ug/m3 is generally clear air… you shouldn’t smell anything in it.
400 ug/m3 usually smells quite a lot on smoke, fire… you shouldn’t also be able to see more than 100m around you

Thank you guys.
All is working now, and the readings from my PMS7003 usually are inline with the values from the nearest (40Km away) aquicn.org station.
Nice sensor.