The Sensing Principle: How Split-Core CTs Work
A current transformer (CT) operates on Faraday’s law of induction to measure alternating current without breaking the circuit. The single AC power wire passing through the ferrite core acts as a 1-turn primary winding, while the hundreds of internal copper wraps form the secondary. This steps down the high primary current (e.g., 100A) to a safe, measurable secondary current (e.g., 30mA or 50mA) that is strictly proportional to the primary load.
Because microcontrollers cannot read raw AC current directly, the secondary current must be converted to a voltage. Sensors like the YHDC SCT-013-000 include a built-in "burden resistor" (typically 62Ω) that performs this conversion, outputting a 0–1V AC signal. Models without a burden resistor (like the SCT-013-030) output raw current and require an external resistor. Safety Warning: Never run a CT without a burden resistor under load. An open-circuit secondary will generate lethal high-voltage spikes that can destroy the sensor, arc across the terminals, and pose a severe shock hazard.
Hardware Wiring and Bias Circuit Setup
The most common mistake makers make when interfacing a current transformer sensor with an ESP32 or Arduino is plugging the analog AC signal directly into the GPIO pin. The ESP32 ADC only reads DC voltages between 0V and 3.3V. An AC signal swings negative, which will either be read as zero or damage the microcontroller's internal ESD diodes.
To fix this, you must build a DC bias network that shifts the AC waveform up so it oscillates around 1.65V (half of the 3.3V reference). This keeps the entire waveform within the ESP32's safe, linear reading window.
Wiring and Pin Mapping Table
| Component / Pin | Connection Target | Technical Notes |
|---|---|---|
| SCT-013 Tip (Red Wire) | ESP32 GPIO 34 (ADC1_CH6) | Analog input only. Do NOT enable internal pull-up/pull-down resistors. |
| SCT-013 Sleeve (White Wire) | Bias Network Midpoint | Connects to the junction of the two 10kΩ resistors and the 10µF capacitor. |
| ESP32 3.3V Pin | Bias Divider Top | Supplies the top of the 10kΩ/10kΩ voltage divider. |
| ESP32 GND Pin | Bias Divider Bottom & Cap | Ground reference for the divider and the negative leg of the 10µF decoupling capacitor. |
Supply Range Note: The CT sensor itself is passive and requires no power supply. The 3.3V connection is strictly to power the bias network on the microcontroller side. If using a 5V Arduino Uno, change the divider resistors to target 2.5V instead.
Raw ADC to Amperage: The Conversion Math
The ESP32 features a 12-bit SAR ADC, meaning it outputs raw integer values from 0 to 4095. With our bias circuit holding the zero-crossing at ~1.65V, the raw ADC value at rest will be approximately 2048. As AC current flows, the reading will swing above and below this midpoint.
To convert these raw readings into physical Amperage, we must calculate the instantaneous voltage, apply the CT ratio, and then compute the Root Mean Square (RMS) over one or more full AC cycles (50Hz or 60Hz).
The Math Sequence
- Remove the DC Bias:
V_instantaneous = (ADC_raw - 2048) * (3.3 / 4095) - Apply CT Scaling: For the SCT-013-000 (100A max, 1V output), the ratio is 100A per 1V.
I_instantaneous = V_instantaneous * 100.0 - Calculate RMS: Sample the instantaneous current 1500+ times over a 1-second window. Square each sample, find the mean of those squares, and take the square root.
I_rms = sqrt(mean(I_instantaneous^2))
The ESP32 ADC is notoriously non-linear near 0V and 3.3V, featuring a ~100mV deadzone at the bottom. Because our bias circuit forces the AC waveform to oscillate between roughly 0.65V and 2.65V (for a 20A load), we stay perfectly within the ESP32's linear region. This is why the 1.65V bias is mandatory, not optional.
For production code, rely on the OpenEnergyMonitor EmonLib library, which handles the RMS sampling window and phase-shift timing automatically. However, understanding the raw math is critical for debugging when your readings are off by a factor of 10.
Interference, Noise, and Calibration Fixes
If your ESP32 is returning noisy or drifting amperage values, the issue is rarely the sensor itself. Current transformer sensors are highly susceptible to environmental interference and ADC quantization noise.
Common Interference Sources
- Capacitive Coupling from Mains: If you extend the 3.5mm audio jack cable and route it parallel to 120V/240V Romex or THHN wire, the 60Hz electric field will induce noise directly into the analog signal wire. Fix: Use shielded twisted-pair cable for extensions, or route the sensor wire at a strict 90-degree angle to mains wiring.
- Missing Decoupling Capacitor: If you omit the 10µF capacitor in the bias network, the ESP32's internal switching noise will modulate the 1.65V reference point, causing massive jitter in the zero-crossing. Fix: Always use a low-ESR ceramic or tantalum 10µF capacitor physically close to the ESP32 pins.
- Adjacent Magnetic Fields: Clamping the CT around a multi-conductor cable (like standard 14/2 Romex) will result in a near-zero reading because the magnetic fields of the hot and neutral wires cancel each other out. Fix: You must separate the wires and clamp ONLY around the single hot (line) conductor.
Calibration and Scaling
The YHDC SCT-013 has a stated accuracy of ±3%. Furthermore, the ESP32's internal 3.3V reference can vary by up to 5% between different dev board batches. To calibrate, measure a known resistive load (like a 1500W space heater) using a trusted True-RMS clamp meter. Adjust the 100.0 multiplier in the math sequence above until the ESP32 serial monitor matches the clamp meter. Typically, a calibration constant between 96.0 and 104.0 is required for the SCT-013-000 on generic ESP32 DevKit V1 boards.
Current Transformer Sensor FAQ
Can I use a current transformer sensor on DC circuits or solar battery banks?
No. Current transformer sensors rely entirely on a changing magnetic field (dΦ/dt) to induce a voltage in the secondary winding. A steady DC current creates a static magnetic field, which induces zero voltage. For DC current measurement in solar or battery systems, you must use a Hall-effect sensor (like the ACS712 or INA219) or a shunt resistor with an amplifier.
Why is my ESP32 reading jumping around when the AC load is disconnected?
This is known as ADC quantization noise and environmental pickup. When no load is present, the CT outputs microvolts of noise, which the ESP32's highly sensitive 12-bit ADC amplifies. To fix this, implement a software low-pass filter or a deadband threshold in your code: if the calculated RMS current is below 0.15A, force the output variable to 0.0. Ensure your bias network capacitor is properly soldered and not floating.
Do I need an external burden resistor if my current transformer sensor has a built-in audio jack?
Check the exact model number printed on the sensor. If it is the SCT-013-000 (ending in -000), it has an internal 62Ω burden resistor and outputs 0-1V AC. You do not need an external resistor. If it is the SCT-013-030 (ending in -030), it outputs 0-30mA and lacks an internal burden resistor. You must wire a 100Ω external burden resistor across the tip and sleeve of the audio jack to convert the current to a 0-3V signal before feeding it to the bias network.
How do I calibrate the sensor if my multimeter and ESP32 readings disagree?
First, verify your multimeter is a "True-RMS" meter; cheap averaging meters will read incorrectly on non-linear loads like LED drivers or switching power supplies. Next, verify your ESP32 sampling rate. You must sample at least 1500 times per second to capture the peaks of a 60Hz waveform accurately. If the sampling rate is too low, the RMS calculation will underestimate the true current. Consult the Espressif ADC Oneshot Driver Documentation to optimize your ESP-IDF or Arduino ADC polling loops for maximum speed.






