The Gravity: PM2.5 Air Quality Sensor (SEN0460) is a high-precision sensor module designed by DFRobot to detect and measure the concentration of fine particulate matter (PM2.5) in the air. PM2.5 refers to particles that are 2.5 micrometers or smaller in diameter, which can pose health risks when inhaled. This sensor is essential for environmental monitoring, air purification systems, and indoor air quality assessment.
Pin Number | Description | Type |
---|---|---|
1 | Analog Output (AO) | Output |
2 | PWM Output | Output |
3 | LED Indicator | Output |
4 | Not Connected (NC) | - |
5 | Ground (GND) | Power |
6 | Power Supply (VCC) | Power |
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup() {
// Start the hardware serial port
Serial.begin(9600);
// Start the software serial port
mySerial.begin(9600);
}
void loop() {
if (mySerial.available()) {
// Read the data from the sensor
int pmValue = mySerial.read();
// Output the PM2.5 value to the hardware serial port
Serial.print("PM2.5 Value: ");
Serial.println(pmValue);
}
}
Note: This example assumes the use of a SoftwareSerial library to communicate with the sensor. The actual implementation may vary depending on the sensor's communication protocol and the specific library used for interfacing with the sensor. Always refer to the sensor's datasheet and the library's documentation for accurate implementation details.