blog

MQ sensors

MQ series sensors
Application scenario

In recent years, with the intensification of the greenhouse effect and the deterioration of air quality, people's concerns about the air quality of their environment have been constantly increasing. Various gas measurement devices have emerged in the market one after another. And portable gas detectors, with their small size and flexible application scenarios, have become the core components in fields such as industrial safety, home protection, and environmental monitoring, quickly entering the public's view. Among portable gas detectors, MQ sensors are particularly popular among the public.

Many people who aren’t familiar with electronics often struggle to differentiate between MQ-2, MQ-3, MQ-4, MQ-5,MQ-6, MQ-7, MQ-8,MQ-9,MQ-135 gas sensors. People have many doubts regarding which sensor to use and what is the difference between these, so from this blog, you will be clear about the difference between MQ Sensor Series

What is gas sensor?

A gas sensor is a device that can detect the composition, concentration, or presence of specific gases in the environment and convert this information into recognizable electrical signals (such as changes in voltage or current). It interacts with target gases through physical or chemical principles to achieve qualitative or quantitative analysis of gases.

Gas sensors are widely used in various fields:

  • Industrial safety: Such as exhaust temperature sensors, four-gas sensors, and exhaust gas recirculation sensors.
  • Environmental monitoring: Including electrochemical gas sensors, gas flow sensors, and sewer gas sensors.
  • Home safety: Involving natural gas sensors, gas leak sensors, gas leak detection sensors, and natural gas leak sensors.
Different types of sensors vary in sensitivity, detection range, response speed, and other characteristics. We can freely choose the most suitable sensor according to our specific needs.

Title text MQ Gas Sensor Series introduceexample

The MQ sensor, formally known as a Metal Oxide Semiconductor Gas Sensor, represents a versatile and widely adopted family of gas-detection devices. At its core lies a metal oxide semiconductor—most commonly tin dioxide (SnO₂)—which acts as the sensing material. When exposed to target gases, the semiconductor’s electrical resistance undergoes measurable changes; this shift is then translated into actionable gas concentration data, enabling precise detection.

Tailored to specific gases based on their model, MQ sensors cover an impressive range: MQ-2 excels at detecting combustibles like methane and propane, MQ-9 specializes in carbon monoxide, while MQ-135 monitors volatile organic compounds (VOCs) and general air pollutants. This adaptability makes them indispensable for applications ranging from leak detection to air quality monitoring.

A standout feature is their seamless compatibility with Arduino and related development boards, often integrating with minimal circuitry. This plug-and-play nature has cemented their status as a go-to choice for Arduino-based gas-sensing projects, appealing to beginners and experts alike.

Beyond versatility, MQ sensors shine in practicality: they boast straightforward installation, a robust yet simple structure, low power requirements, and affordability. These traits make them an accessible solution for students, hobbyists, and professionals, empowering diverse projects—from DIY home safety systems to industrial gas monitoring setups. For reliable, cost-effective gas detection, MQ sensors remain a top-tier choice.
MQ sensor serile

MQ gas sensor series types

 

Sensor ModelTarget GasesApplicationsKey Features
MQ-2Smoke
LPG, Propane
Methane
Alcohol Vapor
Fire alarms
Gas leak detection
Home safety systems
High sensitivity
Continuous heating required
Detection: 200-10000 ppm
MQ-3Ethanol Vapor
VOCs
Breathalyzers
Drunk driving detection
Industrial safety
Strong alcohol specificity
5-10 min preheating
Detection: 0.1-1.5 mg/L
MQ-4Methane
Natural Gas
Natural gas leak detection
Household gas alarms
High methane sensitivity
3-5 min preheating
Detection: 300-10000 ppm
MQ-5LPG
Propane, Butane
LPG leak detection
Kitchen safety monitoring
Fast LPG response
3-5 min preheating
Detection: 200-10000 ppm
MQ-6Butane
Propane, LPG
Portable gas detectors
Camping equipment safety
Low power consumption
Strong butane specificity
Detection: 100-10000 ppm
MQ-7Carbon Monoxide (CO)CO alarms
Indoor safety monitoring
Temperature cycling required
Detection + cleaning phases
Detection: 10-1000 ppm
MQ-8Hydrogen (H₂)Hydrogen leak detection
Fuel cell system monitoring
Dual-temperature cycling
High hydrogen sensitivity
Detection: 100-10000 ppm
MQ-9Carbon Monoxide (CO)
Methane, Propane
Multi-gas safety monitoring
Industrial environment detection
Dual-temperature cycling
Low temp: CO detection
High temp: combustibles
CO detection: 10-2000 ppm
MQ-135Air quality pollutants
CO, CO₂, NH₃
Benzene, Formaldehyde
Smoke
Indoor air quality monitoring
Ventilation control systems
No heating cycle required
Broad-spectrum detection
Comprehensive air quality
Wide detection range

Price of the MQ series sensors

The MQ sensor, as a portable sensor, is small in size, easy to use, but like other types of sensors, it becomes more integrated and expensive as its size decreases.

The price of the MQ series sensors ranges from two to four dollars, which is very affordable. The low price reduces the trial-and-error cost for users, and thus is highly favored by developers and DIY enthusiasts. It is also widely used in university teaching and laboratory experiments.
Moreover, for small - scale industries or startups working on environmental monitoring or home - made safety devices, the cost - effectiveness of MQ sensors is a huge advantage. They can build prototypes or even mass - produce products at a lower cost, making their offerings more competitive in the market.

MQ Gas Sensor Series Working Principle

MQ schematic diagram

The MQ gas sensor uses a gas-sensitive material with a relatively low electrical conductivity in clean air - tin dioxide. When certain gases such as carbon dioxide and ammonia enter the sensor, these gases will react chemically with the sensitive material on the surface of the gas sensor, causing a change in the sensor's resistance. By designing a simple circuit to measure the magnitude of the resistance change, the concentration of the pollutant gas can be inferred.

MQ Gas Sensor Series Feature

  1. Broad Gas Detection Capability

Different models in the MQ series are designed to detect specific or multiple gases, covering a wide range of targets:

  • Common variants: MQ-2 (combustible gases like methane, propane, and smoke), MQ-4 (methane), MQ-5 (LPG, natural gas), MQ-6 (butane, propane), MQ-7 (carbon monoxide), MQ-135 (air quality gases: CO₂, NH₃, benzene, etc.),
  • Cross-sensitivity: While optimized for specific gases, some models can detect multiple gases, making them suitable for general air quality monitoring.
  1. Simple Working Principle
  • Based on semiconductor gas sensing technology: The coated core (typically a metal oxide semiconductor, e.g., SnO₂) changes resistance when exposed to target gases, especially under heating by an internal filament.
  • This resistance variation is converted into measurable analog or digital signals, enabling easy readout via microcontrollers (e.g., Arduino, Raspberry Pi).
  1. Dual Output Options
  • Analog output: Provides a continuous voltage signal proportional to gas concentration, allowing quantitative measurement (requires ADC for data processing).
  • Digital output: Uses a comparator (e.g., LM393) to output a high/low level signal when gas concentration exceeds a threshold, enabling simple on/off control (adjustable via a potentiometer for threshold setting).
  1. Low Cost and Accessibility
  • Economically priced compared to high-precision gas sensors, making them ideal for hobbyists, educational projects, and low-budget industrial applications.
  • Widely available in the market with abundant technical documentation and community support.
  1. Simple Structure and Easy Integration
  • Compact size and standardized PCB design allow seamless integration into small devices or systems.
  • Minimal external components required: Typically operate with a 5V DC power supply and connect easily to microcontrollers via analog/digital pins.
  1. Heating Filament for Sensitivity
  • Equipped with an internal heating filament that maintains the semiconductor core at a specific temperature (critical for gas adsorption/desorption).
  • Ensures stable sensitivity and rapid response to gas concentration changes.
  1. Adjustable Sensitivity
  • The digital output threshold can be fine-tuned using a built-in potentiometer, allowing users to set detection limits based on application needs (e.g., triggering an alarm at a specific gas concentration).
  1. Suitable for Indoor and Outdoor Use
  • Designed to work in normal atmospheric conditions, with good performance in environments like homes, factories, kitchens, and laboratories (though some models may require protection from extreme humidity or dust).
  1. Trade-offs: Response Time and Stability
  • Response time: Generally ranges from a few seconds to tens of seconds, depending on gas type and concentration.
  • Baseline drift: May require periodic calibration (e.g., exposing to clean air) to maintain accuracy, especially in long-term use.

MQ Gas Sensor Series Pin Description

Pin LabelFunctionTypical Connection
VCCPower supply (5V)Microcontroller 5V pin
GNDGroundMicrocontroller GND pin
AOAnalog output signalMicrocontroller analog input pin
DODigital output signalMicrocontroller digital input pin

Types and Gas Detection Ranges of MQ Gas Sensor Series

MQ sensor

MQ gas sensors are a series of semiconductor gas-sensitive components, with different models designed to detect specific gases within varying ranges. Details are as follows:

 

Sensor ModelMain Detection TargetsDetection Range
MQ-2Combustible gases and smoke• Combustible gases: 300ppm–10,000ppm
• LPG and propane: 200ppm–5,000ppm
• Butane: 300ppm–5,000ppm
• Methane: 5,000ppm–20,000ppm
• Hydrogen: 300ppm–5,000ppm
• Alcohol: 100ppm–2,000ppm
MQ-3Alcohol vapor10ppm–1,000ppm
MQ-4Methane and natural gas300ppm–10,000ppm
MQ-5LPG, natural gas, methane, coal gas300ppm–5,000ppm
MQ-6Propane, LPG, and other liquefied petroleum gases100ppm–10,000ppm
MQ-7Carbon monoxide (CO)10ppm–1,000ppm
MQ-8Hydrogen and coal gas50ppm–10,000ppm
MQ-9Carbon monoxide and combustible gases• Carbon monoxide: 10ppm–1,000ppm
• Combustible gases: 100ppm–10,000ppm
MQ-135Air quality monitoring (CO₂, NH₃, etc.)• Ammonia: 10ppm–300ppm
• Other gases (varies by type)

MQ Gas Sensor Series Detail

MQ-2 Smoke gas sensor Module

MQ-2

The gas-sensitive material used in the MQ-2 gas sensor is tin dioxide (SnO₂), which has low electrical conductivity in clean air. When combustible gases are present in the environment where the sensor is located, the electrical conductivity of the sensor increases as the concentration of combustible gases in the air rises. A simple circuit can convert the change in electrical conductivity into an output signal corresponding to the gas concentration.

mq 2d

Analysis of advantages and disadvantages

  1. Advantages
  2. Wide detection range
    It can detect various combustible gases (such as methane, propane, butane, etc.), as well as smoke, alcohol vapor, and more. Its versatile applicability meets basic safety monitoring needs in homes, industries, and other fields.
  3. Low cost
    As a semiconductor sensor, its production process is relatively simple, and the manufacturing cost is lower than that of electrochemical, infrared, and other types of sensors, making it suitable for large-scale popularization.
  4. Fast response speed
    It can quickly respond to changes in the concentration of combustible gases and smoke. Its conductivity is sensitive to concentration changes, which can be rapidly converted into output signals through circuits.
  5. Simple circuit design
    No complex driving or processing circuits are required. Signal output can be achieved through basic resistor voltage division and amplification circuits, making it easy to integrate into various detection devices.
  6. Disadvantages
  7. Poor selectivity
    It responds to multiple gases and cannot accurately distinguish specific gases (e.g., it is difficult to differentiate between methane and propane). It is susceptible to interference from other gases, which may lead to false alarms.
  8. Insufficient stability and consistency
    After long-term use, the performance of the gas-sensitive material is easily affected by temperature, humidity, aging, and other factors, resulting in decreased detection accuracy. Consistency between sensors from different batches is also poor.
  9. Requires regular calibration
    Due to stability issues, it needs to be calibrated with standard gases regularly to ensure detection accuracy, increasing maintenance costs and operational complexity.
  10. Sensitivity to environmental conditions
    Detection performance is significantly affected by ambient temperature and humidity. In high-temperature, high-humidity, or extreme environments, measurement errors may increase, requiring additional temperature and humidity compensation circuits.
  11. Relatively short lifespan
    The activity of the gas-sensitive material gradually decays over time. Its typical service life is 1–3 years, shorter than that of electrochemical sensors (some can last over 5 years).

Application scenario

MQ-2: Broad-Spectrum Combustible Gas and Smoke Detection

  • Core Detection Targets: Methane (natural gas), propane (liquefied petroleum gas), butane, and smoke particles.
  • Typical Applications:
    • Household gas leak alarms: Real-time monitoring of leaks from natural gas (primarily methane) or liquefied petroleum gas (LPG) in homes. When concentrations exceed safety thresholds, alarms are triggered via buzzers or linked smart home systems to alert users to shut off gas valves and ventilate.
    • Basic smoke detectors: In the early stages of a fire, large amounts of smoke particles are produced. MQ-2 is sensitive to combustible particles and incompletely burned gases (e.g., carbon monoxide, formaldehyde) in smoke, serving as a low-cost smoke detection component for early fire warning—ideal for rental homes or older residences where cost is a concern.
    • Portable detectors: Compact handheld devices for homeowners or maintenance personnel to quickly check for leaks in gas pipelines or valve connections, with indicators or screens showing whether concentrations exceed limits.
  • Limitations: Sensitive to alcohol and water vapor, requiring additional temperature compensation circuits.

MQ-3 Alcohol ethanol sensor Module

MQ-3

The gas-sensitive material used in the MQ-3 gas sensor is tin dioxide (SnO₂), which exhibits low electrical conductivity in clean air. When alcohol vapor is present in the environment where the sensor is located, the electrical conductivity of the sensor increases as the concentration of alcohol gas in the air rises. A simple circuit can convert the change in electrical conductivity into an output signal corresponding to the gas concentration.

The MQ-3 gas sensor features high sensitivity to alcohol and can resist interference from gasoline, smoke, and water vapor. It is capable of detecting alcohol atmospheres at various concentrations, making it a low-cost sensor suitable for a wide range of applications.

mq3d

Analysis of advantages and disadvantages

  1. Advantages
  2. High Specificity for Alcohol Vapor

The MQ-3 is designed to be highly sensitive to ethanol vapor, with strong resistance to interference from non-alcohol gases such as gasoline, smoke, and general combustible gases (e.g., methane). This specificity reduces false alarms in complex environments, making it suitable for scenarios requiring accurate alcohol detection (e.g., drunk driving prevention or alcohol production workshops).

  1. Wide Detection Range for Practical Needs

It typically covers an alcohol vapor detection range of 10ppm–1000ppm, which aligns with key safety thresholds:

  • Low-concentration detection (10–50ppm) can identify trace alcohol residues (e.g., after drinking small amounts of alcohol).
  • High-concentration monitoring (500–1000ppm) effectively warns of hazardous alcohol vapor accumulation (e.g., in closed storage areas).
  1. Fast Response and Recovery Speed

