You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope this is still active, as I would really like to use your code for my PMS5003 on the ESP32 WROOM. When uploading the basic code (after downloading the library) to my esp32 it displays thefollowing:
⸮!⸮H⸮�>⸮\x⸮K⸮$�⸮
At first I thought it had something to do with the baud rate, but this is set to 9600.
Do you have a clue what might be the issue here?
Thanks,
Bas
The text was updated successfully, but these errors were encountered:
Don't use the RX/TX pins (pin 0 and 1 on arduino). This serial port is used for communication between your arduino/esp and computer.
Instead, use the built-in SoftwareSerial library to open another one, like this:
#include <SoftwareSerial.h>
#include "PMS.h"
SoftwareSerial pmsSerial(D8, D7);
//SoftwareSerial(rxPin, txPin), I used D8 for RX and D7 for TX (esp8266) and connected TX on PMS5003 to D8
PMS pms(pmsSerial);
PMS::DATA data;
void setup()
{
Serial.begin(9600);
pmsSerial.begin(9600);
}
void loop()
{
if (pms.read(data))
{
Serial.print("PM 1.0 (ug/m3): ");
Serial.println(data.PM_AE_UG_1_0);
Serial.print("PM 2.5 (ug/m3): ");
Serial.println(data.PM_AE_UG_2_5);
Serial.print("PM 10.0 (ug/m3): ");
Serial.println(data.PM_AE_UG_10_0);
Serial.println();
}
// Do other stuff...
}
Hi,
I hope this is still active, as I would really like to use your code for my PMS5003 on the ESP32 WROOM. When uploading the basic code (after downloading the library) to my esp32 it displays thefollowing:
⸮!⸮H⸮�>⸮\x⸮K⸮$�⸮
At first I thought it had something to do with the baud rate, but this is set to 9600.
Do you have a clue what might be the issue here?
Thanks,
Bas
The text was updated successfully, but these errors were encountered: