Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use MQ135: Examples, Pinouts, and Specs

Image of MQ135Design 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. It operates on the principle of resistive change, where the sensor's resistance varies in the presence of target gases. This change is converted into an analog output signal, making it suitable for air quality monitoring and environmental sensing 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!
Image of Arduino UNO Based Air Quality Monitoring and GSM Notification System: 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.

Open Project in Cirkit Designer
Image of Arduino UNO Based Gas Detection and GSM Alert System: 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.

Open Project in Cirkit Designer
Image of Arduino UNO Based Air Quality Monitor with Buzzer Alert: 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.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

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

Parameter Value
Operating Voltage 5V DC
Load Resistance (RL) 10 kΩ (typical)
Heating Voltage (VH) 5V ± 0.1V
Heating Current (IH) ≤ 120 mA
Detection Range 10 ppm to 1000 ppm
Preheat Time ≥ 24 hours (for best results)
Analog Output Voltage 0V to 5V
Operating Temperature -20°C to 50°C
Humidity Range ≤ 95% RH
Sensor Life ≥ 2 years

Pin Configuration and Descriptions

The MQ135 sensor module typically has four pins. 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

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 the Output:
    • Use the AOUT pin to read the analog voltage output. This can be connected to an ADC (Analog-to-Digital Converter) pin of a microcontroller like Arduino.
    • Alternatively, use the DOUT pin for a digital HIGH/LOW signal based on a preset threshold.
  3. Calibrate the Sensor:
    • Allow the sensor to preheat for at least 24 hours for accurate readings.
    • Use a potentiometer (if available on the module) to adjust the threshold for the DOUT pin.

Important Considerations and Best Practices

Example: Connecting MQ135 to Arduino UNO

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

Circuit Connections

Arduino Code

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

const int sensorPin = A0; // MQ135 analog output connected to Arduino A0

void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600 baud
  Serial.println("MQ135 Gas Sensor Test");
}

void loop() {
  int sensorValue = analogRead(sensorPin); // Read analog value from sensor
  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 1 second before the next reading
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings:

    • Cause: Insufficient preheating time.
    • Solution: Allow the sensor to preheat for at least 24 hours before use.
  2. Fluctuating Readings:

    • Cause: Unstable power supply or environmental interference.
    • Solution: Use a stable 5V power source and ensure proper ventilation around the sensor.
  3. DOUT Pin Not Triggering:

    • Cause: Incorrect threshold setting.
    • Solution: Adjust the potentiometer on the module to set the desired threshold.
  4. Sensor Not Responding to Gases:

    • Cause: Sensor may be damaged or expired.
    • Solution: Replace the sensor if it has exceeded its lifespan (typically 2 years).

FAQs

Q1: Can the MQ135 detect specific gases like CO2 or CO?
A1: The MQ135 is sensitive to a variety of gases, but it is not selective. It provides a general indication of air quality rather than precise gas concentration.

Q2: How do I calibrate the MQ135 for specific gases?
A2: Calibration requires exposing the sensor to a known concentration of the target gas and adjusting the readings accordingly. This process may require additional equipment.

Q3: Can I use the MQ135 with a 3.3V microcontroller?
A3: The MQ135 is designed for 5V operation. If using a 3.3V microcontroller, a level shifter or voltage regulator is required.

Q4: How often should I replace the MQ135 sensor?
A4: The sensor typically lasts for 2 years under normal operating conditions. Replace it if readings become unreliable.