I wanted to measure the gas usage inside my home and push the data into Home Assistant.
To collect the data, I wanted to use the MMC5603 magnetometer + ESP32 Feather V2. The MMC5603 had a great price point and the ESP32 Feather V2 was able to connect to my Home Assistant server via WiFi.
Requirements
- ESPHome 2025.8.3
- The Adafruit Products above (MMC5603 + ESP32 Feather V2 or similar board that can connect via WiFi)
- Ethernet Cable (Cat 5 and later is fine)
- USB Power Adapter (e.g. like this one , 5V 1A)
- A short USB-A to USB-C connector (e.g. like this one, data isn't important here - so any cable will do)
- M2.5 screws (lengths and materials will be up to you, I used nylon M2.5 screws to attach the bracket to the gas meter and metal M2.5 screws for the MMC5603 to the bracket).
If you end up using any earlier version of ESPHome and you'll run into issues like I did where the MMC5603 wasn't being registered properly.
I connected everything like this diagram:
Preparing the Feather for ESPHome
After I flashed the Feather to be able to be connect to my network I used the following configuration in ESPHome to have it work with the MMC5603:
esphome-web-97c208.yaml
esphome:
name: esphome-web-97c208
friendly_name: Gas Monitor
min_version: 2025.5.0
name_add_mac_suffix: false
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
substitutions:
# For water one of: CCF, ft³, gal, L, m³
# For gas one of: CCF, ft³, m³
# For better accuracy avoid using large units like CCF and m³.
# You can always change the unit later in Home Assistant.
volume_unit: 'ft³'
i2c_scl: GPIO20
i2c_sda: GPIO22
hide_magnetic_field_strength_sensors: 'true'
hide_half_rotations_total_sensor: 'true'
packages:
meter:
url: https://github.com/tronikos/esphome-magnetometer-water-gas-meter
ref: main
# file: esphome-water-meter.yaml
# Or for gas meter:
# file: esphome-gas-meter.yaml
# Or if you are using HMC5883L instead of QMC5883L:
# files: [esphome-water-meter.yaml, hmc5883l.yaml]
# Or if you are using MMC5603 instead of QMC5883L:
# files: [esphome-water-meter.yaml, mmc5603.yaml]
files: [esphome-gas-meter.yaml, mmc5603.yaml]
refresh: 0s
I ended up having to create a 3D bracket that could hold the MMC5603 onto the US Gas Meter.
https://www.printables.com/model/1446364-us-gas-meter-brace-for-a-mmc5603-magnetometer
On the other side, I ran the ethernet cable along the floorboards of the house and to the closest outlet that will power the Feather.
The following is a screenshot of the Gas sensor running on Home Assistant.
Leftovers
I still don't think that the sensor is reading the gas meter correctly. I have triggered the "Calibrate axis" button a few times while increasing the timeout & changing how much gas was being used by turning the stovetop on & off while calibrating.
I still don't know what the "normal" amount of gas is for a home or our home. We use natural gas for: Kitchen cooking, clothes drying, water heating. Most of these activities are occurring at some frequency but the graphs don't seem to adjust accordingly.
I'm unsure if the problem is: my calibration, my understanding of how much gas our home actually uses, or whether the MMC5603 is too far from the gas meter itself.
Special Thanks
- https://github.com/tronikos/esphome-magnetometer-water-gas-meter
- yoshizors on the Adafruit forum for troubleshooting
- adafruit_support_mike for forum troubleshooting and being all around a great steward of the Adafruit forums.
This page (Magnetometer - MMC5603 to measure gas usage inside your home with home assistant) was last updated on October 15, 2025.