Particle boron UART(TX,RX) –> dust sensor pms5003

Hello, very good day.

Currently the Particle Photon is working well with the PMS5003 dust sensor and it works very well, it gives very good values.

But when connecting the PMS5003 sensor to the Particle Boron using the UART pins (TX and RX), we get values of ‘0’ or sometimes send letters.

I leave you part of the code or this is the code (plantower/code at master · HammillB/plantower · GitHub)

Any suggestions when using it with the Particle Boron?

long pm10 = 0;
long pm25 = 0;
long pm100 = 0;
long filter = 0;
String colour;

uint8_t wake[] = { 0x42, 0x4D, 0xE4, 0x00, 0x01, 0x01, 0x74 };
uint8_t sleep1[] = { 0x42, 0x4D, 0xE4, 0x00, 0x00, 0x01, 0x73 };
//uint8_t sleep[] = { 0x42, 0x4D, 0xE4, 0x00, 0x00, 0x01, 0x73 };

 void setup() {
void loop() {
     // digitalWrite(SLEEPLED, HIGH);
     Serial1.write(wake, sizeof(wake));

  int index = 0;
  char value;
  char previousValue;
   while (Serial1.available()) {
    value =;
    if ((index == 0 && value != 0x42) || (index == 1 && value != 0x4d)){
      Serial.println("Cannot find the data header.");
     if (index == 4 || index == 6 || index == 8 || index == 10 || index == 12 || index == 14) {
      previousValue = value;
    else if (index == 5){
      pm10 = 256 * previousValue + value;
      Serial.print("{ ");
      Serial.print("\"pm10\": ");
      Serial.print(", ");
    else if (index == 7){
      pm25 = 256 * previousValue + value;
      Serial.print("\"pm25\": ");
      Serial.print(", ");
    else if (index == 9){
      pm100 = 256 * previousValue + value;
      Serial.print("\"pm100\": ");
    } else if (index > 15) {
  Serial.println(" }");}

What device OS version are you using?
Have you tried 3.0.0-beta.1?

It Is 1.5.2 OS version for Particle Boron

Even With 3.0.0 beta OS did not work. :confused:

@ScruffR @rickkas7 thanks for your help, we think is a problem with Boron UART OS version., because the dust sensor is working very good with the Photon and with the Boron we obtain zeros ‘0’. Any suggestions?

Can you post a hi-res photo of your wiring?

BTW, are you working together with @road97 on this?
There is a very similar thread here

If this is indeed a colaboration we’d like you to keep the discussion in one thread rather than scattering information and possible answers over multiple places.

The pic of the test code is working with SERIAL_8N1 and 8E1.

The TX (Boron) goes to RXD(PMS5003), and RX(Boron) goes to RXD(PMS5003), VUSB(Boron) goes to VCC(Pms5003) and GND to GND.

And we get zero ‘0’ with this code for PMS5003 in Boron (

And yes we will use one thread.

Something is not right here :wink:
Your original code uses 9600 baud, the code in the screenshot 1200 - what is your Photon code using?
Are these jumper wires poking through the protoboard soldered or not?

1 Like

Sorry , The TX (Boron) goes to RXD(PMS5003), and RX(Boron) goes to TXD(PMS5003).

The Photon is using 9600 and working perfectly, but the same code with Boron we receive zero’s.

And yes the jumper wires are soldered to the PMS board.

We are using this code for both ( but with Boron is not working, I don’t know if could be the code which does not working with Boron.

As there is nothing obviously wrong to be seen on these images, so it would be good if you could acquire a logic level trace of the RX/TX lines with a logic analyzer or oscilloscope (for Photon and Boron) and compare the two.


@jonamleonel, I just connected a PMS5003 to a Boron 2G/3G and tested the sensor using the PMS7003-Particle-Sensor-Serial library available on the Web IDE. I was able to successfully read the sensor with values closely matching a PMS5003-based air quality unit (with TFT display) that I had purchased on AliExpress. I compiled and tested with Particle CLI targeting the latest release, DeviceOS 2.0.1. I used Particle serial monitor to view the serial output:

Serial monitor opened successfully:
PMS5003 starting up
PM1.0   PM2.5   PM10    0.3u    0.5m    1.0m    2.5u    5.0u    10.0u
1       2       2       474     111     11      2       0       0

Here is code for the Web IDE. You can flash via USB if you download the firmware.bin file and flash using CLI.


Hello, I am working with Jonam and your code if it sends us correct data, but when flashing it the Boron breathes in White, which is not a problem when only executing the pms but apart from the pms we are working with other sensors and adding the code of This sensor to the main code still breathes blank but it no longer sends us any data, do you have any idea why it breathes blank? and in this part of your code PMS7003Serial pms7003 (Serial1, D6);
you give him a pin in that pin is something connected? or if a sensor was connected to that pin could it be what causes the problem?
thank you very much for your help

@road97, you may not have noticed the SYSTEM_MODE(MANUAL); at the top of the file. This puts the Boron in “manual” mode. By default, without this line, the Boron is in “automatic” mode. Simply remove the line and the Boron will connect as you would expect.

Also, I chose D6 as the pin connected to the “SET” pin of the PMS5003. You can chose any pin (I believe you had D1 in your code).

1 Like

@peekay123 thanks a lot!
With PMS7003-Particle-Sensor-Serial library is working now!

Should we connect pin D6 (Boron) to “SET” pin (PMS5003)?

What is "SET’ pin used for?

Thank you very much for your help !!!

1 Like

Just for curiosity sake it would be worth investigating what that library does differently to your own code and why the one works and the other doesn’t.

1 Like

@jonamleonel, I tried with both the wire connected and unconnected and I did not see a difference in operation. However, here are the pin descriptions for the PMS5003:

The SET pin is used to put the PMS5003 in sleep mode. The PMS7003 library sets this pin HIGH on startup and has a function, setSleep(sleep) to set the pin HIGH or LOW depending on the sleep being true or false. For normal operation, the SET pin is pulled HIGH at 3.3V, as well as, the RESET pin. In the PMS5003 datasheet, this is done using 10K pull up resistors:

Unless you modify the PMS7003 library, I suggest you connect the pin you specify (in my case, D6) to the SET pin of the PMS5003.

BTW, I agree with @ScruffR that understanding WHY your original code didn’t work would provide important lessons. My hunch is that the Serial1 parsing code is not working as expected.