Loading...
Pages: [1]   Go Down
Author Topic: Testing Arduino Boards, I/O Pins etc.. Test Shield - Test Software  (Read 2769 times)
0 Members and 1 Guest are viewing this topic.
Red Sea, Saudi Arabia
Offline Offline
God Member
*****
Karma: 11
Posts: 579
..On The Red Sea
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
//--------------------( 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 mode   

    Serial.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:
Code:
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
« Last Edit: January 31, 2011, 07:45:15 am by Terry King » Logged

Regards, Terry King  ..On the Red Sea at KAUST.edu.sa
terry@yourduino.com  LEARN! DO! (Arduino Boards, Sensors, Parts @ http://yourduino.com)

Central MN, USA
Offline Offline
Faraday Member
**
Karma: 35
Posts: 5929
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool, an arduino test shield. Never thought about that. Thanks for sharing.
Logged


Dallas, TX
Offline Offline
Jr. Member
**
Karma: 5
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Kudos!

I am building one!

Edit: Seriously, that 9500 characters limit is not fixed after all the changes?
« Last Edit: January 29, 2011, 03:29:50 am by Staedtler » Logged

--------------------------------------
Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?'
- 'Yeah', reply the bytes. 'Make us a double'.

Red Sea, Saudi Arabia
Offline Offline
God Member
*****
Karma: 11
Posts: 579
..On The Red Sea
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

Make sure you look at the updated photos if you are using that SeeedStudio Proto Board V1.0.
Here: http://terryking.us/arduino-testing.htm

It was a little unclear where the pin strips go on that Proto board to fit into Arduino. The new photos show just where those strips go and that it is better to have the leftmost resistor leads go OVER the soldered pins to the farther holes. (Might make sense if you see the photo  smiley )

Fortunately, 55 years of soldering burns reminded me to physically fit the whole thing together before plugging the iron in.

HINT: It also works well when soldering pins in a shield to first put the pin strips ( long-pins down)  into an Arduino, and then put the shield circuit board down over them. I quick-solder the end pads on each strip and them remove the shield and solder all of them. This way the pins ARE aligned right to start...

I think Seeed intended that it be possible to stack this shield, by putting two sets of pins, male downward and raised female upwards, like some other shields and most proto boards. But maybe they miscounted the rows, like I did at first  smiley-mad

Anyway, it works :-)

Comments and suggestions appreciated!
« Last Edit: January 31, 2011, 07:39:49 am by Terry King » Logged

Regards, Terry King  ..On the Red Sea at KAUST.edu.sa
terry@yourduino.com  LEARN! DO! (Arduino Boards, Sensors, Parts @ http://yourduino.com)

Pages: [1]   Go Up
Print
 
Jump to: