New Product:  Measure your Air Quality with the Grove Dust Sensor on your Raspberry Pi

New Product: Measure your Air Quality with the Grove Dust Sensor on your Raspberry Pi

This PPD42 based 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. This sensor can provide reliable data for air purifier systems; it is responsive to PM of diameter 1μm.

With tweaking, you can also separate out particles 2.5uM and above.

You can buy the Grove Dust Sensor here.

We are definitely adding this to our weather stations that we have on SwitchDoc Labs:


  • Grove compatible interface(extra wire with connecter)
  • Supply voltage range: 5V
  • Minimum detect particle: 1um
  • PWM output
  • Dimensions: 59(W)x45(H)x22(D) [mm]

Using on the Raspberry Pi

We have put together the drivers and test code for using this on the Raspberry Pi.  A driver for the Arduino is available in the download section below.


Download the Raspberry Pi Software here:

This software requires pigio in order to get accurate timings.

Install pigio as follows:

sudo apt-get update
sudo apt-get update sudo apt-get install pigpio python-pigpio python3-pigpio


Calculating AQI

See the Wiki Page on calculating AQI.   The AQI generated in this set of drivers is derived from this page.

The AQI is based on the five “criteria” pollutants regulated under the Clean Air Act: ground-level ozone, particulate matter, carbon monoxide, sulfur dioxide, and nitrogen dioxide. The EPA has established National Ambient Air Quality Standards(NAAQS) for each of these pollutants in order to protect public health. An AQI value of 100 generally corresponds to the level of the NAAQS for the pollutant.[10] The Clean Air Act (USA) (1990) requires EPA to review its National Ambient Air Quality Standards every five years to reflect evolving health effects information. The Air Quality Index is adjusted periodically to reflect these changes.


If you have Pi2Grover, plug your Grove Dust Sensor into D4/D5. That’s it.
Otherwise, you need to write up the unit onto your GPIO on the Raspberry Pi. We only support the Grove version at SwitchDoc Labs.  I you hook it up directly, beware of your 3.3V pins connecting to the 5V pins on the Grove Dust Sensor.  The Pi2Grover board has built in 3.3V to 5.0V buffers.


To test, clone git repository into your Raspberry Pi Home Directory. Then go into the directory
and edit to change your GPIO pin number to match the Grove Plug you plugged it into.

Start the pigpio daemon

sudo pigpio

Then run the program:

sudo python

You should (after 30 seconds) start to see output like this:

Air Quality Measurements for PM2.5:
  1147 particles/0.01ft^3
  1 ugm^3
  Current AQI (not 24 hour avg): 7

Air Quality Measurements for PM2.5:
  1487 particles/0.01ft^3
  2 ugm^3
  Current AQI (not 24 hour avg): 9

Air Quality Measurements for PM2.5:
  6741 particles/0.01ft^3
  10 ugm^3
  Current AQI (not 24 hour avg): 43

Air Quality Measurements for PM2.5:
  2295 particles/0.01ft^3
  3 ugm^3
  Current AQI (not 24 hour avg): 14

Use the Pi2Grover board to connect to the Raspberry Pi



  • This sensor uses a counting method to measure dust concentration, not using a weighing method, and the unit is pcs/L or pcs/0.01cf.
  • Please keep it upright.
  • 3 min preheat time is required while using for the first time.
  • Arbitrary operation may cause unexpected damage.
  • The adjustments on the board (potentiometers) are used only for the factory setting. DO NOT change the default configuration.


Item Norm Unit
VCC 4.75~5.75 V
Standby Current Supply 90 mA
Detectable range of concentration 0~28,000 / 0 ~ 8000 pcs/liter / pcs/0.01cf
Operating Temperature Range 0~45 °C
Output Method Negative Logic, Digital output, High: over 4.0V(Rev.2), Low: under 0.7V
Detecting the particle diameter >1 μm
Dimensions 59(W) × 45(H) × 22(D) mm
Humidity Range 95% rh or less
%d bloggers like this: