GPIO - Raspberry Pi Documentation
GPIO - Raspberry Pi Documentation
GPIO
Any of the GPIO pins can be designated (in software) as an input or output pin and
used for a wide range of purposes.
Note: the numbering of the GPIO pins is not in numerical order; GPIO pins 0 and 1
are present on the board (physical pins 27 and 28) but are reserved for advanced
use (see below).
/
Voltages
Two 5V pins and two 3V3 pins are present on the board, as well as a number of
ground pins (0V), which are uncon gurable. The remaining pins are all general
purpose 3V3 pins, meaning outputs are set to 3V3 and inputs are 3V3-tolerant.
Outputs
A GPIO pin designated as an output pin can be set to high (3V3) or low (0V).
Inputs
A GPIO pin designated as an input pin can be read as high (3V3) or low (0V). This is
made easier with the use of internal pull-up or pull-down resistors. Pins GPIO2 and
GPIO3 have xed pull-up resistors, but for other pins this can be con gured in
software.
More
As well as simple input and output devices, the GPIO pins can be used with a
variety of alternative functions, some are available on all pins, others on speci c
pins.
GPIO pinout
It's important to be aware of which pin is which. Some people use pin labels (like
the RasPiO Portsplus PCB, or the printable Raspberry Leaf).
/
A handy reference can be accessed on the Raspberry Pi by opening a terminal
window and running the command pinout . This tool is provided by the GPIO
Zero Python library, which it is installed by default on the Raspbian desktop image,
but not on Raspbian Lite.
/
For more details on the advanced capabilities of the GPIO pins see gadgetoid's
interactive pinout diagram.
/
Warning: while connecting up simple components to the GPIO pins is perfectly
safe, it's important to be careful how you wire things up. LEDs should have
resistors to limit the current passing through them. Do not use 5V for 3V3
components. Do not connect motors directly to the GPIO pins, instead use an H-
bridge circuit or a motor controller board.
ABOUT US SUPPORT
About us Help
Our team Documentation
Governance Projects
Safeguarding Training
Our supporters Downloads
Jobs Research
Contact us FAQ
SUBSCRIBE
RASPBERRY PI FOUNDATION
UK REGISTERED CHARITY 1129409