Chapter 15

The GPIO Port

THE RASPBERRY PI’S general-purpose input-output (GPIO) port is located on the top-left of the printed circuit board, labelled P1. The port is fitted with two rows of 13 male 2.54mm headers at the factory, or two rows of 20 in the case of the Raspberry Pi Model B+. The spacing of these headers is particularly important: 2.54mm pin spacing (0.1 inches in imperial measurements) is a very common sight in electronics and is the standard spacing for prototyping platforms that include stripboards and breadboards.

Identifying Your Board Revision

The pin layout of the Raspberry Pi’s GPIO port differs depending on what revision of the board you own. All Model As and recent Model Bs have a common pin layout; the original Model B, however, has a slightly different layout, while the latest Model B+ has an elongated 40-pin GPIO port.

Before using the GPIO port for a hardware project, be sure you know which model of Raspberry Pi you have. If you have a Model A, you can use the first diagram in this chapter; if you have a Model B, you should also use the first diagram—unless it’s an original Revision 1 model.

The easiest way to spot a Model B Revision 1 board is to look at the top side of the board, just underneath the GPIO pins themselves. Where a Revision 2 board has two rows of four copper-plated holes, the Revision 1 is solid. This is the P5 header, which is used by some add-on boards—note that this is missing from the original Revision 1 board and also from the ...

Get Raspberry Pi User Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.