Arduino Cable Tracer

88,177

560

63

Introduction: Arduino Cable Tracer

About: I love the challenge of building unique things. My goal is to make technology fun and help individuals build the skills and the curiosity to experiment with some of the amazing technologies we have available t…

_______________

Latest Update!!!:Touch Screen Cable Tracer kitset is now available here - 70% smaller, uses an Arduino shield that eliminates over 20 hours of meticulous soldering, and uses snap-together parts with minimal soldering. If you are wanting to build your own then check this out!!

_______________

Instantly diagnose the type and integrity of USB cables with this Arduino Cable Tracer. Suitable to trace USB A, Mini, Mico, and USB-C cables this is very useful to identify the exact wiring configuration and also diagnose broken connections.

Step 1: Gather the Materials and Tools

The Arduino Mega board is an excellent option for this project because it can support both a display and provide an additional 48 digital pins to simultaneously trace each of the wires within a cable. For this prototype, I used existing cables with commonly used USB sockets.

Parts list

Tools

  • Access to a 3D printer with a Build Plate of 220mm (i.e Creality Ender 3)
  • Soldering Iron
  • Box cutter knife
  • Metal Ruler
  • Wooden chopping board
  • Heat Shrink insulation
  • Wire Strippers
  • Heat shrink air gun
  • Hot Glue Gun
  • Electronic PCB microscope (optional if you have issues with cable wiring)

Step 2: Print and Assemble the Case

Printing the Components

The 3D Print files and printing instructions are included in a Thingiverse link here for the Lid, Base, left, and right USB socket bezel and a screen mounting bracket.

Cleanup the items

Once the components are printed remove any excess plastic paying particular attention to the mounting holes and also the base unit which has provision for external power to the unit.

Step 3: Prepare the PCB

1. Cut the Vero Board to size

Use a pencil to mark out the dimensions of each Vero board

  • 1 of 16x6 holes
  • 2 of 8x5 holes
  • 2 of 17x5 holes

Ensure the orientation of the track is as described in the photo above.

Using a box cutter knife, metal ruler and a wooden chopping board carefully scour the correct size and carefully snap to the right size.

Cut a careful strip down the Vero with16x6 holes as indicated in the photo above. Use the blade of the box cutter to ensure there is no track between each hole.

2. Solder the Header pins

Carefully break the Arduino dual strip male header pins to fit in the Arduino Mega data sockets. Push the Vero boards into position with the track facing upwards. When satisfied solder the header pins into the Vero board.

3. Solder in the Vero Pins

Carefully push the Vero Pins into each of the Vero boards as indicated in the photo. You may need to use a small drill bit to widen the holes the pins are too tight.

Note that on the socket with dual header pins the Vero pins are spaced in a way to enable the wires to be soldered in with better clearance. See the photo above.

4. Mount the Stackable Header Sockets.

Push the stackable header pins onto the 2.8" TFT LCD screen and use this to position the screen on the Vero board. Carefully solder the Stackable header sockets into place as indicated in the picture above.

5. Alignment of the Screen Mounting Bracket

Now is a good time to position the 2.8" TFT LCD display in the Screen Mounting Bracket. This is best done with the screen turned on before you glue the screen mounting bracket into place. Take care to insert the Screen into the correct pins on the Arduino. When powered on you should be able to see the viewable area of the screen through the front panel. Once in the correct position, you can hot glue the screen mounting bracket into position however take care not to fasten the screen into place until all wiring is complete.

Step 4: Connect the USB Sockets to the Arduino Mega

1. Validate the cable configuration

I have provided a breakdown of color-coded wires to pin connections for the Arduino in a PDF document. Please note that some cables (particularly USB-C) may use different colors so in order to be certain it's best to use a multimeter to test each connection to a pin to be sure of the config. It can be a little difficult to do this because of the USB-C cable turned out to have 16 wires and 24 pins.

Hopefully, you don't have to do this and can follow my diagram above which shows which cable color is aligned. My suggestion is to try these and if there are issues use a multimeter.

If you do end up using a multimeter you will likely need to use a PCB microscope and a needle to strobe all of the pins in a USB C see photo above.

2. Cut and position the USB cables

Firstly using hot glue, position the USB sockets in the correct position. Then carefully position the Arduino and screen in the front panel and then put in place the USB cables. Cut the USB cables to the appropriate length so that they provide enough length to accommodate the position of the Arduino header pins.

3. Strip and Insulate Wires

Strip and insulate the cables with heat shrink so that any exposed shielding or earth wires are not exposed so as to avoid any short circuits occurring.

Strip and tin the ends of each of the wires carefully. You will find the USB-C wires will have aluminum foil shielding so remove this and use heat shrink to cover and hold them away from the chassis.

4. Connect wires to the Arduino

Carefully follow the wiring configuration table provided which shows the Arduino pin numbers, USB sockets and the associated pin numbers. Preload each connection with a piece of heat shrink so you can solder the joint and then slip heat shrink over the joint to hold and insulate the wire.

Do a final inspection with a microscope or magnifying glass and light up close to ensure there are no shorted terminals.

Step 5: Load and Test the Code

1. Load the Arduino Libraries

The standard GFX library does not support a 2.8 TFT screen however this can be addressed by a modified version provided here

Make sure this and other libraries are manually added to your Arduino IDE

  • Adafruit_GFX
  • Adafruit_TFTLCD
  • TouchScreen

2. Upload and Test the code

Upload the code via the Arduino IDE and on completion, you should see a color splash screen appear briefly on the LCD. The splash screen should clear and two arrows indicating port scanning are underway.

Step 6: Putting It All Together

1. Install the Power Source

Carefully position the USB Mini adapter into the base of the case. Take the USB A to USB B Arduino programming cable and connector the USB mini adapter. You are now ready for testing.

2. Final Testing

Attach power to the USB Cabe Tracer and if working correctly the splash screen should clear giving way to the scanning screen as per the video demonstration above.

Take a USB A Micro cable and plug one end into the left of the unit and one on the right. Try various cables to test the cable connections. You should see wires identified as in the video.

3. Your USB Cable Tracer in Action

Take a series of USB cables and try them out.

Diagnosing Faulty Cables - A faulty cable compared to a working cable will show missing wires. In the example above you will see D+ and D- wires disconnect when the cable is flexed.

Identifying the right cable - Some cables are only used for fast charging, have limited or no data wires. These explain why some cables do not work on some devices. You can use the Cable Tracer to compare cables to identify the correct cables to avoid disappointment and frustration.

4. Feedback on this prototype

If you are interested in this project and have a preference for a different type of cable tracing then please message me with your feedback as I will consolidate this feedback and if there is enough interest produce a PCB header that will eliminate the soldering.

Thanks in advance

Step 7: Feedback on Prototype and Next Steps

I have received a large amount of feedback on what type of cables and connectors would be useful in a future model. So much that I have had a prototype PCB created that plugs directly into the Arduino Mega for testing and further development.

I have added in RJ45, USB B, USB Micro V3 and Lightning. If you have further suggestions please comment.

My intent would be to produce a board that others can experiment with different approaches to coding without having to do a lot of soldering to get results.

Thanks in advance and please continue with the feedback and will keep you updated on the availability of the PCB and new code to support it.

:)

_______________
Latest Update!!!: Touch Screen Cable Tracer is now available here - 70% smaller, uses an Arduino shield that eliminates over 20 hours of meticulous soldering, and uses snap-together parts with minimal soldering. If you are wanting to build your own then check this out!!

_______________

Arduino Contest

Second Prize in the
Arduino Contest

