Dust Sensor Problem



I have been trying to run Grove Dust sensor along with other sensors.
The only output I get is Dust lowpulseoccupancy 16777215.

If the dust sensor is run on its own it works correctly.
Have you any suggestions what may be causing this, are there Grove sensors that the dust sensor will not run with?



Hi @whimickrh,

Without some actual code, it’s hard for us to tell what the problem might be.
Could you show us the code you’re trying to run?

By the way, if the Grove Dust Sensor and the other sensors are run all simultaneously without being synchronized, you might encounter issues similar to what you have. That’s because the GrovePi’s library isn’t thread-safe, so you’d need to synchronize them “by hand” - that’s valid if only you’re using the sensors in different threads/processes.

Thank you!


Hi Robert,
Here are the python scripts I am using.

Please note that I use the switdoclab weatherboard.
Air sensor is use as dust sensor.

Raspi_Met2WD_beta_032.txt (22.1 KB)
Air_Sensors.txt (2.8 KB)
Wind_Rain6_beta_004e.txt (9.6 KB)


Hi Robert,

was my code any help in solving my problem?


Hi @whimickrh,

I’ve only tested the Grove Dust Sensor and I’ve seen values between the expected ones.
I’ve also been looking on your source code and I’m still trying to interpret it, as it’s quite much in there.

To me, it still looks like there’s a timing issue with the script. I’ll be back with an answer for you.

Thank you!


Hi Robert,
Have had any time to instigate the dust sensor problem?


Hi @whimickrh,

I’ve been looking at the source code thinking there are going to be a couple of lines, but unfortunately I’ve stumbled on an entire project. Generally, for this kind of project I would be seeing diagrams or some sort of documentation that helps out anyone else who isn’t the original developer to continue the work. Without these, lots of time would be required to understand how the code has been built and even more so for debugging the issue.

Here’s a good suggestion I have for you that saved me from difficult situations I had in the past:

  1. Identify the irreducible components of your project and put them on paper.

  2. Create scripts for running each irreducible component of your project.

  3. Run each script that you’ve created and iterate them until you catch a component not working correctly and then fix it.

  4. Create other scripts (or depending on your architecture, run the previous scripts concurrently) that test different components together. Test and verify until you end up with all components together and working.

This advice should help you find the current issue you have. Even better than what we have now, you’ll be able to come up with good information on what’s wrong with the sensor (if there’s any in the first place) and then we can correct it immediately.

I’m waiting to hear what you’re thinking of this and if this helps you with your current problem.

Thank you!


Hi Robert,
Sorry for my late reply.
Thank you for replying, your notes are helpful. When i wrote the project I made each block as an separate python script, and tested it to ensure it worked, the added it the main project, and made sure it worked, which at this moment the script working as it should a part from the Dust sensor which for now I have removed from the project, until I can research the problem at a later date.
I have a question about compatability which that I will ask in another thread.


Hi @whimickrh,

That’s great to hear these gave you a deeper understanding on how to solve these kinds of problems.
I’m going to close this thread - I’m setting a timer on it, in case you want to come back.

Thank you!

closed #10

This topic was automatically closed after 41 hours. New replies are no longer allowed.