December 26, 2025
Description
This is part of an ESPHome project to read a gas meter with Home Assistant. With this you can see your gas usage in real time and track history, build automations, data visualizations etc.
It works by reading the small magnetic field variations created by the rotating drive inside your gas meter. These changes correspond to the meter’s mechanical movement.
See: the ESPHome Gas and Water Meter project page for more details.
This is a weather resistant case to house the electrical components I recommend to use. It is designed so it can be mounted to a Sensus R-275 gas meter, which my utility (PG&E in California) uses. This case is likely to fit other gas meters.
There are 5 components:
a base. This is designed to mount to the gas meter. You can leave this mounted and remove the insert to service the components easily.
an insert. The insert secures the electrical components and is removable.
a lid. This is secured with screws.
2 clips to secure the electronic components to the insert.
What else you need:
M4 threaded inserts + M4 bolts (8 mm long) to secure the lid
Mounting:
Preferably: a piece of 12 gauge (20 amp) romex wire + a piece of thinner wire for mounting
You can also just use duct tape
Electrical components:
M5Stack NanoC6 - this is the ESP32 SoC that runs ESPHome firmware.
Adafruit MMC5603 Triple-axis magnetometer - this reads the movement of the gas meters internal diaphragm.
Adafruit Grove to STEMMA QT Cable - this makes it solderless.
a USB-C cable and power supply. This is just for power. The ESP32 talks to Home Assistant over wifi. The case is design to accept a 3.5mm cable.
Weather resistant design - the primary concern is keeping the electronics dry. The model has a number of design features to help:
I opted to design the case to shed water rather than rely on perfect gasket seals.
3 walls with 2 seals
curved shapes and lips to make water flow down and away from seals
if water gets past the first seal, it will be directed internally to a drainage hole in the bottom.
the insert has an internal shield to protect from water shooting up from the cable exit.
A robust mounting solution - my gas meter is full of curved surfaces making it a challenge to mount this case. You can just use duct tape, but my gas meter is in direct sunlight and i wanted something that will last. It is designed to mount with wire:
A primary wire - a piece of 12 gauge (20 amp) romex is ideal. Bend and wrap it over the meter's gauges and through holes in the base. You can simply bend the wire tips slightly to secure it.
Then wrap two smaller wires around the primary wire in the slots where they are exposed and supported. Tie together at the back of the meter to secure laterally. There is just enough of a lip on my gas meter to have this wire not slip off.
A single USB cable is needed - this project and design requires no soldering and houses both the ESP32 and the sensor. You just need to supply power via a USB-C power cable .. and the gas meter needs to be in range of your wifi.
I did this, but I don't think it is absolutely necessary ... spray clear coat over the parts that can get wet to make them water tight. That includes the back and sides of the insert.
STEP and Fusion 360 files for easy remixing
3MF file for easy printing
License:
Creative Commons — Attribution — Share Alike
10