# What is the best and compact method for varying AC current between 1mA to 100mA for a 500VAC?

I am working on a testing project. The objective is to test an equipment which assures safety to personal when there is a certain current passing through earth wire. So, I must emulate an unsafe condition with current flowing through the earth-wire.

In this project, a microcontroller should control the power drawn from mains. I need to draw current between 1mA to 100mA from a 440VAC to 500VAC. I have a working model with a variable rheostat controlled by stepper motor. However, it is bulky. I want to make it simpler.

Option 1: I am exploring the options of using a circuit with MOSFET. The example circuit is shown below with a mechanical switch instead of a MOSFET. However, I am unable to attenuate the noise. When I go for attenuating the noise, current through the capacitor is reaching values above 100mA.

Option 2: Using a High power BJT as an amplifier. In this technique, I am unable find how can I provide galvanic isolation between the high voltage and the instrumentation.

I guess, my problem will be solved, if I can find a better filter for option 1 or a better isolation circuit for the second option.

Also, if you have any other option, please tell me.

I think I didn't explain the problem correctly. The current flow through the earthwire is not important. The important part is the current flow between line and neutral is not equal. When the equipment (which I want to test) detects that there is a difference between Line current and the current through neutral, it raises alarm. I must test that the alarm is raised as designed. So, I make some current flow through the earthwire.

• It would be nice to know exactly what you are doing. What's the instrumentation type? Is this for a small Geiger counter? Or is this supposed to be some kind of 'lab equipment' used for a variety of unstated purposes? And you are aware that this is both high voltage and relatively high power, as well? Not something to "just go do." Without disclosing more details, it may be difficult to suggest things. That said, visit Dr. Prutchi's site here. They disclose a 250 kV supply, too.
– jonk
Commented Jul 27, 2021 at 16:50
• @jonk I update the purpose in the first paragraph. Commented Jul 27, 2021 at 17:00
• What about a bunch of series resistors with relay contacts across them? 2K /1K/500/250/125/62.5 etc. Dissipation at 100mA 20W/10W/2.5W/1.25W/0.63W etc. Commented Jul 27, 2021 at 17:10
• @SpehroPefhany I guess, it may get bulky to use a high voltage relay. Also, we get a limited resolution. Commented Jul 27, 2021 at 17:13
• Your diagram shows a circuit that will deliver an average of 62 Watts of power to a 4K resistor (125mA through the resistor) when a switch is closed. It doesn't show any relationship to the equipment that you intend to test. How will driving current through that resistor have any effect on your "equipment which assures safety to personal?" Commented Jul 27, 2021 at 19:40

I imagine your instrument is intentionally conducting AC to some end of ground or you are trying to simulate a fault. We define 0V as Gnd anywhere we want but earth bonded ground would be 0V at the source of earth bonding and elsewhere with no current flowing.

What you are trying to do in rather unorthodox when all you need to do is use a variable DC current limited power supply and measure the mV rise between any 2 ground points. E.g. UL might test with 10Adc to ground and expect a cordset to chassis ground to rise no more than 1V.

You wish to know the potential rise due to Ohm’s Law for some impedance x current =Vac by varying the current. Normally earth-bonded equipment must have a total resistance of 100 mohm max from plug to chassis but you might be simulating a faulty ground current injected elsewhere.

This is easily tested with 1 to 10 Adc and measuring the ground voltage rise.

Normally if this current is internally generated it limited by design according to CE and UL limits such as 2.5mA in some cases max. and is tested using an AC ammeter for injected leakage currents to ground for noise suppression from SMPS’s X caps in line filter.

Of course mOhm DMM’s exist but do not stress the ground path with more than 1 mA.

I see no reason to improve your setup as the purpose to measure unsafe voltage rise from injected current can be tested much simpler with higher currents using a current limited DC supply.

New specs

It appears to be only a GFCI tester required but specs are missing.

e.g.

• HIPOT isolation ~3.3 kV <100 uA to ground.

• Must not trip ~ x.x mA Using imbalanced load ( no gnd required )

• Must trip ~ xx mA within xxx ms, (several pulses variations ).

This can be implemented electronically with a rectified AC load and transistor regulated load to 100 mA with dummy load resistors and caps in parallel with a mux to for each level or DAC and ramp with heat sink on driver and dummy load to limit current .

• I think I didn't explain the problem correctly. The current flow through the earthwire is not important. The important part is the current flow between line and neutral is not equal. When the equipment (which I want to test) detects that there is a difference between Line current and the current through neutral, it raises alarm. I must test that the alarm is raised as designed. So, I make some current flow through the earthwire. Commented Jul 28, 2021 at 13:18
• You need to edit the first paragraph of your question again then. It specifically says, "when there is a certain current passing through earth wire." Now it seems you want to monitor imbalance between the live and neutral and don't actually care what the earth current is (although in practice it will be the difference between L and N). Commented Jul 28, 2021 at 17:21

What SKGadi describes is "Ground Fault Detection". The idea is that electric power delivery has to stay in the signal wires (line), hot & neutral. Leakage to ground is hazardous.
There are multiple ways to detect it. Start looking into this device first.

Are you trying to pulse width modulate the FET switch to give a variable average current as the load to the bridge rectifier?

If so, you need to low pass filter in a loop outside the switching element, so the current and voltage are smooth in the long term (I mean here smoothed over many cycles of the 100kHz) and that needs to still vary smoothly over the mains cycle. You will need significant L and C, and a second fast switch to connect that filter to the correct side of the incoming mains on alternate half cycles.

I think this is a poor approach, as the LC filters will be bulky. I assume the thing it tests trips off the power in a short time, so the dissipation of resistors etc is not such an issue as their peak voltage stand off - if so, then note that in the same space of an LC filter, you can have several steps of binary resistors and FETs to switch them, each under opto-isolated control if required, fast enough to switch wherever you want between the crest or the zero of the mains cycle to within a few degrees. With power, it is best to keep it big and simple. Let us know how you get on.

• Mike PJ - Welcome :-) FYI, this site needs 2 x Enter to insert a blank line. More editing / formatting help here. As a new user on the site, I also recommend you read the site tour and help center, as the rules and etiquette are quite different from typical internet forums. Thanks and, again, welcome. Commented Jul 29, 2021 at 16:55