Measure cable length with a PIC?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429

    Default Measure cable length with a PIC?

    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?

  2. #2
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Lightbulb Time-domain reflectometer (TDR)

    Hi Kamikaze47,
    Quote Originally Posted by Kamikaze47 View Post
    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-
    Ohm it's not just a good idea... it's the LAW !

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    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.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    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.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    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/tran...hite_Paper.pdf

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

    Best regards,

    Luciano

Similar Threads

  1. DLR3 Data cable to pic
    By ZOOM in forum GSM
    Replies: 1
    Last Post: - 14th May 2010, 15:50
  2. DS1820 Max Cable length ?
    By dccch in forum General
    Replies: 2
    Last Post: - 24th January 2008, 07:44
  3. Maximun Cable Length for PIC to LCD
    By wildbilly in forum mel PIC BASIC Pro
    Replies: 52
    Last Post: - 1st January 2008, 19:00
  4. PIC to PIC Serial data using Cat5 cable
    By Andy Wood in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd May 2007, 02:42
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts