A Tour of Raspberry Pi Peripheral Devices
I got my start learning about electricity and electronics not through school but by horsing around with a Science Fair 160-in-1 electronics project kit my parents bought for me from Radio Shack for my tenth birthday.
As you can see in Figure 3.1, this wooden-framed kit enabled kids like me to prototype electrical circuits without having to solder any components together. The various “doo dads” on the kit’s circuit board kept me engaged and entertained for many, many hours.
FIGURE 3.1 I learned electronics by studying (playing?) with this Radio Shack project kit.
Fast-forward to the twenty-first century—now we have the Raspberry Pi, a $35 personal computer the size of a credit card! In this chapter, I’d like to pique your curiosity by sharing with you the most popular peripheral devices—which is to say, electronic equipment that is connected to the Pi by means of a cable instead of soldered directly to the board—that exist in today’s marketplace.
If you want to really dig into physical computing and circuit building, you will indeed need to take an iron and braid in hand and learn to solder. I have you covered, though: You learn about all of the most popular starter kits and technician tools at the end of this chapter.
Circuit Prototyping Equipment
In electronics, prototyping refers to mocking up an idea in a way that the circuit can easily be rebuilt. To that end, the breadboard is by far one of the most useful tools you can have in your possession.
A breadboard is a plastic block that is perforated with small holes that are connected internally by tin, bronze, or nickel alloy spring clips. Take a look at Figure 3.2 as a reference while I explain how these devices work.
FIGURE 3.2 Anatomy and physiology of a breadboard. A terminal strip is labeled 1, the bridge is labeled 2, and a bus strip is labeled 3.
First of all, see the empty area that runs down the center line of the breadboard? This region is called the bridge. It’s a physical barrier that prevents current on one side from interacting with current on the other side. Thus, the breadboard is bilaterally symmetric, which is a fancy way of saying it consists of two mirror image halves that represent two separate circuits.
When you mount integrated circuit chips that use the dual inline package (DIP) format on a breadboard, be careful to align the opposing sets of pins on opposite sides of the bridge to prevent circuit overflow.
If you are wondering what a DIP looks like, whip out your Raspberry Pi board and look below the GPIO header: the voltage regulators labeled RG1, RG2, and RG3 are DIPs.
The horizontally numbered rows of perforations represent the breadboard’s terminal strips. Any wires that you connect in a single row share a single electrical circuit. Breadboards come in several different sizes, and each has its own number of terminal strips.
For instance, full-sized breadboards typically include 56 to 65 connector rows, while smaller breadboards normally have 30 rows.
Finally, there are the horizontally aligned perforations that line the outer edges of the breadboard. These are called bus strips, and they constitute “power rails” for your prototype circuits. One connector column represents supply voltage (positive), and the other represents ground (negative).
In sum, the breadboard is the perfect platform for prototyping electrical circuits because you don’t need to solder anything. Instead, you can simply “plug and play” with ICs, resistors, lead wires, buttons, and other components.
Of course, all of this background information on breadboarding suggests the question, “Why would I, a Raspberry Pi owner, want to prototype anything?”
Great question! Here’s the deal: If you want to use your Raspberry Pi to interact with the outside world, whether that interaction is controlling a robot, snapping pictures from 30,000 ft in the air, or creating a solar-powered weather station, you’ll need to learn how to use prototyping hardware such as breadboards, resistors, jumpers, and the like.
On the Raspberry Pi, the 26 General Purpose Input/Output (GPIO) pins are used to “break out” the Pi onto a breadboard. You can do this by using two different types of cable:
- Ribbon cable: This flat cable connects to all the GPIO pins simultaneously
- Jumper wire: This wire connects a single GPIO pin to a terminal on the breadboard. Jumper wires are also called straps, and you’ll use several of them when we use the Gertboard expansion board in Chapter 20, “Raspberry Pi and the Gertboard.”
A ribbon cable and jumper wires are shown in Figure 3.3.
FIGURE 3.3 Ribbon cable at left and female-to-female jumper wires at right.
Breakout boards provide an excellent and convenient way to connect your Raspberry Pi to a solderless breadboard. I recommend the Pi Cobbler kit, sold by Adafruit Industries (http://is.gd/b4LlQ7).
As you can see in Figure 3.4, you mount the Pi Cobbler board across the breadboard bridge (do you like my alliteration?). The ribbon cable connects from the Cobbler to the Pi’s GPIO header on the other side of the connection.
FIGURE 3.4 The Pi Cobbler is a quick and easy way to expand your Raspberry Pi to a breadboard.
Once you’ve broken out your Pi to the breadboard, you have the proverbial world available to you. In point of fact, the latter part of this book walks you through some real-world projects that take advantage of the Raspberry Pi-breadboard connection.