What resistor do I use and how?

How do I know what resistor to use? I can use V=IR but how do I know V, and I? Sorry, I am very new to arduino and electronics in general. help anyone?

How do I know what resistor to use?

It all depends on what you want to use it for.
That’s a hint for you to tell us.

Here’s a little example:

First, V=IR is Ohm’s Law. That’s the voltage (in V) is equal to the current (in amps) times the resistance (in ohms).

Let’s say I want to make a spiffy Knight Rider block out of this blue bar graph LED from Sparkfun. This is really just 10 LEDs in the same package. Sparkfun thoughtfully provided the datasheet that tells me this device can handle a peak of 30mA, but is meant to carry 20mA. I also know (from the ATmega datasheet) that my Arduino can supply a maximum of 20mA per output pin. I am going to be conservative and decide I want to operate it at 15mA. My Arduino also operates at 5V. Now it’s time to whip out Ohm’s Law:

V=IR

5V = 15x10-3 x R

solve for R, and we get

R = 5V / 15x10-3 = 333.3333333

So, I need a 333 Ohm resistor to get that 15mA. I look and can’t find a 333 ohm resistor (or maybe I did finds one, but it was a 0.01% ultra high precision job for US$17), so I round off to the standard 330 ohm value.

Let’s say, for the same LED, I can’t find a 330 Ohm resistor, but I do happen to have a 470 ohm. Will that work? Ohm’s Law says

V=IR

5V = I / 470

I = 5V/470ohm = 10.6x10-3A ~= 10mA

So the 470 ohm, while not as bright as absolutely possible, will work.

hth.

-j

Thank you so much! But, MAKE didn't include a data sheet so I don't know how much the LED can handle. How do I figure out?

Well, for a LED you're probably talking about a current-limiting resistor, so you need to know what the maximum current for the LED is, and what the forward voltage drop across the LED is. Then you need to know what the supply voltage is.

Suppose the supply is 5V, and the forward voltage is 2V, and the current required is 20mA (0.02A).

V= IR, so R = V/I.

So, (5 -2) / 0.02 = ?

Nvm, found a datasheet thank you!

But, MAKE didn't include a data sheet so I don't know how much the LED can handle. How do I figure out?

LEDs can take from a few mA to hundreds of mA - you need to find this out from a datasheet.

=150 what is forward voltage?

what is forward voltage

Vf or Vfwd from the LED datasheet.

What resistor is attached to pin 13 of the duemilanove?

http://arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf

1K