EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Best way to get 2.5 volts from somewhere? (Vcc = 5 volts)

Started by Unknown May 13, 2008
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?
On May 13, 11:27=A0am, Tom=E1s =D3 h=C9ilidhe <t...@lavabit.com> 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: > =A0 =A0 Pin High =3D Light up Red > =A0 =A0 Pin Low =3D Light up Green > =A0 =A0 Pin as Input =3D 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).
You can use another uC to PWM switch a voltage source to an op-amp integrator, since cost/components are not an issue for you.
> 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.
You don't need a microcontroller pin to generate 2.5V. You just need a constant voltage source. You can use a simple voltage divider off 5V which uses two equal valued resistors that serve as a voltage divider AND current limiters.
> Do you think the whole 2.5 volts idea is good?
It's good if it meets your requirements. Your stated requirement is 2.5V from 5V. An implied requirement is it works. If you try it and it works, it's a good idea. You're the judge of "good".
> What's the best way of getting one of the LED pins to sit at 2.5 volts?
There is no way. Your datasheet will tell you the pin will either be 0V or 5V if it's an output. It will be at high impedance if it's a an input and your external circuit will determine what voltage it will be. JJS
On Tue, 13 May 2008 11:27:21 -0700 (PDT), Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe
<toe@lavabit.com> 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?
Predict the current through each LED when it is on, over unit-to-unit variations and temperature. Then see if you think it's a good idea. 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
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?
You can get Source/Sink regulators, intended for DDR memory terminators, they are one option. Or an opamp, if the total node power is OK. You might want slightly different from 2.5V, as the LED Vfs are not the same, nor are the uC Pin drivers, and you might want to adjust the 5V power a little. -jg
Jim Granville wrote:
> 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? > > You can get Source/Sink regulators, intended for DDR memory terminators, > they are one option. Or an opamp, if the total node power is OK. > You might want slightly different from 2.5V, as the LED Vfs are not > the same, nor are the uC Pin drivers, and you might want to > adjust the 5V power a little.
Or an RS-485 driver, my first choice. Unfortunately, he wants to use no more than one I/O pin.
Maybe I'm just dump, but:

Why don't you simply use a 4066 bilateral-switch, a current-limiting 
resistor plus some kind of inverter (can be as simple as a NPN-tranny in 
your case)?


It's cheap and just works...

   Nils

On May 13, 7:27=A0pm, Tom=E1s =D3 h=C9ilidhe <t...@lavabit.com> wrote:

> 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?
I think I've found what I want: http://ourworld.compuserve.com/homepages/Bill_Bowden/page12.htm Something along those lines anyway.
On May 13, 3:40=A0pm, Tom=E1s =D3 h=C9ilidhe <t...@lavabit.com> wrote:
> On May 13, 7:27=A0pm, Tom=E1s =D3 h=C9ilidhe <t...@lavabit.com> wrote: > > > 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? > > I think I've found what I want: > > http://ourworld.compuserve.com/homepages/Bill_Bowden/page12.htm > > Something along those lines anyway.
I am too busy at the moment. Anybody wants to show him the LM317 datasheet?
I have a question...

If I have an LED that has about 2 volts across it, then is it OK to
put a 2 volt power supply across it without a current limiting
resistor?

My overall power supply would be 9 V coming from a square battery, but
I'll be putting it thru a voltage regulator to give me out 2 V.

I'll then be putting the 2 V across the LED.

Can I leave out the LED's current-limiting resistor, or is there still
a chance of there being too much current that would fry components?

Memfault Beyond the Launch