Arduino Pin Current Limit: How Many mA Can Each Pin Supply?
Arduino pin current limit: 20 mA recommended, 40 mA absolute max, 200 mA total. Port groups, 5V and 3.3V pins, ESP32 and Pico values, when to use a transistor.
The short answer to the Arduino pin current limit question: each digital pin of the ATmega328P, the brain of the Arduino Uno, can take at most 40 mA, but for continuous operation 20 mA per pin is recommended. The total of all pins isn't unlimited either: the current through the chip's VCC and GND pins must not exceed 200 mA. So you can't draw 20 mA from each of 20 pins and reach 400 mA; the total budget is shared by all of them.
In this article you'll see the limits per pin, per port group and per board in tables; you'll learn how much current you can take from the 5V and 3.3V pins, the matching values for the ESP32 and Raspberry Pi Pico, and when an LED, buzzer, relay or motor needs a transistor. In the last section we explain what breaks, and how, when you exceed the limit, and how to prevent it.

How many mA can an Arduino pin supply?
The ATmega328P datasheet gives two different values, and mixing them up is the most common mistake. The absolute maximum (40 mA) is the limit the chip can survive for a short time without permanent damage; it is not a design target. The datasheet's electrical characteristics are given at a 20 mA test current: at a 5 V supply, a pin sourcing 20 mA keeps its output at 4.2 V or more, and a pin sinking 20 mA rises to at most 0.9 V. As the current increases, the pin voltage drops, the chip heats up and logic levels start to suffer. That's why 20 mA per pin is the safe target, and 10–15 mA leaves a comfortable margin.
| Value | ATmega328P (Uno, Nano, Pro Mini) | What it means |
|---|---|---|
| Recommended per pin | 20 mA | Safe upper limit for continuous use |
| Absolute maximum per pin | 40 mA | Permanent damage if exceeded; not a target |
| Per VCC and GND pin | 200 mA | The total of all pins flows through here |
| Output HIGH voltage at 20 mA | at least 4.2 V (5 V supply) | Under load the pin drops below 5 V |
| Output LOW voltage at 20 mA | at most 0.9 V (5 V supply) | Under load the pin rises above 0 V |
Port groups: which pins share the same budget?
Besides the 200 mA total, the datasheet splits the pins into groups and limits each group's total current separately. When pins sink current (pin LOW, load tied to 5 V), each group carries at most 100 mA; when they source current (pin HIGH, load tied to GND), two groups carry at most 150 mA each. The table below shows these groups with Arduino Uno pin names; the port letters are the chip's own names.
| Group | Arduino Uno pins | Chip ports | Total limit |
|---|---|---|---|
| Sink group 1 | A0–A5 | PC0–PC5 | 100 mA |
| Sink group 2 | D0–D4 | PD0–PD4 | 100 mA |
| Sink group 3 | D5–D13 | PD5–PD7, PB0–PB5 | 100 mA |
| Source group 1 | A0–A5 and D0–D4 | PC0–PC5, PD0–PD4 | 150 mA |
| Source group 2 | D5–D13 | PD5–PD7, PB0–PB5 | 150 mA |
In practice: if you line up 9 LEDs on D5–D13 and each draws 15 mA, the total is 135 mA, very close to the 150 mA source limit. Spread the same LEDs over two groups and the chip runs more comfortably. The values are the same, with small differences, for the TQFP and DIP packages; for a precise design, check the DC characteristics notes in the datasheet of the chip on your board. You'll find which pin belongs to which port in our Arduino Uno pinout guide.
Board-by-board current table
Different boards use different chips and on-board regulators, so the limits change too. The table below summarises the most common boards. The ATmega328P values come from its datasheet; the ESP32, Raspberry Pi Pico and Uno R4 values are approximate and may vary slightly with the board maker and chip revision, so check the current datasheet of that chip for exact figures.
| Board | Recommended per pin | Upper limit per pin | Total I/O current | From the 3.3 V pin |
|---|---|---|---|---|
| Arduino Uno R3 / Nano | 20 mA | 40 mA (absolute) | 200 mA (VCC/GND) | Uno: about 50 mA |
| Arduino Mega 2560 | 20 mA | 40 mA (absolute) | 200 mA per VCC/GND pin | about 50 mA |
| Arduino Uno R4 | about 8 mA | see the datasheet | see the datasheet | see the board docs |
| ESP32 (WROOM DevKit) | 10–20 mA | about 40 mA source, 28 mA sink | see the datasheet | depends on the regulator, minus the ESP32's own draw |
| Raspberry Pi Pico (RP2040) | 4 mA (default) | 12 mA (strongest setting) | about 50 mA (all GPIO) | under about 300 mA recommended |
How much current can you draw from the 5V and 3.3V pins?
Pin current and supply-pin current are different things. When the Uno is powered over USB, its 5V pin is connected straight to the computer's USB line and protected by a 500 mA self-resetting fuse (polyfuse) on the board; the board itself uses part of that current. When the board is powered through Vin or the DC jack, 5 V comes from the on-board linear regulator. A linear regulator turns the difference between input and output into heat: drawing 150 mA at a 12 V input means about 1 W of heat in the regulator, which the small package handles poorly. So feed Vin with 7–9 V and don't draw more than a few hundred mA from the 5V pin.
The 3.3V pin comes from a separate, small regulator; the official value for the Arduino Uno is 50 mA. That's enough for an RC522 RFID reader or a few sensors, but Wi-Fi modules like the ESP-01 briefly draw more than 200 mA, so they can't run from this pin. Whenever you need high current, use a separate power supply and join the grounds; details are in the Arduino power supply guide and the common ground article.
Which parts can go directly on a pin?
The easiest way to decide is to compare the part's current with the pin limit. If you don't know the current, calculate it with the Ohm's law calculator or measure it with a multimeter. The table below shows typical currents of common parts and the right way to connect them.
| Part | Typical current | Directly on a pin? | Recommended method |
|---|---|---|---|
| Standard 5 mm LED | 5–15 mA | Yes | Series resistor (220–330 Ω for a red LED at 5 V) |
| Active buzzer (5 V) | 20–30 mA | Borderline | Small NPN transistor (BC547, 2N2222) |
| Passive buzzer / piezo | a few mA | Yes | A 100 Ω series resistor is enough |
| Relay module (with driver) | 1–5 mA input | Yes | The module's transistor drives the coil |
| Bare 5 V relay coil | 70–90 mA | No | NPN transistor + flyback diode (1N4007) |
| SG90 servo (signal line) | less than 1 mA | Yes | Servo power from a 5 V supply, signal from the pin |
| Small DC motor | 100–500 mA, more at start-up | Never | MOSFET or a driver such as L298N, L9110S |
| LED strip (12 V) | 0.5 A per metre and up | Never | Logic-level MOSFET (IRLZ44N) |
| WS2812B data line | very low | Yes | 330 Ω on the data line; LEDs from a separate 5 V supply |

