PAGE 107 OF 150 · MICROCONTROLLERS & LEDS
Microcontroller Pin Current Limits
Datasheets state the safe per-pin current.
LED SYMBOLTriangle points from anode to cathode; the arrows show light leaving the part.
Pins are small
A microcontroller pin is meant to supply only a modest current. On classic 5 V AVR boards that is about 20 mA recommended, with 40 mA as the absolute maximum, and around 200 mA for the whole chip.
Advice
- Always read the datasheet for your chip, as 3.3 V boards are often limited to lower currents.
- Use 5 to 10 mA for indicator LEDs.
- Add a transistor or MOSFET for anything heavier.
Count the total of all LEDs on at once, not just one.
REMEMBER
Check per-pin and total-chip limits for your board.Try it yourself
Sketch the circuit on paper first, calculate the values, then build it on a solderless breadboard using a low-voltage supply. Measure with a multimeter before you make anything permanent.
Explore LED clocks, stopwatches and electronics at cosycom.com.