Skip to content

Pin Information

Bryan Hughes edited this page Jul 7, 2016 · 10 revisions

The pins on the Raspberry Pi are a little complicated. There are multiple headers on some Raspberry Pis with extra pins, and the pin numbers are not consistent between Raspberry Pi board versions.

To help make it easier, you can specify pins in three ways. The first is to specify the pin by function, e.g. 'GPIO18'. The second way is to specify by pin number, which is specified in the form "P

-", e.g. 'P1-7'. The final way is specify the Wiring Pi virtual pin number, e.g. 7. If you specify a number instead of a string, it is assumed to be a Wiring Pi number.

Here is a table of the pin mappings on all of the support Raspberry Pi boards.

Model B Rev 1

P1 Header

Physical Pin Wiring Pi Pin Peripherals Peripherals Wiring Pi Pin Physical Pin
P1-1 3.3V 5V P1-2
P1-3 SDA0 5V P1-4
P1-5 SCL0 GND P1-6
P1-7 7 GPIO4 GPIO14/TXD0 15 P1-8
P1-9 GND GPIO15/RXD0 16 P1-10
P1-11 0 GPIO17 GPIO18/PWM0 1 P1-12
P1-13 2 GPIO21 GND P1-14
P1-15 3 GPIO22 GPIO23 4 P1-16
P1-17 3.3V GPIO24 5 P1-18
P1-19 12 GPIO10/MOSI0 GND P1-20
P1-21 13 GPIO9/MISO0 GPIO25 6 P1-22
P1-23 14 GPIO11/SCLK0 GPIO8/CE0 10 P1-24
P1-25 GND GPIO7 11 P1-26

Model B Rev 2

P1 Header

Physical Pin Wiring Pi Pin Peripherals Peripherals Wiring Pi Pin Physical Pin
P1-1 3.3V 5V P1-2
P1-3 SDA0 5V P1-4
P1-5 SCL0 GND P1-6
P1-7 7 GPIO4 GPIO14/TXD0 15 P1-8
P1-9 GND GPIO15/RXD0 16 P1-10
P1-11 0 GPIO17 GPIO18/PWM0 1 P1-12
P1-13 2 GPIO27 GND P1-14
P1-15 3 GPIO22 GPIO23 4 P1-16
P1-17 3.3V GPIO24 5 P1-18
P1-19 12 GPIO10/MOSI0 GND P1-20
P1-21 13 GPIO9/MISO0 GPIO25 6 P1-22
P1-23 14 GPIO11/SCLK0 GPIO8/CE0 10 P1-24
P1-25 GND GPIO7 11 P1-26

P5 Header

Physical Pin Wiring Pi Pin Peripherals Peripherals Wiring Pi Pin Physical Pin
P5-1 5V 3.3V P5-2
P5-3 17 GPIO28 GPIO29 18 P5-4
P5-5 19 GPIO30 GPIO31 20 P5-6
P5-7 GND GND P5-8

Model A+/B+/Raspberry Pi 2/Raspberry Pi 3/Raspberry Pi Zero

P1 Header

Physical Pin Wiring Pi Pin Peripherals Peripherals Wiring Pi Pin Physical Pin
P1-1 3.3V 5V P1-2
P1-3 SDA0 5V P1-4
P1-5 SCL0 GND P1-6
P1-7 7 GPIO4 GPIO14/TXD0 15 P1-8
P1-9 GND GPIO15/RXD0 16 P1-10
P1-11 0 GPIO17 GPIO18/PWM0 1 P1-12
P1-13 2 GPIO27 GND P1-14
P1-15 3 GPIO22 GPIO23 4 P1-16
P1-17 3.3V GPIO24 5 P1-18
P1-19 12 GPIO10/MOSI0 GND P1-20
P1-21 13 GPIO9/MISO0 GPIO25 6 P1-22
P1-23 14 GPIO11/SCLK0 GPIO8/CE0 10 P1-24
P1-25 GND GPIO7/CE1 11 P1-26
P1-27 ID_SD ID_SC P1-28
P1-29 21 GPIO5 GND P1-30
P1-31 22 GPIO6 GPIO12/PWM0 26 P1-32
P1-33 23 GPIO13/PWM1 GND P1-34
P1-35 24 GPIO19/MISO1/PWM1 GPIO16 27 P1-36
P1-37 25 GPIO26 GPIO20/MOSI1 28 P1-38
P1-39 GND GPIO21/SCLK1 29 P1-40
Clone this wiki locally