The Raspberry Pi 3B+ features a 40-pin 2x20 GPIO header driven by the BCM2837B0 SoC. All GPIO pins operate at 3.3V logic with a strict 16mA maximum current draw per pin. Below is the complete physical and BCM (Broadcom) pinout reference, followed by critical hardware-specific edge cases and external wiring standards.
The Complete Raspberry Pi 3B+ Pinout Reference Table
This table maps the physical pin number (1-40) to the Broadcom GPIO number, the functional name, and practical application notes. Physical Pin 1 is the square-pad hole closest to the SD card slot.
| Pin | BCM | Name | Function & Practical Notes |
|---|---|---|---|
| 1 | - | 3.3V | 3.3V Power Output (Max 50mA total across all 3.3V pins) |
| 2 | - | 5V | 5V Power Input/Output (Direct from USB/5V rail) |
| 3 | 2 | SDA1 | I2C Data (Includes 1.8kΩ onboard pull-up to 3.3V) |
| 4 | - | 5V | 5V Power Input/Output |
| 5 | 3 | SCL1 | I2C Clock (Includes 1.8kΩ onboard pull-up to 3.3V) |
| 6 | - | GND | Ground |
| 7 | 4 | GPIO4 | General Purpose / Default 1-Wire Data (w1-gpio) |
| 8 | 14 | TXD | UART Transmit (See mini-UART warning below) |
| 9 | - | GND | Ground |
| 10 | 15 | RXD | UART Receive (See mini-UART warning below) |
| 11 | 17 | GPIO17 | General Purpose |
| 12 | 18 | GPIO18 | Hardware PWM0 (Primary PCM/I2S clock) |
| 13 | 27 | GPIO27 | General Purpose |
| 14 | - | GND | Ground |
| 15 | 22 | GPIO22 | General Purpose |
| 16 | 23 | GPIO23 | General Purpose |
| 17 | - | 3.3V | 3.3V Power Output |
| 18 | 24 | GPIO24 | General Purpose |
| 19 | 10 | MOSI | SPI0 Master Out Slave In |
| 20 | - | GND | Ground |
| 21 | 9 | MISO | SPI0 Master In Slave Out |
| 22 | 25 | GPIO25 | General Purpose |
| 23 | 11 | SCLK | SPI0 Serial Clock |
| 24 | 8 | CE0 | SPI0 Chip Select 0 |
| 25 | - | GND | Ground |
| 26 | 7 | CE1 | SPI0 Chip Select 1 |
| 27 | 0 | ID_SD | HAT EEPROM I2C Data (Do not use for general I2C) |
| 28 | 1 | ID_SC | HAT EEPROM I2C Clock (Do not use for general I2C) |
| 29 | 5 | GPIO5 | General Purpose |
| 30 | - | GND | Ground |
| 31 | 6 | GPIO6 | General Purpose |
| 32 | 12 | GPIO12 | Hardware PWM0 (Alternate) |
| 33 | 13 | GPIO13 | Hardware PWM1 |
| 34 | - | GND | Ground |
| 35 | 19 | GPIO19 | PCM Frame Sync / SPI1 MISO |
| 36 | 16 | GPIO16 | General Purpose |
| 37 | 26 | GPIO26 | General Purpose |
| 38 | 20 | GPIO20 | PCM Data In / SPI1 MOSI |
| 39 | - | GND | Ground |
| 40 | 21 | GPIO21 | PCM Data Out / SPI1 SCLK |
Rows Makers Get Wrong (And How to Avoid Bricking Your Board)
When working with the Raspberry Pi 3B+ pinout, misinterpreting the table above leads to immediate hardware failure or silent communication bugs. Here are the specific traps inherent to the 3B+ architecture.
The UART / Bluetooth Routing Trap (Pins 8 & 10)
On older Pi models, Pins 8 (GPIO 14) and 10 (GPIO 15) provided a stable hardware UART (PL011). On the Pi 3B+, the primary PL011 UART is hardwired to the onboard Bluetooth module. Pins 8 and 10 are instead routed to the mini-UART. The mini-UART lacks a dedicated baud-rate clock and relies on the core CPU clock, meaning your serial baud rate will drift and drop characters if the CPU frequency scales.
The Fix: If you need stable hardware UART for a GPS module or RS485 transceiver, add dtoverlay=disable-bt to your /boot/config.txt file. This frees the PL011 UART and maps it back to Pins 8 and 10, but disables onboard Bluetooth.
The HAT EEPROM Pins (Pins 27 & 28)
Pins 27 (ID_SD) and 28 (ID_SC) form a dedicated I2C bus reserved exclusively for reading the EEPROM on Raspberry Pi HATs (Hardware Attached on Top). While they function as I2C, they lack the standard 1.8kΩ pull-up resistors found on Pins 3 and 5. Using them for general I2C sensors will result in NACK errors and floating bus states unless you add external 4.7kΩ pull-ups to 3.3V.
Hardware vs. Software PWM
Only Pins 12 (GPIO 18), 32 (GPIO 12), and 33 (GPIO 13) support true hardware PWM. If you use the software PWM library on other pins (like Pin 7 / GPIO 4), the signal will jitter under CPU load, causing servos to twitch or LED dimmers to flicker. Always route motor control and precision dimming to the hardware PWM pins.
External Wiring Standards: IEC, NEC, and Old UK Color Codes
While the Pi's PCB silkscreen is universal, the external wiring you connect to its GPIO pins via terminal blocks, relays, or optocouplers must follow your region's electrical color codes. Miswiring a 24V industrial sensor or a mains-voltage relay module using the wrong color standard can lead to lethal shock hazards during maintenance.
According to official Raspberry Pi safety guidelines and international electrical standards, use the following color mappings for external DC and AC wiring connected to your Pi projects:
| Standard / Region | DC Positive (+) | DC Negative (-) | AC Line (L) | AC Neutral (N) | Earth Ground (PE) |
|---|---|---|---|---|---|
| IEC 60446 (EU, Modern UK, AU) | Brown | Blue | Brown | Blue | Green/Yellow |
| NEC / NFPA 70 (US, Canada) | Red (or Black) | Black (or White) | Black (or Red) | White (or Gray) | Green / Bare |
| Old UK (Pre-2006 Installations) | Red | Black | Red | Black | Green |
Practical Application: If you are wiring a 5V relay module to switch a 120V AC fan using a Pi GPIO pin, the DC control side (VCC, GND, IN) should use Red/Black (US) or Brown/Blue (EU). The AC mains side of the relay must strictly use Black/White/Green (US) or Brown/Blue/Green-Yellow (EU). Never mix IEC and NEC colors in the same enclosure; if adapting an old UK project, sleeve the old Red/Black wires with modern Brown/Blue heat shrink to prevent future maintainers from assuming the black wire is a neutral when it is actually a live phase.
Safe Interpretation When Silkscreen Markings Fade
On heavily used Pi 3B+ boards, the white silkscreen text (e.g., '3V3', '5V', 'GND') often flakes off due to thermal cycling or flux residue cleaning. Plugging a 5V line into a GPIO pin because you miscounted the header rows will instantly brick the board. Here is how to safely identify pins when markings are missing.
- Locate the Square Pad: Flip the board over or look closely at the top of the header. Pin 1 is the only pin with a square copper solder pad. All other 39 pins have perfectly round pads.
- Use the SoC Shield as a Landmark: The large metal can covering the Broadcom SoC and RAM is physically located adjacent to Pins 1 through 8. Pin 1 is always the corner closest to the SD card slot and the metal shield.
- Verify Ground with a Multimeter: Set your multimeter to continuity mode (the diode/beep setting). Place the black probe on the metal shield of the USB ports (which is tied to system ground). Probe the suspected GND pins (6, 9, 14, 20, 25, 30, 34, 39) with the red probe. A continuous beep confirms Ground. Never use the resistance setting to test for 3.3V or 5V on a live board, as the meter's internal battery can back-feed the GPIO.
- Verify Voltage Under Load: Once GND is confirmed, power the Pi. Set the meter to DC Voltage. Probe Pin 2 or 4 against your confirmed GND. It should read between 4.9V and 5.2V. Probe Pin 1 or 17; it should read exactly 3.3V. If the 5V rail reads below 4.65V, your power supply is browning out, and the Pi's internal voltage regulator may be dropping the 3.3V rail, leading to SD card corruption.
By relying on physical PCB geometry and multimeter verification rather than faded ink, you eliminate the risk of catastrophic miswiring. Always document your custom wiring harnesses with heat-shrink labels at the connector end, ensuring the next person at the workbench doesn't have to guess.