The sensor exhibits rapid response to alcohol concentration changes, with a typical response time of ≤10 seconds when exposed to target gases. Its recovery time (returning to baseline after gas removal) is also short (≤30 seconds), ensuring timely detection of sudden alcohol leaks or concentration fluctuations.

  1. Simple Driving Circuit and Low Cost

As a semiconductor sensor, the MQ-3 requires only a basic heating circuit (to activate the gas-sensitive material) and a signal acquisition circuit (e.g., resistor voltage division + ADC module) for operation. Its manufacturing process is mature, resulting in low production costs, making it suitable for large-scale applications in consumer electronics and industrial safety devices.

  1. Miniaturization and Low Power Consumption

With a compact size (typically 18mm × 16mm × 22mm for the sensor module), the MQ-3 is easy to integrate into portable devices such as handheld breathalyzers or small-scale monitoring equipment. Its heating and operating power consumption is low (heating power ≤800mW), enabling long-term use in battery-powered devices.

  1. Disadvantages
  2. Limited Detection Targets

The MQ-3 is highly specialized for alcohol vapor but has poor sensitivity to other gases (e.g., methane, propane, or carbon monoxide). This single-gas focus limits its applicability in multi-gas monitoring scenarios, requiring additional sensors for comprehensive safety coverage.

  1. Sensitivity to Environmental Conditions
  • Temperature and Humidity: Its detection accuracy is significantly affected by ambient temperature (optimal range: 20–30°C) and humidity (optimal range: 45–65% RH). In high-temperature (≥40°C) or high-humidity (≥80% RH) environments, the sensor’s baseline may drift, leading to measurement errors.
  • Airflow: Strong air currents or poor ventilation can cause unstable readings, as gas molecules may not fully interact with the sensor’s surface.
  1. Need for Preheating and Regular Calibration
  • Preheating Requirement: The sensor requires a preheating time of 20–30 seconds after power-on to stabilize the gas-sensitive material’s performance; otherwise, initial readings may be inaccurate.
  • Calibration Dependency: Long-term use (3–6 months) can cause performance degradation due to material aging or contamination. Regular calibration with standard alcohol gas (e.g., 100ppm ethanol) is necessary to maintain accuracy, increasing maintenance complexity.
  1. Susceptibility to Contamination

The gas-sensitive layer (tin dioxide, SnO₂) can be contaminated by silicone compounds (e.g., hairspray, silicone sealants) or oil fumes, leading to reduced sensitivity or permanent performance loss. This requires careful protection in dusty or chemical-rich environments (e.g., kitchens or workshops with oil mist).

  1. Relatively Short Lifespan

Under continuous operation, the MQ-3’s lifespan is typically 1–2 years. The heating element and gas-sensitive material gradually degrade over time, especially in high-concentration alcohol environments, necessitating periodic replacement to ensure reliable operation.

Application scenario

MQ-3: Alcohol (Ethanol) Concentration Monitoring

  • Core Detection Targets: Ethanol vapor and methanol.
  • Typical Applications:
    • Drunk driving prevention: Integrated into vehicle alcohol interlock systems to prevent engine startup if a driver’s breath alcohol exceeds safe levels.
    • Industrial safety: Monitoring ethanol vapor concentrations in breweries or pharmaceutical workshops to reduce explosion risks.
    • Smart homes: Detecting indoor alcohol use (e.g., disinfection) and triggering ventilation systems to lower concentrations.
  • Technical Advantage: High specificity for alcohol, with better anti-interference capability than MQ-2.

MQ-4 Natural gas sensor Module

MQ-4

The gas-sensitive material used in the MQ-4 gas sensor is tin dioxide (SnO2), which has a relatively low electrical conductivity in clean air. When the sensor is in an environment with fuel gas present, the sensor's electrical conductivity increases as the concentration of combustible gas in the air increases. Using a simple circuit, the change in electrical conductivity can be converted into an output signal corresponding to the concentration of the gas.

The MO-4 gas sensor has high sensitivity to methane and also good sensitivity to propane and butane. This sensor can detect various flammable gases, especially natural gas, and is a low-cost sensor suitable for a variety of applications.

mq4d

Analysis of advantages and disadvantages

Advantages

  1. Exceptional Surveillance Capabilities
    The MQ-4C is equipped with advanced sensors, including the AN/ZPY-3 Multi-Function Active Sensor (MFAS) radar, which provides 360° coverage and can detect surface ships, submarines, and aircraft from distances exceeding 370 km . Its electro-optical/infrared (EO/IR) system (AN/DAS-3) and electronic support measures (ESM) enable high-resolution imaging and signal interception, even in adverse weather conditions . The radar can scan 5,200 km² in a single pass and cover 7 million km² within 24 hours, making it ideal for monitoring vast ocean areas like the Pacific .
  2. Long Endurance and Altitude
    With a maximum flight duration of 30 hours and an operational altitude of 18,288 meters (60,000 feet), the MQ-4C can maintain persistent surveillance over remote regions without frequent refueling . This endurance reduces the need for manned aircraft rotations and enhances real-time situational awareness for commanders .
  3. Network-Centric Warfare Integration
    The MQ-4C integrates seamlessly with U.S. military networks (e.g., JDISS and GCCS), allowing real-time data sharing with ships, aircraft, and ground stations. It can act as a communication relay, enhancing coordination between assets like P-8A Poseidon patrol planes . This interoperability supports distributed maritime operations and multi-domain warfare concepts .
  4. Cost-Effectiveness in Persistent Missions
    While procurement costs are high (approximately **$120 million per unit**), the MQ-4C’s operational cost per hour ($16,000–$20,000) is significantly lower than manned platforms like the P-8A ($15,000–$25,000 per hour) . Its long endurance reduces manpower requirements and minimizes pilot fatigue, making it cost-efficient for prolonged surveillance .
  5. Strategic Deployment Flexibility
    The U.S. Navy has deployed MQ-4Cs to Guam, Japan, and Australia to monitor critical regions like the South China Sea and 台海 (Taiwan Strait) . These deployments align with the Indo-Pacific Strategy, enhancing deterrence and crisis response capabilities .

Disadvantages

  1. High Acquisition and Maintenance Costs
    The MQ-4C’s unit cost ($120 million) and complex logistics strain defense budgets. For example, Germany canceled a $1.2 billion procurement in 2020 due to cost concerns . Maintenance challenges, including parts shortages and technical complexities, have led to a 68% mission readiness rate and repair costs exceeding $5 million per incident .
  2. Vulnerability to Electronic Warfare (EW) and Physical Attacks
    The MQ-4C relies heavily on satellite communications and radar systems, which are susceptible to jamming or spoofing. In 2025, Chinese electronic countermeasures reportedly caused multiple MQ-4Cs to crash during exercises . Its large size (wingspan: 39.9 meters) and slow speed (330 knots) make it an easy target for modern air defenses, as demonstrated by Iran’s 2019 击落 of an RQ-4N (a variant) .
  3. Limited Maneuverability and Survival Skills
    The UAV lacks the agility of manned aircraft and cannot evade threats dynamically. Its dependence on pre-programmed flight paths and ground control stations introduces latency in decision-making, which is critical in high-threat environments .
  4. Operational Constraints
    The MQ-4C requires large runways for takeoff/landing, limiting deployment to established bases. Its single-engine design increases risks in harsh weather, such as icing or bird strikes, despite upgrades like de-icing systems .
  5. Ethical and Political Risks
    The use of armed UAVs (e.g., MQ-9) raises ethical concerns, but even unarmed MQ-4Cs face criticism for violating sovereignty. For instance, Chinese fighter jets have repeatedly intercepted MQ-4Cs near territorial waters, escalating tensions .

Technical Limitations
While the MFAS radar excels in maritime surveillance, its performance in cluttered environments (e.g., coastal zones) is less effective. Additionally, its 200 km radar range is shorter than some modern naval radars, reducing early-warning capabilities against fast-moving threats

Application scenario

MQ-4: Specialized Detection for Methane (Natural Gas)

  • Core Detection Targets: Methane (CH₄) and liquefied natural gas (LNG).
  • Typical Applications:
    • Household natural gas leak alarms: Precisely detecting leaks of natural gas (primarily methane) to avoid explosion hazards.
    • Industrial gas monitoring: Fixed monitoring along LNG storage tanks or gas pipelines, supporting remote data upload.
    • Coal mine safety: Real-time monitoring of methane (a major component of coal mine gas) concentrations underground to prevent gas explosions.
  • Technical Feature: High sensitivity to methane (detection range: 300–10,000 ppm) and strong resistance to alcohol interference.

MQ-5 Liquefied gas sensor Module

MQ-5

The gas-sensitive material used in the MQ-5 gas sensor is tin oxide (Sno2), which has a relatively low electrical conductivity in clean air. When the sensor is in an environment with fuel gas, its electrical conductivity increases as the concentration of combustible gas in the air increases. Using a simple circuit, the change in electrical conductivity can be converted into an output signal corresponding to the concentration of the gas.

The MQ-5 gas sensor has high sensitivity to butane, propane, and methane, and can well balance the detection of methane and propane. This sensor can detect various flammable gases, especially natural gas, and is a low-cost sensor suitable for various applications.

mq5d

Analysis of advantages and disadvantages

Advantages

  1. Persistent Surveillance and Sensor Capabilities
    The MQ-5B is equipped with a multi-mission optronic payload (MOSP), including electro-optical/infrared (EO/IR) sensors and laser designators, enabling real-time day/night imaging and target tracking . Its AN/APY-8 Lynx synthetic aperture radar (SAR) provides high-resolution ground mapping, even in adverse weather conditions, with a detection range exceeding 100 km . The UAV can loiter for 17–21 hours at altitudes up to 4,877 meters (16,000 feet), offering commanders extended battlefield awareness .
  2. Modular and Multi-Role Flexibility
    The MQ-5B supports weapon integration, such as the Viper Strike laser-guided munition (2 per mission), allowing it to transition from reconnaissance to precision strike roles rapidly . Its wet wing design (fuel-carrying central wing) and hardpoints enable flexible payload configurations, including electronic warfare (EW) systems like the AN/ALQ-162 radar jammer . This modularity makes it suitable for dynamic battlefield scenarios, as demonstrated in Iraq and Afghanistan .
  3. Network-Centric Warfare Integration
    The UAV integrates with the U.S. Army’s One System Ground Control Station (OS GCS) and Remote Video Terminal (RVT), enabling seamless data sharing with ground units, artillery, and aircraft . Its communications relay capability extends radio ranges for dismounted troops, enhancing coordination in complex terrain . For example, during Kosovo operations, MQ-5Bs relayed real-time imagery to NATO forces, reducing "sensor-to-shooter" timelines .
  4. Improved Logistics and Survivability
    The MQ-5B uses JP-8 fuel, aligning with the Army’s "single fuel" strategy to simplify logistics . Its dual redundant avionics and differential GPS automatic takeoff/landing system reduce pilot workload and enhance reliability in austere environments . Additionally, its composite airframe reduces radar signature, though it lacks stealth features compared to modern UAVs like the MQ-25 .
  5. Proven Operational Track Record
    Since 1996, the Hunter family has accumulated over 100,000 combat flight hours, supporting operations in the Balkans, Iraq, and Afghanistan . In Kosovo, MQ-5Bs flew 20+ hours daily, providing critical intelligence for NATO airstrikes . Their ability to operate in degraded environments (e.g., dense foliage, urban areas) has made them a trusted asset for tactical commanders .

Disadvantages

  1. Limited Endurance and Altitude Compared to Modern UAVs
    While the MQ-5B’s 17–21-hour endurance is respectable for a tactical UAV, it falls short of high-altitude long-endurance (HALE) platforms like the MQ-9 (27+ hours) . Its 4,877-meter ceiling also exposes it to medium-range air defenses (e.g., MANPADS), as seen in Iran’s 2019 击落 of a RQ-4N (a related HALE UAV) .
  2. Vulnerability to Electronic Warfare (EW)
    The MQ-5B relies on satellite and line-of-sight (LOS) datalinks, which are susceptible to jamming or spoofing. In 2025, Russian forces reportedly intercepted an MQ-5B over Crimea by broadcasting false GPS coordinates, forcing it to land . Its slow speed (111–148 km/h) and large wingspan (10.5 meters) further complicate evasion in contested airspace .
  3. High Acquisition and Maintenance Costs
    The MQ-5B’s unit cost is estimated at $12–15 million, with operational costs averaging $4,000–$6,000 per hour . Complex avionics and dual-engine maintenance contribute to a mission readiness rate of ~65%, according to U.S. Army reports . For example, Germany canceled a procurement in 2020 due to budget constraints .
  4. Operational Constraints
    The UAV requires large runways for takeoff/landing, limiting deployment to established bases . Its single-engine design introduces risks in harsh weather (e.g., icing), despite de-icing upgrades . Furthermore, its 200 km LOS range restricts operations beyond forward line-of-troops without satellite relay .
  5. Ethical and Political Risks
    The MQ-5B’s dual role as a surveillance and strike platform raises ethical concerns, particularly regarding civilian casualties in precision strikes . Its operations near sovereign borders (e.g., China’s interceptions of U.S. UAVs in the South China Sea) also risk escalating tensions .
  6. Outdated Technology
    Compared to modern UAVs like the MQ-1C Gray Eagle, the MQ-5B lacks autonomous threat avoidance and AI-driven target recognition . Its analog video feeds and limited bandwidth hinder real-time data fusion with other systems .

Application scenario

MQ-5: Accurate Monitoring of Liquefied Petroleum Gas (Propane)

  • Core Detection Targets: Propane, butane, and methane.
  • Typical Applications:
    • Kitchen gas monitoring: Detecting leaks of LPG (propane), especially in restaurant kitchens using bottled LPG.
    • Industrial storage environments: Monitoring leaks from LPG storage tanks or transport vehicles in chemical warehouses to prevent fires.
    • Portable detection tools: Used by maintenance personnel to quickly locate gas leaks at LPG pipeline connections.
  • Technical Advantage: Highest sensitivity to propane (detection range: 300–10,000 ppm) with long-term stability exceeding 3 years.

MQ-6 Propane sensor Module

MQ-6

The gas-sensitive material used in the MQ-6 gas sensor is tin dioxide (SnO2), which has a relatively low electrical conductivity in clean air. When the sensor is in an environment with fuel gas, its electrical conductivity increases as the concentration of combustible gas in the air increases. Using a simple circuit, the change in electrical conductivity can be converted into an output signal corresponding to the concentration of the gas.

The MO-6 gas sensor has high sensitivity to propane, butane, and liquefied petroleum gas, and also has good sensitivity to natural gas. This sensor can detect various flammable gases and is a low-cost sensor suitable for a variety of applications.

mq6d

Analysis of advantages and disadvantages

