Continuity?

Hey Everyone,

I have a little adapter i have connected to the arduino to test the polarity of 500+ cables,

I have D1 and D2 set as inputs,
if D1 is set high, it turns on a green LED as a pass, if it is pulled low, it turns on a red LED.
If D2 is set low, it turns on a green LED as a pass and if high, turns on a red LED as a fail.

For a high / low source, i used ground and 5v of the arduino. This worked perfectly fine for what i needed, if the polarity of the cable is wrong, the lights would be red. if it was correct, the lights out be green.
The problem is that i never accounted for one of the pins of the cable i was testing to be shorted to the other. So when that happened, a direct short across GND and 5v occurred, the arduino survived with just a burnt out diode.

From looking around, it seems as though even if i do it all with digital pins (set one high and one low), its still a direct short and will release the magic smoke.

So my question to you is, Is there a way of testing the polarity of the cables (as above) and having protection from a short?

Chris

If the Arduino pins are set as INPUT or INPUT_PULLUP a short between 5v and the pin or between GND and the pin won't cause a problem.

If you are using a pin in OUTPUT mode then you do need to guard against short circuits, A 250 ohm resistor will limit the 5v current to 20mA.

...R

... and presumably there has been a separate check for opens in the cable.