-
Book Overview & Buying
-
Table Of Contents
Raspberry Pi for Python Programmers Cookbook - Second Edition
By :
There are many ways to wire up the Raspberry Pi and use the various interfaces to view and control content. For typical use, most users will require power, display (with audio), and a method of input such as keyboard and mouse. To access the Internet, refer to the Networking and connecting your Raspberry Pi to the Internet via the LAN connector or Using built-in Wi-Fi and Bluetooth on the Raspberry Pi recipes.
Before you can use your Raspberry Pi, you will need an SD card with an operating system installed or with the New Out Of Box System (NOOBS) on it, as discussed in the Using NOOBS to set up your Raspberry Pi SD card recipe.
The following section will detail the types of devices you can connect to the Raspberry Pi and, importantly, how and where to plug them in.
As you will discover later, once you have your Raspberry Pi set up, you may decide to connect remotely and use it through a network link, in which case you only need power and a network connection. Refer to the following sections: Connecting remotely to the Raspberry Pi over the network using VNC and Connecting remotely to the Raspberry Pi over the network using SSH (and X11 Forwarding).
The layout of the Raspberry Pi is shown in the following figure:

The Raspberry Pi connection layout (Model 3 B, Model A+, and Pi Zero)
The description of the preceding figure is as follows:
For best results, use a TV or monitor that has an HDMI connection, thus allowing the best resolution display (1080p) and also digital audio output. If your display has a DVI connection, you may be able to use an adapter to connect through the HDMI. There are several types of DVI connections; some support analogue (DVI-A), some digital (DVI-D), and some both (DVI-I). The Raspberry Pi is only able to provide a digital signal through the HDMI, so an HDMI-to-DVI-D adapter is recommended (shown with a tick mark in the following screenshot). This lacks the four extra analogue pins (shown with a cross mark in the following screenshot), thus allowing it to fit into both DVI-D and DVI-I type sockets:

HDMI-to-DVI connection (DVI-D adaptor)
If you wish to use an older monitor (with a VGA connection), an additional HDMI-to-VGA converter is required. The Raspberry Pi also supports a rudimentary VGA adaptor (VGA Gert666 Adaptor), which is driven directly off of the GPIO pins. However, this does use up all but 4 pins of the 40-pin header (older 26-pin models will not support the VGA output).
An alternative display method is to use the analogue composite video connection (via the phono socket); this can also be attached to an S-Video or European SCART adapter. However, the analogue video output has a maximum resolution of 640 x 480 pixels, so it is not ideal for general use.

3.5mm phono analogue connections
Direct Display DSI
A touch display produced by the Raspberry Pi Foundation will connect directly into the DSI socket. This can be connected and used at the same time as the HDMI or analogue video output to create a dual display setup.
amixer or alsamixer.To find out more information about a particular command in the terminal, you can use the following man command before the terminal reads the manual (most commands should have one):
man amixer
Some commands also support the --help option for more concise help, shown as follows:
amixer --help
The Raspberry Pi should work with most USB keyboards and mice available. You can also use wireless mice and keyboards, which use RF Dongles. However, additional configuration is required for items that use the Bluetooth dongles.
If there is a lack of power supplied by your power supply or the devices are drawing too much current, you may experience the keyboard keys appearing to stick, and in severe cases, corruption of the SD card.
USB power can be more of an issue with the early Model B revision 1 boards that were available prior to October 2012. They included additional Polyfuses on the USB output and tripped if an excess of 140 mA was drawn. The Polyfuses can take several hours or days to recover completely, thus causing unpredictable behavior to remain even when the power is improved.
You can identify a revision 1 board as it lacks the four mounting holes that are present the later models.
Debian Linux (upon which Raspbian is based) supports many common USB devices, such as flash storage drives, hard disk drives (external power may be required), cameras, printers, Bluetooth, and Wi-Fi adapters. Some devices will be detected automatically while others will require drivers to be installed.
You should aim to make all other connections to the Raspberry Pi before connecting the power. However, USB devices, audio, and network may be connected and removed while it is running without problems.
In addition to the standard primary connections you would expect to see on a computer, the Raspberry Pi also has a number of other connections.
Each of the following connections provides additional interfaces for the Raspberry Pi:
Change the font size
Change margin width
Change background colour