
Understanding the raspberry pi zero pinout helps you connect things like sensors and LEDs. It also helps you connect other hardware without worry. All raspberry pi zero models use the same 40-pin GPIO header layout. This includes the original, Zero W, Zero WH, and raspberry pi zero 2 w. You can see the differences in the table below:
| Model | Key Pinout Feature | GPIO Header Type |
|---|---|---|
| Raspberry Pi Zero | 40-pin GPIO, unpopulated | Unpopulated |
| Pi Zero W | Same as original | Unpopulated |
| Pi Zero WH | Same as Pi Zero W | Pre-soldered |
| Pi Zero 2 W | Same as others | Unpopulated |
You can use this guide to help you build and test raspberry pi zero projects. It is good for quick reference.
Key Takeaways
-
Every Raspberry Pi Zero has the same 40-pin GPIO header. This makes it easy to use the same accessories and projects on all versions.
-
There are three ways to number the pins: physical, BCM, and WiringPi. You need to know these to avoid mistakes with wires. This helps your code match your hardware.
-
Be careful with the GPIO pins. They use 3.3V logic and give only a little current. Always use resistors and check your wires to keep your board safe.
-
Use a 5V power supply through the Micro-USB port for safety. You can power it through the GPIO pins, but this is risky without extra protection.
-
Try simple projects first, like blinking LEDs or using sensors. This helps you learn how to control the GPIO. Use online tools and datasheets to help you plan and build safely.
Raspberry Pi Zero Pinout
40-Pin Header
You will find a 40-pin GPIO header on every raspberry pi zero board. This header uses a 2x20 layout, which means there are two rows of 20 pins each. The raspberry pi zero pinout matches the layout used on other Raspberry Pi models like the Pi 2, Pi 3, and Pi 4. This standardization makes it easy for you to use accessories and HATs across different boards.
Here is a table that shows the main pin categories and their functions on the raspberry pi zero pinout:
| Pin | Name | Pin Category | Function/Notes |
|---|---|---|---|
| 1 | 3.3V | Power | 3.3V Power |
| 2 | 5V | Power | 5V Power |
| 3 | GPIO 2 | I2C | SDA1 (Data) |
| 4 | 5V | Power | 5V Power |
| 5 | GPIO 3 | I2C | SCL1 (Clock) |
| 6 | GND | Ground | Ground |
| 7 | GPIO 4 | GPIO | General Purpose |
| 8 | GPIO 14 | UART | TXD (Transmit) |
| 9 | GND | Ground | Ground |
| 10 | GPIO 15 | UART | RXD (Receive) |
| 11 | GPIO 17 | GPIO | General Purpose |
| 12 | GPIO 18 | PWM | PWM0 |
| 13 | GPIO 27 | GPIO | General Purpose |
| 14 | GND | Ground | Ground |
| 15 | GPIO 22 | GPIO | General Purpose |
| 16 | GPIO 23 | GPIO | General Purpose |
| 17 | 3.3V | Power | 3.3V Power |
| 18 | GPIO 24 | GPIO | General Purpose |
| 19 | GPIO 10 | SPI | MOSI |
| 20 | GND | Ground | Ground |
| 21 | GPIO 9 | SPI | MISO |
| 22 | GPIO 25 | GPIO | General Purpose |
| 23 | GPIO 11 | SPI | SCLK |
| 24 | GPIO 8 | SPI | CE0 |
| 25 | GND | Ground | Ground |
| 26 | GPIO 7 | SPI | CE1 |
| 27 | GPIO 0 | ID EEPROM | Reserved |
| 28 | GPIO 1 | ID EEPROM | Reserved |
| 29 | GPIO 5 | GPIO | General Purpose |
| 30 | GND | Ground | Ground |
| 31 | GPIO 6 | GPIO | General Purpose |
| 32 | GPIO 12 | PWM | PWM0 |
| 33 | GPIO 13 | PWM | PWM1 |
| 34 | GND | Ground | Ground |
| 35 | GPIO 19 | PWM/SPI | PWM1/MISO1 |
| 36 | GPIO 16 | GPIO | General Purpose |
| 37 | GPIO 26 | GPIO | General Purpose |
| 38 | GPIO 20 | PWM/SPI | PWM0/MOSI1 |
| 39 | GND | Ground | Ground |
| 40 | GPIO 21 | PWM/SPI | PWM1/SCLK1 |
You can see that the pin categories include power, ground, GPIO, I2C, SPI, UART, and PWM. Each pin has a specific function, and some pins support multiple features.
Tip: Always double-check your pin configuration before connecting any hardware. The raspberry pi zero does not have built-in protection on the GPIO header. Incorrect wiring can damage your board.
Pin Numbering Schemes
When you work with the raspberry pi zero pinout, you will notice three main numbering schemes:
-
Physical numbering: This counts pins from 1 to 40, starting at the top left of the header. It matches the physical position of each pin.
-
BCM numbering: This uses the Broadcom chip's GPIO numbers, such as GPIO 17 or GPIO 18. You will see this scheme in most programming libraries and official documentation.
-
WiringPi numbering: This uses a unique set of numbers, different from both physical and BCM. For example, GPIO 18 is physical pin 12 and WiringPi pin 1.
You must know which scheme your code or wiring diagram uses. Confusing these schemes is a common mistake. For example, if you connect an LED to physical pin 12 but your code uses BCM 12, the LED will not work as expected.
The raspberry pi zero uses the same 40-pin header and BOARD numbering as other models. However, always check the pinout for your specific board before connecting devices.
Note: You can use the
pinoutcommand in Raspberry Pi OS to see a real-time pin exploration of your board. Online tools like pinout.xyz and pinouts.vercel.app also offer an interactive pinout diagram for the raspberry pi zero 2 w and other models.
Pin Functions
The GPIO header on the raspberry pi zero gives you many options for connecting hardware. The main pin categories are:
-
Power pins: These provide 3.3V or 5V power to your circuits.
-
Ground pins: These complete the circuit and are essential for safe operation.
-
GPIO pins: You can use these as inputs or outputs. For example, you can read a button press or turn on an LED. Accessing the gpio lets you control many types of devices.
-
I2C pins: These allow you to connect multiple low-speed devices, like sensors, using only two wires (SDA and SCL).
-
SPI pins: These support high-speed communication with devices like displays and ADCs. SPI uses several pins for data and clock signals.
-
UART pins: These let you send and receive serial data. On the raspberry pi zero 2 w, UART is only available on pins 8 (TXD) and 10 (RXD).
-
PWM pins: These let you control things like motor speed or LED brightness by changing the signal's duty cycle.
The GPIO pins work at 3.3V logic levels. Never connect them directly to 5V signals. Always use resistors with LEDs and check your wiring to avoid short circuits.
You will also find a camera port (CSI) on the raspberry pi zero and raspberry pi zero 2 w. This port sits at the edge of the board and lets you connect a camera module for projects like photography or video streaming.
Common mistakes to avoid:
Mixing up pin numbering schemes.
Connecting components while the board is powered on.
Using the wrong voltage levels.
Forgetting current-limiting resistors for LEDs.
Not checking for loose connections.
If you want to explore the raspberry pi zero pinout visually, use an interactive pinout diagram online. These tools help you see pin functions, pin configuration, and even highlight pin categories for easier understanding.
Specs

