I just purchased the Sensirion SPS30 environmental sensor and I am trying to get it to work over UART. I have the board connected to a SparkFun FT232 board and the sensor is powered via 5V on the USB connection. Some data does seem to be coming from the sensor. When I open the port in a terminal and power on the sensor I see a single ‘0xFF’ come by and nothing else. Should I be seeing some data coming by?
As with many intelligent sensors, you have to provide instructions before it provides results. If you have an Arduino-variant you can use the SPS30 driver like https://github.com/paulvha/sps30
There is a bug in version 1.4 of @paulva’s otherwise-exemplary SPS30 package. The Instruct function is supposed to return a boolean value, but under certain conditions it tries to return ERR_PARAMETER, a uint8_t. Information is lost.
Also, since you are updating it, you might want to recognize some of the Teensy processors. Some of the ```
#if defined(...) || defined(...)|| ...
``` lines were getting unwieldy, so I rewrote the beginning of <B>**SPS30::setSerialSpeed()**</B> to
{ long _Serial_baud = 115200; // no other speed is allowed for SPS30
I have changed the other return code as well and updated on github.
As it relates to have the embedded communication channel selection to recognize the Teensy, It looks good what you have done. However there are many new boards every week, with many different connection possibilities and pins. It would become a bottleneck for the driver to keep adding each and every possible combination. I have decided back in May to stop adding more to embedded communication channel selection and add the possibility to select the communication channel to use in the Sketch and pass that to the driver. I had added example12 and example13 to show that.