The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1
Chapter 6 Physical computing with Scratch and Python 121

THE OFFICIAL RASPBERRY PI BEGINNER’S GUIDE


Introducing the GPIO header
Found at the top edge of the Raspberry Pi circuit board and looking like two long rows of
metal pins, the GPIO header is how you can connect hardware like light-emitting diodes (LEDs)
and switches to the Pi for control under programs you create. The name might sound a little
confusing, but it describes the component well: its pins can be used for both input and output,
they have no fixed purpose, and when rows of pins are exposed on a circuit board like this
they’re known as a header. Thus: ‘general-purpose input/output header’.


14 15 18
2 3 4 17 27 22 5 6 13 19 26

23 24 25 8 7
10 9 11

12 16 20 21

Raspberry Pi pin numbers (3B+, 3B, 2B, Zero, A+, B+)
GPIO Ground 3V3 5V ID EEPROMAdvanced use only

The Raspberry Pi GPIO header is made up of 40 male pins. Some pins are available for you
to use in your physical computing projects, some pins provide power, while other pins are
reserved for communicating with add-on hardware like the Sense HAT (see Chapter 7).
There are several categories of pin types, each of which has a particular function:


A permanently-on source of 3.3 V
power, the same voltage the
Raspberry Pi runs at internally

A permanently-on source of
5 V power, the same voltage as
the Raspberry Pi takes in at the
micro USB power connector

A ground connection, used to
complete a circuit connected to
power source

The GPIO pins available for your
programs, identified by a number
from 2 to 27

Pins reserved for use with
Hardware Attached on Top (HAT)
and other accessories

3V3 3.3 volts power

5V

Ground (GND)

5 volts power

0 volts ground

GPIO XX

ID EEPROM

Reserved special-
purpose pins

General-purpose
input/output pin
number ‘XX’
Free download pdf