WEBVTT

00:00.080 --> 00:06.050
Let's start with the first component we're going to add to the circuit, the RGB led.

00:06.260 --> 00:12.350
So basically what I'm going to do for the lessons on creating the circuit is I'm going to create a circuit

00:12.350 --> 00:18.900
first on a simulation here on Tinkercad, and then I'm going to show you the real circuit.

00:18.920 --> 00:19.100
Okay.

00:19.100 --> 00:25.640
I use this simulation here because it's simply easier to show you how to connect the components.

00:25.720 --> 00:25.810
Okay.

00:25.820 --> 00:29.870
I'm not going to use the simulation for the course just to create the circuit.

00:29.870 --> 00:34.070
And if you want to create an account on tinkercad.

00:34.070 --> 00:34.700
So that's free.

00:34.730 --> 00:35.810
That's a free tool.

00:35.840 --> 00:38.470
You go on tinkercad.com.

00:38.480 --> 00:38.900
Okay.

00:38.900 --> 00:46.070
You just create your account and then you go to circuits and you can do create new circuits here.

00:46.190 --> 00:49.280
And that is where I am right now.

00:49.370 --> 00:53.270
The first thing I'm going to do is to add an Arduino board here.

00:53.270 --> 00:57.710
So Arduino, Uno, and I'm going to add a breadboard.

00:58.220 --> 00:59.910
So let's use a breadboard.

00:59.910 --> 01:02.250
Let's use a full size breadboard.

01:03.000 --> 01:03.210
Okay.

01:03.210 --> 01:06.570
So the components you can see here, you have all the components.

01:06.570 --> 01:12.000
You just search and you have the different components.

01:12.000 --> 01:14.940
I'm going to put the Arduino here like that.

01:14.940 --> 01:20.790
And before we actually add the RGB led, I'm going to connect those two lines here.

01:20.790 --> 01:27.420
So the minus line, I'm going to connect here like that to the ground.

01:28.430 --> 01:28.590
Okay.

01:28.590 --> 01:30.840
So let's first connect the ground.

01:31.200 --> 01:36.570
So let's make a line for ground and a line for a five volt.

01:38.280 --> 01:38.550
Okay.

01:38.550 --> 01:41.220
Between the Arduino and the breadboard.

01:41.250 --> 01:41.460
Okay.

01:41.460 --> 01:44.730
So the ground line will be black.

01:45.740 --> 01:49.010
And the five volt line will be read.

01:50.020 --> 01:51.670
Okay, So that's important.

01:51.670 --> 01:57.490
First, you connect the ground here of the breadboard to the ground of the Arduino and five volt of

01:57.490 --> 01:59.890
the breadboard to five volt of the Arduino.

01:59.890 --> 02:04.150
So you can just add a black wire here and a red wire here.

02:04.510 --> 02:04.780
Okay.

02:04.780 --> 02:13.090
Now that we have this down, I'm going to search for RGB Led and just take it here and plug it.

02:13.510 --> 02:14.890
Let's plug it here.

02:14.920 --> 02:17.320
So actually, let's play it here.

02:18.680 --> 02:23.870
So one thing is that if you don't have an editor, you can also use three different LEDs.

02:23.910 --> 02:24.140
Okay.

02:24.140 --> 02:30.290
You probably know how to create a circuit with one Led so you could create a circuit with three LEDs

02:30.290 --> 02:31.610
if you don't have the RGB.

02:32.230 --> 02:32.390
Okay.

02:32.420 --> 02:37.580
And for the RGB, well, you can see that you have four legs.

02:37.670 --> 02:38.180
Okay.

02:38.180 --> 02:41.830
And here we see red cathode, blue, green.

02:41.840 --> 02:45.440
So here the order you can see is red, blue and green.

02:45.440 --> 02:51.890
But maybe the order for the colors on your RGB led and for my RGB for the physical one and I'm going

02:51.890 --> 02:56.840
to show you just after is not red, blue, green, but red, green and blue.

02:56.840 --> 02:57.230
Okay.

02:57.230 --> 03:01.940
So that you can of course, experiment with the colors and then find out.

03:01.940 --> 03:08.690
And then the pin here, the Led cathode, which is actually the longer leg of the Led.

03:08.720 --> 03:08.960
Okay.

03:08.960 --> 03:14.420
So you just check what is the longer leg and this is the cathode or this is the anode?

03:14.420 --> 03:21.810
Depends if this is a cathode, what you're going to do is you're going to simply link this to the ground.

03:21.840 --> 03:24.030
Okay, So let's use a black wire.

03:24.420 --> 03:24.690
Okay.

03:24.690 --> 03:30.150
Use black wire if possible, for the ground and red for VCC or five volt.

03:30.510 --> 03:34.380
So now that I have this ground line, I can just link the cathode to the ground.

03:34.860 --> 03:38.610
If this is an anode, you would need to link to five volt.

03:38.610 --> 03:39.810
And how to know that?

