Back to Tools

ESP32, Arduino and Raspberry Pi Pinouts

Interactive pin diagrams for the ESP32 DevKitC, Arduino Uno and Nano, Raspberry Pi Pico and the Raspberry Pi 40-pin header, checked pin by pin against the official documents. Hover a pin to see what it can do and what to avoid.

Arduino Uno pinout (Uno R3, ATmega328P)

The classic Arduino: an ATmega328P at 5 V with 14 digital pins (6 with PWM), 6 analog inputs and the ICSP header. The Uno R4 keeps the header positions but uses another chip, so its pin functions and limits differ.

Arduino Uno R3DCUSB16U2ATmega328PICSPNCIOREFRESET3V35VGNDGNDVINA0A1A2A3A4A5SCLSDAAREFGNDD13D12D11D10D9D8D7D6D5D4D3D2D1/TXD0/RX

Top view, USB and power jack at the top, digital pins on the right.

Key facts: Arduino Uno R3

Logic level
5 V. IOREF on the power header tells shields the same.
Current per pin
20 mA is Arduino's stated maximum per I/O pin. 40 mA is the ATmega328P's absolute maximum, a damage limit, not a working value.
Total current
200 mA through the chip's VCC and GND pins (absolute maximum), and at most 100 to 150 mA per group of ports.
Power
USB, or 7 to 12 V on the barrel jack or VIN. The 3V3 pin gives up to 50 mA.
Analog
A0 to A5, 10-bit (0 to 1023), referenced to 5 V unless you use AREF.

Pins to avoid or treat with care

  • D0 and D1: the USB serial link. Disconnect them while uploading.
  • A4 and A5 as analog inputs when you use I2C (SDA and SCL are the same pins).
  • AREF: never apply a voltage before calling analogReference(EXTERNAL).
  • D13 if the on-board LED would get in the way: it is wired to that pin.

Arduino Uno R3 pin table

38 of 38 pins
All pins of the Arduino Uno R3
PositionPinIn codeFunctionsNotes
Power header––Not connected.
Power header––Tells a shield which logic voltage the board uses. On the Uno it is connected to 5 V.
Power header––PC6, PCINT14Pull low to reset the ATmega328P, like pressing the reset button.
Power header––3.3 V output for small 3.3 V parts. 50 mA maximum.
Power header––The board's 5 V rail, fed by USB or by the on-board regulator when you power the Uno through the barrel jack or VIN. Arduino's documents give no current limit for this pin.
Power header––
Power header––
Power header––Input to the 5 V regulator, the same as the barrel jack. Use 7 to 12 V; 20 V is the absolute maximum and Arduino advises against getting near it.
Analog headerA0 (D14)ADC0PC0, PCINT8
Analog headerA1 (D15)ADC1PC1, PCINT9
Analog headerA2 (D16)ADC2PC2, PCINT10
Analog headerA3 (D17)ADC3PC3, PCINT11
Analog headerA4 (D18)ADC4, SDAPC4, PCINT12A4 is the I2C data line (SDA) and A5 the clock (SCL). While I2C is running they can't be used as analog inputs.
Analog headerA5 (D19)ADC5, SCLPC5, PCINT13A4 is the I2C data line (SDA) and A5 the clock (SCL). While I2C is running they can't be used as analog inputs.
Digital headerA5 (D19)SCLPC5I2C clock. Wired to A5 on the board: the same signal, not a second I2C port.
Digital headerA4 (D18)SDAPC4I2C data. Wired to A4 on the board: the same signal, not a second I2C port.
Digital header––ReferenceAnalog reference input, 0 to 5 V only. Only connect a voltage here after calling analogReference(EXTERNAL): with the default reference it is shorted to the chip's internal reference and can damage it.
Digital header––
Digital header13SCKPB5, PCINT5Also drives the on-board LED (LED_BUILTIN).
Digital header12CIPO (MISO)PB4, PCINT4
Digital header11PWM (OC2A), COPI (MOSI)PB3, PCINT3
Digital header10PWM (OC1B), SSPB2, PCINT2
Digital header9PWM (OC1A)PB1, PCINT1
Digital header8–PB0, ICP1, CLKO, PCINT0
Digital header7–PD7, AIN1, PCINT23
Digital header6PWM (OC0A)PD6, AIN0, PCINT22PWM runs at 980 Hz on pins 5 and 6, 490 Hz on the others.
Digital header5PWM (OC0B)PD5, T1, PCINT21PWM runs at 980 Hz on pins 5 and 6, 490 Hz on the others.
Digital header4–PD4, T0, XCK, PCINT20
Digital header3PWM (OC2B)PD3, INT1, PCINT19External interrupt INT1: attachInterrupt() works on pins 2 and 3.
Digital header2–PD2, INT0, PCINT18External interrupt INT0: attachInterrupt() works on pins 2 and 3.
Digital header1TXPD1, TXD, PCINT17USB serialShared with the USB serial link that uploads sketches and carries Serial. Anything connected here can block uploads; disconnect it while you upload.
Digital header0RXPD0, RXD, PCINT16USB serialShared with the USB serial link that uploads sketches and carries Serial. Anything connected here can block uploads; disconnect it while you upload.
ICSP pin 112CIPO (MISO)Same signal as digital pin 12. The ICSP header is how you program the ATmega328P without the bootloader, and some shields take SPI from here.
ICSP pin 2––The board's 5 V rail.
ICSP pin 313SCKSame signal as digital pin 13. The ICSP header is how you program the ATmega328P without the bootloader, and some shields take SPI from here.
ICSP pin 411COPI (MOSI)Same signal as digital pin 11. The ICSP header is how you program the ATmega328P without the bootloader, and some shields take SPI from here.
ICSP pin 5––The ATmega328P's reset line, the same as the RESET pin on the power header.
ICSP pin 6––

