cable fault locator help

Hello everyone, i could to make a tdr (time domain reflectometer) with Arduino, for measuring cable lenght, do you have any suggestions?

please help me!!!!

The Reflectometer that I used looked like an oscilloscope. You can use an oscilloscope in a TDR apparatus with extra circuits. The signal travels at half "the speed of light in a vacuum", so each foot of wire has a delay of about 2 nanoseconds.

You can evaluate how long the minimum wire length should be for an Arduino or oscilloscope to get a valid time measurement. A 1 microsecond delay will exist for 500 feet of wire. How will your circuit test short wires?

http://forum.arduino.cc/index.php?topic=180926.msg1340978#msg1340978

I would to measure wire lenght from min. 100 ft and max 3000 ft

At 100ft the reflected pulse would be 200 to 400ns later than the transmitted pulse, which rather short to measure on an Arduino. You could use the input capture facility of timer 1, which would give you a resolution of 62.5ns @ 16MHz clock, with some dead time at the start. Better would be to use an ATtiny85, which has a fast peripheral clock and can therefore provide much better resolution.

You would need a high speed comparator to detect the reflected pulse. You could try the internal analog comparator, but the atmega datasheets unfortunately give no data on its speed. So it’s probably better to use an external comparator.

You would probably want to be able to adjust the voltage on the other input of the comparator, either using a potentiometer or by generating the voltage from a PWM output pin and a low pass filter.

The code could look something like this:

set output low
clear timer 1
set output high
start timer 1
set output low
enable timer 1 input capture
set output Hi-Z
wait for timer 1 capture event
read timer 1 input capture register

Old-school discrete TDR build. Author states,

Works very well with cables from 5 meters to 500 meters

Approach Arduino integration to the extent that the uC can process information (consider voltage levels, time intervals, etc.) With some external latch circuitry, it may be possible to address the reflected pulse. But,

The signals are displayed with 0.5 us/div and 2.5V/div scale. The signals are samples at 20 MSa/s sample rate.

does not give me great hope unless you are skilled in analog signal amplification and filtering...

From mrburnette's post, it appears that a 2.5V 50ns (or possibly longer) pulse sent into the cable gave a 0.5V 100ns pulse back. That should not be difficult to detect using a comparator. One issue I can see is that in order to use the timer/counter 1 input capture facility, the capture pulse must be more than 1 clock cycle long (62.5ns using a 16MHz Arduino). It may be that sending a 200ns long pulse into the cable will give a sufficiently long reflected pulse. If not, then you will need to use an external comparator feeding a latch.

Hi, thank you for answer, if i would work with cables from 20 meters to 2000 meters, can i use this circuit?
I will use Arduino for analyze reflected signal instead oscilloscope and display result in 16x2 display (for example "circuit open at 152,3 mt" or "short circui at 233,4 mt").

mrburnette:
TDR Circuit

Old-school discrete TDR build. Author states,

Works very well with cables from 5 meters to 500 meters

Approach Arduino integration to the extent that the uC can process information (consider voltage levels, time intervals, etc.) With some external latch circuitry, it may be possible to address the reflected pulse. But,

The signals are displayed with 0.5 us/div and 2.5V/div scale. The signals are samples at 20 MSa/s sample rate.

does not give me great hope unless you are skilled in analog signal amplification and filtering...

I got sufficiently interested in this that I decided to to try it out. I connected digital pin 2 through a 150 ohm series resistor to one of the wires in a reel of 2-pair telephone cable, with the other wire in the pair grounded. The reel was originally 100m but I had used some, so I think there were 60m to 80m remaining. I used this code to generate a 62.5ns pulse on pin 2:

void setup()
{
  pinMode(2, OUTPUT);
}

void loop()
{
  byte on = (1 << 2);
  byte off = 0;
  PORTD = on;
  //delayMicroseconds(10);
  PORTD = off;
  delayMicroseconds(500);
}

Then I un-commented the first delayMicroseconds call to try using a step function instead of a pulse. The attached images show the scope trace I saw at the cable/resistor junction. The first is using a pulse, with the far end of the cable open circuit. The second is with the far end of the cable short circuit. the third and fourth are using a step, with the far end of the cable open and then short circuit. Horizontal scale is 100ns/division, vertical is 1V/division.

Next step is to see if the analog comparator is fast enough to take measurements.

dc42:
… the atmega datasheets unfortunately give no data on its speed.

It gives some data, though maybe less than we’d hope. Chapter 29, “Electrical Characteristics – (TA = -40°C to 85°C),” of the 02/2013 datasheet lists the “Analog Comparator Propagation Delay” as 500 nanoseconds, typical, at VCC = 4.0V. It doesn’t describe a propagation delay for VCC = 5.0V.

tmd3:

dc42:
... the atmega datasheets unfortunately give no data on its speed.

It gives some data, though maybe less than we'd hope. Chapter 29, "Electrical Characteristics – (TA = -40°C to 85°C)," of the 02/2013 datasheet lists the "Analog Comparator Propagation Delay" as 500 nanoseconds, typical, at VCC = 4.0V. It doesn't describe a propagation delay for VCC = 5.0V.

Thanks, I didn't know that the datasheet had been updated this year. I've downloaded the new version. The analog comparator data you mentioned is also repeated at the start of section 30. There is unfortunately no mention of the conditions (such as the input step size and the amount of overdrive) under which the propagation delay was measured, other than temperature, and Vcc. Likewise, no mention of the common-mode input range, although it seems to be rail-to-rail, or close to that.

I've found that I can use the analog comparator and timer 1 input capture to detect the reflected pulse, although the timing I measure depends very much on the voltage I apply to the other comparator input. I think the propagation delay varies substantially with the amount of overdrive (I'm seeing well under 500ns in some cases). In any case, with a quoted typical propagation delay of 500ns, a faster external comparator is evidently needed for this application. I'll add a TLV3501 to my next component order.