# High voltage continuity & leakage tester

#### strantor

Joined Oct 3, 2010
5,369
I have designed this little board which will monitor a 7 conductor cable during a specific stage of production. During this stage, the cable (between 3,000ft & 40,000ft) is having heavy duty steel armor wires wrapped around the outside of it and there is a potential for one or more of these steel armor wires (if the tension is not set properly) to cut into the cables, resulting either in a direct short from conductor to armor wire, a high resistance short from conductor to armor wire (think armor wire compressed almost all the way through conductor insulation) or an open caused by armor wire severing one or more of the conductors. The purpose of this board is to detect any of the above scenarios and shut down the machine so that a repair can be made before it's too late, or so the cable can be scrapped before all the supplies are used up. The armor wire contacts the machine, which is bolted to the ground, so armor wire = chasis ground = earth ground. It is controlled by an arduino microcontroller and has 2 relay outputs; one for the 120V machine run signal, and one for a 120V red/green stack light.

The board is already made and I have tested it on a few diffferent conductors, and it performs perfectly. What I am seeking from the members here is a little proofreading of my circuit & the ideas behind it. I am a novice at best and there's a good chance that I designed this thing insufficiently in one or more areas. As you read, if what I say is incorrect ot my circuit is incorrect, please tell me. On monday I will be demonstrating the operation of the device to the thermoplastics engineers who design the cables that we make to get their blessing to install it; so if you have something to say, please speak now. Thanks

The basic theory of operation is that 1,000v from the DC/DC converter will be sent out on the center conductor, weave back and forth through the rest of the conductors, and return on 2 conductors. the DC/DC converter can only supply 1.5mA, so it should be able to push all 1000V across 666KΩ; any lower resistance and voltage starts to drop off. In the circuit, I have 10MΩ of resistance, (plus 500Ω-5KΩ for the conductor), so that means that theoretically I should be able to start to detect a DC/DC voltage output drop (leakage from conductor to armor wire) around 715KΩ. The voltage recieved back on the 2 conductors is conveyed to the microcontroller via a darlington optocoupler. I am aware that the output of the opto is not linear, but at the specific current resultant of the 20MΩ resistors, it seems to be the "butter zone" and testing has shown that I get a useable analog output from it - doesn't need to be exact. The μcontroller recieves the 2 analog signals (inverted signals) from the opto and compares them to a value from a potentiometer; this value would be the user-set tripwire - if the value of either opto channel is > than the pot value, there is a problem: either there is a short to ground or an open.

Ok, first a couple of pics:

I know it's not pretty, but it's functional, and I'm likely the only one who will ever see it from the back side.

Now the drawing:

And finally, the code:

Rich (BB code):
/*
Armor Machine Fault Tester

Also prints the results to the serial monitor.

The circuit:
see drawing

created 11 jan. 2011
by Charles Staton
*/
const int optoCH1InPin = A2;  // Analog input pin that ch1 of the optocoupler is attached to
const int optoCH2InPin = A1;  // Analog input pin that ch2 of the optocoupler is attached to
const int thresholdpotInPin = A0;  // Analog input pin that the potentiometer is attached to
const int allgood =  3;       //output that will trigger relay for lightstack green light & relay for machine estop contact closure
const int turn1KVon = 2;      // output to relay that will turn on the 1KV DC/DC converte
const int resetbutton = 4;    // reset button, will turn the unit on initially & reset after a fault is detected.
int opto1Value = 0;           // value read from the optocoupler CH1
int opto2Value = 0;           // value read from the optocoupler CH2
int thresholdValue = 0;       // value read from the threshold pot
int leakagedetected = 0;      // Value to store if optocoupler in is higher or lower than threshold value
int reset = 1;                //  value to store state of reset button (normally closed button)
int startupsequence = 0;
void setup() {
pinMode(allgood, OUTPUT);
pinMode(resetbutton, INPUT);
pinMode(turn1KVon, OUTPUT);
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
if (reset == 0) {
startupsequence = 1;
}
else {
startupsequence = 0;
}
if (startupsequence == 1) {
digitalWrite(turn1KVon, HIGH); //turn on the HV and..
delay(500); //wait half a second for it to charge up
startupsequence = 0;
}

//detect leakage. If the voltage on both opto channels are higher than
//the user-set threshold voltage then no leakage tripwire exists. The
//principle is that if an indirect short allows enough current to pass,
//the voltage output of the dc/dc converter will drop.
if (opto1Value > thresholdValue || opto2Value > thresholdValue ) {
leakagedetected = 1;
}
else {
leakagedetected = 0;
}
if (leakagedetected == 1){
digitalWrite(allgood, LOW);
}
else{
digitalWrite(allgood, HIGH);
}
}
else{
digitalWrite(turn1KVon, LOW);
digitalWrite(allgood, LOW);
}

