1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

How to Wire an LED

Discussion in 'Electronics Videos' started by unix60959, Jan 23, 2012.

  1. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    As the current surpasses the maximum permissible value the lifespan of the device drops exponentially. Surpassing the maximum rated current can be okay for very short periods of time that do not repeat. If it is constantly applied the device will fail, in the case of an LED the light output will drop it will heat up more and become useless as a source of light and then fail utterly more than likely in the form of an open circuit (no appreciable current will ever flow through it again)

    Due to the fact that heating from ohmic resistance increases as the square of the current often called I^2R heating you should consider the Maximum allowable current through a device as the knee curve from an exponential run away, even getting to that point is bad, surpassing it can only be done by those that know exactly what they're doing and know the consequences.

    Many people think that because an LED is rated for 20ma means that 25 or 30ma might not be so bad and that it will give you much more light, but the lifespan of the LED goes down faster because of the increase in heat, AND the light output slows as current increases, so even if you double the current you won't get 200% brightness and you might get 2000% decreased life.
     
  2. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,592
    Likes:
    952
    Location:
    Canada, of course!
    I disagree.
    Most 5mm ordinary LEDs have a maximum continuous current of 30mA TO 40mA. Most have their spec's and lifetime rated at 20mA.
    Here are the spec's for the Fairchild (Name brand) red LED that I have used for years:
     
  3. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Most common LEDs used now are white or blue LED, not red.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. flinty

    flinty New Member

    Joined:
    May 26, 2012
    Messages:
    26
    Likes:
    0
    Location:
    Cairo-Egypt

    that was so useful i wish i can add something :p
     
  6. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
    Does it matter on which side of LED ill attach a resistor?
    Can i wire LED like this:
    View attachment 65012
     
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    That will be OK.
    E
     
  8. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    In that circuit it does not matter.
     
  9. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
    But it can matter on which side of LED the resistor is? I that case can resistor be placed like that in this circuit?
    View attachment 65027
     
  10. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Of course it can matter, it's totally up to the application. In the case of the circuit in post #28 two different resistors are required because of the difference in the forward voltage of the RGB elements so you obviously can't put the resistor on the common anode. You also can't put it on the other side of the transistor as it will bias the transistor improperly.
     
    • Like Like x 1
  11. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
    So the LED resistor should stay like it is on #28 schematic?
     
  12. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Yep, though keep in mind that although you're not driving the LED's from the I/O lines directly that the 1k resistors still draw 5ma of current keep that in mind with the rest of the current drawn from your chip to keep it cool and running fine, those 5ma's adds up to 75 milli watts of waste power (all as heat) in the transistors.

    For lower power usage you would be better off with a switching transistor with a LOT more gain. 2n2222's are general purpose.
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    That only applies to the 'specific' application as shown in your post #28, for a general single series resistor/led it doesn't matter which order.
     
  14. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
  15. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,592
    Likes:
    952
    Location:
    Canada, of course!
    You forgot to show us a schematic with the BC517 darlington transistor. It does not MANUFACTURE current, instead it simply switches existing current on and off if it is connected correctly. It has a voltage loss (called collector-emitter saturation voltage) of 1V max at 100mA when its base current is 0.1mA.
     
  16. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
  17. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,592
    Likes:
    952
    Location:
    Canada, of course!
    hFE is its DC current gain when it is a linear amplifier with plenty of collector to emitter voltage. But you do not show us a circuit with a transistor so we don't know if it is linear and fades the brightness of an LED or if it simply switches an LED on and off.
    When a transistor is used as a switch then its collector to emitter voltage is very low (the transistor is saturated when it is turned on) so the hFE is a minimum of only 10.
    We also do not know if enough current is available to feed the base of the transistor.
     
  18. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
    Its the circuit in post 28 View attachment 65060
    It will simply switch on and off the LED

    And from datasheet of ATmega8 i read that it can supply from 20mA to 40mA of current and output is from 0.6Vcc to Vcc+0.5V (the VCC is 5V)

    Im looking for right Q4, Q5, Q6 transistors and R13, R14 and R15 resistor value (if needed).

    Firstly i wanted to choose 2n2222 but from post above i read that its hFE is way too low. So i started to filter transistors by their hFE value and found that 2n3904 since it has to be npn switching transistor (not darlington)
     
    Last edited: Jun 21, 2012
  19. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,592
    Likes:
    952
    Location:
    Canada, of course!
    Konrad,
    How much will be the collector current when the transistor is switched on?
    What is the range of forward voltage for your LEDs?
    What is the supply voltage for the LEDs?

    With 1k series base resistors then the base current is only 3.8mA then the collector current can be 38mA or less then each transistor can drive one bright LED or two dimmed LEDs.

    If the series base resistor value is 200 ohms then the base current is 19mA a 2N2222 or 2N4401 transistor can have a collector current of 190mA and can drive 10 bright LEDs. The maximum collector current for a 2N3904 is 200mA and it works poorly above 100mA.
     
    • Like Like x 1
  20. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
    There will be transistor for each of RGB LED cathode (the anode is shared) so the red, blue and green will be turned on/off independently and every anode will have its own transistor.

    The collector current will be 20mA for each of transistor (thats the 'If' of the each of RGB diode segment, green has If=20mA, red and blue same)
    The forward voltage is 1.95V/3.3V/3.3V Red/Green/Blue
    Supply voltage is 5V and it will be attached to the shared anode.
     
  21. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,592
    Likes:
    952
    Location:
    Canada, of course!
    I assume the forward voltages you listed are "typical". Some LEDs will have a higher forward voltage and others will have a lower forward voltage because they cannot make LEDs the same.
    The red LEDs need a 150 ohm current-limiting resistor.
    The green and blue LEDs need a 82 ohm resistor.

    Each transistor has a collector current of only 20mA and the base current for a saturated switching transistor is 1/10th at 2mA so the series base resistor is 2k ohms.

    I guess you use transistors so that many LEDs can be lighted at the same time. The microcontroller will melt if it tries to light more than a few LEDs by itself at the same time.
     
    • Like Like x 1

Share This Page