ESP32 + MQ-2: Gas and Smoke Sensor (Quick Test Sample Code)
Intermediate4/7/2026- Author: IoTSpark Maker

ESP32 + MQ-2: Gas and Smoke Sensor (Quick Test Sample Code)

The MQ-2 is an SnO2 (tin oxide) semiconductor sensor — when exposed to combustible gas (LPG, methane, propane) or smoke, the SnO2 surface's resistance changes, producing an analog signal proportional to concentration.

mq-2khi-gaskhoi
4 steps2 components

The MQ-2 is an SnO2 (tin oxide) semiconductor sensor — when exposed to combustible gas (LPG, methane, propane) or smoke, the SnO2 surface's resistance changes, producing an analog signal proportional to gas concentration. It needs 24-48 hours of preheating the first time it's used for the SnO2 layer to stabilize — the biggest difference from the other sensors in this series.

Related Articles