Open circuit fault detection using arduino

Hey guys i was able to implement Short circuit fault detection of UG Cables and i was also able to add a GSM module(SIM900D) with it. I'm trying to further enhance my project by detecting Open circuit fault detection. But it seems a bit tough as i can't extract any useful information from and open terminal(V=0 and I=0 because of the open terminal). So i tried searching online and found 2 relevant papers that uses and RC meter to count the time constant to find the open circuit location. The circuit diagram and code are given in the link of pdf. The links are given below

Also here is the link to RC meter link

But the problem is that when i generate an open circuit across the charging resistor and change it's resistance both the time constant and capacitance changes while keeping the resistor constant so it's not really useful for open circuit fault detection. Can anyone tell me if i'm doing something wrong or how i can implement this differently to get an accurate result.
Here is the pic of my simulation below

But the problem is that when i generate an open circuit across the charging resistor and change it's resistance both the time constant and capacitance changes while keeping the resistor constant so it's not really useful for open circuit fault detection. Can anyone tell me if i'm doing something wrong or how i can implement this differently to get an accurate result.

The cable has a fixed capacitance and resistance per meter of length. Each parameter (resistance and capacitance) increases for longer lengths and so does the time constant. Therefore, just measuring the time constant should give you the distance to the open circuit. See modified simulation image attached.

I tried running your circuit with the same code but it still give me the same thing a changing value of C and Taw and while R stays constant. I know it's because of R=Taw/C and in my code R is a declared Value so it acts like a constant. Here is the following result i got....1st pic shows simulation without fault 2nd ones shows fault at first switch and 3rd one shows the previous fault has been removed..... so it Taw and C changes to make R a value of 10K. I'm not sure how that is of any use

Sorry, I'm not familiar with your simulation software or code, but I just think the open circuit results are useful. Perhaps its like comparing the results of a 2, 3, or 4-pole passive RC filter.

So what you are looking at is "TDR" - Time Domain Reflectometry.

Not really an Arduino thing as has been discussed in the past, but perhaps relevant to an ESP. :sunglasses:

Hello there again guys. I'm trying to do Underground cable fault detection using Arduino for open circuit and i just thought of a good way to do it. The principle here is to measure the time constant which is the time my capacitor takes to reach 63.2 percent of the source voltage. The Proteus simulation uses the principle of an RC meter which measures my time constant. i Can already find the time constant and print it on my virtual scope. for this experiment it's 1002 ms to reach 3.158 Volts of the capacitor ( Which is 63.2 percent of 5 Volts). Now if i generate an open circuit my capacitor will never charge up to 63.2 percent of 5 volts and the elapsedTime variable will exceed the value of 1002 ms so i can say an open circuit has occurred. So i basically gave the condition after measuring elapsedTime in A0 pin that

if(elapsedTime>=1003) // Time exceeds 1002 meaning open circuit
{

Serial.println("Fault at 2 KM");

return; //to break the if statement
}
else //there is more code to the else condition but i'm attaching it separately
{
Serial.println(elapsedTime); // print the value to serial port
Serial.println(" mS "); // print units and carriage return
}
But i'm just getting the time constant and no fault condition and when i generate and open circuit nothing happens RC time constant code and my VT is blank......Can anyone please explain what i did wrong here? I'd really appreciate it. Here is the main code line again
https://www.arduino.cc/en/Tutorial/Foundations/CapacitanceMeter the link to my diagram of Proteus simulation
ardu1 hosted at ImgBB — ImgBB

What is a VT ?

Please put your complete sketch in the post between code-tags. The </> button is for code-tags.
I don't want to re-create your sketch with that snippet of code, because I'm not sure where you have put that.

Please add pictures as attachment to you post.

If something works in Proteus, then it might not work for real. If something works in real life, then it might not work in Proteus.
It is unclear if you are testing it with a real cable or only in Proteus.

If you send a message, then at least you know that the serial monitor is working.

