Go Down

Topic: Arduino Mega cable tester (Read 365 times) previous topic - next topic

Paul_l


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. 

wildbill

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?

DrDiettrich

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

allanhurst

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

Paul_l

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.

Code: [Select]

// --- 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.


wildbill

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.

DrDiettrich

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.

Paul_l

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 ?

DrDiettrich

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.

DrDiettrich

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.

Paul_l

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

DrDiettrich

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


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?

Go Up