

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 response to the concentration of target gases in the air. This makes it an ideal choice for air quality monitoring and environmental safety applications.








Below are the key technical details of the MQ135 gas sensor:
| Parameter | Value |
|---|---|
| Manufacturer | MQ135 |
| Manufacturer Part ID | MQ135 |
| 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 | ≤ 95% RH |
| Sensitivity | Detects NH3, NOx, alcohol, benzene, smoke, and CO |
The MQ135 sensor typically comes with four pins. Below is the pin configuration:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (5V DC) |
| 2 | GND | Ground pin |
| 3 | AOUT | Analog output pin (provides gas concentration as voltage) |
| 4 | DOUT | Digital output pin (high/low signal based on threshold) |
Below is an example of how to interface the MQ135 with an Arduino UNO to read analog values:
// MQ135 Gas Sensor Example Code for Arduino UNO
// This code reads the analog output of the MQ135 sensor and prints the value
// to the Serial Monitor. Ensure the sensor is connected to the correct pins.
const int MQ135_PIN = A0; // Analog pin connected to AOUT of MQ135
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Serial.println("MQ135 Gas Sensor Test");
}
void loop() {
int sensorValue = analogRead(MQ135_PIN); // Read analog value from MQ135
float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (0-5V)
// Print the raw sensor value and voltage to the Serial Monitor
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
Serial.print(" | Voltage: ");
Serial.print(voltage);
Serial.println(" V");
delay(1000); // Wait for 1 second before the next reading
}
No Output or Incorrect Readings:
Fluctuating Readings:
Digital Output Not Triggering:
Sensor Not Detecting Specific Gases:
Q1: Can the MQ135 detect CO2?
A1: The MQ135 is not specifically designed for CO2 detection. While it may respond to CO2, its sensitivity to other gases like NH3, benzene, and smoke is higher.
Q2: How long does the sensor last?
A2: The MQ135 has a typical lifespan of 2-3 years under normal operating conditions. Prolonged exposure to high concentrations of target gases may reduce its lifespan.
Q3: Can I use the MQ135 with a 3.3V microcontroller?
A3: The MQ135 requires a 5V power supply for proper operation. However, you can use a voltage divider or level shifter to interface its output with a 3.3V microcontroller.
Q4: How do I calibrate the MQ135?
A4: To calibrate, expose the sensor to clean air and measure the baseline resistance. Use this value to calculate gas concentrations based on the sensor's response curve provided in the datasheet.