Authorized Online Retailers:
The Raspberry Pi is a credit card-sized minicomputer with a pre-installed Linux system. As for ports, the Raspberry Pi provides ports for mouse and keyboard. In addition, there are also ports for SD card and HDMI display or TV’s connection. Being low cost and low consumption, the Raspberry Pi is very suitable to do very complicated embedded projects through its powerful GPIO pins.
GPIO (General-purpose input/output) are hardware pins rows which locate in the top of RPi board. Raspberry Pi use GPIO pins to interact with other hardware including sensors, motors, and many many other peripheral devices.
Through this kit, you will learn how to use the GPIOs to make simple experiments and how to program GPIO.
The Raspberry Pi evolves through many versions including the latest (so far) Raspberry Pi Zero W, Pi 3 Model B, Pi 2 model B, Pi 1 Model B+, Pi Zero, and Pi 1 Model A+. Different version might different GPIO layout.
In this tutorial, our default Pi board is Raspberry Pi 3 Model B which supports Bluetooth and Wi-Fi. You can choose according to actual needs. The following is a photo for RPI3 Model B and Pi Zero:
GPIO Pin Name System BCM/Wiringpi and their relation with physical pin location:
There are no pins printed on the latest Raspberry Pi, which may cause difficulties for beginners.
To make thing worse, there are actually two major GPIO naming systems: BCM
which is often used in python language, and wiringPi
which is often used in C language. Same physical pin with different number has confused many novice learners. So let's start to figure it out.
1)The relation between Raspberry Pi official GPIO and physical location:
In following graph, the number in the circle is the physical pin location , the word beside the pin is the official
name of the GPIO pin. For example, The Official name of the pin in location 12 (in blue circle
of following picture) is "GPIO 18".
BCM Pin name system:
The Official name of a GPIO pin normally matches BCM pin number. For example, Physical Pin 12 (inside blue circle
of above picture) official name is GPIO 18 , in BCM system is pin# 18. If you use Python to program this pin, the sample code should be like following:
import RPi.GPIO as GPIO
LedPin = 18
wiringPi GPIO Naming system:
wiringPi library is often used in C programming. pin name/number in wiringPi is quite different from that of BCM(Raspberry official naming system).
For example, pin in physical location 12(in blue circle
of above picture) is called GPIO# 18
(or GPIO 18
) in BCM, however, in wiringPi, its name is GPIO. 1
or pin# 1
. If you use C to program this pin, the sample code should be like following:
#include < wiringPi.h>
#define LedPin 1
By running console command gpio readall
, you can get wiringPi name,number and its relations to BCM(GPIO official name) numbers as following:
Enlarged BCM pin map relation with Physical pin location No.
T Type 40-pin GPIO Extension Board
- GPIO are your standard pins that simply be used to turn devices on and off. For example, a LED.
- I2C (Inter-Integrated Circuit) pins allow you to connect and talk to hardware modules that support this protocol (I2C Protocol). This will typically take up 2 pins.
- SPI (Serial Peripheral Interface Bus) pins can be used to connect and talk to SPI devices. Pretty much the same as I2C but makes use of a different protocol.
- UART (Universal asynchronous receiver/transmitter) are the serial pins used to communicate with other devices.
- DNC stands for do not connect, this is pretty self-explanatory.
- The power pins pull power directly from the Raspberry Pi.
- GND are the pins you use to ground your devices. It doesn’t matter which pin you use as they are all connected to the same line.
The function of the extension board is to lead out pins of the Raspberry Pi to breadboard by GPIO Extension Board to avoid GPIO damage caused by frequent plugging in or out. For plugging convenience,the kit includes T-Shape GPIO Extension Board with 40 GPIO flat cable
This 40-pin GPIO Extension Board and GPIO cable can be plugged into Raspberry Pi 2 model B and 3 model B. as per following graph :
This 40-pin GPIO Extension Board and GPIO cable can be plugged into Raspberry Pi Zero and Zero W. as per following graph :
For your better understanding of every pins, we have drawn a table for you to understand relation between the Name printed in T board , BCM# and wiringPi#