Stufin
Home Quick Cart Profile

MQ-135 Gas Sensor Module For NH3, Alcohol, benzene, smoke , CO2 Detector Module

Buy Now

Operating Voltage

5V

Operating Current

150mA (max)

Output Signal

Analog voltage (0V to 5V)

Sensitivity

100-1000ppm (dependent on gas type)

Response Time

10-30 seconds

Operating Temperature

-20C to 50C

Humidity

5-95% RH

Dimensions

34mm x 20mm x 10mm

Applications

The MQ-135 Gas Sensor Module is suitable for a wide range of applications, including

Air quality monitoring systems

Industrial process control systems

Safety systems

Environmental monitoring systems

HVAC systems

Home automation systems

Precautions and Notes

The module should be used in a well-ventilated area to prevent exposure to hazardous gases.

The module should not be exposed to direct sunlight or high temperatures.

The module may require calibration before use.

The module is sensitive to humidity and temperature, so it may require compensation in certain applications.

By following proper usage guidelines and precautions, the MQ-135 Gas Sensor Module can provide accurate and reliable gas detection capabilities for a wide range of applications.

Pin Configuration

  • MQ-135 Gas Sensor Module Documentation
  • Overview
  • The MQ-135 Gas Sensor Module is a versatile sensor module designed to detect various gases, including NH3, alcohol, benzene, smoke, and CO2. This module is widely used in air quality monitoring, industrial automation, and IoT applications. This documentation provides a detailed explanation of the MQ-135 Gas Sensor Module's pins and connection guidelines.
  • Pin Description
  • The MQ-135 Gas Sensor Module has 6 pins, each with a specific function:
  • 1. VCC (Power Supply):
  • Pin type: Power input
  • Voltage range: 5V
  • Description: This pin is used to power the sensor module. Connect it to a 5V power source.
  • 2. GND (Ground):
  • Pin type: Ground
  • Description: This pin is the ground connection for the sensor module. Connect it to the ground of your circuit.
  • 3. AO (Analog Output):
  • Pin type: Analog output
  • Description: This pin provides an analog voltage output proportional to the detected gas concentration.
  • 4. DO (Digital Output):
  • Pin type: Digital output
  • Description: This pin provides a digital output signal ( HIGH or LOW ) indicating the presence or absence of the detected gas. The threshold value can be adjusted using the potentiometer (VR2).
  • 5. VR1 ( heaters voltage adjustment):
  • Pin type: Adjustable voltage input
  • Description: This pin adjusts the heater voltage for the sensor. A lower voltage can reduce power consumption, but may affect sensor accuracy.
  • 6. VR2 ( threshold voltage adjustment):
  • Pin type: Adjustable voltage input
  • Description: This pin adjusts the threshold voltage for the digital output (DO). Turning the potentiometer clockwise increases the threshold value, and counterclockwise decreases it.
  • Connection Guidelines
  • To connect the MQ-135 Gas Sensor Module to your circuit, follow these steps:
  • Step 1: Power Connection
  • Connect the VCC pin to a 5V power source (e.g., an Arduino board or a 5V power supply).
  • Connect the GND pin to the ground of your circuit.
  • Step 2: Analog Output Connection
  • Connect the AO pin to an analog input pin on your microcontroller (e.g., Arduino's A0 pin).
  • Use a resistive divider or a voltage follower circuit if your microcontroller's analog input range is not compatible with the MQ-135's output voltage range.
  • Step 3: Digital Output Connection (Optional)
  • If you want to use the digital output feature, connect the DO pin to a digital input pin on your microcontroller (e.g., Arduino's D2 pin).
  • Make sure to adjust the threshold voltage using VR2 before connecting the DO pin.
  • Step 4: Heater Voltage Adjustment (Optional)
  • If you want to reduce power consumption or adjust the heater voltage, connect VR1 to a voltage source (e.g., a variable voltage regulator) and adjust the voltage to your desired level.
  • Important Notes
  • Make sure to handle the sensor module with care, as it is sensitive to environmental factors and mechanical stress.
  • Avoid exposing the sensor module to direct sunlight, high temperatures, or humidity.
  • Calibrate the sensor module according to the manufacturer's instructions before use.
  • By following these guidelines, you can successfully connect and use the MQ-135 Gas Sensor Module in your IoT projects.

Code Examples

MQ-135 Gas Sensor Module Documentation
Overview
The MQ-135 Gas Sensor Module is a versatile gas detection module capable of detecting various gases, including NH3, alcohol, benzene, smoke, and CO2. This module is widely used in IoT applications, such as air quality monitoring, industrial automation, and surveillance systems.
Pinout and Technical Specifications
Pinout:
	+ VCC: Power supply (5V)
	+ GND: Ground
	+ OUT: Analog output signal
	+ DOUT: Digital output signal (optional)
 Technical Specifications:
	+ Operating Voltage: 5V
	+ Operating Temperature: -20C to 50C
	+ Sensitivity: 1-1000 ppm (depending on the gas type)
	+ Response Time: 10-30 seconds
Arduino Code Examples
### Example 1: Basic Analog Reading
In this example, we will read the analog output signal from the MQ-135 module and display the raw sensor value on the serial monitor.
```cpp
const int sensorPin = A0;  // Connect the OUT pin to an analog input on your Arduino board
void setup() {
  Serial.begin(9600);
}
void loop() {
  int sensorValue = analogRead(sensorPin);
  Serial.print("Sensor Value: ");
  Serial.println(sensorValue);
  delay(500);
}
```
### Example 2: Digital Output with Threshold Detection
In this example, we will use the digital output pin (DOUT) to detect when the gas concentration exceeds a certain threshold.
```cpp
const int doutPin = 2;  // Connect the DOUT pin to a digital input on your Arduino board
void setup() {
  pinMode(doutPin, INPUT);
}
void loop() {
  int sensorState = digitalRead(doutPin);
  if (sensorState == HIGH) {
    Serial.println("Gas concentration exceeded threshold!");
  } else {
    Serial.println("Gas concentration is normal.");
  }
  delay(500);
}
```
### Example 3: airs quality monitoring using MQ-135 with ESP32
This example shows how to use the MQ-135 module with an ESP32 board to monitor air quality and send data to a remote server using Wi-Fi.
```cpp
#include <WiFi.h>
#include <HTTPClient.h>
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
const int sensorPin = 32;  // Connect the OUT pin to an analog input on your ESP32 board
WiFiClient espClient;
HTTPClient http;
void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  Serial.println("Connected to WiFi");
}
void loop() {
  int sensorValue = analogRead(sensorPin);
  float airQuality = map(sensorValue, 0, 4095, 0, 100);  // Convert sensor value to air quality percentage
http.begin("http://your_remote_server.com/air_quality_data");
  http.addHeader("Content-Type", "application/x-www-form-urlencoded");
  String postData = "air_quality=" + String(airQuality);
  int httpResponseCode = http.POST(postData);
if (httpResponseCode > 0) {
    Serial.println("Data sent successfully!");
  } else {
    Serial.println("Error sending data: " + http.getString());
  }
http.end();
  delay(60000);  // Send data every 1 minute
}
```
In this example, you'll need to replace `"your_wifi_ssid"` and `"your_wifi_password"` with your Wi-Fi credentials, and `"http://your_remote_server.com/air_quality_data"` with the URL of your remote server.