English
English
简体中文
日本語

Unit MQ ESPHome Component

The Unit MQ component reads combustible gas detection data and heating status.

1. Component Overview

Item Information
Product Name Unit MQ
SKU U199
Main Function Combustible gas and heating status detection
Communication Interface I2C
Default I2C Address 0x11
ESPHome Component m5stack_unit_mq (external component)
ESPHome Version Requirement /

2. Component Description

Including the External Component

external_components:
  - source: github://m5stack/esphome-yaml/components
    components: [m5stack_unit_mq]
    refresh: 0s

Gas Detection with Sensor and Binary Sensor

Add the m5stack_unit_mq Sensor Platform to configure the heating mode and read MQ, NTC, and reference voltage data. The led option additionally creates a Binary Sensor entity indicating whether the data is valid.

sensor:
  - platform: m5stack_unit_mq
    heat_mode: SWITCH
    temperature:
      name: "Unit MQ Temperature"
    mq_adc:
      name: "MQ ADC"
    ntc_adc:
      name: "NTC ADC"
    ntc_resistance:
      name: "NTC Resistance"
    reference_voltage:
      name: "Internal Reference Voltage"
    mq_voltage:
      name: "MQ Voltage"
    ntc_voltage:
      name: "NTC Voltage"
    led:
      name: "MQ Data Valid"
    update_interval: 20s

Main parameters:

Parameter Description
heat_mode Heating mode: CONTINUOUS, SWITCH, or OFF.
temperature Temperature calculated from thermistor data.
mq_adc 12-bit raw ADC reading from the MQ channel.
ntc_adc 12-bit raw ADC reading from the NTC channel.
ntc_resistance NTC resistance.
reference_voltage Internal reference voltage.
mq_voltage MQ channel voltage.
ntc_voltage NTC channel voltage.
led Binary data-valid status; this option reads the status and does not control the onboard LED.
high_level_time High-level duration in SWITCH mode, in seconds; default 30, minimum 30.
low_level_time Low-level duration in SWITCH mode, in seconds; default 5, minimum 5.
update_interval Sensor data update interval.
Warning
The device must be heated for a period before it can output valid data; ADC readings become available only after heating to approximately 29°C. In heat_mode: CONTINUOUS, the device heats continuously. Avoid touching the hot probe.

3. Reference Example

After configuration and connection to Home Assistant, the result is displayed as follows:

Page Tools
PDF
On This Page