The Raspberry Pi 3 Model B and B+ utilize a 40-pin GPIO header (J8) operating strictly at 3.3V logic. Unlike 5V-tolerant microcontrollers such as the Arduino Uno, injecting 5V into a Raspi 3 GPIO pin will permanently destroy the BCM2837 SoC. While the Pi 5 and Pi 4 dominate new designs in 2026, the Pi 3 remains heavily deployed in industrial control panels, legacy maker projects, and retrofit sensor nodes. Below is the definitive hardware pinout reference, wiring color mappings, and physical identification tricks you need before connecting your first peripheral.
The Complete Raspberry Pi 3 GPIO Pinout Reference
The following table maps the physical header pins to their Broadcom (BCM) GPIO numbers and primary functions. Physical pin numbering starts at 1 (top-left, closest to the USB ports when the board is oriented with USB facing you) and zig-zags down to 40.
| Pin L | BCM L | Name L | Pin R | BCM R | Name R |
|---|---|---|---|---|---|
| 1 | - | 3.3V Power | 2 | - | 5V Power |
| 3 | 2 | SDA1 (I2C) | 4 | - | 5V Power |
| 5 | 3 | SCL1 (I2C) | 6 | - | Ground |
| 7 | 4 | GPIO 4 | 8 | 14 | TXD (UART) |
| 9 | - | Ground | 10 | 15 | RXD (UART) |
| 11 | 17 | GPIO 17 | 12 | 18 | GPIO 18 (PWM0) |
| 13 | 27 | GPIO 27 | 14 | - | Ground |
| 15 | 22 | GPIO 22 | 16 | 23 | GPIO 23 |
| 17 | - | 3.3V Power | 18 | 24 | GPIO 24 |
| 19 | 10 | MOSI (SPI) | 20 | - | Ground |
| 21 | 9 | MISO (SPI) | 22 | 25 | GPIO 25 |
| 23 | 11 | SCLK (SPI) | 24 | 8 | CE0 (SPI) |
| 25 | - | Ground | 26 | 7 | CE1 (SPI) |
| 27 | 0 | ID_SD (I2C) | 28 | 1 | ID_SC (I2C) |
| 29 | 5 | GPIO 5 | 30 | - | Ground |
| 31 | 6 | GPIO 6 | 32 | 12 | GPIO 12 (PWM0) |
| 33 | 13 | GPIO 13 (PWM1) | 34 | - | Ground |
| 35 | 19 | GPIO 19 (PWM1) | 36 | 16 | GPIO 16 |
| 37 | 26 | GPIO 26 | 38 | 20 | GPIO 20 |
| 39 | - | Ground | 40 | 21 | GPIO 21 |
Source: Pinout.xyz and Raspberry Pi Official Documentation.
Rows People Get Wrong (And How to Avoid Bricking Your Pi)
Reading the table is easy; understanding the hidden hardware quirks of specific pins is where bench experience matters. These are the most common failure points when wiring sensors and actuators to the Pi 3.
The BCM2837 SoC on the Pi 3 is strictly 3.3V. Connecting a 5V Arduino sensor output directly to any BCM GPIO pin will forward-bias the internal ESD protection diodes, injecting current into the 3.3V rail and permanently destroying the silicon. Always use a logic level converter (like the BSS138 MOSFET bi-directional shifter) or a voltage divider when interfacing 5V logic.
- Pins 1 & 17 (3.3V Power): These are tied to the onboard 3.3V linear regulator. The absolute maximum continuous draw is ~50mA. Hobbyists frequently wire 3.3V servo motors or high-current LED strips here, causing an immediate brownout that reboots the Pi or burns out the regulator. Use the 5V pins (2, 4) for high-current loads and regulate down locally if needed.
- Pins 3 & 5 (GPIO 2 & 3 - I2C): These pins feature hardware 1.8kΩ pull-up resistors tied to the 3.3V rail on the Pi board itself. If you use these pins for generic active-low interrupts or button inputs, the 1.8k pull-up will fight your external circuit. Stick to dedicated I2C devices here.
- Pins 8 & 10 (GPIO 14 & 15 - UART): By default, the Pi 3 routes the Linux serial console to these pins. If you connect an external UART device (like a GPS module) without disabling the serial console in
/boot/config.txt(enable_uart=1and disabling the console overlay), the Pi's boot spam will flood your peripheral and potentially cause erratic behavior. - Pins 27 & 28 (ID_SD & ID_SC): These are reserved exclusively for the HAT (Hardware Attached on Top) EEPROM I2C bus. The Pi uses these during boot to read HAT configuration data. Do not use them for general-purpose GPIO or standard I2C sensors.
Wiring Color Standards: IEC, US, and Legacy Conventions
When wiring external industrial sensors, optocoupler relay boards, or custom terminal blocks to your Pi 3 GPIO, you will encounter different regional wiring color standards. Misinterpreting these when adapting mains-powered control circuits to low-voltage Pi logic is a primary cause of short circuits.
| Standard / Region | DC Positive (VCC) | DC Negative (GND) | Control / Signal | Application Context |
|---|---|---|---|---|
| IEC 60446 (EU / Global) | Brown | Blue | Black | Industrial sensors, DIN-rail terminal blocks, modern Pi HATs. |
| US (NEC / NFPA 79) | Red or Orange | White or Blue | Blue (DC Control) | North American industrial control panels, PLC interfaces. |
| Old UK (Pre-2004) | Red | Black | Yellow / Green | Legacy equipment retrofits. High hazard if mixed with IEC. |
| Hobbyist (Adafruit/SparkFun) | Red | Black | Blue/Yellow/White | DuPont jumper wires, JST-XH sensor pigtails, breakout boards. |
The Legacy Wiring Hazard
If you are retrofitting a Pi 3 into an older UK-manufactured control panel (pre-2004 harmonization), you will likely find Red (DC+) and Black (DC-) wiring. If you connect this to a modern IEC-compliant Pi HAT terminal block where Black is expected to be the signal line and Blue is DC-, you will create a dead short or reverse-polarity condition. Always verify wire functions with a multimeter before trusting the jacket color on legacy equipment.
Hobbyist I2C Color Mapping
For standard 4-pin I2C sensors (OLEDs, BME280), the hobbyist standard is almost universal: Red (VIN/3.3V), Black (GND), Blue (SDA), and Yellow (SCL). Map Blue to Pin 3 (SDA1) and Yellow to Pin 5 (SCL1).
Identifying Pin 1 When Silkscreen Markings Fade
In harsh environments, 3D-printed enclosures, or after years of bench use, the white silkscreen pin numbers on the Pi 3 PCB can wear off or become obscured by ribbon cables. Guessing Pin 1 orientation and plugging in a 5V HAT will instantly kill the board. Use these physical and electrical verification methods to safely identify the header layout.
Visual and Physical Cues
- The Square Pad: Look closely at the copper pads on the PCB beneath the plastic header shroud. Pin 1 is the only pad with a square copper outline. All other pins (2 through 40) have round copper outlines.
- Component Proximity (Pi 3 Model B/B+): Orient the board so the USB ports and Ethernet jack are facing your chest. The GPIO header runs along the left edge. Pin 1 is the top-left pin, closest to the USB/Ethernet block. Pin 2 is top-right.
The Multimeter Continuity Trick
If the board is mounted in a case and you cannot see the square pad, use your multimeter to map the Ground pins first. The metal shielding of the USB ports and Ethernet jack is directly tied to the system ground.
- Set your multimeter to continuity mode (the diode/beep symbol).
- Place the black probe firmly against the metal shield of a USB port.
- Probe the header pins with the red probe. The pins that emit a continuous beep (reading < 1 ohm) are your Ground pins (Pins 6, 9, 14, 20, 25, 30, 34, and 39).
- Once you have mapped the Ground pins, you can mathematically deduce the rest of the header based on the standard 40-pin zig-zag layout. For example, the pin immediately to the left of the top-most Ground pin (Pin 9) on the same side is Pin 7 (GPIO 4), and the pin above it is Pin 5 (SCL1).






