How to determine why PMS5003 serial device is not communicating?

I am unable to get any reading from a PMS5003 connected to an ESP32.

In trying to debug this problem, I have a very minimal setup. Only the PMS5003 is connected to the ESP32, and using the following the code.

#include <Arduino.h>
#define PMS_DEBUG
#include <PMSerial.h>

SerialPM pms(PMSx003,Serial2)

void setup() {

void loop() {;

pms25 always returns 0. When the PMS5003 is properly connected to the ESP32, status always returns "Wrong message start".

Why would the device be sending the wrong start code, and what steps can I take to debug this?

I have tried connecting to different serial pins, including following the ESP32 software serial example provided by the PMSerial library. In all cases, it simply looks as though the PMS5003 sensor is not transmitting anything - indeed no fans are switching on and there is no sign of life at all from the device. However, I am very much a beginner, and don't know enough to tell whether this is a problem with the device, the library or something I have done.

What is the best way to debug an issue like this?

please provide a link about:

thanks @paulpaulson , I've added links to my question above

Many thanks for the link.
I would start to connect a terminal to that device and study how the communication take place.

thanks everyone for these suggestions. apologies for slow reply, things became very busy! I managed to borrow some spare components to test my project. Turns out there was a fault with the cable I was using to attach the PMS5003 sensor. Replaced the cable, everything works. Simple fix, but quite annoyed with myself for not checking this sooner!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.