Sources for the Arduino Uno R3

How to read these pin diagrams

Every board is drawn from the top, the way you see it on the bench, with the pins in their real order. Red pins are power, black are ground, grey are control pins such as reset, and green are general-purpose I/O. A yellow ring marks a pin with a catch: a strapping pin that changes how the chip boots, a pin wired to flash or USB, or an input-only pin.

Pick a function above the drawing (I2C, SPI, ADC…) to light up the pins that can do it and see each pin's name for that function. Pins marked default are the ones the board's own documentation uses; on the ESP32 and the Pico most peripherals can move to other pins in software.

The label printed on the board, the physical pin number and the number you type in code are often three different things. On a Raspberry Pi, physical pin 11 is GPIO17. On an ESP32 the board says IO32 and the code says 32. The table under each drawing lists all three.

3.3 V or 5 V: logic levels and current limits

BoardLogic level5 V on a GPIO?Current per pinAll pins together
ESP32-DevKitC3.3 VNo (3.6 V max)~20 mA default, ~40 mA max drive1,200 mA (abs. max)
Arduino Uno R3, Nano5 VYes20 mA (40 mA abs. max)200 mA (abs. max)
Raspberry Pi Pico3.3 VNo2–12 mA, 4 mA default50 mA
Raspberry Pi (40-pin header)3.3 VNo16 mA50 mA

The ESP32, the Pico and the Raspberry Pi run their pins at 3.3 V and none of them is 5 V tolerant. A 5 V sensor output on one of their GPIOs needs a level shifter or a resistor divider. The Arduino Uno and Nano run at 5 V; most 3.3 V modules need their inputs shifted down when you connect them to an Arduino.

The current limits are for the I/O pins, not for driving motors or relays. A small indicator LED is fine on any of these boards with a series resistor that keeps it under the pin's limit; anything bigger goes through a transistor or a driver. The LED resistor calculator works out the resistor.

Questions people ask

Which ESP32 pins are safe to use?
On an ESP32-DevKitC with a WROOM module, GPIO4, 13, 14, 16–19, 21–23, 25–27, 32 and 33 are full input/output pins with no boot role. GPIO34–39 are fine as inputs. Leave GPIO6–11 alone (flash), keep GPIO1 and 3 for USB serial, and check what your circuit does to GPIO0, 2, 5, 12 and 15 at reset.
Why won't my ESP32 boot or upload?
Usually a strapping pin. GPIO0 pulled low at reset starts the bootloader instead of your program. GPIO12 pulled high switches the flash to 1.8 V. GPIO2 pulled high stops the board entering download mode. Move whatever is on those pins, or make sure it doesn't pull them the wrong way while the board resets.
Can I use ADC2 with Wi-Fi on?
No. The ESP32's Wi-Fi driver uses ADC2, so readings from ADC2 pins (GPIO0, 2, 4, 12–15, 25–27) fail while Wi-Fi is running. Use the ADC1 pins: GPIO32–36 and 39.
Is the ESP32-S3 or ESP32-C3 pinout the same?
No. The S3 and C3 are different chips with different GPIO numbers, ADC channels and strapping pins, and their dev boards have their own layouts. Don't use the ESP32 pinout above for them; use Espressif's guide for your exact board.
Which Arduino Uno pins are PWM?
Pins 3, 5, 6, 9, 10 and 11, marked with a ~ on the board. They run at about 490 Hz, except 5 and 6 at about 980 Hz. The same pins are PWM on the Nano.
Which pins are interrupts on an Uno or Nano?
attachInterrupt() works on pins 2 and 3 (INT0 and INT1). D0 to D13 and A0 to A5 also have pin-change interrupts (PCINT), which attachInterrupt() doesn't use.
What are A6 and A7 on the Nano?
Two extra analog inputs the Uno doesn't have. They are analog only: analogRead() works, but digitalRead(), digitalWrite() and pinMode() don't, and there is no pull-up.
Are Raspberry Pi GPIO pins 5 V tolerant?
No. Raspberry Pi GPIO pins are 3.3 V only, and 5 V on one can permanently damage the processor. The two 5V pins on the header are power pins, not signals.
Raspberry Pi: physical pin numbers or GPIO numbers?
Code uses the GPIO numbers (also called BCM numbers), such as GPIO17. The physical numbers 1 to 40 count across the header, odd pins on one row and even on the other, starting at the 3.3 V pin. GPIO17 is physical pin 11.
Does the Raspberry Pi Pico 2 have the same pinout?
The header layout and the power pins are the same. The chip is the RP2350 instead of the RP2040, with different electrical limits, so check the Pico 2 datasheet before relying on the numbers on this page.

Related tools and guides

Describe a circuit. Get a board you can order.

GrandpaCAD's chat picks real parts, draws the schematic, routes the PCB and checks it against JLCPCB's rules. You get Gerbers, BOM, pick-and-place, a KiCad project and a 3D board, plus a printed case if you want one.

"Arduino Uno shield with an OLED screen and three buttons"

3 free generations, no card required