HomeRaspberry Pi SensorsResistors for beginners

Resistors for beginners

Everything you need to know about the resistors

This guide to resistors for beginners aims to give you all the knowledge you need for Raspberry Pi and Arduino projects.

One of the most used components is resistors. The main purpose of it is to control the amount of the current that flows through a circuit. Using resistors you can drive the correct power levels on your circuit, and protect other components from a potential damage.

You will be using ‘through-hole’  design, (the one in the main picture) as SMD are tiny (0.8mmx0.5mm) and therefore not practical for home use. The resistor has 2 pins (or more, if it’s an array) which are bidirectional. The orientation of a resistor on the board does not matter, and there is no polarity of the component.

Resistors can have a variable resistance value, allowing for knobs and sliders to be installed on it, to select the current resistance.

Schematics

There are 2 ways of marking a resistor in  schematics:

both are correct (EU vs USA), and come with labels (R1,R2…etc)  and values  (220Ω, 210kΩ …etc) next to it. There isn’t anything more fascinating to put here really, which is a good thing, as you will notice these schematics get confusing very quickly!

Bands and power rating

To measure the value of the resistor, and this is something you should do each time if I’m honest,  you can use a multimeter to do so. Additionally, each resistor has colour coded bands (from 4 to 6) that correspond to the value of the resistor.

  • Band1 (1st digit)
  • Band2 (2nd digit)
  • Band3 (if any* 3rd digit)
  • Penultimate band (multiplier)
  • Last band (tolerance)

   

Another thing to bear in mind is the power rating of the resistor. Picking lower power rated resistor than required, will result in resistor being fried.  The ones you will come across most often are rated ¼W or ½W.  The rating is measured in Watts.

P= I*V (the formula)
P = I2*R (using Ohm’s Law)
P= V2/R (and if you know the voltage)




The math & usage

Current LimiterPull-up/Down I/OVoltage divider

Serial
Series resistors

The math behind the serial link is very simple, just add it all together, to calculate the total resistance of the circuit

Rtot = R1+ R2+R3+R4

This is pretty much all you need to know if you want to know the voltage step downs between the components have a look at the voltage divider tab.

Parallel

Parallel resistors
This is where things get little more complicated. While the screen example is relatively simple to deal with, chances are your circuit won’t look that simple.

1/Rtot = 1/R1+1/R2+1/R3+1/R4

This formula allows you to deal with the parallel circuit, there is another version of this calculation, in a slightly more useful shape, and it applies to any 2 resistors in parallel circuit:

Rtot = R1*R2/(R1+R2)

Why am I littering your head with that? Take a look at this:
resistors
The total resistance value of R8 is calculated like in a serial circuit: the sum of R5,R6,R7, this will give us the base, to use the previous equation for calculating the resistance of 2 resistors in a parallel circuit R8 and R4. This is how we solve more complex situations. From there just rinse and repeat until you get through the entire board. I really hope this makes sense to you!

This part is mostly useful for circuits alone and pull-up behaviour is built-in in a lot of microcontrollers (RPI and Arduino). This means that we can enable this within the software. Why should you be interested?  We can set pins to LOW or HIGH,  depending on voltage submitted to the pin. LOW being GND (0V) and HIGH (5V, 3.3V).
There is also another state on input pins. And it is referred to, as floating. This is when the pin is disconnected from the circuit, and can still have a small floating current present (caused by electrical interference), which can cause our circuit to misbehave. Usually, it causes a board to read the pin state as LOW or HIGH regardless of what is happening in our circuit.  To fix this software-wise, when declaring your input pin, we can set it as:

pinMode(5, INPUT_PULLUP);

which will take care of this issue for us.
If we have no option to do so, we can design a circuit in a way to enable the same functionality.pull up pull down
Both circuits deal with the same issue, removing floating electrons on input pins. In the pull-down, when the switch is open – input pin reads LOW, as any floating current is drawn to GND, in a pull-up the logic is inverted, and when the switch is open the input pin reads HIGH as there is a direct connection between the input pin and the power source.

U1, U2 are controllers with pins, which have impedance built-in into the pins itself.  This means that the value of our R1 and R2 has to be adjusted accordingly to achieve the pull-up or pull-down effect.

Using two resistors in a serial connection we can create a simple voltage divider. Voltage  Why are we interested?  Unless you are lazy and get yourself bunch of LLC converters, which pretty much plug and play, this basic circuit is a solution to: “I have 5V board and I’m using 3.3V sensor“.  Pretty much any case when Arduino stuff is used on RPI and another way around. It allows you to take the initial Voltage from a power source and step it down to the desired value.  We can calculate the V providing we know the values of resistors R1 and R2 and the initial voltage from the power source.

Vout = Vin * [R1/(R1+R2)]

This is used to create a range of potentiometers,  the same principle is used in sensors (photo-sensor: R1 -resistor, R2 Photoresistive component), please don’t use this to lower the power supply voltage (ie stepping down 12V to 6V), as this is very inefficient and can cause problems from overheating, use voltage regulators instead.

I believe this is all you need to know to start working with resistors, whether on its own or with Raspberry PI and Arduino. I hope that this resistor for beginners guide helped you!

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

M5Paper

Programable, ESP32 based awesome dev platform with 4.7 e-ink display by M5Stack

More HATs

client-image
client-image

Argon One M.2

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO and M.2 SSD support

More cases on

client-image
client-image

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Slow Internet Warning

0
From time to time my Internet grinds to a stop. Since Raspberry Pi 4 comes with a 1Gbps Ethernet, I decided to take advantage of it and create a reporting system in NodeRED that will monitor and report when the ISP is not keeping the contractual agreements. Works with Alexa, Google Home, Android and Windows 10.

How fast Raspberry Pi NAS is?

0
Let's see how fast Raspberry Pi NAS really is?

Argon18: Argon ONE SSD modification

0
Argon One case just got better - now you can boot it from USB without ruining the design thanks to Argon 18: Argon One SSD modification

HOW TO...

How to boot Raspberry Pi 5 from NVMe M.2 SSD

0
This is how you can boot your Raspberry PI 5 from NVMe in 10 min! Check out these easy instructions

It took me 2 months to boot CM4 from NVMe

0
Complete beginners guide to Compute Module 4 boot from NVMe.

Raspberry Pi Zero 2 W vs other Zero boards

0
It's time to test the Raspberry Pi Zero 2 W against other Raspberry Pi boards from Zero series: power, WiFi, temperature and core performance

C/C++ and MicroPython SDK for Raspberry Pi Pico on Windows

0
A guide to SDK toolchain for Raspberry Pi Pico and C/C++ , Micropython on Windows.

A comprehensive guide to Grafana & InfluxDB

0
How to use Grafana and InfluxDB on Raspberry Pi for IoT sensors in home automation