@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?
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.
Something is not right here
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?
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).
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.
@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.