Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use MQ135: Examples, Pinouts, and Specs

Image of MQ135
Cirkit Designer LogoDesign with MQ135 in Cirkit Designer

Introduction

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 is widely used in air quality monitoring systems, industrial safety applications, and environmental testing. It operates on the principle of resistive change, where the sensor's resistance varies in the presence of target gases, producing an analog output that can be easily read by microcontrollers.

Explore Projects Built with MQ135

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO Based Air Quality Monitoring and GSM Notification System
Image of Arduino wild: A project utilizing MQ135 in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an MQ135 air quality sensor, an MPU-6050 accelerometer/gyroscope, a SIM900A GSM communication module, and a buzzer. The Arduino reads analog data from the MQ135 sensor and communicates with the MPU-6050 via I2C, while also controlling the buzzer and handling serial communication with the SIM900A module. The purpose of this circuit is likely to monitor air quality and motion, provide alerts through the buzzer, and enable remote communication via GSM.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Air Quality Monitor with LED Indicator and Piezo Speaker
Image of EXP-2. LED & Buzzer ON/OFF Using MQ-135 Sensor & Arduino: A project utilizing MQ135 in a practical application
This circuit uses an Arduino UNO to monitor air quality via an MQ 135 sensor and provides visual and auditory feedback using an LED and a piezo speaker. The Arduino is powered by a MAHIR 7.0 power supply, and the LED and speaker are controlled through digital pins D13 and D12, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Gas Detection and GSM Alert System
Image of Copy of Copy of gas sensor: A project utilizing MQ135 in a practical application
This circuit is designed to monitor air quality using an MQ135 sensor and provide visual and audible alerts. It features an Arduino UNO microcontroller interfaced with a GSM module for communication, an I2C LCD for display, and LEDs and a buzzer for local alerts. The Arduino runs embedded code to read the MQ135 sensor data, display air quality index (AQI) on the LCD, and trigger SMS and call alerts via the GSM module when gas is detected above a certain threshold.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Air Quality Monitor with Buzzer Alert
Image of smoke detector: A project utilizing MQ135 in a practical application
This circuit consists of an Arduino UNO microcontroller connected to an MQ135 air quality sensor and a buzzer module. The MQ135 sensor's analog output (A0) is connected to the Arduino's analog input (A0) to monitor air quality, while the buzzer's I/O pin is connected to the Arduino's digital pin (D9) to potentially alert based on sensor readings. The Arduino, sensor, and buzzer share a common power supply (5V) and ground (GND), indicating that the Arduino controls both the sensor data acquisition and the buzzer activation.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MQ135

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino wild: A project utilizing MQ135 in a practical application
Arduino UNO Based Air Quality Monitoring and GSM Notification System
This circuit features an Arduino UNO microcontroller interfaced with an MQ135 air quality sensor, an MPU-6050 accelerometer/gyroscope, a SIM900A GSM communication module, and a buzzer. The Arduino reads analog data from the MQ135 sensor and communicates with the MPU-6050 via I2C, while also controlling the buzzer and handling serial communication with the SIM900A module. The purpose of this circuit is likely to monitor air quality and motion, provide alerts through the buzzer, and enable remote communication via GSM.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of EXP-2. LED & Buzzer ON/OFF Using MQ-135 Sensor & Arduino: A project utilizing MQ135 in a practical application
Arduino UNO Air Quality Monitor with LED Indicator and Piezo Speaker
This circuit uses an Arduino UNO to monitor air quality via an MQ 135 sensor and provides visual and auditory feedback using an LED and a piezo speaker. The Arduino is powered by a MAHIR 7.0 power supply, and the LED and speaker are controlled through digital pins D13 and D12, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of Copy of gas sensor: A project utilizing MQ135 in a practical application
Arduino UNO Based Gas Detection and GSM Alert System
This circuit is designed to monitor air quality using an MQ135 sensor and provide visual and audible alerts. It features an Arduino UNO microcontroller interfaced with a GSM module for communication, an I2C LCD for display, and LEDs and a buzzer for local alerts. The Arduino runs embedded code to read the MQ135 sensor data, display air quality index (AQI) on the LCD, and trigger SMS and call alerts via the GSM module when gas is detected above a certain threshold.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of smoke detector: A project utilizing MQ135 in a practical application
Arduino UNO Based Air Quality Monitor with Buzzer Alert
This circuit consists of an Arduino UNO microcontroller connected to an MQ135 air quality sensor and a buzzer module. The MQ135 sensor's analog output (A0) is connected to the Arduino's analog input (A0) to monitor air quality, while the buzzer's I/O pin is connected to the Arduino's digital pin (D9) to potentially alert based on sensor readings. The Arduino, sensor, and buzzer share a common power supply (5V) and ground (GND), indicating that the Arduino controls both the sensor data acquisition and the buzzer activation.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Air quality monitoring systems
  • Industrial gas leak detection
  • Environmental pollution monitoring
  • Smoke and alcohol detection systems
  • Smart home automation for air quality control

