WEBVTT

00:00.080 --> 00:04.760
Our circuit now contains an LED and we are going to add a push button.

00:04.760 --> 00:09.470
So I will show you step by step exactly what you need to do to add this push button.

00:09.470 --> 00:14.060
And then in the next lesson we are going to control it with Python and the first thing.

00:14.060 --> 00:17.480
So here you can see I'm still on the Raspberry Pi OS desktop.

00:17.480 --> 00:22.070
Make sure first that you shut down the Raspberry Pi okay.

00:22.130 --> 00:26.570
So shut it down and remove the power cable.

00:26.840 --> 00:28.880
So here I'm back on my circuit.

00:28.880 --> 00:32.510
I will first show you with this software and then with the real circuit.

00:32.510 --> 00:33.740
We still have the LED here.

00:33.740 --> 00:35.750
We're not going to touch anything about that.

00:35.750 --> 00:38.000
But we have two new components here.

00:38.000 --> 00:42.650
We have this push button and we also have a one kilo ohm resistor.

00:42.650 --> 00:46.790
So that's the exact same model as we had for the LED.

00:46.850 --> 00:52.730
And once again here, even if you see Raspberry Pi four on my software, it's the same for Raspberry

00:52.730 --> 00:55.490
Pi five, Raspberry Pi three, etc..

00:55.520 --> 00:59.720
Okay, so the push button, you will see that a push button has four legs.

00:59.750 --> 01:06.900
But actually if I click here this leg on the left is connected to that one, and this leg on the right

01:06.900 --> 01:08.730
is connected to that one.

01:08.730 --> 01:11.820
So in the end you only have basically two connections.

01:11.850 --> 01:12.060
Okay.

01:12.090 --> 01:15.270
So this one is connected to that one and this one to that one.

01:15.300 --> 01:18.780
What I will do is I will put my push button.

01:18.810 --> 01:24.330
Usually what I do is so I'm going to go on the right here, and I put it in the middle like that.

01:24.330 --> 01:28.080
So it's connected to both sides.

01:28.080 --> 01:35.160
Just because if you put it here you see that, then you only have one possible dot to connect something

01:35.460 --> 01:35.670
okay.

01:35.700 --> 01:39.840
If I put it in the middle then I have additional dots okay.

01:39.870 --> 01:41.340
I have more space basically.

01:41.340 --> 01:43.050
So we're going to do it like this.

01:43.050 --> 01:48.750
And now you can see that because of this connection here all the dots in this line are also connected

01:48.750 --> 01:51.060
to all the dots in that line.

01:51.060 --> 01:52.290
So in that column okay.

01:52.320 --> 01:57.420
So this whole column does five and five dots here are connected together.

01:57.420 --> 01:59.430
And the same for that side.

01:59.430 --> 02:03.630
So the first thing I will do is connect the button to the ground.

02:03.640 --> 02:05.620
And you can see we already have the ground.

02:05.620 --> 02:10.210
So the ground is connected from the Raspberry Pi to this blue line here.

02:10.210 --> 02:14.290
So I'm going to take this dot here and connect it to the ground.

02:14.290 --> 02:17.410
And I'm just going to choose a black color.

02:17.980 --> 02:20.650
So why is black here.

02:20.680 --> 02:21.460
All right okay.

02:21.460 --> 02:22.600
We use black for ground.

02:22.600 --> 02:26.230
So then it's much easier not to make mistakes in the future.

02:26.230 --> 02:28.450
And then this is where.

02:28.450 --> 02:31.150
So you can see here I have a full.

02:31.180 --> 02:33.010
So the line is fully connected.

02:33.010 --> 02:37.060
This is where if you have a disconnection in the middle for example here.

02:37.060 --> 02:42.640
So that only applies for those of you who have a long breadboard and it's disconnected in the middle.

02:42.640 --> 02:46.990
Then the ground here is not going to be connected to that side.

02:46.990 --> 02:53.140
So maybe in this case you might want to add an extra wire here if it was disconnected.

02:53.170 --> 02:56.320
Okay I'm going to come back to this on the real circuit.

02:56.350 --> 03:00.880
But if you have a fully connected breadboard like this, you don't need to worry about that.

03:00.880 --> 03:04.300
And then so we have one side of the button connected to the ground.

03:04.300 --> 03:07.040
And I'm going to just connect here.

03:07.070 --> 03:09.470
I'm going to plug a resistor.

03:09.470 --> 03:11.810
So wherever here on the other side.

03:11.810 --> 03:13.850
So I can even put it here if I want.

03:13.910 --> 03:14.180
Okay.

03:14.210 --> 03:14.930
It's the same.

03:14.930 --> 03:16.160
And then I will connect.

03:16.160 --> 03:23.150
So basically I will connect this leg here on the right which is going through a resistor.

03:23.150 --> 03:26.420
I will connect to a Gpio on the Raspberry Pi.

03:26.420 --> 03:31.010
And that's going to be that one Gpio number 26.

03:31.010 --> 03:32.720
And I chose this one okay.

03:32.720 --> 03:34.370
Because it's quite easy to locate.

03:34.400 --> 03:37.400
It's going to be also on the inside of the Raspberry Pi.

03:37.400 --> 03:41.540
And you can see that the first one here, the first pin on the right is a ground.

03:41.540 --> 03:43.940
So that's going to be the second to last pin.

03:44.030 --> 03:50.630
So you're going to connect this one to to that part here.

03:50.720 --> 03:55.970
So to that leg of the resistor I'm just going to make it nicer.

03:59.600 --> 03:59.750
Okay.

03:59.750 --> 04:06.110
So when I export the image for you I'm also going to make it nicer to look at.

04:06.110 --> 04:09.570
And I'm going to change the color here because we don't want black.

04:09.600 --> 04:13.170
And let's use blue for example, because I'm going to use the blue wire later.

04:13.170 --> 04:14.700
But it can be any color you want.

04:14.730 --> 04:15.180
All right.

04:15.210 --> 04:17.340
And that's basically it for the push button.

04:17.340 --> 04:20.880
So we have the ground to one side of the button.

04:20.880 --> 04:27.120
Then on the other side we have this resistor which is basically just here to reduce the current.

04:27.120 --> 04:29.670
That's more like a safety feature.

04:29.670 --> 04:34.320
You might find some circuits online that don't even use the resistor okay.

04:34.350 --> 04:38.640
They just connect the two legs of the push button directly to the Raspberry Pi.

04:38.670 --> 04:43.860
Here I just add this resistor to reduce the current as an additional safety.

04:43.860 --> 04:48.840
And then basically so you see one side is connected to the ground and the other side is connected to

04:48.870 --> 04:50.340
a Gpio.

04:50.340 --> 04:53.370
And now let's go to the real circuit.

04:54.240 --> 04:55.860
So we are on the real circuit.

04:55.860 --> 04:56.940
And as you can see.

04:56.970 --> 04:58.920
So I have just shut down my Raspberry Pi.

04:58.920 --> 05:01.500
I'm going to make sure to power it off.

05:01.740 --> 05:07.890
And just to make it easier for you to see, I'm going to use the same orientation as in the software.

05:08.140 --> 05:09.100
like this.

05:09.100 --> 05:14.050
And then the first thing you might want to do, just in case you have a disconnection in the middle

05:14.080 --> 05:14.290
here.

05:14.290 --> 05:20.020
So I don't have a disconnection, but if you have then you might for example, put one.

05:20.050 --> 05:25.150
You see, take one small black wire, male to male, and then you plug it just like that.

05:25.150 --> 05:30.970
For example, if the disconnection is here, which means that the left part here is going to be connected

05:30.970 --> 05:34.870
to the right part, and then everything is going to be connected to the ground.

05:34.900 --> 05:35.110
Okay.

05:35.140 --> 05:36.850
So that's just in case.

05:36.850 --> 05:39.580
And now I'm going to remove that because I don't need it.

05:39.790 --> 05:42.460
Now what do I have I have my push button.

05:43.090 --> 05:45.820
I have my one kilo ohm resistor.

05:45.850 --> 05:48.700
That's the same as the one we used for the LEDs.

05:48.700 --> 05:54.730
So if you have a doubt about the value and how to pick the color, you can come back to previous videos.

05:54.820 --> 06:01.720
And then I have a small black wire so male to male and I have a here a blue wire.

06:01.930 --> 06:03.070
The color doesn't matter.

06:03.100 --> 06:05.470
Just don't use red and don't use black.

06:05.470 --> 06:08.410
And this one is a male to female.

06:10.160 --> 06:14.150
So I'm going to take my push button and I'm going to connect it here.

06:14.180 --> 06:15.770
While on the right.

06:15.980 --> 06:16.790
Okay.

06:17.090 --> 06:18.380
Just like this.

06:18.650 --> 06:20.480
Between the two parts.

06:20.510 --> 06:21.140
Okay.

06:21.800 --> 06:24.710
Now I'm going to connect the ground.

06:24.710 --> 06:30.770
So let's just take whatever dot here and connect to whatever dot on this blue line.

06:31.340 --> 06:31.670
Okay.

06:31.700 --> 06:36.260
I just make sure that I don't put the wire too close to the button, because what's going to happen

06:36.260 --> 06:38.660
is we are actually going to push the button.

06:38.660 --> 06:40.970
So we're going to need to touch the circuit.

06:40.970 --> 06:45.980
And if you see you have the wire too close or the resistor too close, then you might touch it.

06:45.980 --> 06:47.870
And it's better to avoid doing that.

06:47.870 --> 06:50.120
So I'm just going to plug it here.

06:50.300 --> 06:50.480
Okay.

06:50.480 --> 06:55.280
So I have enough space then to push the button without touching anything.

06:56.540 --> 06:59.060
So that's the left side of the button.

06:59.060 --> 07:03.740
Now on the right side I could plug it here but I'm going to plug it here.

07:03.890 --> 07:06.380
So make sure it's on the same color right.

07:07.490 --> 07:11.190
I'm going to put a resistor and right here.

07:12.750 --> 07:14.670
It doesn't matter where you put it.

07:14.700 --> 07:15.930
Where you put the leg.

07:15.930 --> 07:20.520
It just matters that it's a colon with no other components.

07:21.930 --> 07:23.310
So just like this.

07:23.310 --> 07:27.180
And then I will connect this side of the resistor.

07:27.210 --> 07:34.350
So here for example to the second to last pin on the Raspberry Pi.

07:34.380 --> 07:38.430
So from the bottom right which is that one.

07:42.000 --> 07:42.600
Okay.

07:42.630 --> 07:47.010
So now it's looks like it's in.

07:47.040 --> 07:47.490
All right.

07:47.490 --> 07:48.450
So just like that.

07:48.600 --> 07:51.210
So now on the Raspberry Pi we have the ground here.

07:51.390 --> 07:57.780
We have the, uh, first LED and then we have the button right here.

07:58.500 --> 08:01.110
And our circuit is now finished.

08:01.140 --> 08:04.260
What you can do now is you just pull it on.

08:04.260 --> 08:09.390
So if you have removed the SD card because you don't have a case, you put it back and then you can

08:09.390 --> 08:11.580
power on the Raspberry Pi.
