How do determine which resistor to use?

I'm very new to electronics and have been trying to read and absorb how use Ohm's law and how to calculate voltage, current and resistance but I still have a lot of questions. I won't ask them all at once but here's my first:

How do I determine which resistor to use in a circuit? Do I need to know the voltage and current and what a particular LED is rated at or what a servo is rated at? In all the examples I've seen (videos and on paper) they all just say to place a resistor between the 5v pin and the LED (or whatever). They don't say which resistor. So, how do I know which to use?

Since you're wanting to learn, take a look at a few Led datasheets, and select a
current value, and then use Ohm's Law to calculate the resistance to guve you that
current. You will also want to know the forward voltage drop across the Led.

[hint: R = 470 - 1000 ohms usually works].

There is an LED calculator:

http://led.linear1.org/1led.wiz

Plus some of the links there explain the theory.

Given that Ohm's Law is: V = I * R

To calculate R you need: R = V / I

An LED will have around a 2V forward voltage drop (see the datasheet for exact figures) so you need to drop 3V (5V - 2V) if you are plugging into an Arduino output pin.

Generally you might want 20 mA (0.020 amps) to light the LED. So substituting you get:

R = (5 - 2) / 0.020 = 150 ohms

Very cool! Thank you Nick and Dan for a pretty detailed explanation, exactly what I was hoping for.

So I guess it would be safe to assume that these steps and info would need to be repeated for each component that you add to the circuit/schematic?

James

Do I need to know the voltage and current and what a particular LED is rated at or what a servo is rated at?

And that can be the hardest question for a beginner to understand, which devices require external current limiting resistors and which do not?

An LED is a current driven device and thus requires external means to control the circuit current to at or less then the LED's maximum continuous rated value. The fact that an led has a forward voltage drop rating (Vf) is what confuses begineers a lot as while it does have a specific voltage drop rating it is not wired up as a voltage operated device, it needs the circuit current to be limited to a specific value.

A servo is on the other hand a voltage driven device, you just provide it with it's rated voltage and it will itself control how much current it will draw which can vary significanlty depending if the servo is a rest with no mechanical load (maybe 10ma draw) or turning a large mechanical load where it might draw 1 amp.

So while a formula is nice it's still more important to determine if the formula even applies to what you are wishing to wire up. Ohm's law always applies but how it applies depends on what component you are talking about and how it is going to be used in a specific circuit.

So learning electronics fundamentals in not rule based so much as having to understand the basic physics behind electronic circuits and components.

So which of the following is voltage driven or current driven devices?

A simple switch
A DC motor
A incandescent lamp
A AVR microcontroller chip

Those are not easily answered by raw beginners to electronics, as we often meet here in this forum, and while what can be obvious to many of us can be a real roadblock to others that are first starting on building their first arduino projects.

There is a reason that electronics fundamental are taught in a very logical sequence starting on what is voltage, what is current, what is resistance, and how does ohms law relate these three together. Then basic components like resistors and switches and lamps are drawn into circuits where one can see the basic properties used together in actual simple circuits. It's learning by bootstraping rather then memorizing rules and formulas.

I suspect the problem is the LEDS are so often the first component a beginner is encouraged to wire up to a arduino board, probably because the software guys need something to show off their classic 'hello world by blinking" program to introduce one to learning to program (yep it's all the software guys fault). The problem is a LED is a semiconductor and as such is never a component to start out with when learning electronic fundamentals via the classic step by step progression of learning ohms laws, simple series and parallel circuits, etc.

An Arduino with all it's software libraries and project examples makes it almost too simple for people to advance too quickly then they maybe should and assumes that the beginners will pick up good electronics fundamentals as they proceed, as needed. But that is maybe just a grumpy old hardware guy talking about the good old days, it's certainly possible to use an arduino and build impressive stuff without really having to learn much about electronics, which is what probably a lot of people want rather then any formal learning in electronics.

Lefty

Hi Lefty,

That's my problem, I don't even know what I don't know. My background is as a software developer writing business apps that hooks up to a database. So I guess I'm wanting to apply rules and logic as it would be applied to software development such as object oriented programming principles.

I've found several books or electronics and and the arduino architecture but I'm feeling a little overwhelmed about what I should read and understand first. At this point, I feel that I would benefit best if I understood some of these beginning concepts like what you mentioned, understanding voltage, current, resistance, ohm's law, how they all relate and then move on to what the different components are and what function they provide.

Is there a good book/books or even a particular author that you would recommend I start with? I've looked at the community college in my area to see if they offer any kind of beginning electronics course but I think I'm going to have to just call them as their online catalog leaves a lot to be desired.

Thank you for the great response Lefty!

euta226:
So I guess it would be safe to assume that these steps and info would need to be repeated for each component that you add to the circuit/schematic?

For limiting current through an LED? Sure.

There are other reasons to use resistors in circuits, however, such as voltage division or pulling a pin up/down, which come with the fundamental equation of Ohm's Law, but haven't different requirements for setting the resistance.

The real answer to the question How do I calculate the Ohms needed for my resistor? is It depends n the circuit.