Raspberry pi is a powerful computer with amazing features of GPIO (General-purpose input-output) pins. There are many models available in the market. All models have almost similar Raspberry pi pinout. Here we will discuss all models of raspberry pi pinout in detail.
Raspberry pi 4 Pinout
Pi 4 is the latest board we have in the market it is the most powerful board. It has 2 micro HDMI ports, 4 USB ports, and an Ethernet port. Apart from this, it has a total of 40 GPIO pins.
Supply pins
Raspberry pi has 2 pins for 5v supply and 2 pins for 3.3v supply. It has a total of 8 Ground pins.
Output | Pin Number |
5v | Pin no. 2 & Pin no. 4 |
3.3v | Pin no. 1 & Pin no. 17 |
GND | Pin no. 6, 9, 14, 20, 25, 30, 34 and 39 |
Input and Output Pins
In Raspberry pi 4 all pins can read as well as write from 0v to 3.3v. Every pin can use the internal pull-up and pull-down resistance. Also, GPIO2 and GPIO 3 have to fix pull-up resistance. Rest all the pins can configure as pull up or pull down using the software.
A pull-up resistor connects unused input pins to the dc supply voltage, (Vcc) to keep the given input HIGH.
A pull-down resistor connects unused input pins to ground, (0V) to keep the given input LOW.
PWM Pins
All GPIO supports the PWM (Pulse-Width Modulation) signal using the software. Hardware PWM pins were available on pins no. 12, 13, 18, and, 19.
Communication Pins
The GPIO can be used for communication also. There are many pins that support SPI, Serial communication, and I2C protocols.
SPI Protocol Pins
The Serial Peripheral Interface (SPI) is a synchronous serial communication interface specification used for short-distance communication, primarily in embedded systems. Raspberry pi has a total of 2 sets of pins for SPI.
SPI 1 | MISO | MOSI | SCLK | CEO | CE1 | |
Pin no. 9 | Pin no. 10 | Pin no. 11 | Pin no. 8 | Pin no. 7 | ||
SPI 2 | MISO | MOSI | SCLK | CEO | CE1 | CE2 |
Pin no. 19 | Pin no. 20 | Pin no. 21 | Pin no 18 | Pin no 17 | Pin no 16 |
I2C Protocol Pins
The inter-integrated circuit is an asynchronous, multi-master, multi-slave, packet-switched, single-ended, serial computer protocol.
DATA | CLOCK | EEPROM | EEPROM CLOCK |
Pin no. 2 | Pin no. 3 | Pin no. 0 | Pin no. 1 |
Serial protocol Pins
The serial communication protocol is a communication protocol transmitted one a bit at a time. This protocol uses widely in short-range communication. Raspberry pi 4 has GPIOs support serial communication.
TX | RX |
Pin no. 14 | Pin no. 15 |
Raspberry Pi 3A+, B, and all model Pinout
Pinout for raspberry pi 3 Model A+, Raspberry Pi 3 Model B and raspberry pi 3 has the same raspberry pi pinout as raspberry pi 4 have. They all have a total of 40 GPIOs having two 5v supplies and two 3.3v supplies.
Raspberry Pi Zero all model Pinout
Zero is the mini version of a normal raspberry pi like 4 or 3. Also, it has exactly the same pinout as the above mentioned. But you have to solder Male buck pins to use as others. It also has 40 pins with 2 5v output and two 3.3v output.
All the pins can be used as PWM output software. Every pin has an inbuilt pull-up and pull-down resistance can be initialized using the software.
Raspberry Pi B pinout
Raspberry pi b is the first raspberry pi. It has a total of 26 pins. It has a 2, 5v supply and 2, 3.3v supply and a total of 5 GND.
Supply pins
Raspberry pi B has one 3.3v supply one 5v supply and 5 GND.
5v | 2 & 4 |
3.3v | 1, 17 |
GND | 6, 9, 14, 20, 25, |
Input and Output Pins
Raspberry Pi B has a total of 17 GPIOs. All pins have internal pull-up and pull-down ability. Also, all pins support pulse width modulation can be done by software.
Communications pin
SPI Protocol Pins
Raspberry pi B has 5 pins for SPI communication.
MOSI | 19 |
MISO | 21 |
CLK | 23 |
CE1 | 26 |
CE0 | 24 |
UART Protocol Pins
Raspberry pi B has two pins that support the UART protocol.
RX | TX |
10 | 8 |
I2C Protocol Pins
Raspberry pi B has 2 pin that Supports the I2C protocol. GPIO 2 & GPIO 3
SDA | SCL |
Pin no. 3 | Pin no. 5 |
Raspberry pi B is outdated and not available in the market. Rest all model has exactly the same pinout.
Source:- Raspberry foundation.