Raspberry Pi

Raspberry Pi 4 GPIO Pinout

Raspberry Pi 4 has come up with more advanced features as compared to the previous model of the Raspberry Pi. It was launched in June 2019 and has come up with a much-improved processing speed of about 90% as compared to previous version due to the inclusion of 4GB and 8GB RAM memory. Its General-Purpose Input Output (GPIO) pins have also maintained the previous standard set by the Raspberry Pi models, and are now more functional and performing flawlessly.

The Raspberry Pi 4 has 40 GPIO pins that can be easily configured to read inputs or write outputs. If you are unfamiliar with the operation of these GPIO pins, this article will assist you in understanding the operation of each pin. 

Raspberry Pi 4 GPIO Pins

Here, you will be able to learn the functioning of each pin, which helps you to do things on your Raspberry Pi 4 easily. There are 40 pins in this model and among them 26 are GPIO pins.

The Raspberry Pi model includes two 5V pins, two 3.3V pins, eight ground pins and two reserved pins.

5V pins: The 5V pins are used to output the 5V power supply provided from the Type-C port. The pins are numbered 2 and 4 on Raspberry Pi 4 device.

3.3V pins: The 3.3V pins are used to provide a 3.3V power supply to the external components which are numbered 1 and 17.

Ground pins: The ground pins are used to close the electric circuits. The ground pins help you to protect your board from burning and play an important part in a circuit. The ground pins are numbered 6,9,14,20,25,30,34 and 39.

Reserved Pins: These pins are used to perform communication between I2C and EEPROM. If you are new to Raspberry Pi, you are advised not to connect anything with these pins which are 27 and 28 number pins.

GPIO Pins

These are the pins on your Raspberry Pi that perform various functions and each pin is assigned a different task. Some pins are used as inputs, while others are used as outputs. Input voltages ranging from 1.8V to 3V are considered high voltage, while voltages less than 1.8V are considered low voltage. You need to keep the voltage of the power supply below 3V in order to protect your Raspberry Pi from burning.

The GPIO pins built on Raspberry Pi devices are used to perform various functions and their details are given below.

Pulse Width Modulation

The GPIO pins are used for Pulse Width Modulation (PWM), which is the process of converting a digital signal to analog signal. All pins are capable of performing software PWM, but only a few are capable of performing hardware PWM, including GPIO pins number 12, 13, 18, and 19.

Serial Peripheral Interface Pins on Raspberry Pi 4

You can use Serial Peripheral Interface (SPI) pins to communicate between devices such as sensors or actuators on the Raspberry Pi. The Raspberry Pi sends data to a device via the Master Out Slave Pin (MOSI), and the same device communicates with the Raspberry Pi via the Master In Slave Out (MISO) pin. SP communication necessitates the use of five GPIO pins for GND, SCLK, MOSI, MISO, and CE. The CE pin is used to enable or disable circuit integration, whereas the SCLK pin serves as a clock for SPI communication. The Raspberry Pi’s SPI communication pins are listed below.

For SPIO select GPIO9 as MISO, GPIO10 as MOSI, GPIO11 as SCLK, GPIO8 as CE0 and GPIO7 as CE1.

For the case of SPI1 pins, select GPIO19 as MISO, GPIO20 as MOSI, GPIO21 as SCLK, GPIO18 as CE0, GPIO17 as CE1 and GPIO16 as CE2.

Inter Integrated Circuit Pins on Raspberry Pi 4

Using the Inter Integrated Circuit (I2C) pins, the Raspberry Pi can easily control other peripheral devices attached with it. The communication is possible using the pins Serial Data (SDA) and Serial Clock (SCL). The data is forwarded using the SDA pin and the processing speed of data is controlled using SCL pin. There is another type of data called “Electrically erasable programmable read-only memory (EEPROM)” data which is present in literally small quantities.

In Raspberry Pi, GPIO2 pin is responsible for transferring data using SDA and GPIO3 is used to control the speed of data by working as SCL. For the case of EEPROM, GPIO0 pin is used for data transferring while the GPIO1 pin is used as a clock to control the speed of data.

UART Pins on Raspberry Pi 4

A Universal Asynchronous Receiver Transmitter (UART) is a type of communication in which data is transferred sequentially bit by bit. You need a transmitter and a receiver to perform UART. For UART communication, the Raspberry Pi 4 has two default pins. The GPIO14 pin is used as a transmitter to send data to another device, while the GPIO15 pin is used as a receiver to receive data from another device.

Conclusion

You now gain sufficient knowledge about using Raspberry Pi 4 GPIO pins but you need to be careful in making your projects on Raspberry Pi 4. A little mistake may burn your Raspberry Pi 4 thus, you have to go with the guideline provided to you. Learning about the GPIO pins helps you to perform communication of your favourite Raspberry Pi 4 with other devices.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.