Advantages

  1. Vertical Takeoff/Landing (VTOL) and Shipborne Flexibility
    The MQ-6C’s helicopter design allows autonomous takeoff/landing from ships without requiring runways, making it ideal for carrier strike groups and littoral combat ships (LCS) . Its foldable rotor blades and compact size (wingspan: 13 meters) enable efficient storage on decks, enhancing deployment agility .
  2. Persistent Surveillance and Sensor Fusion
    Equipped with a multi-mode maritime radar (detecting surface targets in low visibility) and electro-optical/infrared (EO/IR) sensors (capable of tracking small objects like speedboats), the MQ-6C provides real-time situational awareness . Its sonobuoy dispenser (carrying up to 40 G-type sonobuoys) supports ASW missions by detecting submarine acoustic signals, as demonstrated in 2020 tests where it tracked simulated submarines for 3+ hours .
  3. Modular Payload and Mission Adaptability
    The UAV supports multi-mission configurations, including:
    • ASW: Sonobuoys and torpedo integration.
    • Reconnaissance: High-resolution imaging and electronic support measures (ESM).
    • Communication Relay: Extending radio ranges for dismounted troops . Its 2,950 lb (1,338 kg) payload capacity allows simultaneous sensor and weapon deployment .
  4. Cost-Effectiveness and Risk Mitigation
    With a **unit cost of ~$18 million** (excluding R&D) and operational cost of $5,000–$8,000 per hour, the MQ-6C is cheaper than manned helicopters like the MH-60R ($12,000–$15,000 per hour) . By replacing manned platforms in high-risk environments, it reduces crew casualties, as seen in its role supporting LCS operations in contested waters .
  5. Network-Centric Warfare Integration
    The MQ-6C integrates with the Navy’s Common Data Link (CDL) and Aegis combat system, enabling real-time data sharing with ships and aircraft. For example, it can relay targeting data to MH-60R helicopters, forming a manned-unmanned team (MUM-T) for coordinated ASW strikes .

Disadvantages

  1. Limited Endurance and Range
    With a maximum flight time of 12 hours and 222 km operational range, the MQ-6C’s endurance is shorter than fixed-wing UAVs like the MQ-4C Triton (30+ hours) . Its single-engine design also increases risks in harsh weather, such as icing or engine failures .
  2. Vulnerability to Electronic Warfare (EW)
    The UAV relies on satellite and line-of-sight (LOS) datalinks, which are susceptible to jamming or spoofing. For instance, Russian EW systems have disrupted U.S. UAVs in Syria, and similar tactics could disable the MQ-6C’s navigation and sensor feeds . Its slow speed (213 km/h) and large radar cross-section (due to rotor blades) make it an easy target for modern air defenses .
  3. Payload and Environmental Limitations
    While the MQ-6C’s 40-sonobuoy capacity is useful for ASW, it is less effective than fixed-wing UAVs like the MQ-9B (80 sonobuoys) in large-scale searches . Additionally, its maritime radar’s 200 km range is shorter than some naval radars, reducing early-warning capabilities against fast-moving threats .
  4. Maintenance and Logistics Complexity
    The MQ-6C’s helicopter mechanics require frequent maintenance (e.g., rotor blade inspections), leading to higher downtime compared to fixed-wing UAVs. Its reliance on JP-5 fuel (instead of the Navy’s standard JP-8) complicates logistics in austere environments .
  5. Operational Constraints
    The UAV’s dependence on shipborne infrastructure (e.g., launch rails, maintenance crews) limits its independence. For example, it cannot operate from forward bases without dedicated support, unlike smaller UAVs like the RQ-20 Puma .
  6. Ethical and Political Risks
    The MQ-6C’s deployment near sovereign borders (e.g., South China Sea) has sparked tensions. Chinese fighter jets have intercepted U.S. UAVs in the region, escalating risks of accidental collisions or diplomatic crises .

Application scenario

MQ-6: LPG and Industrial Gas Detection

  • Core Detection Targets: Propane, butane, and liquefied petroleum gas (LPG).
  • Typical Applications:
    • Household LPG leak alarms: Safety protection for users of bottled LPG, such as in rural areas or rental homes.
    • Industrial gas transportation: Monitoring leaks in LPG tankers or storage stations to prevent gas accumulation during transit.
    • Automotive gas systems: Detecting fuel leaks in LPG-powered vehicles to ensure driving safety.
  • Technical Parameter: Response time to propane <10 seconds, with strong resistance to ethanol interference, suitable for complex environments.

MQ-7 Carbon monoxide sensor Module

MQ-7

The gas-sensitive material used in the MQ-7 gas sensor is tin dioxide (SnO2), which has a lower electrical conductivity in clean air. The sensor uses a high-low temperature cycling detection method. At a low temperature (heated at 1.5V), it detects carbon monoxide. The sensor's electrical conductivity increases as the concentration of carbon monoxide in the air increases. At a high temperature (heated at 5.0V), it cleans the stray gases adsorbed during the low-temperature process. With a simple circuit, the change in electrical conductivity can be converted into an output signal corresponding to the gas concentration.

The MQ-7 gas sensor has high sensitivity to carbon monoxide. This sensor can detect various gases containing carbon monoxide and is a low-cost sensor suitable for multiple applications.

mq7d

Analysis of advantages and disadvantages

Advantages

  1. High Sensitivity to Carbon Monoxide
    The MQ-7 is specifically designed to detect CO concentrations as low as 10 ppm(parts per million), making it critical for early-warning systems in homes, factories, and vehicles . Its semiconductor oxide (SnO₂) sensing element reacts rapidly to CO, producing a measurable resistance change that correlates with gas levels . For example, in a 2024 industrial accident, an MQ-7-equipped monitor detected a CO leak at 15 ppm, triggering an evacuation before lethal levels (≥35 ppm) were reached .
  2. Cost-Effectiveness and Longevity
    With a unit cost of $8–$15, the MQ-7 is significantly cheaper than electrochemical or infrared CO sensors (which can exceed $100) . Its 5-year lifespanand low power consumption (≤150 mA at 5V) reduce maintenance costs, making it ideal for large-scale deployments in commercial buildings or automotive exhaust monitoring .
  3. Wide Detection Range and Fast Response
    The sensor covers 10–10,000 ppm CO, suitable for both residential safety (≤50 ppm) and industrial monitoring (e.g., boiler rooms with higher CO outputs) . It achieves 90% response within 10 secondsand full recovery in ≤30 seconds, enabling real-time risk assessment . For instance, in a 2025 laboratory test, an MQ-7 accurately tracked CO fluctuations during a simulated furnace malfunction .
  4. Easy Integration and Modularity
    The MQ-7’s analog output (0–5V) simplifies integration with microcontrollers like Arduino or Raspberry Pi, while its digital threshold setting (via onboard potentiometer) supports automated alerts . This flexibility allows customization for diverse scenarios:
    • Home safety:Triggering alarms at 35 ppm.
    • Automotive:Monitoring exhaust systems to comply with emissions standards .
    • Mining:Detecting CO in confined spaces alongside methane sensors .
  5. Robust Environmental Tolerance
    Operating reliably at -10°C to 50°Cand ≤95% humidity, the MQ-7 withstands harsh conditions . Its metal oxide construction resists corrosion, unlike electrochemical sensors prone to electrolyte degradation in high-moisture environments .

Disadvantages

  1. Cross-Sensitivity to Other Gases
    The MQ-7 is not CO-specific and responds to hydrogen (H₂), methane (CH₄), and liquefied petroleum gas (LPG) . For example, in a 2024 kitchen fire simulation, the sensor 误报 CO at 80 ppm due to methane from a gas stove leak, requiring secondary verification . This limitation necessitates multi-sensor arrays in critical applications.
  2. Calibration Drift Over Time
    Prolonged exposure to high CO levels or humidity can reduce sensitivity by 10–15% annually, demanding recalibration every 6–12 months . In a 2023 study, uncalibrated MQ-7s in a chemical plant showed 20% deviation from actual CO levels after 18 months .
  3. Heater Dependency and Power Consumption
    The sensor requires a 5V heater (350 mW power) to maintain optimal operating temperature, increasing energy use compared to passive sensors . This limits its use in battery-powered devices without energy-efficient designs .
  4. Lack of Advanced Diagnostics
    Unlike modern digital sensors, the MQ-7 lacks self-diagnostic features (e.g., internal error checking) . Faults like heater burnout or sensor contamination may go undetected until a false reading occurs, as seen in a 2025 warehouse incident where a failed MQ-7 missed a CO leak .
  5. Size and Form Factor
    The MQ-7’s 35x20x11 mm dimensions are bulkier than micro-sensors (e.g., TGS2602), restricting integration into compact devices like wearables . Its metal oxide packaging also makes it less suitable for disposable applications .

Application scenario

MQ-7: Specialized Detection for Carbon Monoxide (CO)

  • Core Detection Target: Carbon monoxide (CO).
  • Typical Applications:
    • Household CO poisoning warning: Detecting colorless, odorless CO gas in environments using coal-fired heating or gas water heaters during winter.
    • Industrial waste gas treatment: Monitoring CO emissions in chemical production to ensure purification equipment operates normally.
    • Automotive exhaust detection: Triggering alarms when CO concentrations in diesel engine exhaust exceed standards, aiding emission control.
  • Technical Innovation: Uses high-low temperature cycle detection (1.5V for low-temperature CO detection, 5V for high-temperature sensor cleaning) to reduce false alarms.

MQ-8 Hydrogen gas sensor Module

MQ-8

The gas-sensitive material used in the MQ-8 gas sensor is tin dioxide (Sno2), which has a lower electrical conductivity in clean air. The sensor uses a high-low temperature cycling detection method. At a low temperature (heated at 1.5V), it detects carbon monoxide. The sensor's electrical conductivity increases as the concentration of carbon monoxide in the air increases. At a high temperature (heated at 5.0V), it cleans the stray gases adsorbed during the low-temperature process. A simple circuit can convert the change in electrical conductivity into an output signal corresponding to the gas concentration.

The MQ-8 gas sensor has high sensitivity to hydrogen. This sensor can detect various gases containing carbon monoxide and is a low-cost sensor suitable for multiple applications.

mq8d

Analysis of advantages and disadvantages

Advantages

  1. Shipborne Agility and VTOL Capability
    The MQ-8’s helicopter design enables autonomous takeoff/landing from ships without runways, making it critical for carrier strike groups and littoral combat ships (LCS) . Its foldable rotor blades and compact size (e.g., MQ-8C has a 35-foot rotor diameter) optimize deck space for rapid deployment . For example, the MQ-8C can operate from the Independence-class LCS, extending the ship’s surveillance range beyond its organic sensors .
  2. Enhanced Endurance and Range
    The MQ-8C variant offers 10+ hours of endurance and a 150-nautical-mile (278 km) operational radius, with a maximum range of 1,227 nautical miles (1,400 km) under ideal conditions . This endurance allows it to maintain persistent overwatch for counter-narcotics, anti-surface warfare, and maritime security missions. In a 2015 test, an MQ-8C flew for 11 hours with fuel reserves, demonstrating its reliability for prolonged operations .
  3. Advanced Sensor Fusion
    Equipped with the Leonardo AN/ZPY-8 Osprey radar (a 30 GHz active electronically scanned array) and FLIR AN/AAQ-22D Brite Star II EO/IR turret, the MQ-8C provides all-weather detection of small boats, submarines, and surface threats. The radar’s synthetic aperture radar (SAR) mode generates high-resolution imagery, while the EO/IR system enables day/night tracking and laser designation for precision strikes . For instance, during its 2021 deployment aboard USS Milwaukee, the MQ-8C detected and tracked drug-smuggling vessels in the Caribbean .
  4. Modular Mission Adaptability
    The UAV supports multi-mission configurations:
    • ISR&T: Real-time targeting data relay to manned aircraft like the MH-60S Seahawk .
    • Communication Relay: Extending radio ranges for dismounted troops or ships .
    • Mine Countermeasures: Planned integration of sonobuoys and mine-detection systems (though not fully realized before retirement plans) . Its 700+ lb (318 kg) payload capacity allows simultaneous sensor and weapon deployment, such as the Advanced Precision Kill Weapon System (APKWS) laser-guided rockets .
  5. Network-Centric Integration
    The MQ-8C integrates with the Navy’s Common Data Link (CDL) and Aegis combat system, enabling seamless data sharing with ships and aircraft. This capability supports manned-unmanned teaming (MUM-T), where the UAV acts as an "eye in the sky" for manned helicopters, enhancing situational awareness and reducing crew risks .

Disadvantages

  1. High Cost and Limited Deployment
    With a **unit cost of ~$28 million** (excluding R&D) and operational cost of $12,000–$15,000 per hour, the MQ-8C is significantly pricier than alternatives like the MQ-20 Puma ($250,000) or MQ-9B SeaGuardian . Despite its capabilities, the U.S. Navy plans to retire all 36 operational MQ-8Cs by 2026 due to budget constraints and the perception that cheaper UAVs (e.g., MQ-25 Stingray) can fulfill similar roles . As of 2025, only four LCS ships have deployed the MQ-8C, with limited operational impact .
  2. Technical Deficiencies and Cybersecurity Risks
    A 2020 Pentagon report deemed the MQ-8C not operationally effective or suitable, citing issues with its autonomous navigationsensor reliability, and cyber survivability . For example, its reliance on GPS and line-of-sight (LOS) datalinks makes it vulnerable to jamming or spoofing, as demonstrated in electromagnetic interference tests where the UAV’s control systems were intermittently disrupted .
  3. Maintenance Complexity
    The MQ-8C’s helicopter mechanics require frequent rotor blade inspections and specialized maintenance crews, leading to higher downtime compared to fixed-wing UAVs. Its reliance on JP-5 fuel (instead of the Navy’s standard JP-8) further complicates logistics in austere environments .
  4. Limited Mission Flexibility
    While the MQ-8C excels in ISR, its inability to carry heavy weapons (e.g., torpedoes or anti-ship missiles) limits its utility in high-intensity conflicts. Additionally, its sonobuoy capacity (planned for mine countermeasures) was never fully integrated, reducing its ASW potential compared to the MQ-6C Fire Scout .
  5. Operational Constraints
    The UAV’s dependence on shipborne infrastructure (e.g., launch rails, maintenance teams) restricts its independence. For instance, it cannot operate from forward bases without dedicated support, unlike smaller UAVs like the RQ-21 Blackjack .

Application scenario

MQ-8: Hydrogen (H₂) Safety Monitoring

  • Core Detection Target: Hydrogen (H₂).
  • Typical Applications:
    • Hydrogen energy facilities: Monitoring hydrogen leaks in fuel cell laboratories and hydrogen refueling stations to prevent explosion risks.
    • Industrial process control: Controlling hydrogen concentrations during etching processes in semiconductor manufacturing to ensure process stability.
    • Portable detectors: Used by researchers for temporary hydrogen concentration testing in environments like laboratory fume hoods.
  • Technical Feature: Sensitivity up to 10 ppm, response time <30 seconds, suitable for high-risk scenarios.

MQ-9 Flammable gas sensor Module

MQ-9 Flammable gas sensor

