The ideal AC current circuit for microcontroller monitoring uses a split-core current transformer (CT) paired with a calculated burden resistor and a mid-supply DC bias network. This topology shifts the bipolar AC waveform into the 0-3.3V unipolar range required by an ESP32 ADC, providing galvanic isolation from lethal mains voltage while avoiding the heat and accuracy issues of inline shunt resistors.

Topology and Node Map for the AC Current Circuit

When designing an analog front-end for AC measurement, you cannot feed a raw alternating waveform directly into a microcontroller. The ESP32 ADC only reads 0V to 3.3V. A raw CT output swings positive and negative around 0V. To fix this, we use a voltage divider to create a virtual ground (DC bias) at exactly half the supply voltage (1.65V), and superimpose the AC signal on top of it.

Here is the exact node mapping and bill of materials for a 100A monitoring circuit. This table serves as your master reference for breadboarding.

Table 1: Component Specification and Node Mapping
Component Value / Spec Node Connections Purpose in Topology
Current Transformer (T1) SCT-013-000 (100A:50mA) Node A (White), Node B (Red) Steps down AC current to measurable mA range; provides isolation.
Burden Resistor (R1) 22Ω, 1/4W, 1% Metal Film Node A to Node B Converts secondary AC current into an AC voltage signal.
Bias Divider (R2, R3) 10kΩ, 1% Metal Film (x2) 3V3 to Node D, Node D to GND Creates a stable 1.65V DC offset (virtual ground).
Bias Filter Cap (C1) 10µF, 16V Electrolytic Node D to GND Stiffens the 1.65V bias rail against AC ripple.
RC Filter Resistor (R4) 1kΩ, 1/4W Node A to Node E Isolates the CT from the ADC sampling capacitor kickback.
RC Filter Cap (C2) 100nF (0.1µF) Ceramic Node E to Node D Forms a low-pass filter to smooth high-frequency noise.
CRITICAL SAFETY WARNING: Never open-circuit a CT secondary (disconnect Node A or B) while the primary mains wire is energized. Without a burden resistor to limit it, the CT core will saturate and induce lethal high-voltage spikes that will arc across your breadboard and destroy your microcontroller. Always install the 22Ω burden resistor before clamping the CT around a live wire.

Why This Topology Beats the Alternatives

Makers often default to Hall-effect sensors like the ACS712 or inline shunt resistors for current measurement. While easier to wire, both fail in critical areas when measuring high-power AC loads. The CT-based AC current circuit wins on isolation, thermal performance, and resolution.

Table 2: Topology Comparison for 120V/240V AC Monitoring
Criteria Split-Core CT (SCT-013) Hall Effect (ACS712-30A) Inline Shunt Resistor
Galvanic Isolation Yes (Magnetic) Yes (Magnetic) No (Direct Conductive)
Heat Dissipation at 15A 0W (Lossless) 0W (Internal 1.2mΩ) High (Requires massive wattage)
Bandwidth / Noise Excellent (No switching noise) Poor (Prone to EMI) Excellent
ADC Resolution Utilization High (Bidirectional swing) Medium (Unidirectional offset) Low (Microvolt signals)
Approx. Cost (2026) $6.00 - $9.00 $3.50 - $5.00 $1.00 - $2.00

The ACS712 introduces significant switching noise and suffers from thermal drift, requiring heavy software filtering. Shunt resistors require dangerous mains wiring and high-gain instrumentation amplifiers. The CT topology, as detailed by the OpenEnergyMonitor project, remains the gold standard for non-invasive, high-resolution AC monitoring.

Behavior Matrix and Failure Extremes

Understanding how the circuit reacts to component drift or catastrophic failure is essential for designing robust firmware and hardware protections. Below is the behavior matrix detailing what happens when specific elements change or fail.

Table 3: Circuit Behavior Under Variable and Fault Conditions
Condition / Fault Effect on Node E (ADC Input) System Consequence
Burden R1 increases to 33Ω Peak voltage exceeds 3.3V rail ADC clipping; reads flat 4095 at waveform peaks.
Bias Cap C1 fails open 1.65V bias sags under load Waveform shifts downward; negative half-cycles clip at 0V.
RC Filter C2 fails short Node E locked to 1.65V DC ADC reads constant 2048; zero AC current reported.
EXTREME: CT Secondary Open Kilovolt spike across Nodes A/B Catastrophic: Arcing, melted breadboard, fried ESP32.
EXTREME: CT Secondary Short 0V AC signal; Node E sits at 1.65V Safe: CT operates safely; firmware reads 0 Amps.

