Go Down

Topic: Arduino Mega cable tester (Read 321 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.

The array is like this:
A          B
1          1
2          2
3          3
...         ...
24          24

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

Here is the centipede shield that I want to use: http://macetech.com/store/index.php?
main_page=product_info&products_id=23

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" };



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

cedarlakeinstruments

This would probably be easier and cost less on a Raspberry Pi. Ethernet, SD card I/O and interface to large screen is already built in. The only issue would be expanding the amount of I/O and that's not really a problem.
Electronics and firmware/software design and assistance. No project too small

Paul_l

#2
Sep 20, 2018, 01:35 pm Last Edit: Sep 20, 2018, 01:36 pm by Paul_l
This would probably be easier and cost less on a Raspberry Pi. Ethernet, SD card I/O and interface to large screen is already built in. The only issue would be expanding the amount of I/O and that's not really a problem.
Hello,

Thank you for your replay, the modules are not a problem, because we already got those parts.

Those are the parts that we have already:

2004 LCD with I2C module
Ethernet shield with SD card
Centipede shield

And if we need other parts that will not be a problem because we got some cheap parts in our town.

I like more the idea of using a raspberry pi, but for the moment I would like to continue this project with arduino mega and some shields.

JMeller

If you had access to WiFi, I would buy an ESP-01 with the intent to get rid of the Ethernet shield and the 20x4 LCD.  In place of the Ethernet shield, I would would purchase a 2.8" TFT screen shield (with on-board SD slot).

I use the aforementioned configuration as a thermostat controller on my Mega; TFT has 6 permanent menu options with sub-menus in each page with additional controls to change temp, schedules, controls for my Philips Hue lights, etc.

Just my two cents...

Paul_l

Can anyone help me modify my code to read a text document trough an card from ethernet shield with the testing parameters :
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" };

Go Up