

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 change is converted into an analog output, making it suitable for air quality monitoring and environmental sensing applications.








The MQ135 sensor is designed for ease of use and integration into various systems. Below are its key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 5V DC |
| Load Resistance (RL) | 10 kΩ (typical) |
| Heating Voltage (VH) | 5V ± 0.1V |
| Heating Current (IH) | ≤ 120 mA |
| Detection Range | 10 ppm to 1000 ppm (varies by gas) |
| Preheat Time | ≥ 24 hours for stable operation |
| Output Signal | Analog voltage (0-5V) |
| Operating Temperature | -20°C to 50°C |
| Humidity Range | ≤ 95% RH |
| Sensor Life Span | ≥ 2 years (under normal conditions) |
The MQ135 sensor typically comes with a 4-pin or 6-pin interface. Below is the pin configuration for the 4-pin version:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (5V DC) |
| 2 | GND | Ground pin |
| 3 | AOUT | Analog output pin (provides voltage proportional to gas concentration) |
| 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 with 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 analogPin = A0; // Connect AOUT pin of MQ135 to A0 on Arduino
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
pinMode(analogPin, INPUT); // Set the analog pin as input
}
void loop() {
int sensorValue = analogRead(analogPin); // Read the analog value from MQ135
float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (0-5V)
// Print the 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:
Sensor Not Responding:
High Analog Values in Clean Air:
Q1: Can the MQ135 detect multiple gases simultaneously?
A1: The MQ135 provides a combined response to multiple gases. It cannot differentiate between specific gases without additional calibration and processing.
Q2: How do I set the threshold for the digital output (DOUT)?
A2: Use the onboard potentiometer to adjust the threshold level. Turn it clockwise or counterclockwise to increase or decrease sensitivity.
Q3: Can the MQ135 be used outdoors?
A3: While the MQ135 can operate outdoors, it should be protected from extreme weather conditions, such as rain or high humidity, to prevent damage.
Q4: How often should the sensor be replaced?
A4: Under normal conditions, the sensor has a lifespan of approximately 2 years. Replace it if readings become unreliable.