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 Nano pinout (classic Nano, ATmega328P)

The original breadboard-sized Arduino: the same ATmega328P as the Uno, plus two extra analog inputs (A6, A7). The Nano Every, Nano 33 and Nano ESP32 share the footprint but not the chip, so check which one you have.

Arduino NanoUSB328P16D13173V318AREF19A020A121A222A323A424A525A626A7275V28RESET29GND30VIN15D1214D1113D1012D911D810D79D68D57D46D35D24GND3RESET2D0/RX1D1/TX

Top view, USB at the top. Board pin 1 is D1/TX, bottom right; pin 30 is VIN, bottom left.

Key facts: Arduino Nano

Logic level
5 V.
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 (Mini-B), 7 to 12 V on VIN (pin 30), or regulated 5 V on the 5V pin (pin 27). The 3V3 pin gives up to 50 mA.
Analog
A0 to A7, 10-bit. A6 and A7 are analog inputs only.

Pins to avoid or treat with care

  • A6 and A7 as digital pins: they are analog inputs only.
  • D0 and D1: the USB serial link. Disconnect them while uploading.
  • A4 and A5 as analog inputs when you use I2C.
  • AREF: never apply a voltage before calling analogReference(EXTERNAL).

Arduino Nano pin table

30 of 30 pins
All pins of the Arduino Nano
PositionPinIn codeFunctionsNotes
Pin 11TXPD1, 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.
Pin 20RXPD0, 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.
Pin 3––PC6, PCINT14Pull low to reset the ATmega328P. Both RESET pins are the same signal.
Pin 4––
Pin 52–PD2, INT0, PCINT18External interrupt INT0: attachInterrupt() works on pins 2 and 3.
Pin 63PWM (OC2B)PD3, INT1, PCINT19External interrupt INT1: attachInterrupt() works on pins 2 and 3.
Pin 74–PD4, T0, XCK, PCINT20
Pin 85PWM (OC0B)PD5, T1, PCINT21PWM runs at 980 Hz on pins 5 and 6, 490 Hz on the others.
Pin 96PWM (OC0A)PD6, AIN0, PCINT22PWM runs at 980 Hz on pins 5 and 6, 490 Hz on the others.
Pin 107–PD7, AIN1, PCINT23
Pin 118–PB0, ICP1, CLKO, PCINT0
Pin 129PWM (OC1A)PB1, PCINT1
Pin 1310PWM (OC1B), SSPB2, PCINT2
Pin 1411PWM (OC2A), COPI (MOSI)PB3, PCINT3
Pin 1512CIPO (MISO)PB4, PCINT4
Pin 1613SCKPB5, PCINT5Also drives the on-board LED (LED_BUILTIN).
Pin 17––3.3 V output for small 3.3 V parts. 50 mA maximum.
Pin 18––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.
Pin 19A0 (D14)ADC0PC0, PCINT8
Pin 20A1 (D15)ADC1PC1, PCINT9
Pin 21A2 (D16)ADC2PC2, PCINT10
Pin 22A3 (D17)ADC3PC3, PCINT11
Pin 23A4 (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.
Pin 24A5 (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.
Pin 25A6ADC6Analog onlyAnalog input only. A6 and A7 are ADC channels with no digital port behind them, so digitalRead(), digitalWrite() and pinMode() don't work here and there is no pull-up.
Pin 26A7ADC7Analog onlyAnalog input only. A6 and A7 are ADC channels with no digital port behind them, so digitalRead(), digitalWrite() and pinMode() don't work here and there is no pull-up.
Pin 27––The board's 5 V rail: an output when the Nano runs from USB or VIN, or an input for a regulated 5 V supply.
Pin 28––PC6, PCINT14Pull low to reset the ATmega328P. Both RESET pins are the same signal.
Pin 29––
Pin 30––Unregulated input to the on-board 5 V regulator. Arduino's pinout gives 7 to 12 V; the Nano user manual's feature list says 7 to 15 V. Staying within 7 to 12 V keeps the regulator cool.

Sources for the Arduino Nano

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 Nano carrier board with a buzzer and four buttons"

3 free generations, no card required