void setup()
{
  Serial.begin(9600);             // initialize serial transmission for debugging
  Serial.println( "The sketch has started");
  ...

By VT i meant virtual terminal I'm attaching the code like you instructed. This is just a simulation based project i am doing. and my picture gets pixalated when i attach it so i'm giving the link for for it below:

#define analogPin      0          // analog pin for measuring capacitor voltage
#define chargePin      13         // pin to charge the capacitor - connected to one end of the charging resistor
#define dischargePin   11         // pin to discharge the capacitor
#define resistorValue  10000.0F   // change this to whatever resistor value you are using

                                  // F formatter tells compliler it's a floating point value

unsigned long startTime;
unsigned long elapsedTime;
float microFarads;                // floating point variable to preserve precision, make calculations
float nanoFarads;

void setup(){

  pinMode(chargePin, OUTPUT);     // set chargePin to output

  digitalWrite(chargePin, LOW);

  Serial.begin(9600);             // initialize serial transmission for debugging
}

void loop(){

  digitalWrite(chargePin, HIGH);  // set chargePin HIGH and capacitor charging

  startTime = millis();

  while(analogRead(analogPin) < 648){       // 647 is 63.2% of 1023, which corresponds to full-scale voltage

  }

  elapsedTime= millis() - startTime;
  
if(elapsedTime>=1003)
{
  
  digitalWrite(chargePin, LOW);             // set charge pin to  LOW

  pinMode(dischargePin, OUTPUT);            // set discharge pin to output

  digitalWrite(dischargePin, LOW); 
  Serial.println("Fault at 2 KM"); 
  
  return;
  }
else{

  Serial.println(elapsedTime);       // print the value to serial port
  Serial.println(" mS    ");         // print units and carriage return }
  

  digitalWrite(chargePin, LOW);             // set charge pin to  LOW

  pinMode(dischargePin, OUTPUT);            // set discharge pin to output

  digitalWrite(dischargePin, LOW);          // set discharge pin LOW

  while(analogRead(analogPin) > 0){         // wait until capacitor is completely discharged

  }

  pinMode(dischargePin, INPUT);            // set discharge pin back to input
}
}

This is basically how a line test on a telephone line works. In the UK there is a capacitor across the line at the socket, doing something like you describe gives 2 very different capacitance measures depending on whether the wires are complete or broken somewhere.

The Germans quickly developed the technic to detect broken, shorted... cables after WW2..... 1945.....

Do you use the switch to create an open circuit ? But then the capacitor does not longer charge and the while-loop will run forever:

// This will run forever when the switch is opened.
while(analogRead(analogPin) < 648){
}

You need an other circuit and/or other code.

@rashid456

TOPIC MERGED.

Could you take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum.

Koepel:
Do you use the switch to create an open circuit ? But then the capacitor does not longer charge and the while-loop will run forever:

// This will run forever when the switch is opened.

while(analogRead(analogPin) < 648){
}




You need an other circuit and/or other code.

Thank you now i understand why it was not working like i expected it to. Is there a bypass to this?I mean by keeping the same circuit is it possible to tweak the code enough to get the desired output?I tried many things(Changing the conditional statements or introducing a new loop ) but there just doesn't seem to be any way to resolve this.

I don't understand your circuit.
Where is the long cable ? What is at the end of the cable ? If R2 is also at the end of the cable, then you need a wire going back to the Arduino and that wire can be broken as well.

Koepel:
I don't understand your circuit.
Where is the long cable ? What is at the end of the cable ? If R2 is also at the end of the cable, then you need a wire going back to the Arduino and that wire can be broken as well.

Okay i'll explain the circuit. R3 to R1 is my test cable. It's net resistance is 10K . I'm letting 10K = 2 KM in length. Now if i generate a fault in between R3 and R1 i can say the fault location is in between that length(I understand it's not very accurate to assume that for calculating the actual distance but bare with me) SO R1 to R3 is your long cable and R3 's end point is your termination.

There are two drawings (one in your post and another one with a link). Can you make a new drawing and write in the drawing which components simulate the long cable. Is there a capacitor at the end, or does the capacitor simulate the cable ?

I think the cable is tested with two wires: one signal and one GND with something at the end.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.