Table of Contents
ToggleA 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.
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.

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.

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.
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.
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.
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.
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Ω
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
| Model | Main Target Gas | Typical Use |
|---|---|---|
| MQ2 | LPG, propane, methane, smoke | Kitchen and smoke alarms |
| MQ3 | Alcohol vapour | Breath analyser projects |
| MQ4 | Methane, natural gas | PNG pipeline leak alarms |
| MQ5 | LPG, natural gas | Domestic gas leak alarms |
| MQ7 | Carbon monoxide | Garage and generator room alarms |
| MQ8 | Hydrogen | Battery room monitoring |
| MQ135 | Ammonia, benzene, smoke, CO2 trend | Indoor 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.
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
6 Practical Calibration Steps
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.
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.
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.
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.
- 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.
- 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
How an MQ2 Works, Animated
MOS Gas Sensor FAQ
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.
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.
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.
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.
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.
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.
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.
Related Articles
- Gas Analyzers Explained
- NDIR Gas Analyzer Working Principle
- H2S Gas Detector Working Principle
- Humidity Sensor Capacitive RH
- What Is a Semiconductor
External References
- Flammable Gas Sensor MQ2 Manual, Winsen
- Semiconductor MOS CO Sensors: Working Principles, Design and Applications, Winsen
- Gas Detector, Wikipedia
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.
