To monitor a circuit protected by ground fault circuit interrupter GFCI breakers using an ESP32, you must use a non-invasive split-core current transformer (CT) and an isolated 5V power supply. Never wire your microcontroller’s ground to the panel’s neutral bus downstream of the GFCI, and never use a transformerless capacitive dropper power supply. For load monitoring, clamp the CT around the hot wire only; for leakage (ground fault) monitoring, pass both the hot and neutral wires through the CT window.

The Hazard: What Happens When Smart Wiring Defeats GFCI Protection

WARNING: Lethal Shock and Fire Risk
A ground fault as low as 5mA (0.005 Amps) can cause ventricular fibrillation in humans. GFCI breakers are designed to trip within 25 milliseconds when they detect a 4-6mA imbalance between the hot and neutral conductors. If an embedded hardware maker incorrectly wires a smart sensor’s neutral return to the ground bus downstream of a GFCI breaker, it creates a parallel neutral path. This will either cause the GFCI to trip constantly (nuisance tripping) or, if wired upstream incorrectly, it can mask a genuine ground fault, defeating the life-saving protection entirely.

The specific hazard this practice prevents is electrocution from undetected leakage currents and electrical fires caused by arcing faults to ground. When integrating microcontrollers into mains panels, the most common failure mode is the maker assuming the "ground" and "neutral" bars are interchangeable. In a subpanel or downstream of a GFCI, they are not. Mixing them up bypasses the GFCI's internal toroid sensor, rendering the ground fault circuit interrupter GFCI breakers blind to actual faults.

Ground vs. Bond vs. Neutral: The Embedded Maker's Guide

Before opening a panel to install sensors, you must understand the physical distinction between these three conductors. Confusing them is the root cause of 90% of smart-panel wiring failures.

  • Neutral (The Return Path): The grounded current-carrying conductor. It carries the exact same current as the hot wire back to the source under normal conditions. It is white or gray.
  • Ground (The Fault Path): The equipment grounding conductor (EGC). It carries zero current under normal conditions. It only carries current during a fault to trip the breaker. It is bare copper or green.
  • Bond (The Meeting Point): The physical connection between the neutral and ground systems. NEC-style guidance dictates this bond must occur only at the main service disconnect. In any subpanel, or downstream of a GFCI breaker, the neutral and ground must remain strictly isolated.

When wiring your ESP32 sensor circuit, your DC ground (GND pin) must only connect to the DC ground of your isolated power supply. It must never touch the panel's neutral or ground busbars.

Decision Tree: Choosing the Right Sensor for GFCI Circuits

Not all current transformers measure the same thing. Use this decision path to select the correct hardware for your ESP32 project.

What do you want to measure? How to wire the CT sensor Recommended Hardware Pick
Total Load Current (e.g., "Is the sump pump running?") Clamp split-core CT around the Hot wire only. YHDC SCT-013-030 (30A max, built-in burden)
Leakage / Ground Fault (e.g., "Is current escaping to ground?") Pass both Hot and Neutral through a solid or large split-core toroid. CR Magnetics CR8410-1000 (Designed for 5mA-100mA resolution)
Power / Energy (Voltage × Current) CT on Hot wire + ZMPT101B voltage sensor (requires strict isolation). YHDC SCT-013-000 + isolated ZMPT101B module
The Concrete Pick: If your goal is to build a smart monitor that alerts you to degrading insulation or minor ground faults before the GFCI trips, buy the CR Magnetics CR8410-1000. It is specifically wound for high sensitivity at low currents (milliamps), whereas standard 100A CTs cannot accurately resolve a 5mA leakage current through the ESP32's 12-bit ADC.

Step-by-Step: Non-Invasive ESP32 Installation

This procedure covers adding a non-invasive load monitor to a branch circuit protected by ground fault circuit interrupter GFCI breakers. This does not require altering the breaker's internal wiring.

  1. De-energize and Verify: Turn off the main breaker. Use a non-contact voltage tester (NCVT) and a CAT III multimeter to verify the busbars are dead. Note: If you are not comfortable working inside a dead panel, stop here and hire a professional.
  2. Route the Sensor: Identify the branch circuit's hot wire (black or red) leaving the GFCI breaker. Clamp your split-core CT around this single wire. Ensure the arrow on the CT points toward the load (away from the breaker).
  3. Wire the DC Bias Circuit: The ESP32 ADC reads 0V to 3.3V, but AC current alternates positive and negative. You must center the AC signal at 1.65V. Connect two 470kΩ resistors in series across your 3.3V and GND pins to create a 1.65V midpoint. Connect the CT signal wire to this midpoint via a 10µF decoupling capacitor.
  4. Connect to ESP32: Wire the conditioned CT signal to GPIO 34 (ADC1_CH6). Avoid ADC2 pins (like GPIO 25, 26, 27) if you plan to use WiFi, as ADC2 is disabled when WiFi is active.
  5. Power the Microcontroller: Plug the ESP32 into a standard, UL-listed 5V USB wall adapter. Do not build a custom mains-to-5V power supply inside the panel unless it is a fully enclosed, isolated DIN-rail module (like a Mean Well IRM-03-5).
  6. Restore Power and Calibrate: Turn the main breaker back on. Use the OpenEnergyMonitor EmonLib port for ESP32 to sample the ADC at 4kHz and calculate the RMS current.

Verifying Operation and When to Call a Pro

Once your ESP32 is reading data, you must verify both the safety of the panel and the accuracy of your sensor.

How to Verify the GFCI and Sensor

  • Test the GFCI: Press the physical "TEST" button on the GFCI breaker. The breaker should trip with an audible click, and your ESP32 should instantly read 0.00 Amps. If the breaker does not trip, the GFCI is defective and must be replaced immediately.
  • Test with a Receptacle Tester: Plug a dedicated GFCI receptacle tester (e.g., Klein Tools RT210) into an outlet on that branch. Press the test button. This simulates a ground fault and verifies the breaker's internal toroid is functioning correctly despite your external sensor.
  • Verify DC Bias: With the ESP32 powered but no AC load running, measure the voltage at GPIO 34 with a multimeter. It should read exactly 1.65V (±0.05V). If it reads near 0V or 3.3V, your bias resistors are incorrect, and the ESP32 will clip the AC waveform.

When a Licensed Electrician is Required

While clamping a non-invasive sensor around an existing wire is generally safe for a competent DIYer, you must call a licensed electrician if your project requires:

  • Removing the panel cover to install a new GFCI breaker (requires working near live main busbars).
  • Terminating or modifying the neutral or ground busbars.
  • Adding a subpanel or modifying the main service entrance.

Disclaimer: References to NEC Articles 210.8 (GFCI Protection) and 250.142 (Grounding/Bonding) are provided as NEC-style guidance for safe practice. Your local Authority Having Jurisdiction (AHJ) or electrical inspector has final legal authority over all panel modifications and smart home integrations.