Embedded Micro

Resistors

by on Aug.20, 2010, under Electronics, Tutorials

Resistors, one of the most common and simple parts used in electronics. So, what is a resistor? Why are they so useful? A resistor is anything that resists the flow of electricity. Now that is pretty broad isn’t it. Pretty much everything resists the flow of electricity, except for super conductors, however “resistor” generally applies to a component that looks something like this.

So what exactly do they do? As I said before, resistors resist electrical current. If your electrical current was water running through a hose, a bend in the hose would be a resistor.

Ohm

What is an ohm? Just like voltage or amperage, ohm is a unit. Ohm is used to measure how much a resistor resists the flow of electricity. The higher the rating the more it resists. Just like the hose, the more bends, or the tighter the bend, the more it resists the water. In this tutorial I use a LED as an example for the resistor. Exactly what an LED is will be covered in a later tutorial, for now all you need to know it that it is a type of light bulb. They are found in all sorts of electronics. They are commonly used to show that something is on, and are normally green or red.

Ohm’s Law

You may have heard about this before in school, the famous equation V=IR. This is very important when working with resistors. Using this formula you can find out how much current (amperage) will flow though a resistor at a set voltage. For this you want to use a variation of the formula (solve for I, I stands for current) I=V/R.

So why would I ever need this? Here is a very common example, you have a nice LED (Light Emitting Diode) and you want to use 5V to power it. If you decided to connect 5V directly to the LED then your LED might last for a second or two, it would then turn a black color and stop working, they also smell horrible, of course I have never done this :) .

So how can you stop this? Well the title of this tutorial gives it away, a resistor! The average LED takes around 35mA of current and a red LED has a forward voltage of around 1.7V, the voltage it takes to make it light up. That means that it uses 1.7V*0.035A=~0.06W. Now we need to know how many amps we need at 5V to equal 0.06W. First we divide 0.06W by 5V = ~0.012A. Well what this means is that if we can power the LED with 5V and 12mA then it won’t burn out. To limit the amount of current down to 12mA we need a resistor, but how many ohms? We use another variation of Ohm’s Law R=V/I, R=5V/0.012A. We need a resistor with the value of around 417ohms for this LED.

Now I commonly use 220ohm resistors with LED and most can take it. I have yet to burn one out with a 220ohm resistor at 5V. Just to be sure lets find out how much current will flow though a 220ohm resistor at 5V. In this example we know R and V so we solve for I, I=5V/220ohm. Approximately 23mA, but wait that is not through the resistor. When something (the LED) uses more power than provided (providing 23mA when 35mA are needed) the voltage will drop and the current will increase. That is why we need to calculate the wattage, W=VI. 5V*0.023A=0.115W, now how much current will flow if the voltage is 1.7V? W/V=I 0.115W/1.7V=~0.07A or 70mA.

I know what you are thinking, “OK, do you really do all this for a LED?” honestly, no, but that is because 220ohms is usually safe, but for things like high power LED or LED in series/parallel, I do.

Voltage Divider

Another fantastic use of resistors. A voltage divider does just that, it divides voltage. A common voltage divider looks like this.

The output is equal to Vo=V*[R2/(R1+R2)]. If R1=R2 and VDD=5V then:

5*[x/(x+x)]

5*[x/2x]

5*1/2

Vo=2.5V

The voltage divider is useful for reading a voltage with a microcontroller that is over the maximum voltage it can read. I have used a voltage divider to read 0-400V with a microcontroller running at 5V (meaning it can’t read anything over 5V with out damage).

The problem with voltage dividers is if you draw any current from the output then the voltage will drop. If you are using a microcontroller to read the voltage then the amount of current it draws from it is so little that the drop is not noticeable. The higher value you use for the resistors the more it is effected by current draw. For example if you used the ratio described above a 1ohm to 1ohm divider would be a lot less effected by current draw then a 1M ohm to 1M ohm (1M ohm = 1,000,000ohms). However the voltage divider draws power and that is calculated with Ohm’s Law, I=V/(R1+R2). So using 1ohm for R1 and R2 with VDD=5V you would draw 2.5A! However with 1M ohm for each you would draw only 0.0000025A! For most cases I use 10K ohm to 100K ohm for a nice balance.

What’s the value?

Resistors are measured in ohms as you probably figured out by now, but how do we know how many ohms the resistor is? As you can see in the picture below resistors have colored bands on them. Those colors tell you what the value of the resistor is and the tolerance. Here is close up of a 220ohm resistor.

Each color represents a number.

0 1 2 3 4 5 6 7 8 9

The first two bands are the 1st and 2nd digits. In this case the two red bands on the left. So that makes red red or 22. The next band is the multiplier. You add that many 0s to the end of your original number. On this one it is brown, 1. That means our resistor is 220ohm. If it were a black stripe it would be 22ohm or if it were another red strip it would be 2200ohm or 2.2K ohm.

Wait! What is that other band for? This band tells you the tolerance. Gold is +-5%, silver is +-10%, and if it is missing it is +-20%. In our case it is gold so the value of the resistor is 220ohm+-5% or 209-231ohm.


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives

All entries, chronologically...