---------------------( COPY )-------------------------- Arduino has limits on how much current can be sourced or sunk by its I/O pins. When interfacing with hardware you need to be careful not to exceed these limits. For details see ArduinoPinCurrentLimitations. In general, do not exceed 20 mA per pin. In particular, do NOT directly connect LEDs to Arduino outputs! Always use a series resistor (220 ohms is a good value)
-----------------( END COPY )----------------------
A more 'Pretty?' version of it with a bigger diagram is on my ARDUINO-INFORMATION Wiki here:
It might be worth pointing out, although you have alluded to it, that the steady state for sourcing current is given as 20 mA, since you have 20 pins, and your maximum steady state current (for all pins) is 200 mA, then effectively you can only afford an average of 10 mA (if you were sourcing all 20 pins). And then of course:
The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150 mA.
So if you are planning to source a lot of stuff (drive lots of LEDs for example) then you need to drop down even more (average of 7.5 mA?).
By my calculations this bumps up the recommended resistor for LEDs to closer to 400 ohms than 220.
Also can you guys answer this? It isn't totally clear to me from reading the Atmega documentation, but would you add together sourcing and sinking?
So, for example if you can source a max of 200 mA, and sink a total of 200 mA (or is it 300? - it isn't totally clear), then would this be true ...
Source 190 and sink 190 -> OK (but no more than 10 mA extra of each)
or:
Source 190 and sink 10 --> OK (you add sourcing and sinking, so we have reached the max of 200).
I feel this is what we should be using for any serious designs that we expect to run for some time.
BUT (A Formal Engineering Term!): The Spec. doesn't quite add up:
Absolute Maximum Ratings
DC Current per I/O Pin ............................................... 40.0 mA
DC Current VCC and GND Pins................................ 200.0 mA
There is 1 VCC pin: Means these Arduinos can Source a total of 200mA Max
There are 2 GND pins: Means these Arduinos can Sink a total of 400mA MAx
BUT the maximums for the PORTS add up to 300 mA.
I would "Simplify" this and go with these guidelines: 1. Do not exceed the total per-port currents shown above 2. Do not exceed 20 mA per pin for normal designs 3. Never exceed 40 mA per pin.
Here's the way I think about this (Comments Welcome!):
SOURCE current flows:
From the External Power Supply + terminal
to the Chip Vcc pin
through the Chip "pull up" FET driver
out the I/O pin
'down' through the external load
to the External Power Supply - GND terminal
SINK current flows:
From the External Power Supply + terminal
'down' through the external load
into the Chip pin and through the Chip "pull down" FET driver
to the Chip Gnd pin
to the External Power Supply - GND terminal
SO: These are largely independent circuits, depending on the Chip PD (Chip Guy Talk: Physical Design), and neglecting (!) capacitance effects in high-speed switching.
A little resulting mantra: "When driving LEDs, 'tis better to SINK than to SOURCE!"
Maybe we can get an ATMEL applications Engineer to comment on this...