Shop OBEX P1 Docs P2 Docs Learn Events
leds and bs2 — Parallax Forums

leds and bs2

rrrr Posts: 63
edited 2005-01-04 02:45 in BASIC Stamp
is it bad to run 2 leds of of one pin on a bs2? i know it might be an issue with the 20ma limit.
do the leds just take what they can get or will it damage the board?
can i exchange a resistor for another led.
i am looking for more powerfull light source that i can control with a digital (solid state) potentiometer

Comments

  • EdGroodEdGrood Posts: 4
    edited 2005-01-02 02:10
    I suggest you look for an ultra high intensity led that will operate under the limit of 20 ma and produce an output of 6000 mcd. Check out http://www.superbrightleds.com/leds.htm.
  • KenMKenM Posts: 657
    edited 2005-01-02 02:21
    Generally speaking, you should not try to run two LED's in series from one BS2 pin. You need a current limiting resistor.

    And you bring up a good point about exceeding the 20 mA limit of the BS2. If memory serves me correctly.

    There is a very simply solution however. Use a 2n304 transistor in an emitter follower configuration. This will reduce the BS2 output current on the particular output pin to less than one milliamp.

    Selection of the current limiting resistor is done with ohms law.....R = V/I

    The value of V is the stamp output voltage when high (5v) minus the base emitter voltage drop (~0.6) minus the SUM of the forward voltage of each LED.

    Example.....If you want 20 mA through both LEDs, and assume the forward voltage of each LED is ~ 1.8 volts, then V = 5 - 0.6 - 3.6 = 0.8 volts

    0.8 volts divided by 20 mA = 40 ohms (0.8/0.02 = 40)

    See attached diagram


    Post Edited (KenM) : 1/3/2005 2:16:50 AM GMT
    370 x 447 - 9K
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-02 02:43
    There should be a resistor between the BASIC Stamp and the base of the 2N3904.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • KenMKenM Posts: 657
    edited 2005-01-02 03:46
    Jon Williams said...
    There should be a resistor between the BASIC Stamp and the base of the 2N3904.

    Not true......a resistor is NOT needed for the proper function of the circuit I described. This configuration is called an emitter follower and again,·a resistor is not needed.

    For stamp protection in case of a short to ground on the base lead, yes, a resistor is needed. For function, a resistor is not needed.

    Looking back at some data I took for an emitter follower configuration, I offer the following:

    Collector connected to 5 volts (measured 5.11)

    Base connected directly to 5 volts (measured 5.11)

    Emitter has one LED and a 100 ohm resistor connected in series to ground

    Emitter voltage measured 4.41 volts

    Emitter current measured 22.7 mA

    Base current measured 105 uA

    hfe of the 2n3904 calculates to 216 at this current and room temperature, which is a reasonable hfe for a 2n3904

    Post Edited (KenM) : 1/2/2005 4:11:36 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-03 14:49
    Umm... If a "resistor is NOT needed for proper function", but "For stamp protection in case of a short to ground...yes, a resistor is needed" then I would conclude a resistor is a good idea.

    Jon didn't say a resistor was needed for proper function. Perhaps he should have said for protection, a resistor is a good idea.

    In any event, for the original poster's education, an LED is a neat device.· When powered, it drops about 1.4 volts across itself, but it will take all the current available -- even to its own destruction.· So you MUST have a current limiting resistor in there with the LED.· Typical 'good' lit currents is 10 mA, but there are ultra-efficient LED's that work on 3 mA.· 30 mA will burn out most LED's if held on for more than 10 mSec.

    Now, a BS2 will drive ONE pin to 20 mA, but that's about it.· If you really want bright LED's that won't destroy your BS2, you should use one of the external driver circuits mentioned above.

    Post Edited (allanlane5) : 1/3/2005 2:51:12 PM GMT
  • StarManStarMan Posts: 306
    edited 2005-01-04 02:45
    rr,

    Typically for high brightness LEDs you'll find two different ranges of forward voltage (at 20mA).

    For Reds and Ambers (AlInGaP technology), a·typical Vf is in the range of 1.7 to 2.3 V.

    For·Greens, Blues·and·Whites (InGaN technology), a·typical Vf is in the range of·3.3 to·4.0 V.

    Check the spec sheets for your chosen LEDs.· Brightness and color vary and most manufacturers use a binning scheme to group LEDs of similar properties.· Stuff you buy on ebay is all over the place.

    BTW white LEDs are created by coating a blue LED die with phosphor.· Some manufacturers will supply a spec sheet for a blue LED when you ask for white.

    Chris Isaacson
Sign In or Register to comment.