How to know which resistor to use?

Hello!

As I already post in some other theme I'm newbie with electricity things, but I know some little basics. So my question is how to know which resistor I must use?
I know for Ohm's law, but I can't get values to calculate which will be best resistor to use. I've bought Arduino Base and I can't find values for LEDs and other things.

Thanks for help! :slight_smile:

I know for Ohm's law

The you know what resistor to use in any situation if you know the voltage and the current.

For a LED you know the current you want. The voltage across the resistor is the supply voltage minus the forward voltage of the LED.

Problem is in values (current) of LEDs and other things. I don't have any data on the box, so I can't calculate resistance for them. How can I know which resistor I have to use?

How do we provide specific help when you don't have specfics on the parts you are connecting?

Ohms Law, V=IR, or rearrange as V/I = R. V = voltage, I = current, R = resistance.
Pick 2, solve for the 3rd time:

(Vsource - Vforward-led)/20mA = Resistor needed

I don't have any data on the box, so I can't calculate resistance for them. How can I know which resistor I have to use?

If you don't know these things then you can not know what value of resistor you need.

How high do you need to jump to beat the world record?

If you don't know the what the world record is then you can't answer the question.

Hello,
I also recently bought an Arduino starter kit. The LEDs do not come with datasheets or any real specs. What I have been doing for these "generic" LEDs is assuming 2 volts each and calculating for 10mA. It works for simple projects but I figure when I want to make something worth keeping, I'll buy better LEDs and use proper specs. For now, I assume 2v each.

If using a circuit with 2 LEDs, the LEDs will use 4v. If connected to a 5v supply, I will have 1v left over. This "leftover" is what i use in Ohms Law. 1v divided by 10mA (keep it low to be safe) = 100?
If using a circuit with 3 LEDs, the LEDs will use 6v. If connected to a 9v supply, I will have 3v left over. This "leftover" is what i use in Ohms Law. 3v divided by 10mA (keep it low to be safe) = 300?
If the resistor comes to an odd size, i round up to the next closest resistor.

That help any?

If connected to a 9v supply, I will have 3v left over

I hope you are not connecting this chain of three LEDs to the arduino directly, you will damage the arduino.

The LEDs do not come with datasheets or any real specs. What I have been doing for these "generic" LEDs is assuming 2 volts each and calculating for 10mA.

Why not just measure the voltage across the LED when it is on?
Am sure you will find is ~1.5V for red, maybe ~1.7V for green or yellow, and ~3.2V for Blue.

2V and 10ma is pretty safe:
(5V - 2V)/.01mA = 300 ohm
(5V - 1.5V)/300ohm = 11.7mA

Grumpy_Mike:

If connected to a 9v supply, I will have 3v left over

I hope you are not connecting this chain of three LEDs to the arduino directly, you will damage the arduino.

Nope, just trying to explain it in a simple way from one noob to another.

Grumpy_Mike:

If connected to a 9v supply, I will have 3v left over

I hope you are not connecting this chain of three LEDs to the arduino directly, you will damage the arduino.

Why is that? Does the chain pull too much current?

Nope, just trying to explain it in a simple way from one noob to another.

Careful some might read that as "the blind leading the blind". :wink:

Daanii:

Grumpy_Mike:

If connected to a 9v supply, I will have 3v left over

I hope you are not connecting this chain of three LEDs to the arduino directly, you will damage the arduino.

Why is that? Does the chain pull too much current?

No, but 9 volts into the AVR will probably release the magic smoke so it no work so well anymore :wink:

Absolute Max voltage on a pin is 6V. When the pin is an input, not driving high or low, then the output will float to same voltage as the other side of the LEDs, 9V, and damage your output pin.

CrossRoads:
Absolute Max voltage on a pin is 6V. When the pin is an input, not driving high or low, then the output will float to same voltage as the other side of the LEDs, 9V, and damage your output pin.

I'm still not following. Say that someone put together a chain of three LEDs, with a current-limiting resistor calculated for a supply voltage of 9 Volts. Then that someone hooked one end of the chain up to an output pin of an Arduino and the other end, where the resistor is, to ground. So when the output pin of the Arduino is set to HIGH, the chain of LEDs gets 5 Volts.

The reason I ask is that in another thread someone did just that, and she got the LEDs to light up. I've been trying to figure out what exactly happens in that case, without much success. I'm curious, but don't want to burn out my Arduino experimenting.

With the output pin set to 5v, you have a chain of
9V - LEDs - Resistor - 5V, so there is 4V across the LEDs/Resistor, and one, maybe 2 will turn on at low current.

With the output pin set to 0V, you have chain of
9V - LEDs - Resistor - 0V, so there is ~9V across the LEDs/Resistor, and all should turn on.

With the pin as an input, as in after a reset and before the sketch starts and all pins are inputs, you have a chain of
9V-LEDs-Resistor-very high resistor-no effective DC level (such as 5V or Gnd), and no current flow - so the input will pin will see 9V and have a high potential to be damaged.

Atmel data sheet, May 2011, Section 29:

Absolute Maximum Ratings*
Maximum Operating Voltage ............................................ 6.0V
Voltage on any Pin except RESET with respect to Ground ................................-0.5V to VCC+0.5V

*NOTICE: Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage
to the device. This is a stress rating only and functional operation of the device at these or
other conditions beyond those indicated in the operational sections of this specification is not
implied. Exposure to absolute maximum rating conditions for extended periods may affect
device reliability.

Common DC characteristics TA = -40°C to 85°C, VCC = 1.8V to 5.5V (unless otherwise noted)

I'm talking about something different:

Arduino output pin -- LED -- LED -- LED -- resistor -- ground

So the Arduino output pin will provide from one to 5 Volts. As mentioned, in another thread, a chain of four LEDs plus a resistor was connected between an Arduino output pin and ground. When the Arduino output pin was set to HIGH, all four LEDs went on.

My own experience was to hook up an LED and a resistor between a digital-analog converter and ground. When I increased the voltage from the converter from 0 to 5 Volts, the LED turned on at about 0.5 Volts, and then got brighter up to 5 Volts. I had thought that the voltage would have to be at least 2 Volts to turn the LED on.

I'm just curious as to how this all works.

Ah, so the 9V was just a red herring then.
2 Red LEDs could certainly be driven, even yellow, green. 2 blues would not. I really doubt 3 would turn on.

The lowest Vforward I could find at Digikey is 1.6V.
I could see 4 in parallel, or 2 sets of 2 in series in parallel.

I thought you were talking of current sourcing.
9V -> resistor -> LEDs -> arduino output pin
This would fry the arduino as soon as you turned it off, while it was on it would be safe.

Now I'm confused :astonished:

If Arduino have 5V when it's plugged to USB, then I can connect only 2 LEDs on board (with 270ohm resistors)?

I'm asking this because I work on tutorials from here and I don't have all those resistors which are needed for some tuts. And one more question... somewhere I read there is no need to unplug Arduino from computer when changing wires on board and program, but on other site it's warning, that I need to unplug it when doing what I previously wrote.

Thanks! :slight_smile:

And one more question... somewhere I read there is no need to unplug Arduino from computer when changing wires on board and program,

You can read all sorts of rubbish on the internet, this is an example of it. You don't need to reload the program but you always need to disconnect the power when making wiring changes, otherwise the slightest slip can kill your system. There are many people on this forum that have found this out the hard way.

If Arduino have 5V when it's plugged to USB, then I can connect only 2 LEDs on board (with 270ohm resistors)?

With any sort of resistor powering LEDs from 5V then two is the limit, because there is not enough voltage to properly turn on three LEDs in series. Yes you might get some glowing but not properly.