Build an Isolated AC Current Monitor Prototype
Explain Like I'm 12
The clamp surrounds one insulated wire in a low-voltage AC loop. It produces an AC signal on a separate winding. The bias circuit shifts that signal around mid-rail for the ESP32 ADC.
Learning Support
- Recommended ageAges 14+
- Adult supervisionQualified supervision for low-voltage bench wiring and instrument checks. Mains work is outside this exercise.
- Classroom useUse only an isolated, current-limited 12 V AC source and a load rated for that source. Do not build or open a mains transformer or adapter.
- Parent promptAsk why the CT needs AC current and why a low-voltage source is different from accessible mains wiring.
- Screen-free activityDraw the isolated 12 V AC source/load loop and the separate CT-to-ESP32 signal circuit.
- Next challengeRecord the actual low-voltage source, load and reference-instrument details before considering a separate calibration exercise.
- Skills practiced
- Isolated sensing
- ADC biasing
- RMS estimate
- Calibration limits
- Learning outcomes
- Use the selected voltage-output CT on an isolated low-voltage AC loop.
- Verify bias and waveform headroom before connecting the ADC.
- Distinguish uncalibrated current and nominal-voltage VA estimates from power measurement.
- Mini experiments
- Record unloaded noise without calling it current accuracy.
- Compare one-conductor and whole-two-wire-cable clamp positions with the low-voltage source switched off during repositioning.
Safety Standards
- Only the documented low-voltage circuit is supported. No mains wiring or life-safety function is covered.
- Disconnect USB and every external supply before rewiring; check actual voltage and terminal labels before attaching a GPIO.
- Review the selected parts and supply budget. Documentation review and calculated limits are not physical hardware validation.
What You Will Build
An isolated low-voltage AC current-sensing exercise. Use a factory-isolated, current-limited 12 V AC bench source (not DC), a matching low-voltage load and an SCT-013-030 voltage-output clamp. No mains conductors, panels or appliance leads are part of this tutorial.
Learning Objectives
- Use the selected voltage-output CT on an isolated low-voltage AC loop.
- Verify bias and waveform headroom before connecting the ADC.
- Distinguish uncalibrated current and nominal-voltage VA estimates from power measurement.
Components List
- ESP32 DevKit boardUSB-programmable ESP32 board used for the low-voltage control side.
- SCT-013-030 current transformer clampIsolated clamp with built-in burden, used around one insulated conductor only.
- 10 kOhm resistor pairCreates 1.65 V ADC midpoint bias.
- 10 uF electrolytic capacitorAC-couples the CT signal into the biased ADC node.
- 3.5 mm jack socketMatches the SCT-013 plug; keep low-voltage side enclosed.
- Factory-isolated, current-limited 12 V AC source and matching loadOnly its low-voltage output is used; no DC source and no mains assembly. SCT-013-030 has poor sensitivity for small bench loads; near-zero/noise is possible.
Bill of Materials
| Part | Qty | Estimated Cost | Notes |
|---|---|---|---|
| ESP32 DevKit board | 1 | Varies | USB-programmable ESP32 board used for the low-voltage control side. |
| SCT-013-030 current transformer clamp | 1 | Varies | Isolated clamp with built-in burden, used around one insulated conductor only. |
| 10 kOhm resistor pair | 1 | Varies | Creates 1.65 V ADC midpoint bias. |
| 10 uF electrolytic capacitor | 1 | Varies | AC-couples the CT signal into the biased ADC node. |
| 3.5 mm jack socket | 1 | Varies | Matches the SCT-013 plug; keep low-voltage side enclosed. |
| Factory-isolated, current-limited 12 V AC source and matching load | 1 set | Varies | Only its low-voltage output is used; no DC source and no mains assembly. SCT-013-030 has poor sensitivity for small bench loads; near-zero/noise is possible. |
Wiring
Only the isolated 12 V AC source and its low-voltage load form the sensed loop. The SCT-013-030 has a built-in burden; its secondary output feeds the separate biased GPIO34 circuit.
-
1
Unplug USB before changing the ADC bias circuit.
-
2
Build the 10 kOhm / 10 kOhm divider between 3.3 V and GND.
-
3
Connect the divider midpoint to GPIO34.
-
4
Couple the SCT-013 tip signal into the midpoint through the 10 uF capacitor, observing capacitor polarity for the biased node.
-
5
Connect the SCT-013 sleeve to ESP32 GND on the low-voltage side.
-
6
With the isolated 12 V AC source OFF, clamp around ONE insulated conductor between that source and its matching low-voltage load. Do not clamp the complete two-wire cable; no mains lead is used.
-
7
Before GPIO34 is connected, verify the midpoint and waveform with a meter/oscilloscope: keep the complete waveform within approximately 0.2β2.9 V for headroom inside the classic ESP32 11 dB measurement range. Limit the low-voltage source/load accordingly. The bias divider is not an overvoltage clamp.
GPIO Mapping
| Signal | ESP32 Pin | Direction | Notes |
|---|---|---|---|
| Biased CT waveform | GPIO34 | Input | ADC1 input-only. Verify waveform about 0.2β2.9 V; nominal bias alone does not guarantee protection. |
| Bias midpoint | 3.3 V / GND | Power | 10 kOhm divider creates about mid-rail. |
Circuit Explanation
The SCT-013 produces an isolated AC signal proportional to current. The bias network shifts that waveform into the ESP32 ADC range so EmonLib can estimate RMS current.
Engineering Explanation
The SCT-013-030 is the 30 A / 1 V voltage-output version with an internal burden; it is not interchangeable with an SCT-013-000 current-output clamp. A small low-voltage bench load may produce readings dominated by ADC noise. The two 10 kΞ© resistors bias the input nominally to 1.65 V; the 10 Β΅F coupling capacitor has its positive terminal toward the biased ADC node. Verify actual waveform bounds, not just midpoint. EmonLib 1.1.0 assumes 10-bit counts on non-ARM builds; this example explicitly requests that resolution. Neither that change nor the library establishes calibration. The assumed 12 V multiplication is only an illustrative VA estimate, not measured voltage, watts, power factor or energy.
Libraries
- Arduino-ESP32 3.3.2Classic ESP32-WROOM review baseline. Uses 10-bit analogRead here to match EmonLib non-ARM ADC_COUNTS, not the default 12-bit setting.
- EmonLib 1.1.0OpenEnergyMonitor library. ICAL=29 is an unvalidated starter factor; ADC transfer, CT tolerance and coupling network require a separate calibration. No ESP32 firmware compilation or current-accuracy result is claimed.
Code
Copy into Arduino IDE. Install any libraries noted in the component guides first.
// ESP32 Isolated AC Current Monitor Prototype
// Isolated current-limited 12 V AC bench loop ONLY; no mains wiring.
// Arduino-ESP32 3.3.2 / EmonLib 1.1.0 review baseline; uncalibrated estimate.
#include "EmonLib.h"
EnergyMonitor emon;
const int CT_PIN = 34; // ADC1 input at 1.65 V biased midpoint
const float ICAL = 29.0; // Starter calibration; tune with a known safe reference
const float ASSUMED_VOLTAGE = 12.0; // Nominal bench AC source, not measured voltage
void setup() {
Serial.begin(115200);
analogReadResolution(10);
analogSetPinAttenuation(CT_PIN, ADC_11db);
emon.current(CT_PIN, ICAL);
Serial.println("Educational isolated CT current monitor. Not billing-grade.");
}
void loop() {
double irms = emon.calcIrms(1480);
double apparentPower = irms * ASSUMED_VOLTAGE;
Serial.printf("Irms estimate: %.3f A Apparent power estimate: %.1f VA\n", irms, apparentPower);
delay(5000);
}
Code Explanation
CT_PIN is GPIO34. EmonLib samples the biased waveform, estimates RMS current, and multiplies by an assumed voltage only for apparent-power practice.
Expected Output
Serial Monitor prints Irms estimate and apparent power estimate every five seconds. Treat both as prototype estimates that need calibration.
Troubleshooting
- Current reads near zero Confirm the clamp surrounds one conductor only and the jack wiring reaches GPIO34.
- Readings drift Check the midpoint bias and capacitor orientation.
- Values disagree with a meter Tune ICAL against a known safe reference; do not claim precision.
Common Mistakes
- Using a DC source: a current transformer requires changing current.
- Clamping around both low-voltage source and return conductors, cancelling the field.
- Assuming a mid-rail divider prevents excessive waveform peaks.
- Treating a nominal-voltage VA calculation as measured watts or billing energy.
Testing Checklist
- Confirm the source is factory-isolated 12 V AC with an appropriate current limit/fuse and matching low-voltage load.
- Verify bias and waveform limits before connecting GPIO34.
- Record unloaded noise and a supervised low-voltage load observation separately from any reference measurement.
- Do not infer useful low-current precision from plausible Serial output.
Engineering Tips
- Use only the isolated low-voltage AC arrangement described here.
- Check the CT model and secondary plug contacts before wiring.
- Keep all accuracy claims pending an actual reference comparison.
Upgrade Ideas
- Display the explicitly uncalibrated estimate on an OLED.
- Log the bench source, load and ADC settings with each observation.
Real-World Applications
- Current transformer lesson
- Energy-estimation prototype
- Electrical-safety discussion
FAQs
Is mains wiring covered?
No. Only the isolated, current-limited low-voltage AC loop is supported; a clamp does not make mains work safe for beginners.
Why can a small load read almost zero?
The selected CT is rated 30 A / 1 V. A small bench current produces a small secondary voltage and may be obscured by ADC noise.
Are the displayed amps or VA calibrated?
No. ICAL is an unvalidated starter value and 12 V is assumed, not measured. No accuracy result is supplied.
Review, Testing, and References
Author: Abdul Mubeen and the ESP32 Engine editorial team. Last updated: 2026-11-10. Reviewed: wiring logic, Arduino code structure, beginner safety, and learning sequence.
Educational level: Advanced. Estimated completion time: 90-120 min. This project is for learning and prototyping; production or unattended hardware needs additional engineering review.
Check your result
Before treating this example as working on your hardware, compare the observed behavior with Expected Output and complete the checks on this page. If results differ, use Troubleshooting. Reading this tutorial does not establish successful compilation or hardware operation.
- Isolated sensing
- ADC biasing
- RMS estimate

