Measure real-time AC current and power on an ESP32 using an SCT-013 clamp sensor.
Build an energy monitoring device that reports accurate wattage without slowing down WiFi tasks.
Wire up a DC bias circuit and read AC signals safely through a microcontroller's ADC.
| anha1/silkyrms | allentdan/shape_based_matching | amu2mod/radeonmon | |
|---|---|---|---|
| Stars | 1 | 1 | 1 |
| Language | C++ | C++ | C++ |
| Last pushed | — | 2019-03-01 | — |
| Maintenance | — | Dormant | — |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 3/5 | 3/5 | 3/5 |
| Audience | developer | developer | vibe coder |
Figures from each repo's GitHub metadata at analysis time.
Needs a current clamp sensor and a hand-built voltage divider circuit, not just software setup.
SilkyRMS is a code library for ESP32 and similar dual core microcontrollers that measures alternating current power and current using an inexpensive clip-on sensor, the kind often called an SCT-013 current transformer. It calculates a continuously updated true RMS reading of the current and power flowing through a wire, which is the standard, accurate way to measure alternating current signals rather than a rougher estimate. The library is built to run fast without slowing down other tasks on the microcontroller. It uses integer math instead of slower floating point calculations during the main sampling loop, which on an ESP32-S3 lets it take around 89,000 samples over a 5 second window, roughly 17,800 samples per second. Because small manufacturing differences and heat can shift a circuit's resting voltage away from its expected midpoint, the library continuously tracks and corrects for that using a smoothing filter, so its measurements stay accurate over time. It also deliberately varies exactly when it yields control back to the microcontroller's other background tasks, using prime number based timing, so that these brief pauses do not repeatedly miss the same part of the electrical wave and skew the reading. To use it, you need a compatible current clamp sensor, wired into the microcontroller's analog input through a simple voltage divider circuit that shifts the clamp's alternating signal into a range the chip can read, since the chip cannot read negative voltages directly. The library's settings let you specify the chip's ADC resolution, the reference voltage, the sensor's specific volts-to-amps ratio, and your local mains voltage, whether 230V as used in Europe or 120V as used in the United States. The project includes ready to use example code for both a sensor wired directly into the ESP32 and one using a separate external ADC chip. It is written in C++ and currently has 1 star on GitHub. The available material does not state the project's license.
SilkyRMS is a fast, accurate C++ library for measuring AC current and power on ESP32 microcontrollers using clip-on sensors.
Mainly C++. The stack also includes C++, ESP32, FreeRTOS.
Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.