Skip to Main Content
Raspberry Pi Cookbook, 2nd Edition
book

Raspberry Pi Cookbook, 2nd Edition

by Simon Monk
June 2016
Beginner to intermediate content levelBeginner to intermediate
508 pages
9h 40m
English
O'Reilly Media, Inc.
Content preview from Raspberry Pi Cookbook, 2nd Edition

Chapter 9. Hardware Basics

9.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 allows you to connect all sorts of interesting electronics to your Raspberry Pi.

9.1 Finding Your Way Around the GPIO Connector

Note

Be sure to check out the accompanying video for this recipe at http://razzpisampler.oreilly.com.

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 actually been three versions of the Raspberry Pi GPIO connector. Two 26-pin layouts for the original Raspberry Pi and one 40-pin layout that came in with the Raspberry Pi “+” models. 

Figure 9-1 shows the GPIO pinout for revisions 1 and 2 of the original Raspberry Pi Model B. The quick way to distinguish the boards is knowing that if you have one of the very first revision 1 boards, it has a black audio socket. The revision 2 boards have a blue audio socket.

rpck 0801
Figure 9-1. The GPIO pinout (26-pin models)

There were three changes to the GPIO connector between revision 1 and revision 2. These are highlighted in Figure 9-1. First, the I2C port was swapped. The two pins SDA and SCL are still SDA and SCL but use a different internal I2C interface. This means that if you’re using the pins as GPIO rather than I2C, then you will ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Raspberry Pi Cookbook, 3rd Edition

Raspberry Pi Cookbook, 3rd Edition

Simon Monk

Publisher Resources

ISBN: 9781491939093Errata Page