-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support PMS5003S/ST/T #10
Comments
Thank you for the update! We have been using your code in your ESP32 and it is very stable and reliable. Soon we will use PMS5003T. |
Glad you found it useful. I'm currently just collecting all the information to add support these sensors. In the meantime, please note that the temperature on the Something like Also as I do not have any of this sensor variants, I really appreciate if you could let me know if the new code works for you. |
It went faster than expected, but as I wrote before I do not have any of S/T/ST variants, I'll close this issue after updating the examples, but I would really appreciate if you could let me know if it works for your |
I'm trying to facilitate the PMS sensor project recently and so glad to see your library. |
you can try something like this #include <PMserial.h>
SerialPM pms(PMS5003T, Serial); // PMS5003T, on hardware serial
void setup() {
Serial.begin(9600);
pms.init(); // config serial port
}
void loop() {
pms.read(); // read the PM sensor
Serial.print(F("PM1.0 "));Serial.print(pms.pm01);Serial.print(F(", "));
Serial.print(F("PM2.5 "));Serial.print(pms.pm25);Serial.print(F(", "));
Serial.print(F("PM10 ")) ;Serial.print(pms.pm10);Serial.print(F(" [ug/m3]"));Serial.print(F(", "));
Serial.print(pms.temp, 1);Serial.print(F(" °C"));Serial.print(F(", "));
Serial.print(pms.rhum, 1);Serial.println(F(" %rh"));
delay(10000); // wait for 10 seconds
} |
Originally posted by @gbalbinot in #4 (comment)
Message structure
message
PMS5003
PMS5003T
PMS5003S
PMS5003ST
42 4d 00 1c
42 4d 00 1c
42 4d 00 1c
42 4d 00 24
PMSx003
sensorThe
PMSx003
sensor type will infer the sensor type from the message header.As the
PMS5003T
/PMS5003S
variants have the same header than thePMS5003
they need to be declared explicitly on the
SerialPM
constructor.The text was updated successfully, but these errors were encountered: