Air Quality Monitoring

Automatically measuring and graphing Air Quality with an inexpensive device (Shinyei Model PPD42NS Dust Sensor)
Copyright 2012, Chris Nafis

Table of Contents


Background

With allergies and asthma I'm interested in both the indoor and outdoor air quality. I heat with a Quadrafire woodstove. It is suppose to be a clean stove. I was interested in the impact on both my inside air (ie. ash/dust) and outside air (smoke). New York State monitors the air quality at several locations around the State. Certified Allergy & Asthma Consultants in Albany NY published daily pollen counts. The American Lung Association has a great article called State of the AIR that talks about Particle Pollution. I have several weatherstations collecting data ( KNYREXFO1 [barn roof], KNYCLIFT1 [garage roof] ),

There are several citizen group projects that are developing open source equipment (e.g. Air Quality Egg). There are several recent discussions about adding a Particulate sensor. The Egg Project aims to give citizens a way to participate in the conversation about air quality. It is composed of a sensing device that measures the air quality in the immediate environment and an on-line community that is sharing this information in real-time. It is a community-developed, open source project that is driven by people who care about the air they breathe.


Monitoring

The $290 DC1100 Pro Air Quality is a true Laser Particle Counter with two different size ranges. The small channel (0.5> Micron) should see bacteria and mold. The Large channel (2.5> micron) should see dust and pollen. The LCD display constantly shows bargraphs and values for the small and large particles. The unit saves 30 days of air quality data. I ordered the unit with the PC Interface Option and connected it to an Arduino Ethernet so I can automatically log the data to Pachube. That way air quality alerts can be triggered and sent to twitter and my cell phone.

The unit is amazingly sensitive. It easily sees the dust kicked up from walking on a rug or the vapors from cooking. Looking at the graphs below you can see some interesting things. First you can see that things settle down at night when people are not walking around. You can see around noon that my daughter cooked lunch. It's surprising how long it takes for the fine particles to settle down.



Approach

Set Up

The hardware set-up is very easy. If you order the Grove Shield, you just need to put the stacking headers on the Arduino Ethernet and install the shield. Plug the Grove dust connector into Digital Port 8. Without the shield, you can just cut the 4-pin connector off, and solder header pins to the wires.
JST Pin 1 (Black Wire)  => Arduino GND
JST Pin 3 (Red wire)    => Arduino 5VDC
JST Pin 4 (Yellow wire) => Arduino Digital Pin 8
PPD42NS Spec. Sheet

The interface is fairly simple. You just measure how long the digital signal on Pin 8 is low during the 30 second sample time. This ratio is used in a transfer function to calculate the particles per 0.01 cubic feet.

Software

The Arduino grovedust.ino sketch demonstrates reading the Grove sensor and printing the low pulse duration, the ratio, and estimated particles per 0.01 cubic feet. The grovedustpachube.ino sketch sends the estimated particles per 0.01 cubic feet and the low pulse ratio to a Pachube feed. You need to edit this sketch to use your own feed id and key.
/*
 Interface to Shinyei Model PPD42NS Particle Sensor
 Program by Christopher Nafis 
 Written April 2012
 
 http://www.seeedstudio.com/depot/grove-dust-sensor-p-1050.html
 http://www.sca-shinyei.com/pdf/PPD42NS.pdf
 
 JST Pin 1 (Black Wire)  => Arduino GND
 JST Pin 3 (Red wire)    => Arduino 5VDC
 JST Pin 4 (Yellow wire) => Arduino Digital Pin 8
 */

int pin = 8;
unsigned long duration;
unsigned long starttime;
unsigned long sampletime_ms = 30000;
unsigned long lowpulseoccupancy = 0;
float ratio = 0;
float concentration = 0;

void setup() {
  Serial.begin(9600);
  pinMode(8,INPUT);
  starttime = millis();
}

void loop() {
  duration = pulseIn(pin, LOW);
  lowpulseoccupancy = lowpulseoccupancy+duration;

  if ((millis()-starttime) > sampletime_ms)
  {
    ratio = lowpulseoccupancy/(sampletime_ms*10.0);  // Integer percentage 0=>100
    concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve
    Serial.print(lowpulseoccupancy);
    Serial.print(",");
    Serial.print(ratio);
    Serial.print(",");
    Serial.println(concentration);
    lowpulseoccupancy = 0;
    starttime = millis();
  }
}

Calibration

I digitized the Spec. Sheet Characteristic Chart and fit a cubic polynomial to it. I got the following equation:
y = 1.1x^3 - 3.8x^2 + 520x + 0.62

Testing

My previous experience showed that cooking puts a lot of particulates into the air. So for a quick test, I fried some bacon on the stove and logged the results from the two sensors. I need to get more data from normal days. The Dylos is very sensitive at low particle counts. The Sharp Dust Sensor using the Arduino A/D turned out not to be too sensitive to low levels.

The Fry pan Bacon test :-)


Materials


Results

Other types of real-time data have sites that users can share their data with the global Internet Community. For example, Weather Underground is a great place to store my weatherstation data. StrikeStar is wonderful for processing distributed lightning detectors data to produce real-time maps.

Pachube ("patch-bay") connects people to devices, applications, and the Internet of Things. As a web-based service built to manage the world's real-time data, Pachube gives people the power to share, collaborate, and make use of information generated from the world around them.

This is a perfect repository for our Dylos Air Quality, Shinyei Air Quality, and Radon data. It provides a simple HTTP interface to post data and applications which generate charts that can be included on your web pages:


References

Articles

Sharp Sensor

Dylos

Grove Dust Sensor


Disclaimer

This project is for experimental use only. The user assumes all responsibilities for assembly, installation, and use. This circuit is provided without warranty and the author makes no claim that this device will work in any particular application. Do not use in applications where failure or incorrect operation could jeopardize someone's safety. This schematic is provided for noncommercial use only.