Grove - Dust Sensor

Has anyone got the Seeed Studios Grove Dust Sensor working with the Grove Pi?

http://www.seeedstudio.com/wiki/Grove_-_Dust_sensor

I just got some in, and when reading the Wiki it states:

“Plug the dust sensor into digital port D8 on the Grove - Base Shield. It can only be D8, because the operation of this sensor involves sampling, a function only can be achieved by D8, the capture input pin of Atmage328P, on Arduino/Seeeduino.”

Is this also consistent with the Grove Pi? Must it be D8?

Also … I’m beginning to look at how to port this code to Python … any suggestions?

Hello,

Just to answer my own question … update the code from Github here: https://github.com/DexterInd/GrovePi

The updated Software/Python folder now contains a Dust Sensor example … :slight_smile:

BUT … it does NOT seem to work!!

I have updated my firmware per the instructions … and then tried the example …

In ONE case I got back:

pi@raspberrypi ~/GrovePi/Software/Python $ sudo python grove_dust_sensor.py
Reading from the dust sensor
167772.15
Error
Error
Error
Error
Error
167772.15

But usually I just get back:

pi@raspberrypi ~/GrovePi/Software/Python $ sudo python grove_dust_sensor.py
Reading from the dust sensor
Error
Error
Error
Error
Error

Any thoughts on what might be up? Or how to get this working?

Hey Humancell,
We just got the dust sensor to work with the GrovePi. Do let us know how the code works for you and also share your project with the community.

-Karan

Hello,

I just updated my second post … it’s not quite working … :frowning:

I did update my firmware, and the code from Github. I also did run the: sudo python setup.py install

But then running the example is not working … I’m mostly just getting “Error” and the one time I got values, it was: 167772.15 which seems out of range?

Hello,

Just another update … I rebooted and even am using a second dust sensor (I bought several for a project we are working on) and I’m getting almost identical results …

pi@raspberrypi ~/GrovePi/Software/Python $ sudo python grove_dust_sensor.py
Reading from the dust sensor
Error
Error
167772.15
Error
Error
167772.15
Error

It does not seem to be working?

Hello,

Who can assist with debugging this sensor? I have tried two different dust sensors, and have the exact same results. I ran it all night long, and the only out I get is something like:

Error
Error
Error
Error
167772.15
Error
Error
Error
167772.15
167772.15
167772.15
Error
Error
Error
167772.15
Error
Error
Error
Error
Error

I would be glad to assist you in any way that I can to debug and get this working correctly … I need this for a project we are building.

Thank you!

Hey,
I just tried using the sensor and it is giving good values. Can, you run the grove_firmware_version_check.py and make sure that you have version 1.2.4 and then run the code.

This is what I got:

root@raspberrypi:/home/pi/Desktop/GrovePi/Software/Python# python grove_firmware_version_check.py
('GrovePi has firmware version:', '1.2.4')
root@raspberrypi:/home/pi/Desktop/GrovePi/Software/Python# python grove_dust_sensor.py
Reading from the dust sensor
2626.57
Error
841.84
1044.35

-Karan

Hello,

No … where can I get v1.2.4? I have cloned Git, and run the update that that leaves me with 1.2.2, then I ran the other pinned post update and got to v1.2.3 … but where is v1.2.4 being distributed?

I ran this too, just now, using the latest GrovePi repository.

All I did was connect the sensor to D8, and then run:

cd ~/Desktop/GrovePi/Software/Python
sudo python grove_dust_sensor.py

I had pretty good results although they do go up and down, depending on how close my fingers are to the sensor. I think blocking light made the sensor value go up and down.

Looking at some of the sparse documentation on the Seeed site for the dust sensor here, even their example swings quite a bit (max being 650, min being 0.6).

So not sure what to say. THe documentation does say not to mess with the two screw adjusters on the side.

Do you have the same sensor I do?

Hello again,

BTW … if I search the forums for v1.2.4 I get nothing … :frowning:

http://www.dexterindustries.com/search/1.2.4/

Hey,
The GrovePi firmware version v1.2.4 is still in beta. We’ll make it official in some time. It’s here: https://github.com/DexterInd/GrovePi/tree/master/Firmware/Source/v1.2/grove_pi_v1_2_4. Update you local git repo, go to this folder and run sudo avrdude -c gpio -p m328p -U flash:w:grove_pi_v1_2_4.cpp.hex to update the firmware.

Make sure that you connect the sensor to Port8.

Do let us know how it goes.

-Karan

Ha! That did the trick!

I was able to update to the BETA v1.2.4 and now I am seeing MUCH better readings!

pi@raspberrypi ~/GrovePi/Software/Python python grove_firmware_version_check.py ('GrovePi has firmware version:', '1.2.4') pi@raspberrypi ~/GrovePi/Software/Python sudo python grove_dust_sensor.py
Reading from the dust sensor
0.62
298.91
95.58
91.25
Error
0.62
Error
Error
140.23
578.64
0.62
128.54

Per John’s comments, I did see that the values seem to vary, and I’ll do more testing. I’m curious if you know what causes the “Error” statements? I see in the code, it’s throwing an exception, but what is the root cause of that? Power issue? Or?

Also, it seems the low values can be thrown out … the 0.62 seems to be a warm-up or something?

Thanks again!

There is some great information about how to use this sensor in the Resources Section on the Wiki here: http://www.seeedstudio.com/wiki/Grove_-_Dust_Sensor.

The first reading might be an older reading from the buffer. You can just neglect it. The Raspberry Pi keeps polling GrovePi every .5s seconds asking for a value back and the GrovePi gives a new value back almost every 30 seconds and it sometimes fails to read the values which gives the “Error” message. It does not cause any harm and you can easily disable it by replacing line 56 here with a pass statement: https://github.com/DexterInd/GrovePi/blob/master/Software/Python/grove_dust_sensor.py#L56 .

-Karan

Just as another note … I’ve been reading all of those sources, and many others.

There was one that I came across that was very valuable, and seems to indicate that the Dust Sensor is to be placed with the cable connection “down”.

http://forums.parallax.com/discussion/comment/1185869#Comment_1185869

This is based on where the “heating” resistor is located, and how it causes the air to slightly draft upwards bringing dust into the chamber. I’ll be reorienting mine and checking the difference in values.

To remove the values < 1 I also changed line 51 to be: if new_val and conc > 1:

https://github.com/DexterInd/GrovePi/blob/master/Software/Python/grove_dust_sensor.py#L51

Thanks again!

Thanks for the tip! Problem solved is good to hear.

Also, curious, what project are you working on with these dust sensors? We’d love to know more.

At my company - Wovyn (http://www.wovyn.com) - we’re building custom and turn-key sensor solutions for customers. We’ve built a variety of solutions in many markets, and now have several customers wanting to have “air quality” sensors created. We’ve collected an array of sensors - the Dust Sensor included - that talk I2C or Analog, and are building all of the early small volume prototypes on the RPi (looking at the NanoPi) and using the Grove Pi.

We actually do more than just the sensors, but also an entire middleware solution for easily connecting a wide range of sensors - 3rd party and our own - into enterprise and commercial applications. We also support a large list of IoT cloud platforms that we integrate into.

We’ve found the Grove Pi to be an excellent prototyping platform, and then as we solidify our designs and capabilities we evolve them into our own embedded ARM boards using C.