Dust Sensor no reading - Firmware 1.3.0

grovepi
dust-sensor
#1

I upgraded the firmware to v1.3.0. Earlier I was getting readings of 1 or 0 or Error in the v1.2.7 version.(connected dust sensor to D2 )

Now there are simply no readings at all.

Since 1.2.5 I do not think the sensor worked on any of the versions. Is there a solution? Or is my sensor itself faulty?

#3

Hi @reunny,

I’ve just tested it on mine and it’s working perfectly. Maybe you’re still running a script that’s not up to date. Here’s how I did it:

import grovepi
import time

grovepi.dust_sensor_en() # it enables it on port D2
grovepi.set_dust_sensor_interval(10000) # set it to retrieve the values every 10 seconds

while True:
    read, lpo_time = grovepi.dust_sensor_read()
    if read == 1:
        print('LPO time = {}'.format(lpo_time))
    time.sleep(2)

And this is what I’m getting in return from it:

LPO time = 30
LPO time = 421
LPO time = 256
LPO time = 230
LPO time = 0
LPO time = 78
LPO time = 160
LPO time = 383
LPO time = 16
LPO time = 697
LPO time = 1939
LPO time = 855
LPO time = 639

If you look at the script, you’ll see that before using the dust sensor, I had to enable it, otherwise, it will only return zeros. The 2nd instruction, for setting the sensor interval to 10s is because the default one is at 35 seconds and that was a bit too much for what I needed to showcase.

And if you want to connect a different device to that port, you’ll consequently have to disable the dust sensor by calling dust_sensor_dis. You can check more about this here:
https://dexterind.github.io/GrovePi/api/interrupt/

Let me know if that made your dust sensor device to work.

Thank you!

1 Like
Error in Grove Dust Sensor code (Solved)
#4

Wow. I must have missed quite a few updates in the past year.
Thanks a lot. Will try it this weekend and let you know

#5

I tried this,

Not getting any readings. Not even 1 or 0 or any error reading. Just nothing.

#6

Even specified (pin =2)

grovepi.dust_sensor_en(pin=2)

Yet no readings. Is this a problem with the sensor? It is 3 years old

#7

Now i notice my DHT 11 sensor also has no readings

#8

Interestingly, I have an old Jessie SD card with Grove Pi installed (not Raspbian for Robots). It has firmware 1.2.2.
Both sensors DHT11 and Dust Sensor are working properly. I saved the old codes on the desktop.

So where am I going wrong with 1.3.0? I installed Raspbian For Robots into a new SD card and upgraded the default firmware ( (1.2.7) to 1.3.0 but neither of the sensors give out any reading.

I used the code above as well as the old code for the dust sensor.

#9

That’s very weird indeed. I know for a fact mine works, so going back to testing it again is pointless.

I might help you with a couple of questions that might help us what’s wrong with it:

  1. Are you waiting for that amount of the time for the sensor to retrieve a value? The default is set at 35 seconds.
  2. You keep mentioning the old firmware, 1.2.2. Does firmware 1.2.7 work for you?
  3. Does anything else work on the 1.3.0? Like the analog sensors, the digital ones, etc?
  4. Are you running other processes that use the GrovePi in parallel? Or maybe even other I2C devices.
  5. Can you describe to me what’s the output of the function when you run it? The dust_sensor_read function.
  6. Have you checked the firmware version on your GrovePi after you have flashed the firmware?
  7. Are you using the same hardware for both firmware versions? The same Pi and GrovePi?

Let me know if this helps you at all.

Thank you!