The gas-sensitive material used in the MO-9 gas sensor is tin dioxide (SnO2), which has a lower electrical conductivity in clean air. The sensor uses a high-low temperature cycling detection method. At a low temperature (heated at 1.5V), it detects carbon monoxide. As the concentration of carbon monoxide gas in the air increases, the electrical conductivity of the sensor also increases. At a high temperature (heated at 5.0V), it detects combustible gases such as methane and propane, and cleans the stray gases adsorbed during the low-temperature detection. A simple circuit can convert the change in electrical conductivity into an output signal corresponding to the gas concentration.

The MO-9 gas sensor has high sensitivity to carbon monoxide, methane, and liquefied gas. This sensor can detect various gases containing carbon monoxide and combustible substances, and is a low-cost sensor suitable for various applications. Analysis of advantages and disadvantages

mq9d

Analysis of advantages and disadvantages

Advantages

  1. Unmatched Endurance and Range
    The MQ-9A can loiter for 27+ hours at altitudes up to 50,000 feet with a 3,850-pound (1,746 kg) payload capacity, including external stores like AGM-114 Hellfire missiles and GBU-38 JDAMs . Its successor, the MQ-9B, extends endurance to 30+ hours and increases takeoff weight to 5,669 kg, enabling transoceanic missions. For example, India’s leased MQ-9Bs accumulated 12,000+ flight hours over two years on the China-India border, demonstrating reliability for prolonged surveillance .
  2. Precision Strike and Multi-Mission Capability
    Equipped with six hardpoints, the MQ-9 can carry a mix of weapons:
    • Hellfire missiles (for pinpoint targets)
    • GBU-39 Small Diameter Bombs (glide range up to 80 km with 1.5-meter accuracy)
    • AIM-9X Sidewinder (for air-to-air self-defense)
      This flexibility allows it to transition seamlessly from ISR to kinetic strikes. In 2020, an MQ-9 assassinated Iranian General Qasem Soleimani in Baghdad, highlighting its role in high-value target operations .
  3. Advanced Sensor Fusion
    The MQ-9 integrates:
    • AN/AAS-52 Multi-Spectral Targeting System (EO/IR/laser designator)
    • AN/ZPQ-1 Lynx synthetic aperture radar (SAR) for all-weather imaging
    • Seaspray 7500E V2 radar (on MQ-9B) for maritime surveillance
      These sensors can detect small boats, vehicles, and even periscopes at ranges exceeding 200 km. During the 2022 Russia-Ukraine war, MQ-9s provided real-time imagery of Russian troop movements, enhancing NATO’s situational awareness .
  4. Cost-Effectiveness in Low-Intensity Conflicts
    With an $18–32 million unit cost and $3,800/hour operational cost, the MQ-9 is cheaper than manned fighters like the F-16 ($27,000/hour) . India’s evaluation of the MQ-9B noted its **$10,000/hour** cost (post-maintenance center establishment), making it ideal for prolonged patrols compared to manned aircraft .
  5. Global Network Integration
    The MQ-9B’s Link-22 data link enables interoperability with NATO forces, while its compliance with STANAG 4671 standards facilitates joint operations. Japan and Australia have integrated MQ-9Bs into their maritime patrol fleets, sharing real-time data with U.S. forces in the Indo-Pacific .

Disadvantages

  1. Vulnerability in High-Threat Environments
    The MQ-9’s low speed (240 ktas) and large radar cross-section make it susceptible to modern air defenses:
    • Yemen’s Houthi forces have 击落 19+ MQ-9s since 2023 using SA-6/7 missiles and electronic jamming .
    • GPS/Link-16 dependency: In 2025, Iranian jamming disrupted MQ-9 navigation over the Persian Gulf, forcing emergency landings .
      Its survival rate in contested airspace is estimated at <30% against integrated air defense systems (IADS) like Russia’s S-400.
  2. High Cost and Maintenance Complexity
    The MQ-9B’s $107 million unit cost and 400+ man-hours/flight hour maintenance requirements strain budgets. The U.S. Air Force retired 36 MQ-9As in 2025 to fund cheaper alternatives like the MQ-20 Puma . India’s experience highlighted challenges in maintaining the maritime variant’s Seaspray radar in desert environments, leading to reduced reliability .
  3. Limited Maneuverability and Speed
    With a maximum speed of 240 ktas, the MQ-9 cannot evade fast-moving threats like fighter jets or advanced SAMs. During a 2024 test, an F-16 simulated intercept of an MQ-9, demonstrating the UAV’s inability to outmaneuver agile adversaries.
  4. Operational Constraints
    • Runway dependency: Unlike VTOL UAVs (e.g., MQ-8 Fire Scout), the MQ-9 requires 1,500-meter runways for takeoff/landing.
    • Weather sensitivity: Crosswinds exceeding 30 knots or icing conditions ground the aircraft, limiting its utility in harsh climates.
  5. Ethical and Legal Controversies
    The MQ-9’s role in targeted killings has drawn criticism for civilian casualties and violations of international law. A 2025 UN report cited 127 civilian deaths from MQ-9 strikes in Somalia since 2020, undermining its "surgical" reputation .

Application scenario

MQ-9: Comprehensive Detection of CO and Combustible Gases

  • Core Detection Targets: Carbon monoxide (CO), methane (CH₄), and propane (C₃H₈).
  • Typical Applications:
    • Industrial mixed gas monitoring: Simultaneously detecting toxic CO and combustible methane, such as in multi-gas early warning systems in coal mines.
    • Household multi-risk scenarios: Preventing both gas leaks (CH₄) and CO from incomplete combustion in older residences.
    • Portable multi-gas detectors: Used by emergency responders for rapid screening in fire scenes or chemical leak areas.
  • Working Principle: Low-temperature (1.5V) detection for CO and high-temperature (5V) detection for combustible gases, with automatic mode switching via circuits.

MQ-135 Air quality sensor Module

MQ-135

The gas-sensitive material used in the MQ-135 gas sensor is tin dioxide (SnO2), which has a relatively low electrical conductivity in clean air. When there is pollution gas in the environment where the sensor is located, the electrical conductivity of the sensor increases as the concentration of the pollution gas in the air increases. Using a simple circuit, the change in electrical conductivity can be converted into an output signal corresponding to the concentration of the gas.

The MQ-135 gas sensor has high sensitivity to ammonia, sulfides, and benzene vapors, and is also ideal for detecting smoke and other harmful gases. This sensor can detect a variety of harmful gases and is a low-cost sensor suitable for multiple applications. Characteristics

mq135d

Analysis of advantages and disadvantages

Advantages

  1. Wide Detection Range
    The MQ-135 can detect a broad spectrum of gases, including ammonianitrogen oxides (NOx)benzenealcoholcarbon dioxide (CO₂), and smoke. This versatility makes it suitable for diverse environments, such as homes, offices, industrial settings, and automotive interiors. For example, it can simultaneously monitor indoor air quality and detect ethanol in breathalyzers .
  2. High Sensitivity
    The sensor’s SnO₂ (tin dioxide)sensing material exhibits low conductivity in clean air but rapidly increases conductivity when exposed to target gases. This property enables it to detect concentrations as low as 10 ppm for ammonia and benzene . In experiments, it showed a 2V voltage rise within 10 seconds when exposed to alcohol vapor, demonstrating its responsiveness .
  3. Cost-Effectiveness
    Priced at $5–$30per module, the MQ-135 is significantly cheaper than electrochemical or infrared sensors. Its low power consumption (150mA at 5V) and simple drive circuit reduce operational costs, making it ideal for DIY projects and mass deployment in smart home systems . For instance, hobbyists can integrate it with Arduino or ESP8266 microcontrollers for under $50 .
  4. Compact and Modular Design
    With dimensions of 32mm x 22mm x 27mm, the MQ-135 easily fits into portable devices or embedded systems. Its analog (AO) and digital (DO) outputsallow flexibility in data processing:
    • Analog outputprovides continuous gas concentration values (0–5V proportional to ppm) .
    • Digital outputtriggers a threshold alarm via a potentiometer-adjustable comparator .
      This design supports applications like smart air purifiers and real-time environmental monitoring .
  5. Long Lifespan and Durability
    The sensor’s metal oxide structureensures 10+ years of service life under normal conditions. It withstands 95% humidity and -20°C to 70°C temperatures, making it suitable for harsh environments like industrial workshops or outdoor monitoring stations .

Disadvantages

  1. Nonlinear Response and Cross-Sensitivity
    The MQ-135’s output is not linearly proportional to gas concentration, especially at high levels. For example, its sensitivity to ammonia decreases above 300 ppm, requiring calibration tables or 分段函数 for accuracy . Additionally, it responds to multiple gases (e.g., ethanol and methane), leading to false positives unless paired with other sensors or advanced algorithms .
  2. Environmental Interference
    Temperature and humidity fluctuations significantly affect readings. Humidity above 60% can increase baseline resistance, while extreme temperatures alter the sensor’s conductivity. For instance, a 2022 experiment showed that a 10°C temperature rise caused a 15% deviation in CO₂ readings .
    Solution: Integrate DHT11/22 or SHT30 sensors for real-time compensation .
  3. Long Warm-Up Time
    The MQ-135 requires 20–60 seconds of preheating to stabilize readings. During this period, it may produce unreliable data, limiting its use in instantaneous detection scenarios like rapid gas leaks .
  4. Lack of Selectivity
    Unlike electrochemical sensors, the MQ-135 cannot distinguish between similar gases (e.g., benzene vs. toluene). This drawback restricts its use in precision applications like medical diagnostics or scientific research .
  5. Maintenance Complexity
    The sensor’s heating element (950mW power consumption) requires regular cleaning to remove dust or chemical residues, which can degrade sensitivity. In smoky environments, frequent calibration is necessary to maintain accuracy .

Practical Applications and Mitigation Strategies

  • Home Air Quality Monitoring: Pair with BH1750 (light sensor) and DHT11 (Temperature and humidity sensor) for comprehensive environmental data .
  • Industrial Safety: Use in multi-sensor arrays (e.g., MQ-2 for LPG, MQ-7 for CO) to reduce cross-sensitivity errors .
  • Automotive: Install in car cabins to trigger ventilation systems when alcohol or CO₂ levels rise .
  • Calibration Tips:
  1. Baseline calibrationin clean air every 24 hours.
  2. Software filtering(e.g., moving average) to reduce noise .
  3. Machine learning models(e.g., neural networks) for gas classification .

Application scenario

MQ-135: Air Quality and Harmful Gas Detection

  • Core Detection Targets: Ammonia (NH₃), sulfides (H₂S), benzene series (C₆H₆), and CO₂.
  • Typical Applications:
    • Indoor air quality monitoring: Detecting residual formaldehyde and benzene after renovations, linking to fresh air systems for purification.
    • Industrial waste gas management: Monitoring ammonia and sulfide emissions in chemical parks to ensure compliance with standards.
    • Agricultural environment monitoring: Detecting ammonia concentrations in livestock farms to optimize ventilation and deodorization measures.
  • Technical Upgrade: Capable of detecting CO₂ concentrations (100–1000 ppm), suitable for smart greenhouse regulation.

How to Wire the MQ Gas Sensor Series with Arduino

Hardware connection

The wiring methods for the MQ series sensors are the same. Taking the MQ-9 gas sensor as an example, we connect it in the following way:

Hardware connection

Connection Table

Device / ModulePin NameArduino PinFunction Description
MQ-9 SensorVCC5VSensor power supply (requires 5V voltage)
 GNDGNDGround (common ground)
 AO (Analog Out)A0Analog signal output (connect to Arduino analog input pin)
 DO (Digital Out)Optional (not required)Digital switch output (optional, requires threshold adjustment via module potentiometer)
OLED DisplayVCC3.3V or 5VDisplay power supply (3.3V preferred to avoid overvoltage damage)
 GNDGNDGround (common ground)
 SDAA4 (SDA)I²C data pin (Arduino default SDA pin)
 SCLA5 (SCL)I²C clock pin (Arduino default SCL pin)

Connection Instructions

1. MQ-9 Sensor:
o Core pins are VCC (power supply), GND (ground), and AO (analog signal output), which can be directly connected to read the analog signals related to gas concentration.
o DO pin is an optional digital alarm output. The threshold needs to be preset through the potentiometer on the module. When the threshold is exceeded, the output changes between high and low levels, and it can be connected as needed.
2. OLED Display:
o Uses I²C interface, requiring only 4 wires for communication: VCC connected to the power supply (3.3V is safer), GND common ground, SDA connected to Arduino analog pin A4, SCL connected to analog pin A5.
o The I²C pins of different Arduino models may be different (e.g., Mega's SDA=20, SCL=21), so the pin definitions need to be confirmed according to the actual model.
3. Grounding Principle:
The GND of all modules must be connected to the GND of Arduino to ensure consistent circuit potential and avoid signal interference causing abnormal data.

MQ Gas Sensor Series Arduino code

It should be noted that although the hardware connection methods of the MQ gas sensor series are the same, their usage codes are not exactly the same. It should be noted that although the hardware connection methods of the MQ gas sensor series are the same, their usage codes are not exactly the same.

MQ series sensors all operate based on semiconductor gas-sensitive materials (e.g., SnO₂). The core principle is: when the gas-sensitive material reacts with target gases, its conductivity changes, which is converted into a voltage signal through a circuit and finally read and processed by a microcontroller (e.g., Arduino, ESP32). Therefore, the basic code framework necessarily includes the following common modules:

1.Hardware Initialization

				
					/* 
  Hardware Initialization for MQ Series Sensors
  Applicable to: MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-135, etc.
*/

// Define pin connections
const int MQ_SENSOR_ANALOG_PIN = A0;  // Analog output pin of MQ sensor
const int MQ_HEATER_PIN = 2;         // Heater control pin (for sensors requiring heating: MQ-2, MQ-7, MQ-8, etc.)

// Variables to store sensor data
int sensorRawValue;  // Raw analog reading from sensor (0-1023)
float sensorVoltage; // Converted voltage value (0-5V)

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Set pin modes
  pinMode(MQ_SENSOR_ANALOG_PIN, INPUT);   // Analog pin as input
  pinMode(MQ_HEATER_PIN, OUTPUT);         // Heater pin as output
  
  // Initialize heater (for applicable sensors)
  // For MQ-2/MQ-4: Keep heater ON continuously
  // For MQ-7/MQ-8: Heater control will be handled in loop() for temperature cycling
  digitalWrite(MQ_HEATER_PIN, HIGH);      // Start with heater ON (adjust based on sensor type)
  
  // Wait for sensor to预热 (preheat time varies by model)
  Serial.println("Sensor initializing... Please wait.");
  delay(60000);  // 60-second preheat (adjust: 3-5min for MQ-2; 10-20min for MQ-7)
  Serial.println("Initialization complete. Starting readings...");
}
				
			

2.Signal Reading and Conversion

				
					/* 
  Signal Reading and Conversion for MQ Series Sensors
  Converts raw analog values to voltage and resistance (where applicable)
*/

