Continue to Site

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.

  • 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.

How to Wire an LED

Status
Not open for further replies.
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.
 
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:
 
Most common LEDs used now are white or blue LED, not red.
 
In that circuit it does not matter.
 
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.
 
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.
 
So the LED resistor should stay like it is on #28 schematic?

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.
 
BC517? http://www.datasheetcatalog.org/datasheet2/6/0rkjplo475sireugkcpd64zw19fy.pdf I has a LOT of gain, not sure if i went from "too low" to "way too much" or it will be fine?
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.
 
Oh, i didnt noticed its darlington, i dont know how it slipped with search that should exclude them...

How big should be the [LATEX]h_{FE}[/LATEX]? I found 2N3904 NPN transistor with [LATEX]h_{FE}[/LATEX] around 210 @ 25 celcius and [LATEX]V_{CE}[/LATEX] 5V
http://www.datasheetcatalog.org/datasheet/nationalsemiconductor/DS013058.PDF
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.
 
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:
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.
 
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.
 
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top