Resistors Tutorial

Resistors are one of the most common components in any circuit and if you want to get technical, basically everything is a resistor. So what exactly is a resistor? A Resistor is anything that resists the flow of electricity. When electricity flows through something, it encounters a kind of friction that causes some loss of energy. While basically everything has a resistance, the term resistor generally refers to a component with an intentional known resistance. They often look something like below.

Bunch of resistors

Going back to the water analogy, if your wire is a hose, then a resistor would be a kink in the hose. But how tight is the kink? For that we need another unit, the ohm.


The ohm, often written using the symbol Ω, is a unit of resistance. The higher the value the more resistance there is to the flow of electricity. You can think of it as how tight the kink in the hose is. A small value would be just a slight bend while a large value would almost close off the hose.

The definition of an ohm is known as Ohm's Law. It is traditional written as V = IR where V is voltage, I is current, and R is resistance. This form is a bit confusing and is easier to understand if we rearrange terms. Solving for I we get I = V/R. This form makes it easy to see how much current will flow though a resistor. The current across a resistor is proportional to the voltage across it. This means that if you want to double the current you need to double the voltage. This should seem fairly intuitive as voltage is the pushing force causing the electricity to flow. If you push twice as hard, twice as much charge should move.

LED with a resistor

One of resistor's most common applications is as a current limiter. As the name suggests, this application is to limit the amount of current that flows through another component. Let's walk though a simple example of powering an LED with 5V. For this example, you don't need to know exactly what an LED is, just that it is a small light. A typical LED will be happy with 1.7V and about 15mA. However, circuits are often powered with 3.3V or 5V. If you connect an LED directly to 5V you'll get a short bright flash followed by some smoke as it burns out. To prevent this, we need a resistor. Now the only question is what value should we use?

To calculate the value of our resistor we need to know the voltage across it and the current we want to flow. The LED should be happy with 15mA and we know at this current the voltage across the LED is about 1.7V. This means the voltage across the resistor will be 5V - 1.7V = 3.3V. Rearranging Ohm's Law again we get R = V/I. Plugging in 3.3V and 15mA we get 3.3V/0.015A = 220Ω.

Voltage Divider

Another common application for resistors is the voltage divider. As the name suggests, this circuit is used to divide the input voltage by a fixed amount. The circuit is shown below.

Voltage Divider

The output voltage is defined by this equation, Vout=Vin*[R2/(R1+R2)]. If R1 = R2 = R and Vin = 5V then Vout = 5*R/(2R) = 5 * 1/2 = 2.5V.

Voltage dividers are particularly helpful when you need to measure a voltage higher than the analog input on an analog-to-digital converter (ADC) can handle. I've used a simple voltage divider to be able to read voltages between 0-400V with a simple microcontroller running at 5V.

While the output voltage only depends on the ratio of resistances, the actual resistances need to be considered for a robust design. The first thing to realize is that the output voltage will change if you start pulling current from the middle of the divider. If you connect anything to this point then you will be pulling some amount of current. The divided output voltage is the entire purpose of the divider so of course you are going to connect something to it. Whatever you connect can be seen as another resistor in parallel with R2.

When resistors are in parallel we can calculate their effective resistance. This is the resistance if they were actually just one resistor. The formula for two resistors in parallel is Req=1 / (1/R1 + 1/R2). This is often called the "one over" equation. If you have more than one resistor in parallel you can continue adding their reciprocals together in the denominator.

Just as a sanity check, let's see what the effective resistance would be of two 50Ω resistors in parallel. Intuitively, it should be 25Ω because we have two paths of equal resistance so putting them together should make the overall path half the resistance. Subbing in values to our equation it becomes Req=1 / (1/50 + 1/50) = 1 / (1/25) = 25.

Something to notice about this equation is that if either resistor is small, it will dominate the overall effective resistance. Imagine attaching a fire hose and a coffee straw in parallel. The coffee straw will contribute basically nothing to the overall water flow when compared to the fire hose. We can use this principle to make sure our voltage divider works properly.

The resistances used in the voltage divider need to be small enough so that when we connect something with a relatively high resistance to its output, the output voltage effectively won't change. This is fairly easy to achieve if we are using the divider for an analog to digital converter as they are designed to have very high input resistances (in the order of millions of ohms). The resistances for our voltage divider can then be somewhere around 10-100K ohms.

Why not simply use even lower resistances? This is because we are wasting power through our divider. If we used 1Ω resistors to divide 5V into 2.5V we would be drawing 2.5A just in the single divider (resistors in series add together)! This it is important to consider the values of the resistors and not just their ratio when designing a voltage divider. Use too high of values and the output will be very sensitive to what is connected to it. Use too low of values and you waste a lot of power.

What's the value?

Resistors are measured in ohms, as you probably figured out by now, but how do we know how many ohms a 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 its tolerance. Here is close up of a 220ohm resistor.

220 Ohm 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.