Cable Tester

bfgstew

Senior Member
Hello all, sorry it has been a while since I have posted but other things have taken priority.

I have a project I would like to undertake, and need the Picaxe collective to see if it is viable.

I would like to make a cable tester, the cable is 25 pin D-sub to 17 pin 12mm socket, manufactured by the supplier of the equipment it is used on (high speed barcode scanner camera).
We are experiencing issues with loss of comms, now rather than just replace the cable (£150 a pop) it would be easier (and cheaper) to plug it into the tester and check continuity down each line and therefore eliminate cable issues.
My idea is,

Simple set up of 28X2 using 17 pins connected to cable via male socket, through cable to be tested, into 25 pin D-sub socket, then through an LED.
Mode of operation would be, press start test button, prog would set pin 1 as output, send 5v through wire 1, light LED, other pins would be set as inputs and set to detect any voltage creeping back through any fault in cable, thus illuminating a red LED, (fault). This would be cycled for each wire - ie pin 2 set as output and rest to inputs and so on until all 17 wires have been tested. 17 green LED's will be set in panel to show test progress or maybe 17 Bi colour LED's to show good and bad wire tests?

Can the 28X2 detect voltage as mentioned above? If so how, (sorry but it has been a while), just a pointer please.
Can the pin config be changed as simply as I think, i.e. just a line of coding.

Sorry if this sounds a daft idea but it goes towards my yearly appraisal, plus it gets me back into electronics.........win win for me, plus get paid for doing it in works time....lol.

look forward to hearing your thoughts

Stewart
 

techElder

Well-known member
Are there only two fault conditions that you want to test for? Continuity and High Impedance (open wire)

Or is there some level of leakage between wires that is acceptable?

How do most of your cables break? Do they get pulled / stretched to break connections and/or stepped on / driven over to somehow squash wires together in a short circuit?

I've made lots of "cable testers" with a battery, a buzzer and two spare connectors. All wires are jumpered to the next wire through the spare connectors so that there is one continuous connection.

If it "buzzes" correctly, then the cable is probably OK. I've even built one where a skilled operator could detect other faults by the change in sound level.

Certainly that wouldn't find all possible fault conditions, but repairs on cables are usually caused by mechanical forces from operators.

No micro needed for this kind of GO/NOGO tester.
 

bfgstew

Senior Member
Hi Tex,

I am looking for any leakage really.
As these cables are tucked away, so traffic is not a problem, the main problem is moisture/water. There are various voltages 24, 5 and 3.3 present, so with any moisture getting in (mainly in the connections) this is causing the bad comms.
Testing each wire individually with a known voltage and monitoring other pins for 'stray voltage' while that wire is being tested is my theory.
LED indication is the route I would like to go down as the environment is noisy and with LED's set in a sequence, it should be easy to see good/bad indication.
 

mikeyBoo

Senior Member
Before I retired, I used to use a tester for DB-type cables that worked for most problems. It had 2 sets of LEDs laid out side by side. Testing was done by single-stepping through each wire & seeing if it made it to the other end of the cable or just used to find out how the cable was wired. It also had a sequencer mode & it was easy to identify a short (more than one LED lit on other end of cable) or open (no LED lit).
Seems like it was pretty inexpensive. May have been purchased from B&B electronics.
A poor connection was indicated by a dim LED.
Hope this gives you some ideas. Shouldn’t be too tough to do with a Picaxe if you wanna’ roll your own.
 

techElder

Well-known member
So, you're going to put a "black box" at each end of the cable? With LEDs at one end as indicators?

You would have to have 17 "switches" to connect to both 5 volts or an INPUT pin? That's really 34 switches.

How much "leakage" can you detect at 5 volts?
 

bfgstew

Senior Member
Hi mikeyboo,

Will have a further look on internet, but my search for a tester with these cable ends has been fruitless so far, hence the need for making my own...... thanks for the input though.

Tex.

Cable ends will be plugged into a single "black box" with LED's as indicators.........Yes.

Hoping to use just 17 pins, using 1 pin as an output the other 16 as inputs, to be cycled for each wire check thus (IOOOOOOOOOOOOOOOO, OIOOOOOOOOOOOOOOO, OOIOOOOOOOOOOOOOO etc etc), the idea being, if wire is good LED lights up, if poor or broken wire, dim or no LED, if short or small leakage, the inputs detect voltage on pins and red LED lights up.

This is the big part of the question - can the Picaxe detect a relatively small voltage on the input pin?

Again, many thanks for your thoughts and ideas.

Stewart
 

hippy

Technical Support
Staff member
I am sure some sort of cable tester can be built using a PICAXE.

The first question I would ask is are all 17 wires used ? The second is do you have a mint condition reference cable ?

