Getting PM2.5 and PM10 values from dust sensor (Shinyei PPD42)


I am trying to create an air quality monitoring device that measures PM2.5 and PM10. I am using a Raspberry Pi with the GrovePi+ HAT, and the Shinyei PPD42 particulate sensor connected to port D2. This is all working and I am getting readings on the RPi. However, the raw value that the code gets from the GrovePi is Low Pulse Occupancy (LPO) time. I know that the Shinyei PPD42 sensor has P1 and P2 outputs, measuring particles above 1um and 2.5um respectively. This post explains it well. Does anyone know how I can get these readings from the GrovePi instead of the LPO time?

The wiki (link) for this sensor states the feature “Dual output for the particle size over 1 micron and 2.5 micron”, which suggests that this is possible somehow.


Hi @edrjeffery,

It seems like this Shinyei PPD42 sensor is shipped with a Grove cable that only has 3 wires (GND, Power and the P1 output for particles between 1um and 10um). So this means we won’t be able to pull another wire in for the P2, which means we’ll be stuck with P1.

Now, regarding the PM measurements, wouldn’t it be possible to be calculated from the LPO time? Looking at this image

tells me there’s a correlation between the low pulse occupancy time and the size of the particle. And if you know how many there are smaller than 1um, then it means you can calculate the density/concentration in ug/m^3.

What do you think of this?

Thank you!

Edit: here’s a nice wiki on what pins are pulled into the GrovePi.

Thanks for your reply!

That is a shame that it only has 3 cables. If I soldered on another cable into the P2 location, could we then get a reading through it?

Regarding the density - I think the two following links enable this calculation. Firstly, this link shows how to get to concentration of particles per 0.01 cubic feet. The pcs_to_ugm3 function from this link then converts this to ug/m^3.

Hi @edrjeffery,

Technically, that’s feasible, but we need to determine if we can do that in the current firmware, without compromising the current functionalities. Just give us some time to think about it and we’ll be back with an answer. Until then, I’ll add the pending label, which means we’ll discuss about this internally.

Thank you!

Hi @RobertLucian,

Thank you very much - that could be really helpful. I might have a go myself in the meantime and see what happens. I look forward to hearing back from you.