The Raspberry Pi Zero is proof that "full Linux computer" and "fits inside an Altoids tin" aren't mutually exclusive. It runs the exact same 40-pin GPIO layout as a full-size Raspberry Pi 3 or 4, which means the same HATs, the same wiring diagrams, and the same RPi.GPIO/gpiozero code — just shrunk onto a board the size of a stick of gum.
The catch is that shrinking the board didn't shrink the number of things you need to know before wiring it up. The header usually ships unpopulated, the ports are miniaturized in ways that need adapter cables, and there are a couple of Zero-specific quirks (the status LED lives on a different GPIO than you'd expect, for one) that don't show up on a full-size Pi.
Here's the complete pin and hardware breakdown — GPIO, power, and the physical-port gotchas that are specific to the Zero form factor.
What's Actually on the Board
Every Raspberry Pi Zero variant — the original Zero, Zero W, and Zero 2 W — uses the same 40-pin GPIO header layout as the full-size Raspberry Pi 3 and 4. If you've wired anything for a regular Pi, the pin map transfers directly. What changes between Zero variants is the compute side: the original Zero uses a single-core BCM2835 at 1GHz, the Zero W adds 2.4GHz Wi-Fi and Bluetooth on the same chip, and the Zero 2 W jumps to a quad-core BCM2710A1 (the same silicon family as the Pi 3) at 1GHz with 512MB of RAM — a genuine performance leap in the same footprint.
The header itself provides 26 usable GPIO pins, plus power and ground. Most Zero boards ship with this header completely unpopulated — you'll need to solder a 2×20 pin header (or use solderless pogo-pin adapters) before you can wire anything to it at all. This trips up more first-time Zero buyers than any pin-mapping question does.
The 40-Pin Header
| Category | Count | Detail |
|---|---|---|
| GPIO (usable) | 26 | General-purpose, BCM-numbered |
| 5V | 2 | Direct from the board's 5V input |
| 3.3V | 2 | Regulated output |
| GND | 8 | Ground |
| ID EEPROM (SDA/SCL) | 2 | Reserved for HAT identification — pins 27 & 28 |
Two numbering systems matter here, and mixing them up is the single most common Pi GPIO mistake:
- Physical/BOARD numbering — the simple 1-to-40 count of the pin's physical position on the header.
- BCM numbering — the actual GPIO channel on the Broadcom SoC (e.g., "GPIO17"), which is what
RPi.GPIOandgpiozeroactually expect in code.
Physical pin 11, for example, is BCM/GPIO 17 — not GPIO 11. Getting this backwards is the top cause of "my code runs but nothing happens" confusion for anyone new to the platform.
from gpiozero import LED
led = LED(17) # this is BCM/GPIO numbering, NOT physical pin 17
led.on()
Pins 27 and 28 are reserved for the HAT ID EEPROM (used for auto-detecting HAT add-on boards) and appear in software as GPIO0 and GPIO1 — leave them alone unless you're specifically designing a HAT.
The Full 40-Pin Reference, Pin by Pin
This is the table worth bookmarking — every physical pin, in header order, with its BCM GPIO number where one applies:
| Physical Pin | Function | Physical Pin | Function |
|---|---|---|---|
| 1 | 3.3V Power | 2 | 5V Power |
| 3 | GPIO2 (SDA1 / I2C) | 4 | 5V Power |
| 5 | GPIO3 (SCL1 / I2C) | 6 | GND |
| 7 | GPIO4 (GPCLK0) | 8 | GPIO14 (TXD, UART) |
| 9 | GND | 10 | GPIO15 (RXD, UART) |
| 11 | GPIO17 | 12 | GPIO18 (PCM_CLK / PWM0) |
| 13 | GPIO27 | 14 | GND |
| 15 | GPIO22 | 16 | GPIO23 |
| 17 | 3.3V Power | 18 | GPIO24 |
| 19 | GPIO10 (SPI0 MOSI) | 20 | GND |
| 21 | GPIO9 (SPI0 MISO) | 22 | GPIO25 |
| 23 | GPIO11 (SPI0 SCLK) | 24 | GPIO8 (SPI0 CE0) |
| 25 | GND | 26 | GPIO7 (SPI0 CE1) |
| 27 | ID_SD (HAT EEPROM) | 28 | ID_SC (HAT EEPROM) |
| 29 | GPIO5 | 30 | GND |
| 31 | GPIO6 | 32 | GPIO12 (PWM0) |
| 33 | GPIO13 (PWM1) | 34 | GND |
| 35 | GPIO19 (PCM_FS / PWM1) | 36 | GPIO16 |
| 37 | GPIO26 | 38 | GPIO20 |
| 39 | GND | 40 | GPIO21 |
Finding pin 1 on the board: pin 1 is the one closest to the micro-SD card slot, usually marked with a square solder pad on the underside of the PCB (every other pin uses a round pad) — that square pad is the fastest way to orient the header correctly before wiring anything, HAT or otherwise.
Power Pins
| Pin | Description |
|---|---|
| 5V | Direct board input voltage — no onboard regulation between this and the micro-USB power port |
| 3.3V | Regulated output for GPIO-level peripherals |
| GND | Ground (8 pins, all common) |
The Zero has no barrel jack and no full-size USB power connector — it's powered exclusively through its micro-USB port (or, less commonly, directly via the 5V/GND header pins, which bypasses the board's polyfuse and reverse-polarity protection and should be reserved for advanced, space-constrained builds). Because of the board's small size and limited power circuitry, a genuinely stable 5V supply matters more here than on a full-size Pi — flaky USB cables and underpowered hubs are a disproportionately common cause of random reboots and SD card corruption on Zero-based projects.
GPIO Pins — Digital I/O
All 26 GPIO pins operate at 3.3V logic, and — critically — are not 5V tolerant. Feeding a 5V signal from a sensor or module directly into a GPIO pin can damage it permanently; use a logic-level shifter for any 5V peripheral.
from gpiozero import Button
button = Button(2) # BCM GPIO 2
Each GPIO pin can source or sink only a few tens of mA, and the combined draw across all GPIO pins is capped too — driving several LEDs, a relay, or a motor straight off the header, with no current-limiting resistor or driver circuit in between, is one of the fastest ways to cause brownouts or permanent damage on a board this small.
Communication Pins
I2C, SPI, and UART
| Interface | Pins (BCM) |
|---|---|
| I2C (SDA / SCL) | GPIO2 / GPIO3 |
| SPI0 (MOSI / MISO / SCLK / CE0 / CE1) | GPIO10 / GPIO9 / GPIO11 / GPIO8 / GPIO7 |
| UART (TX / RX) | GPIO14 / GPIO15 |
# I2C example
import smbus2
bus = smbus2.SMBus(1)
The Zero exposes the same primary UART, SPI0, and I2C1 bus that a full-size Pi does, and the same raspi-config steps (enabling I2C, SPI, or serial under Interface Options) apply identically. On Zero W and Zero 2 W boards, the secondary UART is internally connected to the Bluetooth radio by default rather than being exposed on the header — if a project needs two independent hardware UARTs, that's a real constraint worth planning around early, since only one (GPIO14/15) is available externally.
PWM
Hardware PWM is available on a subset of GPIO pins (commonly GPIO12, 13, 18, and 19), useful for dimming LEDs, driving servos, or generating precise timing signals without relying on software-timed bit-banging, which is more CPU-intensive and less precise.
from gpiozero import PWMLED
led = PWMLED(18)
led.value = 0.5 # 50% brightness
Onboard LEDs
| LED | Function |
|---|---|
| PWR (red) | Power indicator — hardwired, not user-controllable |
| ACT (green) | SD card activity by default, but user-programmable via a device-tree overlay |
The ACT LED can be repointed to do something else entirely (a heartbeat blink, a Wi-Fi status indicator, whatever your project needs) by editing /boot/config.txt and setting a GPIO trigger — a small but genuinely useful customization that surprises people who assume it's hardwired like the PWR LED is.
Zero-Specific Ports (Not on the GPIO Header, But Worth Knowing)
Mini-HDMI, not full-size HDMI — you'll need a mini-to-standard HDMI adapter or cable for any display.
Micro-USB OTG port for peripherals — this is a data port, not a power port, and connecting a keyboard, mouse, or USB hub requires a USB OTG adapter. It's easy to plug a USB device into the wrong micro-USB port, since the board has two nearly identical ones (power vs. data), distinguished only by small silkscreen labels.
CSI camera connector, but it uses a smaller connector pitch than a full-size Pi's camera port — a Zero-specific ribbon cable (not the standard Pi camera cable) is required to connect a Camera Module.
No wired Ethernet on any Zero variant — Zero W and Zero 2 W add Wi-Fi; the original Zero has no networking at all beyond USB-tethered options.
Test pads on the board's underside expose a hardware RUN/reset pad and, on some revisions, composite TV-out — useful for advanced projects, but not silkscreened as clearly as the main header.
Practical Pin Usage Tips
Solder the header before you do anything else. It's the single most common "my Zero doesn't work" support question, and it isn't a software problem.
Always use BCM numbering in code, physical numbering when reading a wiring diagram. Keep both in front of you until it becomes automatic.
Budget for a genuinely stable 5V supply. The Zero's compact power circuitry is less forgiving of marginal USB cables and hubs than a full-size Pi's is.
Plan around a single external UART. If a project needs two independent hardware serial connections, the Bluetooth-shared secondary UART on Zero W/2 W won't give you a second free one without extra configuration.
Use a logic-level shifter for any 5V sensor. GPIO pins are 3.3V-only and not 5V tolerant, identical to every other modern Raspberry Pi.
Common Mistakes and How to Avoid Them
Buying a Zero board without checking header status. Most ship without a soldered header — factor that into your first order if you don't have a soldering iron handy.
Confusing the two micro-USB ports. One is power-only, the other is USB OTG data — check the silkscreen labels (often "PWR" and "USB") before connecting anything.
Using a standard Pi camera ribbon cable. The Zero's CSI connector pitch is different and needs its own Zero-specific cable.
Wiring a 5V signal directly into a GPIO pin. Same rule as every modern Pi — 3.3V logic only, use a level shifter for anything higher.
Assuming the ACT LED can't be changed. It can, via a device-tree overlay in /boot/config.txt — useful for custom status indicators.
Summary: Raspberry Pi Zero Pin Reference at a Glance
| Feature | Count / Detail |
|---|---|
| Total header pins | 40 |
| Usable GPIO | 26 |
| I2C | 1 (GPIO2/GPIO3) |
| SPI | SPI0 (GPIO7–11) |
| Hardware UART (external) | 1 (GPIO14/GPIO15) |
| PWM-capable pins | 4 common (GPIO12, 13, 18, 19) |
| Logic level | 3.3V, not 5V tolerant |
| Power input | Micro-USB only (or 5V/GND header, unregulated path) |
| Camera connector | CSI, Zero-specific ribbon cable required |
| Display output | Mini-HDMI |
| Wireless (W / 2 W only) | 2.4GHz Wi-Fi, Bluetooth |
The Zero's real trick is that it doesn't ask you to learn a new pinout at all — it's the same GPIO map as every other modern Raspberry Pi, just wearing a much smaller jacket. Solder the header, sort out the port adapters, and everything you already know about Pi GPIO wiring, gpiozero, and HAT compatibility carries straight over unchanged.
Raspberry Pi Zero Family · 40-Pin GPIO Header · 26 Usable GPIO · I2C · SPI · UART · PWM
Quick Answers to Common Pi Zero Pin Questions
Does the Zero use the same GPIO layout as a full-size Pi? Yes — identical 40-pin header and pin functions to the Pi 3 and Pi 4, so existing wiring diagrams and HATs work the same way.
Why doesn't my Zero have header pins? Most ship with the header completely unpopulated. You'll need to solder a 2×20 header (or use a solderless adapter) before wiring anything.
Are GPIO pins 5V tolerant? No — 3.3V logic only, same as every modern Raspberry Pi. Use a logic-level shifter for 5V sensors and modules.
What's the difference between physical and BCM pin numbering? Physical numbering is the simple 1–40 position on the header; BCM numbering is the GPIO channel number the SoC actually uses, which is what RPi.GPIO and gpiozero expect in code. They're not the same number for most pins.
Can I use two hardware UARTs? Only one is exposed on the header (GPIO14/15). On Zero W and Zero 2 W, the second UART is internally wired to the Bluetooth radio by default, not available externally without extra configuration.
Which micro-USB port do I plug a keyboard into? The one labeled for USB/data, using an OTG adapter — the other micro-USB port is power-only and won't recognize connected devices.
Does the Zero's camera port take a standard Pi camera cable? No — its CSI connector uses a different pitch and needs a Zero-specific ribbon cable.
What's the difference between the Zero, Zero W, and Zero 2 W? The original Zero has no wireless and a single-core BCM2835. The Zero W adds Wi-Fi/Bluetooth on the same chip. The Zero 2 W jumps to a quad-core BCM2710A1 (Pi 3-class performance) with the same wireless capability, in the identical physical footprint.
Where to Go From Here
Once the header's soldered and the port adapters are sorted, the GPIO side of the Zero behaves exactly like a full-size Pi — so the natural next step is the same as for any Raspberry Pi: enabling I2C/SPI/UART in raspi-config, working through gpiozero examples, and exploring HAT compatibility. The main thing worth revisiting specifically for the Zero is power supply quality, since its compact design is noticeably less forgiving of marginal USB cables than a full-size Pi.