Shop OBEX P1 Docs P2 Docs Learn Events
Bi-Color LED - single pin wiring — Parallax Forums

Bi-Color LED - single pin wiring

Bobb FwedBobb Fwed Posts: 1,119
edited 2008-10-27 11:47 in BASIC Stamp
I was wondering how much power (if a significant amount) is wasted by wiring a bi-color LED in the [noparse][[/noparse]attached] manor. Or what other issues might there be? I can pull the pin high to turn the light one color, and low for the other. I already know it works, but am wondering if I am going to waste battery power by doing so (and by how much). Also, does this wiring mean the BS2 is outputting less power or more?

Would it behoove me to use more than 220-Ohm on either side. The LED can be a bit dimmer, maybe 330-Ohm?

Any other ways to wire the bi-color on a single pin?

Comments

  • FireHopperFireHopper Posts: 180
    edited 2008-05-27 18:09
    lets see..

    220x2 = 440 ohm..

    v = i * r

    v = 5 volts
    r = 440 ohm
    i = v/r
    i = .0113 a or 11.3 milliamps lost through the 2 resistors.
    if you use 2 1K resistors it is 2.5 milliamps
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-05-27 18:29
    Except 11.3 milliamps WILL light up an LED, where 2.5 milliamps won't. Basically, the two serial 220 ohm resistors is a huge current loss, even when you ARE lighting the LED, so I wouldn't do it that way.
  • FireHopperFireHopper Posts: 180
    edited 2008-05-27 18:55
    some leds will lite on 2.5 ma.

    but the 2.5 ma is what will be lost to 2 1K resistors in stead of the 220 ohm.



    a led will lite using a 1k resistor on a stamp pin.. it may not be super bright.. but it does work.. and is visable.

    if you do the math, a standard red led with a voltage drop of 2 volts..

    vr = 5 volt - 2 volts (drop on the led)

    3 volts

    i = v/r

    i = 3 volt/1000 ohm = 3 ma· I've seen it work. I know it works.. infact lemme wire it up right now.

    yes it does work, kinda dim on the r/g led I have (the one from the WAM kit)

    maybe you could use 470 ohm resistors.

    hrmm.. a lil bit brighter.

    5.3 ma through the 2 470 ohm resistors.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2008-05-27 21:38
    I'll have to figure out how much power I can use, and see where my priorities are, an extra pin, or battery life.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-05-27 21:56
    Here's a circuit I posted elsewhere (but I can't find the thread) for two discrete LEDs. It draws negligible current when neither LED is on (i.e. I/O pin floating). This is because the sum of all six forward voltages is more than Vdd.

    -Phil
    153 x 306 - 2K
  • FireHopperFireHopper Posts: 180
    edited 2008-05-27 22:06
    nice. but could it be changed to use a bicolor led?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-05-27 22:08
    Here's another circuit with the same theme as before, but applicable to your bi-color LED. If the forward voltages of the two internal LEDs are different, the zeners can be adjusted accordingly, so long as their sum exceeds 5V.
    247 x 254 - 1K
  • FireHopperFireHopper Posts: 180
    edited 2008-05-27 22:32
    very nice phil [noparse]:)[/noparse]
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2008-05-27 23:42
    Creative. I'll have to go find some 2.7V zeners now.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-05-28 00:03
    Bobb,

    Be sure to check the forward voltages of your LED first. If one is higher than the other, you will want to adjust the relative zener voltages to compensate.

    -Phil
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2008-05-29 16:28
    2.2 and 2.1, not a big difference.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-05-29 19:40
    That's pretty high and only leaves either a 0.1V or 0.2V drop in the series resistor with a 5V supply, which is really marginal.

    For a little more headroom, instead of zeners, you might consider a virtual ground or "rail splitter" like the Texas Instruments TLE2426. It will do the same thing as your original voltage divider, but without the excessive quiescent current draw (170uA, compared with 11mA for the divider). You will still need a resistor in series with the LED to limit current. 15 or 22 ohms should do nicely.

    -Phil
  • beatsbeats Posts: 17
    edited 2008-10-19 07:02
    but what is the point of the zener diodes, why would you drop the voltage from 5 to 2.3V? if it is to limit the current, couldn't u just modify the resistance?






    ***edited: ah ok, i·think i figured it out, to eliminate the power supply loss during off-time....i think, correct me if i am wrong

    Post Edited (logical) : 10/19/2008 7:26:59 AM GMT
  • beatsbeats Posts: 17
    edited 2008-10-20 18:12
    Phil,
    It is very rare to have two different LEDs with the same forward voltage, so what would be an exceptional range for the forward voltages that would be suitable with those 2.7V zeners?

    Thanks
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-20 20:52
    It all depends on how much you want the relative brightnesses to match. With 2.7V zeners, you've got 2.3V to play with when Vdd is 5V. Ideally, you want the forward voltages of the LEDs as low as possible to maximize the voltage across the dropping resistor. This ensures that the currents approximately match. For example, with forward voltages of 2.0 and 2.1 volts, the resistor has to drop 0.3 and 0.2 volts, repsectively, which gives a 1.5:1 current ratio for the two LEDs. At 1.7 and 1.8V, the resistor drops 0.6 and 0.5 volts, respectively, yielding a 1.2:1 current ratio.

    By using a rail splitter instead of the zeners, you gain an extra 0.2V of headroom in both directions. At the expense of a larger package, you could use an op-amp instead and set the output voltage to whatever fraction of 5V yields the the closest relative brightness levels.

    -Phil
  • beatsbeats Posts: 17
    edited 2008-10-22 21:34
    Not the answer I was hoping for sad.gif.....I'm not sure I want to order more parts than I need, although I might do so - just not sure yet,·thanks for your help·though·.

    However, if I drop the whole bi-color LED component, and·use the first schematic·you·uploaded with just the two·seperate LEDs, would it matter if their Forward Voltages were different too?
    Also would that circuit work the same way, as in if I send out logical 1 one LED lights up, and if I send out logical 0 the other LED lights up?

    Thanks

    Post Edited (logical) : 10/22/2008 9:45:16 PM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-10-26 02:22
    Are you trying to conserve pins on the Stamp, or are you trying to conserve parts in the circuit? You could feed the Stamp pin output to an inverter. When the Stamp pin output is high, the inverter output will be low, and vice versa. Put your bicolor LED between the Stamp pin output and the inverter output, and switching the Stamp pin will switch colors. You'll need a resistor, say 470 ohms or more, in series with the LED, of course. To turn the LED off, make the Stamp pin an input.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2008-10-26 19:20
    The two pin approach allows you to conserve more power as you can pulse the LED or shut them off completely.
    All single pin approaches leave one LED on all of the time.
    Jim-

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Signature space for rent, only $1.
    Send cash and signature to CannibalRobotics.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-10-26 22:50
    CannibalRobotics said...
    The two pin approach allows you to conserve more power as you can pulse the LED or shut them off completely.
    All single pin approaches leave one LED on all of the time.
    Jim-

    Well, no, You can use a single pin and still turn them off·-- see the post immedately preceding yours -- turn.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl
  • UghaUgha Posts: 543
    edited 2008-10-27 11:47
    Excuse a dumbish newbie response... but what about using two latching relays? One set to NO and one set to NC?
Sign In or Register to comment.