Processor & Memory
You will find that the raspberry pi zero comes in different models, each with its own processor and memory setup. The table below shows the main differences:
| Raspberry Pi Zero Model | Processor | Memory |
|---|---|---|
| Raspberry Pi Zero v1.3 | Single-core 1 GHz BCM2835 ARM1176JZF-S | 512 MB RAM |
| Raspberry Pi Zero 2 W | Quad-core 64-bit ARM Cortex-A53 1 GHz | 512 MB SDRAM |
The original raspberry pi zero uses a single-core processor, which works well for simple projects. The raspberry pi zero 2 w has a quad-core processor, so you get more power for multitasking and faster gpio operations. Both models have 512 MB of RAM, but the zero 2 w uses SDRAM for better performance. If you want to run more complex projects or handle multiple tasks, the zero 2 w gives you a clear advantage.
The processor and memory affect how fast your gpio projects run. A faster processor means you can toggle gpio pins more quickly and handle more devices at once.
Power & Voltage
Supplying the right power keeps your raspberry pi zero running smoothly. You should use a 5 V power supply, with a recommended current of at least 1.3 A for basic models and 2.5 A for the raspberry pi zero 2 w. Most people power the board through the Micro-USB port, but you can also use the gpio pins (pin 2 or 4 for 5 V, pin 6 for ground). Be careful—there is no protection if you power through the gpio header.
| Aspect | Details |
|---|---|
| Input Voltage | 5 V ± 5% (4.75 V to 5.25 V) |
| Recommended Current | 1.3 A (Zero), 2.5 A (Zero 2 W) |
| Powering Methods | Micro-USB (recommended), GPIO pins |
| Protection | No fuse/diode on GPIO power input |
Never connect a power source to the 3.3 V pins. Using the wrong voltage can damage your raspberry pi zero.
Connectivity
The raspberry pi zero models offer different wireless features. The original model does not have Wi-Fi or Bluetooth. The raspberry pi zero w, zero wh, and zero 2 w all include 2.4 GHz Wi-Fi (802.11 b/g/n) and Bluetooth 4.1 with BLE. These features let you connect to networks and devices without extra adapters.
| Raspberry Pi Zero Model | Wi-Fi | Bluetooth |
|---|---|---|
| Zero | None | None |
| Zero W / Zero WH | 802.11 b/g/n (2.4 GHz) | Bluetooth 4.1 + BLE |
| Zero 2 W | 802.11 b/g/n (2.4 GHz) | Bluetooth 4.1 + BLE |
GPIO Features
The 40-pin gpio header gives you many options for connecting hardware. The gpio pins use 3.3 V logic, so you must avoid 5 V signals. Each gpio pin can supply up to 16 mA, but the total current from all gpio pins should not go over 50 mA. You can use protocols like I2C and SPI for sensors and displays. Libraries such as WiringPi, pigpio, and CircuitPython help you control gpio pins and use features like PWM.
-
Supported protocols: I2C, SPI, UART, PWM
-
Logic level: 3.3 V (not 5 V tolerant)
-
Max current per gpio pin: 16 mA (default 8 mA)
-
Total max current (all gpio): 50 mA
-
Use resistors to protect gpio pins
You can expand your raspberry pi zero with boards like the IO Pi Zero. These boards make it easier to connect more devices and add features like relays or extra headers.
Tip: Always check your wiring and use high-quality power supplies to keep your raspberry pi zero safe and reliable.
Datasheet
Official Reference
You can find the official Raspberry Pi Zero pinout datasheet on the Richard Electronics blog page. This datasheet covers every Raspberry Pi Zero model, like Zero W and Zero 2 W. It gives you a full look at the hardware features, pinout details, and supported protocols. The table below shows what is inside the datasheet:
| Section | Details |
|---|---|
| Processor and Memory | Model, CPU type and speed, RAM size |
| GPIO Header | 40-pin layout, pin functions, soldering requirements |
| Wireless Connectivity | Wi-Fi and Bluetooth specifications |
| Camera Interface | CSI port details for camera module connection |
| Power Requirements | 5V micro USB input, power consumption, recommended supply |
| Ports and Expansion | USB, HDMI, microSD, composite video, HAT compatibility |
| Physical Dimensions | Board size, weight |
Tip: The datasheet also tells you about the electrical features of each pin. You can use this to match your hardware with the right pins and keep it safe.
How to Use
When you start a project, the datasheet helps you pick the right pins and features. Begin by looking at the GPIO header section. This part lists all 40 pins, their numbers, and what they do. You will see which pins work with I2C, SPI, UART, and PWM. The datasheet uses Broadcom BCM names for GPIO pins, so make sure your code uses these names too.
Here are some steps for using the datasheet when planning a project:
-
Decide what hardware you want to connect, like sensors or LEDs.
-
Find out which protocol you need (I2C, SPI, UART, or PWM).
-
Look for the matching pins in the datasheet and write down their physical and BCM numbers.
-
Check which pins give power and ground for safe wiring.
-
Read the electrical limits for each pin so you do not overload them.
Always make sure your power supply fits the board’s needs. Use the datasheet to check pin numbers in your code and make sure your wires are connected well. If you have problems, the datasheet can help you fix them by showing the right pinouts and power details.
You can also use the datasheet to learn how to set pin modes. Each GPIO pin can be input, output, or do something special. The datasheet explains how to use function select registers for more control. This helps you build Raspberry Pi Zero projects that work well and stay safe.
Projects
LED Control
You can start learning about the Raspberry Pi Zero by making an LED blink. This project helps you understand how to use gpio pins for output. Follow these steps to build a basic LED blinking project:
-
Update your Raspberry Pi with
sudo apt-get update. -
Install the GPIO library using
sudo apt-get install rpi.gpio. -
Power off your Raspberry Pi Zero. Connect two LEDs and 220-ohm resistors to GPIO 27 and GPIO 22 using a breadboard and jumper wires.
-
Write a Python script. Use the
RPi.GPIOlibrary and set the mode to BCM. Set GPIO 27 and GPIO 22 as outputs. Make a loop that turns each LED on and off with a one-second delay. -
Save your script as
led.py. -
Run the script with
python led.py. -
Watch the LEDs blink one after the other.
Always power off your Raspberry Pi before wiring. Use resistors to protect the gpio pins.
Sensor Projects
You can connect many types of sensors to the Raspberry Pi Zero. Common sensors include PIR motion sensors, ultrasonic distance sensors, IR sensors, and temperature sensors like DHT11 or DHT22. Connect the sensor’s power pin to 3.3V or 5V, ground to GND, and the signal pin to a gpio pin. Some sensors need extra parts, like a 10k-ohm pull-up resistor for DHT sensors. Use Python libraries such as Adafruit_DHT to read sensor data.
-
Double-check your wiring before powering up.
-
Use level shifters for 5V sensors.
-
Power off the Pi before connecting or disconnecting components.
Soldering the gpio header can be hard for beginners. Take your time and use the right tools for a strong connection.
I2C/SPI Devices
You can use I2C and SPI devices for more advanced projects. Common devices include displays, EEPROMs, and digital-to-analog converters. To enable I2C or SPI:
-
Open Raspberry Pi Configuration and enable I2C or SPI in the Interfaces tab.
-
Or, use
sudo raspi-configin the terminal and enable the interfaces. -
Reboot your Raspberry Pi Zero.
-
Use tools like
i2cdetect -y 1to check for connected I2C devices.
I2C uses only two wires, making it simple for projects with many devices. SPI is faster and works well for displays or fast data transfer. Choose the protocol that fits your project needs.
| Feature | I2C Advantages | SPI Advantages |
|---|---|---|
| Wiring | Two wires (SDA, SCL) | Four wires (SCK, MOSI, MISO, SS) |
| Speed | Up to 3.4 Mbps | Higher speeds possible |
| Scalability | Many devices | Fast, but fewer devices |
Home Automation
You can build smart home projects with the Raspberry Pi Zero. Try these ideas:
-
Smart Door Sensor: Use magnetic sensors on doors to detect open or closed status. Send alerts or trigger alarms.
-
Weather Station: Connect DHT11 or DHT22 sensors to monitor temperature and humidity. Log and display the data.
-
Plant Watering System: Use soil moisture sensors and a relay to control a water pump. Water your plants automatically.
For safety, use strong passwords, update your software, and use a high-quality power supply. Secure your network and power off the Pi before wiring.
Project Resources
You can find many educational guides and project ideas online. The Pi4J project website offers detailed pinout diagrams, example projects, and community support. Forums and GitHub repositories provide help and code samples. Use these resources to learn more about gpio projects and get inspired for your next build.
Knowing the Raspberry Pi Zero pinout helps you make and fix projects. Keep the pinout and specs close when you try new things. Begin with easy GPIO projects to see how the pins work. Always use safety tips and check reference tools to keep your board safe. Careful wiring and planning help you finish your projects well.
FAQ
What is the difference between physical and BCM pin numbering?
Physical numbering counts pins from 1 to 40 based on their position. BCM numbering uses the Broadcom chip’s GPIO numbers. Always check which scheme your code or diagram uses to avoid wiring mistakes.
Can I power the Raspberry Pi Zero through the GPIO header?
Yes, you can use pin 2 or 4 for 5V and pin 6 for ground. You should use the Micro-USB port for safety. The GPIO header does not have built-in protection.
Are the GPIO pins 5V tolerant?
No, the GPIO pins only support 3.3V logic. Connecting 5V signals can damage your board. Always check voltage levels before wiring.
How much current can each GPIO pin handle?
Each GPIO pin can supply up to 16 mA. The total current for all GPIO pins should not go over 50 mA. Use resistors to protect your pins and devices.
Where can I find a Raspberry Pi Zero pinout diagram?
You can use the pinout command in Raspberry Pi OS. Online tools like pinout.xyz also show interactive pinout diagrams. These resources help you find pin functions quickly.

