Hi,
I have a led that works with about 3v. I know that Arduino digital output is 5v and I need to apply a resisteance in serial with the led before connect. How is the formula to get the number of ohms in this case and in general porposes? I mean: How can I get the required ohms of a resistence if I want to reduce Xvolts to Y volts, being Y<X?
Many thanks,
We need one more piece of information... We need to know the current rating on the LED.
[u]Ohm's Law[/u] describes the relationship between voltage, resistance, and current. We can't apply Ohm's Law directly to the LED because LEDs are non-linear and the it's resistance changes when the voltage changes.
But if we know the voltage across the resistor and the current through it, we can use Ohm's law to calculate the required resistance as Voltage/Current.
You also need to know that the same current flows through all components in series, and that the voltage gets divided among series components ([u]Kirchhoff's Laws[/u]).
OK... Let's say your LED is rated at 20mA. If there is 3V across the LED, that leaves 2V across the resistor. 2V / .020A = 100 Ohms.
DVDdoug:
We need one more piece of information... We need to know the current rating on the LED.
[u]Ohm's Law[/u] describes the relationship between voltage, resistance, and current. We can't apply Ohm's Law directly to the LED because LEDs are non-linear and the it's resistance changes when the voltage changes.
But if we know the voltage across the resistor and the current through it, we can use Ohm's law to calculate the required resistance as Voltage/Current.
You also need to know that the same current flows through all components in series, and that the voltage gets divided among series components ([u]Kirchhoff's Laws[/u]).
OK... Let's say your LED is rated at 20mA. If there is 3V across the LED, that leaves 2V across the resistor. 2V / .020A = 100 Ohms.
Thanks DVDoug,
how can I know which rated intensity by only looking at the LED? I'm talking about the led's included in the Arduino starter kit. There's no information about the vendor or something like that.
The second question is that the amprage depends on the Arduino UNO board that sends it or the LED? You mentioned 20mA.
Paul__B:
Very few LEDs would be limited to 5 mA, so 470 ohms would generally be safe.
{OK, I do know - the old HP "bubble" displays.}
Thanks Paul,
the problem is to deduce what's the amperage of the LED, depends on the arduino board UNO that I use? Or by the LED manufactured. How can I know whether are 5mA or 20mA? There's any way to calculate the resistence value without taking care about the amperage?
Many thanks,
That's what datasheets are made for. Any part comes (or should come) with a datasheet giving all its specs. For an LED, it gives for example, the rated voltage and rated current. However, for standard LEDs like the one you have, the maximum safe current will be around 30 mA. Depending on the brightness you want, the actual current you want to give the LED will often be between 5 and 20 mA. Just try.
Since you use Ohm's law to calculate the resistor, you can't ignore the amperage. It's the main data here!
It depends on the LED. Where did you get the 3V rating? If you just experimented used 3V without a resistor, that's a bit high... Most LEDs run at about 2V, but it depends on the color.
10-20mA at 2V is a pretty safe assumption for the "average" LED. With a 5V supply, 180 - 220 Ohms is usually about right, and usually safe. If the resistance it too high (and the current too low) the LED will be dim or it won't come on at all. It the resistance is too low (too much current), you can fry the LED or the Arduino. (The Arduino is rated at 40mA maximum.)
DVDdoug:
It depends on the LED. Where did you get the 3V rating? If you just experimented used 3V without a resistor, that's a bit high... Most LEDs run at about 2V, but it depends on the color.
10-20mA at 2V is a pretty safe assumption for the "average" LED. With a 5V supply, 180 - 220 Ohms is usually about right, and usually safe. If the resistance it too high (and the current too low) the LED will be dim or it won't come on at all. It the resistance is too low (too much current), you can fry the LED or the Arduino. (The Arduino is rated at 40mA maximum.)
Hi DVDoug,
I understand you now. The main idea is to know the maximum amperage and maximum voltage of a component to then calculate the before resistence value you must set to it in order to not burn it.
Many thanks,
In that case, it's more like : you know what current you want to put thru your LED. The datasheet tells you if this current is acceptable or if it might destroy the LED. It then tells you, with that current, what will be the voltage on the LED.
If you have not got a data sheet then assume the maximum current will be 20mA into the LED. But it will be almost the same brightness with 10 or 15 mA due to the responce of the human eye being logarithmic.
Thanks all for your help, now I understand the main principles of this calculations, but there's still a lot of work to do, because there's still a lot of electronic component that I'd like to use and I don't know how to connect them to create my own "robots" or "circuits" in Arduino. If you let me, I will ask you in these forums.
Many thanks,
Well, I don't think we could stop you from asking even if we wanted to. After all, if it weren't for people like you, we'd be out of a job...
FYI, the forward voltage rating of a led is the voltage at which it begins to conduct. Led
If you had a variable voltage power supply (or an Lm317 adjustable voltage regulator circuit), you could find out the forward voltage empirically, by putting a 330 ohm resistor in series with the led connected to the output of the adjustable regulator circuit with a voltmeter on the Anode of the led, the cathode connected to GND , and the resistor in series with the regulator and the anode. Start at the lowest voltage and gradually increase the regulator output until the led begins to conduct and do not increase the voltage beyond that point. Look at the voltmeter . That's the forward voltage. Put the meter leads across the resistor and record that voltage.
ILed = VR/R
Let VR = 3V, for the sake of discussion (you can substitute the real value later)
ILed = VR/R = 3V /330 ohms = 9.1 mA.
If you change the value of RCL (CL = Current Limiting) until you obtain a voltage of 3V,
assuming that is in fact the voltage at which the led begins to conduct, which I doubt, your resistor would probably be about 150 ohms. (because 3V/0.020 A = 150 ohms)
My guess is that the garden variety red leds in your starter kit have a forward voltage closer to 2.0V.
I measured one using a 100 ohm resistor and got 2.006V across the led when I had 2.0V across the 100 ohm resistor (which is 20mA). Led forward voltage rating is always given as some specific current because otherwise there would be no reference point. Typically the led I used would have a forward voltage rating of 2V @ 20mA. This same led has a forward voltage of 1.944V @ 10mA (when the 100 ohm resistor has 1.0V across it).
For the sake of discussion, the forward voltage rating is not necessarily the voltage at which the led begins to light because a led with a Vf of 2V @ 20mA is visible when it is drawing less than 20 mA. Rather than say the led forward voltage is the voltage at which it "begins to conduct", it would be more accurate to say the forward voltage is the voltage at which the led draws the rated current (ie: 20mA for a led rated for 2V @ 20mA)