DEV Community

Hedy
Hedy

Posted on

What are the specifications of the GPIO pins in Raspberry Pi 4 Model B?

The GPIO (General Purpose Input/Output) pins on the Raspberry Pi 4 Model B provide a versatile interface for connecting sensors, LEDs, displays, and other electronics. Here's a complete overview of the specifications and layout:

Image description

Raspberry Pi 4 Model B GPIO Header Overview
Total Pins: 40 (2x20 header)

GPIO Pins: 26 usable general-purpose pins

Voltage Levels:

  • Logic high: 3.3V
  • Logic low: 0V
  • Do NOT apply 5V directly to GPIO pins — it can damage the Pi.

Pin Categories on the 40-Pin Header

Image description

GPIO Electrical Specifications

Image description

Pinout (Top-Down View, 40-Pin Header)

Image description

Common Use Examples

  • LED: GPIO output with resistor to control on/off.
  • Button: GPIO input with pull-up/down resistors.
  • I2C Devices: Use GPIO2 and GPIO3.
  • SPI Devices: Use GPIO7–11.
  • Serial Devices: Use GPIO14 (TX) and GPIO15 (RX).

Tools & Resources

  • Pinout Reference Site: pinout.xyz
  • Python Library: Use RPi.GPIO or gpiozero for scripting.
  • Voltage Protection: Use logic level shifters when interfacing 5V components.

Top comments (0)