Language: EN

pinput-raspberry-pi

Raspberry Pi Pinout Diagram

  • 4 min

One of the most notable features of the Raspberry Pi is its expansion port, which allows us to interact with the physical world through its GPIO pins (General Purpose Input/Output).

Raspberry Pi has a total of 40 pins, although not all are available for general use. Additionally, some of them have specific functions, such as power, ground, or communication.

The Pinout is a diagram that explains the arrangement of the pins and their specific function. It allows us to know how we can connect sensors, actuators, displays, and other electronic devices.

The pinout follows the same standard across Raspberry Pi models. It is valid for Raspberry Pi 2, 3, 4, and Zero.

So let’s take a detailed look at the Raspberry Pi pinout diagram. In the following tutorials, we will explain the different functionalities 👇.

1
3.3V
3
GPIO 2
SDA
5
GPIO 3
SCL
7
GPIO 4
9
GND
11
GPIO 17
13
GPIO 27
15
GPIO 22
17
3.3V
19
GPIO 10
MOSI
21
GPIO 9
MISO
23
GPIO 11
CLK
25
GND
27
GPIO 0
EEPROM
29
GPIO 5
31
GPIO 6
33
GPIO 13
PWM1
35
GPIO 19
PWM1
I2S FS
37
GPIO 26
39
GND
Raspberry Pi 3 Pinout
2
5V
4
5V
6
GND
8
GPIO 14
TXD0
10
GPIO 15
RXD0
12
GPIO 18
PWM0
I2S CLK
14
GND
16
GPIO 23
18
GPIO 24
20
GND
22
GPIO 25
24
GPIO 8
CE0
26
GPIO 7
CE1
28
GPIO 1
EEPROM
30
GND
32
GPIO 12
PWM0
34
GND
36
GPIO 16
38
GPIO 20
I2S DIN
40
GPIO 21
I2S DOUT

Leyenda y filtrado

(pulsa los botones para mostrar u ocultar pines)

  • POWER
  • GPIO
  • PWM
  • UART
  • SPI
  • I2C
  • COMM
  • Select all
  • Select none
## Power Pins
  • 3V3 (Pins 1 and 17): Provide 3.3V power. Useful for low-power sensors and devices.
  • 5V (Pins 2 and 4): Provide 5V power. Ideal for devices that require more energy.

The Raspberry Pi pins operate at 3.3V. They are not 5V tolerant, so it is necessary to use level converters if connecting 5V devices.

Configuring GPIO Pins

To use the GPIO pins, it is necessary to configure them as inputs or outputs. This can be done using programming languages such as Python with the RPi.GPIO library.

  • GPIO (Pins 3, 5, 7, 8, 10, 11, 12, 13, 15, 16, 18, 19, 21, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 35, 36, 37, 38, 40): General-purpose pins that can be configured as inputs or outputs.
  • PWM (Pin 12): GPIO18 supports PWM output for motor or LED control.

Communication with Interfaces

UART (Serial)

The Raspberry Pi has a built-in UART port that allows serial communication with other devices. The GPIO14 (TXD) and GPIO15 (RXD) pins are used to transmit and receive data.

I2C

The I2C protocol is used to communicate with sensors and devices that support this interface. The GPIO2 (SDA) and GPIO3 (SCL) pins are used for I2C.

SPI

The SPI protocol is useful for devices that require fast and synchronized communication. The GPIO10 (MOSI), GPIO9 (MISO), GPIO11 (SCLK), and GPIO8 (CE0) pins are used for SPI.