PDA

View Full Version : When Driving An Indicator L.E.D.



Keith55555
- 11th November 2021, 16:10
I've thought of this for a while and it has come up I need to know how it applies to a usage:
In the PBP Manual, there is a simple blinking of an L.E.D. test in one of the commands as an example.
The circuit shows an output pin on a PIC to the L.E.D. anode and the cathode though a resistor to ground. PIC is running at 5 volts.
My question is how (since most L.E.D.s forward voltage is rated at 1.5 to maybe 3 volts) is the L.E.D. handling the output of the PIC without being destroyed.

I'm pulsing the IR L.E.D. in a Solid State relay (see link) and would love to avoid translating through a mosfet down to the nominal forward voltage of the L.E.D. shown in the data sheet. Pulses are from 1 to 40 milliseconds long. All of supply is a regulated 5 volts. Can I skip the translation voltage?

I've also seen 'power on' indicators go from Vin to resistor/L.E.D.

I don't get it. :confused:

https://media.digikey.com/pdf/Data%20Sheets/Omron%20PDFs/G3VM-zBRzzzERzz_DS.pdf

HenrikOlsson
- 11th November 2021, 18:17
That's what the resistor is there for, it's basic Ohms law (look it up if you don't know about it, it's fundamental in electronics)

The PIC outputs 5V, the forward voltage of the LED is 1.5V at 10mA. So you need to drop 3.5V across the resistor when 10mA flows thru it.
R=U/I or 3.5V/0.01A=350Ohm. For a LED this is not at all critical, a 220Ohm resistor will work and so will a 680Ohm resistor.


EDIT: Oh, another thing that might confuse you. LEDs (being diodes basically) are highly non linear, they're not meant to be driven by a low impedence voltage source. They are current driven devices and the Vf figure is the voltage that is being dropped across the LED at a specified current.

Keith55555
- 11th November 2021, 18:55
I thought the resistor only provided current limiting? Maybe you've explained but I don't get how it drops the voltage. I've used voltage dividers using 2 resistors, etc.
Thanks for your patience.

Keith55555
- 11th November 2021, 19:11
Also, when you say 'L.E.D.s aren't meant to be driven by a low impedance voltage source; isn't when a circuit using an L.E.D. for a power indicator (which I've seen) driven by a regulators output (to say power is turned on via throwing a switch in the circuit) a low impedance source?

HenrikOlsson
- 11th November 2021, 19:33
I thought the resistor only provided current limiting? Maybe you've explained but I don't get how it drops the voltage. I've used voltage dividers using 2 resistors, etc.
As before, Ohms law says that U=IxR, voltage = current x resistance. For a given current thru a given resistance there is a given voltage drop. The voltage drop across the LED is relatively constant (around 1.5V in your example). For a voltage drop of 5V across the LED the current would be in the tens of amps, instantly destroying the LED - provided the source could deliver that amount of current of course.


Also, when you say 'L.E.D.s aren't meant to be driven by a low impedance voltage source; isn't when a circuit using an L.E.D. for a power indicator (which I've seen) driven by a regulators output (to say power is turned on via throwing a switch in the circuit) a low impedance source?
The voltage regulator itself is a low impedance voltage source but surely there was a resistor in series with the LED wasn't there? That resistor turns that low impedance voltage source into a high(ish) impedance source, limiting the current thru the LED to whatever the designer of the circuit has decided.

tumbleweed
- 11th November 2021, 21:24
I'm pulsing the IR L.E.D. in a Solid State relay (see link) and would love to avoid translating through a mosfet down to the nominal forward voltage of the L.E.D. shown in the data sheet. Pulses are from 1 to 40 milliseconds long. All of supply is a regulated 5 volts. Can I skip the translation voltage?


Once you figure out how an LED works, then you can skip any additional circuitry you have driving the MOSFET relay LED input, and just treat it like a normal LED.
All you need is a resistor in series with the input LED. According to the datasheet you want a min of 3mA to turn it on, so to be safe calculate R so that you get 5mA,
something like R=(5V-Vf)/0.005, where Vf is the LED forward voltage taken from the datasheet.

Keith55555
- 11th November 2021, 21:49
Yes there was always a resistor. Thank you for the lesson.

mpgmike
- 12th November 2021, 01:36
The PIC outputs 5V, the forward voltage of the LED is 1.5V at 10mA. So you need to drop 3.5V across the resistor when 10mA flows thru it.
R=U/I or 3.5V/0.01A=350Ohm. For a LED this is not at all critical, a 220Ohm resistor will work and so will a 680Ohm resistor.


I thought the resistor only provided current limiting? Maybe you've explained but I don't get how it drops the voltage. I've used voltage dividers using 2 resistors, etc.

It may be helpful to try what HenrikOlsson suggested. Put a volt meter at the LED Anode (the + side, assuming the resistor is placed on the LED's "+" side) with a low value resistor (referencing the math provided by Henrik, try 220 Ohms) and see what the actual voltage is. Then replace the resistor with one a bit higher in value and retest the voltage. Repeat with an even larger resistor. You'll see that the voltage at the LED Anode doesn't change much as you swap out different resistors. HOWEVER, the CURRENT flowing through the circuit DOES change. (Ohm's Law stuff.) This will eventually affect how bright the LED appears to your human eye.

Most 8-bit PICs have 25ma ratings on the individual pins (some are as low as 10 ma, some as high as 50; you didn't mention the PIC part you're playing with). Therefore, driving an LED is perfectly safe, so long as you include the 'current limiting' resistor.

Keith55555
- 12th November 2021, 02:33
Thanks Mike. I'm using the 16F1823.

Amoque
- 12th November 2021, 22:29
Take a look at charlieplexing if you'd like to see LED indicators taken to the extreme. Not saying this applies to your question, but it will give you some insight into how cleverly these simple rules can be applied.