The diagram below show GPIO pinouts used on different models of the Raspberry Pi. The earlier revisions of the Raspberry Pi were 26-pin based while the newer models are 40-pin.
As well as supplying power (GND, 3.3V and 5V) all the GPIO pins can be used as either digital inputs or outputs. The pins labelled SCL and SDA can be used for I2C. The pins labelled MOSI, MISO and SCKL can be used to connect to high speed SPI devices.
All the pins have 3.3V logic levels and are not 5V-safe so the output levels are 0-3.3V and the inputs should not be higher than 3.3V. If you want to connect a 5V output to a Pi input, use a level shifter
A popular way to actually make the connections to the Raspberry Pi is to use a Pi Cobbler Plus or a Pi T-Cobbler Breakout for older 26-pin versions.
This uses a ribbon cable to connect the GPIO connector to solderless breadboard, where you can add your own components.
Text editor powered by tinymce.