One of the most significant changes to the Raspberry Pi Model B+ is the 40-pin header (J8). This offers and increase of 14 pins over the 26-pin header on the original Raspberry Pi.
This page aims to provide a set of information that should prove useful to anyone interfacing to these pins in their projects. It also includes a link to a printable PDF worksheet that is useful for making notes as you connect items to your header.
Diagram
Here is a diagram showing all 40-pins :
Additional GPIO
The B+ offers 9 extra GPIO pins which can be configured as inputs of outputs. This brings the total number to 26 (17+9).
Ground Pins
The extended header offers an additional 3 ground pins. So that’s a total of 8.
Worksheet
Referring to information on a webpage is great but when you are hardware interfacing it is still useful to be able to scribble on a piece of paper. I’ve created a printable Model B GPIO worksheet so that you can draw and write on the diagram as you build your projects.
It makes it much easier to remember what wires, sensors and components you’ve got connected to each pin.
14 Comments
Can I reuse your GPIO diagramme (with source) to complete our documentation page available here?
http://mchobby.be/wiki/index.php?title=Rasp-Hack-GPIO_Connecteur#Les_broches_27_.C3.A0_40
Hello, yes that is OK!
Hello!
Thank you very much for this good diagram.
Perhaps you could add a hint how to find Pin1 on Model B+? It isn’t marked there like it was on the previous model, as far as I can see.
I now located it by comparing it to the previous Model and also http://mchobby.be/wiki/index.php?title=Rasp-Hack-GPIO_Connecteur#Les_broches_27_.C3.A0_40 helped, however a simple picture or drawing would surely ease finding it.
Thanks again.
Christian
Hi Christian, if you look on the reverse of the PCB Pin 1 has a square pad and the others have round pads.
Thank you very much for that hint. (-:
En el pinout de la raspbeery pi b+ (27 y 28) se puede colocar un microcontrolador para que pueda leer la eeprom sd o los puertos usb?
I’m trying to address the GPIO in board mode:
GPIO.setmode(GPIO.BOARD)
I can't seem to figure out how to address the ports in that mode. I've tried referring to them as they are on the diagram e.g. GPIO4 or P4 or even just "4" and I get errors every time. Any suggestions?
Thanks!
BOARD mode means you refer to pins with the pin numbers rather than references. So GPIO4 is Pin 7. In BOARD mode using 4 will be referring to pin 4 which is a 5V power pin.
Could you post one for the pi zero please.
The header on the Pi Zero is the same as on the A+,B+,Pi 2 and Pi 3.
What do the colours mean? It is clear that Red is 5V, Orange is 3V3, and White is Ground. Put why are GPIO Blue, Green, Purple, and Violet
The colours represent groups of pins that can perform special functions. Blue is the SPI interface, Green are general GPIO, purple is the serial interface and violet is the I2C interface.
This pinout doesn’t match my Raspberry Pi 3B. Below is the gpio output from my Pi. Do you know why:
pi@remotepower:~ $ gpio readall
[removed output]
My diagram is correct. For example if we take physical pin 37 the “gpio” utility labels this as “GPIO.25” when it IS GPIO26. This is probably because of some obscure technical reason which no one cares about. Pin 37 is GPIO26. In the “gpio readall” output the “BCM” column is correct when talking about “GPIO” references. I would ignore the “GPIO.” text in the “Name” column as it won’t help at all.
A better tool to use on the command line is the official “pinout” command. This will agree with my diagram.