Driving a load with a transistor: step by step
Whenever a pin isn't enough, the solution is the same: the pin doesn't drive the load, it drives the switch that turns the load on and off. For small loads that switch is an NPN transistor; for large loads it's a logic-level MOSFET or a ready-made driver module. This way only a few mA leave the pin, while the load current comes straight from the power supply. We covered transistor selection in the transistor article and MOSFET wiring in the MOSFET guide.
- Find out the load's voltage and current: check its label or datasheet, or measure it with a multimeter.
- If the current is under 20 mA and the voltage is 5 V, you can connect it directly to the pin with a series resistor.
- If the current is between 20 and 500 mA, use an NPN transistor; put a 1 kΩ resistor on the base and connect the load between the collector and the supply.
- If the current is above 500 mA, or you're driving a 12 V or higher load, use a logic-level MOSFET; put a 100–220 Ω resistor in series with the gate and a 10 kΩ resistor between gate and GND.
- For coil loads such as relays, motors and solenoids, add a diode (1N4007) across the load in reverse; it absorbs the voltage spike when the coil switches off.
- Connect the GND of the load's power supply to the Arduino's GND; without a common ground the transistor won't switch properly.
1// Pin yalnız transistörün tabanını sürer, yük akımı 12 V kaynaktan gelir
2// The pin only drives the transistor base, load current comes from the 12 V supply
3const int MOTOR_PIN = 9; // MOSFET kapısı (220 Ω seri) / MOSFET gate (220 Ω series)
4const int ROLE_PIN = 7; // NPN tabanı (1 kΩ) -> röle bobini / NPN base (1 kΩ) -> relay coil
5const int LED_PIN = 6; // LED + 330 Ω doğrudan pine / LED + 330 Ω straight on the pin
6
7void setup() {
8 pinMode(MOTOR_PIN, OUTPUT);
9 pinMode(ROLE_PIN, OUTPUT);
10 pinMode(LED_PIN, OUTPUT);
11 Serial.begin(9600);
12}
13
14void loop() {
15 digitalWrite(ROLE_PIN, HIGH); // röle çeker, pinden ~4 mA çıkar / relay on, ~4 mA from the pin
16 digitalWrite(LED_PIN, HIGH); // LED ~9 mA / LED ~9 mA
17 for (int hiz = 0; hiz <= 255; hiz += 5) { // motoru yavaşça hızlandır / ramp the motor up
18 analogWrite(MOTOR_PIN, hiz);
19 delay(40);
20 }
21 Serial.println(F("Motor tam hizda / Motor at full speed"));
22 delay(2000);
23 analogWrite(MOTOR_PIN, 0); // motoru durdur / stop the motor
24 digitalWrite(ROLE_PIN, LOW);
25 digitalWrite(LED_PIN, LOW);
26 delay(2000);
27}This example combines three cases. Pin D9 drives a MOSFET gate with PWM; the motor's hundreds of mA come from the 12 V supply, and the pin only gives a very short burst while charging the gate capacitance. Pin D7 drives the base of an NPN transistor through 1 kΩ: (5 V − 0.7 V) / 1000 Ω ≈ 4.3 mA. With a transistor gain around 100, that easily saturates an 80 mA relay coil. The LED on D6 is connected directly: with a red LED's roughly 2 V drop it draws (5 − 2) / 330 ≈ 9 mA. In total, the current leaving the pins stays under 15 mA. You can find the LED resistor with the LED resistor calculator and pick a transistor with the transistor table.
Pin current and drive strength on the ESP32
The ESP32 runs at 3.3 V and its pin drive strength can be set in software. According to the ESP-IDF documentation there are four levels: about 5, 10, 20 and 40 mA, with about 20 mA as the default. At the strongest setting the datasheet lists about 40 mA source and 28 mA sink current per pin, but these are upper limits. In practice, stay at 10–20 mA per pin and keep the total of all pins low, because the board's 3.3 V regulator must also cover the ESP32 itself and Wi-Fi bursts approaching 300 mA. Some pins (GPIO 6–11) are tied to the internal flash and must never be used; details are in the ESP32 guide.
1#include "driver/gpio.h"
2
3const int LED_PIN = 25; // LED + 150 Ω / LED + 150 Ω
4
5void setup() {
6 pinMode(LED_PIN, OUTPUT);
7 // Sürüş gücü: CAP_0 en zayıf, CAP_2 varsayılan, CAP_3 en güçlü / drive strength: CAP_0 weakest, CAP_2 default, CAP_3 strongest
8 gpio_set_drive_capability((gpio_num_t)LED_PIN, GPIO_DRIVE_CAP_1);
9 Serial.begin(115200);
10 gpio_drive_cap_t guc;
11 gpio_get_drive_capability((gpio_num_t)LED_PIN, &guc);
12 Serial.printf("GPIO %d surus gucu / drive strength: %d\n", LED_PIN, (int)guc);
13}
14
15void loop() {
16 digitalWrite(LED_PIN, HIGH);
17 delay(500);
18 digitalWrite(LED_PIN, LOW);
19 delay(500);
20}In this code the drive strength of GPIO 25 is lowered by one level (CAP_1). Lowering the drive strength is not a current limiter; you still need a resistor in front of the LED. But it reduces the current the pin would deliver during a short circuit or wiring mistake, and it also lowers the noise created by fast edges.
Pin current on the Raspberry Pi Pico
The RP2040 chip on the Pico is far more cautious than the ESP32. Each GPIO's drive strength can be set to 2, 4, 8 or 12 mA, and the default is 4 mA. More importantly, there's an upper limit of about 50 mA for the total current of all GPIO pins. So even driving a few LEDs directly on a Pico needs a quick calculation: at 3.3 V blue or white LEDs barely light anyway, while running a red LED at about 4 mA with 330 Ω is both visible and safe. For the board's 3V3(OUT) pin, Raspberry Pi recommends staying under 300 mA. You'll find the basics in our Raspberry Pi Pico guide.
What breaks when you exceed the limit?
When the pin current is exceeded, an Arduino usually doesn't blow up at once, which is why the damage creeps in. First the pin voltage drops: a pin drawing 30–40 mA can fall below 4 V on a HIGH output, and the logic levels of other pins on the same port are affected too. Then the chip heats up, and with prolonged stress the output transistors inside the pin weaken or fail permanently. The most common symptoms are:
- A single pin dies: the pin no longer goes HIGH or stays LOW all the time; the other pins keep working.
- The pin behaves oddly as an input: a damaged pin leaks current even in input mode and readings become inconsistent.
- The chip heats up and resets: when the total approaches 200 mA the supply voltage collapses and the board restarts at random.
- The ATmega328P dies completely: when a coil load like a motor is wired straight to a pin, the reverse voltage spike can kill the chip in one go.
- The USB port shuts off: drawing too much from the 5V pin trips the polyfuse; the board comes back on its own after a short while.
To check whether your board is damaged, follow the tests in the is my Arduino dead article step by step. If only one pin died, you can usually keep using the rest of the board; on Unos with the DIP chip you can even replace the chip.
Common mistakes and fixes
- Connecting an LED without a resistor: the LED current is limited only by the pin's internal resistance and easily passes 40 mA. Put a series resistor on every LED.
- Wiring a motor or fan to a pin: a motor both draws a lot of current and generates reverse voltage. Always use a driver; DC motor control with the L298N is a good start.
- Powering a servo from the Arduino's 5V pin: a single SG90 can draw up to 500 mA while moving. Power the servo from a separate supply and take only the signal from the pin.
- Leaving out the diode on a relay coil: the transistor and pin wear out over time from the coil's turn-off spike. Ready-made relay modules already include this diode.
- Not adding up the total current: 12 LEDs at 15 mA each make 180 mA; pins that are safe one by one push the limit together.
- Powering a Wi-Fi module from the 3.3V pin: the 50 mA pin can't cover the ESP-01's current peaks; the module keeps resetting.
Getting pin current right is the foundation of every project, from lighting an LED to driving a motor. In the BlueGrays app you can try LED, buzzer, relay and L298N motor control projects step by step, with circuit diagrams showing where every part connects and ready-to-use code.
Frequently asked questions
How many mA can an Arduino pin supply?
Each pin of the ATmega328P on the Arduino Uno can take an absolute maximum of 40 mA, but 20 mA per pin is recommended for continuous use. Aiming for 10–15 mA gives you a safe margin.
What is the total current limit for all Arduino pins?
At most 200 mA can flow through the ATmega328P's VCC and GND pins, so the total of all pins must stay below that. There are also group limits of 100 mA (sink) and 150 mA (source).
How many amps can I draw from the Arduino 5V pin?
When the board is powered over USB, up to 500 mA in total is available from the 5V pin, part of which the board uses itself. When powered through Vin or the jack, the limit is set by regulator heating; at a 12 V input even a few hundred mA heats it considerably.
How much current can the Arduino 3.3V pin supply?
The official value for the Arduino Uno's 3.3V pin is 50 mA. That's enough for sensors and small modules like the RC522, but not for Wi-Fi modules such as the ESP-01.
Can I connect a motor directly to an Arduino?
No. Even the smallest DC motor draws hundreds of mA and produces reverse voltage when it stops, which damages both the pin and the chip. Drive the motor with a driver such as the L298N or L9110S, or with a MOSFET and a diode.
How many mA can ESP32 and Raspberry Pi Pico pins supply?
ESP32 pins have adjustable drive strength, around 20 mA by default with an upper limit of about 40 mA. On the Raspberry Pi Pico the default is 4 mA, the highest setting is 12 mA, and the total of all GPIO is limited to about 50 mA; check the datasheet for exact values.
Projects to build after reading this
See all projects
LED Blink
The very first hello of electronics: switching a single LED on and off. The Arduino keeps the LED on for one second and off for one second, so you can easily follow every blink.