03:39.840 --> 03:44.760
Well you have to check the manual or the description of what you bought because you can't just find

03:44.760 --> 03:46.770
out from the component.

03:46.770 --> 03:52.290
And if you are not sure, then try with the cathode mode like this and then make the code, make the

03:52.290 --> 03:53.340
experimentation.

03:53.340 --> 03:58.710
And if it doesn't work, then try to plug this to five volts and see if that works.

03:58.920 --> 03:59.400
All right.

03:59.400 --> 04:05.640
And now for each of the colors here, I'm going to add a resistor.

04:06.210 --> 04:16.980
So resistor let's add a resistor here between, for example, the red and a digital pin here.

04:16.980 --> 04:22.740
And we are going to use a 220 ohm resistor.

04:24.010 --> 04:24.220
Okay.

04:24.220 --> 04:31.090
You can see here the color is red, red and brown for a four band resistor.

04:31.180 --> 04:36.130
If you have a five band resistor that's going to be red, red and then black and black.

04:36.430 --> 04:36.640
Okay.

04:36.640 --> 04:44.830
And I'm going to here connect this to digital PIN number 11 on the Arduino Uno.

04:45.220 --> 04:47.470
So let's change the color, actually.

04:48.980 --> 04:49.910
Let's use.

04:49.940 --> 04:51.300
Well, let's use orange.

04:51.320 --> 04:51.860
Okay.

04:52.190 --> 04:55.760
Let's avoid black and red.

04:55.760 --> 05:00.230
And I'm going to copy this here and copy this here.

05:00.920 --> 05:05.750
I'm going to connect the blue line to pin ten.

05:07.640 --> 05:10.790
Well, let's put it blue so it's easier to recognize it.

05:10.790 --> 05:12.200
And the green.

05:13.080 --> 05:13.890
To.

05:15.760 --> 05:18.460
In nine and let's put it green.

05:18.580 --> 05:19.330
Also.

05:20.020 --> 05:20.410
All right.

05:20.410 --> 05:22.900
And the circuit is done.

05:23.980 --> 05:31.210
So one thing that is very important is to make sure that you connect the three LEDs or the three legs

05:31.510 --> 05:39.780
of the Led to pins where you have a tilde here, as you can see, so that you can use the functionality.

05:39.910 --> 05:42.940
Okay, because we are going to use the analog write function.

05:42.940 --> 05:49.080
So here I have chosen 11, ten and nine, which are all compatible.

05:49.090 --> 05:53.260
But you can see, for example, on the Arduino Uno, we have also the six, the five and the three,

05:53.260 --> 05:56.170
and it may also depend on the board you have.

05:56.170 --> 05:58.930
So make sure you have functionality.

05:59.410 --> 06:02.560
And this is the real circuit with the RGB LEDs.

06:02.560 --> 06:03.550
So very important.

06:03.550 --> 06:09.640
First of all, before you do anything with the Arduino, just make sure to unplug your Arduino from

06:09.640 --> 06:10.450
the Raspberry Pi.

06:10.480 --> 06:14.260
So the Raspberry Pi is still power on, as you can see, the LEDs here.

06:14.260 --> 06:17.380
But we have pulled off the Arduino.

06:17.530 --> 06:17.920
Okay.

06:17.920 --> 06:22.690
And then you can see we have so here we have the red and the black wires.

06:22.720 --> 06:23.050
Okay.

06:23.050 --> 06:26.870
To make the common ground and the common five volt on the breadboard.

06:26.900 --> 06:29.060
I have plugged my RGB here.

06:29.330 --> 06:32.600
The longer leg is actually the second one on the left.

06:33.160 --> 06:38.980
So connect this to a ground line here with this small black wire.

06:38.980 --> 06:44.320
And then for each of the other legs, I have a 220 ohm resistor.

06:44.320 --> 06:49.840
And then this other part of the resistor goes to a digital pin here.

06:49.870 --> 06:50.080
Okay.

06:50.080 --> 06:51.790
This one is actually out.

06:51.820 --> 06:52.900
Let's put it in.

06:53.380 --> 06:57.910
And you can see I have connected from PIN 11, ten and nine.

06:58.030 --> 07:05.620
And one difference from the Tinkercad simulation is that here my colors are actually red, green and

07:05.620 --> 07:05.950
blue.

07:05.980 --> 07:06.220
Okay.

07:06.220 --> 07:06.850
How to know that?

07:06.850 --> 07:09.670
Well, I have just made some experimentations.

07:09.880 --> 07:14.320
So I have used a wire which is white, green and blue.

07:14.530 --> 07:14.800
Okay.

07:14.800 --> 07:18.240
Just for the three colors, it doesn't really matter the color of the wires.

07:18.250 --> 07:18.430
Okay?

07:18.430 --> 07:19.570
It's just to give you some.

07:19.570 --> 07:23.980
Maybe some indication so you don't make more mistakes in the future.

07:24.250 --> 07:24.700
All right.

07:24.700 --> 07:27.190
So you can see that the circuit.