Technical Specifications

The MQ135 sensor is designed for ease of use and integration into various systems. Below are its key technical details:

Key Specifications

Parameter Value
Operating Voltage 5V DC
Load Resistance 10 kΩ (recommended)
Heating Voltage 5V ± 0.1V
Power Consumption ≤ 800 mW
Detection Range 10 ppm to 1000 ppm
Preheat Time ≥ 24 hours (for stable output)
Analog Output 0V to 5V
Operating Temperature -20°C to 50°C
Humidity Range ≤ 95% RH
Sensor Life Span ≥ 2 years

Pin Configuration

The MQ135 sensor typically comes with four pins. Below is the pinout description:

Pin Name Description
VCC Power supply input (5V DC)
GND Ground
AOUT Analog output signal (proportional to gas concentration)
DOUT Digital output signal (threshold-based, optional)

Usage Instructions

The MQ135 sensor is straightforward to use in a circuit. Follow the steps below to integrate it into your project:

Circuit Connection

  1. Power Supply: Connect the VCC pin to a 5V power source and the GND pin to ground.
  2. Analog Output: Connect the AOUT pin to an analog input pin on your microcontroller (e.g., Arduino UNO or ESP32).
  3. Digital Output (Optional): If using the DOUT pin, connect it to a digital input pin on your microcontroller. Adjust the onboard potentiometer to set the gas concentration threshold for the digital output.

Important Considerations

  • Preheating: Allow the sensor to preheat for at least 24 hours before taking stable readings.
  • Calibration: Calibrate the sensor in a clean air environment to establish a baseline reading.
  • Load Resistor: Use a 10 kΩ resistor between the AOUT pin and ground for optimal performance.
  • Ventilation: Ensure proper ventilation around the sensor to avoid saturation and improve response time.

Example Code for Arduino UNO

Below is an example of how to use the MQ135 sensor with an Arduino UNO to read analog values:

// MQ135 Gas Sensor Example Code
// Reads analog values from the sensor and prints them to the Serial Monitor.

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
}

Best Practices

  • Avoid exposing the sensor to high concentrations of corrosive gases for extended periods.
  • Place the sensor in a stable environment to minimize noise in readings.
  • Use a low-pass filter in your circuit to smooth out fluctuations in the analog output.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings:

    • Ensure the sensor is properly powered (5V DC).
    • Verify connections to the microcontroller are secure.
    • Allow sufficient preheating time (≥ 24 hours).
  2. Fluctuating Readings:

    • Check for electrical noise in the circuit and use a decoupling capacitor.
    • Ensure the sensor is placed in a stable environment with minimal airflow disturbances.
  3. Digital Output Not Triggering:

    • Adjust the onboard potentiometer to set the correct threshold for the DOUT pin.
    • Verify the digital input pin configuration on your microcontroller.

FAQs

Q: Can the MQ135 detect multiple gases simultaneously?
A: 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 detectable gases.

Q: How do I calibrate the MQ135 sensor?
A: Place the sensor in clean air and record the baseline analog output. Use this value to calculate gas concentrations relative to the baseline.

Q: Can I use the MQ135 with a 3.3V microcontroller like ESP32?
A: Yes, but you will need a level shifter or voltage divider to safely interface the 5V analog output with the 3.3V ADC of the ESP32.

Q: How long does the MQ135 sensor last?
A: The sensor has a typical lifespan of 2 years under normal operating conditions.

By following this documentation, you can effectively integrate the MQ135 gas sensor into your projects for reliable air quality monitoring and gas detection.