LED Lighting and Resistors
Light-Emitting Diodes (LEDs) are solid state light emitting devices that are known for their low current draw (typically 20-60 milliwatts) and long lifespan (100,000 hours). They will burn out if too much current is allowed to flow through them.
An LED is a diode, therefore current can only flow through it in one direction.
A common application is replacement of lamps or additional lighting effects. While LEDs are available in a variety of sizes and colours, white LEDs do not look like incandescent lamps. The preferred colour is Sunny White. It is also possible to tint the lens of a white LED to get the correct effect.
- 1 Light Emitting Diodes and Series Resistors
- 2 An Example
- 3 Ohm's Law
- 4 Identifying the Anode and Cathode
- 5 Failure modes
- 6 LED Colours
- 7 Reading the Data Sheet
- 8 See Also
Light Emitting Diodes and Series Resistors
An LED is a current controlled device. In most applications related to Digital Command Control, a simple, low cost resistor is used to limit the current flowing through the LED. For more exacting applications a controlled current source would be used instead of a resistor.
The LED is a semiconductor device that will burn out quite quickly if its specifications are exceeded.
The following explains how to wire an LED for your model train or layout without letting the magic smoke out of the LED.
In this example, our LED specifies a forward current of 20mA (milliAmps) at a forward voltage of 2 volts. We will be wiring the LED from a power source, and using a resistor to limit both the current and the voltage. (Always read the spec sheet for your LED as it will have the details you need to calculate the series resistor.)
Voltage from one end of a string of devices in series (like the LED and Resistor, above) to the other is divided among the items in the series, in proportion to their resistance. Assume that the voltage source is 9 Volts DC. Since the voltage across both devices is 9 Volts, and the LED is rated for 2 volts, the voltage drop across the series resistor must be 7 volts.
Since the current through two devices in series is the same through both devices, and we want the maximum current through the LED to be 20 mA, the resistor must drop 7 volts at a current of 20mA.
We need to calculate the Resistance of the resistor. Ohm's law tells us how Voltage, Current, and Resistance in a circuit are related. The 3 variables are:
- Voltage (measured in Volts, represented by the letter V, or it may be E.)
- Current (measured in Amperes, represented by the letter I ('eye'))
- (don't ask why it's not A)
- Resistance (measured in Ohms, represented by the letter R or the symbol Ω)
The law says that V=IxR. This can be re-arranged to say I = V/R or R = V/I. This 3rd form is the one we want:
- R = 7 Volts / 20 milliAmps
- R = 7 Volts / .020 Amps
- R = 7/.020
- R = 350 Ω (Ohms).
So, we need:
- LED, forward current: 20mA, forward voltage: 2V
- Power supply: 9VDC
- Resistor, 350 Ω
The next step is to choose a resistor with a value of at least 350 ohms. (You may see this value written as 350R.)
Resistors are only available with certain standard values. Standard values near 350 Ω include 330, 360, and 390 Ω. Due to manufacturing processes, resistors are manufactured with 5, 10, or 20% tolerance. The tolerance means the value may vary ±5%, 10% or 20% from the stated value. Many of the resistors you see today will be 10% or better tolerance, as the old carbon resistors are no longer manufactured.
With a manufacturing tolerance of 10%, a 390 Ω resistor could be anywhere from 351 to 429 Ω. If the value is precisely as marked, a 390 Ω resistor would limit the current to 7/390, or 18mA. This is below the 20mA maximum for the LED. At the lower extreme (assuming a worst case value of 351 Ω) the maximum current would be 20mA.
Don't forget-- the ratings for the LED are the MAXIMUM values! Limiting the current to less than 20 mA or reducing the voltage will extend the life of the LED, just as running a light bulb at less than rated voltage will extend its life! And, just as in a light bulb, reducing the current or voltage will reduce the brightness of the LED.
Also remember that if a power supply isn't supplying a full load, the rated output voltage is often exceeded! So you may need to calculate the resistance based on a higher than rated voltage, and a lower than rated current.
Wiring Multiple LEDs
When wiring multiple LEDs in a circuit, it is best to connect them in parallel, each with its own series resistor to limit the current. In this case, the power source must be able to supply enough current in total to insure each device gets enough current. Ten LEDs at 20mA each would need a total current of 200mA.
Large numbers of LEDs can be powered by a lower current power source by multiplexing them. Each LED is rapidly switched ON, then OFF, but to the human eye, it appears to be constantly lit. For the additional complexity of the driver circuits, a larger power supply is simpler.
Why Can I Not Use a Single Resistor for Multiple LEDs?
You can, but you really should not.
Ten LEDs in parallell, 20mA IFWD. VFWD is 2V.
Power source is 12V.
There are two components to this circuit:
- Ten LEDs in parallel, VDrop = 2V, ILED = 20mA × 10 = 200mA
- Series Resistance: VDrop = 10V, IResistor = 200mA.
Ohms Law says RSeries = V÷I. 10 ÷ 0.2 = 50Ω
Should one LED fail, the current flowing through RSeries will still be 200mA to maintain the 10V drop. ILED is now 200 ÷ 9, or 22.2mA.
Not all LEDs are alike. Some may flow more current, others less. So one might be flowing 25mA, until it fails. Now you have 8 LEDs remaining, flowing on average 25mA. When another fails, it becomes 29mA...
LED Parameters IFWD and VFWD are nominal, not absolute values for a specific LED. These values vary by batch, and by individual LED.
Identifying the Anode and Cathode
Identifying the Anode (A) and Cathode (K) can be easy with some LEDs. The typical LED with the coaxial leads has a flat spot on the package, and a shorter lead, which is the cathode. The positive lead (Anode) is the longer lead.
Another technique is to hold the device up to the light so you can see the internal structure. The cathode (or anvil) looks like a flag.
Surface Mount Devices
Surface Mount Devices are very small components. By eliminating most of the packaging, the component can often be made smaller, which means less cost for packaging it, and higher board density at manufacture. SMT LEDs can be used in tight spaces. They may or may not come with leads.
To identify the K cathode, there may be a stripe (like a diode), a dot, or a chamfer on one corner of the package. If not, there may be a dot printed on the underside of the package. As always, consult the data sheet for the device if you are unsure.
Another type may look like a little button, with three leads, two long ones and a short one, with a hole. The two long leads are the anode and cathode. The short lead, or tab with the hole, is part of the lead frame. The lead opposite it is the cathode. The lead next to the tab is the anode. As always, check the data sheet.
Why is the Cathode marked with a K?
The terms Anode and Cathode go back to the vacuum tube diode. The Anode is the positive connection which is in turn connected to the B+ power supply connection. The Cathode was usually grounded, and marked as K on schematics. The K was used, as C was already claimed to indicate a capacitor on a schematic. The term C- referred to the control grid voltages used in an amplifier.
These terms also resulted in the A, B, and C designations for batteries. The A cell was a large 1.5V cell (about the diameter of a D cell but about four times longer) that supplied the filament voltage, the B battery was 90V, connected to the anode, supplying the B+ voltage. Prior to the invention of the indirectly heated cathode, all radios were battery powered, using an A cell and B battery.
The most common way for LEDs to fail is the gradual lowering of light output and loss of efficiency. However, sudden failures can occur as well. When operated at, or just below their rated current (I.e. 20mA) an LED should last 100,000 or more hours before failure.
Other methods include:
- Extreme current - Too high of a current will let the magic smoke out of the LED, causing premature failure.
- Extreme heat - Caution should be used when soldering LEDS to a board or wires to the LED leads. It's recommended to use a soldering heat sink.
- Electrostatic discharge - ESD may cause immediate failure of the semiconductor junction. Be sure to ground yourself and your workstation when working on any electronics.
- Excessive Reverse Voltage - LEDs can be very intolerant of excessive reverse voltage. Diodes are designed to withstand a reverse voltage, and have a PRV (Peak Reverse Voltage) specified, but LEDs are not designed to be used as rectifiers.
Avoid the excessive current failure vector by using a resistor for each LED. This prevents increasing current if one LED fails, since a single resistor is calculated to limit the current with multiple LEDs connected to it. Two LEDs connected in parallel with one series resistor will flow 40mA of current, and the resistor will be half the size. Meaning it will allow 40mA through one LED should the other fail. See the above section on Ohm's Law.
The colour of a LED is important.
The first LEDs were Red in colour. Later, Green and Yellow LEDs appeared. For a number years, those were the only colours available, with Blue ones eventually appearing, and later still, White
For the examples below, a 5mm commodity LED is the norm for values presented.
Red, Red-Orange, and Orange LEDs are typically 1.7 to 2.4V at 10mA.
Green, and yellow-green, are typically 1.8 to 2.4V. Some green LEDs can be 3 to 3/5V.
2.8 to 3.5V. Early "blue LEDs" were in fact, small incandescent lamps with a blue diffuser. Later ones were true semiconductors and further development brought blue LEDs five times brighter than their predecessors .
True white-light-emitting LEDs do not exist. LEDs emit one wavelength.
White does not appear in the colour spectrum; instead, perceiving white requires a mixture of wavelengths. A trick is employed to make white LEDs: Blue-emitting semiconductor base material is covered with a converter material that emits yellow light when stimulated by the blue light, similar to a fluorescent light's construction. The result is a mixture of blue and yellow light that is perceived by the eye as white. The mixing of specific colour values is the principle behind colour television.
White LEDs exhibit a colour shift due to different concentrations of converter material, in addition to a change of wavelength with forward voltage for the blue-emitting InGaN material. So when changing the forward current, the colour balance of the LED with shift. This can be an issue if multiple LEDs are used. Also, dimming the LED will have some effect.
Reading the Data Sheet
Manufacturers and distributors of LEDs will supply a data sheet outlining their products parameters. There are a number of details you need to know. (These were taken from a Vishay white LED data sheet.)
Forward Voltage indicates the amount of voltage drop across the junction, which must not be exceeded.
|DC Forward Current||IF||30||mA|
|Soldering Temperature||t≤ 5s||TSD||260||°C|
Two details are important: VR and IF. The maximum current, IF must not exceed 30 mA, and the maximum reverse voltage VR applied to the LED is 5V.
What the Data Sheet Tells You
As seen in the tables above, the maximum current is 30mA, and forward voltage is 3.6 MAX. For easy calculations, a nominal VF of 3.0V will be used.
Power supply, VS will be 14V.
The forward voltage is 3V. Therefore the series resistor must flow enough current to develop a potential across it of 14 − 3 or 11V.
Using the value of 11V, Ohms Law says that R=V ÷ I, or 14 ÷ 0.03, which is 467Ω. Resistor values in this range are multiples of 4.3, 4.7, and 5.1. Using that rule, 470Ω is a reasonable choice, at a tolerance of 5% or ±24Ω. Since a lower value will cause more current to flow, the better choice is 510Ω, which results in a current of 22mA. This also gives a margin of safety.
If this LED will be powered by a DCC track signal, it gets more interesting. It will be exposed to a reverse voltage of ≈14V Note 1 when the phases switch, exceeding the 5V VR. To prevent that, another diode will be placed in parallel and reverse biased to protect it. The reverse current will flow through it, with the VF of a typical diode being 1.4V, which is below the rating for the LED. (This section also applies to layouts using Analog Direct Current for power.)
Note 1: The DCC voltages on the track may be more than 14V. Measure it or estimate it to be greater than the amounts specified in the NMRA Standards.
Also see this website for more information: SM LEDs.