Two LEDs Blinking Alternately
Two LEDs blink quickly in turn: when one lights up the other goes off, as if they were tossing a ball back and forth.

Traffic Light
A tiny copy of the traffic light you see on the road every day. Red stays on for two seconds, yellow flashes for a moment, green stays on for two seconds, then it goes back to red through yellow…

Using a Buzzer
Ever wondered how a doorbell or an alarm makes its sound? The Arduino makes a small buzzer beep at short intervals: beep, pause, beep, pause.

LED Control with a Push Button (Push)
Just like a doorbell: the light stays on as long as you press, and goes off when you let go.

Lighting 220V Bulb with Push Button
As long as you hold the button, a real 220-volt bulb stays lit, and it goes out the moment you let go.

Using a Servo Motor
The arm of a small servo motor turns to three positions in turn: all the way to the start, right to the middle and all the way to the end, waiting two seconds at each stop.

Bluetooth Controlled Car with L298N
Turn your phone into a remote and drive your own robot car. The Arduino receives commands from a remote-control app on your phone through a Bluetooth module and spins the wheels with a motor driver…
More articles
BlueGrays app
Build this circuit step by step on your phone
Wiring diagram, code and parts list on one screen. 500+ Arduino, ESP32, ESP8266, Pico, mBot and micro:bit projects ready to build.
Scan with your phone
Point your camera at the code and your phone's app store opens.
or open the store

