

The MQ135 is a versatile gas sensor designed to detect a wide range of gases, including ammonia, benzene, alcohol, and smoke. Manufactured by ESP32 with the part ID 001, this sensor operates on the principle of resistive change when exposed to target gases. It provides an analog output that can be easily interfaced with microcontrollers, making it ideal for air quality monitoring and environmental sensing applications.








The MQ135 sensor is designed for ease of use and reliable performance. Below are its key technical details:
| 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 |
| Analog Output Voltage | 0V to 5V |
| Operating Temperature | -20°C to 50°C |
| Humidity Range | ≤ 95% RH |
| Dimensions | 32mm x 20mm x 22mm |
The MQ135 sensor typically comes with a 4-pin interface. Below is the pinout description:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (5V DC) |
| 2 | GND | Ground pin |
| 3 | AOUT | Analog output pin; provides a voltage proportional |
| to the concentration of detected gases | ||
| 4 | DOUT | Digital output pin; triggers when gas concentration |
| exceeds a preset threshold |
The MQ135 sensor is straightforward to use in a circuit. Follow the steps below to integrate it into your project:
Below is an example of how to use the MQ135 sensor with an Arduino UNO to read analog values:
// MQ135 Gas Sensor Example Code
// 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; // Connect AOUT pin of MQ135 to Arduino analog pin A0
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
Sensor Saturation
Digital Output Not Triggering
Q1: Can the MQ135 detect multiple gases simultaneously?
A1: Yes, the MQ135 can detect a variety of gases, but it does not differentiate between them. It provides a combined analog output based on the total concentration of detected gases.
Q2: How do I calibrate the MQ135 sensor?
A2: To calibrate, expose the sensor to clean air and record the baseline analog output. Use this value to calculate gas concentrations in your application.
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: What is the lifespan of the MQ135 sensor?
A4: The MQ135 has a typical lifespan of 2-3 years under normal operating conditions. Regular maintenance and proper usage can extend its life.
By following this documentation, you can effectively integrate the MQ135 gas sensor into your projects and ensure reliable performance.