The MQ135 is a versatile gas sensor designed for detecting a wide range of gases including ammonia (NH3), nitrogen oxides (NOx), alcohols, aromatic compounds, sulfide, smoke, and carbon dioxide (CO2). It is commonly used in air quality monitoring equipment for both indoor and outdoor environments, as well as in systems for detecting hazardous gases for safety and health applications.
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (5V) |
2 | GND | Ground |
3 | DO | Digital output (TTL) |
4 | AO | Analog output (Varies with gas concentration) |
// MQ135 Gas Sensor Example Code
#include <MQ135.h>
MQ135 gasSensor = MQ135(A0); // Assign the analog pin A0 to MQ135
void setup() {
Serial.begin(9600); // Start serial communication at 9600 baud rate
}
void loop() {
float ppm = gasSensor.getPPM(); // Get the concentration of gas in ppm
Serial.print("Gas concentration: ");
Serial.print(ppm);
Serial.println(" ppm");
delay(1000); // Wait for a second before taking the next reading
}
Q: How long does the MQ135 sensor last? A: The lifespan of the MQ135 sensor can vary depending on usage and environmental conditions, but it typically lasts for about 2 years with proper calibration and maintenance.
Q: Can the MQ135 sensor detect carbon monoxide (CO)? A: The MQ135 is not specifically designed for CO detection. For accurate carbon monoxide measurements, a dedicated CO sensor is recommended.
Q: Is the MQ135 sensor suitable for outdoor use? A: Yes, the MQ135 can be used outdoors, but it should be protected from water and extreme environmental conditions to ensure accurate readings.