This guide breaks down the Raspberry Pi Zero 2 W pinout, covering every header, pad, and connector you’ll actually use. Whether you’re wiring sensors, adding a display, or building a wearable, you’ll learn what each pin does, which ones are safe to power, and how to avoid the classic beginner mistakes. By the end, you’ll be able to read the pinout diagram like a pro and wire your next project with confidence.
1. The 40-Pin GPIO Header – Your Main Interface
The Zero 2 W has the same 40-pin male header as the larger Pi models, but it’s unpopulated by default. You’ll need to solder on a header strip or use a hammer header for a low-profile build. The pin functions are identical to the Raspberry Pi 3 and 4: 26 GPIO pins, 2 5V pins, 2 3.3V pins, and 8 ground pins. This compatibility means any HAT or breakout board designed for a standard Pi will work with the Zero 2 W.
2. Power Pins (5V and 3.3V)
Pins 2 and 4 provide 5V directly from the USB power input, while pins 1 and 17 supply 3.3V. The 5V pins can source up to 1.2A in practice (limited by your power supply and the board’s input fuse), but the 3.3V pins are regulated and should not be loaded beyond about 50mA total. Never connect 5V to a 3.3V pin – you’ll instantly damage the SoC. For high-current peripherals like motors, use a separate power supply and only share ground.
3. Ground Pins – The Unsung Heroes
There are eight ground pins (6, 9, 14, 20, 25, 30, 34, 39) that are all connected internally. Use them liberally to complete circuits for sensors, LEDs, and logic level converters. A common mistake is relying on a single ground pin for multiple devices, which can cause voltage drops and erratic readings. Spread your ground connections across the header to keep signals stable.
4. I2C Pins (GPIO 2 & 3)
GPIO 2 (pin 3) and GPIO 3 (pin 5) are the I2C data (SDA) and clock (SCL) lines, respectively. They have 1.8kΩ pull-up resistors to 3.3V built in, so you can connect multiple I2C devices (like OLED displays, accelerometers, or RTC modules) on the same bus. The Zero 2 W supports 100kHz and 400kHz modes. Use the `i2cdetect -y 1` command to find device addresses. Remember to enable I2C via `raspi-config` before use.
5. SPI Pins (GPIO 7-11)
The SPI0 interface uses GPIO 7 (CE1), 8 (CE0), 9 (MISO), 10 (MOSI), and 11 (SCLK). These pins are perfect for high-speed communication with displays, ADC chips, or SD cards. The Zero 2 W runs SPI at up to 32MHz, though you’ll often set lower speeds for reliability. Note that GPIO 8 (CE0) is also used for the onboard EEPROM on HATs, so if you’re using a HAT, avoid using CE0 for other devices unless you disable the HAT detection.
6. UART Pins (GPIO 14 & 15)
GPIO 14 (TXD) and GPIO 15 (RXD) provide a serial UART connection. On the Zero 2 W, these are connected to the Bluetooth module by default, so you’ll need to disable Bluetooth or remap the UART to the PL011 peripheral for reliable serial communication. Use `raspi-config` to switch the UART to the mini UART or use the `/dev/serial0` alias. This is great for GPS modules, serial consoles, or talking to Arduino boards.
7. PWM Pins (GPIO 12, 13, 18, 19)
Hardware PWM is available on GPIO 12, 13, 18, and 19. These are ideal for driving servos, LEDs with fading effects, or audio output via PWM. The Zero 2 W has two PWM channels (0 and 1), each with two outputs. For example, GPIO 18 is PWM0 on channel 0, and GPIO 19 is PWM1 on channel 1. Use the `pigpio` library or the Linux `sysfs` interface to control them. Unlike software PWM, these won’t jitter under load.
8. I2S Pins (GPIO 18-21)
GPIO 18 (BCLK), 19 (LRCLK), 20 (DIN), and 21 (DOUT) are the I2S audio interface. This is how you connect external DACs like the PCM5102 or MEMS microphones. The Zero 2 W has a dedicated I2S peripheral that supports high-quality audio (up to 24-bit/192kHz). You’ll need to configure the device tree overlay (e.g., `dtoverlay=hifiberry-dac`) to enable it. This is a significant upgrade over the analog PWM audio output.
9. ID EEPROM Pins (GPIO 0 & 1)
Pins 27 (ID_SD) and 28 (ID_SC) are reserved for the I2C ID EEPROM that HATs use to identify themselves. These are not general-purpose GPIOs – they have pull-ups to 3.3V and are not broken out to the main header. You can use them for your own I2C devices if you’re not using a HAT, but be aware that the Pi will try to read them at boot. If you leave them unconnected, it’s fine. If you connect a device, make sure it doesn’t respond to address 0x50.
10. The Camera and Display Connectors
The Zero 2 W has two dedicated CSI (camera) and DSI (display) connectors, but they are not standard 15-pin – they are smaller, 22-pin 0.5mm pitch connectors. You’ll need a special ribbon cable adapter to connect a standard Raspberry Pi camera or the official 7-inch touchscreen. These connectors carry high-speed MIPI signals, so they are not GPIO pins. The camera connector supports the Raspberry Pi Camera Module 2, Camera Module 3, and HQ Camera with the right adapter.
How to Choose
When deciding which pins to use, start by listing your peripherals and their interfaces. If you have multiple I2C devices, you’ll want to reserve the I2C bus and use it exclusively. For high-speed data, SPI is the best choice. For simple on/off control, any GPIO will do. Always check the voltage levels – the Zero 2 W is 3.3V logic, so 5V signals need a level shifter. Also consider the physical layout: if you’re using a HAT, you’ll be limited to the pins it uses. For bare GPIO, you can use any pin, but avoid the ID EEPROM pins unless you know what you’re doing.
Frequently Asked Questions
Can I use all 40 pins on the Zero 2 W?
Yes, all 40 pins are electrically connected to the SoC, but some are shared with other functions (like the ID EEPROM). You can use them as GPIO, but be aware of conflicts with HATs or the camera/display interfaces.
What is the maximum current from the 5V pin?
The 5V pin is directly connected to the USB input through a polyfuse (rated at 2A, but typically 1.2A is safe). The actual limit depends on your power supply. The 3.3V pin is regulated and can supply about 50mA total.
Do I need to solder a header on the Zero 2 W?
Yes, the Zero 2 W ships without a header. You can solder a standard 2×20 pin header, or use a hammer header for a low-profile connection. If you’re not comfortable soldering, you can use a GPIO expansion board that clips onto the pads, but those are less reliable.
Can I use the Zero 2 W with a Raspberry Pi 4 HAT?
Yes, as long as the HAT uses standard 40-pin GPIO and doesn’t require more than 1.2A from the 5V pin. Some HATs with high-power components may not work due to the Zero’s power limitations. Always check the HAT’s requirements.
How do I enable I2C or SPI on the Zero 2 W?
Run `sudo raspi-config`, go to Interface Options, and enable I2C, SPI, or Serial. You may need to reboot. For SPI, you might also need to add `dtparam=spi=on` to `/boot/config.txt` if it’s not enabled by default.
What is the difference between the Zero 2 W and the original Zero pinout?
The pinout is identical – both have the same 40-pin header with the same functions. The Zero 2 W has a faster CPU (4 cores) and more RAM (512MB vs 512MB on the original Zero W, but the Zero 2 W is significantly faster). The electrical characteristics are the same.
Final Thoughts
The Raspberry Pi Zero 2 W pinout is your gateway to a huge ecosystem of sensors and add-ons. Once you understand the basics – power, ground, I2C, SPI, and UART – you can wire almost anything. Always double-check your connections before powering up, and use a multimeter to verify voltages. With this guide, you’re ready to start building.