The usual way to test cable continuity and correctness would be a 25+17 (42) I/O unit, output on one pin and read the rest, build up a 42x42 matrix of connections which can be compared to a reference to indicate pass or fail.

Having done this it is a fun project but I am not convinced the effort is worth it just for one cable or to save a company £150.
 

BESQUEUT

Senior Member
I am looking for any leakage really.
As these cables are tucked away, so traffic is not a problem, the main problem is moisture/water. There are various voltages 24, 5 and 3.3 present, so with any moisture getting in (mainly in the connections) this is causing the bad comms.

Cable ends will be plugged into a single "black box" with LED's as indicators.........Yes.

This is the big part of the question - can the Picaxe detect a relatively small voltage on the input pin?
YES

I am sure some sort of cable tester can be built using a PICAXE.

The first question I would ask is are all 17 wires used ? The second is do you have a mint condition reference cable ?

The usual way to test cable continuity and correctness would be a 25+17 (42) I/O unit, output on one pin and read the rest, build up a 42x42 matrix of connections which can be compared to a reference to indicate pass or fail.

Having done this it is a fun project but I am not convinced the effort is worth it just for one cable or to save a company £150.
If no risk for short circuit, you can simply inject 3,3 V to each wire, and read voltage as the other end with the Picaxe. So you only need 17 or 25 ADC inputs, and test each for correct voltage.
For output, you can use a serial LCD or an APA102 to limit PIN usage, (or even nothing : simply report tests results to a computer using sertxd...)
 
Last edited:

techElder

Well-known member
... high speed barcode scanner camera ...
Another thing to consider is that DC testing may not find faults that affect high speed transmissions.

You should make yourself aware of the signal/data that is being transmitted on those cable wires.

Another thing to consider is change. What are the chances that what you build will have to be rebuilt due to manufacturing changes/revisions?

Hippy's suggestion of a programmable matrix is seriously valid in a testing rig; even one that is not meant for production.
 

hippy

Technical Support
Staff member
Another thing to consider is that DC testing may not find faults that affect high speed transmissions.
That's a good point; it all comes down to what one wants to check for.

The cable testing I was involved in was all end of production line, where we only needed to check point to point connections were present, that there were no open circuits, solder shorts across pins or miswirings. This was for cables which may have loop-back links at each end, pin to multi-pin connections and in-line diodes. And all that could be tested with high-low digital signals.

Once one goes beyond simple continuity and connection testing it gets harder, more complicated, and likely more expensive.

But all it basically needs is two 1-to-N multiplexors, one to put out an analogue or digital voltage, the other to read that back in.

Our final version was a standalone unit, but the prototype was simply a digital I/O scanner which returned results to a PC which would then do the checking and reporting.
 

lbenson

Senior Member
The 40X2 has 27 ADC inputs (ADC0-ADC27 with ADC15 missing). Adding an MCP23017 and an MCP23008 (or 3 MCP23008s) gives you 24 additional I/Os. Take away 2 ADCs for your I2C connection and you have 25 ADCs and counting 4 non-ADC pins (C.0, C.1, B.6, B.7), you have enough available pins for 25 outputs.

So a (relatively) simple program could turn on an output and with an inner loop cycle through 25 ADC reads, outputting the results with sertxd. The outer loop would cycle through the 25 outputs.

You would need to make all the MCP230xx pins except the one you wanted as output high to be inputs so as not to produce any shorts.

A lot of wires, and as others have noted, this wouldn't capture all types of fault.
 

hippy

Technical Support
Staff member
Note that an output-to-input scheme doesn't check for any loop-back connections such as may be the case for the 25-way connection if carrying RS232 serial. For example, CTS and RTS may be joined in the 25-way and if that is missing or intermittent it may cause comms problems.

Without a mint condition reference cable or a known wiring scheme it is impossible to tell from a potentially faulty cable what should be expected. Would an open or short between CTS and RTS be intended or a fault ?

And if there is an intermittent fault, one would have to perform repeated tests to see if one test varied from another.

Checking if a newly built cable is how it should be is a lot easier than trying to tell if some unknown cable is faulty or not.
 

OLDmarty

Senior Member
Could you test signal quality / leakage, by sending an ascii character (or string) at different baud rates, increasing to the top speed (from 1200 to 115kb) and monitor if the returned serial data is corrupt or not?
Each response received would advance the next LED turning on Green or RED depending if the returned character "matched", proving no corruption.

I think you'd need to use 2 'slots' in the picaxe to have a simultaneous transmit and receive monitoring on 2 different pins.



