Dust Sensor Module
Get a PDF version of this file here!
The Dust Sensor Module is an air quality sensor capable of detecting air quality by measuring dust concentration in your surroundings. It is responsive to particles >1µm in diameter. Use this for detecting PM 2.5 particles, environment monitoring or pollution monitoring.
HARDWARE SPECIFICATIONS
- Input Voltage: 5V
- Standby current supply: 90 mA
- Detectable range of concentration: 0-28,000 pcs/liter; 0-8,000 pcs/0.01cf
- Operating Temperature Range: 0-45°C
- Particle Detection Range: >1 µm
- Humidity Range: 95%rh or less
PARTS LIST
For this quickstart guide, we will need the following materials:
- 1 – Arduino Uno
- Connecting wires
- 1 – Dust Sensor Module
HARDWARE OVERVIEW
The Dust Sensor has 5 pins to connect to: GND, OUTPUT (P2), VDC, OUTPUT (P1) and Thresh. The Pinout for the connector is shown in the table beside the image:
Pin | Description |
1 | GND |
2 | Output (P2) |
3 | VDC |
4 | Output(P1) |
5 | Thresh |
In using the table, pin labels are printed in the PCB, indicated by the numbers 1 and 5.
The table below describes the function of each pin in the module
INPUT | Description | |
Thresh | Adjust threshold voltage used in increasing or decreasing sensitivity when using P2 sensor. | |
GND | To be connected to the GND pin in a microcontroller. | |
VDC | Supplies power to the module. Should be connected to a +5V pin. | |
OUTPUT | ||
P2 | Detects particulate sizes around 2.5 µm or higher | |
P1 | Detects particulate sizes around 1 µm or higher |
WIRING CONNECTION
Connect the dust sensor to Arduino Uno according to the table. Pin label of dust sensor is printed on the board:
Dust Sensor (Pin Number from left to right) | Arduino Uno |
1 | GND |
3 | 5V |
4 | Digital 8 |
ARDUINO CODE
Open Arduino IDE. Set the board to Arduino/Genuino Uno. Copy the code below to the programmer:
/* 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(); } }
Upload the code into an Arduino Uno board. Open Serial Monitor, and set baud rate to “9600, Both NL & CL”.
OUTPUT
The Serial output displays 3 outputs: low pulse occupancy, ratio, and concentration. Low pulse occupancy is the amount
References and other Applications
You can find more information, examples and resource below.
Blinds Control by GPL3+
Home Automation Using Raspberry Pi 2 and Windows 10 IoT by CC BY-NC
Datasheet
Datasheet example
Example project by takingspace
Grove example from seeedstudio