Here is the complete pinout for the Raspberry Pi five, but it's also the same as for the Raspberry
Pi four, three and two.
The Gpios haven't changed with the latest evolution of the board, so as you can see we have some pins
in black which represent the ground.
We've already used one.
All those pins are connected together.
Then we have what we call power pins.
So we have two pins for 3.3V in yellow and two pins for five volts in red.
Then we have the Gpio in orange.
So again Gpio means general purpose input output.
And each Gpio has a number.
That's the number you will use in your Python code to interact with that Gpio.
And a quick reminder here is that Gpio supports 3.3V, not five volt.
We only have two pins here that support five volt.
So now how are Gpios controlled?
Well, it's pretty simple.
A Gpio will be set as either an input pin or an output pin.
Input will be used when you want to read some data.
For example, with a push button you want to read, the state of the button and output will be used
when you want to write some data.
For example, you want to set an LED, so you want to turn on or off an LED.
So once the mode for the Gpio is set, you can use it.
If it is set as an input, you can read a value.
The value has only two states high and low.
So this is a binary state.
And high and low here correspond to the voltage which was read from the pin.
If the voltage is high enough and close to 3.3V, then the value will be high, otherwise it will be
low.
And if you have set the Gpio as output, you can then write a value to it.
And it's also going to be high or low for an LED.
If you want to turn on the LED, the Gpio state will be high, so close to 3.3V.
And if you want to turn off the LED, the Gpio state will be set as low so close to zero volts.
And that's basically how a Gpio works.
Okay.
It's not that complicated.
And in the code we will use a Python library that takes care of all that for you.
So basically we won't have to deal directly with this.
And you can just then focus on your application.
But with what you've seen here in those few minutes, at least you understand the basics of how it works
under the hood.
Now, if we come back to the Raspberry Pi pinout image, you can see that the Gpios are not set in any
specific order and some numbers are missing.
And that's totally okay.
And it's nothing to worry about.
You just have to be extra careful when finding the Gpio number corresponding to the Pin number.
Okay, so you can see the pin number.
We have numbers from one until 40.
So those are the gray pins and they are ordered.
But we are not going to use those numbers.
We are going to use the Gpio numbers directly.
And then what else do we have.
You can see that we also have two reserved pins in gray.
So you should not use those.
Then we have two pins in green that are used for Uart communication.
You also have alternate functions with I to C and SPI communications.
So all those are more advanced communications.
And in this course we are just going to focus on the Gpio.
But if you want to learn more about those communications that can be a nice thing to research after
this course.
All right.
And now that you have an overview of how Gpio work, let's actually use one to power on our first LED.