
ESP32C6 gasometer
sneumeister/Gas-o-Meter2
Automatically track your (energy) gas consumption based on counter wheel magnet

Automatically track your (energy) gas consumption based on counter wheel magnet
ESP32C6 gasometer is an open-source printed circuit board by sneumeister, from the sneumeister/Gas-o-Meter2 repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 52 × 30 mm with 13 parts on 17 nets, routed with 66 tracks and 3 vias.
It is built around the TPL5110DDC. Its parts include 5 resistors, 2 ICs, 2 switches and 1 connector. It belongs with the radio and wireless boards and the ESP32 and RISC-V boards of this library.
ESP32-C6-basiertes Gaszähler-Monitoring mit LP-Core Pulse-Counting, akkubetriebenem Deep-Sleep und wählbaren Übertragungswegen (WiFi/MQTT, BLE, Zigbee).
Custom Carrier-PCB mit TPL5110-Mikrotimer für saubere Reed-Impulse, optionalem 3D-Druck-Gehäuse und Web-Interface zur Konfiguration.

ulp/ulp_main.c); der HP-Core ist nur bei Wake-up zur Datenübertragung aktivwakeup_minutes in der Configdata/index.html, config.html); im Dauerbetrieb (Timer-Wake-up) nicht automatisch erreichbarnone, mqtt, ble oder zigbee (jeweils ein Modus aktiv)Die Firmware-Revision (BOARD_VERSION_ID, siehe Build & Flash) steuert nur die USB-Erkennung: Der Default PCB_20251022 läuft auch auf der neuen Platine (Revision 20260523), nutzt dort aber die ADC-Heuristik statt VBUS an GPIO18. Für die dedizierte VBUS-Erkennung der zweiten Revision: PCB_20260523. Details zu den Platinen über die KiCAD-Übersicht.
| Modus | Beschreibung | Integration |
|---|---|---|
mqtt | WiFi + MQTT (+ optional Home Assistant Autodiscovery) | NTP-Zeitsync, transfer_mqtt.cpp |
ble | NimBLE, JSON-Notify auf Characteristic 0xFFF1 | Node-RED Flow |
zigbee | Zigbee End Device (Metering + Battery Cluster) | Zigbee2MQTT Converter |
none | Nur lokale Erfassung; kein externer Transfer | — |
Einstieg für externe Systeme: integration_templates/README.md
LiPo-Spannungsreihe (wie in der Firmware hinterlegt; %-Anzeige wird dazwischen linear interpoliert):
| Spannung | % | Ohne USB (Akku) | Mit USB |
|---|---|---|---|
| ≥ 4,02V | 100% | Normal: Transfer, Zähler im RTC-RAM | Normal: Transfer, Zähler im RTC-RAM (kein NVS) |
| 3,92V | 80% | wie oben | wie oben |
| 3,72V | 50% | wie oben | wie oben |
| 3,57V | 30% | Ab hier bzw. darunter: Low-Battery-Meldung; Zähler in NVS | wie links |
| 3,42V | 20% | Darunter: Sofort Deep-Sleep, kein Transfer; Timer weiter bis 3,15V | Schutz greift nicht → Transfer wie normal |
| ≤ 3,15V | 0% | Timer aus; nur Taster A weckt | Timer bleibt an |
Zurück in den Normalbetrieb (Timer war aus): USB allein weckt nicht. USB anstecken und Taster A drücken (startet Web-UI; warten bis Web-Timeout) — danach Deep-Sleep mit Timer.
USB-Erkennung nach Platine:
PCB_20260523).Der LP-Core zählt Impulse weiter, solange der Chip versorgt ist. Taster B hat aktuell keine Funktion.
| Komponente | Pfad / Modul | Aufgabe |
|---|---|---|
| HP-Core | src/main_idf.cpp | Boot, Config, HTTP-Server, ADC, Deep-Sleep, Transfer-Orchestrierung |
| LP-Core | ulp/ulp_main.c | Reed-Pulse-Counting auf GPIO2 |
| Transfer | src/transfer.cpp, transfer_{mqtt,ble,zigbee}.cpp | Modus-Dispatcher und Protokoll-Stacks |
| Netzwerk | src/wifi_manager.cpp, src/time_sync.cpp | WiFi STA/AP, mDNS, NTP |
| Persistenz | data/ (LittleFS), pulse_nv (NVS) | Web-UI, config.json, Zähler-Ringpuffer |
| Version | include/version.h | Gas-O-Meter2 v1.0.7 |
Typischer Ablauf: TPL5110 weckt ESP → LP-Core liefert Zählerstand → HP-Core liest ADC/Config → optional Transfer → Deep-Sleep.
| Komponente | Version / Quelle |
|---|---|
| IDE | VS Code oder Cursor mit PlatformIO-Extension |
| PlatformIO | pioarduino/platform-espressif32 (stable zip in platformio.ini) |
| Framework | ESP-IDF 5.5.1 (sdkconfig.defaults) |
| Board | seeed_xiao_esp32c6 |
| Extension (empfohlen) | pioarduino.pioarduino-ide + vscode-clangd (.vscode/extensions.json, gas-o-meter2.code-workspace) |
| IntelliSense | clangd (.vscode/settings.json; Espressif-clangd setzt pioarduino lokal) |
Voraussetzungen: PlatformIO CLI, Git, USB-Treiber für XIAO ESP32-C6.
Standard-Environment in platformio.ini: PCB_20251022
| Environment | USB-Erkennung | Befehl |
|---|---|---|
PCB_20251022 | ADC-Heuristik (Default; läuft auf beiden Platinenrevisionen) | pio run / pio run -t upload |
PCB_20260523 | VBUS an GPIO18 (nur sinnvoll auf Revision 20260523) | pio run -e PCB_20260523 -t upload |
TPL_test | — (Hardwaretest TPL5110/Reed an GPIO2, ohne LP-Core/WiFi) | pio run -e TPL_test -t upload |
TPL_test: Seriell pio device monitor -e TPL_test (115200). Monitor vor dem Reset öffnen oder Board danach neu starten (USB-CDC). Flanken auf GPIO2 mit µs-Zeitstempel und Intervall dt; alle 2 s ein Heartbeat. Funktionstest TPL: Reed kurz tippen → ein LOW ~3–4 s, dann HIGH; Reed dauerhaft brücken → nur ein LOW, das bis zum Öffnen der Brücke anhält (keine kurzen HIGH-Lücken dazwischen). Magnettest: Reed-Schalter mit Magnet auslösen (typische Empfindlichkeit/Abstand). Details: src/main_TPL_test.cpp.
BOARD_VERSION_ID steuert in include/hardware.h, ob USB per ADC-Schwellwert oder per VBUS-GPIO erkannt wird — kein harter Platinen-Zwang.
Erstinstallation:
data/config.json aus data/config.json_example erstellenpio run -t upload (Default); optional -e PCB_20260523 für VBUS-Erkennung auf Revision 20260523pio run -t uploadfs (Web-UI und Default-Config)pio device monitor (115200 baud)Partitionen (partitions.csv): Factory-App, pulse_nv (NVS-Ring), Zigbee-Speicher, LittleFS.
Ohne PlatformIO kann die Firmware über den
Gas-O-Meter2 Web-Flasher
installiert werden (Firefox ab Version 151 auf Desktop-Systemen, Chrome oder
Edge; USB-Datenkabel erforderlich). Firefox installiert beim ersten Zugriff
eine seitenspezifische Berechtigungs-Erweiterung; eine zusätzliche
Drittanbieter-Erweiterung ist nicht notwendig. Unterstützt werden beide
PCB-Versionen sowie TPL_test.
Bei Firmware-/LittleFS-Teilupdates im ESP-Web-Tools-Dialog niemals „Erase device“ wählen.
Release-Tags v* bauen und veröffentlichen diese Dateien automatisch. Die
Maintainer-Schritte stehen in RELEASING.md.
Zwei Wege:
data/config.json — manuell oder über die Web-UI speichernHinweis Dauerbetrieb: Bei periodischem Timer-Wake-up (Akku-Betrieb) wacht das Gerät nur kurz auf, überträgt ggf. Daten und geht wieder in Deep-Sleep — ohne Web-Frontend. Status und Konfiguration sind nur nach manuellem Wake-up über Taster A erreichbar (WiFi STA oder Captive Portal im AP-Modus).
Wichtige Config-Keys (vollständig in config.json_example):
| Gruppe | Keys |
|---|---|
| Gerät | hostname, adminpass |
| WiFi | wifiCredentials (max. 2 Netze) |
| Timing | wakeup_minutes, transfer_interval_x |
| Transfer | transfer_mode (none / mqtt / ble / zigbee) |
| MQTT | mqtt_host, mqtt_port, mqtt_username, mqtt_password, mqtt_main_topic, mqtt_ha_autodiscovery, ntp_server |
| Kalibrierung / TX | adc_voltage_multiplier, wifi_tx_power_dbm, ble_tx_power_dbm, zigbee_tx_power_dbm |
gas-o-meter2/
├── src/ # Firmware (ESP-IDF)
├── ulp/ # LP-Core Pulse-Counting
├── data/ # LittleFS Web-UI + config.json
├── include/ # Header (hardware, transfer, version)
├── KiCAD-PCB/ # Platinen-Dokumentation
├── CAD-housing/ # Gehäuse STEP/Creo/Bilder
├── integration_templates/ # Zigbee2MQTT, Node-RED
├── pictures/webui/ # Screenshots für README_WEBUI.md
├── scripts/ # Release-Build und Artefakt-Verifikation
├── web-flasher/ # GitHub-Pages-Installseite (ohne Binaries)
├── RELEASING.md # Maintainer-Anleitung für Releases
└── platformio.ini # Build-EnvironmentsGas-O-Meter2 ist unter der Apache License 2.0 veröffentlicht.
Copyright- und Attributionshinweise stehen in NOTICE. Die
Lizenzen der verwendeten Bibliotheken dokumentiert
THIRD_PARTY_NOTICES.md.
Die permissive Apache-2.0-Lizenz wurde gewählt, um mögliche Konflikte zwischen starkem Copyleft und den zusätzlichen Binärbedingungen der separat lizenzierten ZBOSS-Komponente zu vermeiden. ZBOSS und alle weiteren Drittanbieter-Komponenten behalten ihre jeweils eigene Lizenz.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | 390k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R2, R3 |
| 2 | OMRON_B3F-6000 | footprints:SW_TH_Tactile_Omron_B3F-6000 | SW2, SW3 |
| 1 | 220k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R5 |
| 1 | 330k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R4 |
| 1 | 8,2k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R1 |
| 1 | BATT+ | TestPoint:TestPoint_THTPad_1.5x1.5mm_Drill0.7mm | TP2 |
| 1 | BATT- | TestPoint:TestPoint_THTPad_1.5x1.5mm_Drill0.7mm | TP1 |
| 1 | JST SH 1.25 2pin socket | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J1 |
| 1 | M.Hole_2.2mm_M2 | MountingHole:MountingHole_2.2mm_M2 | . |
| 1 | TPL5110 | Package_TO_SOT_SMD:SOT-23-6 | U1 |
| 1 | XIAO-ESP32-C6 | footprints:XIAO-ESP32C6-Breakout | U2 |

