# How to select resistor values for LEDs | Basic Electronics

We're gonna go over really quick onhow to calculate the resistor that you need to put in series with an LEDso you don't blow it up.

The reason we need this is because onceyou pass the forward voltage of an LED, a slight increase in the voltage makesa huge increase in the current and we don't want to blow things up.

So we put a resistor in series with itthat keeps it under control and it makes it have a little bit moreof a linear relationship between the voltage and the current thoughit's not exact, it's better.

So I have six steps for choosingthe resistor but two of them are sanity checks andthe other four are really simple.

So definitely don't stress about it.

The first thing you need is to find outthe forward voltage.

That's either from the datasheet, a generic source like our color and forward voltage table on ourwebsite or from simple experimentation.

I bought this from SparkFun and I don'tknow if they still do this because I did it a couple of years ago, but they have some of the basic data you need in the package itself.

It's pretty cool.

So I can see straight from here that thevoltage drop of this LED is 2.

2V.

That makes it easier than going andlooking in the datasheet.

But if you don't know, it's worth it.

So that is the first thing: find out what theforward voltage drop of your LED is.

Now, the second thing is to find outwhat the max current is.

They're should also be from the datasheetand you can almost always go past the max current and still have it workbut you'll be shortening its life.

Looking on here, this says I max (current max) is 20milliamps which is very typical for this size of LED.

I'm actually not sure if I've ever seen onethat's different than 20 milliamps on these.

If you get a bigger LED or a smaller LED, you want to check that datasheet to make sure that you don't blow this.

The third thing is actually acontinuation of step two and that is we know that this can have 20 milliampsbefore it starts to damage it.

But how much do I actually want?Do I need it to be that bright? Can I use less current? Step three is find out how muchcurrent you actually want and that could be something where youjust have to do a little bit of trial and error and see how much current is neededto give it the brightness that you want and that's all you have to do.

Once you know what the forward voltagedrop is and you know how bright you want it to be, how much currentyou need to have go through it making sure that you don't go overthe maximum current, you do step four which is figuring out what theresistance will require to hit that current.

You can use Ohm's Law and just math itwhich is voltage source minus the forward voltage at the desired current and thenvoltage over current.

In that case, we have the voltage source, we're just going to assume 5V because that's very common andjust keeps the math simple.

The voltage drop on this is 2.

2V so, 5V minus 2.

2V gives you 2.

8V and then you just divide that by the 20 milliamps.

So we actually have an app or somethingon our site where you can first see this all laid out visually, gives you theequation and you can type it in.

So voltage source is 5V, the voltage drop of the LED is 2.

2V and then the current of the LEDis going to be 20 milliamps.

Doing that and that way I don't haveto do the math in my head, gives us a hundred and forty ohms.

So that is basically how you figurethat out and that's step four.

The next two steps are just sanity checks.

And number five is making sure theresistor that you physically, actually using has a high enoughpower rating.

I'm gonna use a quarter watt resistorwith this and looking at my calculations here, it's showing that I'm only going to beconsuming about 44 milliwatts.

I can handle 250 milliwatts, this says, I'm only going to be consuming 44 milliwatts.

I'm good to go.

And then number six, the other sanity checkis just making sure that everything makes sense.

So, if you have a 12V battery source and a 3V LED, why not put three or four of them in series three or four LEDs in series insteadof all of them in parallel with huge power wasting resistorsfor the rest of the voltage.

If your max current is 1 amp butyou're only driving it to 1 milliamp, why don't you just use asmaller cheaper LED.

If this is just a project you're doingfor the fun of it, then efficiency in saving a couple penniesisn't such a big deal.

Just go and have some fun.

But if you are planning on somethingthat's a little bit more logical a little bit more sensical, take that time to think How much power am i burning here? Is this oversized? Is this undersized?And then go from there.

So with that, I actually wantto do this really quick.

We calculated a hundred and forty ohms.

But in reality, unless you're doing highprecision resistors, they're at a different rate.

So you don't get 100, 102, 104, 105, you get the 100, 142, 150, 100 like the more random numbers.

I'll probably only be able to find a 150 ohmresistor to go with this but that's okay.

If you can't get the exact resistanceif you're already pushing the limit you want to go up a little bit in resistanceso 150 ohms will be perfect for this.

I'm just gonna grab my power sourcehere and turn it on.

So it's gonna be 5V becausethat's fairly common with USB.

I'm gonna hook this up to the anode.

Spread that out.

And then I'm going to hook up to theresistor and hook up to the cathode and we're gonnasee what happens.

We're getting a bright shinygreen LED and not only that but just as you can see here I've got 5Vand we're at 19 milliamp which is about exactly what we expected witha 150 ohm resistor.

We're gonna be burning much lessthan this quarter watt resistor can handle.

And I think we'll be good to go.

So that is what happens in action.

All those steps really quick: First, find the forward voltage.

Second, find the max current.

Third, figure out what current you want as long asit doesn't go over that max current.

Fourth, use Ohm's Law to find outwhat resistance you need.

Fifth, make sure that your resistor is ratedfor the power dissipation that you're actually going to beputting it through.

Sixth and final is just make sure thatyour whole circuit makes sense.

That you're not doing somethingcrazy and inefficient or really expensive that justdoesn't need to happen.

And that's it! It's really straightforward.

Don't even need all those steps.

If you just get rid of thosesanity checks, you'll be fine.

If you liked this video, give us a like.

Subscribe.

Leave something in the comments andwe'll see you next time.

.