Using a Dust Sensor to Estimate Particulate Levels
Low-cost dust sensors can be used to estimate particulate pollution levels. These sensors operate by shining a beam of light through the air. Dust particles enter the beam and bounce light down into a light sensor.
The standard interface for these low-cost sensors is a digital pulse each time a dust particle passes through the beam. You can estimate dust levels by counting up the pulses over a given time window. The data tends to be noisy (because the dust is sparse and random), so it is best to use a long time window (i.e. temporal averaging or filtering).
You can find an example of this in the code for our Air Quality Measurement Station
Note that these devices do not give you precise PM2.5 levels, since they respond to a range of different particle sizes. Measuring accurate PM2.5 levels requires more expensive hardware with filters, air vortexes, or other mechanisms to separate the particles by size.
Hardware
We typically use the Shinyei PPD42, available with a Grove connector from Seeed Studio. This device has been the basis of numerous DIY air quality measurement systems.
A higher-quality alternative is the Shinyei PPD60, which costs about $200-250 in low quantities. This device has been recommended by the EPA for DIY particulate measurement.
References
Also check out David Holstius's Ph.D. thesis (Monitoring Particulate Matter with Commodity Hardware).