# Question regarding resistors and LED

Hello everyone,

I am a software engineer who has always had the passion of eletronics. Recently I decided to really get into it, get my self an arduino and study electronics really well to have a deep understanding of how to build a circuit and try to understand the physics behind it (to the point where I know what I am building and why).

I am trying to learn so I apologize if I ask a stupid question or I am concentrating on the wrong thing, but my intent is not to just get an answer and build a circuit, but to actually understand each single part of what I am doing.

I have a couple of questions on the simplest circuit you can build, the classic Arduino Hello World.

I attached the circuit everyone recommends building.
Also:

The Arduino specs (as you guys probably already know) are the following: output pins: 5V, 40mA
The LED specs are the following: 1.8-2.2 V, 20mA max

So, here are my questions:

1. Why when I am building a circuit, I need to limit current but not voltage? in other words, the resistor won’t modify the voltage of the output, it will just limit the current on the other side of it. If the LED supports max 2.2V, wouldn’t it get ruined by sending 5V to it?

2. I first tried to connect the led directly to the arduino and it worked without the LED breaking or anything. Does that mean that even if the specs say max 20mA, the LED actually supports more?

3. if I do the calculation by hands, I find that a 330 Ohms resistor is too much but maybe I am doing the wrong calculation:

Arduino outputs 40mA, but LED needs max 20mA. I need to find a resistor such that it blocks 40 - 20 = 20ma

R = V / I → R = 5V / 0.02A → R = 250 Ohms

So why can I put a 330 Ohms resistor and it still works?

330 = 5 / I → I = 15mA.

Am I not blocking too little current? Arduino sends 40mA, I am blocking 15 so I am sending 25mA.
Also it’s kind of not intuitive that as I use a bigger resistor I am blocking LESS current, but maybe I am not understanding something.
It seems that as the resistor tends to INFINITE, I am blocking close to 0 current, which doesn’t sound intuitive.

1. Is that any resistor that will block so much current that the led won’t turn on?
I was thinking:

R = 5V / 0.04 A → 125 Ohms. Does this mean that if I put a 125 Ohms resistor I will block all current and the LED won’t turn on?

1. Electrons go from negative to positive but the model says current is going from positive to negative. Is that why I need to put the resistor BEFORE the + goes into the led? Is it any useful if I put it after?

Thanks in advance for the reply, hopefully I will get a better understanding of this as times goes by.

Paolo

circuit.tiff (41.1 KB)

play it safe.. Use 200 Ohm+ Also be aware of total current. (sum all pins)

Hi knut_ny,

thanks for your reply. Does that mean that it's not safe to use a 330 resistor because it doesn't block enough current? Again, I am kind of confused by the fact that a bigger resistor blocks LESS current that a smaller one. Am I getting this wrong?

Paolo

any 200Ohm + will do. Greater value reduces current => dimmer light. Select the one that give you the intencity you want. Resistor before/after do same job. Doesnt matter at all.

Greater value reduces current

Ok, that makes more sense. Though it doesn't match the formula.

R = V/I which means I = V/R which means that with V being constant, R has to get smaller for I to get bigger.

if "I" is the current I want to block, then it seems like R has to get smaller. Am I applying this formula in the wrong way?

Why when I am building a circuit, I need to limit current but not voltage? in other words, the resistor won't modify the voltage of the output, it will just limit the current on the other side of it. If the LED supports max 2.2V, wouldn't it get ruined by sending 5V to it?

Your difficulty of understanding is that you haven't yet mastered learning basic DC Ohm's Law. The resistor is 'consuming' voltage' as the voltage drop across the resistor is equal to current X resistance and that voltage is therefore not 'avalible' to the LED.

A better learning method of learning electronics is to find a basic primer on Ohm's Law and study that till you get a good understanding of the relationship between voltage, current. and resistance in simple passive DC circuits. By 'jumping ahead' and including a LED you are missing the knowledge necessary to understand even simple circuits. Semiconductors (like LEDs) are usually taught only after studying basic DC circuits then basic AC circuits. There is a good reason to keep to a time tested logical progression of lessons and topics as they build on each other and make each new subject easier to master. Otherwise you end up just memorizing a bunch or rules or facts that don't always make sense and don't support further growth of knowledge in electronics.

By 'jumping ahead' and including a LED you are missing the knowledge necessary to understand even simple circuits. Semiconductors (like LEDs) are usually taught only after studying basic DC circuits then basic AC circuits.

