{"id":46958670,"url":"https://github.com/npotts/esp32-samplenode","last_synced_at":"2026-03-11T09:26:10.567Z","repository":{"id":74588451,"uuid":"226003699","full_name":"npotts/esp32-samplenode","owner":"npotts","description":"ESP32 that measures PTU and AC power measurements to spew to MQTT.","archived":false,"fork":false,"pushed_at":"2022-05-06T04:26:16.000Z","size":432,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-26T07:10:45.195Z","etag":null,"topics":["esp32","humidity","mqtt","power-meter","temperature"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npotts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-05T02:58:56.000Z","updated_at":"2022-05-06T04:26:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"6fe7bf70-2595-48a1-855d-bb50ab8e09e3","html_url":"https://github.com/npotts/esp32-samplenode","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"503cf48680ae178f49ee3d4fba57854c404f5a78"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/npotts/esp32-samplenode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npotts%2Fesp32-samplenode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npotts%2Fesp32-samplenode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npotts%2Fesp32-samplenode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npotts%2Fesp32-samplenode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npotts","download_url":"https://codeload.github.com/npotts/esp32-samplenode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npotts%2Fesp32-samplenode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30377194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","humidity","mqtt","power-meter","temperature"],"created_at":"2026-03-11T09:26:09.847Z","updated_at":"2026-03-11T09:26:10.558Z","avatar_url":"https://github.com/npotts.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 Sampler\n\nThe TL;DR is that I got excited about looking into how to use [Split Phase Current Measurement](https://circuitsetup.us/index.php/product/split-single-phase-real-time-whole-house-energy-meter-kit-programmed-esp32-2-cts-abs-box/) kit, and trying to figure out how to avoid installing some arbitrary annoying PHP software that is called ESPMon.\n\nI soon started reading the docs on [FreeRTOS](www.freertos.com), and quickly bought:\n\n* I2C Hygrometer [SI7021](https://www.adafruit.com/product/3251)\n* I2C Barometer [MPL3115A2](https://www.adafruit.com/product/1893)\n* SPI based on a ATM90E32 [Split Phase Current Measurement](https://circuitsetup.us/index.php/product/split-single-phase-real-time-whole-house-energy-meter-kit-programmed-esp32-2-cts-abs-box/)\n\n\nWith the intent to spew data into a MQTT queue installed inside my home network.\n\n# Wiring Diagram\n\n![Wiring Diagram](docs/wiring.png)\n\n# MQTT Enpoints\n\nRunning `make menuconfig` will allow one to modify the bulk of what is in there, but the defaults do the following.  Data points all have the same structure:\n\n\u003e {\"t\":1231231,\"v\":832.234662}\n\n`t` is the ESP32's `millis()` clock that eventually rolls over.  V is the \n\n|Topic|Data|\n|:----|:---|\n|heartbeat/pwr| Heartbeat message with a brief timestamp.  Messages here are strings, and are triggered when  the SPI poll has errant data|\n|heartbeat/wxpwr| Heartbeat for main monitor loop. Contains slightly different data values |\n|sensor/wx/p| Pressure, in mBar|\n|sensor/wx/pth| Temperature of the barometer sensor.  Could be used for \ncalibration|\n|sensor/wx/rh| Relative humidity in %RH.  Is not clipped to 100 and may be wildly off during temperature shocks|\n|sensor/wx/rht| Relative humidity sensor temperature in C. Could be used for calibration|\n|sensor/power/f| Frequency, in Hz|\n|sensor/power/v1| Phase 'A' voltage, RMS|\n|sensor/power/v2| Phase 'C' voltage, RMS (not entirely sure how this is different from v1 above|\n|sensor/power/i1| Phase 'A' current (amps) |\n|sensor/power/i2| Phase 'C' current (amps) |\n|sensor/power/I| Total current (A+C) |\n|sensor/power/ap| [Apparent Power](https://en.wikipedia.org/wiki/AC_power#Active,_reactive,_and_apparent_power) |\n|sensor/power/ap| [Power Factor](https://en.wikipedia.org/wiki/Power_factor) |\n|sensor/power/t| Temperature sensor |\n|sensor/power/f|  AC Frequency |\n|sensor/power/w| Power (Watts) |\n\n# How to Build\n\n* Firstly, you need to get the [esp-idf](https://github.com/espressif/esp-idf). That is outside the realm of this manual, but is necessary to work properly.\n\n```sh\n\nsource path/to/esp-idf/export.sh # get the ESP-IDF build environment\ncp sdkconfig.sample sdkconfig\nmake menuconfig # Modify the build parameters (eg, Wifi SSID, Password, MQTT etc) under the \"House Monitor Config\"\nmake -j8 #because I can\n```\n\n# Why?\n\nDo you really need to to ask that?\n\nOutside the normal `I had an itch` answers, consider the fact you are here  continuing to read this sentence; impling that you too, want to invest time tinkering in homebrewing your own tools.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpotts%2Fesp32-samplenode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpotts%2Fesp32-samplenode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpotts%2Fesp32-samplenode/lists"}