Check out a free preview of the full Nodebots / Hardware course:
The "Wiring Up a RGB LED" Lesson is part of the full, Nodebots / Hardware course featured in this preview video. Here's what you'd learn in this lesson:

Steve wires up an RGB LED to the breadboard.

Get Unlimited Access Now

Transcript from the "Wiring Up a RGB LED" Lesson

>> Steve Kinney: So, we're gonna move on to our next experiment. Earlier we made n a single LED blink and pulse and do a bunch of stuff and yes, there were many colors in there, but what we didn't have was one LED that could be all of the colors. So what we're gonna do now is we have one RGB LED in there, that we're gonna get a chance to use.

[00:00:29] And you'll notice this one has a bunch more pins, so I'm about to go over and put together this circuit. So I wanna talk about it a little bit first, is you'll notice that the ground is not on one of the ends, it's kinda in the middle there.

[00:00:42] And we'll kinda look real quick at what each pin is. And then we'll have a few wires going to the board. Before we get to wiring looks like I picked some pretty odd pins on the Tessel there. I've got the like red and the green going to port A, and I've got the blue going to port B.

[00:01:05] Does anyone have a suspicion or hypothesis, if you will, on why I chose those pins?
>> Steve Kinney: Yeah.
>> Speaker 2: Cuz they match the colors of the lights?
>> Steve Kinney: Are the wires, I chose the wires cuz they match the colors of the lights. But why I chose like one pin on port B, and two on A?

>> Speaker 3: There's only PWM ports on each bar.
>> Steve Kinney: Exactly, exactly like if I had non PWA ports, I could have the green all the way on or the green all the way off or I could have the blue all the way on or the blue all the way off or the red all the way on or the red all the way off.

[00:01:41] But if I can fade well, then I can make a wider range of colors. So that's why I picked those ports. I told you sometimes I just picked a port cuz it was like easy and there and sometimes I had a very specific reason why I did and promise to tell you.

[00:01:57] So that is the reason why I picked this odd arrange of ports. Another thing I wanna look at is, so has an experimenter’s guide for the Johnny Five Inventors Kit. And there's a bunch of other stuff you can do in there. A lot of it has some overlap with what we're doing today because there's so many components in the kit, right?

[00:02:18] But this is really helpful for figuring out what pin is what. So we've kind of in the middle we have got two kind of longer ones. And we could see that the second one there is the ground. All right, cool. So I'm gonna go over and begin to put this together.

[00:02:41] And then, we're going to make LED that can be a wide range of colors. So the first thing I'm gonna do is I'm gonna take my fun little RGB LED. I'm gonna place it in the board.
>> Steve Kinney: I'm actually bringing it closer to me for a second, I might be off screen for a moment here just so I can have a better angle to get it in there.

[00:03:09] So you can give me one moment.
>> Steve Kinney: Four prongs are just a little bit harder than two to do from a few feet away. Great, so I've got that in place across four different of the rows on the bread board. Next thing I wanna do is I need for the actual power ones, I'm gonna use some resistors.

[00:03:34] And resistors are non-polarized, which means there's no right or wrong direction to put them in. But I'm gonna simply line them up here as well, per the diagram. I'm gonna go over the channel, like there is no reason they need to be necessarily like that, but I'm gonna, it's easiest because they are pretty long.

[00:03:56] I'm going to close to make end for one second. Cool, so we have,
>> Steve Kinney: Two like this.
>> Steve Kinney: And I'm going to be very honest with you right now. There is a 50% chance that I put the RGB LED in the right way. [LAUGH] So one out of two cuz there were four pins, and I have done this enough times to know that I have a 50% of the time I get it right every time.

[00:04:34] So we'll find that out when we get to writing the code. We might have to come back and flip it around. And so I say that because while theres a 50% chance that I got it right, there is likely also a 50% chance,
>> Steve Kinney: That you got it right.

[00:04:57] And the nice part is, we'll do all the hard wiring with the hard wire, I don't mean hardwire like that, I mean difficult wiring, with the resistors. But if we do mess up the LED, then we'll simply just flip it around. So luckily, if the 50% chance that we have messed this up is true, it is very easy to rectify.

[00:05:18] We simply pull it out, turn it around, place it in, problem solved. We'll be able to do that without redeploying the code.
>> Steve Kinney: This will likely be the second hardest thing that we wire all day today. So, that's good news insofar that everything else, except for one thing is easier, and the bad news is that it does mean that one thing that we are gonna wire today is going to be harder.

[00:05:47] [LAUGH] Cool, so I've got those resistors going. And now I'm gonna take the first one. Again, anywhere along that channel, it doesn't really matter where. Put in the red, then we have the space where we are gonna have the ground and I'll put in the green. And the schematic is in, there's a directory called wiring diagrams.

[00:06:13] So you can also look at it on your computer too if this angle's not working out great for you.
>> Steve Kinney: And then blue. And,so as far as the PWM ports on the Tessel, I need to go to PWM pins. I keep mixing up pins and ports, I'm sorry.

[00:06:33] I need to go to PWM pins. Which ones I actually go to don't necessarily matter because I'll be able to configure that in code. But I'm gonna take the red and put it in the A5.
>> Steve Kinney: I'm gonna take the green and put it into A6. Easy way to tell A5 and A6 is that it goes A0 to 7, so if you're not the last one, but the two that are second to last, that's one way to tell.

[00:07:03] Or you can also just if you get real, real close to the board you can also see little numbers on the sides. We'll put the blue in one of the PWM pins on the B-port and then for the black one, we have those resistors kinda going over the gap there.

[00:07:24] But the ground, we don't have like a little bridge so we'll go right on this side of the bread board. And we will plug that in. Cool, I'm just gonna bring it close to me again for a second to see.
>> Steve Kinney: Looks like I have got it. The nice part is if I do not have it, I will find out very quickly when I deploy code to it and it doesn't work.

[00:07:54] [LAUGH] None of this is permanent, if I have messed it up, I can just go in and fix it. Especially cuz I can write the code, deploy it, and if I've messed up some wires, I can just move it around as it's running, it's not really a big deal.

[00:08:08] So low risk if I've gotten it wrong, and so it's probably a good idea to go ahead and validate it right?