#### strantor

Joined Oct 3, 2010
5,369
Nothing?
I'm going to demonstrate this in 4 hrs

#### strantor

Joined Oct 3, 2010
5,369
Ok, demonstration went over very well. Device performed as advertized in front of my audience of engineers.

There is however time for any suggestions, as it will be a couple of days before I have a chance to install it.

I guess I am looking for a prediction as to how long the circuit will last as I have designed it. What I am afraid of is that right now it works great, but after a week of running is it going to crater and make me look like an a-hole?

#### SgtWookie

Joined Jul 17, 2007
22,220
Well, the point-to-point wiring on the back of the board looks a bit iffy. You have some rather close tolerances there, and I don't know offhand what's high and what's low voltage, nor do I have time to figure it out.

When you're dealing with HV on a circuit board, you need to pay attention to how closely things are routed, provide extra separation in HV areas, and it's really good if you can actually have cuts in the board to prevent carbon tracking - if there is no board for carbon to form on, there is not much of a chance for a short circuit.

You might consider designing a PCB for the project. Once the PCB is assembled and tested, you can use conformal coating rated for high voltage to prevent the accumulation of carbon and/or debris on the board where it could interfere with the operation of the circuit. "Corona Dope" is one kind of HV insulation that is suitable for such applications; around 4kv per mil thickness.

If your application is just going to be used for the "short haul", then it may not be worth going to the extra trouble. However, if it's going to be in use for a long period of time, it would be worth building in the extra reliability, as "down time" is very expensive.

#### ErnieM

Joined Apr 24, 2011
8,058
Sorry I missed your deadline, I only saw this this morning as I was leaving for work.

OK, so you tie the "drive wire" to the others such that all wires should see the same 1,000 volts. Each side of the sense sees 4 round trips thru the wire. How much resistance does 4 x 40,000 feet give? Is that where the 666K ohms comes from?

OK, so with no wire in the works the diodes dropping R sees the full 1,000 volts:

I = 1,000/ 20M = 50 uA

And with the long wire:

I = 1,000/ 20.666M = 48 uA

so the current seems stable and should allow you to detect broken wires.

What worries me is YOU HAVE 1,000 VOLTS GOING OUT OF THIS THING.

That is a TON of voltage, enough top fry someone touching something they should not touch, such as a frayed end when there is a problem.

You have switches for turning off the machine, yet you let this current go on and on, even after a fault is detected, even before you start testing. And you put the 20 M ohms on the "safe" side of the circuit. If they go anywhere it is on the 1,000 volt output, that might be the only thing that keeps some poor guy alive.

This is a good place to put a ground fault detector! Only currents coming back thru the wires are allowed. Any current coming back thru ground trips this OFF.

1) Relay to shut off the 1,000 volts. Putting a relay before it and after it is not overkill.

2) move those 20M resistors to the better place.

3) Add TWO switches to turn it on (you may already have these).

I do not know your installation. You need to very carefully review it to make sure no fault, either by the operator or by equipment, can allow this lethal voltage to escape from your device.

#### strantor

Joined Oct 3, 2010
5,369
You have some rather close tolerances there, and I don't know offhand what's high and what's low voltage, nor do I have time to figure it out.
Sorry about that, see attachment. I don't know what the tolerance is for 1000V or 120V, but I just left as much room as I could. The holes are standard .254.
...and it's really good if you can actually have cuts in the board to prevent carbon tracking - if there is no board for carbon to form on, there is not much of a chance for a short circuit.
Never hear of carbon tracking. I will look into it; maybe I can design it into the PCB that I have in the works. Thanks.

You might consider designing a PCB for the project. Once the PCB is assembled and tested, you can use conformal coating rated for high voltage to prevent the accumulation of carbon and/or debris on the board where it could interfere with the operation of the circuit. "Corona Dope" is one kind of HV insulation that is suitable for such applications; around 4kv per mil thickness.

If your application is just going to be used for the "short haul", then it may not be worth going to the extra trouble. However, if it's going to be in use for a long period of time, it would be worth building in the extra reliability, as "down time" is very expensive.
I currently have a PCB design made in eagle. I tried the toner transfer thing a while back and almost had success. I will be making more of these things if this prototype turns out to work long term; and those will definately be on a PCB.

#### Attachments

• 129.3 KB Views: 306

#### strantor

Joined Oct 3, 2010
5,369
Sorry I missed your deadline, I only saw this this morning as I was leaving for work.
No worries. I still have a couple of days before I install it. Plus, I will be making another one, so any advise will help.

OK, so you tie the "drive wire" to the others such that all wires should see the same 1,000 volts. Each side of the sense sees 4 round trips thru the wire. How much resistance does 4 x 40,000 feet give? Is that where the 666K ohms comes from?
4X40,000ft gives between 500-5000Ω depending on the type of cable we run.
The 666K ohms was what I calculated for the minimum resistance the DC/DC converter can pass 1000V through (1.5mA max output). 1000V/1.5mA = 666KΩ.
OK, so with no wire in the works the diodes dropping R sees the full 1,000 volts:

I = 1,000/ 20M = 50 uA

And with the long wire:

I = 1,000/ 20.666M = 48 uA

so the current seems stable and should allow you to detect broken wires.

What worries me is YOU HAVE 1,000 VOLTS GOING OUT OF THIS THING.

That is a TON of voltage, enough top fry someone touching something they should not touch, such as a frayed end when there is a problem.

You have switches for turning off the machine, yet you let this current go on and on, even after a fault is detected, even before you start testing. And you put the 20 M ohms on the "safe" side of the circuit. If they go anywhere it is on the 1,000 volt output, that might be the only thing that keeps some poor guy alive.
In the code, as soon as a fault is detected, it immediately cuts power to the DC/DC converter. I have found that if there is an open at the far end of the cable, the capacitive charge in the cable itself will continue to feed the unit for a few seconds, so opens at long distances are detected a little late. I don't see a way around this.

This is a good place to put a ground fault detector! Only currents coming back thru the wires are allowed. Any current coming back thru ground trips this OFF.
In my mind, I see this whole thing is a ground detector, just functioning opposite of normal ones. it reads the absence of return voltage in the proper place, vise the presence of voltage in the improper place.

I may design the next one the other way around, as I know I'm not smarter than the guy who designed the normal type.

1) Relay to shut off the 1,000 volts. Putting a relay before it and after it is not overkill.
It has one, relay "A". I did not put one on the 1KV side because I didn't have one with contacts rated for that. I will plan the next one accordingly.

2) move those 20M resistors to the better place.
What about this: the DC/DC converter only puts out 1.5mA, not enough (going off the magic 4mA number) to kill, but the reel is a giant capacitor, which has no current limiting if there are no resistors between it and ground. If I put too much resistance between a potential fault location and ground, it won't register a fault anymore. How about if I put just enough resistance there to limit a capacitive discharge to 4mA, and leave the rest of the resistance where it is?

3) Add TWO switches to turn it on (you may already have these).

I do not know your installation. You need to very carefully review it to make sure no fault, either by the operator or by equipment, can allow this lethal voltage to escape from your device.
Thank you very much for your insight.

#### strantor

Joined Oct 3, 2010
5,369
Ok, So I slept on it and realized that this:

This is a good place to put a ground fault detector! Only currents coming back thru the wires are allowed. Any current coming back thru ground trips this OFF..

I have found that if there is an open at the far end of the cable, the capacitive charge in the cable itself will continue to feed the unit for a few seconds, so opens at long distances are detected a little late. I don't see a way around this.

In my mind, I see this whole thing is a ground detector, just functioning opposite of normal ones. it reads the absence of return voltage in the proper place, vise the presence of voltage in the improper place.
If I redesign the board to detect current flowing back through ground, rather than waiting for the output voltage to drop + capacitive charge in the reel to dissipate, then I can detect a fault in the cable the instant it happens.

EDIT: Actually, that is how I planned it in the beginning (I have been working on this off-and-on for months) but changed my mind somewhere along the line. I don't remember why, but I had a reason for it.

This is exactly the kind of food for thought I was looking for. Thank you again very much.

Last edited:

#### studiot

Joined Nov 9, 2007
4,998
Well, the point-to-point wiring on the back of the board looks a bit iffy. You have some rather close tolerances there, and I don't know offhand what's high and what's low voltage, nor do I have time to figure it out.
I'll echo these statements with the following.

Any soldered joints at high voltage should be rounded to avoid sharp points. This avoids the danger of HV point discharge which can damage the circuit etc. Such discharge can reach a very long way between metal points at high voltage difference.

I have attached an extract from your pic to show what I mean, although I too do not know if the joint in question is at high or low voltage.

go well

#### Attachments

• 15.7 KB Views: 20

#### strantor

Joined Oct 3, 2010
5,369
Any soldered joints at high voltage should be rounded to avoid sharp points. This avoids the danger of HV point discharge which can damage the circuit etc. Such discharge can reach a very long way between metal points at high voltage difference.