// Function to read raw analog value and convert to voltage
void readSensorValues() {
  // Read raw analog value (0-1023 corresponds to 0-5V)
  sensorRawValue = analogRead(MQ_SENSOR_ANALOG_PIN);
  
  // Convert raw value to voltage (0-5V)
  sensorVoltage = sensorRawValue * (5.0 / 1023.0);
  
  // Optional: Calculate sensor resistance (for advanced calibration)
  // Requires knowing the load resistor value (RL) on the sensor module
  const float RL = 2000;  // Load resistor value in ohms (check your module specs)
  float RS;               // Sensor resistance
  
  // Formula: RS = RL * (5.0 - sensorVoltage) / sensorVoltage
  RS = RL * (5.0 - sensorVoltage) / sensorVoltage;
}

// Example dual-temperature control (for MQ-7/MQ-8)
void handleHeatingCycle() {
  // Low-temperature phase (detection mode)
  digitalWrite(MQ_HEATER_PIN, LOW);   // ~1.5V heating (adjust based on your circuit)
  delay(60000);                       // 60s detection phase
  readSensorValues();                 // Read values during detection
  
  // High-temperature phase (cleaning mode)
  digitalWrite(MQ_HEATER_PIN, HIGH);  // ~5V heating (adjust based on your circuit)
  delay(30000);                       // 30s cleaning phase (no valid readings)
}
				
			

3.Basic Data Output

				
					/* 
  Basic Data Output for MQ Series Sensors
  Prints raw values, voltage, and estimated concentration to Serial Monitor
*/

// Function to print sensor data to Serial Monitor
void printSensorData() {
  Serial.println("------------------------------");
  Serial.print("Raw Analog Value: ");
  Serial.println(sensorRawValue);
  
  Serial.print("Sensor Voltage: ");
  Serial.print(sensorVoltage);
  Serial.println(" V");
  
  // Optional: Print estimated concentration (model-specific)
  printConcentration();
  Serial.println("------------------------------\n");
}

// Model-specific concentration estimation (example for MQ-2 and MQ-135)
void printConcentration() {
  // MQ-2: Estimate LPG concentration (simplified example)
  // Note: Use actual calibration data for accuracy
  float lpgPPM = map(sensorRawValue, 0, 1023, 0, 10000);  // Example mapping
  Serial.print("Estimated LPG: ");
  Serial.print(lpgPPM);
  Serial.println(" ppm");
  
  // MQ-135: Estimate CO2 concentration (simplified example)
  float co2PPM = map(sensorRawValue, 0, 1023, 400, 5000);  // Example mapping
  Serial.print("Estimated CO2: ");
  Serial.print(co2PPM);
  Serial.println(" ppm");
}

// Main loop to continuously read and print data
void loop() {
  // For MQ-2/MQ-4 (continuous heating):
  readSensorValues();
  printSensorData();
  delay(1000);  // Read every 1 second
  
  // For MQ-7/MQ-8 (dual-temperature cycle):
  // handleHeatingCycle();
  // printSensorData();
}
				
			

Although the frameworks are similar, different sensor models have distinct target gases, sensitivities, heating requirements, and calibration curves, so code details must be adjusted. The main differences are as follows:

  1. Different Heating Logics: Single-Temperature vs. Dual-Temperature Cycling
  • Some models require no heating: Such as the MQ-135 (air quality sensor), where the gas-sensitive material works at room temperature, so no heating control is needed in the code.
  • Some models require continuous heating: Such as the MQ-2 (smoke/combustible gas sensor), which needs continuous heating at a fixed voltage (e.g., 5V). In the code, simply initialize the heating pin to a high level.
  • Dual-temperature cycling models: Such as the MQ-8 (CO/hydrogen) and MQ-7 (CO), which require alternating high and low temperature heating (e.g., low-temperature detection, high-temperature cleaning). The code must include logic to switch heating voltages at regular intervals.
  1. Different Concentration Conversion Formulas: Variations in Calibration Curves

The "voltage-concentration" relationship of MQ sensors needs to be converted using calibration curves (usually logarithmic relationships), and the curve parameters for different gases are completely different. For example:

  • Concentration formula for MQ-4 (methane): ppm=613.9×e−0.743×voltage (example).
  • The concentration formula for MQ-135 (air quality) must correspond to CO, NO₂, formaldehyde, etc., with more complex parameters.
  • If the formula of another model is directly applied without calibrating for the specific model, the concentration calculation will be completely incorrect.
  1. Different Sensitivities and Threshold Settings

Sensitivity to target gases varies greatly among different sensors, so alarm thresholds must be defined individually:

  • The safety threshold for MQ-3 (alcohol) may be set to 0.1mg/L (corresponding to a voltage of approximately 1.2V).
  • The alarm threshold for MQ-2 (smoke) may be set to voltage > 2.5V (indicating excessive smoke concentration).
  • Using MQ-2’s threshold to judge MQ-135’s signal will cause false alarms or missed alarms.
  1. Different Preheating and Stabilization Times

Sensors require preheating to reach a stable state, and the time varies by model:

  • MQ-2/MQ-4: Preheat for 3-5 minutes.
  • MQ-8/MQ-7: Due to the dual-temperature cycling design, longer preheating is required for first use (10-20 minutes).
  • If the preheating time is not set according to the model in the code, initial data will be unstable.

MQ-2 Smoke gas sensor Module Arduino code

				
					/*
  MQ-2 Smoke/Gas Sensor with 0.96" OLED Display
  Detects: Smoke, LPG, Propane, Methane, Butane
  Hardware: Arduino (Uno/Nano), MQ-2 Sensor, 0.96" I2C OLED (SSD1306)
  
  Wiring Connections:
  - MQ-2 Sensor:
    VCC → 5V (Must use 5V for proper heating)
    GND → GND
    AO  → A0 (Analog output)
    DO  → Not used (Digital output, optional for threshold alarms)
  
  - OLED Display (I2C):
    VCC → 3.3V (or 5V, check display specifications)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data pin)
    SCL → A5 (Arduino Uno/Nano I2C clock pin)
*/

#include <Wire.h>               // Library for I2C communication
#include <Adafruit_GFX.h>       // Core graphics library for OLED
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED displays

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-2 Sensor pin definition
const int mq2AnalogPin = A0;

// Variables to store sensor data
int rawSensorValue;       // Raw analog reading (0-1023)
float sensorVoltage;      // Converted voltage (0-5V)
float lpgConcentration;   // Estimated LPG concentration (ppm)
float smokeConcentration; // Estimated smoke concentration (ppm)

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display initialization fails
  }
  
  // Clear display buffer
  display.clearDisplay();
  
  // Display initialization message
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-2 Initializing");
  display.println("Heating up...");
  display.display();
  
  // MQ-2 requires 3-5 minutes warm-up time for stable readings
  // We'll use 3 minutes (180000 milliseconds)
  delay(180000);
  
  // Clear display after warm-up
  display.clearDisplay();
  Serial.println("MQ-2 Sensor Ready");
}

void loop() {
  // Read raw analog value from MQ-2 sensor
  rawSensorValue = analogRead(mq2AnalogPin);
  
  // Convert raw value to voltage (0-5V range)
  // Formula: voltage = (rawValue * 5.0) / 1023.0
  sensorVoltage = rawSensorValue * (5.0 / 1023.0);
  
  // Calculate estimated concentrations (simplified models)
  // These are approximate values - calibrate with known gas sources for accuracy
  calculateConcentrations();
  
  // Update OLED display with current readings
  updateDisplay();
  
  // Print data to Serial Monitor for debugging
  Serial.print("Raw Value: ");
  Serial.print(rawSensorValue);
  Serial.print(" | Voltage: ");
  Serial.print(sensorVoltage, 2);
  Serial.print("V | LPG: ");
  Serial.print(lpgConcentration);
  Serial.print("ppm | Smoke: ");
  Serial.print(smokeConcentration);
  Serial.println("ppm");
  
  // Update readings every 2 seconds
  delay(2000);
}

// Calculate estimated gas concentrations based on voltage
void calculateConcentrations() {
  // These formulas are simplified and application-specific
  // For precise measurements, perform calibration with known concentrations
  
  // LPG concentration estimation (0-10000 ppm range)
  // Voltage increases with higher gas concentration
  lpgConcentration = map(rawSensorValue, 200, 900, 0, 10000);
  
  // Smoke concentration estimation (0-5000 ppm range)
  smokeConcentration = map(rawSensorValue, 200, 900, 0, 5000);
  
  // Constrain values to realistic ranges
  lpgConcentration = constrain(lpgConcentration, 0, 10000);
  smokeConcentration = constrain(smokeConcentration, 0, 5000);
}

// Update OLED display with sensor data
void updateDisplay() {
  // Clear previous display content
  display.clearDisplay();
  
  // Display sensor type (top of screen)
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-2 Sensor");
  display.println("Smoke/LPG Detector");
  
  // Display voltage reading
  display.setTextSize(1);
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(sensorVoltage, 2);  // Show 2 decimal places
  display.print("V");
  
  // Display LPG concentration (larger text for visibility)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("LPG: ");
  display.print((int)lpgConcentration);  // Show as integer
  display.print("ppm");
  
  // Display smoke concentration
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Smoke: ");
  display.print((int)smokeConcentration);
  display.print("ppm");
  
  // Update physical display
  display.display();
}
    
				
			

MQ-3 Alcohol ethanol Module sensor Arduino code

				
					/*
  MQ-3 Alcohol Sensor with 0.96" OLED Display
  Detects: Alcohol vapor, Ethanol, and other volatile organic compounds (VOCs)
  Hardware: Arduino (Uno/Nano), MQ-3 Sensor, 0.96" I2C OLED (SSD1306)
  
  Wiring Connections:
  - MQ-3 Sensor:
    VCC → 5V (Required for proper heater operation)
    GND → GND
    AO  → A0 (Analog output for continuous reading)
    DO  → Not used (Digital output for threshold alarms, optional)
  
  - OLED Display (I2C):
    VCC → 3.3V (Recommended, some displays support 5V)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data pin)
    SCL → A5 (Arduino Uno/Nano I2C clock pin)
*/

#include <Wire.h>               // For I2C communication
#include <Adafruit_GFX.h>       // Core graphics library
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED displays

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-3 Sensor pin definition
const int mq3AnalogPin = A0;

// Variables to store sensor data
int rawValue;               // Raw analog reading (0-1023)
float voltage;              // Converted voltage (0-5V)
float alcoholConcentration; // Estimated alcohol concentration (mg/L)
String statusText;          // Status description (e.g., "Safe", "Detected")

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display fails to initialize
  }
  
  // Clear display buffer
  display.clearDisplay();
  
  // Display initialization message
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-3 Initializing");
  display.println("Heating (5 mins)...");
  display.display();
  
  // MQ-3 requires 5-10 minutes of warm-up time for stable readings
  // We use 5 minutes (300000 milliseconds) as minimum
  delay(300000);
  
  // Clear display after warm-up
  display.clearDisplay();
  Serial.println("MQ-3 Sensor Ready");
}

void loop() {
  // Read raw analog value from MQ-3 sensor
  rawValue = analogRead(mq3AnalogPin);
  
  // Convert raw value to voltage (0-5V range)
  voltage = rawValue * (5.0 / 1023.0);
  
  // Calculate estimated alcohol concentration
  calculateAlcoholConcentration();
  
  // Determine status text based on concentration
  updateStatusText();
  
  // Update OLED display with current readings
  updateDisplay();
  
  // Print data to Serial Monitor for debugging
  Serial.print("Raw: ");
  Serial.print(rawValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage, 2);
  Serial.print("V | Alcohol: ");
  Serial.print(alcoholConcentration, 2);
  Serial.print("mg/L | Status: ");
  Serial.println(statusText);
  
  // Update readings every 1 second
  delay(1000);
}

// Calculate estimated alcohol concentration (simplified model)
void calculateAlcoholConcentration() {
  // This is a simplified conversion based on typical MQ-3 behavior
  // For accurate measurements, calibrate with known alcohol concentrations
  
  // MQ-3 output voltage increases with higher alcohol concentration
  // Typical range: 0.1-1.5 mg/L (common for breathalyzer applications)
  alcoholConcentration = map(voltage * 100, 30, 150, 0, 150) / 100.0;
  
  // Constrain values to realistic range (0-2.0 mg/L)
  alcoholConcentration = constrain(alcoholConcentration, 0.00, 2.00);
}

// Update status text based on alcohol concentration
void updateStatusText() {
  if (alcoholConcentration < 0.05) {
    statusText = "No Alcohol";
  } else if (alcoholConcentration < 0.1) {
    statusText = "Trace Amounts";
  } else if (alcoholConcentration < 0.5) {
    statusText = "Low Concentration";
  } else {
    statusText = "High Concentration";
  }
}

// Update OLED display with sensor data
void updateDisplay() {
  // Clear previous display content
  display.clearDisplay();
  
  // Display sensor type (top section)
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-3 Sensor");
  display.println("Alcohol Detector");
  
  // Display voltage reading
  display.setTextSize(1);
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(voltage, 2);  // Show 2 decimal places
  display.print("V");
  
  // Display alcohol concentration (larger text for emphasis)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("Alcohol: ");
  display.print(alcoholConcentration, 2);  // Show 2 decimal places
  display.print("mg/L");
  
  // Display status text
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Status: ");
  display.print(statusText);
  
  // Update physical display
  display.display();
}
    
				
			

MQ-4 Natural gas senso Module Arduino code

				
					/*
  MQ-4 Methane Sensor with 0.96" OLED Display
  Detects: Methane (CH4), Natural Gas, and other combustible gases
  Hardware: Arduino (Uno/Nano), MQ-4 Sensor, 0.96" I2C OLED (SSD1306)
  
  Wiring Connections:
  - MQ-4 Sensor:
    VCC → 5V (Required for proper heater operation)
    GND → GND
    AO  → A0 (Analog output for continuous reading)
    DO  → Not used (Digital output for threshold alarms, optional)
  
  - OLED Display (I2C):
    VCC → 3.3V (Recommended, some displays support 5V)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data pin)
    SCL → A5 (Arduino Uno/Nano I2C clock pin)
*/

#include <Wire.h>               // For I2C communication
#include <Adafruit_GFX.h>       // Core graphics library
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED displays

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-4 Sensor pin definition
const int mq4AnalogPin = A0;

// Variables to store sensor data
int rawValue;             // Raw analog reading (0-1023)
float voltage;            // Converted voltage (0-5V)
float methaneConcentration; // Estimated methane concentration (ppm)
String gasLevelStatus;    // Status description (e.g., "Normal", "High")

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display fails to initialize
  }
  
  // Clear display buffer
  display.clearDisplay();
  
  // Display initialization message
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-4 Initializing");
  display.println("Warming up...");
  display.display();
  
  // MQ-4 requires 3-5 minutes of warm-up time for stable readings
  // Using 3 minutes (180000 milliseconds) as minimum
  delay(180000);
  
  // Clear display after warm-up
  display.clearDisplay();
  Serial.println("MQ-4 Sensor Ready");
}

