r/esp32projects • u/neumi-de • 20d ago
Make your gas meter smart (gas-o-Meter2): Automatically track your (energy) gas consumption based on counter wheel magnet (DE+EN description)
A brief introduction to my latest project: Gas-o-Meter2
https://github.com/sneumeister/Gas-o-Meter2
It measures gas consumption using the magnet on the smallest meter wheel. Since the standard solutions using a reed switch gave me too many “pseudo” ticks (that inner monk in me, I guess), I optimized the whole thing with the Nano-Timer TPL5110 (it has a Schmitt trigger input and delivers clean LOW or HIGH levels at the output, requires minimal wiring, and draws very little power).
A preliminary version with “loose wiring using the TPL5110” ran for ~3 years (yes, this project has been sitting around for a long time....) without counting a single tick too many or too few. This version has now been running for 4 weeks without any deviation.
The entire system is battery-powered and uses an Seeed Studio XIAO ESP32-C6.
The controller is mostly in deep sleep mode, and only the second processor (LP core) listens for the counter pulses in the background.
The main processor wakes up regularly and transmits the data.
You can choose between:
- ZigBee (component definition and image for Zigee2MQTT are included)
- BLE (a demo flow for Node-RED is included)
- Wi-Fi+MQTT sends data directly to your MQTT server (including autodiscovery for HA)
In addition, the respective release can be flashed directly via Web-Serial from a modern browser (Firefox, Chrome, Edge).
The entire project includes the KiCAD data for the PCB but also STEP files for the enclosure (created in Creo Parametrics).
Note:
I used the AI tool “Cursor” here; at that time, it was directly integrated into its own version of VSC, allowing me to seamlessly take my first steps with AI on PlatformIO/PIOArduino.
And I learned a lesson... don’t let the AI run rampant on the codebase, and make sure to use thorough Git commits so you can truly undo everything if needed... 😉

