Go Down

Topic: Too much current on digital pins? (Read 473 times) previous topic - next topic

Mark Conner

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

retrolefty

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


Mark Conner

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

retrolefty

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

Mark Conner

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

ajb

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.

Mark Conner

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

Go Up