MOS Gas Sensor: 6 Practical Steps for Reliable PPM Readings

Share:
Electronic Sensors
MOS Gas Sensor: 6 Practical Steps for Reliable PPM Readings

A small tin oxide bead heated to a few hundred degrees changes its resistance when smoke, LPG or carbon monoxide touches it. Read that resistance correctly, calibrate it in clean air and use the datasheet curve, and a cheap module becomes a useful gas indicator.

SnO2 Sensing Layer Heater Element Rs/R0 Ratio MQ Series Models PPM Calculation

Metal oxide sensors such as the MQ series are the most common low cost gas detectors in student projects and consumer alarms. Learn how they work, how to calibrate them and how to turn a voltage into an approximate ppm value.

Hello everyone, today we are going to learn how a MOS gas sensor works, what the heater and Rs/R0 ratio do, how the MQ2, MQ7 and MQ135 differ and how to calculate gas concentration in ppm.
MOS gas sensor

What Is a MOS Gas Sensor?

A MOS gas sensor is a chemiresistor built from a heated metal oxide semiconductor, usually tin dioxide, whose electrical resistance changes when target gases react on its surface. The metal oxide behaves as an n type material, a concept explained in what is a semiconductor.

MOS here means metal oxide semiconductor, not the transistor structure called MOSFET. Such sensors belong to a large family of detection methods, which are compared in gas analyzers explained.

Sensing layer resistance decreasing as carbon monoxide reacts on a metal oxide surface
Image credit: Winsen. Illustration courtesy of Winsen, shown here for educational reference.

The best known examples are the MQ series made by Winsen and Hanwei, such as MQ2 for flammable gas, MQ7 for carbon monoxide and MQ135 for air quality. They are cheap, rugged and easy to read with any microcontroller.

Advertisement

How the Tin Oxide Layer Detects Gas

In clean air, oxygen molecules settle on the hot tin oxide grains and capture free electrons from the material. This creates an electron depleted barrier at every grain boundary, so the layer has a high resistance.

When a reducing gas such as carbon monoxide, methane or LPG arrives, it reacts with the trapped oxygen ions and releases the electrons back into the oxide. The barriers shrink, and the resistance falls in proportion to the gas concentration.

Heater Warms BeadSensing layer reaches its working temperature.
Oxygen AdsorbsSurface oxygen traps electrons, resistance rises.
Target Gas ArrivesGas reacts with oxygen ions on the surface.
Electrons ReturnGrain barriers shrink, resistance falls.
Circuit Reads ChangeLoad resistor turns resistance into voltage.

Oxidising gases such as nitrogen dioxide or ozone do the reverse and raise the resistance of an n type layer. That is why a MOS gas sensor can respond to many gases at once, a property called cross sensitivity.

Do You Know?

Winsen states that the heater keeps the sensing layer at roughly 200 to 400 °C. At room temperature, the surface reactions are too slow for the sensor to respond in any useful time.

Heater, Sensing Element and Load Resistor

A typical MQ element has six pins, two for the heater coil and four for the sensing electrodes. The heater is a nickel chromium coil inside a ceramic tube, and the tin oxide coating sits on the outside of that tube.

According to the Winsen MQ2 manual, the heater needs 5.0 V plus or minus 0.1 V, AC or DC, and consumes up to 950 mW. That is about 190 mA, so the heater must come from a proper 5 V rail and not from a microcontroller pin.

The sensing layer is wired in series with a load resistor RL to form a voltage divider. The voltage across RL rises as the sensor resistance falls, and this is the signal read by the ADC.

Rs = RL × (Vc minus Vout) ÷ Vout
Vc = circuit supply, Vout = voltage across RL

Example: Vc = 5 V, RL = 10 kΩ, Vout = 1.0 V
Rs = 10 × (5 minus 1) ÷ 1
Rs = 40 kΩ
Quick Tip

Many cheap breakout modules fit a 1 kΩ load resistor, which gives very small voltage swings for some gases. Measure the fitted RL with a meter and replace it with 10 kΩ or 20 kΩ if the output barely moves.

Popular MQ Series MOS Gas Sensor Models

ModelMain Target GasTypical Use
MQ2LPG, propane, methane, smokeKitchen and smoke alarms
MQ3Alcohol vapourBreath analyser projects
MQ4Methane, natural gasPNG pipeline leak alarms
MQ5LPG, natural gasDomestic gas leak alarms
MQ7Carbon monoxideGarage and generator room alarms
MQ8HydrogenBattery room monitoring
MQ135Ammonia, benzene, smoke, CO2 trendIndoor air quality boxes

The Winsen MQ2 manual lists a detection range of 300 to 10000 ppm for flammable gas. Winsen gives the MQ7B carbon monoxide sensor a range of 10 to 500 ppm, which suits early warning in homes and parking areas.

The MQ7 is special because its heater is cycled between a high and a low voltage. The high phase near 5 V cleans the surface, and the reading is taken at the end of the low phase near 1.4 V, when carbon monoxide response is strongest.

The MQ135 is sold as an air quality sensor, yet it cannot measure carbon dioxide selectively. For a true CO2 or methane reading, use the optical method explained in NDIR gas analyzer working principle.

Understanding Rs/R0 and Log Log Curves

Every MOS gas sensor datasheet plots Rs/R0 against gas concentration on log scales for both axes. Rs is the resistance you measure now, and R0 is the resistance in a defined reference condition, for example a known ppm of the reference gas or clean air.

On log log paper each gas forms a nearly straight line, which means the sensor follows a power law. This non linear behaviour is the opposite of the ideal described in what is sensor linearity, so the curve must be linearised in software.

Rs/R0 = A × ppm to the power m
m = log(y2 ÷ y1) ÷ log(x2 ÷ x1)
ppm = x1 × (ratio ÷ y1) to the power (1 ÷ m)

Illustrative curve points: (200 ppm, 2.5) and (5000 ppm, 0.6)
m = log(0.24) ÷ log(25) = minus 0.4434
Measured Rs = 40 kΩ, R0 = 20 kΩ, ratio = 2.0
ppm = 200 × (2.0 ÷ 2.5) to the power (1 ÷ minus 0.4434)
ppm = about 331

Read the two curve points for your gas directly from the datasheet graph, as far apart as possible. A small reading error on a log scale can shift the result a lot, so treat the answer as an estimate and not as a certified measurement.

MOS Gas Sensor PPM Calculator

Sensor Resistance, Ratio and Estimated ppm
Result
Rs 40.00 kΩ, Rs/R0 2.000, gas about 331 ppm
Advertisement

6 Practical Calibration Steps

1
Burn In the Sensor
Power the heater continuously for the preheat time in the manual.
2
Warm Up Before Use
Let the reading settle after every power on.
3
Measure Rs in Clean Air
Take an average of many samples in fresh outdoor air.
4
Calculate R0
Divide clean air Rs by the clean air ratio on the datasheet curve.
5
Check With Known Gas
Expose to a certified test gas if you have one.
6
Store and Recheck
Save R0 in memory and repeat the check every few months.

The Winsen MQ2 manual asks for a preheat of not less than 48 hours before the first calibration. During this burn in, contaminants burn off the surface and the resistance drifts to its stable working value.

For the MQ2, many engineers use a clean air Rs/R0 of about 9.8, read from the air line on the datasheet chart. If clean air Rs is 98 kΩ, R0 comes out near 10 kΩ, and this value is then used in every later calculation.

Quick Tip

Do the clean air calibration outdoors or near an open window, never inside a lab that smells of solvent or solder flux. A slightly contaminated room makes R0 too low and every later reading too high.

Do You Know?

The MQ2 manual defines its standard test conditions as 20 °C, 55 percent relative humidity and 21 percent oxygen. Any change from these conditions shifts the curve, which is why the manual includes temperature and humidity correction charts.

Temperature, Humidity and Cross Sensitivity

The resistance of a MOS gas sensor also changes with ambient temperature and moisture, because water vapour competes with oxygen on the surface. Serious designs add a capacitive RH sensor and a thermistor to correct the reading.

Cross sensitivity means an MQ2 will also react to alcohol, cooking fumes and perfume. A MOS gas sensor therefore tells you that something reducing is present, not exactly which gas it is.

Advertisement
Myth: An MQ135 measures CO2 in ppm.
Fact: It responds to many gases, so its CO2 value is only a rough trend.
Myth: The sensor works right after power on.
Fact: It needs warm up after every start and a long burn in when new.
Myth: The datasheet R0 value fits every unit.
Fact: Each sensor differs, so R0 must be measured for each unit.
Myth: A hobby module is a safety device.
Fact: Life safety needs certified detectors with approved calibration.

Where MOS Gas Sensors Fit in Industry

Plant safety systems use certified detectors with electrochemical, catalytic or infrared cells, often tied into a fire and gas system. For toxic gas duty such as hydrogen sulphide, see the approach in H2S gas detector working principle.

Detectors placed in hazardous areas must also carry the right protection for the gas group, as covered in gas groups IIA, IIB and IIC. A bare MQ module has a glowing hot heater and must never be used where flammable gas can build up to explosive levels.

