

The MQ135 is a versatile gas sensor designed to detect a wide range of gases, including ammonia, benzene, alcohol, and smoke. 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 sensing applications. Manufactured by ESP32 with part ID 001, the MQ135 is widely used in both industrial and hobbyist projects.








| Parameter | Value |
|---|---|
| Operating Voltage | 5V DC |
| Load Resistance | 10 kΩ (recommended) |
| Heating Voltage | 5V ± 0.1V |
| Heating Current | ≤ 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 ammonia, benzene, |
| alcohol, smoke, and other gases |
| Pin Name | Pin Number | Description |
|---|---|---|
| VCC | 1 | Power supply pin (5V DC) |
| GND | 2 | Ground pin |
| AOUT | 3 | Analog output pin for gas concentration readings |
| DOUT | 4 | Digital output pin for threshold-based detection |
Below is an example of how to interface the MQ135 with an Arduino UNO to read analog values:
// Include necessary libraries (if any additional libraries are required, install them)
// Define the analog pin connected to the MQ135 sensor
const int MQ135_PIN = A0;
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
pinMode(MQ135_PIN, INPUT); // Set the MQ135 pin as input
}
void loop() {
int sensorValue = analogRead(MQ135_PIN); // Read the analog value from the sensor
float voltage = sensorValue * (5.0 / 1023.0); // Convert the analog value to voltage
// Print the sensor value and voltage to the Serial Monitor
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
Serial.print(" | Voltage: ");
Serial.println(voltage);
delay(1000); // Wait for 1 second before taking the next reading
}
Inconsistent Readings:
No Output from DOUT Pin:
High Sensitivity to Humidity:
Sensor Not Responding:
Q1: Can the MQ135 detect CO2?
A1: Yes, the MQ135 can detect CO2, but it is not specifically calibrated for precise CO2 measurements. For accurate CO2 detection, consider using a dedicated CO2 sensor.
Q2: How do I calibrate the MQ135?
A2: To calibrate the MQ135, expose it to clean air and measure the baseline resistance. 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. If using a 3.3V microcontroller, use a level shifter for the output signals.
Q4: How long does the MQ135 last?
A4: The MQ135 has a typical lifespan of 2-3 years under normal operating conditions.