Robot Pi Shop

MQ-4 Methane Gas Sensor

$1.99

Shipping calculated at checkout.

Quantity

The MQ-4 Methane Gas Sensor Module is a semiconductor gas detection sensor designed primarily for detecting methane (CH4) and natural gas in the surrounding environment. It is suitable for combustible gas monitoring prototypes, environmental sensing, and microcontroller-based electronics projects.

The MQ-4 uses a Metal Oxide Semiconductor (MOS) sensing element made from tin dioxide (SnO2). Its electrical resistance changes when exposed to methane, allowing the module to detect variations in gas concentration.

Featuring analog and digital outputs, an adjustable detection threshold, and a 5V operating voltage, the MQ-4 can be integrated with Arduino, ESP32, Raspberry Pi (with additional interfacing), and other compatible development boards.

The module is particularly useful for educational gas sensing experiments, IoT monitoring systems, and methane detection prototypes.

Key Features

  • Methane Detection: Designed primarily for detecting methane (CH4), the main component of natural gas.
  • CNG Detection Applications: Suitable for experimental monitoring of compressed natural gas containing methane.
  • High Methane Sensitivity: Designed to respond to methane concentrations within its specified detection range.
  • Reduced Cross-Sensitivity: Generally less sensitive to alcohol vapors and smoke than to methane under specified test conditions.
  • Analog Output (AO): Provides a variable voltage related to changes in gas concentration.
  • Digital Output (DO): Provides a HIGH/LOW signal when the adjustable threshold is reached.
  • Adjustable Detection Threshold: Onboard potentiometer allows digital trigger adjustment.
  • 5V Operating Voltage: Suitable for common microcontroller-based projects.
  • Onboard Indicator LEDs: Power and digital detection status indication, depending on module version.
  • Compact Design: Easy integration into embedded systems and electronic projects.

Technical Specifications

Specification Details
Product Model MQ-4
Sensor Type Semiconductor Gas Sensor
Sensor Technology Metal Oxide Semiconductor (MOS)
Sensing Material Tin Dioxide (SnO2)
Operating Voltage 5V DC
Primary Target Gas Methane (CH4)
Additional Application Natural Gas / CNG Detection
Typical Detection Range 200–10,000 ppm Methane
Analog Output Variable Voltage, Typically 0–5V
Digital Output HIGH/LOW, TTL Logic
Digital Output Levels Approximately 0V or 5V
Detection Threshold Adjustment Onboard Potentiometer
Interface Analog and Digital
Sensor Heating Internal Heating Element
Preheating Required for Stable Measurements
Module Type Gas Detection Module

Pin Configuration

Pin Description
VCC 5V DC Power Supply
GND Ground
AO Analog Gas Sensor Output
DO Digital Threshold Output

Arduino UNO Connection Example

MQ-4 Pin Arduino UNO
VCC 5V
GND GND
AO A0
DO D2 (Optional)

The Arduino can monitor changes in methane concentration using the analog output or detect when the adjustable digital threshold is reached.

ESP32 Connection Example

MQ-4 Pin ESP32
VCC 5V
GND GND
AO GPIO34 Through Voltage Divider
DO Digital GPIO Through Level Shifter

Important: The MQ-4 module operates at 5V, while ESP32 GPIO pins are designed for 3.3V logic. Use suitable voltage scaling or level shifting to prevent damage to the ESP32.

Raspberry Pi Compatibility

The MQ-4 can be connected to Raspberry Pi boards for methane detection experiments.

  • Analog Reading: Requires an external ADC module such as ADS1115 or MCP3008.
  • Digital Reading: Requires appropriate 5V-to-3.3V level shifting.
  • Power Supply: Requires a suitable 5V power source.

Applications

  • Methane gas detection experiments
  • Natural gas monitoring prototypes
  • CNG sensing demonstrations
  • Arduino and ESP32 gas detection projects
  • IoT environmental monitoring
  • Smart home gas monitoring prototypes
  • Industrial gas sensing experiments
  • Laboratory and educational projects
  • Robotics and embedded sensor systems
  • Automated ventilation research

Important Notes

  • The MQ-4 is primarily designed for methane detection, although other combustible gases may affect its readings.
  • The sensor cannot reliably identify methane independently when multiple interfering gases are present.
  • The analog output does not provide a direct ppm measurement. Accurate methane concentration estimates require calibration and appropriate conversion methods.
  • The onboard potentiometer adjusts the digital detection threshold, not the sensor's underlying sensitivity.
  • The sensor requires preheating before stable readings can be obtained. Initial conditioning may require extended operation according to manufacturer recommendations.
  • Temperature, humidity, and airflow can influence sensor readings.
  • The internal heating element becomes warm during operation.
  • Do not connect 5V output signals directly to 3.3V-only microcontroller GPIO pins.
  • The MQ-4 is intended for educational, experimental, and non-safety-critical monitoring applications.
  • This module is not a certified natural gas leak detector and must not replace approved gas safety alarms.

Package Includes

  • 1 × MQ-4 Methane Gas Sensor Module