

The MQ135 is a versatile gas sensor designed to detect a wide range of gases, including ammonia (NH3), benzene (C6H6), alcohol, smoke, and other harmful gases. It operates on the principle of resistive change, where the sensor's resistance varies in the presence of target gases. This makes it an ideal choice for air quality monitoring and environmental safety applications.








| Parameter | Value |
|---|---|
| Operating Voltage | 5V DC |
| Load Resistance (RL) | 10 kΩ (typical) |
| Heating Voltage (VH) | 5V ± 0.2V |
| Heating Current (IH) | < 120 mA |
| Detection Range | 10 ppm to 1000 ppm |
| Preheat Time | ≥ 24 hours for stable output |
| Operating Temperature | -20°C to 50°C |
| Humidity Range | 20% to 90% RH (non-condensing) |
| Sensitivity | Adjustable via onboard potentiometer |
| Pin Name | Description |
|---|---|
| VCC | Power supply pin (5V DC) |
| GND | Ground pin |
| AOUT | Analog output pin (provides gas concentration) |
| DOUT | Digital output pin (high/low signal based on threshold) |
// MQ135 Gas Sensor Example Code for Arduino UNO
// This code reads the analog output (AOUT) of the MQ135 sensor and prints
// the gas concentration value to the Serial Monitor.
const int mq135Pin = A0; // Connect AOUT pin of MQ135 to Arduino A0
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Serial.println("MQ135 Gas Sensor Test");
}
void loop() {
int sensorValue = analogRead(mq135Pin); // Read analog value from MQ135
float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage
Serial.print("Sensor Value: ");
Serial.print(sensorValue); // Print raw sensor value
Serial.print(" | Voltage: ");
Serial.print(voltage); // Print voltage value
Serial.println(" V");
delay(1000); // Wait for 1 second before next reading
}
Unstable Readings:
No Output from DOUT Pin:
Incorrect Analog Readings:
Sensor Not Responding:
Q1: Can the MQ135 detect specific gases individually?
A1: No, the MQ135 is a general-purpose gas sensor and cannot differentiate between specific gases. It provides a combined response to all detectable gases in its range.
Q2: How do I calibrate the MQ135 sensor?
A2: Place the sensor in a clean air environment and record the baseline resistance value. Use this value to calculate gas concentrations in your application.
Q3: Can the MQ135 be used outdoors?
A3: The MQ135 is not designed for outdoor use as it is sensitive to humidity and temperature variations. Use it in controlled indoor environments for best results.
Q4: What is the lifespan of the MQ135 sensor?
A4: The MQ135 has a typical lifespan of 2-3 years under normal operating conditions.