Maybe I am jumping ahead. I am studying electronics on a couple of books, one of which is "Practical electronics for inventors". It is a pretty in depth book and I am still at the beginning on the Physics chapter.

I thought that Ohms law would apply directly like that but apparently I am missing some step somewhere.

Would you recommend any source that maybe, in your experience, you know it explains this concept better?

Higher resistans, thinner tube, less current.
Higher voltage more current.

Pelle

PaoloS:

By ‘jumping ahead’ and including a LED you are missing the knowledge necessary to understand even simple circuits. Semiconductors (like LEDs) are usually taught only after studying basic DC circuits then basic AC circuits.

Maybe I am jumping ahead. I am studying electronics on a couple of books, one of which is “Practical electronics for inventors”.
It is a pretty in depth book and I am still at the beginning on the Physics chapter.

I thought that Ohms law would apply directly like that but apparently I am missing some step somewhere.

Would you recommend any source that maybe, in your experience, you know it explains this concept better?

Again any fundamental training material the progresses from basic DC circuits then basic AC circuits first before introducing semiconductor components like diodes and transistors, let alone ‘digital output pins’.

A basic DC circuit is one that would have only a single DC voltage source, any number of resistors wired first in series then parallel then a combination of series and parallel resistors, and maybe a on/off switch. One is usually tasked to be able to calculate the total circuit current and the voltage drop and current flowing through each individual resistor. It may sound too basic but it’s a fundamental step in learning electronics in a logical progression. It’s been way too many decades for me to recommend a specific lesson plan, but a quick goggle search turned up the below link. It may not be how you thought to proceed, but you really should put the arduino aside for awhile if your goal really is to learn basic electronics. Arduino projects tend to make it too easy to jump ahead a build really cool stuff that works, but tends to leave large gaps in understanding what is really happening at the electronics level.
http://www.learnelectronicsonline.com/

EDIT: On looking further on that site I think it’s too simplistic and brief to do justice to the task at hand. If I find something better I’ll add it here.

Arduino projects tend to make it too easy to jump ahead a build really cool stuff that works, but tends to leave large gaps in understanding what is really happening at the electronics level.

I agree, and I am not afraid to put it aside and study the basics before moving on. It’s just so tempting to do stuff though

Anyway, thanks for the help. I’ll review those concepts and make sure I have a solid understanding of DC circuits and then AC circuits before moving on.

Thanks,

Paolo

PaoloS: The reason you were getting the wrong answer is that the LED itself has a voltage drop that varies by color!

Here is the generic calculation: https://www.sparkfun.com/tutorials/219

Ohm's Law applies when you have all the pieces.

Ray

4) Electrons go from negative to positive but the model says current is going from positive to negative. Is that why I need to put the resistor BEFORE the + goes into the led? Is it any useful if I put it after?

It is a common beginner mistake to think the direction of current matters. In electronic engineering it is simply irrelevant. If you think it does matter then you have not grasped the fundamental concept of a circuit, that is the circulation nature of electricity.

It matters not where you put the resistor for the LED before or after it is just the same.

In explaining how you got away with it directly connecting your LED, draw a rectangle to represent what is inside the arduino and within it +5V and an "internal resistance" about 200 ohms to the digital output pin of the arduino. From the output of the arduino, draw another resistance. This is the"200" or "2000" Ohms which friends here have advised. From that draw an LED to ground.

"Internal resistance" is perhaps not quite what I wrote as it arises from thin metal tracking within the chip, smallish transistors in there, and anything else which might get in the way of current flowing. Whilst it might deliver up to 40mA you really want to draw a lot less than that so if anything gets hot it is not within the chip. For example set a desgn goal of 1mA.

red LED at 1mA is about 1.9V (from datasheet) your external resistor needs to drop most of the remaining 3V at 1mA arduino internal drop at 1mA is going to be about 0.2 Volts, so it won't burn anything inside the chip.

Your external resistor R=V/I = 3/0.001 (Volts/Amps) = 3kOhm

It won't matter if you chose 2000 Ohms instead of 3000. Doing so should get 1.5mA instead of 1mA If you can afford a multimeter, (those were below £10 last time I looked), that would be a good thing to have.

If you can afford a multimeter, (those were below £10 last time I looked), that would be a good thing to have.

... And inside the meter is (almost always) is a fuse to protect the meter from over-current situations. Buy spare fuses! You will be glad you did