Domestic LPG Alarms
Kitchen leak warning with buzzer and exhaust fan.
Smoke Indicators
Early warning in stores and cabinets.
CO Alarms
Generator rooms, garages and closed parking.
Air Quality Monitors
Trend of pollutants in homes and offices.
Breath Alcohol Testers
Low cost screening devices.
Student Projects
IoT and microcontroller learning kits.
Advantages of a MOS Gas Sensor
  • Very low cost and widely available.
  • Long life, often several years.
  • High sensitivity to many gases.
  • Simple two resistor readout circuit.
  • Robust against shock and dust.
Limitations of a MOS Gas Sensor
  • Poor selectivity and cross sensitivity.
  • High heater power, about 1 W.
  • Drifts with temperature and humidity.
  • Needs burn in and warm up.
  • Non linear log log response.

Wiring an MQ Sensor to a Microcontroller

Feed the heater from a 5 V supply able to deliver at least 200 mA, then read the load resistor voltage on an analog pin of the microcontroller. If the board runs at 3.3 V, scale the signal down with a resistor divider so it never exceeds the ADC limit.

The digital output on common modules comes from an LM393 comparator and a trimmer that sets a fixed alarm threshold. It works like the circuit in comparator circuits explained, but it gives no ppm information.

  • Heater supply holds 5 V under full heater current.
  • Load resistor value is measured and recorded.
  • MOS gas sensor has completed its burn in period.
  • Warm up time is allowed after each power on.
  • R0 is measured in clean outdoor air.
  • Temperature and humidity are logged with each reading.
  • Alarm threshold is tested with a real gas sample.

Average at least 20 to 50 ADC samples per MOS gas sensor reading, because the raw value flickers with air movement. When choosing between sensing methods, the factors listed in sensor selection criteria help decide whether a MOS part is good enough.

MQ2 Gas Sensor Manual PDF

PDF
Flammable Gas Sensor Model MQ2 Manual
Winsen technical manual, specifications and curves

How an MQ2 Works, Animated

MOS Gas Sensor FAQ

What is a MOS gas sensor?

It is a heated metal oxide chemiresistor whose resistance changes when target gases react on its surface. Tin dioxide is the most common sensing material.

The MQ series from Winsen and Hanwei are well known examples. Every MOS gas sensor in this family is cheap and sensitive, but it responds to many gases rather than to just one.

Why does the sensor need a heater?

The surface reactions between oxygen ions and the target gas are only fast enough at high temperature. Winsen gives a working range of roughly 200 to 400 °C for the sensing layer.

The heater in an MQ2 takes about 5 volts and up to 950 milliwatts. That current must come from a proper power rail and never from a logic pin.

What is R0 in MQ sensors?

R0 is the sensor resistance in a defined reference condition used by the datasheet curves. For some models it is set in clean air and for others at a known gas concentration.

You measure Rs in clean air and divide by the clean air ratio from the chart. The result is the R0 value used in all later ppm calculations.

How long is the burn in time?

The Winsen MQ2 manual asks for a preheat of not less than 48 hours before calibration. This removes contaminants from the MOS gas sensor surface and lets the resistance settle to a stable value.

After burn in, a shorter warm up is still needed after every power on. Readings taken too early are usually higher than the true gas level.

How do I convert the voltage to ppm?

First calculate Rs from the load resistor voltage and then divide it by R0. Next use two points on the log log curve to find the slope of the line.

Finally apply the power law to get an approximate concentration in ppm for that gas. The calculator above does all three steps with the numbers you enter.

Can an MQ135 measure CO2 accurately?

No, because it also responds to ammonia, alcohol, benzene, smoke and other gases. Any CO2 value from it is only a rough indicator of air quality.

For true CO2 readings, use an NDIR sensor that measures infrared absorption at a specific wavelength. Such sensors are selective and much more stable over time than metal oxide parts.

Can I use an MQ module for gas safety in a plant?

No, a hobby module is not certified for life safety or hazardous area use. Its heater also runs hot enough to be an ignition source in flammable surroundings.

Plants must use certified detectors with approved protection, a proper gas group rating and regular calibration. An MQ module is fine only for learning, trends and simple domestic alarms.

Advertisement

Related Articles

External References

What We Learn Today

  • A MOS gas sensor uses heated tin dioxide whose resistance falls when reducing gases react with oxygen ions trapped on its surface.
  • Calculate Rs from the load resistor voltage, divide by R0 measured in clean air, then apply the log log datasheet curve to estimate ppm.
  • MQ sensors need burn in, warm up and temperature correction, and they suit trends and simple alarms rather than certified safety duty.
I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for reading!! Happy Learning!!

Leave a Reply

Your email address will not be published. Required fields are marked *