I'm doing what would otherwise be a ho-hum project: an Arduino Mega driving 40 different LEDs distributed around the hubs of a geodesic sphere. A no-brainer, right? Yes, I'm fully aware that the maximum current output of a MEGA pin is 40mA. My LEDs max out at 20mA, and I put in current limiting resistors to keep their current below 20mA. Everything should be hunky-dory, right?
Well, hunky-doriness is nowhere to be seen. Yes, I know that I can't light up all those LEDs at once; in my test rig, I'm lighting them up individually in sequence, each one getting only 10mSec of current. It works pretty well, but the un-hunky-dory part is that SOME of the LEDs aren't getting much current. While the other ones blink brightly, eight of the LEDs faintly flicker. They're getting a signal, all right, but it's very weak. It's not the LEDs, because when I bypass the Arduino output and give them straight 5V, they light up bright and cheery. It would appear that some of the pins have lost their current-generating oomph.
I found one striking pattern: pins 2 through 7 all turned out to be gutless. That's certainly suspicious! But alas, pins 29 and 51 are also gutless. Poof! There went that line of reasoning.
My best guess is that, at some point in my experimentations, I pulled too much current from these pins and blew their output transistors. But I've been quite careful about that kind of thing. Perhaps I scuffled across the carpet and touched the wrong wire, zapping them with static electricity--but why pins 2 through 7? Besides, after 40 years of zapping ICs, I'm pretty careful about grounding myself before touching anything.
Yes, this is definitely an Arduino brand Mega board, not NoNamo Electronics.
So the question here is, can I expect more pins to fail with time, or should I just buy a new board? Or maybe just slap some transistors onto the outputs of the bad pins?
One other thing: can I use the analog input pins for LED output? The documents seem to say so, but they aren't explicit on the matter.