π§ͺ Best Gas and VOC Sensors for ESP32
Indoor air quality, VOCs, carbon monoxide, smoke and multi-gas detection for ESPHome, Home Assistant and data logging projects. Here are 9 picks, from digital ENS160 and SGP30 breakouts to a calibrated electrochemical CO sensor and classic MQ-series modules.
Gas sensing is one of the most useful things you can add to an ESP32. With Wi-Fi and ESPHome you can log VOC levels from paint, cooking or a 3D printer, switch on an extractor fan when the air turns bad, or send a phone alert when a garage starts to fill with exhaust. The ESP32’s I2C bus, UART ports and ADC cover every sensor type on the market, so the only real question is which sensor matches the gas you care about.
That question matters more than most buyers expect. A cheap MQ module, a digital metal-oxide (MOX) chip and an electrochemical cell all claim to “detect gas”, but they work very differently and give very different quality of data. This guide compares 9 gas and VOC sensors that work with an ESP32 and explains what each one actually measures, how it connects and where it fits. If you need true CO2 readings, see our separate CO2 sensor guide linked at the end, because none of the MOX sensors here measure real CO2.
β‘ Quick Comparison: All 9 Gas and VOC Sensors
Specs come from the manufacturers and the live Amazon listings. Star scores below are our ratings.
π What Matters in an ESP32 Gas Sensor
Sensing Technology
MOX chips (ENS160, SGP30, MQ series) react to many gases at once and suit trends. Electrochemical cells target one gas and give calibrated ppm. MEMS boards like the MiCS-4514 sit in between.
Target Gas
VOCs from cleaning products and printers, CO from combustion, LPG and methane from leaks, NO2 from traffic. Pick the sensor built for your gas instead of a generic “air quality” module.
Interface and Voltage
I2C boards give processed values and share the bus with other sensors. Analog MQ modules need an ADC1 pin, a voltage divider and your own calibration code.
Heater Power and Warm-Up
MOX and MQ sensors heat a sensing element. MQ heaters draw far more current than an ESP32 itself and need minutes to stabilise, which rules them out for small batteries.
Calibration
Factory calibrated sensors report ppm out of the box. Uncalibrated MQ modules only show relative change until you calibrate them against a known reference.
π Detailed Reviews: The Top Two
π§ Detailed Reviews: More Gas Sensors
β Also Worth Considering
6. HiLetgo ENS160+AHT21 Air Quality Module
A low-cost board that pairs the same ENS160 MOX sensor as our top pick with an AHT21 temperature and humidity sensor on a shared I2C bus, so you get TVOC, eCO2, AQI and compensation data for a fraction of the cost of a branded breakout. HiLetgo sells it as a CCS811 replacement. There is no Qwiic connector, quality control on these generic boards varies and Amazon reviews are mixed, so test yours on the bench before building it into an enclosure.
Buy Here β7. HiLetgo MQ-135 Air Quality Sensor Module
The classic MQ-135 responds to ammonia, nitrogen oxides, benzene, smoke and other pollutants, and this module adds a comparator with a trim pot for a digital threshold output alongside the analog signal. It is the cheapest way to see when a room’s air gets worse. Power the heater from 5V, scale the analog output down to 3.3V with a divider before an ADC1 pin, and expect relative readings unless you calibrate it yourself.
Buy Here β8. MQ-2 Smoke and Combustible Gas Sensor Module
The MQ-2 is tuned for smoke, LPG, butane and hydrogen, which makes it the usual choice for gas leak and smoke detector experiments near a kitchen, camper stove or workshop heater. Like the MQ-135 it gives an analog output plus an adjustable digital alarm pin, needs a 5V heater supply and a warm-up period, and should feed the ESP32 through a voltage divider. Use it to trigger a fan or notification, never as your only smoke alarm.
Buy Here β9. Teyleten Robot MQ Series Gas Sensor Kit (9pcs)
Not sure which gas you will end up chasing? This kit includes nine modules: MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9 and MQ-135, covering smoke, alcohol, methane, natural gas, LPG, carbon monoxide, hydrogen and general air quality. It is ideal for a classroom or for comparing how each sensor reacts to the same source. All of them share the same 5V heater and analog output caveats as the single modules above.
Buy Here βπ Which Sensor for Which ESP32 Project?
π Which Gas Sensor Should You Buy?
Indoor air quality
The SparkFun ENS160 Qwiic, or the ENS160/BME280 Combo if you also want climate readings.
Carbon monoxide
The DFRobot Gravity CO sensor for calibrated ppm, alongside a certified CO alarm.
Several gases at once
The DFRobot MiCS-4514 for CO, NO2, NH3 and more over I2C.
Learning on a budget
The Teyleten MQ Kit or a single MQ-135 to understand how gas sensors behave.
β Frequently Asked Questions
Can I connect an MQ sensor directly to an ESP32?
Not safely in most cases. MQ modules are designed for 5V, and their analog output can rise close to 5V, which is above the ESP32’s 3.3V pin limit. Power the module from 5V, then use a simple resistor divider (for example 10k and 20k) on the analog output and connect it to an ADC1 pin such as GPIO 34. The digital threshold pin also needs level shifting if it swings to 5V.
Is eCO2 the same as a real CO2 reading?
No. The ENS160 and SGP30 estimate “equivalent CO2” from VOC and hydrogen levels. In a room full of people the two often move together, but cooking, cleaning sprays or alcohol will push eCO2 up even when real CO2 is normal. For true CO2 you need an NDIR or photoacoustic sensor such as the SCD41 or SenseAir S8.
How long do gas sensors need to warm up?
Digital MOX sensors such as the ENS160 and SGP30 give usable readings within minutes, but their baseline settles over hours to days of continuous operation. MQ sensors need several minutes of heater time before readings stabilise, and a long burn-in when new. Electrochemical cells like the DFRobot CO sensor also need time to settle after power-up, so ignore the first readings after a reboot.
Can I run a gas sensor from a battery with deep sleep?
Heated sensors make this hard. MQ modules draw a lot of current and need long warm-ups, so they are best on USB power. MOX chips can be duty cycled but lose accuracy when power cycled often. The electrochemical CO sensor, at under 5mA, is the best fit for battery logging, though it still needs settling time after waking.
Can an ESP32 gas sensor replace my smoke or CO alarm?
No. These are development sensors without safety certification, and a Wi-Fi project can crash, lose power or drop off the network. Keep certified smoke and CO alarms installed, and use your ESP32 build for logging, early warnings and automations like switching on ventilation.
π Final Verdict: Best Gas and VOC Sensors for ESP32
The right sensor for each job:
For most ESP32 projects, the SparkFun ENS160 Qwiic is the gas sensor to start with: processed TVOC, eCO2 and AQI values over a solderless I2C link. Choose the DFRobot Gravity CO sensor when you need calibrated carbon monoxide readings, the MiCS-4514 for multi-gas pollution work, and an MQ kit when you just want to learn. If you need true CO2 or particulate readings, see our CO2 and air quality sensors guide, pair your gas sensor with compensation data from the temperature and humidity sensors guide, switch an extractor fan with a board from our relay modules guide, and learn the bus basics in our ESP32 I2C tutorial with ESP-IDF.
π¬ Building a fume extractor controller, a garage CO logger or a pollution station? Tell us about it in the comments below, and we’ll help you pick the right sensor.
All Amazon links above use our affiliate tag (esp32tutorials-20). Purchasing through them supports esp32tutorials.com at no extra cost to you. Prices and availability change frequently, so always confirm the current price on Amazon before buying. The sensors in this guide are not certified safety alarms.
We are a team of experienced Embedded Software Developers with skills in developing Embedded Linux, RTOS, and IoT products from scratch to deployment with a demonstrated history of working in the embedded software industry. Contact us for your projects: admin@esp32tutorials.com





