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 (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.

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 detection
  • Smoke and fire detection systems
  • Environmental monitoring stations
  • Home automation for air quality control

Technical Specifications

The MQ135 gas sensor is manufactured by ESP32 with the part ID 002. Below are the key technical details and pin configuration:

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
Sensing Resistance (RS) 10 kΩ to 200 kΩ (clean air)
Preheat Time ≥ 24 hours
Detection Range 10 ppm to 1000 ppm
Operating Temperature -20°C to 50°C
Humidity Range ≤ 95% RH
Dimensions 18mm x 18mm x 15mm

Pin Configuration and Descriptions

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

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 signal)

Usage Instructions

How to Use the MQ135 in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
  2. Read Analog Output: Connect the AO pin to an analog input pin of a microcontroller (e.g., Arduino UNO) to measure gas concentration.
  3. Digital Output (Optional): Use the DO pin for threshold-based detection. Adjust the onboard potentiometer to set the threshold level.
  4. Preheat the Sensor: Allow the sensor to preheat for at least 24 hours for accurate readings.

Important Considerations

  • Preheating: The sensor requires a preheating period of 24 hours for optimal performance.
  • Calibration: Calibrate the sensor in a clean air environment to determine the baseline resistance (RS in clean air).
  • Power Supply: Ensure a stable 5V power supply to avoid fluctuations in readings.
  • Placement: Avoid placing the sensor in environments with high humidity or temperatures beyond its operating range.

Example Code for Arduino UNO

Below is an example code snippet to interface the MQ135 with an Arduino UNO:

// Include necessary libraries
const int analogPin = A0; // Connect AO pin of MQ135 to A0 on Arduino
float sensorValue;        // Variable to store sensor reading

void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600 baud
  pinMode(analogPin, INPUT); // Set the analog pin as input
}

void loop() {
  sensorValue = analogRead(analogPin); // Read analog value from MQ135
  float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage
  Serial.print("Sensor Value: ");
  Serial.print(sensorValue);
  Serial.print(" | Voltage: ");
  Serial.println(voltage);
  
  delay(1000); // Wait for 1 second before next reading
}

Notes on the Code

  • The analogRead() function reads the analog output from the MQ135 sensor.
  • The voltage conversion formula assumes a 10-bit ADC with a 5V reference.
  • Use the serial monitor to observe the sensor readings in real-time.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings

    • Cause: Insufficient preheating time.
    • Solution: Ensure the sensor is preheated for at least 24 hours before use.
  2. Fluctuating Readings

    • Cause: Unstable power supply or environmental interference.
    • Solution: Use a regulated 5V power supply and avoid placing the sensor near fans or vents.
  3. Sensor Not Detecting Gases

    • Cause: Incorrect threshold setting on the potentiometer.
    • Solution: Adjust the potentiometer to set an appropriate threshold level.
  4. High Humidity Impacting Performance

    • Cause: Operating in environments with >95% relative humidity.
    • Solution: Use the sensor in controlled environments within its specified humidity range.

FAQs

Q1: Can the MQ135 detect CO2?
A1: Yes, the MQ135 can detect CO2, but it is more sensitive to ammonia, benzene, and alcohol. For precise CO2 detection, consider a dedicated CO2 sensor.

Q2: How do I calibrate the MQ135 sensor?
A2: Place the sensor in clean air, measure the resistance (RS), and use it as the baseline for gas concentration calculations.

Q3: Can I use the MQ135 with a 3.3V microcontroller?
A3: The MQ135 requires a 5V power supply. Use a level shifter or voltage divider to interface with 3.3V systems.

Q4: How long does the sensor last?
A4: The MQ135 has a typical lifespan of 2-3 years under normal operating conditions.

By following this documentation, users can effectively integrate the MQ135 gas sensor into their projects for reliable air quality monitoring.