Are you overthinking this ?
If all the pins are set as INPUT_PULLUP and one pin is OUTPUT LOW, then it does not matter what is connected to what. All the wires can be short circuit to one big blob.
@Koepel,
The cable that i'm thinking to test is about 12m, I think. I've picked upp the cable from the cable garbage container and I thought it could be a good sample to test, if I succeed in my project.
I've never thought in any interference/noise, to be honest.
Let's back up a bit. Let's look at a simple scanner. The whole idea with a simple scanner, all you need, is to tickle one wire, and see which others respond. For example, think of a four-wire cable connected at both ends, to keep the discussion manageable.
Set 7 of 8 pins as input with INPUT_PULLUP, set the eighth one as output, and drive it low. Scan all pins looking for which ones are low; then, repeat for the other 7 pins; you've just identified all connections.
The output could look something like:
1 - 5
2 - 8
3 - 4 - 6 - 7
Any pin only gets listed a maximum once on the left, not at all if it's already on the right.
Does that make sense? Now, scale that up to your 27x2.
I see @Koepel beat me to it.
You could run the test a number of times.
In the worst case, you have to add 4k7 or 10k external pullups to all the wires on both sided. I think that is not needed. A good cable has two internal pullups for each wire (one on each side).
@camsysca, can you break my sketch ? I'm not sure that it covers 100%.
Yes, I agree with you. This is a good way to get around the possibility of any short cable.
@Koepel, apologies, but I don't "do" Wokwi. Haven't had the time to dig into it.
However, I would ask, why not just treat the whole pin list as one array, walk through it one pin at a time, and simply list the connections as you go? Simpler. As you list them, keep track of any listed, and never mention it again.
Sorry for the late reply! Me and my family have had stomach flu.
But now everything is ok.
I'd like to thank you guys for the last great feedback.
@camsysca , As you said. Koepel has beat us to it.
I'm exiting to test a long cable, when I'm done with the cose, and see if it makes a sense.
I'll take your input into consideration.
Thank you!
Hi again,
I've got another question.
Which IDE you are using today? something better than Arduino IDE?
Thank you in advanced!
Yes, but I have not figured out how to do the "administration", how to combine the results and present it.
Some things can not be detected.
For example:

When counting from zero, then A0 = A1 = B0 = B1.
The shortcuts can be detected, but that A0 is not connected to B0 can not be detected. The sketch gives 4 messages, but those messages are weird.
It would be nice if the sketch could say: Pins A0, A1, B0, B1 are all short circuit to each other.
After that is fixed, the sketch could say: Pin A0 is not connected to B0. Then that can be fixed.
The pins can be in a single array, as proposed by camsysca in post #26, but then I still don't know how to do the "administration" of the results.
Not sure what you mean by "administration". As I said in my short (4-wire) example, you simply report what is found on every test as you scan. Or do you want a visual depiction? From a one-lung microprocessor?
Okay, how about a line-by-line drawn horizontally on Serial Monitor? Might get a bit stuffy to draw (characters are so limited), but maybe something like:
1>-------------------------------------------------------------------------------------------<1
2>--------------o---------------------------------------------------------------------------<2
3>--------------|---------------------------------------------------------------------------<3
4>--------------|--------o-----------------------------------------------------------------<4
5>--------------|--------|-----------------------------------------------------------------<5
6>--------------o--------|-----------------------------------------------------------------<6
7>------------------------o-----------------------------------------------------------------<7
8>-------------------------------------------------------------------------------------------<8
That would be very nice. Can you write code for that ?
I didn't know a better word than "administration"
![]()
I mean the code has a result (the result could be in an array) and somehow that has to be presented in a way that makes sense. It should show what is wrong in a understandable way.
imho you should not only check "from left 27 to right 27pins" but each (27+27) pins against the other 53 pins.
Then you can display not only connections (left - right) but also (multiple) shorts "on the same side".
My example in #6 didn't get so much attention, but it would print:
New Test
5 -->6-->8
6 -->5-->8
7
8 -->5-->6
9
10 -->12
11
12 -->10
@camsysca , Would you please translate the pattern below for me?
I' think the best way, as you've said, to deal with all wires as one array. Because, for example, when it comes to short circuit test, it will be no difference between side A or side B
Yes, I agree totaly with. It should goes this way. And we maybe dont need to repeate short circuit combination of 5-6-8 or 10-12 every time the combination is detected
Right. Looks like we're testing an 8-wire cable. conductors 1,3,5, and 8 are straight through, no deviations. Conductors 2,4,6 and 7 are straight through, but 2 is shorted to 6, and 4 is shorted to 7. It's just a depiction of what you might have in an array output from the test phase.
If a connector pin, either end, wasn't connected anywhere, it would appear as a -- that went nowhere.
Think of how you might draw the cable in a schematic - it would appear much as above.
It would take a little work to develop the algorithm to print it this way, but I don't see a flaw, for cables that are 1:1 anyway. It'll get a bit hairy to draw cables that are a mish-mash, as you'll have to keep track of several complications, like branches on the left and right simultaneously. It will all start, though, with the connection list you generate from your scan, which should still appear as I described it in #23. To me, the key is to start by uniquely identifying every pin. In my example sketch above, you'd internally manage the connections as 1-16, but present 9-16 on the right hand side as 1-8 for the user.
That's how I'd approach it, anyway. I'm not sure it covers all the bases, but I've not 'imagineered' a fatal flaw yet. Of course, one might become apparent the momentI tried to implement it.
The worst might be a very non-standard cable with a lot of back-connects on each end, because the drawing doesn't provide a way to depict that easily on the right hand side. You might end up with:
1>-------ox
2>-------|-----o---------------------------------------------------------------------------<2
3>-------ox |
4>--------------|--------o-----------------------------------------------------------------<4
5>-- x | |
6>--------------o--------|-----------------------------------------------------------------<6
7>------------------------o-----------------------------------------------------------------<7
8>------------------------|-----------------------------------------------------------------<8
xxxxxxxxxxxxxxxxxo----------------------------------------------------------------<5
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo--------------------------------------<1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo--------------------------------------<3
Unfortunately, the message window code here mangles ASCII art(removes excess space chars), and I don't see a way to turn that off, so you'll have to imagine that that looks okay on my screen.
That would work okay in Serial Monitor, where the x would be replaced with a space.
To do this for a 27 pin cable will be a challenge, because you might have to actually generate a large portion of it in memory before sending it to Serial Monitor. Maybe, get all the 1:1 pins printed first, then print all the exceptions last, rather than proceeding in numerical order.
Could also be simplified to just a connections list, as I suggested earlier.
The testing should proceed fast enough that optimizing, by adding complexity, is counterproductive. Consider, this test should take 1ms (or much less) per pin. It will take longer to print the results than to do the test, and longer several orders of magnitude for the observer to comprehend, assess, change cables, etc. There are other areas to improve throughput more effectively than saving processor cycles.
A big thanx to you and for your huge efforts. I really appriciate how much you and the other in this forum are trying to help folk out.
I'd prefere to display the result on LCD display. and the result will be displayed rutin by rutin (short circuit, wrong wiring and no connection).
Here's how the harness would look like


