A short introduction to the GPIO pins of the Raspberry Pi

A Short Introduction to the GPIO pins of the Raspberry Pi
Published: by
Last updated:
Raspberry Pi

The Raspberry Pi is equipped with a set of input/output or GPIO (general-purpose input/output) pins. This powerful feature significantly expands the Raspberry Pi’s abilities to communicate with other devices. These pins are connected directly to the CPU of the Raspberry Pi.

This is an ongoing post. Please suggest corrections, explanations, etc. in the comment section at the bottom of this page.

The newer Raspberry Model B, including the Raspberry Pi 2 & 3 have a total of 40 GOI pins, while the older Model A-boards have a total of 26 pins. The Raspberry Pi Zero and Raspberry Pi Zero W have 40 unpopulated/headerless pins (holes). Pins are aligned as two equal rows (i.e. 2x 20 or 2x 13).

The pins include 5V (2), 3.3V (2), ground (5 for A & 8 for B) and a few other pins mentioned below. Apart from sensing high and low signals, some of the GPIO pins also doubles for other functions.

Through, for example, Linux Bash and Python programming, complex logic to and from these pins can be programmed to interact with various microelectronic components such as LEDs, switches, buttons, communication and display modules. The networking capabilities and the control of various USB devices makes the possibilities almost endless.

Raspberry Pi GPIO specifications

Model B

Operating voltage (logic level): 3.3V DC
Input voltage: 5V DC
Power source: 5V via Micro-B or GPIO I/O pins
Digital I/O (read/write) pins: 22
Interrupt pins: all
Analog input pins:
Operating current (per I/O pin): ~8 mA (15 mA max) (50 mA max all)
Interfaces: Serial/UART (GPIO 14 & 15), SPI, I2C
Breadboard friendly: na
Pin size: male, 5 x 2.54 mm

Raspberry Pi model B GPIO pinout

Raspberry Pi GPIO Layout Model B Plus
Example of a Raspberry Pi Model B GPIO pinout. This pinout is commonly used when for e.g. using the Wiring Pi Python library. Other libraries might use a different pinout. Image from RaspberryPi-Spy.co.uk

Output pins

A GPIO pin designated as an output pin can be set to HIGH (3.3V) or LOW (0V).

Input pins

A GPIO pin designated as an input pin can be read as HIGH (3.3V) or LOW (0V). This is made easier with the use of internal pull-up or pull-down resistors. Pins GPIO2 and GPIO3 have fixed pull-up resistors, but for other pins this can be configured in software.

Interrupt pins

On the Raspberry Pi, each GPIO pin can also be configured as an interrupt pin.

Serial pins

The Raspberry Pi is capable of serial communication with other devices. Tx (GPIO14) and Rx (GPIO15) pins use 0 and 3.3 V TTL (transistor-transistor logic) to produce its signal.

Raspberry Pi GPIO libraries

There are currently a couple of libraries available to be able to utilise the GPIO pins of the Raspberry Pi. GPIO Zero (which is included by default in the Raspbian image) and Wiring Pi are fairly comprehensive. Other, less developed libraries include RPi.GPIO, pi-gpio and raspberry-gpio-python.

About the author
Renier busies himself with improving his English writing, creative web design and his websites, photoshopping, micro-electronics, multiple genres of music, superhero movies and badass series.
Behind the Scenes is a free, informative website. If you find value in any of our content, please consider making a donation to our cause.
Donate via PayPal

Save, share & discuss

Your comment is important, but don't be a knob. Keep it constructive and polite.

Leave a Reply

Your email address will not be published. Required fields are marked *

More Raspberry Pi and microelectronic related posts