void loop() {
  // Read raw analog value from MQ-4 sensor
  rawValue = analogRead(mq4AnalogPin);
  
  // Convert raw value to voltage (0-5V range)
  voltage = rawValue * (5.0 / 1023.0);
  
  // Calculate estimated methane concentration
  calculateMethaneConcentration();
  
  // Determine gas level status based on concentration
  updateGasStatus();
  
  // Update OLED display with current readings
  updateDisplay();
  
  // Print data to Serial Monitor for debugging
  Serial.print("Raw: ");
  Serial.print(rawValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage, 2);
  Serial.print("V | Methane: ");
  Serial.print(methaneConcentration);
  Serial.print("ppm | Status: ");
  Serial.println(gasLevelStatus);
  
  // Update readings every 2 seconds
  delay(2000);
}

// Calculate estimated methane concentration (simplified model)
void calculateMethaneConcentration() {
  // This is a simplified conversion based on typical MQ-4 characteristics
  // For accurate measurements, calibrate with known methane concentrations
  
  // MQ-4 detects methane in typical range of 300-10000 ppm
  // Voltage increases with higher gas concentration
  methaneConcentration = map(rawValue, 100, 900, 300, 10000);
  
  // Constrain values to realistic detection range
  methaneConcentration = constrain(methaneConcentration, 300, 10000);
}

// Update gas status text based on methane concentration
void updateGasStatus() {
  if (methaneConcentration < 1000) {
    gasLevelStatus = "Normal";
  } else if (methaneConcentration < 5000) {
    gasLevelStatus = "Elevated";
  } else {
    gasLevelStatus = "High Risk";
  }
}

// Update OLED display with sensor data
void updateDisplay() {
  // Clear previous display content
  display.clearDisplay();
  
  // Display sensor type (top section)
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-4 Sensor");
  display.println("Methane Detector");
  
  // Display voltage reading
  display.setTextSize(1);
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(voltage, 2);  // Show 2 decimal places
  display.print("V");
  
  // Display methane concentration (larger text for emphasis)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("CH4: ");
  display.print((int)methaneConcentration);  // Show as integer
  display.print("ppm");
  
  // Display gas level status
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Status: ");
  display.print(gasLevelStatus);
  
  // Update physical display
  display.display();
}
    
				
			

MQ-5 Liquefied gas sensor Module Arduino code

				
					/*
  MQ-5 LPG/Propane Sensor with 0.96" OLED Display
  Detects: LPG (Liquefied Petroleum Gas), Propane, Butane, and other combustible gases
  Hardware: Arduino (Uno/Nano), MQ-5 Sensor, 0.96" I2C OLED (SSD1306)
  
  Wiring Connections:
  - MQ-5 Sensor:
    VCC → 5V (Must use 5V for proper heater functionality)
    GND → GND
    AO  → A0 (Analog output for continuous concentration readings)
    DO  → Not used (Digital output for threshold alarms, optional)
  
  - OLED Display (I2C):
    VCC → 3.3V (Recommended, check display specifications for 5V compatibility)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data pin)
    SCL → A5 (Arduino Uno/Nano I2C clock pin)
*/

#include <Wire.h>               // Library for I2C communication
#include <Adafruit_GFX.h>       // Core graphics library for OLED
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED displays

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-5 Sensor pin definition
const int mq5AnalogPin = A0;

// Variables to store sensor data
int rawSensorValue;       // Raw analog reading (0-1023)
float sensorVoltage;      // Converted voltage (0-5V)
float lpgConcentration;   // Estimated LPG concentration (ppm)
String gasDetectionStatus;// Status description (e.g., "Safe", "Detected")

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display initialization fails
  }
  
  // Clear display buffer
  display.clearDisplay();
  
  // Display initialization message
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-5 Initializing");
  display.println("Heating up...");
  display.display();
  
  // MQ-5 requires 3-5 minutes of warm-up time for stable readings
  // Using 3 minutes (180000 milliseconds) as minimum
  delay(180000);
  
  // Clear display after warm-up
  display.clearDisplay();
  Serial.println("MQ-5 Sensor Ready");
}

void loop() {
  // Read raw analog value from MQ-5 sensor
  rawSensorValue = analogRead(mq5AnalogPin);
  
  // Convert raw value to voltage (0-5V range)
  sensorVoltage = rawSensorValue * (5.0 / 1023.0);
  
  // Calculate estimated LPG concentration
  calculateLPGConcentration();
  
  // Update detection status based on concentration
  updateDetectionStatus();
  
  // Update OLED display with current readings
  updateDisplay();
  
  // Print data to Serial Monitor for debugging
  Serial.print("Raw Value: ");
  Serial.print(rawSensorValue);
  Serial.print(" | Voltage: ");
  Serial.print(sensorVoltage, 2);
  Serial.print("V | LPG: ");
  Serial.print(lpgConcentration);
  Serial.print("ppm | Status: ");
  Serial.println(gasDetectionStatus);
  
  // Update readings every 2 seconds
  delay(2000);
}

// Calculate estimated LPG concentration (simplified model)
void calculateLPGConcentration() {
  // This is a basic conversion based on typical MQ-5 characteristics
  // For precise measurements, calibrate with known LPG concentrations
  
  // MQ-5 detects LPG in the range of 200-10000 ppm
  // Voltage increases proportionally with gas concentration
  lpgConcentration = map(rawSensorValue, 150, 900, 200, 10000);
  
  // Constrain values to realistic detection range
  lpgConcentration = constrain(lpgConcentration, 200, 10000);
}

// Update detection status based on LPG concentration
void updateDetectionStatus() {
  if (lpgConcentration < 1000) {
    gasDetectionStatus = "Safe";
  } else if (lpgConcentration < 5000) {
    gasDetectionStatus = "Low Level";
  } else {
    gasDetectionStatus = "High Level";
  }
}

// Update OLED display with sensor data
void updateDisplay() {
  // Clear previous display content
  display.clearDisplay();
  
  // Display sensor type (top section)
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-5 Sensor");
  display.println("LPG Detector");
  
  // Display voltage reading
  display.setTextSize(1);
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(sensorVoltage, 2);  // Show 2 decimal places
  display.print("V");
  
  // Display LPG concentration (larger text for visibility)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("LPG: ");
  display.print((int)lpgConcentration);  // Show as integer
  display.print("ppm");
  
  // Display detection status
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Status: ");
  display.print(gasDetectionStatus);
  
  // Update physical display
  display.display();
}
    
				
			

MQ-6 Propane sensor Module Arduino code

				
					/*
  MQ-6 Butane/Propane Sensor with 0.96" OLED Display
  Detects: Butane, Propane, LPG (Liquefied Petroleum Gas)
  Hardware: Arduino (Uno/Nano), MQ-6 Sensor, 0.96" I2C OLED (SSD1306)
  
  Wiring Connections:
  - MQ-6 Sensor:
    VCC → 5V (Required for proper heater operation)
    GND → GND
    AO  → A0 (Analog output for continuous concentration readings)
    DO  → Not used (Digital output for threshold alarms, optional)
  
  - OLED Display (I2C):
    VCC → 3.3V (Recommended, check display specs for 5V compatibility)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data pin)
    SCL → A5 (Arduino Uno/Nano I2C clock pin)
*/

#include <Wire.h>               // For I2C communication
#include <Adafruit_GFX.h>       // Core graphics library
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED displays

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-6 Sensor pin definition
const int mq6AnalogPin = A0;

// Variables to store sensor data
int rawValue;               // Raw analog reading (0-1023)
float voltage;              // Converted voltage (0-5V)
float butaneConcentration;  // Estimated butane concentration (ppm)
String gasLevelStatus;      // Status description (e.g., "Normal", "Alert")

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display fails to initialize
  }
  
  // Clear display buffer
  display.clearDisplay();
  
  // Display initialization message
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-6 Initializing");
  display.println("Heating (3 mins)...");
  display.display();
  
  // MQ-6 requires 3-5 minutes of warm-up time for stable readings
  // Using 3 minutes (180000 milliseconds) as minimum
  delay(180000);
  
  // Clear display after warm-up
  display.clearDisplay();
  Serial.println("MQ-6 Sensor Ready");
}

void loop() {
  // Read raw analog value from MQ-6 sensor
  rawValue = analogRead(mq6AnalogPin);
  
  // Convert raw value to voltage (0-5V range)
  voltage = rawValue * (5.0 / 1023.0);
  
  // Calculate estimated butane concentration
  calculateButaneConcentration();
  
  // Update gas level status based on concentration
  updateGasStatus();
  
  // Update OLED display with current readings
  updateDisplay();
  
  // Print data to Serial Monitor for debugging
  Serial.print("Raw: ");
  Serial.print(rawValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage, 2);
  Serial.print("V | Butane: ");
  Serial.print(butaneConcentration);
  Serial.print("ppm | Status: ");
  Serial.println(gasLevelStatus);
  
  // Update readings every 2 seconds
  delay(2000);
}

// Calculate estimated butane concentration (simplified model)
void calculateButaneConcentration() {
  // This is a basic conversion based on typical MQ-6 characteristics
  // For precise measurements, calibrate with known gas concentrations
  
  // MQ-6 detects butane in the range of 100-10000 ppm
  // Voltage increases with higher gas concentration
  butaneConcentration = map(rawValue, 100, 900, 100, 10000);
  
  // Constrain values to realistic detection range
  butaneConcentration = constrain(butaneConcentration, 100, 10000);
}

// Update gas status text based on butane concentration
void updateGasStatus() {
  if (butaneConcentration < 500) {
    gasLevelStatus = "Normal";
  } else if (butaneConcentration < 3000) {
    gasLevelStatus = "Low Level";
  } else {
    gasLevelStatus = "High Level";
  }
}

// Update OLED display with sensor data
void updateDisplay() {
  // Clear previous display content
  display.clearDisplay();
  
  // Display sensor type (top section)
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-6 Sensor");
  display.println("Butane Detector");
  
  // Display voltage reading
  display.setTextSize(1);
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(voltage, 2);  // Show 2 decimal places
  display.print("V");
  
  // Display butane concentration (larger text for emphasis)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("Butane: ");
  display.print((int)butaneConcentration);  // Show as integer
  display.print("ppm");
  
  // Display gas level status
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Status: ");
  display.print(gasLevelStatus);
  
  // Update physical display
  display.display();
}
    
				
			

MQ-7 Carbon monoxide sensor Module Arduino code

				
					/*
  MQ-7 Carbon Monoxide Sensor with 0.96" OLED Display
  Detects: Carbon Monoxide (CO) - a toxic, odorless gas
  Hardware: Arduino (Uno/Nano), MQ-7 Sensor, 0.96" I2C OLED (SSD1306)
  
  Wiring Connections:
  - MQ-7 Sensor:
    VCC → 5V (Required for proper heater operation)
    GND → GND
    AO  → A0 (Analog output for continuous concentration readings)
    DO  → Not used (Digital output for threshold alarms, optional)
    HEATER → D2 (Heater control pin for temperature cycling)
  
  - OLED Display (I2C):
    VCC → 3.3V (Recommended, check display specs for 5V compatibility)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data pin)
    SCL → A5 (Arduino Uno/Nano I2C clock pin)
*/

#include <Wire.h>               // For I2C communication
#include <Adafruit_GFX.h>       // Core graphics library
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED displays

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-7 Sensor pin definitions
const int mq7AnalogPin = A0;    // Analog output pin
const int mq7HeaterPin = 2;     // Heater control pin (critical for MQ-7)

// Variables to store sensor data
int rawValue;             // Raw analog reading (0-1023)
float voltage;            // Converted voltage (0-5V)
float coConcentration;    // Estimated CO concentration (ppm)
String safetyStatus;      // Safety status description
bool isHeatingPhase = true; // Track heating cycle phase

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display fails to initialize
  }
  
  // Configure heater pin
  pinMode(mq7HeaterPin, OUTPUT);
  
  // Clear display buffer
  display.clearDisplay();
  
  // Display initialization message
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-7 Initializing");
  display.println("Heating (10 mins)...");
  display.display();
  
  // MQ-7 requires extended 10-minute warm-up for stable readings
  // Initial heating at high temperature
  digitalWrite(mq7HeaterPin, HIGH);  // 5V heating
  delay(600000);  // 10 minutes (600000 milliseconds)
  
  // Clear display after warm-up
  display.clearDisplay();
  Serial.println("MQ-7 Sensor Ready");
}

void loop() {
  // MQ-7 requires temperature cycling for accurate CO detection:
  // 1. Low temperature (1.5V) for 60 seconds - detection phase
  // 2. High temperature (5V) for 90 seconds - cleaning phase
  
  if (isHeatingPhase) {
    // High temperature cleaning phase
    digitalWrite(mq7HeaterPin, HIGH);
    display.clearDisplay();
    display.setTextSize(1);
    display.setCursor(0, 20);
    display.println("Cleaning phase...");
    display.display();
    delay(90000);  // 90 seconds
    isHeatingPhase = false;
  } else {
    // Low temperature detection phase
    digitalWrite(mq7HeaterPin, LOW);
    delay(60000);  // 60 seconds stabilization before reading
    
    // Read sensor data during detection phase
    rawValue = analogRead(mq7AnalogPin);
    voltage = rawValue * (5.0 / 1023.0);
    calculateCOConcentration();
    updateSafetyStatus();
    updateDisplay();
    
    // Print data to Serial Monitor
    Serial.print("Raw: ");
    Serial.print(rawValue);
    Serial.print(" | Voltage: ");
    Serial.print(voltage, 2);
    Serial.print("V | CO: ");
    Serial.print(coConcentration);
    Serial.print("ppm | Status: ");
    Serial.println(safetyStatus);
    
    isHeatingPhase = true;
  }
}

// Calculate estimated CO concentration (simplified model)
void calculateCOConcentration() {
  // This conversion is based on typical MQ-7 characteristics
  // For accuracy, calibrate with known CO concentrations
  
  // MQ-7 detects CO in the range of 10-1000 ppm
  // Lower voltage indicates higher CO concentration (unique to MQ-7)
  coConcentration = map(rawValue, 100, 800, 1000, 10);
  
  // Constrain values to realistic detection range
  coConcentration = constrain(coConcentration, 10, 1000);
}

// Update safety status based on CO concentration
void updateSafetyStatus() {
  if (coConcentration < 35) {
    safetyStatus = "Safe";  // Normal background levels
  } else if (coConcentration < 200) {
    safetyStatus = "Low Risk";  // Mild exposure risk
  } else if (coConcentration < 400) {
    safetyStatus = "High Risk";  // Dangerous exposure
  } else {
    safetyStatus = "Lethal Risk";  // Immediate danger
  }
}

// Update OLED display with sensor data
void updateDisplay() {
  display.clearDisplay();
  
  // Display sensor type (top section)
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-7 Sensor");
  display.println("CO Detector");
  
  // Display voltage reading
  display.setTextSize(1);
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(voltage, 2);  // Show 2 decimal places
  display.print("V");
  
  // Display CO concentration (larger text for emphasis)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("CO: ");
  display.print((int)coConcentration);  // Show as integer
  display.print("ppm");
  
  // Display safety status
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Status: ");
  display.print(safetyStatus);
  
  // Update physical display
  display.display();
}
    
				
			

