The Raspberry Pi 3 (Model B and B+) uses the standard 40-pin GPIO header introduced in the Pi 1 Model B+. While the physical layout is identical to newer boards, the underlying BCM2837 chip mappings and power delivery limits have specific quirks you must respect to avoid destroying the 3.3V rail. Here is the exact pinout, followed by critical wiring standards and failure modes.
The 40-Pin Raspberry Pi 3 GPIO Pinout Reference
Read this table with the Pi oriented so the USB and Ethernet ports face downward. The left column represents the odd-numbered pins (closest to the SD card slot edge), and the right column represents the even-numbered pins. For a visual, interactive map, cross-reference with the definitive Pinout.xyz Raspberry Pi database.
| Odd Pin | Function / BCM (Left Row) | Function / BCM (Right Row) | Even Pin |
|---|---|---|---|
| 1 | 3.3V Power | 5V Power | 2 |
| 3 | GPIO 2 (SDA1 / I2C) | 5V Power | 4 |
| 5 | GPIO 3 (SCL1 / I2C) | Ground | 6 |
| 7 | GPIO 4 (GPCLK0) | GPIO 14 (TXD / UART) | 8 |
| 9 | Ground | GPIO 15 (RXD / UART) | 10 |
| 11 | GPIO 17 | GPIO 18 (PWM0) | 12 |
| 13 | GPIO 27 | Ground | 14 |
| 15 | GPIO 22 | GPIO 23 | 16 |
| 17 | 3.3V Power | GPIO 24 | 18 |
| 19 | GPIO 10 (MOSI / SPI) | Ground | 20 |
| 21 | GPIO 9 (MISO / SPI) | GPIO 25 | 22 |
| 23 | GPIO 11 (SCLK / SPI) | GPIO 8 (CE0 / SPI) | 24 |
| 25 | Ground | GPIO 7 (CE1 / SPI) | 26 |
| 27 | GPIO 0 (ID_SD / I2C) | GPIO 1 (ID_SC / I2C) | 28 |
| 29 | GPIO 5 | Ground | 30 |
| 31 | GPIO 6 | GPIO 12 (PWM0) | 32 |
| 33 | GPIO 13 (PWM1) | Ground | 34 |
| 35 | GPIO 19 | GPIO 16 | 36 |
| 37 | GPIO 26 | GPIO 20 | 38 |
| 39 | Ground | GPIO 21 | 40 |
Wire Color Standards & Regional Variants for Pi Projects
When wiring external sensors, relays, or custom HATs to the Pi's header, wire color standards dictate how you interpret power, ground, and signal lines. Misinterpreting a salvaged harness can instantly short the 5V rail to a 3.3V GPIO.
IDC Ribbon Cables (Global Standard)
If you are using a standard 40-pin IDC ribbon cable to breakout the GPIO header, the global manufacturing standard dictates that Pin 1 is always marked by a red stripe on the cable edge. Never assume Pin 1 based on the connector notch alone; always verify the red stripe aligns with the 3.3V pin (Pin 1) on the Pi.
External Sensor Wiring: IEC vs. NEC vs. Old UK
When building custom sensor harnesses using discrete wire, the color code depends on your regional electrical standards. While the official Raspberry Pi documentation does not mandate external wire colors, adhering to regional low-voltage standards prevents dangerous confusion when mixing mains-powered relays with Pi logic.
- IEC 60446 (EU / Global Standard): For DC low-voltage sensor wiring, Brown is typically positive (+), Blue is negative/ground (-), and Green/Yellow is reserved strictly for earth/shield.
- US / NEC Standard Practice: Red is positive (+), Black is negative/ground (-), and Green is earth. In US automotive and low-voltage hobbyist contexts, Yellow is often used for 12V/5V switched signals.
- Old UK (Pre-2004 Mains / Legacy Kits): Red was Line (+), Black was Neutral (-), and Green was Earth. Warning: If you are salvaging old UK hobbyist kits, a black wire might be ground, but in modern IEC kits, black is often used as a secondary signal or switched live.
Rows and Pins People Get Wrong (The Pi Killers)
The BCM2837 SoC on the Raspberry Pi 3 is notoriously unforgiving of electrical abuse. Here are the specific rows and pins that cause the most hardware failures on the workbench.
The 5V Tolerance Myth (Pins 8, 10, and General GPIOs)
Unlike the Arduino Uno (ATmega328P), which is 5V tolerant, every GPIO pin on the Raspberry Pi 3 is strictly 3.3V. Feeding a 5V signal from an ultrasonic sensor (like the HC-SR04) or a 5V Arduino into GPIO 14 (Pin 8 / TXD) will backfeed current through the SoC's internal protection diodes, eventually latching up and destroying the chip.
The Fix: Use a BSS138-based bidirectional logic level converter, or build a simple voltage divider using a 2kΩ resistor (to GND) and a 3.3kΩ resistor (in series with the signal) to drop 5V down to a safe ~3.0V.
I2C Pull-Up Resistor Conflicts (Pins 3 and 5)
GPIO 2 (Pin 3 / SDA) and GPIO 3 (Pin 5 / SCL) are the primary I2C bus pins. The Raspberry Pi 3 board includes onboard 1.8kΩ pull-up resistors tied to the 3.3V rail for these pins. If you connect an I2C sensor module that also has pull-up resistors tied to 5V, you will force 5V directly into the Pi's 3.3V I2C lines. Always inspect the schematic of your sensor breakout board and cut the 5V pull-up traces or disable them via jumpers before wiring to the Pi.
Pin 1 Orientation and HAT Reversal
Pin 1 is the 3.3V pin located on the row closest to the USB/Ethernet ports, and it's the pin closest to the SD card slot corner. If you force a GPIO HAT or ribbon cable on backward (shifting by one pin or flipping 180 degrees), you will route the 5V rail (Pin 2 or 4) directly into the 3.3V rail or a GPIO pin, instantly killing the board's 3.3V voltage regulator and the SoC.
Frequently Asked Questions
Is the Raspberry Pi 3 GPIO pinout identical to the Pi 4 and Pi 5?
Physically, yes. The 40-pin layout, BCM pin assignments, and power pins are identical across the Pi 3, 4, and 5. However, the Pi 4 and 5 have higher current limits on the 5V and 3.3V rails. Furthermore, the Pi 5 uses a dedicated RP1 southbridge chip for GPIO routing, which changes some software-level peripheral behaviors and requires updated device tree overlays in your code.
How do I safely identify Pin 1 if the header markings are faded or missing?
Look at the physical board layout. Pin 1 is the 3.3V pin located on the row closest to the USB/Ethernet ports, and it sits nearest to the SD card slot corner. If the board is heavily modified or obscured, use a multimeter: with power off, check continuity to the metal RF shields to identify and eliminate the ground pins (6, 9, 14, 20, 25, 30, 34, 39). Then, power on the Pi and measure DC voltage; the pin reading exactly 3.30V-3.33V relative to GND on that specific corner is Pin 1.
Can I power the Raspberry Pi 3 directly through the 5V GPIO pins?
Yes, you can backpower the board through Pin 2 (5V) and Pin 6 (GND). Warning: This completely bypasses the board's polyfuse and USB power management IC. You must use a high-quality 5V/2.5A power supply with its own over-current and over-voltage protection circuitry. If your external supply spikes to 6V, you will fry the Pi instantly, as there is no onboard protection on the GPIO 5V rail.
Why do my GPIO pins read 3.3V when they should be LOW?
The BCM2837 pins are configured as high-impedance inputs by default at boot. A floating input will read random electromagnetic noise or drift high. You must explicitly set the pin mode to OUTPUT and write LOW in your Python/C code. If you are using the pin as an input (e.g., reading a pushbutton), you must enable the internal pull-down resistors via your GPIO library (like gpiozero or RPi.GPIO) to prevent the pin from floating when the switch is open.






