- All products
- Sensors & Modules
- Gas
- MQ 135 Gas Sensor Module for Benzene, Alcohol
- Gas
Features
- Multi-gas response: Sensitive to ammonia, nitrogen oxides, alcohol vapour, benzene, smoke, and other gases.
- Analog output: Provides a variable voltage for monitoring changes in sensor response.
- Digital output: Onboard comparator provides a HIGH or LOW signal when the adjusted threshold is crossed.
- Adjustable threshold: Onboard potentiometer controls the digital output switching threshold.
- Heated sensing element: Uses a built-in heater to maintain the operating temperature required by the sensing material.
- Simple interface: Four pins for power, ground, analog output, and digital output.
- Microcontroller compatibility: Suitable for prototyping with Arduino and other controllers, subject to input-voltage compatibility.
- Mounting holes: The module PCB includes mounting holes for installation.
Principle of Operation
The MQ-135 uses a tin dioxide (SnO2) semiconductor sensing element. Its electrical resistance changes when exposed to certain gases in the surrounding air.
- Heating: An integrated heater raises the temperature of the sensing element to its operating level.
- Gas interaction: Gas molecules interact with the heated SnO2 surface, changing its electrical resistance.
- Analog signal: The module's sensing circuit converts the resistance change into a variable analog output voltage.
- Digital signal: An onboard comparator compares the sensor signal with an adjustable threshold and switches the digital output when that threshold is crossed.
- Microcontroller reading: A controller can read the analog output to monitor relative changes or use the digital output for threshold-based detection.
The analog output is a sensor response, not a direct measurement in parts per million (ppm). Accurate concentration estimates require suitable calibration, reference measurements, and compensation for environmental conditions such as temperature and humidity. The MQ-135 is cross-sensitive to multiple gases, so it cannot independently identify which gas caused a change in its output.
The onboard potentiometer adjusts the digital comparator threshold. It does not calibrate the sensor or convert its output into a gas concentration measurement.
Pinout

| Pin | Name | Description |
|---|---|---|
| 1 | VCC | 5V power supply input. |
| 2 | GND | Ground connection. |
| 3 | DO | Digital output from the onboard comparator. Switching threshold is adjusted using the potentiometer. |
| 4 | AO | Analog output representing the sensor response. |
Wiring and Connection

