Don't like ads? Help support the Mercs by becoming a Supporter or Auxiliary Member today!
Official Members also get to use the forum ad-free - so kit up and join us!

 Understanding LEDs and Circuit Design

  • 1 Replies
  • 1364 Views
Understanding LEDs and Circuit Design
« on: Jul 01, 2017, 08:41 PM »
The symbol for an LED is a diode with a few ray lines off of a side. The important part here is an LED is simply a diode that makes light. Unfortunately for the uninitiated, an LED is somewhat intolerant of abuse as it is a very low current diode. As an example, you can very briefly make a red LED appear to be orange... Until it burns up. An instructor I had was fond of this and I'm sure others have come across similar if not the same thing. "All electronics runs on smoke. It quits working when you let the smoke out."  The purpose here is to help prevent smoke and design high brightness LED circuits that won't fail. What I am not going to do is allow you to cheat or otherwise abuse an LED. I have found a lot of commercial abuses of LED's in products on the market today. Used properly an LED has an extremely long life.

From this point forward you will need at least a basic understanding of terms and abbreviations.

Manufacturers have created some LED's that can be described as self regulating or having an internal resistor. The self regulating types will have a somewhat broad operating range such as 5-12V. The internal resistor types may also have an operating range but the voltage will be more specific such as 5V or 12V and a secondary small range near that voltage. These are easy to use and save the cost of a resistor in theory at least.

The original red LED (light emitting diode) had a forward voltage drop of about 1.2V. Early LED's had a current limit as small as 10mA though the 5mm "jumbo" LED usually had a limit of about 20mA. For design purposes, the two important numbers you need to know for an LED is the "forward voltage" and the "maximum current" rating. On a datasheet this may be abbreviated to something like Vfwd and Imax. Make sure you know these numbers. If you ripped them out of something and don't know the specifications, try searching for similar color datasheets. While the process used to make one color is different than another color, most similar colors will use a similar process and have similar ratings. Low brightness LED's will usually have lower current limits than high brightness types. I highly recommend purchasing new LED's in bulk where you know what you are working with.

Now, we have all the numbers to design an LED circuit. There are two routes to go for this. The "cheap" method employs a single current limiting resistor and the LED's may be connected in series. If you use white or one of the higher voltage LED types, series operation quickly becomes impractical with a lot of LED's though this method can yield the longest battery life. The parallel method uses a resister for each LED and the resulting higher current will yield shorter battery life. We'll get to all these numbers in a bit.

First we need to identify the leads of an LED. Again, search for datasheets for examples here. Typically, the long lead of an LED is the anode and the short lead is the cathode. Failing that, the flat side, notch or even sometimes a tiny dot marks the cathode. The markings can vary between manufacturers. An SMT (surface mount) part can also have other markings such as a flat corner or a line. You might want to consider SMT where size is a factor.

To turn on an LED we need to forward bias it. That makes the anode the + (positive) side and the cathode the - (negative) side.

The series LED array:
For the examples here, we will use two or more red LED's in series. As already mentioned, a red LED has a Vfwd of 1.2V and we'll use an Imax of 20mA. The power supply in this case will be a standard 9V battery. Lastly we'll use a bit of Ohm's law to calculate the resistors needed. In the examples I'll be using extra parenthesis to make the order of operations clear.  In electronics design, just as many other fields, the math doesn't lie though there can be minor differences between theoretical calculations and actual measurements.

2 LED's in series: R =(9V - (2 * 1.2V)) / .020A = 330 ohms
In the calculation mA or 1000ths of an A (amp) is converted to amps. So we have the 9V battery minus the drop across 2 LED's (2.4V) for a voltage of 6.6V for the resistor. Dividing by the current limit or Imax of .020A we get a resistance value of 330 ohms. Now, 330 ohms is a standard resister value so no further work needs to be done.

4 LED's in series: R = (9V - (4 * 1.2V) / .020A = 210 ohms
 This time we have the 9V battery minus the drop across 4 LED's (4.8V) for a voltage of 4.2V for the resistor. Dividing by the current limit or Imax of .020A we get a resistance value of 210 ohms. This is not a standard value. The next higher standard value is 220 ohms.

At this point, you need to know the standard resistor values. Regardless of the decimal point, resistor values only have 2 significant digits. As a side note, capacitance standard values follow the resistor value standard.  For practical use, the 10% interval resistors are normally close enough. If you do a lot of this stuff, you might want to look into an assorted resistor kit though LED work will only use the lower values.

10% intervals:
10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82

7 LED's in series:  R = (9V - (7 * 1.2V) / .020A = 30 ohms
On the surface, this looks good. Wow, I can put 7 LED's in series and it will still work! Or will it? Remember, we are using a 9V battery and not a 9V power supply. What happens as the 9V battery discharges? The nominal 9V that you started with will become 8V in short order.  Those who are quick with math probably already see this but it needs to be explained. The new calculation based off of the partially used battery at 8V is (8 - (7 * 1.2)) = -0.4V and what that negative sign means here is our LED's shut off. Without enough forward voltage (1.2V per LED), the LED string won't light up or at the very least it will be very very dim.

Now we have a new design consideration that needs to be taken into account. Just how long do you want your battery to last? Obviously, the fewer LED's in series, the lower voltage we need, but even that has limits. No matter what resistor you select with a shorter series, the LED's will dim as the battery voltage drops. As a design rule, you probably don't want more than half the battery voltage dropped in an LED series when using a direct battery connection.

If you are driving your LED's with a logic output with a regulated voltage such as 5V, you can design your LED circuits right up to the limits of the driver. You only need to deal with the variables of a battery if the voltage changes as the battery discharges.

Parallel operation causes some different problems. Again assuming a 9V battery source, the math is nearly the same as the series array.  The only difference is you only have a single drop. There is one major difference in creating an array this way. The currents add in parallel where the voltages add in series.

A single LED: R = (9V - 1.2V) / .020A = 390 ohms
That isn't to bad, the 390 ohm resistor is a standard value so nothing else needs to be done. In this configuration, the LED will remain the brightest and last the longest as the battery discharges.

4 LED's in parallel: 4 * .020A = .080A
The resistor value is the same for each single LED but the currents add. This isn't so bad, but this can be a problem for CMOS logic circuits. The effect is your battery will drain 4 times faster. The visual brightness will be less effected though. This is something you need to account for when driving things with an Arduino or similar board. If this is not a direct battery hookup, you might need to check driver board limitations. Also with a driver board, your supply voltage becomes what ever the control voltage is, It could be as low as 5V.

7 LED's in parallel: 7 * .020A = .140A
This many in parallel runs the risk of burning up or at least over loading driver circuits. Now you need to check the specifications for the driver circuit. These are source and sink limits found in the datasheet for the driver. If it is just a direct battery hookup, battery life may be severely impacted. If you need this many LED's, the obvious compromise is a series/parallel arrangement where the current drain is only doubled while still giving good battery life.

What if I need to drive 24 LED's with a single output from an Arduino board? This is 6 sets of 4 LED's in a series/parallel arrangement. You need a driver transistor. Using a transistor as a switch is quite common and your LED's have a direct connection to the battery. Assuming a 5V drive voltage, you will need a 120-220 ohm resistor from the drive output to the base, the emitter is grounded, the collector attaches to the negative side of the LED's and the positive side of the LED array to the battery. A common 2N3904, 2N4401, or a 2N2222 should work for this most of the time. In this instance, the LED circuits can be designed as though connected directly to the battery. The transistor is acting as a switch and the driver circuit doesn't know it might be controlling 12V rather than 5V or that it's .140A rather than just .040 - .020A.

Using 2 transistors and a couple resistors it's possible to create a current limiter. This could also be described as an automatic variable resistor. You can drive your LED's at full brightness until the battery discharges below the current/voltage threshold of the limiter and associated LED circuit arrangement. This may be the subject of a future post as it needs pictures.

Logged
Understanding LEDs and Circuit Design Part 2
« Reply #1 on: Jul 02, 2017, 08:25 PM »
In the previous post, I outlined pretty much everything you need to know to use LED's without making smoke. In this one I give you a little regulator circuit that can be made cheaply and produces reliable constant brightness from LED's. This is what some might call a magic resistor. It automatically maintains the proper operating current regardless of what the input voltage might be.

First the circuit:


If you look at the graphic, you'll notice the wide voltage range. It actually should maintain near constant brightness down to nearly 5V running 4 red LED's in series or when your 9V battery is near dead. The other thing is it will safely handle just 1 LED with a supply as high as 24V with no changes.

First some notes about the parts. The 2N3906 transistors are general purpose and several other general purpose PNP transistors may be substituted. Another common high gain type is the 2N4403 that is nearly the same. The transistors are not real critical but these 2 types are very easy to get. One thing to be careful with is the through hole version is rated for about twice the power of the SMT version of the same part. If you must substitute, be sure you understand the specifications and what they mean. The bias resistor (R2) is also not real critical but the best value will typically be around 18k. Using anything in the range of 10k to 27k may work depending on LED requirements and the transistors used. The only critical resistor is the current limit resistor (R1) and it will be explained in detail.

The only math you need to know for this is 0.7V / Imax = R1. That's it. As an example, the typical red LED might have an Imax of 20mA or 0.02A. Using the formula you get 0.7V / 0.02A = 35 ohms. Now, because this is kind of critical, the nearest 5% tolerance value is 36 ohms. In fact, testing in LTspiceIV gives you about 17-18.mA from 6V to a 24V supply using the 18k bias resistor. You can run up to 4 red LED's in series or just a single LED and they will always be the same brightness. If you have more than 4, you'll need to make more of the little circuits.

Off the top of my head, I had some bright blue LED's that required 40ma. So, 0.7 / 0.04A = 17.5 ohms and in this case the next nearest standard value is 18 ohms.

While you can get 1% precision and better, the extra precision probably isn't worth it. If you really need to tweak the brightness, you can use resisters in parallel. For 2 resistors, (R1 * R2) / (R1 + R2) = R.

Circuit construction:
The transistors are shown in blue with the flat side up, R2 is orange and R1 is green. The power wires are red and black and the LED wires are magenta and black. In both cases the black is the negative (-) side. If you use another type of transistor, you are on your own since the basing might be different. Solder the parts together as shown. With some care you should be able to get them shaped in a little more or less round bundle. Make sure none of the leads are touching anything they shouldn't. Test your circuit to make sure it is working right. Use a small glob of RTV silicone to make sure the leads stay in position and let that dry 24 hrs. Cover the assembly with heat shrink tube making sure the red and black wires come out one end and the magenta and black come out the other. You can skip the heat shrink step, but it makes the circuit much more durable.  You can substitute white for the magenta or really any other color as long as it isn't red or black. Test your circuit one more time to be sure everything is still working.

One final note. You can still turn your LED's on and off simply by controlling the power to this circuit. Treat the red and black leads as you would an LED and resistor set. If you switch just the LED side, the minor power drain of the bias resistor might eventually drain your battery.

Logged
 


Don't like ads? Help support the Mercs by becoming a Supporter or Auxiliary Member today!
Official Members also get to use the forum ad-free - so kit up and join us!




Powered by EzPortal