The Raspberry Pi 3 (Model B and B+) features a 40-pin GPIO header driven by the BCM2837 SoC. The direct answer for bench work: the data pins operate strictly on 3.3V logic levels, the board provides 5V and 3.3V power rails, and sending 5V into any GPIO data pin will permanently destroy the processor. Below is the complete physical-to-BCM mapping, followed by the wiring color standards you need when interfacing the Pi with external regional mains loads.

The Complete Raspberry Pi 3 GPIO Pinout Reference

This table mirrors the physical layout of the header. Orient your Pi 3 with the USB and Ethernet ports facing toward you; the GPIO header is on the top right. The left column represents the row closest to the edge of the board.

Pin (L) Function (Left Bank) Function (Right Bank) Pin (R)
13.3V Power5V Power2
3GPIO 2 (SDA1 / I2C)5V Power4
5GPIO 3 (SCL1 / I2C)Ground6
7GPIO 4 (GPCLK0)GPIO 14 (TXD / UART)8
9GroundGPIO 15 (RXD / UART)10
11GPIO 17GPIO 18 (PCM_CLK / PWM0)12
13GPIO 27Ground14
15GPIO 22GPIO 2316
173.3V PowerGPIO 2418
19GPIO 10 (MOSI / SPI0)Ground20
21GPIO 9 (MISO / SPI0)GPIO 2522
23GPIO 11 (SCLK / SPI0)GPIO 8 (CE0 / SPI0)24
25GroundGPIO 7 (CE1 / SPI0)26
27ID_SD (I2C HAT EEPROM)ID_SC (I2C HAT EEPROM)28
29GPIO 5Ground30
31GPIO 6GPIO 12 (PWM0)32
33GPIO 13 (PWM1)Ground34
35GPIO 19 (MISO / SPI1)GPIO 16 (CE2 / SPI1)36
37GPIO 26GPIO 20 (MOSI / SPI1)38
39GroundGPIO 21 (SCLK / SPI1)40

Source: Raspberry Pi Official Hardware Documentation

Rows People Get Wrong (and How to Avoid Bricking Your Pi)

When wiring up sensors or relay boards, these specific pins cause 90% of bench failures.

⚠️ The 5V Logic Trap: Pins 2 and 4 output 5V from the USB power rail. They are strictly for powering external 5V components (like a 5V relay module's VCC). Never route a 5V signal back into any GPIO data pin (like Pin 3 or 5). The BCM2837 has no internal 5V tolerance; doing this will instantly fry the SoC's I/O ring.

1. The HAT EEPROM Pins (27 & 28)

Pins 27 (ID_SD) and 28 (ID_SC) are a dedicated I2C bus reserved exclusively for reading the EEPROM on official Raspberry Pi HATs. Do not use these for your own I2C sensors. Use Pins 3 and 5 (SDA1/SCL1) instead. Pulling these pins low during boot can cause the Pi to misidentify attached hardware and fail to configure the device tree correctly.

2. UART Cross-Wiring (Pins 8 & 10)

When connecting the Pi 3 to an Arduino, ESP32, or a USB-to-TTL serial adapter via UART, you must cross the lines. Pin 8 is TXD (Transmit) and Pin 10 is RXD (Receive). Connect Pi TXD to the external device's RXD, and Pi RXD to the external device's TXD. Also, ensure the external device is outputting 3.3V logic, or use a logic level shifter.

3. Locating Pin 1 on Faded or Missing Markings

If your Pi 3 has been sitting in a dusty industrial enclosure for five years and the silkscreen is completely faded, you can safely identify Pin 1 using physical board cues:

  • The Pad Shape: Pin 1 is always the square solder pad on the underside of the board. All other pins are round.
  • The Orientation Rule: With the USB/Ethernet ports facing your stomach, the 40-pin header is on the top right. Pin 1 is the bottom-left corner of that 2x20 grid.
  • The Ethernet Port Trick: On the Pi 3 Model B+, Pin 1 is located on the side of the header closest to the Ethernet port, not the edge of the board.

Wiring Color Codes: Pi Jumper Conventions vs. Regional Mains Standards

A common point of confusion arises when a Pi 3 is used to switch AC mains loads via opto-isolated relay boards. The low-voltage control side (Pi to Relay) follows hobbyist conventions, but the high-voltage load side (Relay to Mains) must follow your region's legal electrical codes. Never mix these color standards on the same harness.

Wire Function Pi Hobbyist (Low Voltage) NEC / NFPA 70 (US/Canada) IEC 60446 (EU / Modern UK) Old UK (Pre-2004)
Power / Line / HotRed (5V) / Orange (3.3V)Black (or Red for 2nd phase)BrownRed
Neutral / ReturnBlack (GND)White (or Gray)BlueBlack
Earth / GroundGreen or BareGreen, Green/Yellow, or BareGreen/YellowGreen
Switched LoadYellow or BlueRed (or Blue/Yellow for travelers)Black (with brown sleeve)Yellow

Reference: NFPA 70 (National Electrical Code) and IEC 60446 wiring standards.

💡 Bench Tip: When building a custom wiring harness that transitions from the Pi 3 GPIO to a relay board, use Red for 5V VCC, Black for GND, and Yellow for the GPIO signal wire. This prevents accidental cross-wiring if the connector is reversed. Never use Green or Green/Yellow for any low-voltage signal; reserve those strictly for safety earth grounding.

Raspberry Pi 3 Pinout FAQ

What is the difference between physical pin and BCM pinout on Raspberry Pi 3?

The physical pin number (1 through 40) refers to the actual physical location of the pin on the hardware header, starting from the square pad (Pin 1). The BCM GPIO number (e.g., GPIO 17, GPIO 22) refers to the internal Broadcom BCM2837 SoC register mapping. When writing Python code using the RPi.GPIO library, you must explicitly declare which numbering system you are using via GPIO.setmode(GPIO.BOARD) for physical pins, or GPIO.setmode(GPIO.BCM) for Broadcom pins. Physical pin 11 is BCM GPIO 17; confusing the two is the most common reason a script fails to trigger a relay.

Can I power the Raspberry Pi 3 through the 5V GPIO pins?

Yes, but with strict current limitations. You can backpower the Pi 3 by supplying 5.1V to Pin 2 or Pin 4 (and grounding via Pin 6). However, this route bypasses the board's polyfuse and ideal diode protection circuitry. If your external power supply spikes or exceeds 5.25V, you will fry the board. Furthermore, the 5V rail is shared with the USB ports; if you backpower the Pi while also plugging in power-hungry USB peripherals, you risk browning out the SoC. It is always safer to power the Pi 3 via the micro-USB port or the official power supply.

Which Raspberry Pi 3 pins are safe for 5V input?

None of the GPIO data pins are 5V tolerant. The BCM2837 I/O pins are strictly 3.3V. If you need to read a 5V signal (like a 5V Arduino output or a 5V industrial proximity sensor), you must use a voltage divider (e.g., a 2kΩ and 3.3kΩ resistor network) or a dedicated logic level shifter (like the TXB0108 or BSS138 MOSFET circuit) to step the 5V signal down to 3.3V before it reaches the Pi's GPIO pin.

Does the Raspberry Pi 3 B+ have a different pinout than the Pi 3 B?

The main 40-pin GPIO header is identical in both pinout and BCM mapping between the Pi 3 Model B and the Pi 3 Model B+. The B+ introduced a 4-pin PoE (Power over Ethernet) header near the USB ports, but this does not alter the standard 40-pin layout. Any HAT or wiring harness designed for the Pi 3 B will physically and electrically interface with the Pi 3 B+ without modification.