Chapter 10. Hardware Basics

10.0 Introduction

This chapter contains some basic recipes for setting up and using the Raspberry Pi’s general-purpose input/output (GPIO) connector. This connector enables you to connect all sorts of interesting electronics to your Raspberry Pi.

10.1 Finding Your Way Around the GPIO Connector

Problem

You need to connect electronics to the GPIO connector, but first you need to know more about what all the pins do.

Solution

There have been three versions of the Raspberry Pi GPIO connector: two 26-pin layouts for the original Raspberry Pi, and one 40-pin layout that was introduced with the Raspberry Pi “+” models and has been in use ever since.

A 26-pin Raspberry Pi is more of a vintage collectible than a practical computer, and you’ll likely find it slow and incompatible with a whole slew of software. So, for practical terms, you’ll probably need to get a Raspberry Pi 4 or 400, or at least a Pi 3.

Figure 10-1 shows the current 40-pin layout, which is the same for all 40-pin GPIO Raspberry Pi models right up to the Raspberry Pi 4 and 400.

The top 26 pins are the same as the 26 pins of the original Raspberry Pi model B revision 2. This allows the 40-pin Raspberry Pi models to use hardware and software designed for the earlier 26-pin Raspberry Pi designs. The extra pins of the 40-pin connector are made up of three useful extra GND connections and nine GPIO pins. The ID_SD and ID_SC pins are intended for use in communicating with a special ...

Get Raspberry Pi Cookbook, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.