banner

News

Nov 14, 2023

How To Use Resistors in a Project

Resistance is futi… Voltage divided by Current

The maker toolkit has a core selection of essential maker tools. The tools that we can't do any work without. Breadboards, soldering irons, LEDs are important, but resistors are the tiny components that projects depend on.

No matter what bord we choose, be it Raspberry Pi, Raspberry Pi Pico or Arduino, we need resistors to protect our LEDs, divide voltages and provide precise values for our circuits. But what do they do, why do we need them and how can we make sure we have the correct value? For that we need to do a little math, and consult a few datasheets.

In this reference we will explain what resistors are, what they do and tell you how to pick the correct resistor for your next project.

Resistors are components which introduce electrical resistance in a circuit. Typically they are used to reduce the current flow in a circuit, for example when used with LEDs they stop the LED from consuming too much current.

An LED without a resistor will burn itself out very quickly. Resistors can also be used to create voltage potential dividers, useful circuits that will reduce the voltage in a circuit. Every maker will have some resistors in their kits. They come in bandolier strips and can be bought in singular packs or in their thousands.

The most basic use of resistors is to stop a component from consuming too much current. Take for example an LED (Light Emitting Diode). LEDs are designed to pass current in one direction and produce a small amount of light as they operate. If we give LEDs as much current as they want, the LED will light brightly but soon burn out. In some cases we can give it too much current at once, causing the LED to "pop" and then die.

We can use the following calculation to determine the exact resistor value.

R is the resistor value, Vs is the supply voltage, Vf is the forward voltage (the amount component needs), and If is the forward current.

Let's put this into practice. We have a blue LED connected to a 5V supply. The forward voltage of the LED is 3.2V and the required current is around 10mA. So the calculation looks like this.

This means that the value of R is 180 Ohms. In the standard series of resistors we can use this exact value or we can choose a 150 or 220 Ohm resistor instead. For basic tasks, the exact value isn't essential but when designing circuits for professional / industrial or high precision devices you will need to use the exact values. The exact values can be found in the components datasheet or on the product page from your chosen store.

For most hobbyist / maker applications we can choose the nearest value that we have. We often favor a 220 / 330 Ohm resistor for our LEDs.

Resistors can also be used to pull up or pull down a GPIO pin. A pull up resistor will pull a pin high by connecting a voltage supply to a pin. A pull down resistor will pull a pin down to GND. We used a 10K Ohm resistor with a DHT22 temperature sensor to pull the data pin high using the 3.3V supply.

Resistors can also be used to drop voltages from one level to another. This is called a voltage divider and it is commonly used in potentiometers to vary the voltage.

To create a voltage divider we need to use this equation.

Vout is the voltage that we want.

Vin is the input voltage.

R1 is the first resistor's value.

R2 is the second resistor's value.

So, for our voltage divider we want to convert the 5V input voltage to around 3.3V. This process is commonly used when we need to change the logic voltage of a component, for example the HC-SR04. The HC-SR04 ultrasonic distance sensor originally used 5V logic, and so the echo pin, which activates when sound bounces off an object, will send 5V to the GPIO.

For an Arduino, this is ok. For a Raspberry Pi, it can damage the pin, or even the Pi. We’re using two resistors, R1 a 1K Ohm resistor (top) and R2 a 2.2K Ohm resistor (bottom) to create a voltage divider. The legs of R1 and R2 go into the same row of the breadboard. Into R1 we supply 5V and into R2 we connect to GND. Where the legs of R1 and R2 meet is the output voltage, which should be 3.4375V, well within the tolerance of the 3.3V GPIO.

The calculation works by adding R1 and R2 together (1000 + 2200 = 3200) then we divide the value of R2 by this (2200 / 3200 = 0.6875) and lastly we multiply by the input voltage (5 8 0.6875 = 3.4375V).

Resistors have color bands around their axis. We have a detailed article on how to decode resistor color codes, but below is a brief explanation that's suitable for your first project.

These bands are a code system that we can use to identify the value of a resistor. There are four, five and six bands but the most common are four. In fact the four band resistors are the easiest to read.

Let's take this resistor as an example. The bands are printed to the resistor but the final band, tolerance, is printed on one of the "bulges" at the end of the resistor. We can see the first band is yellow and the second is violet. This gives us a value of 47. The third band is the multiplier, in this case red is 100. If we do the math, 47 x 100 = 4700. We have a 4700 Ohm resistor, generally referred to as a 4.7K Ohm resistor. The final band is the tolerance. Our tolerance band is gold which means we have a 5% tolerance, it could be 5% over or under the 4.7K Ohm value.

Five band resistors offer additional precision and use an extra third digit to dial in the precision. The same 4.7K Ohm resistor's third band is now black, which refers to zero. The fourth band is the multiplier and the fifth is our tolerance.

This table provides a quick reference which can be applied to four and five band resistors.

Sometimes it can be hard to correctly identify a resistor by its color code. It could be old, damaged or incorrectly printed. If that is the case then we can check our resistor using a multimeter.

Multimeters are an essential tool for makers. Amongst other features multimeters can measure voltages, current, and check for continuity in a circuit. There are two common multimeters, auto-ranging and manual. Auto-ranging try to detect reading and put it into a range. For manual we have to set the range.

1. Turn the dial to the Ω (Ohm) symbol and press the power button. Some multimeters will turn on when the dial is turned, while others have a power button.

2. Wrap one leg of the resistor around one probe. Resistors do not have a polarity so we can connect either leg to the probe.

3. Wrap the other leg around the remaining probe.

4. Read the value from the screen. Give it a few moments to settle before taking a reading.

1. Turn the dial to the Ω (Ohm) symbol and select the lowest range. Press the power button.

2. Wrap one leg of the resistor around one probe. Resistors do not have a polarity so we can connect either leg to the probe.

3. Wrap the other leg around the remaining probe.

4. Read the value from the screen. Give it a few moments to settle before taking a reading.

5. If the reading states OL or garbled, go up one range until you see a stable value. This is the multimeter trying to tell us that our reading is out of range, normally higher than the manual setting we have used.

Join the experts who read Tom's Hardware for the inside track on enthusiast PC tech news — and have for over 25 years. We'll send breaking news and in-depth reviews of CPUs, GPUs, AI, maker hardware and more straight to your inbox.

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

Best Soldering Irons and Stations

World's First Wood Transistor Chops Out at 1 Hz

AMD's EPYC Rome Chips Crash After 1,044 Days of Uptime

By Les PounderApril 23, 2023

By Avram PiltchApril 22, 2023

By Brandon HillApril 21, 2023

By Avram PiltchApril 20, 2023

By Brandon HillApril 16, 2023

By Les PounderApril 15, 2023

By Les PounderApril 09, 2023

By Les PounderMarch 25, 2023

By Jarred WaltonMarch 19, 2023

By Les PounderMarch 18, 2023

By Avram PiltchMarch 15, 2023

Turn the dial to the Ω (Ohm) symbol and press the power button. Wrap one leg of the resistor around one probe. Wrap the other leg around the remaining probe. Read the value from the screen. Turn the dial to the Ω (Ohm) symbol and select the lowest range. Press the power button. Wrap one leg of the resistor around one probe. Wrap the other leg around the remaining probe. Read the value from the screen. If the reading states OL or garbled, go up one range until you see a stable value. How To Use Resistors in a Project : Read more
SHARE