Go Down

### Topic: Resistor Placement and Value - Understanding assistance needed (Read 1 time)previous topic - next topic

#### KG1610

##### Aug 09, 2017, 10:38 am
Hi All,

I am new to the Arduino world and new to Electronics
I am hoping someone can explain the following to help me understand whats going on.

What I would like to get more info on is the placement and Value of the resistors used in circuits.
let's use the following as an example and reference.

https://circuits.io/circuits/5145733-interactive-traffic-lights

How do you calculate the resistor value needed?
I understand we use Ohms Law - So the voltage of the Arduino is 5v and the current from the pins is 40ma so using Ohm's Law we would need a resistor with the Value of 125 ohms - is this correct ?

The Second Question is on the placement of the resistors

Why do you put the resistor for the Led before the Led - i.e Digital Pin -> Resistor -> Led -> Ground
in the same example circuit above for the Switch we put the resistor after the switch before the ground.
i.e 5v out -> Button -> Resistor -> Ground

Could you help me understand - links to video's i can watch to learn / an explanation would be great Thank you

#### MarkT

#1
##### Aug 09, 2017, 11:05 am
The resistor stops the LED or Arduino burning out.   Since the Arduino outputs 5V and the LED's forward
voltage is between 1.1 and 3.2V (depending on type/colour), the current would be unlimited without a
resistor to drop the excess voltage.

Without a resistor the internal resistance of the Arduino pin drivers (about 30 to 40 ohms) is the only
thing to limit the current, perhaps to 100mA or more, which is well above the absolute maximum current
for the pin drivers themselves as well as for the LEDs.

In a series circuit like the LED/resistor the order is irrelevant, everything is in series and thus has the same
current, the voltages sum to the same value whatever order the components are in.

The button circuit can be either way round too, though that reverses the sense of HIGH/LOW meaning
pressed/not pressed, since the Arduino is snooping on the voltage across part of the series circuit, ie
the order does then matter.

Kirchoffs current and voltage laws are simple, they should become second nature with a little practice and
thought.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### KG1610

#2
##### Aug 09, 2017, 11:18 am
Ok, Thank you.
Very interesting. I will go research some more.

Much Appreciated

#### Grumpy_Mike

#3
##### Aug 09, 2017, 12:02 pmLast Edit: Aug 09, 2017, 12:08 pm by Grumpy_Mike
Quote
Why do you put the resistor for the Led before the Led - i.e Digital Pin -> Resistor -> Led -> Ground
Their is no need to do this, it will work equally as well the other way round.

Quote
in the same example circuit above for the Switch we put the resistor after the switch before the ground.
i.e 5v out -> Button -> Resistor -> Ground
In the case of an input the resistor is acting as a pull down resistor making the input pin see a logic zero and then the button pulls the input up to a high that is 5V.

#### dougp

#4
##### Aug 09, 2017, 03:38 pmLast Edit: Aug 09, 2017, 08:46 pm by dougp
I understand we use Ohms Law - So the voltage of the Arduino is 5v and the current from the pins is 40ma so using Ohm's Law we would need a resistor with the Value of 125 ohms - is this correct ?
40ma is the maximum rated output of the pin. That doesn't mean you have to use it all, nor should you. The calculation should be made on the basis of what the LED needs to achieve a desired brightness. If that's even close to 40ma you need a driver capable of handling the desired current between the Arduino output and the LED (load). A rule-of-thumb resistor value for LEDs is 220Ω (at 5VDC). This gives a nice safe ~20ma for the LED to run on.

Limiting the current means everything runs cooler. And remember, heat is the enemy of semiconductors.
Everything we call real is made of things that cannot be regarded as real.  If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr

No private consultations undertaken!

#### tinman13kup