I have attached an extract from your pic to show what I mean, although I too do not know if the joint in question is at high or low voltage.

go well
That specific extract is the 0V portion of the circuit, but you point out something that I did not know. Does a point increase the likelihood of an arc, or does increase the range that an arc can travel? - or I guess those 2 are one in the same. For good design, I will round off the points, but just out of curiosity, would covering all the high voltage parts with insulative eopxy or potting negate the effect of the points?

#### SgtWookie

Joined Jul 17, 2007
22,220
Carbon tracking can occur around high voltage circuits where there are particulates in the atmosphere. As the carbon track builds up, the resistance of the carbon track decreases, eventually causing a low-resistance path for the current to flow.

This was quite common in automotive electronic ignition systems back when they had distributor caps; the inside of the cap would accumulate carbon tracks over time, eventually causing ignition misfires; intermittent at first, then soon becoming a regular misfire. This became a big problem in the mid-1970's with GM autos when they came out with the so-named "high energy ignition"; the carbon tracks built up at a much higher rate due to the increased spark plug gap causing a higher secondary voltage on the ignition.

You might also observe carbon tracking on the circuit boards of very old television sets or tube (valve) amplifiers.

At 1kv, the tracking may take a long time to form; however you really don't want it to form at all. With the testing you are performing, even minor unplanned current paths could spoil the tests; possibly resulting in scrapped wire assemblies (lots of \$ lost) until the actual problem can be determined.

The test procedure should include some sort of verification of board functionality; that it doesn't indicate a short on it's own, but does trip when a known value of resistance is used from the board to ground.

Once you get your Eagle schematic complete and your board started, you should post them up to get some feedback.
Posting .png format files in 80dpi to 150 dpi is a must; if you also post your .sch and .brd files, some of us may show you some suggestions using your source files.

Last edited:

#### ErnieM

Joined Apr 24, 2011
8,058
Does a point increase the likelihood of an arc, or does increase the range that an arc can travel? - or I guess those 2 are one in the same.
Remember good ole Benjamin Franklin and his lightning rod? Same concept, the point helps "concentrate" the voltage for a discharge.

For good design, I will round off the points, but just out of curiosity, would covering all the high voltage parts with insulative eopxy or potting negate the effect of the points?
Epoxy will insulate very nicely, except it will tend to run off the points. So don't do that! <grin>

#### strantor

Joined Oct 3, 2010
5,369
The test procedure should include some sort of verification of board functionality; that it doesn't indicate a short on it's own, but does trip when a known value of resistance is used from the board to ground.
That's how I set the adjustment pot. I put a 1MΩ resistor across the terminals and adjusted the pot until the device tripped. Now it will trip anwhere below 1MΩ. The second test I performed was slowly pinching the insulated wire under test against a grounded armor wire with insulated channel-lock pliers. The device will trip before the insulation is broken, which is what I'm after. These test are very repeatable; I have done them countless times and will do them again after it is installed on the armor machine.
Once you get your Eagle schematic complete and your board started, you should post them up to get some feedback.
Posting .png format files in 80dpi to 150 dpi is a must; if you also post your .sch and .brd files, some of us may show you some suggestions using your source files.
Will do. Probably not right away, as other work has been piling up as I've been preoccupied with completing this thing.

#### studiot

Joined Nov 9, 2007
4,998
Does a point increase the likelihood of an arc, or does increase the range that an arc can travel?
Both.

I have dashed off some quick sketches concerning good high voltage practice.

In general you need to look also at the component side of the board and try to place components so that adjacent leads do not carry HV or are insulated or both.

#### Attachments

• 30.1 KB Views: 34

#### strantor

Joined Oct 3, 2010
5,369
Both.

I have dashed off some quick sketches concerning good high voltage practice.

In general you need to look also at the component side of the board and try to place components so that adjacent leads do not carry HV or are insulated or both.
awesome! thanks! I can identify quite a few spots on my board (mainly the low voltage part) that fall under the "bad" category. I had no idea. I will need some more solder practice.

#### strantor

Joined Oct 3, 2010
5,369
Mods, This device has been in service for almost a year now. It works marvelously, and has proven itself multiple times. It's a pretty niche thing and I doubt it would help anybody but myself, but I would still like it to be represented in the completed projects forum. Post #1 is pretty well documented, and having lost all the data on my hard drive, I will actually be using post #1 as the guide to building 2 more for our other machines. The new models will be built on arduino protoshields, and housed in an arduino enclosure to look more professional.