

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.








The MQ135 sensor is designed for ease of use and integration into various electronic systems. Below are its key technical details:
| Parameter | Value |
|---|---|
| Manufacturer | MQ135 |
| Manufacturer Part ID | MQ135 |
| Operating Voltage | 5V DC |
| Load Resistance (RL) | 10 kΩ (typical) |
| Heater Voltage (VH) | 5V ± 0.1V |
| Heater 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 CO2 |
The MQ135 sensor typically comes with four pins. Below is the pin configuration:
| Pin Name | Description |
|---|---|
| VCC | Power supply pin (5V DC) |
| GND | Ground pin |
| AO | Analog output pin (provides gas concentration) |
| DO | Digital output pin (threshold-based output) |
VCC pin to a 5V DC power source and the GND pin to ground.AO pin to read the gas concentration as an analog voltage. This pin is typically connected to an ADC (Analog-to-Digital Converter) pin on a microcontroller.DO pin provides a digital HIGH or LOW signal based on a preset threshold. Adjust the threshold using the onboard potentiometer.Below is an example of how to interface the MQ135 sensor 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 properly connected to the Arduino.
const int mq135Pin = A0; // Connect AO pin of MQ135 to A0 on Arduino
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 (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 Always HIGH or LOW:
Sensor Not Responding:
Q1: Can the MQ135 detect CO2?
A1: Yes, the MQ135 can detect CO2, but it is more sensitive to gases like ammonia, benzene, and smoke.
Q2: How do I calibrate the MQ135 sensor?
A2: Place the sensor in a clean air environment and record the baseline resistance. Use this value to calculate gas concentrations.
Q3: Can I use the MQ135 with a 3.3V microcontroller?
A3: The MQ135 is designed for 5V operation. Use a level shifter or voltage regulator to interface with 3.3V systems.
Q4: What is the lifespan of the MQ135 sensor?
A4: The sensor typically lasts for 2-3 years under normal operating conditions.