Gas Sensors

Description

MQ-series gas sensors are semiconductor-based analog sensors designed to detect various gases including natural gas, propane, methane, hydrogen, and carbon monoxide. These sensors work by measuring resistance changes in a tin dioxide sensing layer when exposed to target gases. They are commonly used in DIY projects with microcontrollers like ESP8266 or ESP32 to create custom gas detection systems integrated with Home Assistant via ESPHome.

Device

Overview

My Implementation

Deployed MQ-5 sensors connected to ESP32 boards running ESPHome in my garage and basement utility room to detect natural gas leaks from furnace and water heater. Configured threshold-based binary sensors that trigger critical alerts to my phone and audible alarms when gas concentration exceeds 1000 ppm. Also monitor analog values on dashboard to track baseline levels and detect gradual changes indicating potential issues.

Device Score Summary

CategoryScoreRationale
Features★★★☆☆Provides gas detection capability at very low cost. Limited accuracy and gas specificity compared to professional sensors
Interoperability★★★★★Perfect Home Assistant integration via ESPHome. Fully local, fast updates, and complete control over calibration and thresholds
Setup Ease★★☆☆☆Requires electronics knowledge, soldering, ESPHome configuration, and calibration process. Not beginner-friendly but well-documented
Cloud Dependency★★★★★Completely local operation via ESPHome. Zero cloud dependency or external services required
Vendor Trust★☆☆☆☆Commodity sensors from various Chinese manufacturers with inconsistent quality. No support or warranty infrastructure
Overall★★★☆☆Excellent learning project and supplementary monitoring for DIY enthusiasts. Not suitable as primary safety device. Use with caution and maintain certified detectors

★★★★★ Exceptional | ★★★★☆ Very Good | ★★★☆☆ Good Enough | ★★☆☆☆ Frustrating | ★☆☆☆☆ Avoid

Features

  • Detects multiple combustible gases including methane, propane, butane, and hydrogen
  • Analog output proportional to gas concentration (0-5V or 0-3.3V)
  • Wide detection range: 300-10,000 ppm depending on gas type
  • Fast response time: less than 10 seconds for most gases
  • Long sensor lifespan: 5+ years with proper calibration
  • Adjustable sensitivity via onboard potentiometer
  • Low cost: typically $5-$15 per sensor module
  • Compatible with ESP8266, ESP32, Arduino, and Raspberry Pi platforms

Specifications

Price$5-$15 per sensor module
ProtocolWiFi (via ESP8266/ESP32 with ESPHome)
Hub RequiredNo (ESPHome integrates directly with HA)
Power5V DC (sensor requires 5V, microcontroller separate)
Cloud DependencyLocal (ESPHome operates fully locally)
HA IntegrationNative (ESPHome autodiscovery)
Voice ControlNot applicable (passive sensors, no controllable actions)
Dimensions1.3 x 1.0 x 0.6 inches (MQ-5 module typical)
WarrantyVaries by seller, typically 30-90 days

Home Assistant Integration

Integration Method: ESPHome

  • Requirements: ESP8266 or ESP32 microcontroller, MQ-series gas sensor module, 5V power supply, ESPHome add-on installed in Home Assistant
  • Entities: Analog sensor for raw gas concentration (ADC reading), binary sensor for threshold-based alarm state, calibration sensors for temperature/humidity compensation if added
  • Setup: Wire sensor to ESP board (VCC, GND, analog output to ADC pin), create ESPHome configuration with ADC platform, set calibration values and thresholds, flash firmware to ESP device
  • Notes: Sensors require 24-48 hour burn-in period for accurate readings. Calibration in clean air is essential. Readings are relative and require gas-specific calibration curves for PPM accuracy

Practical Considerations

  • Calibration Required: MQ sensors need calibration in known clean air and with target gas at known concentration for accurate PPM readings. Without calibration, values are relative only
  • Burn-In Period: New sensors must run continuously for 24-48 hours to stabilize. Readings during this period are unreliable and will drift significantly
  • Temperature and Humidity Sensitivity: Readings affected by environmental conditions. Add DHT22 or BME280 sensor to same ESP board for compensation calculations
  • Power Consumption: MQ sensors have internal heater that draws 150-200mA continuously. Not suitable for battery operation, requires constant 5V power
  • Not Safety Certified: These are hobby-grade sensors, not UL/CSA certified for safety applications. Use as supplementary monitoring only, not as replacement for certified gas detectors
  • Gas Specificity Limitations: MQ sensors are cross-sensitive to multiple gases. MQ-5 detects LPG, natural gas, and alcohol. Cannot distinguish between different combustible gases
  • Placement Matters: Mount near ceiling for lighter-than-air gases (natural gas, hydrogen) or near floor for heavier-than-air gases (propane, butane). Keep away from direct airflow sources

References