Hello! This place smells New...
So I'm testing a bunch or Arduinos of various pedigrees. I built a Test Shield that has a 220 ohm resistor from every IO pin except 0,1,13
They all join at a common isolated point. The point also has 2 100K resistors from Ground and +5 to it. So at Reset, everyones an Input, the common point goes right to 2.5Volts unless some pin is shorted or leaky, and I test for that as the first test, using A0.
Then, I walk thru all the pins, first with one pin sinking, and test all the others for ability to source current, then one pin sourcing and each other pin tested for ability to sink current (about 10ma)..Then the reverse, testing sourcing ability. So, in those cases the common point also is right about 2.5 volts unless there is a contact problem or a damaged IO.
Then, I read 3 different voltages with all the Analog Inputs A0..A5 and display them.
So that all works pretty well. This is a "Self-Test" with "Test Fixture" approach. More elaborate testing could be done, but that would take another Arduino and quite a bit of added hardware and fixturing. This covers a lot with just 19 resistors and code.
SO: I have a web page with this stuff on it: http://terryking.us/arduino-testing.htm
Here's a quick look at a Test Shield:
Umm.. and I'll try to put the CODE here. Maybe. (OK, Too Big. This is a fragment...) See the Website.
Where should stuff like this go in the New Forum??
//--------------------( TEST 3 )----------------------------------------
Serial.println("TEST 003 - Digital Pins Sink Current");
pinMode(2, OUTPUT); // Set Load pin to Output mode
digitalWrite(2, HIGH); // Connect HIGH Load
FailArrayPtr = 0 ;//---------( Write the Digital Pin Labels )------------
WriteDigitalPinLabels();//------( Loop thru pins, testing )-----------
for ( DigPort2Test = FirstDigPort;
DigPort2Test <= LastDigPort;
DigPort2Test ++)
{//Loop thru Source Tests
FailArrayPtr ++ ;pinMode(DigPort2Test, OUTPUT); // Set tested pin to Output mode
digitalWrite(DigPort2Test, LOW); // Pin Sinks current LOW
delay(A2D_Delay);
IntVoltsRead = analogRead(A0);
FloatVoltsRead = a2d2float (IntVoltsRead);
pinMode(DigPort2Test, INPUT); // ReSet tested pin to Input modeSerial.print(FloatVoltsRead,2);
Serial.print(" ");if (FloatVoltsRead > LowVoltResultOK
&& FloatVoltsRead < HighVoltResultOK)
{
FailArray[FailArrayPtr] = 0;
}
else
{
Failure ++;
FailArray[FailArrayPtr] = 1;
}}//END Loop thru Source Tests
Serial.println();
The Test Output looks like this:
Arduino Board Test V1.07
Arduino-Direct.com terry@arduino-direct.com
--- TEST START ---
TEST 001 - Any stuck pins??
VoltsRead = 2.50 -- OK!
TEST 002 - Digital Pins Source Current
PIN-3 PIN-4 PIN-5 PIN-6 PIN-7 PIN-8 PIN-9 PIN-10 PIN-11 PIN-12
2.49 2.50 2.49 2.50 2.50 2.51 2.51 2.52 2.53 2.44
-OK- -OK- -OK- -OK- -OK- -OK- -OK- -OK- -OK- -OK-
TEST 003 - Digital Pins Sink Current
PIN-3 PIN-4 PIN-5 PIN-6 PIN-7 PIN-8 PIN-9 PIN-10 PIN-11 PIN-12
2.55 2.54 2.53 2.52 2.52 2.52 2.51 2.49 2.49 2.58
-OK- -OK- -OK- -OK- -OK- -OK- -OK- -OK- -OK- -OK-
TEST 004 - Analog Pins Source Current
PIN-1 PIN-2 PIN-3 PIN-4 PIN-5
2.47 2.49 2.49 2.50 2.51
-OK- -OK- -OK- -OK- -OK-
TEST 005 - Analog Pins Sink Current
PIN-1 PIN-2 PIN-3 PIN-4 PIN-5
2.52 2.50 2.50 2.49 2.48
-OK- -OK- -OK- -OK- -OK-
TEST 006 - Analog Pins A0 to A5: A to D (About 2.50 V)
PIN-0 PIN-1 PIN-2 PIN-3 PIN-4 PIN-5
2.48 2.48 2.48 2.48 2.48 2.48
TEST 007 - Analog Pins A0 to A5: A to D (About 3.33 V)
PIN-0 PIN-1 PIN-2 PIN-3 PIN-4 PIN-5
3.32 3.32 3.32 3.32 3.32 3.32
TEST 008 - Analog Pins A0 to A5: A to D (About 1.66 V)
PIN-0 PIN-1 PIN-2 PIN-3 PIN-4 PIN-5
1.65 1.65 1.65 1.65 1.65 1.65
TEST COMPLETE
OK. let's see if all this stuff worked...
Regards, Terry King ..On the Red Sea at KAUST.edu.sa
terry@terryking.us