Our circuit now contains an LED and we are going to add a push button.
So I will show you step by step exactly what you need to do to add this push button.
And then in the next lesson we are going to control it with Python and the first thing.
So here you can see I'm still on the Raspberry Pi OS desktop.
Make sure first that you shut down the Raspberry Pi okay.
So shut it down and remove the power cable.
So here I'm back on my circuit.
I will first show you with this software and then with the real circuit.
We still have the LED here.
We're not going to touch anything about that.
But we have two new components here.
We have this push button and we also have a one kilo ohm resistor.
So that's the exact same model as we had for the LED.
And once again here, even if you see Raspberry Pi four on my software, it's the same for Raspberry
Pi five, Raspberry Pi three, etc..
Okay, so the push button, you will see that a push button has four legs.
But actually if I click here this leg on the left is connected to that one, and this leg on the right
is connected to that one.
So in the end you only have basically two connections.
Okay.
So this one is connected to that one and this one to that one.
What I will do is I will put my push button.
Usually what I do is so I'm going to go on the right here, and I put it in the middle like that.
So it's connected to both sides.
Just because if you put it here you see that, then you only have one possible dot to connect something
okay.
If I put it in the middle then I have additional dots okay.
I have more space basically.
So we're going to do it like this.
And now you can see that because of this connection here all the dots in this line are also connected
to all the dots in that line.
So in that column okay.
So this whole column does five and five dots here are connected together.
And the same for that side.
So the first thing I will do is connect the button to the ground.
And you can see we already have the ground.
So the ground is connected from the Raspberry Pi to this blue line here.
So I'm going to take this dot here and connect it to the ground.
And I'm just going to choose a black color.
So why is black here.
All right okay.
We use black for ground.
So then it's much easier not to make mistakes in the future.
And then this is where.
So you can see here I have a full.
So the line is fully connected.
This is where if you have a disconnection in the middle for example here.
So that only applies for those of you who have a long breadboard and it's disconnected in the middle.
Then the ground here is not going to be connected to that side.
So maybe in this case you might want to add an extra wire here if it was disconnected.
Okay I'm going to come back to this on the real circuit.
But if you have a fully connected breadboard like this, you don't need to worry about that.
And then so we have one side of the button connected to the ground.
And I'm going to just connect here.
I'm going to plug a resistor.
So wherever here on the other side.
So I can even put it here if I want.
Okay.
It's the same.
And then I will connect.
So basically I will connect this leg here on the right which is going through a resistor.
I will connect to a Gpio on the Raspberry Pi.
And that's going to be that one Gpio number 26.
And I chose this one okay.
Because it's quite easy to locate.
It's going to be also on the inside of the Raspberry Pi.
And you can see that the first one here, the first pin on the right is a ground.
So that's going to be the second to last pin.
So you're going to connect this one to to that part here.
So to that leg of the resistor I'm just going to make it nicer.
Okay.
So when I export the image for you I'm also going to make it nicer to look at.
And I'm going to change the color here because we don't want black.
And let's use blue for example, because I'm going to use the blue wire later.
But it can be any color you want.
All right.
And that's basically it for the push button.
So we have the ground to one side of the button.
Then on the other side we have this resistor which is basically just here to reduce the current.
That's more like a safety feature.
You might find some circuits online that don't even use the resistor okay.
They just connect the two legs of the push button directly to the Raspberry Pi.
Here I just add this resistor to reduce the current as an additional safety.
And then basically so you see one side is connected to the ground and the other side is connected to
a Gpio.
And now let's go to the real circuit.
So we are on the real circuit.
And as you can see.
So I have just shut down my Raspberry Pi.
I'm going to make sure to power it off.
And just to make it easier for you to see, I'm going to use the same orientation as in the software.
like this.
And then the first thing you might want to do, just in case you have a disconnection in the middle
here.
So I don't have a disconnection, but if you have then you might for example, put one.
You see, take one small black wire, male to male, and then you plug it just like that.
For example, if the disconnection is here, which means that the left part here is going to be connected
to the right part, and then everything is going to be connected to the ground.
Okay.
So that's just in case.
And now I'm going to remove that because I don't need it.
Now what do I have I have my push button.
I have my one kilo ohm resistor.
That's the same as the one we used for the LEDs.
So if you have a doubt about the value and how to pick the color, you can come back to previous videos.
And then I have a small black wire so male to male and I have a here a blue wire.
The color doesn't matter.
Just don't use red and don't use black.
And this one is a male to female.
So I'm going to take my push button and I'm going to connect it here.
While on the right.
Okay.
Just like this.
Between the two parts.
Okay.
Now I'm going to connect the ground.
So let's just take whatever dot here and connect to whatever dot on this blue line.
Okay.
I just make sure that I don't put the wire too close to the button, because what's going to happen
is we are actually going to push the button.
So we're going to need to touch the circuit.
And if you see you have the wire too close or the resistor too close, then you might touch it.
And it's better to avoid doing that.
So I'm just going to plug it here.
Okay.
So I have enough space then to push the button without touching anything.
So that's the left side of the button.
Now on the right side I could plug it here but I'm going to plug it here.
So make sure it's on the same color right.
I'm going to put a resistor and right here.
It doesn't matter where you put it.
Where you put the leg.
It just matters that it's a colon with no other components.
So just like this.
And then I will connect this side of the resistor.
So here for example to the second to last pin on the Raspberry Pi.
So from the bottom right which is that one.
Okay.
So now it's looks like it's in.
All right.
So just like that.
So now on the Raspberry Pi we have the ground here.
We have the, uh, first LED and then we have the button right here.
And our circuit is now finished.
What you can do now is you just pull it on.
So if you have removed the SD card because you don't have a case, you put it back and then you can
power on the Raspberry Pi.