General Purpose Input Output (GPIO)
Resources:
- eLinux.org RPi Low-level peripherals
Notes:
- GPIO pins are 3.3 volt logic levels and are not tolerant of 5V levels
- GPIO properties can be set as a block (GPIO pins 0-27 are in the same block) not per pin.
- Can interrupt based on high/low/rise/fall/change.
- Input hysteresis (Schmitt trigger) can be on or off,
- Output slew rate can be fast or limited, and
- Source and sink currents are configurable from 2 mA up to 16 mA.
Color Legend
Color Legend |
---|
3.3 VDC Power | Serial Console/Power |
5 VDC Power | HX711 Scale |
Ground | I2C Sensors |
Unused | I2S Audio |
The first 26 pins on J8 (A+ and B+ models) are the same as H1 on the A and B models.
Hivetool use |
---|
Reserved for I2C Sensors |
Reserved for I2C Sensors |
Reserved for I2C Sensors |
Unused |
Reserved for I2C Sensors |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Reserved I2S |
Unused |
Unused |
|
Raspberry Pi |
---|
3.3 VDC Power |
GPIO 2 I2C |
GPIO 3 I2C |
GPIO 4 |
Ground |
GPIO 17 |
GPIO 27 |
GPIO 22 |
3.3 VDC Power |
GPIO 10 SPIO MOSI |
GPIO 9 SPIO MISO |
GPIO 11 SPIO SCLK |
Ground |
I2C EEPROM ID_SD |
GPIO 5 |
GPIO 6 |
GPIO 13 |
GPIO 19 PCM_FS |
GPIO 26 |
Ground |
|
J8 |
---|
1 | 2 |
3 | 4 |
5 | 6 |
7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 |
31 | 32 |
33 | 34 |
35 | 36 |
37 | 38 |
39 | 40 |
|
Raspberry Pi |
---|
5 VDC Power |
5 VDC Power |
Ground |
GPIO 14 TXDO |
GPIO 15 RXDO |
GPIO 18 PCM_CLK |
Ground |
GPIO 23 |
GPIO 24 |
Ground |
GPIO 25 |
GPIO 8 |
GPIO 7 |
I2C EEPROM ID_SC |
Ground |
GPIO 12 PWM |
Ground |
GPIO 16 |
GPIO 20 PCM_DIN |
GPIO 21 PCM DOUT |
|
Hivetool use |
---|
Reserved Power HX711 |
Reserved Power |
Reserved Ground |
Reserved serial console |
Reserved serial console |
Reserved I2S |
Unused |
Reserved HX711 |
Reserved HX711 |
Reserved HX711 |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Unused |
Reserved I2S |
Reserved I2S |
|
H5 is only on the A and B models. GPIO 28-31 are not available on the + models. These signals should probably not be used.
Hivetool |
---|
Unused |
Unused |
Unused |
Unused |
|
R Pi |
---|
5 VDC Power |
GPIO 28 |
GPIO 30 |
Ground |
|
|
R Pi |
---|
3.3 VDC Power |
GPIO 29 |
GPIO 31 |
Ground |
|
Hivetool |
---|
Unused |
Unused |
Unused |
Unused |
|
GPIO ordered by Signal Name
Signal | Alt Function | J8 | H1 | H5 |
---|
3.3 VDC Power | | 1 | 1 | 3 |
3.3 VDC Power | | 17 | 17 | |
5 VDC Power | | 2 | 2 | 1 |
5 VDC Power | | 4 | 4 | |
GPIO 2 | I2C | 3 | 3 | |
GPIO 3 | I2C | 5 | 5 | |
GPIO 4 | | 7 | 7 | |
GPIO 5 | | 29 | | |
GPIO 6 | | 31 | | |
GPIO 7 | SPIO CE1 | 26 | 26 | |
GPIO 8 | SPIO CE0 | 24 | 24 | |
GPIO 9 | SPIO MISO | 21 | 21 | |
GPIO 10 | SPIO MOSI | 19 | 19 | |
GPIO 11 | SPIO SCLK | 23 | 23 | |
GPIO 12 | PWM | 32 | | |
GPIO 13 | | 33 | | |
GPIO 14 | TXD | 8 | 8 | |
GPIO 15 | RXD | 10 | 10 | |
GPIO 16 | | 36 | | |
GPIO 17 | | 11 | 11 | |
GPIO 18 | PCM_CLK | 12 | 12 | |
GPIO 19 | PCM_FS | 35 | | |
GPIO 20 | PCM_DIN | 38 | | |
GPIO 21 | PCM DOUT | 40 | | |
GPIO 22 | | 15 | 15 | |
GPIO 23 | | 16 | 16 | |
GPIO 24 | | 18 | 18 | |
GPIO 25 | | 22 | 22 | |
GPIO 26 | | 37 | | |
GPIO 27 | | 13 | 13 | |
GPIO 28 | I2C0_SDA | | | 3 |
GPIO 29 | I2C0_SCL | | | 4 |
GPIO 30 | | | | 5 |
GPIO 31 | | | | 6 |
I2C EEPROM ID_SD | | 27 | | |
I2C EEPROM ID_SC | | 28 | | |
Ground | | 6 | 6 | 7 |
Ground | | 9 | 9 | 8 |
Ground | | 14 | 14 | |
Ground | | 20 | 20 | |
Ground | | 25 | 25 | |
Ground | | 30 | | |
Ground | | 34 | | |
Ground | | 39 | | |