Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By peut
#75121 Hi,

I recently bought a Nova SDS021 dust sensor. It measures particles of 2.5 and 10 nmeter.
It works by sending both measurements over a 3.3v uart connection.

Only software I could find was a library that worked fine at https://github.com/ricki-z/SDS011.
But this library does not cover all possibilities, especially the sleep mode as documented in
the manual (https://github.com/gitpeut/cdn.sparkfun.com/assets/parts/1/2/2/7/5/Laser_Dust_Sensor_Control_Protocol_V1.3.pdf).

So I wrote a library that covers the whole manual.
It can be found here:

https://github.com/gitpeut/SDS021

As far as I know everything works as expected.
Have fun
Jose
User avatar
By peut
#75478 Hi,
My guess is you are using an AVR microcontroller. Arduino does not support printf out of the box for these
microcontrollers.
You can enable it, as described here :
https://playground.arduino.cc/Main/Printf

Replacing printf in the library is not easy as I have used it extensively.

Sorry.
User avatar
By peut
#75500 Hi,

My guess is you are compiling this not on an ESP8266, like I used to develop this library.
I forgot that on many processors, printf is not enabled by default.
I have used printf extensively throughout the library and the examples, itquite some work to remove it
from the library.
For now, your best bet is to have a look at the following page and follow some of th einstructions to
enable printf in Arduino:

https://playground.arduino.cc/Main/Printf

I will have a look in a week or so to remove printf or make it conditionally being used.

Good luck.