Written by Jack Elliott from AIChipLink.
AIChipLink, one of the fastest-growing global independent electronic components distributors in the world, offers millions of products from thousands of manufacturers, and many of our in-stock parts is available to ship same day.
We mainly source and distribute integrated circuit (IC) products of brands such as Broadcom, Microchip, Texas Instruments, Infineon, NXP, Analog Devices, Qualcomm, Intel, etc., which are widely used in communication & network, telecom, industrial control, new energy and automotive electronics.
Empowered by AI, Linked to the Future. Get started on AIChipLink.com and submit your RFQ online today!
Frequently Asked Questions
What is the difference between physical and BCM pin numbering?
Physical numbering counts pins from 1 to 40 based on their position. BCM numbering uses the Broadcom chipâs GPIO numbers. Always check which scheme your code or diagram uses to avoid wiring mistakes.
Can I power the Raspberry Pi Zero through the GPIO header?
Yes, you can use pin 2 or 4 for 5V and pin 6 for ground. You should use the Micro-USB port for safety. The GPIO header does not have built-in protection.
Are the GPIO pins 5V tolerant?
No, the GPIO pins only support 3.3V logic. Connecting 5V signals can damage your board. Always check voltage levels before wiring.
How much current can each GPIO pin handle?
Each GPIO pin can supply up to 16 mA. The total current for all GPIO pins should not go over 50 mA. Use resistors to protect your pins and devices.
Where can I find a Raspberry Pi Zero pinout diagram?
You can use the pinout command in Raspberry Pi OS. Online tools like pinout.xyz also show interactive pinout diagrams. These resources help you find pin functions quickly.