Closed marcuscbehrens closed 7 years ago
The control protocol is the same for SDS011, SDS018 and SDS021. But I couldn't test it with with another sensor than the SDS011. We use the code in a project based on esp8266 so we needed to use the SoftSerial. But yes, you can also use the hardware serial.
I did not try it but the sleep and wakeup portion of this also works with the SDS018. I guess the other piece will just work as well. I'm not using this library but the example at https://github.com/crystaldust/sds018 and have re-used the sleep and wake code from your library in combination with it. Also rather using Hardware Serial1 instead of SoftSerial (had bad experience in the past).