The Raspberry Pi 3 Model B pinout consists of a 40-pin header featuring 26 general-purpose I/O (GPIO) pins, 2 I2C buses, 2 SPI buses, 1 UART interface, and 8 power/ground pins. The default and most widely supported numbering standard is BCM (Broadcom SOC channel) numbering, though Physical (BOARD) pin numbering is also available depending on your software library. All GPIO pins operate at strictly 3.3V logic; applying 5V to any data pin will permanently destroy the BCM2837 SoC.
The Complete Raspberry Pi 3 Model B Pinout Table
Below is the definitive 40-pin reference. Use this table to map physical header locations to their Broadcom (BCM) GPIO equivalents and alternate functions. For interactive visual mapping, cross-reference with the community-standard pinout.xyz database.
| Phys | BCM | Name / Function | Phys | BCM | Name / Function |
|---|---|---|---|---|---|
| 1 | - | 3.3V Power | 2 | - | 5V Power |
| 3 | 2 | GPIO2 (I2C1 SDA) | 4 | - | 5V Power |
| 5 | 3 | GPIO3 (I2C1 SCL) | 6 | - | Ground |
| 7 | 4 | GPIO4 (GPCLK0) | 8 | 14 | GPIO14 (UART0 TX) |
| 9 | - | Ground | 10 | 15 | GPIO15 (UART0 RX) |
| 11 | 17 | GPIO17 | 12 | 18 | GPIO18 (PWM0) |
| 13 | 27 | GPIO27 | 14 | - | Ground |
| 15 | 22 | GPIO22 | 16 | 23 | GPIO23 |
| 17 | - | 3.3V Power | 18 | 24 | GPIO24 |
| 19 | 10 | GPIO10 (SPI0 MOSI) | 20 | - | Ground |
| 21 | 9 | GPIO9 (SPI0 MISO) | 22 | 25 | GPIO25 |
| 23 | 11 | GPIO11 (SPI0 SCLK) | 24 | 8 | GPIO8 (SPI0 CE0) |
| 25 | - | Ground | 26 | 7 | GPIO7 (SPI0 CE1) |
| 27 | 0 | GPIO0 (I2C0 ID_SD) | 28 | 1 | GPIO1 (I2C0 ID_SC) |
| 29 | 5 | GPIO5 | 30 | - | Ground |
| 31 | 6 | GPIO6 | 32 | 12 | GPIO12 (PWM0) |
| 33 | 13 | GPIO13 (PWM1) | 34 | - | Ground |
| 35 | 19 | GPIO19 (SPI1 MISO) | 36 | 16 | GPIO16 (SPI1 CE2) |
| 37 | 26 | GPIO26 | 38 | 20 | GPIO20 (SPI1 MOSI) |
| 39 | - | Ground | 40 | 21 | GPIO21 (SPI1 SCLK) |
BCM vs. BOARD: Which Numbering Standard Applies?
Unlike industrial PLCs that use fixed hardware addressing, the Pi's software ecosystem allows two distinct mapping standards. Choosing the wrong one is the leading cause of "my sensor isn't responding" support tickets.
- BCM (Broadcom SOC Channel): Uses the internal GPIO numbers (e.g., GPIO17). This is the native standard for the
RPi.GPIOandgpiozeroPython libraries, as well as the official Raspberry Pi Foundation documentation. - BOARD (Physical): Uses the physical pin numbers (1 through 40). This is often the default in Node-RED, some Scratch implementations, and older
wiringPiC libraries. It ignores the actual silicon routing.
If you wire a relay to Physical Pin 11 but tell your Python script to toggle GPIO(11) in BCM mode, the script will actually toggle Physical Pin 23 (which is BCM 11). Always declare your mode explicitly at the top of your script: GPIO.setmode(GPIO.BCM).
Rows People Get Wrong (And How to Avoid Bricking Your Pi)
The 40-pin header is unforgiving. There is no onboard polyfuse protecting the data lines from overvoltage. Here are the specific rows where builders consistently make catastrophic or functional errors.
Pin 1 (3.3V) vs. Pin 2 (5V)
Pin 1 outputs a regulated 3.3V (max draw ~50mA). Pin 2 outputs raw 5V from the USB power input. Plugging a 5V sensor's VCC into Pin 1 will cause brownouts and system reboots. Plugging a 3.3V sensor's VCC into Pin 2 will instantly destroy the sensor. Always trace your power wires with a multimeter before applying power.
Pins 27 & 28 (ID_SD and ID_SC)
These pins are physically located next to the 3.3V rail. They are reserved for the HAT (Hardware Attached on Top) EEPROM I2C bus. The Pi uses these during boot to read HAT configuration data. Do not use these for standard I2C sensors; use Pins 3 and 5 (I2C1) instead. Pulling these low during boot can prevent the Pi from initializing HATs correctly.
Pins 8 & 10 (UART TX/RX)
These are 3.3V TTL serial pins, not RS-232. If you are connecting a GPS module or a cellular modem, ensure the module's TX line does not exceed 3.3V. Furthermore, by default, the Pi 3 uses this UART for the serial console. You must disable the serial console in raspi-config (Interface Options -> Serial Port -> Disable Login Shell, Enable Hardware) before using these pins for sensor data.
Safe Interpretation When Silk Screen Markings Are Faded
On older Pi 3 Model B boards, or boards exposed to high ambient heat and flux residue, the white silk-screen pin numbers can fade or flake off. If you lose your pinout reference, use these physical landmarks to safely orient the header:
- The Square Pad: Pin 1 is the only pin on the entire header with a square copper pad on the PCB underside. All other pins have round pads. Flip the board over to verify.
- Component Proximity: Pin 1 is located closest to the edge of the board where the microSD card slot resides, and furthest from the USB/Ethernet block.
- Power Bank Orientation: The two pins closest to the USB power input micro-plug are Pin 2 (5V) and Pin 4 (5V). Pin 1 (3.3V) and Pin 3 (SDA) are on the opposite side of that same row.
Decision Path: Choosing the Right Interface for Your Sensor
Don't just pick a random GPIO pin. Match your sensor's protocol to the Pi's dedicated hardware peripherals to offload processing from the CPU. Use this decision tree to select your exact pins.
| Sensor / Device Type | Required Protocol | Concrete Pin Pick (Physical) | Why This Pick? |
|---|---|---|---|
| Temperature/Humidity (BME280), OLED Displays, IMUs (MPU6050) | I2C | 3 (SDA) & 5 (SCL) | Hardware I2C1 bus. Includes onboard 1.8kΩ pull-up resistors to 3.3V. Supports up to 400kHz Fast Mode. |
| SD Cards, High-speed ADCs (MCP3008), RFID (RC522) | SPI | 19 (MOSI), 21 (MISO), 23 (SCLK), 24 (CE0) | Hardware SPI0 bus. Capable of 125MHz (though practically limited to ~30MHz for stable wiring). CE0 is hardware Chip Select 0. |
| GPS Modules, ESP8266 AT-command Wi-Fi, PZEM-004T Energy Meters | UART (Serial) | 8 (TX) & 10 (RX) | Hardware UART0 (PL011). Provides stable baud rates without the jitter of software serial. Remember to cross-wire (Pi TX to Sensor RX). |
| Servos, LED Dimming, DC Motor Speed Control | PWM | 12 (PWM0) or 33 (PWM1) | Hardware PWM channels. Software PWM on other pins causes servo jitter due to Linux OS thread scheduling latency. |
| Push Buttons, PIR Motion Sensors, Relays | Digital I/O | 11, 13, 15, or 16 | Standard GPIOs with no default alternate functions assigned at boot, reducing the risk of startup glitches triggering your relays. |






