Reply by Andrew Smallshaw May 17, 20082008-05-17
On 2008-05-17, Tom <tom@nospam.com> wrote:
> In article <slrng2mo62.o5n.andrews@sdf.lonestar.org>, Andrew Smallshaw <andrews@sdf.lonestar.org> wrote: >> >>This is of course the worst case scenario, but the LED's barrier >>voltage is also conspiring against you. The exact value varies >>depending on the device but typically around 1.7V is needed for >>the LED to conduct. 2.5V+1.7V=4.2V which is a big ask from a 5V >>device. > > From p.135 of the PIC16F684 datasheet: > Voh min = Vdd - 0.7V at 3.0 mA and Vdd=4.5V > Vol max = 0.6V at 8.5 mA and Vdd=4.5V > So no problem getting 4.3V with a 5V supply. Actual values at room temperature > are even better than this.
At 3.0mA. I would expect the voltage to drop further as the LED draws, say, 25mA. You may end up with LEDS that are lit but unusably dim. -- Andrew Smallshaw andrews@sdf.lonestar.org
Reply by Tom May 17, 20082008-05-17
In article <slrng2mo62.o5n.andrews@sdf.lonestar.org>, Andrew Smallshaw <andrews@sdf.lonestar.org> wrote:
>On 2008-05-13, Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe <toe@lavabit.com> wrote: >> >> A friend of mine suggested to me today to connect one of the LED pins >> to the microcontroller, and the other to 2.5 V. That way, if the uC >> pin is high, it will source current from 5 volts to 2.5 volts. If it's >> low, it will source current from 0 volts to 2.5 volts. (Of course I'd >> have a resistor somewhere). > >Potential problem here. What voltage is present on the MCU pin? >5V strongly suggests TTL compatible inputs/outputs to me which are >_not_ 0V and 5V. From memory low is up to 0.8V and high is at >least 2.0V. There is a possibility that your pin could be 'high' >and delivering 2.0V which is still _less_ than the 2.5V on the >other end of the LED. > >This is of course the worst case scenario, but the LED's barrier >voltage is also conspiring against you. The exact value varies >depending on the device but typically around 1.7V is needed for >the LED to conduct. 2.5V+1.7V=4.2V which is a big ask from a 5V >device.
From p.135 of the PIC16F684 datasheet: Voh min = Vdd - 0.7V at 3.0 mA and Vdd=4.5V Vol max = 0.6V at 8.5 mA and Vdd=4.5V So no problem getting 4.3V with a 5V supply. Actual values at room temperature are even better than this. A bigger concern is how he plans to multiplex the LEDs. The maximum current into/out of Vdd or Vss is 95mA. So if he's using 25mA per LED and has more than three LEDs connected in this manner, all it takes is one small glitch somewhere to turn them all on at once and there goes the CPU. This might be an acceptable risk for his hobby project but not something I would ever do in a commercial product.
Reply by linnix May 15, 20082008-05-15
On May 15, 1:52 am, Andrew Smallshaw <andr...@sdf.lonestar.org> wrote:
> On 2008-05-13, Tom\xe1s \xd3 h\xc9ilidhe <t...@lavabit.com> wrote: > > > A friend of mine suggested to me today to connect one of the LED pins > > to the microcontroller, and the other to 2.5 V. That way, if the uC > > pin is high, it will source current from 5 volts to 2.5 volts. If it's > > low, it will source current from 0 volts to 2.5 volts. (Of course I'd > > have a resistor somewhere). > > I thought that I replied to this yesterday but I can't see it here > so I'll post again. Having news server issues at the moment. > > There's a potential problem here. Consider what voltage you will > be getting from the MCU pin. It will _not_ be 0V, 5V, or Hi-Z. > Most 5V devices aim for TTL compatibility. From memory that allows > a low to be up to 0.8V and a high to be as low as 2.0V. Therefore > it is possible for your 'high' voltage to be below the 2.5V centre > voltage. > > This is of course the worst case scenario, but the LED barrier > voltage is also conspiring against you. This varies from device > to device but is typically around 1.7V. 2.5 + 1.7 = 4.2V needed > from the pin in its high state, which is asking a lot from a 5V > device, particularly when you are drawing current from it. > > Do yourself a favour. Put an H-bridge in there.
And for the rest of us dumb old timer (in the OP's mind), we just drive LEDs low with separate pins. Sometimes, we need to KISS up.
> > -- > Andrew Smallshaw > andr...@sdf.lonestar.org
Reply by Andrew Smallshaw May 15, 20082008-05-15
On 2008-05-13, Tom\xe1s \xd3 h\xc9ilidhe <toe@lavabit.com> wrote:

> A friend of mine suggested to me today to connect one of the LED pins > to the microcontroller, and the other to 2.5 V. That way, if the uC > pin is high, it will source current from 5 volts to 2.5 volts. If it's > low, it will source current from 0 volts to 2.5 volts. (Of course I'd > have a resistor somewhere).
I thought that I replied to this yesterday but I can't see it here so I'll post again. Having news server issues at the moment. There's a potential problem here. Consider what voltage you will be getting from the MCU pin. It will _not_ be 0V, 5V, or Hi-Z. Most 5V devices aim for TTL compatibility. From memory that allows a low to be up to 0.8V and a high to be as low as 2.0V. Therefore it is possible for your 'high' voltage to be below the 2.5V centre voltage. This is of course the worst case scenario, but the LED barrier voltage is also conspiring against you. This varies from device to device but is typically around 1.7V. 2.5 + 1.7 = 4.2V needed from the pin in its high state, which is asking a lot from a 5V device, particularly when you are drawing current from it. Do yourself a favour. Put an H-bridge in there. -- Andrew Smallshaw andrews@sdf.lonestar.org
Reply by Andrew Smallshaw May 15, 20082008-05-15
On 2008-05-13, Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe <toe@lavabit.com> wrote:

> A friend of mine suggested to me today to connect one of the LED pins > to the microcontroller, and the other to 2.5 V. That way, if the uC > pin is high, it will source current from 5 volts to 2.5 volts. If it's > low, it will source current from 0 volts to 2.5 volts. (Of course I'd > have a resistor somewhere).
I thought that I replied to this yesterday but I can't see it here so I'll post again... There's a potential problem here. Consider what voltage you will be getting from the MCU pin. It will _not_ be 0V, 5V, or Hi-Z. Most 5V devices aim for TTL compatibility. From memory that allows a low to be up to 0.8V and a high to be as low as 2.0V. Therefore it is possible for your 'high' voltage to be below the 2.5V centre voltage. This is of course the worst case scenario, but the LED barrier voltage is also conspiring against you. This varies from device to device but is typically around 1.7V. 2.5 + 1.7 = 4.2V needed from the pin in its high state, which is asking a lot from a 5V device, particularly when you are drawing current from it. Do yourself a favour. Put an H-bridge in there. -- Andrew Smallshaw andrews@sdf.lonestar.org
Reply by MK May 15, 20082008-05-15
"CBFalconer" <cbfalconer@yahoo.com> wrote in message 
news:482AE8D6.8333F276@yahoo.com...
> MK wrote: >> > ... snip ... >> >> Connect 2 resistors of equal value (R) in series from the 5V >> supply to 0V and the mid point is the 2.5V you need. Connect the >> LED from the mid point to your processor pin and drive >> high/low/open. The current limiting you *NEED* for leds comes >> free because the source resistance of the 2.5V is R/2. >> >> I'm going to let you do the sums to work out the ideal resistor >> value for the LED that you have. > > Of course the on voltage of the LED, and the variance of that, will > not affect the values in the least. Nor will the variance in > current drive needed for the two LED colors. > > -- > [mail]: Chuck F (cbfalconer at maineline dot net) > [page]: <http://cbfalconer.home.att.net> > Try the download section. > > > ** Posted from http://www.teranews.com **
Hello Chuck, I think you mis-typed. The forward voltage of the LEDs will affect the current. If the two LEDs need different drive currents the resistors can be set to different values. The OP wanted a simple solution and set some constraints in his question. Obviously a simple linear, passive solution has limits. Michael Kellett www.mkesc.co.uk
Reply by MK May 15, 20082008-05-15
"linnix" <me@linnix.info-for.us> wrote in message 
news:f95b16db-d9ae-4f86-b5c5-27b959d18012@q24g2000prf.googlegroups.com...
> On May 14, 6:27 am, CBFalconer <cbfalco...@yahoo.com> wrote: >> MK wrote: >> >> ... snip ... >> >> > Connect 2 resistors of equal value (R) in series from the 5V >> > supply to 0V and the mid point is the 2.5V you need. Connect the >> > LED from the mid point to your processor pin and drive >> > high/low/open. The current limiting you *NEED* for leds comes >> > free because the source resistance of the 2.5V is R/2. >> >> > I'm going to let you do the sums to work out the ideal resistor >> > value for the LED that you have. >> >> Of course the on voltage of the LED, and the variance of that, will >> not affect the values in the least. Nor will the variance in >> current drive needed for the two LED colors. >> > > So, we need 2 resistors at the uC end, and 2 resistors at the voltage > regulator end. Oh, great, we eliminated 2 LED resistors with a > regulator and 4 other resistors.
You've got some extra resistors and a voltage regulator in here somehow - my suggestion to Tomas was that he use 2 resistors and the 5V supply already available for the processor. My reference to Thevenin (which you snipped) was to give him a hint as to how to work out the values. Given the constraints of the original question I am interested in your alternative suggestions. Michael Kellett www.mkesc.co.uk
Reply by Jim Granville May 14, 20082008-05-14
Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe wrote:

