project help required

Hello, i have a 6 core cable which i would like to test using an Arduino, the basis of the test would be to output 12v through each core then input it back into itself checking for continuity. Each core would have to be checked individually so a short circuit can also be checked between the other cores. The cable test should start from when an input signal is received, when the test is complete the relevant test result outputted. I am very new to Arduino and this form of programming as all past experience is from PLC's. Could some one please point me in the right direction or try and explain how the code should be written. Any help is appreciated.

Regards, Glenn Foggin.

Any special reason for using 12V? Can you use the operating voltage of the arduino - 5V? How long is the cable?

Hi, Glenn, yes you would be better to use 5V as in most cases that is the native input voltage level for arduinos.

Do you want to connect the arduino at one end and use a jumper system at the other to give you 3 loops, or do you want to connect to the 6 wires at both ends?

If you look at one end with 6 arduino i/o, then you just need to hold one wire at a time high to check the others for shorts, then say loop 1 to2, 3 to 4 and 5 to 6 at the non arduino end.
Then put 1 high and check wire 2.
wire 3 high and check wire 4
wire 5 high and check wire 6.
This uses 6 i/o.
If you want to have connection at both ends then you need 12 i/o.

Tom.... :slight_smile:

i would like to use 6 output and 6 inputs and test each core individually, could you explain how the program would operate? thank you.

also 5 volts supply would not be a problem.

Is there a "plug" on each end of the cable to be tested and could there be a pair of "sockets" on a board connected to the Arduino. Then it would be reasonably easy to connect all the ends to 12 Arduino pins.

A program could cause a HIGH 5v on each of the six wires in turn and could then check that the 5v was detectable on the other end of the same wire and not on any of the others.

...R

yeah the cable will be connected to plug and socket direct to the arduino, the program requires writing so an intermittent fault can be detected, therefore maybe some sort of timer in the software when each core is begin tested or a loop until a fault occurs??

I would wire it like this.
All 12 pins are inputs to start. Take a reading on all 12, ensure there are no lows, which would indicate a short to Gnd somewhere if you had a shield that was grounded for example.
Change 1 pin to an output, drive it Low. Read its mate, ensure it is low, and all others are High, indicating continuity and no shorts to any adjacent pin.
Change pin back to an input, change next pin to an output, repeat.

This can be done quite quickly, so readings can be made continuously while you wiggle things looking for a position that causes an intermittent to occur more frequently or with more repeatability.

i probably wouldnt have the knowledge to program that tbh, this is what i have at the moment but i am getting an error reading...

lead_test_project.ino In function 'void loop()':
lead_test_project:80:error:expected')' before '{' token

i presume it has something to do with the positioning of my brackets but i cant find the error. Could some one please have a look below and identify my errors.

Thanks and apologies for my lack of knowledge but i am very new to this.

Code for the void loop.....................

void loop()
{
{
digitalWrite(core1out, HIGH); //turn on core 1 output and test
}
delay(100);

if(digitalRead(core1in) == LOW
{
digitalWrite(faultout, HIGH);
}

if(digitalRead(core2in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core3in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core4in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core5in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core6in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core7in) == HIGH
{
digitalWrite(faultout,HIGH);
}

{
digitalWrite(core1out, LOW);
}

delay(100);

{
digitalWrite(core2out, HIGH); //turn on core 2 output and test
}

delay(100);

if(digitalRead(core2in) == LOW
{
digitalWrite(faultout, HIGH);
}

if(digitalRead(core1in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core3in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core4in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core5in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core6in) == HIGH
{
digitalWrite(faultout,HIGH);
}

if(digitalRead(core7in) == HIGH
{
digitalWrite(faultout,HIGH);
}

{
digitalWrite(core2out, LOW);
}

delay(100);

if(digitalRead(core1in) == LOW

There, and subsequent "if"s

can you explain how that statment should be wrote?

" ... should be written" :slight_smile:

You have unmatched brackets - two open brackets but only one closing bracket. It should be

" if(digitalRead(core1in)) == LOW "

...R

Firstly, go back to the post where you cited code, "modify" it, highlight the actual code and click on the "code" button [ # ] to mark it up as code so it is easily read in these postings.

Secondly, use the "Tools -> Auto Format" function in the IDE to check your code for problems such as those brackets.

Robin2:
" ... should be written" :slight_smile:

You have unmatched brackets - two open brackets but only one closing bracket. It should be

" if(digitalRead(core1in)) == LOW "

...R

Nope.

AWOL:
Nope.

OK, OK, just to clarify; it is indeed unmatched brackets, but the missing bracket needs to be somewhere else ... on the same line.

:smiley:

AWOL:

Robin2:
" ... should be written" :slight_smile:

You have unmatched brackets - two open brackets but only one closing bracket. It should be

" if(digitalRead(core1in)) == LOW "

...R

Nope.

You're quite right it should be

" if(digitalRead(core1in) == LOW) "

--- do I get 30%?

...R

when powering my board up previous outputs are stopping on from the previous tests, is there a way when initializing my board at the beginning of the programme to turn all outputs to low? thanks

Hmm, have you read the previous replies?

How about going back and marking up your posted code?