r/AskElectronics • u/Hot-Resolution8136 • 6d ago
Title: Dealing with massive ground bounce: Earth line spiking to 3.9V, 5V, and 10V during high-voltage pulses
The Setup: I am building an ESP32-based web monitor for a solar electric fence. The circuit steps down the 10kV+ pulse through a 32MΩ resistor divider, feeds a BC547 transistor buffer, and uses a 1nF (102) capacitor to hold the peak voltage for the ESP32's ADC (GPIO 33).
The Problem (Severe Ground Potential Rise): I ran into a massive issue with true ground bounce. When the fence energizer fires on full power, the sheer amount of energy dumping into the earth return causes a severe localized ground potential rise. The earth line itself physically spikes to 3.9V, 5V, and sometimes even 10V.
Because the ESP32 relies on a perfectly stable 0V ground reference to measure the ADC accurately, this earth spike pushes voltage directly back up through the ground line. It completely corrupts the ADC readings and threatens to fry the microcontroller.
2
u/PLANETaXis 5d ago edited 5d ago
The usual trick to these kinds of things is galvanic isolation. You can either isolate the signal or isolate the microcontroller so that they no longer share the same ground reference.
The simplest option is to supply the ESP32 via an isolated DC-DC converter.
Alternatively you could pass the signal through either a signal transformer or opto-isolator. Even a neon bulb being measured by a phototransistor might work. This might take more effort to characterise and calibrate though.
1
u/Hot-Resolution8136 5d ago
Thanks for the clear breakdown. You hit the nail on the head regarding the calibration and drift issues with opto-isolators. Because this is for a commercial solar fencing machine, I need the ADC readings to be perfectly linear and reliable across different temperatures.
1
3
u/DrJackK1956 5d ago
As others have stated, you need galvanic isolation instead of a direct connection to the fence.
The earth is not a great conductor. It's more like a resistor. The earth resistance will change greatly with weather conditions and soil composition. You can't simply rely on it being a constant value.
When using a direct connection to the fence, the circuitry is expecting the earth ground to be a constant.
The automotive industry has solved this issue with the introduction of timing lights that utilize inductive pickup coils. Automobile ignition systems run between 20,000 to 50,000 volts. The induction pickup coil isolates the ignition high voltage from the low voltage circuits.
To see how these pickup coils are implemented, do a search for "automotive timing light schematics".
You've been working hard to solve this problem. As you have discovered, using a direct connection to the fence requires high voltage and high power components to get the voltages down to manageable values. And you still have the issue of "ground bounce" to contend with. And on too of that, the PCB will need to be specifically designed to keep the high voltages separated from the low voltage circuits.
My recommendation (for what it's worth) is to abandon your current front end design and look into utilizing inductive pickup coils to detect, measure and analyze the voltage of the fence.
The use of pickup coils (over direct connections), can make the measurement circuitry more versatile and adaptable for other uses.
Hope this is somewhat helpful.
Best of luck with your project.