General Raspberry Pi I/O pin explanation

From Sim Innovations Wiki
Jump to navigation Jump to search

All Raspberry Pi models have a number pins which can be used as I/O pins. Not all pins are I/O pins, some of them have a supply voltage (3V3 and 5V0), some of them are ground (GND).

The pin header comes in two versions:

B  version: The old Raspberry Pi 1 B, isn't sold anymore, had a total of 26 pins.
B+ version: The B+ pin model was introduced with the Raspberry Pi 1 B+, all later Raspberry Pi's (2 and 3) have the same B+ pin model, which has a total of 40 pins. If you buy a new Raspberry Pi nowadays it will always be a B+ model, most likely a Raspberry Pi 3 (latest model).
B and B+ model

Pay attention to the pin numbering. The odd numbers are on the left (1, 3, 5, etc...) and the even numbers are on the right (2, 4, 6, etc...).

Raspberry Pi I/O overview

Power pins

The power pins provide a certain voltage and amperage, we will use milliamps in our descriptions. For example 50 milliamps is equal to 0.05 amp. To give you an idea, a standard LED uses about 20 mA.

Raspberry Pi B

3V3 - Pin 1 and 17 This means 3.3 volt. The 3V3 pins can be used power low energy consuming parts, like a couple of LED's. Never use more than 50 mA, so for example no more than 2 LED's.

5V0 - Pin 2 and 4 This means 5.0 volt. The 5V0 pins can be used to power more energy consuming parts, like more LED's, a small motor, a servo, etc... The 5V0 pins can provide more, but this depends on the power consumption of the Pi itself, the number of USB devices that are attached and how much your mini-USB power supply can provide. Think about approximately 500 mA maximum.

GND - Pin 6, 9, 14, 20 and 25 The GND pins are ground pins. When you connect a power consuming device, you connect it between either 3V3 and GND or 5V0 and GND.

Raspberry Pi B+ (1, 2 and 3 models)

3V3 - Pin 1 and 17 This means 3.3 volt. The 3V3 pins can be used power low energy consuming parts, like a couple of LED's. Never use more than 50 mA, so for example no more than 2 LED's.

5V0 - Pin 2 and 4 This means 5.0 volt. The 5V0 pins can be used to power more energy consuming parts, like more LED's, a small motor, a servo, etc... The 5V0 pins can provide more, but this depends on the power consumption of the Pi itself, the number of USB devices that are attached and how much your mini-USB power supply can provide. Think about approximately 500 mA maximum.

GND - Pin 6, 9, 14, 20, 25, 30, 34 and 39 The GND pins are ground pins. When you connect a power consuming device, you connect it between either 3V3 and GND or 5V0 and GND.

I/O pins

The Raspberry Pi B models have 17 I/O pins, and the Raspberry Pi B+ models have 26 I/O pins. The I/O pins are also called GPIO pins. The DNC pins on the B+ model (27 and 28) cannot be used. The list of usable I/O pins can be found here: Hardware_id_list

Let's say you want to connect a button to GPIO22, which is pin 15. This pin 15 corresponds to following hardware ID's for the different models:

Raspberry Pi 1      : RPI_V1_P1_15
Raspberry Pi 1 B+   : RPI_V1B+_GPIO_J8_15 
Raspberry Pi 2 and 3: RPI_V2_P1_15

Note that it is not the the GPIO number which you have to use as the hardware ID, it is the pin number.