PDA

View Full Version : Measure cable length with a PIC?



Kamikaze47
- 15th July 2007, 15:36
I'm wanting to make a PIC program that can measure the length of a cable.

The idea is to be able to connect both ends of the cable to different i/o pins and have the PIC calculate how long the cable is.

I know this should be possible, as i've seen cable testers that can do it. Also, my PC's bios can tell me how long my network cable is, down to 0.1 of a meter.

Obviously sending a pulse down the cable and timing how long it takes to reach the other end is out of the question as the PIC wouldn't be anywhere near fast enough.

Does anybody know (or have any ideas) on how this can be done?

Pic_User
- 15th July 2007, 16:53
Hi Kamikaze47,

I'm wanting to make a PIC program that can measure the length of a cable.

The idea is to be able to connect both ends of the cable to different i/o pins and have the PIC calculate how long the cable is.

I know this should be possible, as i've seen cable testers that can do it. Also, my PC's bios can tell me how long my network cable is, down to 0.1 of a meter.

Obviously sending a pulse down the cable and timing how long it takes to reach the other end is out of the question as the PIC wouldn't be anywhere near fast enough.

Does anybody know (or have any ideas) on how this can be done?
Look for:
Time-domain reflectometer (TDR)
Time-domain reflectometry (TDR)

Here is a very good DYI article using a 74AC04 hex inverter (not PIC) and your OldSillyScope.
The author mentions the timing and velocity factors that might help with your project.

QEX sample PDF article
“Build a cheap and simple time-domain reflectometer”.
Hook this up to your oscilloscope, and you can electronically measure the length of a wire to the end, or find a problem in the wire, including where the problem is physically located.
http://www.arrl.org/qex/2006/03/steinbaugh.pdf

-Adam-

Kamikaze47
- 15th July 2007, 17:38
Problem is, even with a PIC with a 40Mhz clock, the quickest interval you can measure is 100nS. In the cable i'm using, signals travel at 71% the speed of light. Which means 100nS equates to 56.8m. Obviously thats nowhere near the resolution required. To measure within 1m i'd need a clock speed of 2.2GHz - Obviously not going to happen on a pic.

Im wondering how the hand-held cable testers manage that kind of timing.

mackrackit
- 15th July 2007, 18:02
Not sure if this will work as the resistance will be low on a short cable, but this might be a place for RCTIME.

Known capacitance find the resistance. Calculate for wire diameter.

Luciano
- 15th July 2007, 18:45
Also, my PC's bios can tell me how long my network cable is, down to 0.1 of a meter.

Hi,

Virtual Cable Tester™ (VCT)
Technology For Gigabit Networks

White paper:
http://www.marvell.com/products/transceivers/quadport/VCT_White_Paper.pdf

Video about VCT advantages. (46MB zip file/ non-technical).
http://www.marvell.com/products/VCT%20Video.zip

Best regards,

Luciano