I'm trying to make a cable checker to help me make custom cables for my computer. I'm thinking I plug the cable ends into sockets on the device, then the Arduino checks between different pins to make sure that no wires are in the wrong spot or unplugged.

So I'm thinking it runs through like this:

I plug the cable into connectors on the device. The Arduino has the PSU pinouts saved. Pin 1 represents one end of the cable, pin 2 represents the opposite end. Same with 3-4/5-6 etc. If the cable is assembled correctly, it should act as a connection between pins 1-2, pins 3-4, 5-6 etc.

tests pin 1 - 2 to see if they're connected, if yes, light up a green LED, if not, light up a red LED

tests pin 3 - 4, does the same thing

Repeats this for every wire in the cable

Am I on the right track? How would I do this? I've seen people talking about pullup resistors but I'm also seeing people say that shorting can damage the board

  • Am I on the right track? ... that depends on whether pins 1 and 2 are supposed to be shorted together
    – jsotola
    May 21, 2021 at 0:16
  • 1
    write down the exact step-by-step procedure in great detail ... the resulting description will translate to code almost directly, if you include enough detail
    – jsotola
    May 21, 2021 at 0:19
  • @jsotola yes, done
    – Eggo
    May 21, 2021 at 3:11
  • if that is the most detailed description that you can write down, then you have a lot of thinking to do ... tests pin 1 - 2 to see if they're connected is not anywhere near one line of code ......... a cable has two ends ... call them left and right ... I am talking about a description something like, set each pin on left as inputs, set each pin on right as inputs, set left pin 1 to output, output LOW on left pin 1, check state of right pin 1 ......
    – jsotola
    May 21, 2021 at 4:45
  • Do you consider shortcuts as an error? Then you need to check for them, too. -- At least in the history of computer cables, there are a several variants that have connections between two (or more) pins on the same side, without being connected to the other side. -- Other cables might connect one pin of one side to multiple pins on the other side, for example for ground. -- Some USB charger cables have resistors between pins that must fall into a certain range. -- You see, this task is not trivial, if you like to check non-trivial cables. May 21, 2021 at 9:49

1 Answer 1


The scope of your question is too wide for a simple answer so let us constrain it to slow signals (audio frequencies or less) over short cables (not more than several meters) in a electrically clean environment (such as found in most homes).

That said, it is likely most looking for similar solutions reading your question will have different specific requirements. So to make this question and answer useful to others let us consider the most generic, economical and Arduino based solution.

  1. Most cables worth automatically testing will have far more individual connections than common Arduino boards, such as the Arduino Uno, have GPIO pins. Consider using a GPIO expander or multiple Arduinos which communicate with each other to coordinate efforts.
  2. When testing a cable that will be used for low frequencies, short distance and low immunity to noise it is likely the only faults that are of concern are OPENS and SHORTS.
  3. As this design uses GPIO pins we have the following options at any given GPIO pin: Drive High, Drive Low and Input With Pull Ups.
  4. Build a cable test rig where one end (the near end) of the cable under test is connected to GPIO pins designated as the driver side and the other end of the cable under test (the far end) is connected to GPIO pins designated as the sensing side.
  5. For a SHORTS and OPENS test set all the sensing and driving GPIO pins to Input With Pull Ups. Verify that all sensing GPIO pins report a 1. Next change one and only one of the driver GPIO pins to an output and send a 0. Record that state of all sensing GPIO pins. Return the driver GPIO pin to Input with NO PULL UPS and repeat these steps for the next GPIO driver pin.
  6. If this is a STRAIGHT THROUGH cable only 1 sensing GPIO pin should report a 0 in each testing pattern recorded. If more than 1 sensing GPIO pin reports a 0 then there is a short between the 0 reporting pins. If none of the GPIO pins reports a 0 then there is an open for that GPIO pin.
  7. Use the same test for cables containing intentional SHORTS (perhaps multiple ground pins are shorted together) expecting to see the associated GPIO pins to all change to 0 at the same time.
  8. For even more complex cables containing loop backs at both ends consider only the "GPIO pin set to an output sending 0" as the driver and record the state of ALL OTHER GPIO pins as they are now all possible outputs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.