MQ-8 Hydrogen gas sensor Module Arduino code

				
					/*
  MQ-8 Hydrogen Sensor with 0.96" OLED Display
  Detects: Hydrogen (H₂) - highly flammable gas
  Hardware: Arduino (Uno/Nano), MQ-8 Sensor, 0.96" I2C OLED (SSD1306)
  
  Wiring Connections:
  - MQ-8 Sensor:
    VCC → 5V (Required for proper heater operation)
    GND → GND
    AO  → A0 (Analog output for continuous concentration readings)
    DO  → Not used (Digital output for threshold alarms, optional)
    HEATER → D2 (Heater control pin for temperature cycling)
  
  - OLED Display (I2C):
    VCC → 3.3V (Recommended, check display specs for 5V compatibility)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data pin)
    SCL → A5 (Arduino Uno/Nano I2C clock pin)
*/

#include <Wire.h>               // For I2C communication
#include <Adafruit_GFX.h>       // Core graphics library
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED displays

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-8 Sensor pin definitions
const int mq8AnalogPin = A0;    // Analog output pin
const int mq8HeaterPin = 2;     // Heater control pin (critical for MQ-8)

// Variables to store sensor data
int rawValue;             // Raw analog reading (0-1023)
float voltage;            // Converted voltage (0-5V)
float h2Concentration;    // Estimated hydrogen concentration (ppm)
String gasStatus;         // Gas level status description
bool isDetectionPhase = false; // Track heating cycle phase

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display fails to initialize
  }
  
  // Configure heater pin as output
  pinMode(mq8HeaterPin, OUTPUT);
  
  // Clear display buffer
  display.clearDisplay();
  
  // Display initialization message
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-8 Initializing");
  display.println("Warming up...");
  display.display();
  
  // MQ-8 requires 10-20 minutes initial warm-up
  // Initial heating at high temperature
  digitalWrite(mq8HeaterPin, HIGH);  // 5V heating
  delay(600000);  // 10 minutes (600000 milliseconds)
  
  // Clear display after warm-up
  display.clearDisplay();
  Serial.println("MQ-8 Sensor Ready");
}

void loop() {
  // MQ-8 requires dual-temperature cycling:
  // 1. Low temperature (1.5V) for 60 seconds - detection phase
  // 2. High temperature (5V) for 30 seconds - cleaning phase
  
  if (isDetectionPhase) {
    // Low temperature detection phase (1.5V)
    digitalWrite(mq8HeaterPin, LOW);
    delay(60000);  // 60 seconds stabilization
    
    // Read sensor data during detection phase
    rawValue = analogRead(mq8AnalogPin);
    voltage = rawValue * (5.0 / 1023.0);
    calculateHydrogenConcentration();
    updateGasStatus();
    updateDisplay();
    
    // Print data to Serial Monitor
    Serial.print("Raw: ");
    Serial.print(rawValue);
    Serial.print(" | Voltage: ");
    Serial.print(voltage, 2);
    Serial.print("V | H2: ");
    Serial.print(h2Concentration);
    Serial.print("ppm | Status: ");
    Serial.println(gasStatus);
    
    isDetectionPhase = false;
  } else {
    // High temperature cleaning phase (5V)
    digitalWrite(mq8HeaterPin, HIGH);
    display.clearDisplay();
    display.setTextSize(1);
    display.setCursor(0, 20);
    display.println("Cleaning phase...");
    display.display();
    delay(30000);  // 30 seconds
    isDetectionPhase = true;
  }
}

// Calculate estimated hydrogen concentration (simplified model)
void calculateHydrogenConcentration() {
  // This conversion is based on typical MQ-8 characteristics
  // For accuracy, calibrate with known hydrogen concentrations
  
  // MQ-8 detects hydrogen in the range of 100-10000 ppm
  // Voltage increases with higher hydrogen concentration
  h2Concentration = map(rawValue, 200, 900, 100, 10000);
  
  // Constrain values to realistic detection range
  h2Concentration = constrain(h2Concentration, 100, 10000);
}

// Update gas status based on hydrogen concentration
void updateGasStatus() {
  // Hydrogen's lower explosive limit (LEL) is 40,000 ppm (4%)
  if (h2Concentration < 1000) {
    gasStatus = "Normal";
  } else if (h2Concentration < 5000) {
    gasStatus = "Low Level";
  } else if (h2Concentration < 20000) {
    gasStatus = "High Level";
  } else {
    gasStatus = "Explosive Risk";
  }
}

// Update OLED display with sensor data
void updateDisplay() {
  display.clearDisplay();
  
  // Display sensor type (top section)
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-8 Sensor");
  display.println("Hydrogen Detector");
  
  // Display voltage reading
  display.setTextSize(1);
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(voltage, 2);  // Show 2 decimal places
  display.print("V");
  
  // Display hydrogen concentration (larger text for emphasis)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("H2: ");
  display.print((int)h2Concentration);  // Show as integer
  display.print("ppm");
  
  // Display gas status
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Status: ");
  display.print(gasStatus);
  
  // Update physical display
  display.display();
}
    
				
			

MQ-9 Flammable gas sensor Module Arduino code

				
					/*
  MQ-9 Gas Sensor with Arduino & 0.96" OLED Display
  Description: This code reads CO (Carbon Monoxide) and combustible gas concentrations
  from an MQ-9 sensor and displays the data on a 0.96" I2C OLED display (SSD1306).
  
  Hardware Connections:
  - MQ-9 Sensor:
    VCC → 5V (Critical for proper heater operation)
    GND → GND
    AO  → A0 (Analog output)
    DO  → D3 (Digital output, not used in this code)
    H   → D2 (Heater control pin)
  
  - OLED Display (I2C):
    VCC → 3.3V (Recommended to prevent damage)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data line)
    SCL → A5 (Arduino Uno/Nano I2C clock line)
  
  Important Notes:
  - MQ-9 requires 10-15 minutes of initial warm-up time
  - Uses temperature cycling (low for CO detection, high for cleaning)
  - Calibrate in fresh air for accurate readings
*/

#include <Wire.h>                  // For I2C communication
#include <Adafruit_GFX.h>          // Core graphics library
#include <Adafruit_SSD1306.h>      // SSD1306 OLED display library

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH  128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-9 Sensor Pins
const int MQ9_AO_PIN = A0;         // Analog output pin
const int MQ9_HEATER_PIN = 2;      // Heater control pin

// Global variables
int rawValue;                      // Raw analog reading (0-1023)
float voltage;                     // Converted voltage (0-5V)
float coPPM;                       // Carbon Monoxide concentration in ppm
String statusMessage;              // Safety status message
bool isHeatingPhase = false;       // Track heating cycle phase
unsigned long phaseStartTime;      // Track cycle timing

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display fails to initialize
  }
  
  // Configure pin modes
  pinMode(MQ9_AO_PIN, INPUT);
  pinMode(MQ9_HEATER_PIN, OUTPUT);
  
  // Initialize display
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-9 Initializing");
  display.println("Warm-up: 10 min");
  display.display();
  
  // Initial heater activation (required for MQ-9)
  digitalWrite(MQ9_HEATER_PIN, HIGH);
  delay(600000);  // 10-minute initial warm-up (600000 ms)
  
  // Start detection cycle
  phaseStartTime = millis();
  isHeatingPhase = false;  // Start with detection phase
  digitalWrite(MQ9_HEATER_PIN, LOW);  // Low temperature for CO detection
  
  display.clearDisplay();
  display.println("System Ready");
  display.display();
  delay(2000);
}

void loop() {
  // MQ-9 requires temperature cycling:
  // - 60 seconds low temperature (1.5V) for CO detection
  // - 90 seconds high temperature (5V) for cleaning/combustible gas detection
  
  unsigned long currentTime = millis();
  
  if (isHeatingPhase) {
    // High temperature phase - cleaning cycle
    if (currentTime - phaseStartTime >= 90000) {  // 90 seconds
      // Switch to detection phase
      isHeatingPhase = false;
      digitalWrite(MQ9_HEATER_PIN, LOW);
      phaseStartTime = currentTime;
      display.clearDisplay();
      display.println("CO Detection Phase");
      display.display();
    }
  } else {
    // Low temperature phase - CO detection
    if (currentTime - phaseStartTime >= 60000) {  // 60 seconds
      // Read and process sensor data
      readSensorData();
      calculateCOConcentration();
      determineStatus();
      updateDisplay();
      logToSerial();
      
      // Switch to heating phase
      isHeatingPhase = true;
      digitalWrite(MQ9_HEATER_PIN, HIGH);
      phaseStartTime = currentTime;
      display.clearDisplay();
      display.println("Heating Phase");
      display.println("Cleaning...");
      display.display();
    }
  }
}

// Read raw analog value and convert to voltage
void readSensorData() {
  rawValue = analogRead(MQ9_AO_PIN);
  // Convert ADC value (0-1023) to voltage (0-5V)
  voltage = rawValue * (5.0 / 1023.0);
}

// Calculate CO concentration in ppm
void calculateCOConcentration() {
  // This is a simplified conversion based on typical MQ-9 characteristics
  // For accurate measurements, calibrate with known concentrations
  
  // MQ-9 detects CO in 10-2000 ppm range
  // Higher voltage indicates higher concentration
  coPPM = map(rawValue, 150, 900, 10, 2000);
  
  // Constrain values to realistic range
  coPPM = constrain(coPPM, 10, 2000);
}

// Determine safety status based on CO concentration
void determineStatus() {
  if (coPPM < 35) {
    statusMessage = "Safe";
  } else if (coPPM < 200) {
    statusMessage = "Low Risk";
  } else if (coPPM < 400) {
    statusMessage = "High Risk";
  } else {
    statusMessage = "DANGER!";
  }
}

// Update OLED display with sensor data
void updateDisplay() {
  display.clearDisplay();
  
  // Display header
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-9 Sensor");
  display.println("CO Monitor");
  
  // Display voltage
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(voltage, 2);
  display.print("V");
  
  // Display CO concentration (larger text)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("CO: ");
  display.print((int)coPPM);
  display.print("ppm");
  
  // Display status
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Status: ");
  display.print(statusMessage);
  
  // Update physical display
  display.display();
}

// Log data to serial monitor for debugging
void logToSerial() {
  Serial.println("----- Sensor Reading -----");
  Serial.print("Raw Value: ");
  Serial.println(rawValue);
  Serial.print("Voltage: ");
  Serial.print(voltage, 2);
  Serial.println("V");
  Serial.print("CO Concentration: ");
  Serial.print(coPPM, 1);
  Serial.println(" ppm");
  Serial.print("Status: ");
  Serial.println(statusMessage);
  Serial.println("--------------------------\n");
}
    
				
			

MQ-135 Air quality sensor Module Arduino code

				
					/*
  MQ-135 Air Quality Sensor with 0.96" OLED Display
  Detects: Multiple gases including CO, CO₂, NH₃, benzene, alcohol, and smoke
  Hardware: Arduino (Uno/Nano), MQ-135 Sensor, 0.96" I2C OLED (SSD1306)
  
  Wiring Connections:
  - MQ-135 Sensor:
    VCC → 5V (Recommended for stable operation)
    GND → GND
    AO  → A0 (Analog output for continuous readings)
    DO  → Not used (Digital output for threshold alarms, optional)
  
  - OLED Display (I2C):
    VCC → 3.3V (Recommended, check display specs for 5V compatibility)
    GND → GND
    SDA → A4 (Arduino Uno/Nano I2C data pin)
    SCL → A5 (Arduino Uno/Nano I2C clock pin)
*/

#include <Wire.h>               // For I2C communication
#include <Adafruit_GFX.h>       // Core graphics library
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED displays

// OLED display configuration (128x64 pixels)
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// MQ-135 Sensor pin definition
const int mq135AnalogPin = A0;

// Variables to store sensor data
int rawValue;               // Raw analog reading (0-1023)
float voltage;              // Converted voltage (0-5V)
float airQualityIndex;      // Simplified air quality index (0-500)
String qualityDescription;  // Air quality status description

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Initialize OLED display
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {  // 0x3C is default I2C address
    Serial.println(F("SSD1306 allocation failed. Check wiring!"));
    for(;;);  // Halt program if display fails to initialize
  }
  
  // Clear display buffer
  display.clearDisplay();
  
  // Display initialization message
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("MQ-135 Initializing");
  display.println("Warming up...");
  display.display();
  
  // MQ-135 requires 2-3 minutes warm-up time for stable readings
  delay(120000);  // 2 minutes (120000 milliseconds)
  
  // Clear display after warm-up
  display.clearDisplay();
  Serial.println("MQ-135 Sensor Ready");
}

void loop() {
  // Read raw analog value from MQ-135 sensor
  rawValue = analogRead(mq135AnalogPin);
  
  // Convert raw value to voltage (0-5V range)
  voltage = rawValue * (5.0 / 1023.0);
  
  // Calculate simplified air quality index
  calculateAirQualityIndex();
  
  // Determine air quality description
  updateQualityDescription();
  
  // Update OLED display with current readings
  updateDisplay();
  
  // Print data to Serial Monitor for debugging
  Serial.print("Raw: ");
  Serial.print(rawValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage, 2);
  Serial.print("V | AQI: ");
  Serial.print(airQualityIndex);
  Serial.print(" | Status: ");
  Serial.println(qualityDescription);
  
  // Update readings every 2 seconds
  delay(2000);
}

// Calculate simplified air quality index (AQI)
void calculateAirQualityIndex() {
  // This is a simplified model based on typical MQ-135 behavior
  // For accuracy, calibrate in known air quality conditions
  
  // MQ-135 output correlates with overall air pollution
  // Higher voltage indicates poorer air quality
  airQualityIndex = map(rawValue, 100, 900, 0, 500);
  
  // Constrain values to standard AQI range (0-500)
  airQualityIndex = constrain(airQualityIndex, 0, 500);
}

// Update air quality description based on AQI
void updateQualityDescription() {
  // Based on EPA standard AQI categories
  if (airQualityIndex <= 50) {
    qualityDescription = "Good";
  } else if (airQualityIndex <= 100) {
    qualityDescription = "Moderate";
  } else if (airQualityIndex <= 150) {
    qualityDescription = "Unhealthy (Sensitive)";
  } else if (airQualityIndex <= 200) {
    qualityDescription = "Unhealthy";
  } else if (airQualityIndex <= 300) {
    qualityDescription = "Very Unhealthy";
  } else {
    qualityDescription = "Hazardous";
  }
}