To connect the MQ-135 module to an Arduino Uno:
- VCC: Connect to the Arduino 5V supply.
- GND: Connect to Arduino GND.
- AO: Connect to Arduino analog input A0.
- DO: Optionally connect to a digital input such as D8 when threshold-based detection is required.
Important: The module is designed for 5V operation, and its analog or digital outputs may approach the supply voltage. Do not connect these outputs directly to 3.3V-only microcontroller inputs, such as those on many ESP32 boards, without suitable voltage-level protection. The heater also draws significant current; do not power it from a microcontroller GPIO pin.
Library
No additional library is required for basic operation. The analog and digital outputs can be read using standard Arduino functions such as analogRead() and digitalRead().
Code
The following Arduino example reads the analog output, displays the raw ADC value in the Serial Monitor, and turns on the onboard LED when the reading exceeds a demonstration threshold.
#define MQ135_PIN A0
#define LED_PIN 13
int sensorValue = 0;
const int threshold = 700;
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
Serial.println("MQ-135 sensor starting...");
}
void loop() {
sensorValue = analogRead(MQ135_PIN);
Serial.print("Sensor Value: ");
Serial.println(sensorValue);
if (sensorValue > threshold) {
digitalWrite(LED_PIN, HIGH);
} else {
digitalWrite(LED_PIN, LOW);
}
delay(2000);
}
Code notes:
MQ135_PINdefines the analog input connected to the module's AO pin.analogRead()reads the analog signal. On a standard Arduino Uno, the result ranges from 0 to 1023.- The value 700 is an example threshold for demonstrating LED switching. It is not a calibrated gas concentration limit.
- The LED turns on when the raw reading exceeds the example threshold.
- The two-second delay sets the interval between readings.
This example does not calculate ppm, identify individual gases, or perform sensor calibration. The sensor requires an initial conditioning period specified by its datasheet; a 20-second delay is not sufficient to establish stable, calibrated readings. Allow for the required preheating and calibration before using measurements for meaningful comparisons.
Applications
- Indoor air-quality monitoring prototypes.
- Environmental monitoring and air-pollution experiments.
- Experimental gas-response measurement systems.
- Educational projects involving semiconductor gas sensors.
- Microcontroller-based air-quality monitoring systems.
- Research and development projects involving gas sensing.
- Ventilation and HVAC monitoring prototypes.
The MQ-135 is a general-purpose sensor module, not a certified CO2 monitor, smoke alarm, or life-safety gas detector. It should not be used as the sole detection device in safety-critical applications.
Specifications
- Sensor type: Metal oxide semiconductor (SnO2).
- Model: MQ-135.
- Operating voltage: 5V DC.
- Heater voltage: 5.0V ± 0.2V.
- Heater current: Up to approximately 180mA, depending on operating conditions.
- Target gases and vapours: Ammonia, nitrogen oxides, alcohol vapour, benzene, smoke, and other air contaminants.
- Published sensing resistance: Approximately 2kΩ to 20kΩ under the specified test conditions at 100ppm ammonia.
- Analog output: Variable voltage dependent on the sensor circuit and gas exposure.
- Digital output: Comparator-based HIGH/LOW signal.
- Digital threshold adjustment: Onboard potentiometer.
- Operating temperature: -10°C to 50°C (module/source-dependent).
- Module dimensions: Approximately 40 x 21mm.
Measurement note: The MQ-135 does not provide a universal 10–1,000ppm measurement range or a guaranteed accuracy of ±3%. Its response depends on the target gas, calibration conditions, load resistance, temperature, humidity, and sensor history. Refer to the datasheet for the specified test conditions and characteristic curves.
Comparison: MQ-135 vs MQ-3
| Feature | MQ-135 | MQ-3 |
|---|---|---|
| Primary use | General air-quality and multi-gas response monitoring. | Alcohol vapour detection. |
| Target gases | Ammonia, nitrogen oxides, alcohol vapour, benzene, smoke, and other gases. | Primarily alcohol vapour, with cross-sensitivity to other substances. |
| Operating voltage | Typically 5V. | Typically 5V. |
| Outputs | Analog and comparator-based digital outputs on common modules. | Analog and comparator-based digital outputs on common modules. |
| Best suited for | General air-quality sensing experiments. | Alcohol vapour sensing experiments. |
Choose the MQ-135 for general multi-gas air-quality experiments and the MQ-3 when the main target is alcohol vapour. Neither sensor provides selective, calibrated measurements without an appropriate measurement and calibration system.
Resources
Features
- Multi-gas response: Sensitive to ammonia, nitrogen oxides, alcohol vapour, benzene, smoke, and other gases.
- Analog output: Provides a variable voltage for monitoring changes in sensor response.
- Digital output: Onboard comparator provides a HIGH or LOW signal when the adjusted threshold is crossed.
- Adjustable threshold: Onboard potentiometer controls the digital output switching threshold.
- Heated sensing element: Uses a built-in heater to maintain the operating temperature required by the sensing material.
- Simple interface: Four pins for power, ground, analog output, and digital output.
- Microcontroller compatibility: Suitable for prototyping with Arduino and other controllers, subject to input-voltage compatibility.
- Mounting holes: The module PCB includes mounting holes for installation.
Principle of Operation
The MQ-135 uses a tin dioxide (SnO2) semiconductor sensing element. Its electrical resistance changes when exposed to certain gases in the surrounding air.
- Heating: An integrated heater raises the temperature of the sensing element to its operating level.
- Gas interaction: Gas molecules interact with the heated SnO2 surface, changing its electrical resistance.
- Analog signal: The module's sensing circuit converts the resistance change into a variable analog output voltage.
- Digital signal: An onboard comparator compares the sensor signal with an adjustable threshold and switches the digital output when that threshold is crossed.
- Microcontroller reading: A controller can read the analog output to monitor relative changes or use the digital output for threshold-based detection.
The analog output is a sensor response, not a direct measurement in parts per million (ppm). Accurate concentration estimates require suitable calibration, reference measurements, and compensation for environmental conditions such as temperature and humidity. The MQ-135 is cross-sensitive to multiple gases, so it cannot independently identify which gas caused a change in its output.
The onboard potentiometer adjusts the digital comparator threshold. It does not calibrate the sensor or convert its output into a gas concentration measurement.
Pinout

| Pin | Name | Description |
|---|---|---|
| 1 | VCC | 5V power supply input. |
| 2 | GND | Ground connection. |
| 3 | DO | Digital output from the onboard comparator. Switching threshold is adjusted using the potentiometer. |
| 4 | AO | Analog output representing the sensor response. |
Wiring and Connection