Notice the extreme failure modes. As Fluke's technical documentation emphasizes, a current transformer acts as a step-up voltage transformer when the secondary is open. If you must remove the burden resistor for any reason while the mains wire is clamped, you must first short Node A to Node B with a jumper wire.

Step-by-Step Breadboard Test (Low-Voltage Safe Setup)

Do not test your AC current circuit on 120V/240V mains immediately. Validate the analog front-end using a safe, low-voltage AC source. A 12V AC wall transformer (like those used for old doorbells or halogen lamps) is perfect for this.

Bench Tip: The ESP32's ADC is notoriously non-linear near the 0V and 3.3V rails. By biasing our signal to 1.65V, we keep the waveform in the highly linear middle third of the ADC range, drastically improving measurement accuracy.
  1. Build the Bias Network: Insert R2 and R3 (10kΩ each) into the breadboard. Connect the top to the ESP32 3V3 pin and the bottom to GND. Measure Node D (the junction) with your multimeter. It must read exactly 1.65V (±0.02V).
  2. Add Bias Stiffening: Place C1 (10µF) across Node D and GND. Observe the stripe on the capacitor; ensure the negative leg goes to GND. This absorbs transient current draws from the ESP32 WiFi radio.
  3. Install the CT and Burden: Plug the SCT-013 3.5mm jack into a breakout board, or strip the wires. Connect the white wire to Node A and red to Node B. Install the 22Ω burden resistor (R1) directly across Node A and Node B.
  4. Wire the RC Filter: Connect R4 (1kΩ) from Node A to Node E. Connect C2 (100nF) from Node E to Node D (not GND, because the signal is referenced to the 1.65V virtual ground).
  5. Connect to ESP32: Run a jumper from Node E to GPIO 34 (an input-only ADC pin on the ESP32).
  6. Apply Low-Voltage AC: Clamp the SCT-013 around one of the output wires of your 12V AC transformer (do not clamp both wires, or the magnetic fields will cancel out). Power the transformer.
  7. Verify with Oscilloscope: Probe Node E. You should see a clean sine wave centered exactly on 1.65V. If the 12V transformer pushes ~1A through the test wire, the CT outputs 0.5mA. Across the 22Ω resistor, that is 11mV peak-to-peak. It will be small, but perfectly centered.

Design Walkthrough: Calculating the Burden and Bias

The most common mistake in AC current circuit design is picking an arbitrary burden resistor value from a tutorial without checking the math against your specific ADC voltage. Here is the exact derivation for the 22Ω value used in this topology.

1. Determine Secondary Peak Current:
The SCT-013-000 is rated for 100A RMS primary, yielding 50mA RMS secondary. The ESP32 ADC reads instantaneous peaks, so we must convert RMS to peak.
I_peak = I_rms × √2
I_peak = 0.050A × 1.414 = 0.0707A (70.7mA)

2. Determine Maximum Allowable Peak Voltage:
The ESP32 operates at 3.3V. Our DC bias is set at exactly half of that: 1.65V. Therefore, the AC waveform can only swing ±1.65V before hitting the ADC rails and clipping.
V_peak_max = 1.65V

3. Calculate Ideal Burden Resistance:
Using Ohm's Law (R = V / I):
R_burden = V_peak_max / I_peak
R_burden = 1.65V / 0.0707A = 23.33Ω

4. Select Standard Component:
23.33Ω is not a standard E12/E24 resistor value. We must round down to ensure we never exceed the 3.3V rail at maximum rated current. The closest standard 1% metal film value is 22Ω.

5. Verify the Final Swing:
V_actual_peak = 0.0707A × 22Ω = 1.55V
Biased at 1.65V, the signal swings from 1.65 - 1.55 = 0.10V up to 1.65 + 1.55 = 3.20V. This leaves a safe 100mV guard band at the top and bottom of the ESP32's ADC range, completely avoiding the non-linear dead zones at the rails while maximizing resolution.

By strictly following this node map and calculation method, your AC current circuit will yield clean, linear data ready for RMS conversion in firmware, without risking your hardware or your safety.