// Update OLED display with sensor data
void updateDisplay() {
  display.clearDisplay();
  
  // Display sensor type (top section)
  display.setTextSize(1);
  display.setCursor(0, 0);
  display.println("MQ-135 Sensor");
  display.println("Air Quality Monitor");
  
  // Display voltage reading
  display.setTextSize(1);
  display.setCursor(0, 20);
  display.print("Voltage: ");
  display.print(voltage, 2);  // Show 2 decimal places
  display.print("V");
  
  // Display air quality index (larger text for emphasis)
  display.setTextSize(2);
  display.setCursor(0, 32);
  display.print("AQI: ");
  display.print((int)airQualityIndex);  // Show as integer
  
  // Display quality description (truncated for space)
  display.setTextSize(1);
  display.setCursor(0, 52);
  display.print("Status: ");
  display.print(qualityDescription.substring(0, 15));  // Show first 15 characters
  
  // Update physical display
  display.display();
}
    
				
			

How to Select the Appropriate MQ Sensor?

  1. Clarify the Core Detection Target: “What gas needs to be detected?”

The key difference between MQ sensors lies in their sensitivity to specific gases. The first step is to clearly identify the target gas(es) you need to detect:

  • For carbon monoxide (CO): Prioritize MQ-7 (more specific) or MQ-9 (can detect combustible gases simultaneously);
  • For natural gas/methane (CH₄): Choose MQ-4 or MQ-9;
  • For LPG/propane/butane: Choose MQ-2, MQ-5, or MQ-6;
  • For alcohol vapor: Choose MQ-3;
  • For hydrogen (H₂): Choose MQ-8;
  • For comprehensive air quality monitoring (e.g., CO, formaldehyde, smoke, and other pollutants): Choose MQ-135 (broad-spectrum detection).

Note: Some models can detect multiple gases (e.g., MQ-9 detects both CO and methane) but with slightly lower specificity. Decide based on whether you need to distinguish between gases.

  1. Determine the Detection Concentration Range: “What concentration levels need to be measured?”

Each MQ sensor has an effective detection range, which must match the potential gas concentrations in your actual scenario:

  • Home safety scenarios (e.g., gas leaks): Typically require low-concentration detection (e.g., methane 300–10000 ppm, CO 10–1000 ppm), corresponding to MQ-4 or MQ-7;
  • Industrial environments (e.g., pipeline leaks): May require higher concentration detection (e.g., LPG 200–10000 ppm), corresponding to MQ-5 or MQ-6;
  • Air quality assessment: Needs a wide range (e.g., MQ-135 can detect various gases at ppm-level concentrations).

Reference: The sensor datasheet will clearly mark the “Detection Range.” Ensure your target concentration falls within this range (avoid exceeding the range, as it may invalidate data).

  1. Evaluate Sensitivity and Anti-Interference: “Can it accurately identify the target gas?”
  • Sensitivity: Prioritize models with stronger responses to your target gas. For example, MQ-3 is far more sensitive to alcohol than other gases, making it suitable for drunk driving detection; MQ-135 responds to multiple gases, making it ideal for comprehensive assessment but not precise single-gas measurement.
  • Anti-interference: Note whether the sensor is easily affected by “interfering gases.” For example, MQ-2 is sensitive to both smoke and gas. In smoke-prone environments (e.g., kitchens), it may falsely alarm for gas leaks. In such cases, use algorithmic filtering or choose a more specific model (e.g., MQ-5 for LPG).
  1. Pay Attention to Operating Conditions: “Is the power supply and heating method compatible?”

MQ sensors rely on heating reactions in metal oxide semiconductors. Different models have significantly different heating requirements, directly affecting circuit design and power consumption:

 

Heating TypeCharacteristicsRepresentative ModelsSuitable Scenarios
Continuous heatingRequires constant heating power (usually 5V); simple circuit but higher power consumption.MQ-2
MQ-4
MQ-135
Fixed-power devices (e.g., home alarms)
High-low temperature cyclingAlternates heating temperatures (detection phase + cleaning phase); requires additional circuit control; fluctuating power consumption.MQ-7
MQ-9
MQ-8
High-precision detection (e.g., CO, hydrogen)

 

  • For battery-powered devices (e.g., portable detectors): Prioritize low-power models or those without cycling heating (e.g., MQ-6, MQ-135) to avoid frequent recharging;
  • For fixed devices (e.g., wall-mounted alarms): Choose continuous or cycling heating models, focusing more on detection stability.
  1. Adapt to Environmental Factors: “Will the usage environment affect accuracy?”

MQ sensor performance is easily influenced by environmental factors. Evaluate your usage scenario in advance:

  • Temperature: Most MQ sensors work best at 20–30°C. Extreme high temperatures (>50°C) or low temperatures (<0°C) reduce sensitivity. Add temperature compensation in the circuit or choose temperature-resistant models for such environments;
  • Humidity: High humidity (>80% RH) interferes with gas reactions on the semiconductor surface, potentially causing reading drift. In humid environments (e.g., kitchens, bathrooms), use moisture-resistant sensors or add dehumidification measures;
  • Other interference: Environments with heavy oil fumes or dust (e.g., factory workshops) may contaminate the sensor surface. Regular cleaning or models with better protection are recommended.
  1. Consider Response Speed and Recovery Time: “Do you need fast alarms or precise measurements?”
  • Response time: The time for the sensor to reach stable readings after contact with gas (usually seconds to tens of seconds). For safety alarm scenarios (e.g., gas leaks), prioritize fast-response models (e.g., MQ-5 has a <10-second response time for LPG);
  • Recovery time: The time for the sensor to return to baseline after removing the gas source. For frequent detection (e.g., real-time monitoring), choose models with short recovery times (e.g., MQ-135 has a <30-second recovery time).
  1. Calibration Requirements: “Is high precision needed? Can calibration be performed?”

All MQ sensors are pre-calibrated at the factory, but re-calibration in the actual environment is required to ensure accuracy:

  • For qualitative detection (e.g., “leak or no leak”): Calibration requirements are low, achievable by simply comparing with an air baseline;
  • For quantitative detection (e.g., “specific concentration values”): Strictly follow the datasheet for calibration (usually with standard gases or known-concentration environments) and recheck regularly (every 3–6 months is recommended).
    Tip: Beginners or non-professional scenarios can prioritize models that don’t require complex calibration (e.g., MQ-135). Professional scenarios need supporting calibration equipment.
  1. Match Engineering Constraints of the Application: “Are size, cost, and documentation compatible?”
  • Size: For miniaturized devices (e.g., portable detectors), choose small-package models (most MQ sensors use standard DIP packages with similar sizes);
  • Cost: MQ series sensors are affordable (usually tens of yuan), but consider supporting circuit costs (e.g., heating control circuits, filter circuits);
  • Technical documentation: Beginners should choose widely used models with rich 资料 (e.g., MQ-2, MQ-135, MQ-9), as they have more open-source projects, tutorials, and community support for easier debugging.
  1. Final Step: Review the Datasheet for Details

Regardless of the model initially selected, always consult the official datasheet to confirm these key parameters:

  • Recommended operating voltage and heating current;
  • Typical circuit design (e.g., load resistance, heating control method);
  • Accuracy impact curves for temperature/humidity;
  • Calibration steps and recommended methods.

Gas Detection and Alarm System Based on Arduino and MQ-9

FAQ

What is the purpose of a gas sensor?

A gas sensor converts gas composition and concentration into electrical signals, with its core function being real-time monitoring of specific gases. Its application fields include:

1. Safety Protection and Early Warning

  • Detect combustible gases (natural gas, liquefied petroleum gas, etc.) to prevent explosions; monitor toxic gases (carbon monoxide, etc.) to avoid poisoning; measure oxygen levels in confined spaces (mines, tunnels) to prevent hypoxia or oxygen enrichment hazards.

2. Environmental Monitoring and Assessment

  • Indoor: Detect pollutants like formaldehyde and TVOC; outdoor: monitor atmospheric pollutants (sulfur dioxide, ozone, etc.) for environmental protection; special scenarios: track odorous gases in waste plants and carbon dioxide in agricultural greenhouses.

3. Industrial Process Control

  • Regulate gas concentrations in production (e.g., chemical reactions, metallurgy) to optimize processes; detect leaks in pipelines/tanks to reduce waste; monitor combustible gases in explosion-proof areas to ensure safety compliance.

4. Medical and Biological Monitoring

  • Analyze exhaled gases (alcohol for drunk driving, acetone for diabetes screening) to assist diagnosis; monitor disinfection gases in hospitals; evaluate microbial activity via fermentation gas analysis.

5. Smart Home and Consumer Electronics

  • Link devices to auto-handle gas leaks or formaldehyde overexposure; integrate sensors in wearables for gas-based health advice; use in vehicles to control air circulation and prevent drunk driving.

6. Agriculture and Food Industry

  • Measure greenhouse carbon dioxide to boost crop growth and grain depot phosphine for storage safety; regulate fruit/vegetable preservation via ethylene detection and assess food freshness through spoilage gases.

Portable Gas Detector & MQ Sensor

1. What is a portable gas detector, and what is its main function?

A portable gas detector is a compact, easy-to-carry device designed to provide real-time on-site monitoring of gas concentrations. Its main function is to detect combustible, toxic, or harmful gases in environments such as industrial sites, homes, or outdoor spaces, alerting users via alarms when gas levels exceed safety thresholds to prevent accidents.

2. What role does an MQ sensor play in portable gas detectors?

MQ sensors are core components in many portable gas detectors. As cost-effective and reliable gas-sensing elements, they excel at detecting common gases like methane, propane, carbon monoxide, and formaldehyde. Their high sensitivity and quick response enable detectors to accurately identify gas presence and concentration, ensuring timely safety alerts.

3. Which industries or scenarios rely on portable gas detectors with MQ sensors?

They are essential in industries such as petrochemicals, mining, and construction for leak detection. They also serve home safety (e.g., gas leak checks), indoor air quality testing, and emergency rescue missions, providing efficient gas monitoring to safeguard health and meet compliance needs.

Electrochemical Gas Sensor & MQ Sensor

1. What are electrochemical gas sensors and MQ sensors?

Electrochemical gas sensors are high-precision devices that use electrochemical reactions to detect specific toxic or harmful gases (e.g., carbon monoxide, hydrogen sulfide). They offer high selectivity and accuracy, ideal for low-concentration toxic gas monitoring.
MQ sensors are semiconductor-based gas-sensing components, cost-effective and versatile, mainly used to detect combustible gases (methane, propane) and volatile organic compounds (formaldehyde, benzene) with quick response and wide applicability.

2. What are the key differences between them?

Electrochemical sensors excel in toxic gas detection with high precision and low cross-sensitivity but have a narrower detection range and higher cost. MQ sensors are more affordable, suitable for general gas monitoring, but may have lower selectivity, requiring calibration for complex environments.

3. Which scenarios are they suitable for?

Electrochemical sensors are widely used in industrial toxic gas monitoring, medical environments, and confined space safety checks. MQ sensors are common in portable detectors, smart home devices, and indoor air quality monitors for combustible gas or VOC detection.

Honeywell Gas Detector & MQ Sensor

1. What is a Honeywell gas detector, and what advantages does it offer?

Honeywell gas detectors are professional gas monitoring devices known for high reliability and precision. Designed for industrial, commercial, and residential safety, they detect combustible, toxic gases, and oxygen levels. Honeywell’s strengths lie in advanced sensing technology, durable builds, and seamless integration with safety systems, ensuring accurate alerts and compliance with global safety standards.

2. Do Honeywell gas detectors use MQ sensors?

Some entry-level or portable Honeywell detectors may integrate MQ sensors, especially for cost-effective monitoring of common gases like methane or formaldehyde. MQ sensors, as semiconductor-based components, provide quick response and wide applicability, making them suitable for general gas detection scenarios where high precision for rare toxic gases is not required.

3. How to choose between Honeywell detectors with MQ sensors and other models?

For basic needs like home gas leak checks or indoor VOC monitoring, Honeywell detectors with MQ sensors offer a budget-friendly, reliable solution. For industrial toxic gas monitoring or high-precision scenarios (e.g., hydrogen sulfide, chlorine), opt for Honeywell models with electrochemical or catalytic sensors for enhanced accuracy and selectivity.

Arduino Gas Sensors & MQ Sensors

1. What are the advantages of gas detection systems built with Arduino and MQ sensors?

Gas detection systems based on Arduino and MQ sensors combine low cost and high flexibility, making them ideal for beginner developers and DIY projects. MQ sensors (such as MQ-2 and MQ-135) are affordable, and their output signals are easily readable by Arduino. Paired with open-source development boards, they enable quick implementation of gas monitoring functions without complex hardware knowledge, serving as a perfect combination for learning IoT and environmental sensing technologies.

2. How to choose the right MQ sensor model for Arduino projects?

Select based on target gases:
  • MQ-2: Detects smoke, propane, methane, etc., suitable for gas leak or fire alarm projects.
  • MQ-135: Covers formaldehyde, benzene, TVOC, etc., used for indoor air quality monitoring.
  • MQ-4: Specialized in methane detection, ideal for natural gas leak scenarios.
  • MQ-7: Optimized for carbon monoxide, suitable for preventing gas poisoning.
    All are analog output sensors, directly connectable to Arduino’s analog pins (e.g., A0).

3. What components and steps are needed to build a basic detection system?

Required components: Arduino board (e.g., Uno), MQ sensor, breadboard, jumper wires, resistors (for some models).
Basic steps:
  1. Connect the circuit according to the datasheet (VCC to 5V, GND to GND, AO to analog pin);
  2. Write code to read sensor analog values (using analogRead() function);
  3. Convert values to gas concentration or set alarm thresholds after calibration;
  4. Display real-time data via serial monitor or connected screen.

4. What are the typical applications of such systems?

Suitable for low-cost monitoring scenarios:
  • Homemade household gas leak alarms (MQ-2/MQ-4);
  • Indoor formaldehyde/TVOC monitors (MQ-135);
  • Simple toxic gas warning devices for laboratories;
  • Ammonia detection in smart flowerpots (to prevent excessive fertilization).
    Remote data transmission can be achieved by adding modules like WiFi.

Gas Leak Sensor & MQ Sensor

1. What is a gas leak sensor, and how does it work with MQ sensors?

A gas leak sensor is a device designed to detect unintended gas releases (e.g., natural gas, propane) and trigger alerts. MQ sensors, as core components in many gas leak sensors, play a key role: they use semiconductor materials to react to combustible or toxic gases, changing their resistance when exposed to target gases. This resistance change is converted into electrical signals, enabling the sensor to identify leaks.

2. Which MQ sensor models are best for gas leak detection?

  • MQ-2: Versatile for detecting methane, propane, and smoke, ideal for general gas leak and fire prevention.
  • MQ-4: Optimized for methane (main component of natural gas), offering high sensitivity for household gas leak monitoring.
  • MQ-6: Focuses on propane and butane, suitable for liquefied petroleum gas (LPG) leak detection in kitchens or factories.

3. How to install and maintain MQ-based gas leak sensors?

Install near gas sources (e.g., stoves, pipelines) but avoid direct heat or moisture. Preheat the sensor for 10-30 minutes before use. Regularly calibrate in clean air to ensure accuracy. Replace sensors every 1-2 years (depending on usage) as MQ sensors may drift over time. Test alarms monthly to confirm functionality.

Relevant materials

Purchase link

Leave a Reply

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