EmbeddedRelated.com
Forums

LED & Resistor befuddlement

Started by Mike Turco June 2, 2004
"Peter Jakacki" <peterjak@tpg.com.au> wrote in message
news:40be8267@dnews.tpgi.com.au...
> BPing :) > > > 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.
OK, if the LED is connected, what will you see? Still a low?
Mike Turco wrote:
> > "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.
We are not communicating somehow. If the LED and current limit resistor are connected to VCC and you have a 1.5 volt drop, the IO pin will be at 3.5 volts which is *well* above the required 2.0 volts for a TTL input. But as I said, the voltage drop across an LED or any other diode is a function of current. If you have a very light current, you can get the voltage drop to anything you want. Since CMOS inputs are typically rated for 0.7 * VCC you will need an off state voltage on the IO pin of 3.5 volts min to see a one and show the LED is connected. Until someone shows me otherwise with a IV curve, I expect you can reach that voltage with a 1 MOhm pulldown.
> > 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.
The mux can be either a digital mux with inputs and outputs, or you can use an analog switch type mux. If you use an analog switch, you can get away with just one sense circuit, but then I may not understand what the mux is doing. Can't you use your outputs as OC drivers and also inputs and do without the 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.
You are thinking of an LED that is connected to ground. Connect it to VCC instead and you get 3 to 3.5 volts in the pulled up state with a stiff pulldown resistor. Use a (very) light pulldown and you will get a higher voltage.
> 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.
What do you call "reasonable limits"? What voltage do you get with 4 uA vs. 4 mA? If you think a diode is a constant voltage device, you need to go back to your textbooks. All diodes that I work with have a logarithmic IV curve. I think the real problem here is that you are not following what I am proposing. Check the circuit that I drew again. You will see that the IO pin will not see .8 to 2 volts. It will either be ground when the LED is turned on, or some high voltage determined by the VCC minus LED voltage with an appropriately low test current. -- 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
Mike Turco wrote:
> > "Peter Jakacki" <peterjak@tpg.com.au> wrote in message > news:40be8267@dnews.tpgi.com.au... > > BPing :) > > > > > > 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. > > OK, if the LED is connected, what will you see? Still a low?
With the LED in the circuit the pin will be pulled up very quickly to a high voltage. -- 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:40BF8F2C.339D1F9D@yahoo.com...
> Mike Turco wrote: > > > > "Peter Jakacki" <peterjak@tpg.com.au> wrote in message > > news:40be8267@dnews.tpgi.com.au... > > > BPing :) > > > > > > > > > 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. > > > > OK, if the LED is connected, what will you see? Still a low? > > With the LED in the circuit the pin will be pulled up very quickly to a > high voltage.
I'm not clear on the concept. Is this the circuit? +5 | | 1k ohm | | LED | ----------------- I/O If the LED is not in the circuit, given the capacitance of a CMOS output, I can see the output staying at whichever state it is driven for long enough to be measured (State 1 & 2). 1) No LED. Output 0 & measure back 0 2) No LED. Output 1 & measure back 1 When you put the LED in the circuit, I guess I don't understand how it is to operate (State 3 & 4): 3) Has LED. Output 0 & measure back ? (Turns on LED) 4) Has LED. Output 1 & measure back ? Thanks, Mike
"rickman" <spamgoeshere4@yahoo.com> wrote in message
news:40BF8EEA.88631019@yahoo.com...
> Mike Turco wrote: > > > > I think the real problem here is that you are not following what I am > proposing. Check the circuit that I drew again.
I am slightly lysdexic and, oddly enough, a visual thinker. This ASCII art stuff really throws me for a loop. Any chance you could email me a .gif? My email address is mike@miketurcoisamillionaire.com , minus the part about 'is a millionaire'. Thanks, Mike
"rickman" <spamgoeshere4@yahoo.com> wrote in message
news:40BF8EEA.88631019@yahoo.com...

> But as I said, the voltage drop across an LED or any other diode is a > function of current. ..... > I expect you can reach that voltage > with a 1 MOhm pulldown.
The LED also has to be visible.
Mike Turco wrote:
> > "rickman" <spamgoeshere4@yahoo.com> wrote in message > news:40BF8F2C.339D1F9D@yahoo.com... > > Mike Turco wrote: > > > > > > "Peter Jakacki" <peterjak@tpg.com.au> wrote in message > > > news:40be8267@dnews.tpgi.com.au... > > > > BPing :) > > > > > > > > > > > > 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. > > > > > > OK, if the LED is connected, what will you see? Still a low? > > > > With the LED in the circuit the pin will be pulled up very quickly to a > > high voltage. > > I'm not clear on the concept. Is this the circuit? > > +5 > | > | > 330 ohm <=== 1k ohm will only allow 3 mA and LED will be dim!!!! > | > | > LED > | > ----------------- I/O > > If the LED is not in the circuit, given the capacitance of a CMOS output, I > can see the output staying at whichever state it is driven for long enough > to be measured (State 1 & 2). > > 1) No LED. Output 0 & measure back 0 > > 2) No LED. Output 1 & measure back 1 > > When you put the LED in the circuit, I guess I don't understand how it is to > operate (State 3 & 4): > > 3) Has LED. Output 0 & measure back ? (Turns on LED) > > 4) Has LED. Output 1 & measure back ?
1) No LED. Output 0, disable output, measure back 0 When you put the LED in the circuit, I guess I don't understand how it is to operate (State 3 & 4): 2) Has LED. Output 0, disable output, measure back 1 -- 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
Mike Turco wrote:
> I'm not clear on the concept. Is this the circuit? > > +5 > | > | > 1k ohm > | > | > LED > | > ----------------- I/O > > > If the LED is not in the circuit, given the capacitance of a CMOS output, I > can see the output staying at whichever state it is driven for long enough > to be measured (State 1 & 2). > > 1) No LED. Output 0 & measure back 0 > > 2) No LED. Output 1 & measure back 1 > > When you put the LED in the circuit, I guess I don't understand how it is to > operate (State 3 & 4): > > 3) Has LED. Output 0 & measure back ? (Turns on LED) > > 4) Has LED. Output 1 & measure back ? > > Thanks, > > Mike > >
This circuit fulfills your requirements and works just like you want it to. Furthermore, you can use any value resistor practical. With LED in circuit 1. Output logic low Led draws current and output pin goes to within Vss Parasitic capacitance of pin is now at this level 2. Release output (tristate) Pin is now high impedance with parasitic input capacitance holding last state. 3. very short delay Resistor + led charges parasitic input capacitance up to within Vdd 4. Read input as logic high 5. Switch pin back to an output to whatever state you want. With no LED in circuit 1. Output logic low Led draws current and output pin goes to within Vss Parasitic capacitance of pin is now at this level 2. Release output (tristate) Pin is now high impedance with parasitic input capacitance holding last state. 3. very short delay As there is nothing connected to input pin the parasitic input capacitor will hold the last state (logic low). This may eventually float to some indeterminate state if left in this condition. 4. Read input as logic low 5. Switch pin back to an output to whatever state you want. -- Peter Jakacki
On Wed, 02 Jun 2004 19:07:44 -0400, the renowned rickman
<spamgoeshere4@yahoo.com> wrote:

>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?
1.0 V @ 0.06uA 1.94V @ 1uA (visible in dim light) 2.23V @ 4uA 2.59V @ 100uA (quite visibly lit) 2.79V @ 1mA 3.08V @ 10mA (blindingly bright) 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 19:07:44 -0400, the renowned rickman > <spamgoeshere4@yahoo.com> wrote: > > > >What voltage do you measure on the LED with a current of 4 uA? > > 1.0 V @ 0.06uA > 1.94V @ 1uA (visible in dim light) > 2.23V @ 4uA > 2.59V @ 100uA (quite visibly lit) > 2.79V @ 1mA > 3.08V @ 10mA (blindingly bright)
What type of LED is this? I have never seen one that was "blindingly bright" at 10 mA and I have not seen one with a 3 volt Vf. Can you test a standard red LED that is designed to operate at 10 to 20 mA? -- 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