Re: LED & Resistor befuddlement

From: Spehro Pefhany (speffSNIP_at_interlogDOTyou.knowwhat)
Date: 06/02/04


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


Relevant Pages

  • Re: PMOS in parallel with NMOS
    ... See the thread "Clock and Asynchronous Reset with just one pin". ... His latest thread talks about multiplexing LEDs with a 200:1 ... just kludging a circuit that doesn't fail in the brief time you are ... One of the basic principles of engineering is that you *can't* ...
    (comp.arch.embedded)
  • LED Matrix Questions
    ... I thought about messing around with an LED matrix. ... The red LEDs I have apparently want 2v at 30ma to power them. ... I'm confused on how many milliamps are going through such a circuit, ... pin coming from the chip to the base of the transistor, ...
    (sci.electronics.basics)
  • Re: LED installation comparison photo
    ...  To correct the problem, remove the socket from ... to that and end it with a the molex connector. ... I should qualify that the goal is to get a consistent light intensity ... have Terry's LEDs for most of the inserts so what I propose is my way to ...
    (rec.games.pinball)
  • Re: Mini-Review: Turbo Mikes MM Moat Light Up kit
    ... Thanks again Mike!! ... with the 906 wedge base socket and make this ... Assuming the LEDs would have a bit more "oomph", ... you would need to use a 6vac relay to switch on and off with the GI ...
    (rec.games.pinball)
  • Re: Flickering #44 mod?
    ... socketed LED that would make it flicker like a candle? ... able to do it if I had more LEDs of different voltage ratings to play ... Just use a socket out of an old SS Bally machine. ...
    (rec.games.pinball)