#5
##### Aug 09, 2017, 08:09 pm
Quote
I understand we use Ohms Law - So the voltage of the Arduino is 5v and the current from the pins is 40ma so using Ohm's Law we would need a resistor with the Value of 125 ohms - is this correct ?
No. Not the way you are looking at it. The 40mA pin MAX only refers to the maximum current the pin can source. It is not used for any calculation on attached components, but is referenced AFTER to ensure that number is not exceeded. In practice, it is wise to stay well below this figure for reliability and longevity. Exactly how much under is subject to debate, some going down to 50%, while others push beyond the limits.

When you are figuring current limiting resistors, they are based on the voltage and the device you are limiting, which in your case is a led and a pull down. The led might ultimately be set to use 10mA (depending on the resistor you use), so you could put 2 leds in parallel and still only be using 20ma. 20mA is less than 40mA, so it still falls under the max limits.
Tom
It's not a hobby if you're not having fun doing it. Step back and breathe

#### KG1610

#6
##### Aug 10, 2017, 11:10 am
Thanks All - Mind Blasting
Loving this journey but I am realizing how much there is to learn

Very happy the Arduino Community is how it is  - without this I wouldn't get far and in a few years when I know enough i will do the same and share the knowledge.

#### KG1610

#7
##### Aug 10, 2017, 03:51 pm
I have another question

Does a resistor use / consume the Current
or
just kind of blocks the flow of current ?

#### dougp

#8
##### Aug 10, 2017, 07:43 pm
Everything we call real is made of things that cannot be regarded as real.  If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr

No private consultations undertaken!

#### Grumpy_Mike

#9
##### Aug 10, 2017, 08:58 pm
Quote
Does a resistor use / consume the Current
Yes it burns it off as heat.

#### KG1610

#10
##### Aug 11, 2017, 11:51 am
aaah - 100% Thank you

#### kenwood120s

#11
##### Aug 11, 2017, 11:59 am
Yes it burns it off as heat.
... which is why you will also see resistors specified not only by their resistance but by their power handling ability. You need to ensure that the power dissipated (= I2R) is less than the rating of the resistor in Watts.
[gumby]I've got my head stuck in the cupboard[/gumby]

#### INTP

#12
##### Aug 11, 2017, 06:39 pm
You are plugging in the wrong numbers. You don't throw in your source voltage.
Your source is 5v. You look up what you LED 'consumes' called the forward voltage. Subtract this voltage drop from your source. The remaining voltage is what you're dealing with in Ohm's law. The current is how much you want to pass through the LED. 15-20mA is the usual. Plug in that voltage and that current (in Amps) and you'll figure
There are numerous calculators online, some explain what each field comes from. Understand this before moving on.

#### WayNeDogg

#13
##### Aug 21, 2017, 10:17 pm
The resistor stops the LED or Arduino burning out.
Hello!!

I am really fresh with Arduino and I just recently started with the Starter Kit projects.

I am really loving it and I am really willing to learn and fully understand each single process, therefore I apologize in advance for some stupid question I might raise.

My question is related to the first project of the starter kit (get to know your tools): I understand that the resistor is reducing the voltage in a circuit, in order the circuit (or, in this case, the LED) not to burn out.

As I trial, I tried to see what would have happened in the circuit if I removed the resistor. I expected the LED to light up much more and, eventually, to burn out; but actually it didn't happen. The only result was that the LED was not lighting up any longer.

Am I missing something here? How should I interprete this reaction?

Thanks a lot for your precious help!

W

#### Grumpy_Mike

#14
##### Aug 21, 2017, 11:28 pmLast Edit: Aug 21, 2017, 11:29 pm by Grumpy_Mike
Quote
I understand that the resistor is reducing the voltage in a circuit,
No that is incorrect. The resistor limits current, by itself it will do nothing to the voltage.

Quote
I expected the LED to light up much more and, eventually, to burn out; but actually it didn't happen. The only result was that the LED was not lighting up any longer.
Which sounds to me like it burnt out then?
When electronics go they can go fast, so that their is nothing to see.

Quote
As I trial, I tried to see what would have happened in the circuit if I removed the resistor.
You did replace it with a wire did you? If you just removed it then their is no circuit for the current to flow round.

Go Up