EasyManua.ls Logo

Raspberry Pi B User Manual

Raspberry Pi B
2 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
Page #1 background imageLoading...
Page #1 background image
create.withcode.uk
Raspberry Pi Python GPIO Quick start guide
The GPIO pins on a Raspberry Pi allow you to connect your Pi up to all sorts of electronic devices. This guide talks you
through how to set up and control the inputs and outputs using python.
GPIO stands for General Purpose Input and Output.
GPIO pins are the metal spikes that stick out of a RPi.
Older RPis have 26 pins and newer ones have 40 pins.
Some of those pins are for power rather than inputs or
outputs
Pins:
Pins are either power points or I/O pins
Power pins are hard wired to 0v (ground), +3.3v or +5v. You cant change them.
I/O pins can be set to either an input or an output
Inputs read a digital value into the RPi (e.g. has a switch been pressed?)
Output send a digital value out from the RPI (e.g. switch an LED on or off)
Pin numbering:
There are two numbering systems for GPIO pins.
Physical numbering is the easiest to understand: it tells you where to find the pin on the physical RPi board
(see below)
BCM numbers are only for I/O pins. They dont match the physical numbers but come from the way that
they are connected to the processor on the RPi.
When writing your code you can choose to use either physical numbering or BCM numbering
Warning:
You might permanently break your RPi if youre not careful when connecting anything to the GPIO pins.
Short circuits (connecting +3v or +5 either from a power pin or an output pin directly to ground) will
damage your RPi
Whilst your GPIO pins have power pins, theres a limit to how much power they can provide. You may need
an external power supply if youre controlling a circuit that needs anything more than a few LEDs &
switches.
Never connect a motor or speaker directly to a GPIO pin. The electrical feedback can cause damage.
RPi
Model
Number
of GPIO
pins
Number of
inputs or
outputs
A
26
17
B
26
17
A+
40
28
B+
40
28
Pins 27-40 not available on older RPi models
Pin 1
Pin 2
Question and Answer IconNeed help?

Do you have a question about the Raspberry Pi B and is the answer not in the manual?

Raspberry Pi B Specifications

General IconGeneral
GPUBroadcom VideoCore IV
RAM512 MB
Audio Outputs3.5 mm jack, HDMI
GPIO26-pin header
Power5 V via Micro USB or GPIO header
ProcessorBroadcom BCM2835
CPU700 MHz ARM1176JZF-S core
USB Ports2
Video OutputsHDMI, Composite RCA (PAL and NTSC)
StorageSD card
Ethernet10/100 Mbit/s

Summary

Raspberry Pi GPIO Fundamentals

GPIO Pin Types and Functions

Details GPIO pins as power or I/O, explaining input and output capabilities.

GPIO Pin Numbering Conventions

Explains the physical and BCM numbering systems used for GPIO pins.

Critical GPIO Connection Safety

Provides essential warnings for connecting to GPIO pins to prevent RPi damage.

Controlling GPIO with Python

Importing the RPi.GPIO Module

Shows how to import the necessary RPi.GPIO library for Python control.

Configuring GPIO Pins

Explains setting pin numbering modes and configuring pins as inputs or outputs.

Reading and Writing GPIO States

Demonstrates Python code for reading digital inputs and setting digital outputs with timing.

Related product manuals