The MQ Family Of Gas Sensors are simple and cheap Chinese-made MOS Sensors that can detect different gases in the air. Sensor types (and target gases) depend on the detection material used inside the sensor.
In Chinese, “gas sensitive” translates to “Qì Mǐn” (气敏). MQ might have been derived from the Chinese words “gas sensitive”. Note also that numbering of sensors is not consecutive, so there is neither i.e. a MQ-1 sensor nor a MQ-14 sensor.
CO2 is a key substance for determining air quality. None of the MQ series sensors can detect CO2, including MQ-135 (target gas: air quality). Use a dedicated NDIR CO2 sensor if you want reliable air quality monitoring.
Overview
The MQ series of gas sensors are MOS sensors (metal-oxide semiconductors): they detect specific gases by changing their electrical resistance in response to the presence of these gases.
How do these sensors detect gases?
The core of the sensor is a ceramic substrate coated with a thin layer of metal oxide as primary sensing element.
Each sensor type uses a different metal oxide which determines the target gases and sensitivities.
- In clean air, the metal oxide layer has a baseline resistance.
- The metal oxide surface causes target gases to undergo oxidation or reduction reactions which changes the number of free electrons in the metal oxide, thereby changing its resistance proportionally to the concentration of the target gas.
- The sensor resistance (as an indicator of gas concentration) is converted into a voltage change through a voltage divider with one known fixed resistor and outputted as voltage.
How do sensors differ, and how come they detect different gases?
Different MQ sensor types exist with different detectable target gases:
Sensor Type | Target Gas | Detection Range (ppm) |
---|---|---|
MQ-2 | propane, smoke, natural gas (flammable gases and smoke) | 10-10.000 |
MQ-3 | ethanol | 20-500 |
MQ-4 | methane, natural gas (flammable gas) | 300-10.000 |
MQ-5 | propane, methane, LPG (combustible gas) | 300-10.000 |
MQ-6 | LPG, CH4 (flammable gas) | 300-10.000 |
MQ-7 | carbon monoxide | 10-500 |
MQ-8 | H2 (hydrogen) | 100-1.000 |
MQ-9 | CO (carbon monoxide), CH4 | CO: 10-500, CH4: 300-10.000 |
MQ-131 | ozone | 10-1.000 |
MQ-135 | ammonia, sulfide, benzene (air quality) | 10-1.000 |
MQ-136 | hydrogen sulfide (toxic gases) | 1-200 |
MQ-137 | ammonia (toxic gases) | 5-500 |
MQ-138 | organic vapors | 5-500 |
MQ-139 | freon halogen | 10-1.000 |
Most types are cheap and cost between €1-2. Some models (i.e. MQ-131 and all above MQ-136ff) can be more costly.
Metal Oxides Used In Sensors
While the general sensor design is identical in all sensor types, it is the actual composition of the metal oxide used in the sensing element that determines the target gases that a particular sensor can detect.
Core Metal Oxide
Most sensors use one of these two metal oxides to start with:
Metal Oxide | Target Gases | Used in |
---|---|---|
Tin Dioxide (SnO2) | flammable gases, alcohol, air quality-related gases | MQ-2, MQ-3, MQ-4, and MQ-135 |
Iron Oxide (Fe2O3) | flammable gases, carbon monoxide (CO) | MQ-7, MQ-9 |
Doping
These metal oxides are then doped with additional materials to enhance sensitivity to specific gases.
The exact doping elements and their concentrations are usually proprietary information held by the manufacturer, but common dopants can include elements like palladium (Pd) or platinum (Pt) to improve response characteristics.
Stability
As a final step, the doped metal oxide is then mixed with Aluminum Oxide (Al2O3) which in itself is not active but is used to increase mechanical strength and surface area.
Sensor Component
Each sensor (regardless of type) has six pins. Underneath the metal mesh that protects the sensor and prevents explosion hazards (due to the internal heater), the six pins and their purpose becomes evident:
Analog Sensor Output
The sensor element is coated with metal (the actual metal type varies among sensor types and determines the detectable target gases as outlined above). It is connected on one side to both A pins, and on the other side to both B pins.
The sensor element acts like a variable resistor and its resistance varies based on the gas concentrations it can detect. To convert its resistance into a measurable voltage (AO), a load resistor is used that acts as a simple voltage divider.
The load resistor is not part of the sensor and is provided by breakout boards. If you want to use a raw sensor, add an appropriate load resistor to your circuitry yourself.
The actual load resistor value is typically chosen based on the expected range of gas concentrations and the sensor’s resistance range (see datasheet for particular resistor type).
MQ-xxx breakout boards are designed to be used with 5V microcontrollers. If you want to use them with 3.3V, either add your own voltage divider to further reduce AO, or replace the load resistor on the breakout board against a higher value resistor.
Heater
For the detectable chemical reaction to take place, a heater element is connected to both H pins that can be used interchangeably (in fact you could apply AC to the heater circuit).
How much current does the heater require?
The heaters resistance determines the current that flows through it.
A MQ-135 sensor i.e. has a heater resistance of 34 ohms which at 5V results in a heating current of 5V/34ohms = 0.15A (5Vx0.15A = 0.75W).
In the raw sensor, both heating circuit and sensing circuit are completely separated. The heating circuit must be operated with strictly 5V AC or DC while the sensor circuit can theoretically be operated with up to 24V DC. Breakout boards supply 5V DC to both circuits.
Breakout Boards
Often, the MQ sensors come pre-mounted on a supporting breakout board. All sensor types use the same fundamental breakout board design.
The breakout board adds the essential load resistor.
Depending on sensor type, the values for the load resistor vary.
Digital Alarm Functionality
Breakout boards complement the analog sensor output (AO) with an additional digital alarm output (DO) that triggers when a setable threshold is exceeded:
Via a potentiometer, a threshold voltage is set, and when the analog sensor output exceeds this threshold, an OpAmp switches the digital output pin (DO) from low to high.
The schematic of the base breakout board illustrates its functionality:
- Sensor/Pin AO: the sensor pins A and B are connected to VCC and AO, directly providing the analog sensor output. This output is the voltage drop across a voltage divider, consisting of the sensor resistance (which varies with gas concentrations), and a fixed resistor.
- Heater: the sensor component internally uses a NiCd heater that is connected to VCC and GND. An additional resistor may limit the heater current.
- Alarm/Pin DO: A potentiometer is used as a voltage divider to manually define a reference voltage that is fed into an OpAmp. The OpAmp compares this reference voltage to the actual sensor voltage (AO). When the sensor voltage exceeds the reference voltage, the OpAmp sets D0 to high and turns on the LED on the board.
Caveats
Like all MOS sensors, they are fairly unspecific and sensitive to a range of target gases.
Interference
The chemical reaction responsible for changing the sensor resistance (and thus its output) is susceptible to many unspecific environmental factors, such as temperature and humidity:
High humidity causes over-shooting readings whereas extremely low humidity causes the sensor to stop working.
High Power Consumption
The heater requires relatively high current (depending on sensor type) which makes using these sensors in battery-powered devices difficult.
Warm-Up Time
The heater needs to warm up and bring the sensor to operational temperatures before it can work. Warming up takes 30s.
For the same reason, usual energy savings procedures such as taking readings in intervals does not work well. For example, taking a reading every minute would require the sensor to pre-heat for 30s each time.
Burn-In Time
Since the sensor principle is based on a chemical reaction, the metal oxid layer inside the sensor requires an initial burn in time of 48h (exact time depends on sensor type, see datasheet):
The sensor heater needs to run uninterrupted for 48h so that coatings and chemical residues can settle. The sensor should be calibrated only after the burn in time during which the sensor readings have not stabilized yet.
That said, you may want to skip burn in time and immediately start using the sensor if you do not require calibration and precise results and just want to use the sensor to provide a general tendency.
Slow Website?
This website is very fast, and pages should appear instantly. If this site is slow for you, then your routing may be messed up, and this issue does not only affect done.land, but potentially a few other websites and downloads as well. Here are simple steps to speed up your Internet experience and fix issues with slow websites and downloads..
Comments
Please do leave comments below. I am using utteran.ce, an open-source and ad-free light-weight commenting system.
Here is how your comments are stored
Whenever you leave a comment, a new github issue is created on your behalf.
-
All comments become trackable issues in the Github Issues section, and I (and you) can follow up on them.
-
There is no third-party provider, no disrupting ads, and everything remains transparent inside github.
Github Users Yes, Spammers No
To keep spammers out and comments attributable, all you do is log in using your (free) github account and grant utteranc.es the permission to submit issues on your behalf.
If you don’t have a github account yet, go get yourself one - it’s free and simple.
If for any reason you do not feel comfortable with letting the commenting system submit issues for you, then visit Github Issues directly, i.e. by clicking the red button Submit Issue at the bottom of each page, and submit your issue manually. You control everything.
Discussions
For chit-chat and quick questions, feel free to visit and participate in Discussions. They work much like classic forums or bulletin boards. Just keep in mind: your valued input isn’t equally well trackable there.
(content created Jul 16, 2024)