MQ-2 Gas Sensor

MQ-2 is a low-cost tin-dioxide (SnO2) semiconductor sensor that detects combustible gases and smoke (LPG, propane, methane, hydrogen, alcohol) and reports concentration as an analog voltage.

MQ-2 Gas Sensor: Smoke and combustible gas

What is the MQ-2 Gas Sensor?

The MQ-2 is a metal-oxide semiconductor (MOS) gas sensor built around a tin-dioxide (SnO2) sensing layer deposited on a small heated ceramic tube. It responds to a broad group of combustible gases and smoke, including LPG, propane, butane, methane, hydrogen, and alcohol vapor, across roughly 300 to 10,000 ppm. On the common breakout module the sensor is paired with support circuitry and exposed through four pins: VCC, GND, an analog output (AOUT), and a digital output (DOUT).

An internal heater keeps the SnO2 layer hot so gas molecules can react at its surface. When combustible (reducing) gas is present, the sensing resistance Rs drops, and the module converts that change into a rising voltage on AOUT that tracks concentration. A separate onboard LM393 comparator plus a blue trimmer potentiometer produce the DOUT signal, which simply flips state when the concentration crosses the threshold you dial in with the pot.

The MQ-2 measures relative gas concentration rather than calibrated ppm out of the box. Deriving an actual ppm figure requires establishing the sensor's clean-air baseline resistance (R0) and applying the per-gas sensitivity curves from the datasheet. It also needs warm-up time: the heater must stabilize before readings are trustworthy, and a brand-new sensor benefits from an extended initial burn-in before its baseline settles.

MQ-2 Gas Sensor pinout

PinFunctionType
AOUT AOUT / AOAnalog gas concentration voltageDigital output
DOUT DOUT / DODigital comparator threshold outputDigital output
GND GNDPowerPower in
VCC VCC (5V)PowerPower in

Specifications

Operating voltage
5 V (max 5.5 V)
Interface
analog
Dimensions
20.4 × 36.5 × 21.5 mm

Verified from the Tinkered component library · Hanwei / generic breakout module.

Circuit requirements

  • Power the module from 5V on VCC and GND (the verified maximum is 5.5V). The MQ-2 heater is designed for a 5.0V supply; running it below spec reduces sensitivity and skews readings.
  • Budget for heater current: the sensor's heater dissipates up to about 900mW (roughly 150mA at 5V), so the sensor body runs warm to the touch during normal operation. This is expected, but avoid powering it from a weak or heavily shared supply that can brown out.
  • AOUT is an analog signal: wire it to an Arduino analog (ADC) input. The voltage rises as combustible-gas concentration rises, because the internal Rs falls with increasing gas.
  • DOUT is a threshold flag, not a measurement. It is driven by the onboard LM393 comparator, and the blue trimmer potentiometer sets the trip point; the module supplies its own pull-up, so no external pull-up is needed.
  • The module outputs at 5V logic. It pairs directly with 5V Arduino boards; on a 3.3V board, level-shift or divide DOUT and keep AOUT within the ADC's input range.
  • Allow the sensor to warm up before trusting readings. It needs a short stabilization period after power-up, and a fresh or long-stored sensor should be left running for an extended burn-in so its baseline stops drifting.

Board compatibility

The MQ-2 Gas Sensor connects to any of the microcontrollers supported in Tinkered. Mind the 5 V logic level on 3.3 V boards.

Common MQ-2 Gas Sensor mistakes

Expecting calibrated ppm straight away

The MQ-2 outputs a relative signal, not a ready-made ppm value. To estimate concentration you must first measure the clean-air baseline resistance (R0), then apply the datasheet's Rs/R0 sensitivity curve for the specific gas you care about.

Reading it before warm-up

The heated SnO2 layer needs time to stabilize. Values drift noticeably for the first seconds to minutes after power-up, and a brand-new sensor needs a long initial burn-in. Sampling immediately gives readings that keep sliding as the element heats.

Confusing DOUT with concentration

DOUT is only a comparator flag whose trip level you set with the onboard potentiometer. It tells you 'above/below the threshold,' not how much gas is present. Use AOUT and the ADC when you actually want to measure or graph concentration.

Underpowering the heater

The heater pulls around 150mA and needs a steady 5V. Running several sensors, or the sensor plus other loads, from a thin USB cable or shared regulator causes voltage sag, unstable readings, and resets.

Treating it as a specific-gas identifier

The MQ-2 is broadband: it responds to LPG, propane, methane, hydrogen, alcohol, and smoke together and cannot tell them apart. A high reading means 'combustible gas or smoke present,' not which gas it is.

MQ-2 Gas Sensor datasheet

Official MQ-2 Gas Sensor datasheetHanwei / generic breakout module

Popular MQ-2 Gas Sensor projects

Smoke and fire early-warning alarm

Read AOUT with an Arduino and sound a buzzer and flash an LED when the level crosses a set point, giving an early alert for smoke or a smoldering fault.

LPG and propane leak detector

Mount the sensor near a stove or gas line and trigger an alarm or a relay-driven shutoff when combustible-gas concentration climbs above a safe threshold.

Combustible-gas monitor with live display

Show the analog reading in real time on an LCD or OLED and log the trend, useful for watching air quality in a workshop or enclosed space.

Wi-Fi gas alert node

Pair the MQ-2 with an ESP-class board to push notifications or dashboard updates when gas or smoke is detected in an unattended room.

Build with the MQ-2 Gas Sensor.

Drop the MQ-2 Gas Sensor into a circuit, write firmware, and simulate it in your browser, then deploy to real hardware. All in one editable Tinkered project.