I remember trying this many years ago on a PIC micro.
I thought i was being very clever by sending ascii numbers (the pin numbers) on each wire, but i couldn't work out why i wasn't seeing a response coming back (the far end has a loopback plug on it).


It took me DAYS to realise what my code was doing wrong, e.g.

line 1 > send out the character "1" on pinB.0
line 2 > receive (wait) for an ascii loopback ("1") to return on say pinB.1

I TOTALLY did not see the simple fact that once the character "1" was sent, it would have already finished being sent before the code moved to line2, to actually receive NOTHING (because "1" has already been and gone) LOL ;-)


I will **NEVER** forget that oversight ;-)
 

hippy

Technical Support
Staff member
I think you'd need to use 2 'slots' in the picaxe to have a simultaneous transmit and receive monitoring on 2 different pins.
That will not work with SEROUT and SERIN because, as you note, the SEROUT will have sent the data before SERIN would be started to receive it.

It could however work with SEROUT/HSEROUT and HSERIN, and wouldn't require two slots/tasks.
 

Reloadron

Senior Member
I believe if I were wanting to develop a cable test system I would start with several clean sheets of white paper and a sharp pencil, additionally in my case a pencil with a large eraser. I would begin by listing exactly which parameters I want to test such as point to point? Do I want to find any shorts? How about data transfer? Should I send a word and look for it on the other end? I am sure you get the idea. With a test parameter list generated I may want to draw a logic chart showing my series of events and a flow.

I doubt I would use 16 or 17 pins of my uC. Likely I would use a Multiplex and DeMultiplex configuration. I would choose a line as a common and then as one test step through 16 lines sending a word or two of text and look for a reply through each line. If your only concern is continuity I would send for example a Logic High (maybe 5 volts) and scan all lines for my return. You should only see a High on one line of 16. Chips like the 74154 and 74HC4067 come to mind. Anyway I would use my uC to step through a MUX.

Ron
 

The bear

Senior Member
Hi bfgstew,
How about wiring all the conductors (In the cable under test) in series, using suitable connectors at each end, then sending a signal, voltage or current?
As said previously, using a good cable as a standard.

Regards, Bear..
 

OLDmarty

Senior Member
That will not work with SEROUT and SERIN because, as you note, the SEROUT will have sent the data before SERIN would be started to receive it.

It could however work with SEROUT/HSEROUT and HSERIN, and wouldn't require two slots/tasks.
OK, good to know. I never went the next step with that project of mine.

My plan B was to just use 2 pics on the local board, 1 for TX data, 1 for RX data which would have been much easier ;-)
 

bfgstew

Senior Member
Good morning .

Sorry for not getting back but been tad busy.

Anyhow, many thanks for your replies and suggestions, all of which are good valid points, but........and I really don't wish to sound ungrateful,,,,,,,,all far to complicated for what I need.

I do have plenty of brand new cables to use as a reference so that is not an issue.

I think I made an error on post #6......it should have shown this------OIIIIIIIIIIIIIIII - IOIIIIIIIIIIIIIII - IIOIIIIIIIIIIIIII - IIIOIIIIIIIIIIIII etc, etc.
the theory being, send 5v out along one wire to light an LED, if any moisture is in plug or socket this should result in the LED being slightly dim and also come back down the other lines, albeit at a slightly lower voltage.........will the Picaxe detect this voltage on the input pin? Next step is to change the I/O config as above and repeat the process until all 17 wires have been tested...........I am only looking for lose of voltage due to water/break in wire.....not worried about data/write speeds or any other issues.
So in short can the Picaxe detect a slight voltage on the inputs as described above please?

Many thanks for your help as always.

Stewart
 

hippy

Technical Support
Staff member
So in short can the Picaxe detect a slight voltage on the inputs as described above please?
Given a PICAXE ADC can detect a voltage down to 5mV and a smaller voltage than that could be amplified up, then the answer would seem to be "yes".

However, that might not be the answer as to whether it would be achievable.

Effectively you are measuring a resistance, and a potentially high resistance when it comes to wire insulation breakdown. If insulation breakdown is significant enough that it is interfering with signals then I expect it could be possible.
 

AllyCat

Senior Member
Hi,

Electrically, water (i.e. mositure) is a highly complex material, but for the purpose of this thread we can probably assume that it presents a resistance of perhaps 1,000 kohms (1M) if it surrounds the contacts of a plug, or bypasses the insulation in a cable. But that figure might be out by several orders of magnitude, i.e. "give or take a couple of zeros".

if any moisture is in plug or socket this should result in the LED being slightly dim and also come back down the other lines, albeit at a slightly lower voltage.
Sorry, (IMHO) that's just not going to be visible. The leakage might be just enough to very dimly light a LED (which is intended to be off), but you'd never see any "slight dimming".

