-3

I've recenly bought my first Arduino uno and I was messing with DC motors. I put on the prototype shield on arduino with a mini breadboard on it. I was using L293D bridge. I've connected everything and then put in my 6V battery pack and it BURNED. I don't know what happened. I didn't upload the code, I just connected batteries. I put negative to GND and positive to pin 8. Arduino is responding, but I'n not sure whether all pins are working, how do you check this?

migrated from electronics.stackexchange.com Jun 6 '14 at 18:43

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

  • 5
    There is not enough information here to tell if you damaged the board or ATmega, you can check by writing a simple sketch to toggle the state of each IO and test them with a multimeter/logic probe/LED and resistor. – Dan Nixon Jun 6 '14 at 18:53
  • @Dan Nixon. The arduino has internal PULLUP resistors and a led on the board which makes it possible to test the pins without external tools except a jumper wire. – Handoko Jun 7 '14 at 0:11
4

To make sure all pins are responding you could put all your pins as input with internal pull-up except pin 13 which must be set as output. The on board led is connected to pin 13, so when you put pin13 high it will turn the led on. Connect every other pin 1 by 1 to the GND to see if the led is toggling once you've connected a pin to the GND.

Try to use this code.

void setup(){  
for(int p = 0; p <= 12; p++){  // Define pin0 until pin12 to INPUT with internal pull-up resistor
pinMode(p, INPUT_PULLUP); 
} 
pinMode(A0, INPUT_PULLUP);  // Define pinA0 as INPUT with internal pull-up resistor
pinMode(A1, INPUT_PULLUP);  // Define pinA1 as INPUT with internal pull-up resistor
pinMode(A2, INPUT_PULLUP);  // Define pinA2 as INPUT with internal pull-up resistor
pinMode(A3, INPUT_PULLUP);  // Define pinA3 as INPUT with internal pull-up resistor
pinMode(A4, INPUT_PULLUP);  // Define pinA4 as INPUT with internal pull-up resistor
pinMode(A5, INPUT_PULLUP);  // Define pinA5 as INPUT with internal pull-up resistor
pinMode(13, OUTPUT);        // Define pin13 as OUTPUT (INTERNAL LED);
}

void loop(){ 
if(digitalRead(0, LOW)){   // If pin0 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
if(digitalRead(1, LOW)){   // If pin1 is connected to GND turn led off
digitalWrite(13, LOW); 
} 
if(digitalRead(2, LOW)){   // If pin2 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
if(digitalRead(3, LOW)){   // If pin3 is connected to GND turn led off
digitalWrite(13, LOW); 
} 
if(digitalRead(4, LOW)){   // if pin4 is connected to GND turn led on
digitalWrite(13, HIGH); 
}
 if(digitalRead(5, LOW)){  // If pin5 is connected to GND turn led off
digitalWrite(13, LOW); 
}
 if(digitalRead(6, LOW)){  // If pin6 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
if(digitalRead(7, LOW)){   // If pin7 is connected to GND turn led off
digitalWrite(13, LOW); 
} 
if(digitalRead(8, LOW)){   // If pin8 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
if(digitalRead(9, LOW)){   // If pin9 is connected to GND turn led off
digitalWrite(13, LOW); 
} 
if(digitalRead(10, LOW)){  // If pin10 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
if(digitalRead(11, LOW)){  // If pin11 is connected to GND turn led off
digitalWrite(13, LOW); 
} 
if(digitalRead(12, LOW)){  // If pin12 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
if(digitalRead(A0, LOW)){  // If pinA0 is connected to GND turn led off
digitalWrite(13, LOW); 
} 
if(digitalRead(A1, LOW)){  // If pinA1 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
if(digitalRead(A2, LOW)){  // If pinA2 is connected to GND turn led off
digitalWrite(13, LOW); 
} 
if(digitalRead(A3, LOW)){  // If pinA3 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
if(digitalRead(A4, LOW)){  // If pinA4 is connected to GND turn led off
digitalWrite(13, LOW); 
} 
if(digitalRead(A5, LOW)){  // If pinA5 is connected to GND turn led on
digitalWrite(13, HIGH); 
} 
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy