Introduction: Arduino Cable Tracer / Cable Tester
_______________
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
- Arduino Mega 2560 board
- USB A to USB B Arduino Mega programming cable
- 2.8" TFT LCD display Touch ILI9341
- Vero Board (1 of 16x6 holes, 2 of 8x5 holes, 2 of 17x5 holes - see photo)
- Arduino dual strip male header pins( 2 of 8 pins, 2 of 6 pins - see photo)
- Arduino Stackable Header 4 of 8 pins
- Vero Pins qty of 48
- 2 x USB-C V3.0 Cable
- 2 x USB-C to USB-C through adapter
- 2 x USB Mini to USB A adapter
- 1 x USB Micro cable with socket
- 1 x USB-A cable with socket
- 1 x USB-A V3 cable with socket
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.
Attachments
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.
Attachments
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!!
_______________

Second Prize in the
Arduino Contest
69 Comments
Question 1 year ago
Hi,
Why there are 4 directory files ? (see attached Picture copy)
And Wich directory I have to televerse in Mega 2560 v3E (see attached card information)
Thanks
Best regards
Steven
Reply 1 year ago
Hi, these are to accommodate different screen manufacturers. Some use different drivers although they physically look the same.
Reply 1 year ago
Another Question ;)
I see on vidéo that when an USB plug is conneted to the first socket, It is detected but the other end of the cable is not connect.
How is detected the plug ?
There are no active or passive component in plug or in cable !!!
With no current modification and no voltage in plug, I would like to underrtstand.
;)
Reply 1 year ago
There are two modes. Auto and Manual. Auto detects the type of cable based on pin activity. Manual enables you to select cable types to explore cable configuration at one end
Reply 1 year ago
Of course but how this activity is detected in auto mode. There are no passive or active component in USB plug ???
Reply 1 year ago
Hi, great.
Have a good day.
1 year 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.🙏👏👏👏
Reply 1 year 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 :)
1 year ago
I made an analogue version for work
5v
Lots of LED’S
1 of 15 rotary switch
Connectors from USB to DB-15
Reply 1 year ago
Nice work. You could put it up as an Instructable!!
Reply 1 year 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
Reply 1 year 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
2 years 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 :)
Reply 2 years ago
I didn’t catch if there was a way to get access to the PCB schematic to make/order our own?
Reply 2 years ago
https://www.instructables.com/Touch-Screen-Cable-Tracer/ has the schematic here with new code!
Reply 2 years ago
Additionally, is the code updated to include the new cables and ports?
Reply 2 years 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.
2 years 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
Reply 2 years 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.
Reply 2 years 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.