The Rasp4B-Pins are the GPIO (General Purpose Input/Output) pins on the Raspberry Pi 4 Model B, manufactured by Rasp. These pins are designed to interface with a wide range of electronic components, sensors, and modules, enabling users to create custom hardware projects. The GPIO pins support digital input and output, as well as specialized functions such as I2C, SPI, UART, and PWM.
The GPIO pins on the Raspberry Pi 4 Model B are arranged in a 40-pin header. Below are the key technical details and pin configuration:
The GPIO header consists of 40 pins arranged in two rows of 20 pins each. Below is the pinout table:
Pin Number | Pin Name | Function/Description |
---|---|---|
1 | 3.3V Power | 3.3V power output |
2 | 5V Power | 5V power output |
3 | GPIO2 (SDA1) | I2C Data (SDA) |
4 | 5V Power | 5V power output |
5 | GPIO3 (SCL1) | I2C Clock (SCL) |
6 | GND | Ground |
7 | GPIO4 | General Purpose I/O |
8 | GPIO14 (TXD0) | UART Transmit (TX) |
9 | GND | Ground |
10 | GPIO15 (RXD0) | UART Receive (RX) |
11 | GPIO17 | General Purpose I/O |
12 | GPIO18 (PWM0) | PWM Output |
13 | GPIO27 | General Purpose I/O |
14 | GND | Ground |
15 | GPIO22 | General Purpose I/O |
16 | GPIO23 | General Purpose I/O |
17 | 3.3V Power | 3.3V power output |
18 | GPIO24 | General Purpose I/O |
19 | GPIO10 (MOSI) | SPI Master Out Slave In (MOSI) |
20 | GND | Ground |
21 | GPIO9 (MISO) | SPI Master In Slave Out (MISO) |
22 | GPIO25 | General Purpose I/O |
23 | GPIO11 (SCLK) | SPI Clock (SCLK) |
24 | GPIO8 (CE0) | SPI Chip Enable 0 (CE0) |
25 | GND | Ground |
26 | GPIO7 (CE1) | SPI Chip Enable 1 (CE1) |
27 | GPIO0 (ID_SD) | I2C ID EEPROM Data |
28 | GPIO1 (ID_SC) | I2C ID EEPROM Clock |
29 | GPIO5 | General Purpose I/O |
30 | GND | Ground |
31 | GPIO6 | General Purpose I/O |
32 | GPIO12 (PWM0) | PWM Output |
33 | GPIO13 (PWM1) | PWM Output |
34 | GND | Ground |
35 | GPIO19 (PCM_FS) | PCM Frame Sync |
36 | GPIO16 | General Purpose I/O |
37 | GPIO26 | General Purpose I/O |
38 | GPIO20 (PCM_DIN) | PCM Data In |
39 | GND | Ground |
40 | GPIO21 (PCM_DOUT) | PCM Data Out |
Below is an example of how to control an LED connected to a GPIO pin using Python and the Raspberry Pi's GPIO library:
import RPi.GPIO as GPIO import time
GPIO.setmode(GPIO.BCM)
LED_PIN = 17
GPIO.setup(LED_PIN, GPIO.OUT)
try: while True: GPIO.output(LED_PIN, GPIO.HIGH) # Turn the LED on time.sleep(1) # Wait for 1 second GPIO.output(LED_PIN, GPIO.LOW) # Turn the LED off time.sleep(1) # Wait for 1 second except KeyboardInterrupt: # Clean up GPIO settings on exit GPIO.cleanup()
GPIO Pin Not Responding:
Overheating or Damage to GPIO Pins:
I2C or SPI Devices Not Communicating:
Floating GPIO Pins: