EmbeddedRelated.com
Forums

LED & Resistor befuddlement

Started by Mike Turco June 2, 2004
On Wed, 02 Jun 2004 17:20:46 -0400, the renowned rickman
<spamgoeshere4@yahoo.com> wrote:

> >I have never been able to get an IV curve on LEDs and I have not >measured it myself. Anyone know how low the current must be to get the >voltage drop below 1 volt?
Very, very low. I measure about 60nA with the one I mentioned earlier. They follow the classic diode equation in this region up to perhaps a few mA where the series resistance starts to have a significant effect. Best regards, Spehro Pefhany -- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
Spehro Pefhany wrote:
> > On Wed, 02 Jun 2004 17:20:46 -0400, the renowned rickman > <spamgoeshere4@yahoo.com> wrote: > > > > >I have never been able to get an IV curve on LEDs and I have not > >measured it myself. Anyone know how low the current must be to get the > >voltage drop below 1 volt? > > Very, very low. I measure about 60nA with the one I mentioned earlier. > > They follow the classic diode equation in this region up to perhaps a > few mA where the series resistance starts to have a significant > effect.
What voltage do you measure on the LED with a current of 4 uA? -- Rick "rickman" Collins rick.collins@XYarius.com Ignore the reply address. To email me use the above address with the XY removed. Arius - A Signal Processing Solutions Company Specializing in DSP and FPGA design URL http://www.arius.com 4 King Ave 301-682-7772 Voice Frederick, MD 21701-3110 301-682-7666 FAX
> > >I have never been able to get an IV curve on LEDs and I have not > > >measured it myself. Anyone know how low the current must be to get the > > >voltage drop below 1 volt?
Once a diode is turned on, the voltage remains pretty much the same regardless of the amount of in-spec current you run through it. If you limit the current too much, the LED won't be bright enough, or won't turn on. In general, LED's drop between 1.5 and 2V. As you vary the current through the LED, you will see some variation in the forward voltage, but not enough to make a difference, and I doubt that a reliable way to use these devices. Mike
BPing :)

Spehro Pefhany wrote:
> On Wed, 02 Jun 2004 13:06:46 -0400, the renowned rickman > <spamgoeshere4@yahoo.com> wrote: > > >>Mike Turco wrote: >> >>>I thought this was going to be simple. I have a controller, an LED, a >>>resistor and a socket. Its a five volt circuit. >>> >>>I want to plug the LED into the socket in a board. The controller needs to >>>know whether or not the LED is plugged in, and if the LED is plugged in, it >>>needs to be able to turn it on and off. >>> >>>One issue is that the forward voltage of just about any LED puts all the >>>voltages out in the middle of no-mans land in terms of logic levels. >>> >>>Anyway, I came up with a solution, but it seems a little too complex and I >>>get the feeling I'm missing something. My solution is here: >>>http://miketurco.com/123/ledbef.gif . >>> >>>Basically, if you put a low on the input and there's an LED in the socket, >>>the LED will turn on and you'll get a low on the output. If there's no LED, >>>then you'll see a high on the output. >>> >>>Is there a way to accomplish this with one i/o pin? Any way to save a part? >> >>Seems to me you guys are all over thinking the problem... or I am >>missing something important. >> >>How about just adding one resistor and using the IO pin as an input when >>you want to check for the presence of the LED and as an output when you >>want to drive it? >> >> ___ >> | >> | >> - >> | | R1 >> | | current >> - limiter >> | ~330 ohms >> | >> --- >> \ / LED >> _V_ >> | >> +----------> To MCU IO pin >> | >> - >> | | R2 >> | | Light >> - Pulldown >> | ~10 kohms >> | >> _|_ >> \ / >> V >> >>With this circuit the IO pin will be high if the MCU is not pulling it >>down and the LED is installed. If the IO pin is not driving it low and >>no LED is plugged in, the IO pin will be low by R2. The IO pin can >>drive low to turn on the LED. > > > This will work with good margin for some LEDs and some input buffers, > and not at all or marginally with other choices. For example, a > super-bright green LED will yield about 2.2-2.3V typically at the > input with the above circuit and 5V Vdd. Some input buffers need Vdd * > 0.8 worst-case, others are okay at around 1.9-2.0V (the "TTL" type). > > Since this circuit is "measuring" the LED presence with 250uA rather > than 10-20mA, it has less drop and will work with more LEDs than the > circuit I showed, however it has one more component. > > Best regards, > Spehro Pefhany
I would skip the pulldown resistor altogether and simply drive the output low for a few cycles then switch it back to an input. The CMOS inputs have more than enough capacitance and a low enough leakage to hold the charge from the last driven state. After driving the pin low and floating with no led connected you should indeed find a logic low on the input even for 100's of microseconds afterwards. Normally I use this method for reading dip switches etc where the lead length is very short. If you want to run it a bit longer you should shield it somehow. After driving the pin low and floating it when a led is connected you should see the input charging up to within Vdd in a very short period. Method: 1. Drive pin low and switch to output mode 2. Hold for a few cycles 3. Switch pin to input mode 4. Wait for a few cycles 5. Read the input - low = (no led) This way you can still drive the LED with a high current and you don't need any additional components. -- Peter Jakacki
Mike Turco wrote:
> > > > >I have never been able to get an IV curve on LEDs and I have not > > > >measured it myself. Anyone know how low the current must be to get the > > > >voltage drop below 1 volt? > > Once a diode is turned on, the voltage remains pretty much the same > regardless of the amount of in-spec current you run through it. If you limit > the current too much, the LED won't be bright enough, or won't turn on. > > In general, LED's drop between 1.5 and 2V. As you vary the current through > the LED, you will see some variation in the forward voltage, but not enough > to make a difference, and I doubt that a reliable way to use these devices.
I don't think you have read enough of the thread to understand what we are doing. I am trying to use a pull down resistor to pull the IO pin on the MCU to ground when the LED is absent. When the LED is in place, the pull down resistor needs to be light enough (high enough resistance) to *not* draw any more current than necessary. The pull down resistor is not trying to make the LED light. The goal is to allow the LED to pull the IO pin up to a voltage that will be seen as a 1 on the MCU IO pin. I originally assumed that we were talking about TTL levels, but I expect there may be some devices that use CMOS thresholds on the inputs. -- Rick "rickman" Collins rick.collins@XYarius.com Ignore the reply address. To email me use the above address with the XY removed. Arius - A Signal Processing Solutions Company Specializing in DSP and FPGA design URL http://www.arius.com 4 King Ave 301-682-7772 Voice Frederick, MD 21701-3110 301-682-7666 FAX
"rickman" <spamgoeshere4@yahoo.com> wrote in message
news:40BEA128.435BADC1@yahoo.com...
> Mike Turco wrote: > > > > > > >I have never been able to get an IV curve on LEDs and I have not > > > > >measured it myself. Anyone know how low the current must be to get
the
> > > > >voltage drop below 1 volt? > > > > Once a diode is turned on, the voltage remains pretty much the same > > regardless of the amount of in-spec current you run through it. If you
limit
> > the current too much, the LED won't be bright enough, or won't turn on. > > > > In general, LED's drop between 1.5 and 2V. As you vary the current
through
> > the LED, you will see some variation in the forward voltage, but not
enough
> > to make a difference, and I doubt that a reliable way to use these
devices.
> > I don't think you have read enough of the thread to understand what we > are doing.
I'd better read it from the top.
> I am trying to use a pull down resistor to pull the IO pin > on the MCU to ground when the LED is absent.
I understand what you're saying. The thing is that the drop across the LED is a fixed voltage of about two volts, and that puts the logic level into never-never land.
> When the LED is in place, > the pull down resistor needs to be light enough (high enough resistance) > to *not* draw any more current than necessary. The pull down resistor > is not trying to make the LED light. The goal is to allow the LED to > pull the IO pin up to a voltage that will be seen as a 1 on the MCU IO > pin.
OK, lets say you have a 1k pull-up resistor and a 10k across the LED. The voltage drop across the 10k resistor is going to be ~ 2V. So, then, you change the pull-up to 330 and the 10k to a 100k, but it doesn't make a difference? Why? Because the voltage across the LED is always going to be pretty much the same -- that's the nature of a diode. Another thing I thought about doing is putting two resistors in series under the LED. But it just doesn't cut it. Last night I was thinking about this problem for just one LED. The fact is that I need to implement this into a 4x4 array of these "LED Switches". So.... the basic question remains, but its not so many transistors after all.
> > I originally assumed that we were talking about TTL levels, but I expect > there may be some devices that use CMOS thresholds on the inputs.
I will probably use a mux on the keypad rather than a controller, so I have a choice between TTL & CMOS, but not A/D. Mike
Peter Jakacki wrote:
>
... snip ...
> > I would skip the pulldown resistor altogether and simply drive the > output low for a few cycles then switch it back to an input. > The CMOS inputs have more than enough capacitance and a low enough > leakage to hold the charge from the last driven state.
Bad idea. You just don't leave CMOS input lines open. They can drift to a state where both input transistors are on, and just drawing excess current without limit. -- fix (vb.): 1. to paper over, obscure, hide from public view; 2. to work around, in a way that produces unintended consequences that are worse than the original problem. Usage: "Windows ME fixes many of the shortcomings of Windows 98 SE". - Hutchison
CBFalconer wrote:
> Peter Jakacki wrote: > > ... snip ... > >>I would skip the pulldown resistor altogether and simply drive the >>output low for a few cycles then switch it back to an input. >>The CMOS inputs have more than enough capacitance and a low enough >>leakage to hold the charge from the last driven state. > > > Bad idea. You just don't leave CMOS input lines open. They can > drift to a state where both input transistors are on, and just > drawing excess current without limit.
You squeezed the trigger too soon and missed the point. Besides, when a micro is in reset all IO are inputs and floating, and that's for at least several if not 100's of milliseconds, isn't it? This includes spare pins that are not terminated and that configured as outputs for this reason. If you had thought about it further you would of realized that the pin is normally in output mode anyway and just switching to input mode when testing. We can't work with "ideal" circuits, we just make real circuits work for us, that's what engineers do. -- Peter Jakacki
Mike Turco wrote:
> > I understand what you're saying. The thing is that the drop across the LED > is a fixed voltage of about two volts, and that puts the logic level into > never-never land.
Oh, I see you are the OP. But your assumption that the LED has a constant 2 volt drop is not accurate. The drop is a function of current. Anyway, if your MCU input levels are TTL compatible, you don't have a problem in any event. What does your data sheet say?
> I will probably use a mux on the keypad rather than a controller, so I have > a choice between TTL & CMOS, but not A/D.
If you can pick TTL levels, then the problem goes away.... -- Rick "rickman" Collins rick.collins@XYarius.com Ignore the reply address. To email me use the above address with the XY removed. Arius - A Signal Processing Solutions Company Specializing in DSP and FPGA design URL http://www.arius.com 4 King Ave 301-682-7772 Voice Frederick, MD 21701-3110 301-682-7666 FAX
"rickman" <spamgoeshere4@yahoo.com> wrote in message
news:40BF41A4.B517795D@yahoo.com...
> But your assumption that the LED has a > constant 2 volt drop is not accurate. The drop is a function of > current.
The drop is usually closer to 1.5 or 1.8v, which really doesn't cut it for TTL or CMOS.
> Anyway, if your MCU input levels are TTL compatible, you don't > have a problem in any event. What does your data sheet say?
I'm still working on the schematics. I plan to use the usbmicro U421, or something like that, and am still looking for a mux.
> If you can pick TTL levels, then the problem goes away....
Anything between .8 and 2V is in la-la land for TTL, and the level for CMOS (IIRC), are 1.5 and 3V. There may be LED's out there that put me on the cusp of conformity. Next time you get hold of an LED and a few resistors, you might want to build a little circuit. Just an LED, a resistor and a power source. Change the value of the resistor and measure the voltage across the LED. You'll find that the voltage across the LED changes very little, if at all, with any amount of current you drive through the device, within reasonable limits. Mike