sneumeister/Gas-o-Meter2
Automatically track your (energy) gas consumption based on counter wheel magnet

Universidad-Cenfotec/Contraloria
Este es el resultado de un proyecto de investigación en coordinación con la Contraloría General de la República de Costa Rica y la cooperación alemana GIZ, para el desarrollo de cámaras IoT de bajo costo, que permitan…

CoreElectronics/CE-Makerverse-Nano-Power-Timer
This is the repo for the Core Electronics Makerverse Nano Power Timer.



Uspizig/WifiWallSwitch
A WallSwitch with a clever EINK Display that measures your Air Quality, measures Temperature, detects movement, measures Light Conditions... and many more.


ViktorStiskala/ESP8266-door-sensor
This design represents a small sensor intended to be triggered by a magnetic reed switch. It wakes upon closing the contact, reporting the information to the internet and going back to sleep.

bablokb/pcb-pico-proto-pboard
Plug&Play PCB for the Pico and Standard Hardware-Breakouts
It measures 52 × 30 mm and has 2 copper layers, 1.6 mm thick.
13 parts, built around the TPL5110DDC. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the sneumeister/Gas-o-Meter2 repository on GitHub, at the commit this page was made from: the board is KiCAD-PCB/Version20260523/ESP32C6_gasometer-2026-07-11_162129/ESP32C6_gasometer.kicad_pcb and its schematic KiCAD-PCB/Version20251022/ESP32C6_gasometer-2026-02-07_185848/ESP32C6_gasometer.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).