
Unit MQ is a combustible gas detection unit based on the semiconductor gas sensor (MQ-5), integrated with an MCU (STM32G030F6P6). It is mainly used for detecting combustible gases (such as propane, methane, etc.) in the environment. This unit communicates with various host devices via the I2C interface and can obtain internal reference voltage, sensor voltage, 12-bit and 8-bit ADC raw values, firmware version, thermistor temperature, and other information.
I²C component is required for device setup:
# Example configuration entry for ESP32
i2c:
sda: GPIOXX
scl: GPIOXX
scan: trueThese GPIO pins may varies depend on the device you are using. For an example, Atom Lite:
# I2C Bus on Grove Port (HY2.0-4P)
i2c:
sda: GPIO26
scl: GPIO32Example configurations for Unit MQ
external_components:
- source: github://m5stack/esphome-yaml/components@main
components: m5stack_unit_mq
refresh: 0s
sensor:
- platform: m5stack_unit_mq
heat_mode: SWITCH
temperature:
id: mq_temp
name: "Unit MQ Temperature"
mq_adc:
id: mq_adc_val
name: "MQ ADC"
ntc_adc:
id: ntc_adc_val
name: "NTC ADC"
ntc_resistance:
id: ntc_resistance_val
name: "NTC Resistance"
reference_voltage:
id: in_ref_volt
name: "Internal Reference Voltage"
mq_voltage:
id: mq_volt
name: "MQ Voltage"
ntc_voltage:
id: ntc_volt
name: "NTC Voltage"
led:
id: mq_led
name: "MQ LED Status"
update_interval: 20sConfigurable variables:
CONTINUOUR, SWITCH and OFF is accepted.heat_mode: CONTINUOUS, device will heat up continuously, be careful when touching the sensor probe.Dashboard example
