Posts: 2
Joined: Thu Sep 05, 2013 6:11 pm

Raspberry Pi as a cable tester

Thu Sep 05, 2013 7:31 pm

I'm wondering if a Raspberry Pi is a possible solution to a problem I have:
I need to test an industrial amount of custom cables. Each cable has 9
wires and two ends, which we can call A and B. I want to make sure that if a
signal is given to Ax on one end (for x in [0..8]), then the corresponding Bx
gets the signal (and only Bx, as I want to test for possible short-circuits).
So basically I need a device where I can independently write to 9 output pins,
and simultaneosuly read from 9 input pins.

If I understand correctly, revision 2 Raspberry Pi has a total of 21
programmable lines (17 + 4 on P5 connector). Since I only need 18, this
should suffice.

Mind you, I have plenty of experience with low-level bit-manipulation
programming in C, but not much experience programming I/O ports. In your
honest opinion is getting a RPi the best option for me, or am I neglecting
a much more obivous approach using a regular PC? (For instance, I thought
I could use a couple of parallel ports, but it seems that only 8 pins can
actually be read/written in a parallel port, am I right?)

Thanks in advance for your help!

User avatar
Posts: 270
Joined: Mon Apr 02, 2012 1:39 pm
Location: Minneapolis, MN

Re: Raspberry Pi as a cable tester

Fri Sep 06, 2013 6:22 am

Yes, that should work.
Look at the wiringPi libraries for programming the GPIO in C.

Posts: 4208
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Raspberry Pi as a cable tester

Fri Sep 06, 2013 7:16 am

Your scheme seems feasible for basic connection testing.
You may benefit from testing at higher voltages and / or with higher loads to detect insulation problems, dry joints, solder whiskers etc. That would require some extra circuitry.

I suggest you program all pins as input with pull-up except for the pin you are testing. Set that low and read all inputs to check that only the opposite end pin is low and all others are high.

It might be advisable to have some additional protection for the IO if you intend to regularly plug and unplug cables without ESD (electrostatic discharge) precautions. (The Pi has some ESD protection diodes on GPIO).
The Pi is cheap enough to try it and see if you have a problem or not, if occasional failures are tolerable.
Last edited by PiGraham on Fri Sep 06, 2013 9:30 am, edited 1 time in total.

User avatar
Posts: 49
Joined: Mon May 07, 2012 8:48 pm
Location: Settle, in the Yorkshire Dales
Contact: Website

Re: Raspberry Pi as a cable tester

Fri Sep 06, 2013 9:04 am

Many years ago I was tasked with testing a load of installed 9-way d connector cables. I made up a connector with resistors to each pin - pin 1 was the common, pin 2 connected through 220ohm, pin 3 330ohm and so on. Then I could plug that in at one end and check the resistances with a multimeter at the other. If two pins were shorted the resistance came out wrong. Not a full check at higher voltage, but cheap and simple and it worked.

The Pi would be a 'sledgehammer to crack a nut' solution, but it would certainly work. As PiGraham mentioned, do protect it against ESD - a 1meg resistor on each pin should do it. And you may not have much experience programming io ports yet - but you soon will. Just watch out for the permissions problems getting at the Pi GPIOs.

Simon R.

Return to “Automation, sensing and robotics”