House dust is an asthma trigger. Pollution caused by dust particles causes respiratory illness in children and older people. Dust kicked up by vehicles moving on roads make up to 33 percent of air pollution. Dust and pollution particles mix in the atmosphere and can travel for days across continents and countries before settling on the ground's surface. People with heart or lung diseases and other chronic diseases are at increased risk from dust and particle pollution. Pollution can aggravate the disease. Let us create an IoT based device to measure dust concentration so we can prevent respiratory illness by taking precautions.

Dust Sensor

This Dust Sensor gives a good indication of the air qualit is 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) ina 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.

sensor

sensor

Features

Connections

Code

  1. int pin = 8;
  2. unsigned long duration;
  3. unsigned long starttime;
  4. unsigned long sampletime_ms = 2000;//sampe 30s ;
  5. unsigned long lowpulseoccupancy = 0;
  6. float ratio = 0;
  7. float concentration = 0;
  8. void setup() {
  9. Serial.begin(9600);
  10. pinMode(8,INPUT);
  11. starttime = millis();//get the current time;
  12. }
  13. void loop() {
  14. duration = pulseIn(pin, LOW);
  15. lowpulseoccupancy = lowpulseoccupancy+duration;
  16. if ((millis()-starttime) >= sampletime_ms)//if the sampel time = = 30s
  17. {
  18. ratio = lowpulseoccupancy/(sampletime_ms*10.0); // Integer percentage 0=>100
  19. concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve
  20. Serial.print("concentration = ");
  21. Serial.print(concentration);
  22. Serial.println(" pcs/0.01cf");
  23. Serial.println("\n");
  24. lowpulseoccupancy = 0;
  25. starttime = millis();
  26. }
  27. }
sensor

Cautions

Read more articles on Internet of Things (IoT):