Build a Home Energy Monitor with ESP32 and CT Clamps: Whole-House Power Tracking in Home Assistant
A plug-in smart meter tells you what one outlet is drawing. It doesn't tell you what your whole panel is doing, which circuit your 3D printer farm is really costing you, or when your CNC router's spindle kicks a starting-current spike. Split-core current transformer (CT) clamps solve that without touching a single wire nut — they clip around an existing conductor and induce a proportional current on their own secondary winding, so you can measure whole-circuit or whole-panel power non-invasively. This project builds a multi-channel energy monitor around an ESP32 that reports live power, daily energy, and per-circuit breakdowns into Home Assistant.
How CT Clamps Actually Work
A CT clamp is a current transformer: the wire you clamp it around is the primary (a single-turn winding), and the clamp's internal coil is the secondary. A common 30A/1V or 100A/50mA clamp (SCT-013 series) produces a small AC signal proportional to the current flowing through the clamped conductor, which you rectify, scale, and read on the ESP32's ADC. Because it only measures current, not voltage, true wattage calculation needs either an assumed nominal voltage (fine for rough monitoring) or an actual voltage reference from a small AC-AC adapter sampled in parallel, which is what lets you calculate real power and power factor instead of just apparent current draw.
Safety First — This Involves Your Panel
Clamping a CT around an insulated conductor is non-invasive and doesn't require breaking the circuit, but you are still working inside or immediately next to a live electrical panel to get the clamp positioned. If you are not confident identifying individual circuit conductors in your panel and working safely around exposed bus bars, hire an electrician for the clamp installation step and do the electronics build yourself — the CT clamps themselves ship with the split core open specifically so they don't need to be threaded onto a wire, but you still need panel access to get them there.
- Never clamp a CT around a bare or damaged conductor.
- Never open a CT's secondary circuit while it's clamped around an energized conductor — an unloaded CT with current flowing through the primary can generate dangerous open-circuit voltage on the secondary. Always keep a burden resistor across the CT output, and wire the burden resistor before you clamp it on, not after.
- If your panel's main breaker is old, corroded, or the cover doesn't sit flush, treat that as a reason to call an electrician rather than a DIY panel job, energy monitor or not.
- Work with one hand in your pocket near the panel, use insulated tools, and don't work on a wet floor or in wet conditions.
Parts List
- ESP32-S3 DevKit development board (S3 preferred over a plain ESP32 for the extra ADC channels and headroom)
- SCT-013-000 100A split-core CT clamps (pack of 4-6)
- 9V AC-AC voltage reference adapter (for real power/power factor)
- 33-ohm 1% burden resistors (one per CT channel)
- 3.5mm jack breakout boards (if your CTs terminate in a 3.5mm plug)
- ADS1115 16-bit external ADC module (recommended over the ESP32's noisy built-in ADC for accuracy)
- DIN rail enclosure or project box sized to mount near your panel
- 5V USB power adapter for the ESP32
- 22 AWG stranded hookup wire kit
- Screw terminal blocks for clean CT connections
Wiring the Analog Front End
Each CT clamp's output is a small AC voltage centered on zero, which the ESP32's single-supply ADC can't read directly — you need to bias it up to sit within the 0-3.3V ADC range using a voltage divider off the 3.3V rail, typically two 10k resistors forming a mid-supply reference that the CT signal rides on top of. Feed each biased channel into an ADS1115 input rather than the ESP32's native ADC: the built-in ADC is noticeably noisy and non-linear at low signal levels, which matters a lot when you're trying to resolve a few watts of standby draw versus a running compressor.
ComponentConnects To CT clamp secondaryBurden resistor + bias divider → ADS1115 input channel AC-AC voltage referenceSeparate divider → dedicated ADS1115 channel, used for phase/voltage sampling ADS1115 SDA/SCLESP32 I2C pins (see our I2C wiring guide for pull-up requirements)Firmware: EmonLib and ESPHome
You have two reasonable software paths. The fast path is ESPHome's built-in ct_clamp and adc sensor platforms, which handle RMS current sampling and calibration in YAML with no code, and report straight into Home Assistant over the API — this is the right choice if you just want per-circuit current and don't need true power factor correction. The more capable path is the OpenEnergyMonitor EmonLib library ported to ESP32/Arduino, which does proper real-power calculation by sampling both current and voltage in phase and multiplying instantaneous samples, giving you accurate watts and power factor rather than just apparent current × assumed voltage.
Calibration
Whichever path you choose, calibrate against a known load before trusting the numbers: plug a device with a known, stated wattage (a space heater rated for exactly 1500W is a convenient reference) into the circuit you've clamped, and adjust your calibration constant until the reported value matches. Do this per channel — CT clamps have real unit-to-unit variance, and a single global calibration constant across all channels will leave some circuits reading consistently high or low.
Getting It Into Home Assistant
Both ESPHome and raw-MQTT approaches integrate cleanly. With ESPHome, sensors show up automatically once the device is added through the ESPHome integration. With a custom Arduino/EmonLib firmware, publish readings over MQTT (see our MQTT and Node-RED on Raspberry Pi guide) and pick them up with the MQTT integration. Either way, add the resulting sensors to an Energy dashboard in Home Assistant to get long-term, per-circuit history and cost tracking rather than just a live number.
The finished box mounts near your panel, on a DIN rail if your panel has room or in a small project enclosure fastened nearby, with the CT leads routed to their clamped conductors and a single USB cable for power. It's a project that pays for itself in visibility rather than dollars — once you can see that a "vampire load" circuit is pulling 400W around the clock, or that your laser cutter's air assist compressor is a bigger draw than the laser itself, you tend to actually do something about it.
Related Guides
- ESPHome and Home Assistant Beginner Guide: Build Your First WiFi Sensor
- MQTT and Node-RED on Raspberry Pi: Visual Automation for ESP32 Sensor Networks
- Zigbee and Z-Wave on Raspberry Pi: Adding Zigbee2MQTT and Z-Wave JS to Home Assistant
- Choosing the Right ESP32 Variant: ESP32, S2, S3, C3, and C6 Compared
- Build a Wall-Mounted Maker Dashboard: Aggregating Your Print Farm, Security, and Home Server on One CYD Panel
- DIY Home Security System: Combining Raspberry Pi, ESP32 Sensors, and Flipper Zero
- Build a Wall-Mounted Dashboard with the ESP32 Cheap Yellow Display (CYD)
- Build a Home Assistant Voice Satellite with Raspberry Pi and the Wyoming Protocol