Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

MQ-9 CO and combustible gas sensor module

MQ-9 module pinout for carbon monoxide, methane and LPG, the 5 V / 1.5 V heater cycle, keeping AO under 3.3 V on ESP32, and its limits as an alarm.

Analog

Community draft — report a mistake

CategorySensor
InterfaceAnalog
Voltage5 V (heater: about 150 mA)
Typical price₹180

3.3 V or 5 V? The heater needs 5 V. AO can reach about 5 V, so on ESP32 and Pico feed AO through a 10 kΩ / 20 kΩ divider to stay under 3.3 V. DO is driven from VCC — divide it on 3.3 V boards too.

The MQ-9 is a tin-dioxide sensor that responds to carbon monoxide (about 10–1000 ppm) and to combustible gases such as methane and LPG (about 100–10 000 ppm). Which one it favours depends on heater temperature: hot (5 V) for combustible gas, cooler (1.5 V) for CO.

The common blue or red module ties the heater to a constant 5 V, so out of the box it works as a combustible-gas detector. To use the CO side properly, cycle the heater (5 V for 60 s, 1.5 V for 90 s) through a logic-level MOSFET and take readings at the end of each phase. Either way the output is a relative value, not calibrated ppm.

Not a certified safety device. A DIY MQ-9 is a helpful extra warning, not a replacement for a certified CO or gas detector. For an LPG leak: no switches, no flames, open windows, close the cylinder valve.

Prices are indicative (Nov 2026) and vary by seller.

Pinout

PinWhat it does
VCC5 V supply — the heater draws about 150 mA
GNDGround
DOComparator output: changes state when the reading crosses the pot setting
AOAnalog output rising with gas concentration (0–~5 V)

Common errors

Can’t tell CO from LPG

On the module the heater sits at a constant 5 V, where the MQ-9 mainly sees methane and LPG. CO is measured during the low-heat phase (1.5 V for 90 s). To separate them, switch the heater with a MOSFET and read at the end of each phase.

Readings drift for the first day

New sensors need a 48-hour burn-in powered on; after that allow a few minutes of warm-up after each power-on.

Board browns out when the sensor is plugged in

The heater pulls about 150 mA. Power the module from a proper 5 V supply, not the 3.3 V pin or a weak USB port.

↑↓ to move · Enter to open