Simple question about LEDs

Hi folks,

Pretty basic electronics question.
I am attaching three LED's to my Arduino Mini, a Red (2.1v,) Blue (3.2v), and Green (3.0v).

Based on my reading into electronics, I built three simple voltage divider circuits, that reduce the voltage to the correct level for each LED from the Mini's 5v, and the amp's down to the required 20mA, so that is two resistors per LED.

Equivalent circuits I have seen googling around, are just using a single resistor - presumably only to reduce amps down to 20mA. I was always told that having the voltage right, was one of the most important tenants of eletronics.

So I feel I am missing something, do I need the voltage divider?
If I don't, why not?

Ray K

You do not need a voltage divider. The voltages you listed, Vf for each LED, are the voltage 'drop' you will see across each LED when sufficient current is flowing to turn them on.
Every circuit makes a loop from 5V to Gnd.
For an arduino, it is 5V pin, thru output transistor, thru the LED, thru the resistor, to Gnd.
If the LED will have a 3.2V drop, and you assume the transistor has next to none, then the balance of the drop, 5V - 3.2V = 1.8V, will be across the resistor.
Now you can use Ohms Law and determine a resistor value to use to achieve a desire current.
Volts = Current x Resistance. Rearrange as Volts/Current = Resistance
(5V - 3.2V)/.02A (20mA) = Resistance to use = 90 ohm. So start with 100 or 150 ohm and see if that is bright enough. Bigger value resistor won't hurt, smaller value resistor runs the risk of damaging the Arduino's output transistor if the current starts approaching 40mA.

You are correct in your method that each LED will need its own value, although it is not a voltage divider, as per CrossRoads' explanation. Each resistor needs to be different because for the same current you will need to have a different voltage drop.

However, the same current does not mean the same brightness. In a single RGB LED you may need to experiment a bit to make sure that one color does not swamp the others out and make the RGB mix look wrong.

All of this post is just an attempt to help people getting started. Nothing profound. No questions.

Ohms' law works... except when it doesn't... and LEDs break Ohms' law!

Rare, but it happens. Happens inside transistors, too, where I still don't understand it all! But I understand LEDs!...

Think about them like this...

REGARDLESS of the current flowing through them the voltage will "drop" by a fixed amount. (Well... until the current gets higher than the LED can take, then it will go "poof", and REALLY start ignoring Ohms' law.)

The rest of the circuit WILL obey Ohm's law. So if you have an LED that causes a voltage drop of 2 volts, and you are powering things with 5v, it will behave as if you have 3 volts! Do your I=V/R with 3 volts and the value of the resistor you are using, and you'll know the current that will flow. (Don't factor in anything for the "resistance" in the LED. That's taken care of by what you've "left out" of the voltage moving the electrons.)

Strange but true! I haven't explained that very well, but I know when I first met "non-Ohmic devices" they really threw me, until I finally understood what "non-Ohmic" meant.

===
PS... someone kindly sent a PM disputing my "LEDs break Ohms' law..." And you what they say... if one person comments, 10 people had the same thought.

a) I was speaking in jest... always dangerous with expressionless email, etc.

b) But in jest with a serious purpose. Electronics being "science", we expect "laws" to be obeyed. And novices can be forgiven for thinking that Ohms' law is a general law. For not realizing (as I didn't... and it was a major barrier for me in several areas of early hobbyist electronics) that Ohms' law, while generally true can't be applied "simply" in every corner of the circuit.

Take the simple 5v supply- connected to- LED- connected to- resistor- connected to ground...

Ohms' law WORKS!... IF you know that you treat the LED as having "no resistance", BUT that the voltage "below" it (a dangerous shorthand, by the way) is the voltage "above" it, minus the LED's "Vf" (forward voltage) (which you get from data sheet, or by working backwards from what you see if you set something up that would be "okay" if the Vf is 2v (a good approximate value for many LEDs... sometimes more, so you're starting from the "safe" assumption, aren't you? And 20mA is reasonable for most power supplies and LEDs... but do your "what is this LEDs Vf" experiments directly across your power supply... if the current is much higher, it is too high for an Arduino pin. (Higher currents through your LED, with Arduino control, is done by using the Arduino to use a little current to "turn" a transistor "on" and "off".)


The person who wrote quite rightly pointed out that HUMAN laws vary from one place to another. I drive on the left in the UK, and on the right in the US.

But Ohms' law is a law of science... Apples accellerate at 9.8 m/sec/sec whether they are falling from an English tree or one in the US.

For MORE, if you can stand it! LED resistor basics... LEDs with Arduino- an introduction- aht0led


Voltages: They are always BETWEEN two places. Usually, we quote the voltage between a stated point and ground. But you can measure it across other pairs of points, and when you do, you usually call the number a "voltage drop". In the Vss /LED/ (wire A) / resistor/ Gnd example above, if Vss "is" 5v... i.e. you get "5v" when you connect voltmeter to Vss and Gnd...the "drop" across Vss-WireA would be about 2v. And if it was exactly 2v, then the drop across wireA-Gnd would be exactly 3v.

Ohm's law is that resistance is independent of current for certain materials (conductors basically). Or
put another way voltage is proportional to current (at a given temperature) for these materials.

Someconductor devices and insulators don't even remotely obey this. Vacuum tubes and superconductors
too.

For LEDs the current is more important. The resistor regulates the current and the LED regulates its voltage itself.

Ok folks,

Thanks now I get it!
So LED's behave a little bit differently - I didn't understand that before.

So basically, I take the LED voltage drop and deduct from the input voltage.
V = VIN - Vf

I then use the product V to calculate the resistance I need to produce the 20mA required by the LEDs
R = V / I

So

1.8 = 5 (VIN) - 3.2 (Blue LED Vf)
90 ohms = (1.8 * 1000) / 20mA

So a standard 90 ohm will cover the Blue LED?

Thanks,

Ray K

mdr78:
I need to produce the 20mA required by the LEDs...

If you have a car that can do 180km/h, are you then required to drive that fast?

20mA is the max allowed current for small indicator LEDs.
Modern LEDs could already be bright enough with 5-10mA.
The LEDs on your Arduino board draw 3mA.
LEDs for illumination, and matrixed LEDs are usually used at max current, but indicator LEDs don't always need that much.
Leo..

Modern LEDs are upto ~1000 times brighter than the very early ones, which you would struggle to see at 20mA
if there was ambient light! small LEDs have always been rated around 20mA despite this progress, manufacturer's know if they make a 5mA one people will complain that they are unreliable at 20mA....

The seller lists a 'Working Current' of 20mA, not a 'Maximum Current'.
But I guess your message is that it may work just as well at 10mA.

I will try values of 90 and 180 Ohms and see what I get.
Thanks for the tip!