Re: LED & Resistor befuddlement
From: Spehro Pefhany (speffSNIP_at_interlogDOTyou.knowwhat)
Date: 06/02/04
- Next message: Vadim Borshchev: "Re: Bit width?"
- Previous message: Joe Legris: "Re: LED & Resistor befuddlement"
- In reply to: rickman: "Re: LED & Resistor befuddlement"
- Next in thread: Peter Jakacki: "Re: LED & Resistor befuddlement"
- Reply: Peter Jakacki: "Re: LED & Resistor befuddlement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 02 Jun 2004 17:35:15 GMT
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
-- "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
- Next message: Vadim Borshchev: "Re: Bit width?"
- Previous message: Joe Legris: "Re: LED & Resistor befuddlement"
- In reply to: rickman: "Re: LED & Resistor befuddlement"
- Next in thread: Peter Jakacki: "Re: LED & Resistor befuddlement"
- Reply: Peter Jakacki: "Re: LED & Resistor befuddlement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|