This resource will help you understand the Raspberry Pi’s pinout and make your life easier when dealing with the GPIO pins.
As powerful and as useful as they are, the GPIO pins on the Raspberry Pi can be tricky to work out.
With 26 pins on the original Raspberry Pi and 40 on the newer versions, it can be challenging to keep track of what each pin is used for.
This guide will give you a basic understanding of the pinout for the 40 GPIO pins available on the Raspberry Pi.
We have easy to read graphics that show you the pinout for the three different versions of the Raspberry Pi’s GPIO pins.
Raspberry Pi 1 (Revision 1) Pinout
The Raspberry Pi 1 features a smaller 26-pin GPIO header. Below you can find a pinout showing the functionality of each GPIO pin on the Raspberry Pi.
Please make sure you verify what revision of the Raspberry Pi that you are using as it’s pinout differs slightly.
Raspberry Pi 1 (Revision 2) Pinout
The second revision of the Pi 1 has a slight change to its GPIO pinout. This change was a result of a modification made to the Raspberry Pi’s CPU.
The BCM Numbering for the I2C pins changed from 0 and 1 to 2 and 3. All newer versions of the Raspberry Pi also use this new BCM numbering for the two I2C1 pins.
Raspberry Pi 2, 3, and 4 Pinout
The Raspberry Pi 2, 3, 4, and Zero boards all feature a 40-pin GPIO header. Below you can view the pinout for the Raspberry Pi 2 and newer.
The first 26 pins on the Raspberry Pi 2 and newer are the same as the Raspberry Pi 1 (Revision 2). The additional 24 pins were all introduced with the release of the Raspberry Pi 2.
These additional pins introduced an extra 3 ground pins and another 11 GPIO pins that expanded the Raspberry Pi’s functionality for dealing with serial protocols such as SPI and I2C.
This Raspberry Pi pinout key will give you an idea of what each of the colors and numbers mean in our above graphics.
Viewing the Pinout on a Raspberry Pi
You can view the Raspberry Pi pinout using the terminal as long as you have the GPIO Zero Python package installed.
This tool can be helpful if you want quick access to the pinout for your specific Pi.
If you are running Raspbian Desktop, you can skip directly to step 3 of this section. Otherwise continue, below.
1. Before we can use the pinout tool, we need to first update the package list by running the following command.
sudo apt update
2. Next, we can install the package that will provide us with the pinout tool by using the command below.
sudo apt install python3-gpiozero
3. With the package installed, all you need to do is run the following command to get the pinout of the Raspberry Pi you are running it on.
4. From that command, you should get a result similar to the one below. This pinout is for the Raspberry Pi 4.
Hopefully this resource has been helpful for you with understanding the Raspberry Pi’s pinout.
For your convenience, we also have a printout of the Raspberry Pi pinout that you can download.
If you have found any problems or have any feedback, then feel free to drop a comment below.