Be the First to Share

    Recommendations

    • Meatless Challenge

      Meatless Challenge
    • First Time Author Contest

      First Time Author Contest
    • Fabric Challenge

      Fabric Challenge

    63 Comments

    0
    danieljodafoa
    danieljodafoa

    3 months ago

    Hola buenas, Exelente proyecto.
    Lo estoy ejecutando pero eh tenido problemas con las bibliotecas para el ILI9341 eh encontrado muchas para este controlador pero ninguna me permite visualizar..
    Sería posible que facilitara las bibliotecas, le agradecería mucho.
    Gracias.🙏👏👏👏

    0
    TechKiwiGadgets
    TechKiwiGadgets

    Reply 3 months ago

    Hi, Step 2 of the instructable has a link where you can download the libraries. They are in a file called CableTracerLibraries.zip

    My recommendation is to remove all libraries in the IDE and replace them with this.

    If you still have problems please message me directly and I will see if I can help :)

    0
    DDW_OR
    DDW_OR

    7 months ago

    I made an analogue version for work
    5v
    Lots of LED’S
    1 of 15 rotary switch
    Connectors from USB to DB-15

    0
    TechKiwiGadgets
    TechKiwiGadgets

    Reply 7 months ago

    Nice work. You could put it up as an Instructable!!

    0
    DDW_OR
    DDW_OR

    Reply 7 months ago

    Two sets of led
    5v to common of switch

    Two identical sets of connectors
    First set is for power out to cable
    Second set is for power in from cable
    Then to second set of leds

    Second set of leds has an extra led for shield

    Switch pin 1 is connected to first set of connectors pin 1. Then continue for the remaining switch pins

    Then on the power in side all pin 1 are connected together then to first led
    Then continue for the remaining pins to leds

    0
    DDW_OR
    DDW_OR

    Reply 7 months ago

    USB. 7 types
    S-vid
    HDMI
    Lightning
    Fire wire
    D-type. 4 sizes

    So far. 15 type sets
    Some connectors have male and female
    So about 20 for each side

    Then to make a power supply tester
    Every type of round connectors
    And any other connectors you can think of
    LCD for voltage
    Second for current
    Bi-color led for center polarity
    Fans to cool heatsink
    3 switches to increase load current
    250 ma
    500 ma
    1,000 ma

    0
    TechKiwiGadgets
    TechKiwiGadgets

    1 year ago

    I have received a large amount of feedback on what type of cables and connectors would be useful in a future model. So much that I have had a prototype PCB created for testing and further development. See Step 7 above. Many thanks for the feedback everyone :)

    0
    RaymondJ4
    RaymondJ4

    Reply 1 year ago

    I didn’t catch if there was a way to get access to the PCB schematic to make/order our own?

    0
    RaymondJ4
    RaymondJ4

    Reply 1 year ago

    Additionally, is the code updated to include the new cables and ports?

    0
    TechKiwiGadgets
    TechKiwiGadgets

    Reply 1 year ago

    Hi, yes the code will be provided, I have 5 boards testing new code and unfortunately had a schematic error which I picked up on one port so I'll have to correct on the next run. Am hoping to have the next run ordered in the next few weeks then will publish details.

    0
    ruggbg
    ruggbg

    1 year ago

    I have run into a problem with the library and I don't know why. It previously compiled with no errors. Now it is giving me warnings about the Adafruit_TFTLCD.cpp file but it is still compiling the code.
    I am running the 1.5.3 ver of the GFX library. Later versions do create more errors.
    It may be that I updated another library that is causing this, but I do not remember what I updated.
    Do you have any idea why these warnings are being generated.

    C:\Users\Bill\Documents\Arduino\libraries\TFTLCD_Mega2560-master\Adafruit_TFTLCD.cpp:873:0: warning: "read8" redefined
    #define read8(x) x=read8fn()
    In file included from C:\Users\Bill\Documents\Arduino\libraries\TFTLCD_Mega2560-master\Adafruit_TFTLCD.cpp:19:0:
    C:\Users\Bill\Documents\Arduino\libraries\TFTLCD_Mega2560-master\pin_magic.h:192:0: note: this is the location of the previous definition
    #define read8 read8inline
    C:\Users\Bill\Documents\Arduino\libraries\TFTLCD_Mega2560-master\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::begin(uint16_t)':
    C:\Users\Bill\Documents\Arduino\libraries\TFTLCD_Mega2560-master\pin_magic.h:410:25: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    hi = (d) >> 8; lo = (d); CD_DATA ; write8(hi); write8(lo); }
    ^
    C:\Users\Bill\Documents\Arduino\libraries\TFTLCD_Mega2560-master\pin_magic.h:196:29: note: in expansion of macro 'writeRegister16inline'
    #define writeRegister16 writeRegister16inline
    ^~~~~~~~~~~~~~~~~~~~~
    C:\Users\Bill\Documents\Arduino\libraries\TFTLCD_Mega2560-master\Adafruit_TFTLCD.cpp:352:5: note: in expansion of macro 'writeRegister16'
    writeRegister16(ILI9341_VCOMCONTROL1, 0x2B2B);
    ^~~~~~~~~~~~~~~

    thanks

    0
    TechKiwiGadgets
    TechKiwiGadgets

    Reply 1 year ago

    Try removing the libraries. The restart the IDE and manually add them in. If it compiled initially sounds like something broke. I can put a copy of the library on instructables if that helps.

    0
    ruggbg
    ruggbg

    Reply 1 year ago

    Yes, something is broken. I loaded Arduino 1.8.15 on my laptop, installed the libraries and it compiled with no errors/warmings. I moved the libraries back to the desktop and I have the same issue. I deleted all the libraries and removed Arduino and reinstalled as I did on the laptop. Same problem.
    Somehow Windoz must be messing with things. I may have to reimage my system.

    0
    ayavilevich
    ayavilevich

    1 year ago

    I like this project a lot! It would be much more valuable if it could test the resistance of each line. I find that the common problem with no-brand cables today is high resistance and hence voltage drop. This is a bigger issue for me than broken lines.

    0
    ctpearson
    ctpearson

    Reply 1 year ago

    I signed in to post a similar suggestion, but found this thread instead. :)

    I have to agree with @benmcl that this could be as simple as re-ordering the pins, so that the Vcc wires from each cable go to an analog input. Find the difference and you (obviously) have your voltage drop.

    To separate the "good" cables from the "bad", this should be more than enough. That's all that's really needed to quickly decide whether to keep a no-name cable that came with a new device.

    0
    Brian of Fairfield
    Brian of Fairfield

    Reply 1 year ago

    I have been thinking about testing cable resistance for a while on and off. What I'd come up with is a constant current 1 Amp supply with a maximum voltage of 1 Volt. That way an analogue meter movement can be used with Ohms on a linear scale from zero to one. Anything greater than 1 Ohm isn't worth reporting (for GND and VBUS). It may be worthwhile having a 100 mAmp range for testing data wires (in this case the meter would read from zero to ten Ohms).

    0
    benmcl
    benmcl

    Reply 1 year ago

    Agreed - I commonly have all 3 issues with USB cables, the 3rd one being voltage drops as you mentioned. The Arduino Mega has 16 analog inputs, more than enough to measure the voltage drop of all the V+ and GND lines of all 3 cable pairs. See: https://www.circuitbasics.com/arduino-ohm-meter/, where the unknown resistor is your USB cable and the 5v supply is actually the digital IO pin pulled high (the 1k resistor may need to be increased so the digital pin works normally for the connectivity scan).

    0
    ambrose.clarke
    ambrose.clarke

    Reply 1 year ago

    Yes, some cables, either old or just have cheap wiring, only charge with a much reduced current- and so are slower- sometime taking only half or less amps than others.
    If this is down just to the resistance of the wire it would he great to have displayed and make this even more useful.

    0
    GeekyTim
    GeekyTim

    1 year ago on Introduction

    I was planning to do a simpler version of this sort of thing at some time, but now I've seen this I want its awesomeness! Well done, great build.