To connect the MQ-135 module to an Arduino Uno:
- VCC: Connect to the Arduino 5V supply.
- GND: Connect to Arduino GND.
- AO: Connect to Arduino analog input A0.
- DO: Optionally connect to a digital input such as D8 when threshold-based detection is required.
Important: The module is designed for 5V operation, and its analog or digital outputs may approach the supply voltage. Do not connect these outputs directly to 3.3V-only microcontroller inputs, such as those on many ESP32 boards, without suitable voltage-level protection. The heater also draws significant current; do not power it from a microcontroller GPIO pin.
Library
No additional library is required for basic operation. The analog and digital outputs can be read using standard Arduino functions such as analogRead() and digitalRead().
Code
The following Arduino example reads the analog output, displays the raw ADC value in the Serial Monitor, and turns on the onboard LED when the reading exceeds a demonstration threshold.
#define MQ135_PIN A0
#define LED_PIN 13
int sensorValue = 0;
const int threshold = 700;
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
Serial.println("MQ-135 sensor starting...");
}
void loop() {
sensorValue = analogRead(MQ135_PIN);
Serial.print("Sensor Value: ");
Serial.println(sensorValue);
if (sensorValue > threshold) {
digitalWrite(LED_PIN, HIGH);
} else {
digitalWrite(LED_PIN, LOW);
}
delay(2000);
}Code notes:
MQ135_PINdefines the analog input connected to the module's AO pin.analogRead()reads the analog signal. On a standard Arduino Uno, the result ranges from 0 to 1023.- The value 700 is an example threshold for demonstrating LED switching. It is not a calibrated gas concentration limit.
- The LED turns on when the raw reading exceeds the example threshold.
- The two-second delay sets the interval between readings.
This example does not calculate ppm, identify individual gases, or perform sensor calibration. The sensor requires an initial conditioning period specified by its datasheet; a 20-second delay is not sufficient to establish stable, calibrated readings. Allow for the required preheating and calibration before using measurements for meaningful comparisons.
Applications
- Indoor air-quality monitoring prototypes.
- Environmental monitoring and air-pollution experiments.
- Experimental gas-response measurement systems.
- Educational projects involving semiconductor gas sensors.
- Microcontroller-based air-quality monitoring systems.
- Research and development projects involving gas sensing.
- Ventilation and HVAC monitoring prototypes.
The MQ-135 is a general-purpose sensor module, not a certified CO2 monitor, smoke alarm, or life-safety gas detector. It should not be used as the sole detection device in safety-critical applications.
Specifications
- Sensor type: Metal oxide semiconductor (SnO2).
- Model: MQ-135.
- Operating voltage: 5V DC.
- Heater voltage: 5.0V ± 0.2V.
- Heater current: Up to approximately 180mA, depending on operating conditions.
- Target gases and vapours: Ammonia, nitrogen oxides, alcohol vapour, benzene, smoke, and other air contaminants.
- Published sensing resistance: Approximately 2kΩ to 20kΩ under the specified test conditions at 100ppm ammonia.
- Analog output: Variable voltage dependent on the sensor circuit and gas exposure.
- Digital output: Comparator-based HIGH/LOW signal.
- Digital threshold adjustment: Onboard potentiometer.
- Operating temperature: -10°C to 50°C (module/source-dependent).
- Module dimensions: Approximately 40 x 21mm.
Measurement note: The MQ-135 does not provide a universal 10–1,000ppm measurement range or a guaranteed accuracy of ±3%. Its response depends on the target gas, calibration conditions, load resistance, temperature, humidity, and sensor history. Refer to the datasheet for the specified test conditions and characteristic curves.
Comparison: MQ-135 vs MQ-3
| Feature | MQ-135 | MQ-3 |
|---|---|---|
| Primary use | General air-quality and multi-gas response monitoring. | Alcohol vapour detection. |
| Target gases | Ammonia, nitrogen oxides, alcohol vapour, benzene, smoke, and other gases. | Primarily alcohol vapour, with cross-sensitivity to other substances. |
| Operating voltage | Typically 5V. | Typically 5V. |
| Outputs | Analog and comparator-based digital outputs on common modules. | Analog and comparator-based digital outputs on common modules. |
| Best suited for | General air-quality sensing experiments. | Alcohol vapour sensing experiments. |
Choose the MQ-135 for general multi-gas air-quality experiments and the MQ-3 when the main target is alcohol vapour. Neither sensor provides selective, calibrated measurements without an appropriate measurement and calibration system.

