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.
Community draft — report a mistake
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
| Pin | What it does |
|---|---|
VCC | 5 V supply — the heater draws about 150 mA |
GND | Ground |
DO | Comparator output: changes state when the reading crosses the pot setting |
AO | Analog 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.