Issues with Grove Dust Sensors

Hello - I am building an quality monitor and have a pair of the Grove Dust sensors connected to an Arduino clone.

I have tried this on numerous Arduino and Arduino clone boards with the same results, so I am fairly confident that the problems lay elsewhere.

Currently I am running the Grove Base Shield off of a JeeNode, and I just have the pins jumped between them.

What I am seeing is very erratic reporting from the Dust Sensors. It seems that they go to zero unless they are tapped or bumped in some way. Is that normal? Must they have air flowing by them for them to report?

Here’s an example of the output reported from them over a minute of periodic polling (polled by a JeeLink):

±-------------- JeeNode ID
|| ++±-------- Sensor Name
|| ||||| ++±— Sensor Value
VV:VVVV=VVVV

20:Temp=78.80
20:Temp=78.80
20:Humid=42.20
20:Dust1=0.00 <=== before tapping
20:Dust1=0.00 <=== before tapping
20:Humid=42.20
20:Dust1=0.00 <=== before tapping
20:Dust1=0.00 <=== before tapping
20:Dust2=0.48 <=== this is when I tapped the sensors
20:Temp=78.80
20:Temp=78.80
20:Humid=43.90
20:Dust1=0.64
20:Temp=78.80
20:Humid=43.00
20:Dust1=3.18 <=== normal values reported
20:Dust2=1.85 <=== normal values reported
20:Temp=78.80

Any insight into this is greatly appreciated!
AirMonitor.JPG

This issue has changed a bit. It has been a while, and I don’t recall why the initial symptoms improved, but they did.

Now, I have my whole project installed and operational. However, my dust sensors are still very sporadic. I would really like to understand why they are not more stable. Any ideas?

Attached is a graph from the last six hours of collected data.

Here is the code - which is wrapped in a scheduler architecture (which makes it too complex to paste as it exists in the sketch):

Pin setup:

#define  DUST1_PIN    8  // digital
#define  DUST2_PIN    7  // digital
...
pinMode(DUST1_PIN, INPUT);
pinMode(DUST2_PIN, INPUT);

Read sensors - I added a loop to re-try when the low pulse duration is zero/bad:

  duration1 = duration2 = 0; // fixed 19Aug2012

  // Read Dust Sensors:
  for ( int t=0;t<10;t++ ) {
    if (duration1 == 0 ) duration1 = pulseIn(DUST1_PIN, LOW);
    if (duration2 == 0 ) duration2 = pulseIn(DUST2_PIN, LOW);
    if ( duration1 && duration2 ) break;
    delay(10);
  }
  
  lowpulseoccupancy1 = lowpulseoccupancy1+duration1;
  lowpulseoccupancy2 = lowpulseoccupancy2+duration2;

  Serial.print("duration1: ");
  Serial.print(duration1);  
  Serial.print("    lowpulseoccupancy1: ");
  Serial.println(lowpulseoccupancy1);
  Serial.print("duration2: ");
  Serial.print(duration2);  
  Serial.print("    lowpulseoccupancy2: ");
  Serial.println(lowpulseoccupancy2);

Calculate ratios:

    ratio1 = lowpulseoccupancy1/(sampletime_ms*10.0);  // Integer percentage 0=>100
    concentration1 = 1.1*pow(ratio1,3)-3.8*pow(ratio1,2)+520*ratio1+0.62; // using spec sheet curve
    Serial.print("Sensor 1 : ");
    Serial.println(concentration1);

    // 2
    ratio2 = lowpulseoccupancy2/(sampletime_ms*10.0);  // Integer percentage 0=>100
    concentration2 = 1.1*pow(ratio2,3)-3.8*pow(ratio2,2)+520*ratio2+0.62; // using spec sheet curve
    Serial.print("Sensor 2 : ");
    Serial.println(concentration2);

Screen Shot 2012-08-20 at 8.43.46 AM.png