Data from dust sensor

I have an old project where I have a Raspberry Pi, Grove Pi and among other things the dustsensor connected.

I set the project up again (due to a great deal of time at home these days) and decided to look deeper into the data I got from the dust sensor and I realized that I only used 1 piece of data in the old project.
This made me wonder if I actually used the correct data AND what the other data represented.

From the description of the sensor it states:

*This Dust Sensor gives a good indication of the air quality in an environment by measuring the dust concentration. The Particulate Matter level (PM level) in the air is measured by counting the Low Pulse Occupancy time (LPO time) in given time unit. LPO time is proportional to PM concentration.

“Lowpulseoccupancy” represents the Low Pulse Occupancy Time(LPO Time) detected in given 30s. Its unit is microseconds.
“Ratio” reflects on which level LPO Time takes up the whole sample time.
“Concentration” is a figure that has a physical meaning. It is calculated from the characteristic graph below by using the LPO time.*

When I used the existing code in the documentation for the dust sensor, it now gives an error in Python, where is states in gets more data than expected:
[new_val,lowpulseoccupancy] = grovepi.dust_sensor_read()
I changed it to this, and now it works:
[new_val,other,lowpulseoccupancy] = grovepi.dust_sensor_read()

So now I get 3 pieces of data, where lowpulseoccupancy is already explained.

So my question is : What is the other data then and how should they be understood?

Thanks for your help on this!

What kind of error message does Python return? @jbeckj

I dont have the error message anymore, but it was along the lines of “getting more data than expected. Was expecting (2)”.

However, i fixed that by adding 1 more value to the variable(array?).
Before fix it was :
[new_val,lowpulseoccupancy] = grovepi.dust_sensor_read()
After fix it is:
[new_val,other,lowpulseoccupancy] = grovepi.dust_sensor_read()

So I am just curious of what data “new_val” and “other” represents.

https://dexterind.github.io/GrovePi/api/interrupt/#grovepidust_sensor_readpin-2-period-30000

Okay, so the answer to my question is that
“new_val” is LPO time
“other” is LPO time divided by total period
“lowpulseoccupancy” is particle concentration as meassured in pcs/283ml=0.01 cf

Did I get it right?

I think it’s right…

1 Like