Raspberry Pi 4 GPIO Pinout has 40 pins: 26 GPIO pins, two 5V pins, two 3V3 pins, and 7 ground pins. GPIO pins of RPI 4 are capable of generating PWM output and the board supports SPI, I2C, and UART serial communication protocols.
The Raspberry Pi 4 Model B is the latest board launched by the Raspberry Pi Foundation in June 2019. This model has the latest high-performance quad-Core 64-bit Broadcom 2711, Cortex A72 processor clocked at 1.5GHz speed.
This processor uses 20% less power and offers 90% greater performance than the previous model. Raspberry Pi 4 GPIO Pinout with functions, schematic, and specs are given in detail below.
Raspberry Pi 4 model comes in three different variants of 2 GB, 4 GB, and 8 GB LPDDR4 SDRAM.
The other new features of the board are dual-display support up to 4k resolutions via a pair of micro-HDMI ports, hardware video decodes at up to 4Kp60, dual-channel 2.4/5.0GHz wireless LAN, true Gigabit Ethernet, two USB 3.0 ports, Bluetooth 5.0, and PoE capability (via a separate PoE HAT board).
Raspberry Pi 4 Specs:
The table given below gives the complete specifications of the Raspberry Pi 4.
|Processor||Broadcom BCM2711 chip consist of Quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz|
|Memory||2GB, 4GB, and 8GB of LPDDR4 SDRAM (depending on the version of the board)|
|Wireless Module||Dual-channel 2.4/5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE|
2 x USB 3.0 ports
2 x USB 2.0 ports
2 x micro-HDMI ports(support up to 4kp60 resolution)
2-lane MIPI DSI display port
2-lane MIPI CSI camera port
|Audio / Video||4-pole stereo audio and composite video port|
|Multimedia||265 (4k@60 decode), H264 (1080@60 decode and 1080@30 encode)|
|Input Power||1V/3A DC via USB-C connector|
|Operating Temperature||Operating temperature: 0 – 50oC|
|Others||OpenGL ES 3.0 graphics |
Micro-SD card slot for loading operating system and data storage
Power over Ethernet (PoE) enabled(requires PoE HAT board)
R-pi 4 GPIO Pinout
The table below gives the GPIO pinout of the Raspberry Pi 4. We have discussed the detailed pinout at a later stage in this article.
|Pin Type||GPIO Pins|
|PWM pins||GPIO12, GPIO13, GPIO18, GPIO19|
|SPI pins||SPI0: GPIO9 (MISO), GPIO10 (MOSI), GPIO11 (SCLK), GPIO8 (CE0), GPIO7 (CE1)|
SPI1: GPIO19 (MISO), GPIO20 (MOSI), GPIO21 (SCLK), GPIO18 (CE0), GPIO17 (CE1), GPIO16 (CE2)
|I2C Pins||Data: (GPIO2), Clock: (GPIO3)|
EEPROM Data: (GPIO0), EEPROM Clock: (GPIO1)
|UART Pins||TX: (GPIO14)|
Raspberry Pi 4 Board Layout:
The Raspberry Pi 4 board layout shows some major differences between the new RPI 4 and RPI 3B+: More memory, two micro HDMI port that supports 4K resolution, a USB C power port, etc.
CPU: It consists of a Broadcom BCM2711 chip which contains a 1.5GHz 64-bit quad-core ARM Cortex-A72 processor (using an ARMv8-architecture core).
GPU: Broadcom VideoCore VI @ 500 MHz was released in 2009. It is capable of BluRay quality video playback, H.265 (4Kp60 decode); H.264 (1080p60 decode, 1080p30 encode); OpenGL ES, 3.0 graphics.
RAM: It comes with 2GB, 4GB, and 8GB (depends on different versions) variants of LPDDR4 SDRAM.
USB port: It consists of two USB 3.0 and two USB 2.0 ports to connect it to an external keyboard, mouse, or other peripheral devices.
USB power port: It consists of a 5.1V, 3A USB type-C power port.
HDMI port: Two micro HDMI ports capable of supporting up to 4k@60HZ resolution.
Ethernet Port: It comes with a true Gigabit Ethernet capable of sending Ethernet frames at a rate of one gigabit per second (1 billion bits per second).
Composite Video Output: Both the audio output socket and the video composite socket reside in a single 4-pole 3.5mm socket.
SD card Slot: A micro-SD card slot is used for booting up the operating system and storage purposes.
Note: The SD card slot is given at the back of the Raspberry Pi 4 board
Raspberry Pi 4 GPIO Pin Description:
This section is solely dedicated to the Raspberry Pi 4 GPIO Pinout in detail:
Raspberry Pi GPIO stands for General Purpose Input Output pins. These pins are used to connect the Raspberry Pi board to external input/output peripheral devices.
This model B consists of a 40-pin GPIO header. Out of these 40 pins, 28 pins are GPIO pins.
Since GPIO pins do not have any specific function, these pins can be customized using the software.
Power Pins on Raspberry Pi 4:
The raspberry pi 4 model B board consists of two 5V pins, two 3V3 pins, and 7 ground pins (0V).
5V: The 5v pin outputs the 5 volts coming from the USB Type-C port.
3.3V: The 3v pin is used to provide a stable 3.3v supply to external components.
GND: The ground pin is commonly referred to as GND.
R-Pi 4 Global Input/Outputs pins:
A GPIO pin set as input allows the signal transmitted by any external device (connected to this pin) to be received by the Raspberry Pi.
Input voltage between 1.8V and 3.3V is read as HIGH by the Raspberry pi. And when the input voltage is lower than 1.8V, it is read as LOW.
Note: Do not connect an external device with an output voltage above 3.3V to any of the GPIO pins, or else it will fry your Raspberry Pi board.
A GPIO pin set as output delivers HIGH/3.3V or LOW/0V.
Apart from Input/Output, the GPIO pins can also perform a variety of other functions like PWM. Some of these functions/pins are:
PWM (pulse-width modulation) pins:
PWM stands for “Pulse Width Modulation”. It means that an analog value is being modulated on a digital signal.
Software PWM is available on all pins.
Hardware PWM is available on these pins only: GPIO12, GPIO13, GPIO18, GPIO19
SPI pins on RPi 4:
SPI (Serial Peripheral Interface) is a type of serial communication protocol. It is used by the Raspberry Pi for master-slave communication to quickly communicate between one or more peripheral devices.
The data is synchronized using a clock (SCLK at GPIO11) from the master (RPi).
The Pi sends this data to an SPI device using MOSI (Master Out Slave In) pin. And when the SPI device needs to communicate back to the Raspberry Pi, it sends the data back through the MISO (Master In Slave Out) pin.
5 pins are required for SPI communication:
- GND: Connect the GND pin from all the slave components and the Raspberry Pi 4 board together.
- SCLK: Clock for SPI communication.
- MOSI: It stands for Master Out Slave In. This pin is used to send data from the master to a slave.
- MISO: It stands for Master In Slave Out. This pin is used to receive data from a slave to the master.
- CE: It stands for Chip Enable. We need to connect one CE pin per slave (or peripheral devices) in our circuit. By default, we have two CE pins but we can configure more CE pins from the other available GPIO pins.
SPI pins on Raspberry Pi:
SPI0: GPIO9 (MISO), GPIO10 (MOSI), GPIO11 (SCLK), GPIO8 (CE0), GPIO7 (CE1)
SPI1: GPIO19 (MISO), GPIO20 (MOSI), GPIO21 (SCLK), GPIO18 (CE0), GPIO17 (CE1), GPIO16 (CE2)
I2C Pins on RPi 4:
I2C pins on the Raspberry Pi board are used to communicate with peripheral devices that are compatible with Inter-Integrated Circuit (a low-speed two-wire serial communication protocol).
This serial communication protocol requires master-slave roles between both, the board and the peripheral devices.
I2C protocol requires two connections: SDA (Serial Data) and SCL (Serial Clock). They work by transmitting data using the SDA connection, and the speed of data transfer is controlled via the SCLK pin.
Data: (GPIO2), Clock (GPIO3)
EEPROM Data: (GPIO0), EEPROM Clock (GPIO1)
UART pins on RPi 4:
The UART (Universal Asynchronous Receiver / Transmitter) is an asynchronous protocol that provides a way to communicate between two microcontrollers or devices.
TX pin transmits the serial data to the RX pin of another device and RX pin receives the serial data coming from TX pin of the other device.
TX : GPIO14
RX : GPIO15
Raspberry Pi 4 Schematic(official):
**To download the Raspberry Pi 4 Schematic, click here.
Raspberry Pi 4 Physical Dimensions:
The physical dimension of the Raspberry Pi 4 is 85 mm in length and 56 mm in width.
Ways to program the Raspberry PI 4 Board:
You can control the Raspberry Pi 4 GPIO pins using many programming languages. Some of the popular languages along with learning material is given below:
- GPIO Programming using Python
- Programming GPIO with C/C++ using standard kernel interface via libgpiod
- Programming GPIO with C/C++ using 3rd party library pigpio
- GPIO Programming using Scratch 1.4
- GPIO Programming using Scratch 2
- GPIO Programming using Processing3
Prefer Book? Read this article on Best Raspberry Pi Books for beginners
Where to Buy Rpi 4 and Its Accessories?
You can get the original Raspberry Pi 4 board from different stores. But if you want to get it from Amazon, we recommend you the following sellers:
Is PI 64-bit OS compatible with Pi 4?
Since the Pi 4 has a 64-bit architecture, the board is compatible with the Pi 64-bit OS. The official version of the Pi 64-bit OS was launched recently by the RPI foundation and can be installed from their website.
How many GPIOs does Raspberry Pi 4 have?
R-Pi has a 40-pin header out of which 28 pins are GPIO pins.
Can you power a Raspberry Pi 4 with GPIO pins?
No, you can not power a R-Pi 4 using any of the 28 GPIO pins. But, it’s possible to power it using the 5V and GND pins of the GPIO header.
What is the purpose of GPIO in Raspberry Pi 4?
The GPIO pins are used to connect external components like sensors, actuators, displays, etc. with the SoC.
About the Author
I am an electrical engineer by profession who loves to tinker with electronic devices and gadgets and have been doing so for over six years now.