Arduino based underground cable fault distance locator

Hi guys!
I am working on a project called Arduino based underground cable fault detection system. The system detects a voltage drop when the circuit is short-circuited on each phase and displays the exact location of the fault in kilometres else it should display no fault.
I designed the circuit in proteus and managed to get the code, however the system cannot detect and display the fault. I am new to the Arduino ide so can you please help me. Thanks

ps. The ide detected no errors during compilation

I have attached the code and circuit diagram below

Moderator: Tag image added

project_final.ino (2.13 KB)

Does the LCD work with a simple sketch?

.

Print the raw values from the analogRead to see what you're getting. Your distance function will return zero if the analog value is <600 or >=920. It would be useful to know which it is. You need to post the circuit diagram.

Pete

The code is almost useless without the circuit diagram.

This section below seems to be very ambiguous.

int distance(int inputVoltage) {

if (inputVoltage >= 890 && inputVoltage < 920) {
   return 8;
 }
 else if (inputVoltage >= 850 && inputVoltage < 890) {
   return 6;
 }
 else if (inputVoltage >= 750 && inputVoltage < 850) {
   return 4;
 }
 else if (inputVoltage >= 600 && inputVoltage < 750) {
   return 2;
 }

else return 0 ;

}

If the input is above 920 or below 600, you get the same answer. You don't get any indication of "over" or "under". When you test it, which one is it?

The resolution seems rather coarse too. This would only be useful if you wanted to dig up 2km sections of the 10km wire. In the real world, if this was the best you could do, it would be cheaper to just plow in a second wire when the first one breaks.

Yes it does. @ LarryD

Sorry about that i had to change the circuit extension. It's posted now.
@ el_supremo & @ MorganS

Try lcd.print()

.

MorganS if I understand your question. It's a 3 phase cable with 2km interval. Hence the total distance on a phase is 8km from the circuit diagram. At every interval there's a particular voltage drop which the Arduino analogRead pin detect, which is 650-920. Approximately 3.3V-5V

OK, I see the schematic now. The resolution is poor but it's possible to make out most of the details.

Clue: Don't draw supply and ground symbols on their sides. It makes it much more obvious when ground points down and positive supplies point up. (Negative supplies are less clear.) Try not to put symbols too close together. There's a stray ground symbol right next to the 5V pullup on A0 and it's not clear what's going on there.

Is this your schematic or is this the schematic your professor told you to use? It's useless for actual cable faults but it will probably work with this "switchboard" of simulated faults.

You might also look up how a TDR (Time Domain Reflectometer) works. A basic Arduino doesn't have the timing precision required to measure down to km, but it doesn't take a lot of components to do it. There have been projects posted on here using an Arduino to make a TDR.

LarryD:
Try lcd.print()

.

It didn't work

MorganS:
OK, I see the schematic now. The resolution is poor but it's possible to make out most of the details.

Clue: Don't draw supply and ground symbols on their sides. It makes it much more obvious when ground points down and positive supplies point up. (Negative supplies are less clear.) Try not to put symbols too close together. There's a stray ground symbol right next to the 5V pullup on A0 and it's not clear what's going on there.

Is this your schematic or is this the schematic your professor told you to use? It's useless for actual cable faults but it will probably work with this "switchboard" of simulated faults.

You might also look up how a TDR (Time Domain Reflectometer) works. A basic Arduino doesn't have the timing precision required to measure down to km, but it doesn't take a lot of components to do it. There have been projects posted on here using an Arduino to make a TDR.

No, I saw the schematic online. Anyway I will take a look at the TDR

Try again (from #2): "Print the raw values from the analogRead to see what you're getting. Your distance function will return zero if the analog value is <600 or >=920. It would be useful to know which it is."

Pete

paakay:
No, I saw the schematic online.

Let me guess: Instructables? They seem to be universally useless for Arduino projects. Lots of very bad advice there.

paakay:
I am working on a project called Arduino based underground cable fault detection system. The system detects a voltage drop when the circuit is short-circuited on each phase and displays the exact location of the fault in kilometres else it should display no fault.

These sound like power cables, in which case when they are 'shorted' in a fault, there is likley to be some fusing, maybe a bang, and the remainder may well be a partial and not zero resistance fault.

In which case I cannot see how you can come up with an 'exact' location based in voltage or resistance measurments.

Is this a real project ?

My thoughts also Srnet. Would seem more appropriate to be looking for a ground fault.

can anyone help me how to code the program to interface gsm and gps to know the location of fault???

I'm sure that'd be possible, but before that:

  1. create your own thread (probably better in the Gigs & Collaborations section),
  2. give a detailed description of your project (including the actual hardware used and the exact functionality expected from the software).

I want to know how can i code the program for this project its there in the attachment wat i kept

fileserve.pdf (414 KB)

Shashanksri:
I want to know how can i code the program for this project its there in the attachment wat i kept

As has been suggested, start your own thread.

Can you explain why you are using 650-920...what is the unit of that... We are using 5v but why we taking 650-920.now I am working on this project