Pages: [1]   Go Down
Author Topic: Too much current on digital pins?  (Read 422 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just got a Arduino Duemilanove board with a ATMEGA328 in it as was playing with making LEDs blink on the digital and PWM pins.  Suddenly none of the digital pins will light an LED more than a very dim amount.  I'm seeing 5V at the pins when on, but the ammeter only shows a few tens of microamps for current when the LED is (dimly) lit.  Pin 13 works normally, as do the PWM pins using analogWrite.  

I suppose somehow I exceeded the limit of the digital pin current capacity (maybe an accidental short along the way?).  Is the '328 bad now, or did I do something to the board?

Mark
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Were you using series resistors wired to the LEDs? That's what the internal pin 13 uses to safely limit current flow through it's built in LED.

Lefty

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used a 220-ohm resistor in series with the LED, but I may have accidentally shorted a pin to ground while connecting jumpers at one point (got in too much of a hurry).

Mark
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well you can test your LEDs with using the +5vdc pin > resistor > LED and > ground to see if any or all are bad. If they test good and your sure your sketch is proberly setting up pin mode and you still can't blink the LEDs then the output pins in question are probably toast.

You can get a replacement 328 with Arduino bootloader installed from several suppliers. Here is one:

http://www.sparkfun.com/commerce/product_info.php?products_id=9217

Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The LEDs are good, and they work on the PWM pins using analogWrite, so I probably toasted the digital pins on the '328.  Perhaps I should order two replacements just in case.  Thanks for the help.

Mark
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 112
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you properly setting the pins up as outputs?  If you use digitalWrite( pin, HIGH) without using pinMode( pin, OUTPUT) first, you will simply be enabling the internal pullup resistor, so you'll be powering an LED through the internal pullup resistor in addition to your external current limiting resistor and only get a very tiny amount of current through the LED.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, found it.  I was using

  pinMode(8,OUTPUT);
[glow]  pinMode(8,LOW);[/glow]

in the setup(), thinking the second line would force the LED off at the beginning.  Removing that line returned all to normal.  RTM, eh?

Now I have a $30 LED blinker again.  On to more playing.

Mark
Logged

Pages: [1]   Go Up
Jump to: