About this calculator
Microcontroller pins have two separate current limits, and exceeding either damages the chip. One is what a single pin can source or sink; the other is what the whole package can pass through its supply and ground bonds. Staying under the first and blowing through the second is a common way to kill a board.
This calculator lets you list what each pin is driving, sums the total, and checks both limits against the board you have selected.
How it works
The per-pin limit is set by the output driver transistors. Push more than they are designed for and the output voltage sags — then they heat up, and eventually the bond wire or the driver fails. Datasheets give both a recommended continuous figure and an absolute maximum; the latter is a damage threshold, not a design target.
The total limit is set by the package. All the pin currents come in through the Vcc pins and leave through the GND pins, and those bond wires have their own rating. An ATmega328P allows 20 mA per pin but only 200 mA in total, so you cannot run ten pins at 20 mA.
Some parts add a middle tier. AVRs specify a limit per port group as well, typically 100 mA, so loading eight pins of the same port is more restrictive than spreading them around.
On development boards the real constraint is often the on-board regulator rather than the chip. A Raspberry Pi allows just 50 mA across all GPIO combined, because the 3.3 V rail is shared with other things on the board.
Sinking is frequently stronger than sourcing on the same part, which is why LEDs are so often wired from Vcc through the LED to a pin that pulls low.
Worked example
An Arduino Uno project with eight indicator LEDs, a servo and an I²C display.
- 8 LEDs at 15 mA each = 120 mA
- I²C pull-ups and display logic ≈ 5 mA
- Servo: 500 mA — but powered separately, not from a pin
- GPIO total: 120 + 5 = 125 mA of the Uno's 200 mA budget
- Worst single pin: 15 mA, under the 20 mA recommendation
125 mA is within budget, but at 63% there is not much room left. Dropping the LEDs to 8 mA each — still perfectly visible — would halve the load. The servo must never be driven from a pin; it gets its own supply with a shared ground.
Practical notes
- Motors, servos, relays and LED strips never run from a GPIO pin. Use a transistor or driver IC powered from the supply, with only the control signal coming from the pin.
- The absolute maximum in a datasheet is where damage starts, not where performance ends. Design to the recommended continuous figure.
- Modern LEDs are bright at 2–10 mA. The habitual 20 mA is a leftover from older parts and wastes both current budget and battery.
- Add up what is on at once, not what exists. Eight LEDs that are never all lit together do not need eight LEDs worth of budget — but be honest about the worst case.
- Add the chip's own supply current too. An ATmega draws around 20 mA by itself, an ESP32 far more when its radio is transmitting.
- The Raspberry Pi's 50 mA total is the strictest of the common boards and catches a lot of people. Three LEDs at 16 mA already exceeds it.
Frequently asked questions
How much current can an Arduino pin supply?
20 mA continuous is the recommended figure for an Uno, with 40 mA as the absolute maximum. The whole chip is limited to 200 mA across all pins together.
How many LEDs can I drive from a microcontroller?
Divide the total budget by the current per LED. An Uno at 200 mA total with LEDs at 10 mA each manages about 20 — but leave margin for the chip's own consumption and anything else connected.
Can I run a motor from a GPIO pin?
No. Even small DC motors draw hundreds of milliamps and produce inductive kickback that will destroy the pin. Use a MOSFET or a driver IC with a flyback diode, powered from the main supply.
What happens if I exceed the per-pin current limit?
At first the output voltage sags and the chip heats up. Push further and the driver transistor or bond wire fails — sometimes immediately, sometimes after months of marginal operation.
Why is the Raspberry Pi limit so low?
Its GPIO runs off a shared 3.3 V rail that also supplies other parts of the board, and there is limited headroom. 16 mA per pin and 50 mA total across all of them is the documented budget.