Arduino Mega cable tester

Me and my colleagues from work are working on a project that helps us to store some configuration files on an SD card and load those configs to an Arduino mega.

The idea started a year ago when we created with help from this forum a small cable tester i think it was a cable with 2 connectors and each connector had 20 pins in total 40 testing points, from that I created few sketches that I upload and re upload as I needed. That program tested the continuity, wire/pin short and if the wire where crossed.

My question is can anyone tell me or help me to create a program that can access an sd card with multiple config files and then run it instead of reprogramming the mega all over again if i need to change the program ?

Thank you,
Paul L.

It's certainly plausible. You can make the cable testing data driven and populate the data structures that control it from the SD card. You'll need to devise a file format that supports it and write code to parse it from the card.

Then you need to have a way to select which cable you're testing, perhaps have some way to display that information. How does your current project indicate whether the cable it's testing is good? Serial port to PC?

It would probably help if you post the program as it stands today.

Another thing to consider is whether to use the SD card at all. You would be able to store the data for multiple cables in the Mega and all you would need is a means to select the cable type to test. How often does a new cable get introduced?

Have an array of pins, where you enter the connections. Then use for loops to test the pins stored in that array.

A approach might be to have a known 'good' cable, scan it for all interconnects, store this , then compare dubious cables against this pattern.

Could probably do this in on-board eeprom. Perhaps use SD as a bulk storage for many cables.

Allan

Hello,

@wildbill We use a 16x2 LCD to display if the cable is bad or good but we want to upgrade it to 20x4 LCD, also we want to use an ethernet shield with microSD card. we don`t use an serial connection to the PC.

For the upgrade list we want to implement the following:
-Ethernet shield + microSD card -> also we want to communicate with our tester over ethernet.
-20x4 LCD
-Rotary Encoder for menu surfing
-Hopefully we manage how to work with an centipede shield-> this will help us to get another 64 testing pins

I attached the INO file and for the moment this is the program that we use in order to test the cable.

Every time that we are testing a new or different cable we need to change this variable here.

// --- Pins used for testing ---
int nod[48] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27,
        28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 };

// --- Pine name definition ---
String nume[]={ "1M","2M","3M","4M","5M","6M","7M","8M","9M","10M","11M","12M","13M","14M","15M","16M","17M","18M","19M","20M","21M","22M","23M","24M",
        "1T","2T","3T","4T","5T","6T","7T","8T","9T","10T","11T","12T","13T","14T","15T","16T","17T","18T","19T","20T","21T","22T","23T","24T"};
         
// --- Definition of connections between pins ---
const int MaxLenNet=5; // pin number of the connection with most pins + 1
String net[][MaxLenNet] = { {"1M","1T"}, {"2M","2T"}, {"3M","3T"}, {"4M","4T"}, {"5M","6M","5T","6T"}, {"7M","7T"}, {"11M","11T"}, {"12M","13M","12T","13T"},
              {"14M","14T"},{"15M","15T"},{"16M","16T"},{"17M","17T"}, {"18M","18T"},{"19M","20M","19T","20T"} };
    
int lennume=sizeof(nume) / sizeof(nume[0]); // Number of pins defined
int lennet=sizeof(net) / sizeof(net[0]); // Number of defined netts

// --- Definire culori conexiune ---
String culnet[]={ "AbS/Alb", "AbS", "Mar/Alb", "Mar", "Ros+R/A", "Gri/Alb", "Ver/Ng", "Ecranaj", 
          "Ver/Alb", "Ver", "Mov/Alb", "Mov", "Gri", "Neg+N/A" };

Overall it`s a hard project but i thing it will see the light someday.

Thank you for our replay
Paul L.

tester_2.0.ino (6.66 KB)

UP!

I would start by changing what you have to support multiple cables by adding an extra dimension to each array that needs it. Add a selection mechanism and you have a significant part of your requirements done.

Once that's working you can add ethernet and (if you still need it then) an SD card.

I'd use a SD card, with a program to create and manage cable types on a PC.

And a fixed size char array instead of String, for memory sanity.

DrDiettrich:
I'd use a SD card, with a program to create and manage cable types on a PC.

Do you have any idea how to do that ?

Do you mean the Arduino or the PC part?

On the PC you have a choice of (GUI) development systems, e.g. Processing for use with an Arduino.

Sorry for my poor English. I mean a PC program for the maintenance of the data files on the SD card. The Arduino sketch only reads the file with the cable connections.

Can we move to PM or do you have a Skype ID ?

If you want your job done by somebody else, ask in "Gigs and Collaborations".

ty

I still wonder if you're overcomplicating things. How many different cables do you need to test and how often do you add a new one?

wildbill:
I still wonder if you're overcomplicating things. How many different cables do you need to test and how often do you add a new one?

For the moment we have @50 types of cables that we test, after this test the cable goes to the High Voltage test.
And we add 1-2 new cable configuration per month, but if we can test them than change the program more easily I think the income will rise a little bit.

Do your cables have 1 pin on connector A to 1 pin on connector B - or to more than one pin on B?

And how many pins ( maximum) will the cables have?

Allan

allanhurst:
Do your cables have 1 pin on connector A to 1 pin on connector B - or to more than one pin on B?

And how many pins ( maximum) will the cables have?

Allan

Hello Allan,

For the moment we are testing cable with 24 pins/connector in total 48 digital pins that are used. Also we want to upgrade to 56 pins/connector in total 112 digital pins with the help of the Centipede shield, but that is not important for now, what I want is to upload some setting on an SD card and select it trough a menu an test the cable and if it`s needed to change the program by selecting it from the SD card not modify the actual arduino code.

The cable that we are testing now varies from 2 pins/connector to max 24 pins/connector.

The array is like this:
A B
1 1
2 2
3 3
... ...
24 24
Here is the centipede shield that I want to use: Centipede Shield V2 - Macetech Electronics Store
Thank you for your replay

It's not overly complicated. The data starts with the number of pins, followed by that number of connections. If a pin has no connection, its value is zero, otherwise it's the pin number it is connected to. If it's connected to multiple pins, the first pin element contains the lowest number of next pins, that pin element the next higher one, and so on.

The program has an array of available output pins, which is filled from above data files at runtime. Then the test checks the connections pin by pin.