Let's start with the first component we're going to add to the circuit, the RGB led.
So basically what I'm going to do for the lessons on creating the circuit is I'm going to create a circuit
first on a simulation here on Tinkercad, and then I'm going to show you the real circuit.
Okay.
I use this simulation here because it's simply easier to show you how to connect the components.
Okay.
I'm not going to use the simulation for the course just to create the circuit.
And if you want to create an account on tinkercad.
So that's free.
That's a free tool.
You go on tinkercad.com.
Okay.
You just create your account and then you go to circuits and you can do create new circuits here.
And that is where I am right now.
The first thing I'm going to do is to add an Arduino board here.
So Arduino, Uno, and I'm going to add a breadboard.
So let's use a breadboard.
Let's use a full size breadboard.
Okay.
So the components you can see here, you have all the components.
You just search and you have the different components.
I'm going to put the Arduino here like that.
And before we actually add the RGB led, I'm going to connect those two lines here.
So the minus line, I'm going to connect here like that to the ground.
Okay.
So let's first connect the ground.
So let's make a line for ground and a line for a five volt.
Okay.
Between the Arduino and the breadboard.
Okay.
So the ground line will be black.
And the five volt line will be read.
Okay, So that's important.
First, you connect the ground here of the breadboard to the ground of the Arduino and five volt of
the breadboard to five volt of the Arduino.
So you can just add a black wire here and a red wire here.
Okay.
Now that we have this down, I'm going to search for RGB Led and just take it here and plug it.
Let's plug it here.
So actually, let's play it here.
So one thing is that if you don't have an editor, you can also use three different LEDs.
Okay.
You probably know how to create a circuit with one Led so you could create a circuit with three LEDs
if you don't have the RGB.
Okay.
And for the RGB, well, you can see that you have four legs.
Okay.
And here we see red cathode, blue, green.
So here the order you can see is red, blue and green.
But maybe the order for the colors on your RGB led and for my RGB for the physical one and I'm going
to show you just after is not red, blue, green, but red, green and blue.
Okay.
So that you can of course, experiment with the colors and then find out.
And then the pin here, the Led cathode, which is actually the longer leg of the Led.
Okay.
So you just check what is the longer leg and this is the cathode or this is the anode?
Depends if this is a cathode, what you're going to do is you're going to simply link this to the ground.
Okay, So let's use a black wire.
Okay.
Use black wire if possible, for the ground and red for VCC or five volt.
So now that I have this ground line, I can just link the cathode to the ground.
If this is an anode, you would need to link to five volt.
And how to know that?
Well you have to check the manual or the description of what you bought because you can't just find
out from the component.
And if you are not sure, then try with the cathode mode like this and then make the code, make the
experimentation.
And if it doesn't work, then try to plug this to five volts and see if that works.
All right.
And now for each of the colors here, I'm going to add a resistor.
So resistor let's add a resistor here between, for example, the red and a digital pin here.
And we are going to use a 220 ohm resistor.
Okay.
You can see here the color is red, red and brown for a four band resistor.
If you have a five band resistor that's going to be red, red and then black and black.
Okay.
And I'm going to here connect this to digital PIN number 11 on the Arduino Uno.
So let's change the color, actually.
Let's use.
Well, let's use orange.
Okay.
Let's avoid black and red.
And I'm going to copy this here and copy this here.
I'm going to connect the blue line to pin ten.
Well, let's put it blue so it's easier to recognize it.
And the green.
To.
In nine and let's put it green.
Also.
All right.
And the circuit is done.
So one thing that is very important is to make sure that you connect the three LEDs or the three legs
of the Led to pins where you have a tilde here, as you can see, so that you can use the functionality.
Okay, because we are going to use the analog write function.
So here I have chosen 11, ten and nine, which are all compatible.
But you can see, for example, on the Arduino Uno, we have also the six, the five and the three,
and it may also depend on the board you have.
So make sure you have functionality.
And this is the real circuit with the RGB LEDs.
So very important.
First of all, before you do anything with the Arduino, just make sure to unplug your Arduino from
the Raspberry Pi.
So the Raspberry Pi is still power on, as you can see, the LEDs here.
But we have pulled off the Arduino.
Okay.
And then you can see we have so here we have the red and the black wires.
Okay.
To make the common ground and the common five volt on the breadboard.
I have plugged my RGB here.
The longer leg is actually the second one on the left.
So connect this to a ground line here with this small black wire.
And then for each of the other legs, I have a 220 ohm resistor.
And then this other part of the resistor goes to a digital pin here.
Okay.
This one is actually out.
Let's put it in.
And you can see I have connected from PIN 11, ten and nine.
And one difference from the Tinkercad simulation is that here my colors are actually red, green and
blue.
Okay.
How to know that?
Well, I have just made some experimentations.
So I have used a wire which is white, green and blue.
Okay.
Just for the three colors, it doesn't really matter the color of the wires.
Okay?
It's just to give you some.
Maybe some indication so you don't make more mistakes in the future.
All right.
So you can see that the circuit.