Internet of Things: Raspberry PI GPIO
Introduction
The main difference between a Raspberry Pi (little computer) and other computers is the GPIO pins. In contrast to other computers, Raspberry Pi uses these GPIO pins to perform input and output.
The GPIO pins, the function of each pin on the Pi board, and GPIO numeration are presented in this chapter.
The GPIO pins, the function of each pin on the Pi board, and GPIO numeration are presented in this chapter.
Raspberry Pi GPIO
![](https://www.csharp.com/article/understanding-raspberry-pi-gpio/Images/image001.png)
Fig. 1
![](https://www.csharp.com/article/understanding-raspberry-pi-gpio/Images/image002.jpg)
Fig. 2
![](https://www.csharp.com/article/understanding-raspberry-pi-gpio/Images/image003.png)
Fig. 3
![](https://www.csharp.com/article/understanding-raspberry-pi-gpio/Images/image004.jpg)
Fig.4
GPIO numbering
As shown above, the GPIO pins diagram seems to be pretty complex and confusing and there is no easy way to remember each of the pins. You need to keep a printed reference sheet on top while using them.
There is a solution to this problem and in the Raspberry Pi world, there are two different numbering schemes used when referencing Pins.
- Using the BCM
- Physical numbering
Fig, 5Fig. 6
Note
You are free to use any of the above GPIO numbering systems while invoking the GPIO pins in programs ( like python or C # ). Your code should reference one of the numbering systems which you are going to use. Example: In a Python program – the code looks, as shown below.
GPIO.BOARD is the physical numbering system and GPIO.BCM is the Broadcom numbering system. Don’t worry if you don’t understand the above code. We will learn all about in future articles.
Important Warning
You have to be careful when connecting devices and the GPIO pins directly with wires (called jumper cables) -- if these wires are connected to the wrong pins, it might damage the Pi board, so please read the instructions carefully before connecting wires directly to the pins.
I would highly recommend, using a Breadboard – where you can create the dummy circuits on the breadboard and then connect only to the required pins on the Pi. I would also recommend using a “breakout circuit” to connect the Raspberry Pi with the breadboard. One end of the breakout board is connected to the Raspberry Pi and the other end into the breadboard.
![](https://www.csharp.com/article/understanding-raspberry-pi-gpio/Images/image007.png)
That’s all for this chapter. I hope you enjoyed reading!!
Author
Hussain Patel
602
1.8k
543.2k