The Raspberry Pi Zero 2 W uses the exact same 40-pin GPIO layout as the standard Pi 4 and Pi 5, but its compact size and unpopulated header pads make accurate pin identification critical. Below is the complete hardware reference you need to wire sensors, displays, and serial peripherals without frying the BCM2710A1 SoC.
The Complete Raspberry Pi Zero 2 W Pinout Diagram Reference
The GPIO header consists of 40 pins arranged in two rows of 20. Pin numbering follows the physical board layout (1-40), while software control uses Broadcom (BCM) channel numbers. This table maps both, grouping them by their primary hardware functions.
| Pin | Function / BCM | Pin | Function / BCM |
|---|---|---|---|
| 1 | 3.3V Power | 2 | 5V Power |
| 3 | GPIO 2 (SDA1 / I2C) | 4 | 5V Power |
| 5 | GPIO 3 (SCL1 / I2C) | 6 | Ground (GND) |
| 7 | GPIO 4 (GPCLK0) | 8 | GPIO 14 (TXD / UART) |
| 9 | Ground (GND) | 10 | GPIO 15 (RXD / UART) |
| 11 | GPIO 17 | 12 | GPIO 18 (PWM0 / PCM_CLK) |
| 13 | GPIO 27 | 14 | Ground (GND) |
| 15 | GPIO 22 | 16 | GPIO 23 |
| 17 | 3.3V Power | 18 | GPIO 24 |
| 19 | GPIO 10 (MOSI / SPI0) | 20 | Ground (GND) |
| 21 | GPIO 9 (MISO / SPI0) | 22 | GPIO 25 |
| 23 | GPIO 11 (SCLK / SPI0) | 24 | GPIO 8 (CE0 / SPI0) |
| 25 | Ground (GND) | 26 | GPIO 7 (CE1 / SPI0) |
| 27 | GPIO 0 (ID_SD / I2C) | 28 | GPIO 1 (ID_SC / I2C) |
| 29 | GPIO 5 | 30 | Ground (GND) |
| 31 | GPIO 6 | 32 | GPIO 12 (PWM0) |
| 33 | GPIO 13 (PWM1) | 34 | Ground (GND) |
| 35 | GPIO 19 (PCM_FS) | 36 | GPIO 16 |
| 37 | GPIO 26 | 38 | GPIO 20 (PCM_DIN) |
| 39 | Ground (GND) | 40 | GPIO 21 (PCM_DOUT) |
For visual confirmation and software-side BCM mapping, the community-maintained Pinout.xyz remains the definitive interactive reference, while the official Raspberry Pi Hardware Documentation provides the electrical tolerances for the RP3A1 system-in-package (SiP).
Peripheral Wire Color Standards & Faded Silkscreen Recovery
When wiring sensors to the Pi Zero 2 W, you will encounter different wire color conventions depending on where your peripheral was manufactured. Mixing these up can result in feeding 5V into a 3.3V logic pin.
Regional Sensor Wiring Variants (US vs. IEC/EU)
Unlike mains wiring, low-voltage DC sensor wiring isn't governed by a single legal code, but two dominant industry standards have emerged:
- US / Maker Standard (Adafruit, SparkFun, Pololu): Red = VCC (3.3V or 5V), Black = GND, Blue = I2C SDA, Green = I2C SCL, Yellow/Orange = SPI or Signal.
- EU / IEC Industrial Standard (Sick, Balluff, IFM): Brown = VCC (+V), Blue = GND (0V), Black = Signal/Data (SDA/MOSI), White = Signal/Clock (SCL/SCLK).
Safe Interpretation When Markings are Faded or Missing
The Pi Zero 2 W is tiny, and silkscreen text often wears off, or you may be using a clone board with minimal labeling. If you cannot read the pin numbers, use these physical anchors to orient your Raspberry Pi Zero 2 W pinout diagram:
- The Square Pad: Pin 1 is the only pin with a square solder pad (all others are round). This is true even on unpopulated boards.
- Component Proximity: Pin 1 is always located on the corner closest to the microSD card slot and the primary USB OTG port.
- The Multimeter Test: Set your meter to continuity mode. Probe the metal shield of the SoC or the USB port shell with one lead. Sweep the other lead across the header pins. The pins that beep are your Ground pins (6, 9, 14, 20, 25, 30, 34, 39). Pin 1 (3.3V) and Pin 2 (5V) will be immediately adjacent to the Ground pin closest to the SD card slot.
The "Rows People Get Wrong" (And How to Avoid Bricking Your Pi)
Even experienced makers make mistakes when reading the pinout diagram at a glance. Here are the specific rows and pins that cause the most hardware failures on the Zero 2 W.
1. The 3.3V vs. 5V Power Rail Confusion (Pins 1, 2, 4, 17)
The BCM2710A1 SoC on the Zero 2 W operates strictly at 3.3V. The GPIO pins are not 5V tolerant. Pins 2 and 4 provide 5V directly from the USB input, while Pins 1 and 17 provide 3.3V from the onboard regulator. If you accidentally wire a 5V sensor's data line to a GPIO pin, or swap a 5V and 3.3V power feed to an external module, you will instantly destroy the SoC's input protection diodes. Always measure the VCC output of your sensor module before plugging it into the Pi.
2. The EEPROM ID Pins (Pins 27 and 28)
Pins 27 (BCM 0) and 28 (BCM 1) are labeled ID_SD and ID_SC. These are reserved for the I2C bus that reads the EEPROM on official Raspberry Pi HATs. They have onboard 1.8kΩ pull-up resistors tied to 3.3V. While you technically can use them as standard GPIO in a pinch, doing so can cause boot conflicts if a HAT is attached, and they should be avoided in your primary I2C wiring plans.
3. The UART TX/RX Swap (Pins 8 and 10)
When wiring a serial GPS module, ESP32, or Arduino to the Pi Zero 2 W via UART, the physical pinout shows Pin 8 as TXD and Pin 10 as RXD. The most common mistake is wiring TX to TX and RX to RX. Remember: the Pi's TX (Pin 8) must connect to the peripheral's RX, and the Pi's RX (Pin 10) must connect to the peripheral's TX. Furthermore, ensure your peripheral is using 3.3V logic; if it's a 5V Arduino, use a logic level converter or a simple resistor voltage divider on the Pi's RX line.
Raspberry Pi Zero 2 W Pinout FAQ
Does the Raspberry Pi Zero 2 W pinout diagram differ from the Pi 4 or Pi 5?
Physically, no. The 40-pin GPIO header layout, BCM numbering, and primary I2C/SPI/UART assignments are identical across the Pi Zero 2 W, Pi 3, Pi 4, and Pi 5. However, the Pi Zero 2 W has lower thermal limits and a smaller onboard power supply. While a Pi 5 can source significant current from its 5V pins for external peripherals, the Zero 2 W's 5V rail is limited by its USB power input and onboard trace width. Keep external 5V loads under 500mA to prevent brownouts.
Which pins are safe to use for standard GPIO on the Pi Zero 2 W?
Out of the 40 pins, 26 are standard, unrestricted GPIO pins (BCM 2 through 27, excluding the reserved ID pins). The remaining pins are dedicated to power (3.3V, 5V), ground, or specific hardware interfaces (I2C0, SPI0, UART). For general-purpose digital input/output, PWM, or button reading, stick to BCM 4, 5, 6, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, and 26.
How do I read the Raspberry Pi Zero 2 W pinout diagram if the board has no headers soldered?
The Zero 2 W ships without pre-soldered GPIO headers to keep costs and profile height down. When looking at the unpopulated through-holes, orient the board so the microSD card slot is on your left and the USB ports are pointing away from you. The top-left hole is Pin 1. The top-right hole is Pin 2. Count down the left side for odd numbers (1, 3, 5... 39) and down the right side for even numbers (2, 4, 6... 40). Always solder your headers and verify continuity with a multimeter before applying power.
Can I use the I2C pins (3 and 5) to power a small sensor?
Pins 1 and 17 are the correct 3.3V power sources. Pins 3 (SDA) and 5 (SCL) are data lines. While they do have 1.8kΩ pull-up resistors to the 3.3V rail, they cannot supply meaningful current. Attempting to draw power from the I2C data lines will pull the bus voltage down, corrupting your data stream and causing I2C timeout errors in your Python or C++ scripts.