However, to cut to the chase, you need to consider the CURRENT which flows, not the Voltage. It's CURRENT through a wire that lights a LED (or not, if continuity is broken) and leakage CURRENT that may produce the faulty operation. You might consider that the PICaxe ADC inputs are "Voltage" detectors, but Microchip specify that the ADC pins should be fed from a "source resistance" of no more than 10k. That means that if the input might be connected to a "disconnected" wire/pin, then the ADC input pin needs a "pull down" resistor of around 10 kohms to ground. It could be somewhat higher in practice but let's Keep It Simples.

So, at one end of the cable (I'd suggest the 25-pin end), you need to connect a PICaxe ADC input pin and a 10k pulldown for each terminal. You might also want to put (say) 1k in series with each terminal or pin so that the PICaxe pins can be (safely) driven as outputs. What you put at the other end of the cable depends on what you need to test, but a simple switch or a LED across each "pair" of wires/pins (or to ground if there is one) may be quite a good solution.

For the basic "continuity" tests you could either drive any pair of wires High/Low and see if an associated LED lights, or make one pin high and see what is the voltage on the corresponding "return" input (ADC or Digital). Then report the result via a dedicated display (7-segment or LCD/OLED), or SERTXD to the PE/terminal.

For "leakage" tests you need to pull one line/wire High and measure the (ADC) voltage on all the other pins. Of course, any "fixed" LEDs will limit what can be measured (but LEDs should be quite high impedance in their reverse direction).

In terms of sensitivity, a READADC10 can resolve to 0.1% (1/1000) of the "Reference" voltage (which is the supply rail by default). So in theory, if the ADC input has 10 kohms to ground then the ADC could (just) resolve a 10 Mohms "leakage" resistance from the supply rail. In practice, it might not be quite that good, but it should comfortably detect a few Mohms (or uA).

However, it's possible to do better than that. The ADC Reference can be reduced to 2 volts (i.e. 2mV resolution) by using FVR2048, and FVR1024 (1mV resolution) can be used, although not recommended by Microchip. So you should be able to easily detect 10 Mohms (or sub uA) leakage currents if necessary. Greater than that might be possible, but I would hope that whatever equipment this cable is for is not that senstive to leakage or crosstalk.

Cheers, Alan.
 

fernando_g

Senior Member
A cable tester may be as simple or as complicated as one wishes to do it.
The attached image ONLY shows the switching matrix of a commercial cable tester. There is a similar size and complexity board for the logic controls.

IMG_1538.JPG
 

Reloadron

Senior Member
Good morning .

Sorry for not getting back but been tad busy.

Anyhow, many thanks for your replies and suggestions, all of which are good valid points, but........and I really don't wish to sound ungrateful,,,,,,,,all far to complicated for what I need.

I do have plenty of brand new cables to use as a reference so that is not an issue.

I think I made an error on post #6......it should have shown this------OIIIIIIIIIIIIIIII - IOIIIIIIIIIIIIIII - IIOIIIIIIIIIIIIII - IIIOIIIIIIIIIIIII etc, etc.
the theory being, send 5v out along one wire to light an LED, if any moisture is in plug or socket this should result in the LED being slightly dim and also come back down the other lines, albeit at a slightly lower voltage.........will the Picaxe detect this voltage on the input pin? Next step is to change the I/O config as above and repeat the process until all 17 wires have been tested...........I am only looking for lose of voltage due to water/break in wire.....not worried about data/write speeds or any other issues.
So in short can the Picaxe detect a slight voltage on the inputs as described above please?

Many thanks for your help as always.

Stewart
If all you want is a simple point to point and check for inter line to line shorts you can but two simple MUX chips and use a uC PICAXE to step through 16 channels plus a common. The MUX chips are bi directional. Terminate each line into a resistor so you have some minor current or if you want hang 16 LEDs out there. Using a PICAXE step through 0 to 15 in binary and read the voltage on an analog in pin. Write your code to Fail on an error. The MUX chips are about $5 USD each plus your uC cost. The rest is in your programming.

Ron
 

bfgstew

Senior Member
Alan, as always your input is concise and totally valid and will take on board.............didn't expect it to be this complex if I am totally honest......lol
Fernando.........OTT, but interesting.
Ron, I think you have nailed it, thank you.
Will look into the MUX chip and think about restructuring the circuit now.

Many thanks once again guys, the knowledge and willingness to help is superb.

Regards

Stewart
 

fernando_g

Senior Member
Indeed, Ron nailed it.

You may even add some LEDs showing the binary sequence being stepped thru, and a small speaker with different sounds for pass/fail, such that you can awe your co-workers with your intelligence. ;) ;)
 
Top