[{"element_type":"product","content":"https://www.adafruit.com/product/5579","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/5400","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI wanted to measure the gas usage inside my home and push the data into Home Assistant.\u003c/p\u003e\n\u003cp\u003eTo 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.\u003c/p\u003e\n\u003ch1\u003eRequirements\u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://www.esphome.io/\" target=\"_blank\"\u003eESPHome 2025.8.3\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eThe Adafruit Products above (MMC5603 + ESP32 Feather V2 or similar board that can connect via WiFi)\u003c/li\u003e\n\u003cli\u003eEthernet Cable (Cat 5 and later is fine)\u003c/li\u003e\n\u003cli\u003eUSB Power Adapter (e.g. \u003ca href=\"https://www.amazon.com/HomeSpot-Listed-Universal-Charger-Adapter/dp/B07RZ4765V/136-5689264-985636\" target=\"_blank\"\u003elike this one\u003c/a\u003e , 5V 1A)\u003c/li\u003e\n\u003cli\u003eA short USB-A to USB-C connector (e.g. \u003ca href=\"https://www.amazon.com/Charging-Durable-Station-Compatible-Samsung/dp/B08LL1SVZD?dib=eyJ2IjoiMSJ9.GfYK3XzWGOJgP9EJEjp2XPZZLnMTcGhzul-Fcq5vfcM0vzllLKwz7kXDfMX1Lv9SwzndePUG_B6PV0eou2b-vpAZ88qW933Lavxs3vTiGcem0kF9e4eAKiattuxKcPjuCLmaM1w2DGbct5kGFKI0MkqfdrfQRXghvJam5anrHcE6VlINgtkdXPLOPvmsGyyvuJZvpQp46Yo46x6hgXtd6-ajI0z__b1_-x9UDNVrcPM.rHxMll3YkPddDMv9vGEL7v52ZI1M9xW25-yplCTTeew\u0026amp;dib_tag=se\u0026amp;keywords=short+usb+cables\u0026amp;qid=1760575374\u0026amp;sr=8-1\"\u003elike this one\u003c/a\u003e, data isn't important here - so any cable will do)\u003c/li\u003e\n\u003cli\u003eM2.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).\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eIf you end up using any earlier version of ESPHome and you'll run into issues \u003ca href=\"https://forums.adafruit.com/viewtopic.php?t=218527\" target=\"_blank\"\u003elike I did where the MMC5603 wasn't being registered properly\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eI connected everything like this diagram:\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003eAssembly\u003c/h1\u003e\n      \n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/995/original/esp32_gas_monitor_bb.png?1760573671","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n        \u003ch1\u003ePreparing the Feather for ESPHome\u003c/h1\u003e\n\u003cp\u003eAfter I flashed the \u003ca href=\"https://esphome.io/guides/physical_device_connection/\"\u003eFeather to be able to be connect to my network\u003c/a\u003e I used the following configuration in ESPHome to have it work with the MMC5603:\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eesphome-web-97c208.yaml\u003c/code\u003e\u003c/p\u003e\n\u003cpre\u003eesphome:\u003cbr\u003e\u0026nbsp; name: esphome-web-97c208\u003cbr\u003e\u0026nbsp; friendly_name: Gas Monitor\u003cbr\u003e\u0026nbsp; min_version: 2025.5.0\u003cbr\u003e\u0026nbsp; name_add_mac_suffix: false\u003cbr\u003e\u003cbr\u003eesp32:\u003cbr\u003e\u0026nbsp; board: esp32dev\u003cbr\u003e\u0026nbsp; framework:\u003cbr\u003e\u0026nbsp; \u0026nbsp; type: esp-idf\u003cbr\u003e\u003cbr\u003e# Enable logging\u003cbr\u003elogger:\u003cbr\u003e\u003cbr\u003e# Enable Home Assistant API\u003cbr\u003eapi:\u003cbr\u003e\u003cbr\u003e# Allow Over-The-Air updates\u003cbr\u003eota:\u003cbr\u003e- platform: esphome\u003cbr\u003e\u003cbr\u003ewifi:\u003cbr\u003e\u0026nbsp; ssid: !secret wifi_ssid\u003cbr\u003e\u0026nbsp; password: !secret wifi_password\u003cbr\u003e\u003cbr\u003esubstitutions:\u003cbr\u003e\u0026nbsp; # For water one of: CCF, ft³, gal, L, m³\u003cbr\u003e\u0026nbsp; # For gas one of: CCF, ft³, m³\u003cbr\u003e\u0026nbsp; # For better accuracy avoid using large units like CCF and m³.\u003cbr\u003e\u0026nbsp; # You can always change the unit later in Home Assistant.\u003cbr\u003e\u0026nbsp; volume_unit: 'ft³'\u003cbr\u003e\u0026nbsp; i2c_scl: GPIO20\u003cbr\u003e\u0026nbsp; i2c_sda: GPIO22\u003cbr\u003e\u0026nbsp; hide_magnetic_field_strength_sensors: 'true'\u003cbr\u003e\u0026nbsp; hide_half_rotations_total_sensor: 'true'\u003cbr\u003e\u003cbr\u003epackages:\u003cbr\u003e\u0026nbsp; meter:\u003cbr\u003e\u0026nbsp; \u0026nbsp; url: https://github.com/tronikos/esphome-magnetometer-water-gas-meter\u003cbr\u003e\u0026nbsp; \u0026nbsp; ref: main\u003cbr\u003e\u0026nbsp; \u0026nbsp; # file: esphome-water-meter.yaml\u003cbr\u003e\u0026nbsp; \u0026nbsp; # Or for gas meter:\u003cbr\u003e\u0026nbsp; \u0026nbsp; # file: esphome-gas-meter.yaml\u003cbr\u003e\u0026nbsp; \u0026nbsp; # Or if you are using HMC5883L instead of QMC5883L:\u003cbr\u003e\u0026nbsp; \u0026nbsp; # files: [esphome-water-meter.yaml, hmc5883l.yaml]\u003cbr\u003e\u0026nbsp; \u0026nbsp; # Or if you are using MMC5603 instead of QMC5883L:\u003cbr\u003e\u0026nbsp; \u0026nbsp; # files: [esphome-water-meter.yaml, mmc5603.yaml]\u003cbr\u003e\u0026nbsp; \u0026nbsp; files: [esphome-gas-meter.yaml, mmc5603.yaml]\u003cbr\u003e\u0026nbsp; \u0026nbsp; refresh: 0s\u003c/pre\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI ended up having to create a 3D bracket that could hold the MMC5603 onto the US Gas Meter.\u003cbr\u003e\u003cbr\u003e\u003ca href=\"https://www.printables.com/model/1446364-us-gas-meter-brace-for-a-mmc5603-magnetometer\" target=\"_blank\"\u003ehttps://www.printables.com/model/1446364-us-gas-meter-brace-for-a-mmc5603-magnetometer\u003c/a\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/999/original/3d_printed_bracket.png?1760575549","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/996/original/gas_meter_w_magnetometer_headon.png?1760575035","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/997/original/gas_meter_w_magnetometer_side.png?1760575057","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eOn the other side, I ran the ethernet cable along the floorboards of the house and to the closest outlet that will power the Feather.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/998/original/feather_with_connections_plugged_in.jpg?1760575341","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n        \u003cp\u003eThe following is a screenshot of the Gas sensor running on Home Assistant.\u003c/p\u003e\n      \n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/000/original/gas_meter_ha_dashboard.png?1760576238","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/001/original/gas_meter_ha.png?1760576252","metadata":{}},{"element_type":"text","content":"\n  \n        \u003ch1\u003eLeftovers\u003c/h1\u003e\n\u003cp\u003eI 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 \u0026amp; changing how much gas was being used by turning the stovetop on \u0026amp; off while calibrating.\u003c/p\u003e\n\u003cp\u003eI 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.\u003c/p\u003e\n\u003cp\u003eI'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.\u003c/p\u003e\n      \n","metadata":{}},{"element_type":"text","content":"\n        \u003ch1\u003eSpecial Thanks\u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tronikos/esphome-magnetometer-water-gas-meter\"\u003ehttps://github.com/tronikos/esphome-magnetometer-water-gas-meter\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\n\u003ca href=\"https://forums.adafruit.com/memberlist.php?mode=viewprofile\u0026amp;amp;u=576464\"\u003eyoshizors\u003c/a\u003e on the Adafruit forum for troubleshooting\u003c/li\u003e\n\u003cli\u003e\n\u003ca href=\"https://forums.adafruit.com/memberlist.php?mode=viewprofile\u0026amp;amp;u=15481\"\u003eadafruit_support_mike\u003c/a\u003e for forum troubleshooting and being all around a great steward of the Adafruit forums.\u003c/li\u003e\n\u003c/ul\u003e\n      ","metadata":{}}]