I have ESP32 with mq-5 gas sensor.
I am facing a problem, The sensor value is always 7.5% even if there is no gas around, And when there is gas it goes above 12%
Isn’t it should 0% when there is no gas? I’ve tried multiple solutions and nothing worked for me!
Here is my code:
substitutions:
name: mq5-gas-sensor-1
friendly_name: MQ-5 Gas Sensor 1
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: true
project:
name: esphome.web
version: dev
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
# Allow provisioning Wi-Fi via serial
improv_serial:
wifi:
# Set up a wifi access point
ap: {}
captive_portal:
dashboard_import:
package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main
import_full_config: true
esp32_improv:
authorizer: none
# To have a "next url" for improv serial
web_server:
# DIY MQ-5 Smoke & Gas Sensor for Home Assistant
sensor:
- platform: adc
pin: GPIO35
name: "MQ-5 Gas Sensor 1"
update_interval: 10s
filters:
- multiply: 100
unit_of_measurement: "%"
icon: "mdi:percent"