Skip to main content

MQ-135 - Gas Sensor for Air Quality

Pin Configuration:

Pin No:

Pin Name:


For Module



Used to power the sensor, Generally the operating voltage is +5V.



Used to connect the module to system ground.


Digital Out

You can also use this sensor to get digital output from this pin, by setting a threshold value using the potentiometer.


Analog Out

This pin outputs 0-5V analog voltage based on the intensity of the gas.

For Sensor


H -Pins

Out of the two H pins, one pin is connected to supply and the other to ground



The A pins and B pins are interchangeable. These pins will be tied to the Supply voltage.



  1. A pins and B pins are interchangeable. One pin will act as output while the other will be pulled to ground.


MQ-135 Sensor Features

  • Wide detecting scope
  • Fast response and High sensitivity
  • Stable and long life
  • Operating Voltage is +5V
  • Detect/Measure NH3, NOx, alcohol, Benzene, smoke, CO2, etc.
  • Analog output voltage: 0V to 5V
  • Digital output voltage: 0V or 5V (TTL Logic)
  • Preheat duration 20 seconds
  • Can be used as a Digital or analog sensor
  • The Sensitivity of Digital pin can be varied using the potentiometer


Note: Complete technical information can be found in the MQ-135 Datasheet linked a the bottom of this page.


Alternative MQ Gas sensors

Sensor Name

Gas to measure


Methane, Butane, LPG, Smoke


Alcohol, Ethanol, Smoke


Methane, CNG Gas


Natural gas, LPG


LPG, butane


Carbon Monoxide


Hydrogen Gas


Carbon Monoxide, flammable gasses




Air Quality


Hydrogen Sulphide gas




Benzene, Toluene, Alcohol, Propane, Formaldehyde gas, Hydrogen


Methane, Natural Gas


Natural gas, Coal Gas


Alcohol, Ethanol, smoke


LPG, butane


Carbon Monoxide


Carbon Monoxide, flammable gas


Selecting between sensor and module

When it comes to measuring or detecting a particular Gas, the MQ series Gas sensors are the most inexpensive and commonly used ones. MQ135 is available as a module or as just the sensor alone. If you are trying to only detect (not measuring PPM) the presence of a gas, then you can buy it as a module since it comes with an op-amp comparator and a digital output pin. But if you planning to measure the PPM of a gas it is recommend buying the sensor alone without module.


Where to use MQ-135 Gas sensor

The MQ-135 Gas sensors are used in air quality control equipments and are suitable for detecting or measuring of NH3, NOx, Alcohol, Benzene, Smoke, CO2. The MQ-135 sensor module comes with a Digital Pin which makes this sensor to operate even without a microcontroller and that comes in handy when you are only trying to detect one particular gas. If you need to measure the gases in PPM, the analog pin need to be used. The analog pin is TTL driven and works on 5V and so can be used with most common microcontrollers.

If you are looking for a sensor to detect or measure common air quality gases such as CO2, Smoke, NH3, NOx, Alcohol, Benzene then this sensor might be the right choice for you.


How to use MQ-135 Sensors to detect gases

You can either use the digital pin or the analog pin to do this. Simply power the module with 5V and you should notice the power LED on the module to glow and when no gas it detected the output LED will remain turned off meaning the digital output pin will be 0V. Remember that these sensors have to be kept on for pre-heating time (mentioned in features above) before you can actually work with it. Now, introduce the sensor to the gas you want to detect and you should see the output LED to go high along with the digital pin, if not use the potentiometer until the output gets high. Now every time your sensor gets introduced to this gas at this particular concentration the digital pin will go high (5V) else will remain low (0V).

You can also use the analog pin to achieve the same thing. Read the analog values (0-5V) using a microcontroller, this value will be directly proportional to the concentration of the gas to which the sensor detects. You can experiment with this values and check how the sensor reacts to different concentration of gas and develop your program accordingly.


How to use MQ-135 sensor to measure PPM

MQ-135 gas sensor applies SnO2 which has a higher resistance in the clear air as a gas-sensing material. When there is an increase in polluting gases, the resistance of the gas sensor decreases along with that. To measure PPM using MQ-135 sensor we need to look into the (Rs/Ro) v/s PPM graph taken from the MQ135 datasheet.

MQ-135 Sensitivity Characteristics

The above figure shows shows the typical sensitivity characteristics of the MQ-135 for several gases. in their: Temp: 20,­ ­ Humidity: 65%­, O2 concentration 21%, RL=20kΩ,

Ro: sensor resistance at 100ppm of NH3 in the clean air.

Rs:sensor resistance at various concentrations of gases.


The value of Ro is the value of resistance in fresh air (or the air with we are comparing) and the value of Rs is the value of resistance in Gas concentration. First you should calibrate the sensor by finding the values of Ro in fresh air and then use that value to find Rs using the below formula:

Calculate Resistance of MQ135

Once we calculate Rs and Ro we can find the ratio and then using the graph shown above we can calculate the equivalent value of PPM for that particular gas.



  • Used to detect leakage/excess of gases like Ammonia, nitrogen oxide, alcohols, aromatic compounds, sulfide and smoke.
  • Air quality monitors.


2D model of MQ-135 Gas sensor

Use the following MQ135 sensor dimensions to create your own PCB for your application.

MQ-135 Sensor Dimensions

Component Datasheet

Related Post


Join 20K+subscribers

We will never spam you.

* indicates required

Be a part of our ever growing community.