> I've got a bi-colour LED. It has two pins. Internally it consist of > two LED's in parallel except they face in different directions. > > I'm looking into ways of using one micrcontroller pin to control the > LED as follows: > Pin High = Light up Red > Pin Low = Light up Green > Pin as Input = Nothing lights up > > A friend of mine suggested to me today to connect one of the LED pins > to the microcontroller, and the other to 2.5 V. That way, if the uC > pin is high, it will source current from 5 volts to 2.5 volts. If it's > low, it will source current from 0 volts to 2.5 volts. (Of course I'd > have a resistor somewhere). > > So the only question is how I'd put one of the pins at a constant 2.5 > volts. My first thought was to use a zener diode, i.e. take a pin from > the LED, put into one side of the zener, and tie the other side of the > zener to ground. I'm not entirely sure if this will work though. > Another complication would be that I'd need two zeners in parallel > facing the opposite direction in order to let current flow in both > directions. > > Do you think the whole 2.5 volts idea is good? What's the best way of > getting one of the LED pins to sit at 2.5 volts?
Or, if you really want to have LOTS of LED drive capacity :), and low OFF power, then you CAN drive two power outputs, from a single pin this way : (These device have a special 3 State sense ) I think it could also drive either 2 or 3 terminal LEDs http://www.intersil.com/cda/deviceinfo/0,1477,ISL6615,0.html http://www.intersil.com/cda/deviceinfo/0,0,ISL6609,0.html -jg
Reply by Andrew Smallshaw May 14, 20082008-05-14
On 2008-05-13, Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe <toe@lavabit.com> wrote:
> > A friend of mine suggested to me today to connect one of the LED pins > to the microcontroller, and the other to 2.5 V. That way, if the uC > pin is high, it will source current from 5 volts to 2.5 volts. If it's > low, it will source current from 0 volts to 2.5 volts. (Of course I'd > have a resistor somewhere).
Potential problem here. What voltage is present on the MCU pin? 5V strongly suggests TTL compatible inputs/outputs to me which are _not_ 0V and 5V. From memory low is up to 0.8V and high is at least 2.0V. There is a possibility that your pin could be 'high' and delivering 2.0V which is still _less_ than the 2.5V on the other end of the LED. This is of course the worst case scenario, but the LED's barrier voltage is also conspiring against you. The exact value varies depending on the device but typically around 1.7V is needed for the LED to conduct. 2.5V+1.7V=4.2V which is a big ask from a 5V device. -- Andrew Smallshaw andrews@sdf.lonestar.org
Reply by linnix May 14, 20082008-05-14
On May 14, 6:27 am, CBFalconer <cbfalco...@yahoo.com> wrote:
> MK wrote: > > ... snip ... > > > Connect 2 resistors of equal value (R) in series from the 5V > > supply to 0V and the mid point is the 2.5V you need. Connect the > > LED from the mid point to your processor pin and drive > > high/low/open. The current limiting you *NEED* for leds comes > > free because the source resistance of the 2.5V is R/2. > > > I'm going to let you do the sums to work out the ideal resistor > > value for the LED that you have. > > Of course the on voltage of the LED, and the variance of that, will > not affect the values in the least. Nor will the variance in > current drive needed for the two LED colors. >
So, we need 2 resistors at the uC end, and 2 resistors at the voltage regulator end. Oh, great, we eliminated 2 LED resistors with a regulator and 4 other resistors.