Highly Liquid Forum facebook twitter google plus rss feed

Go Back   Highly Liquid Forum > Current Products > MIDI CPU

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-03-2010, 08:33 PM
John's Avatar
John John is offline
Moderator
 
Join Date: Jan 2009
Posts: 3,007
Default Selecting LEDs & wiring them to the MIDI CPU

The MIDI CPU can drive just about any type of LED. But there are some things to think about...

Finding an LED that we like

There's obviously a huge variety of LEDs available. For LED indication, we want to look for the lower-brightness, lower-current types. There are more powerful LEDs used for things like flashlights, etc--not necessarily what's needed for indicator lights.

Indicator LEDs (or numerical 7-segment displays) typically work nicely at around 10-20mA of current or less.

Search for "LED" at Digikey and you'll get this page:

http://search.digikey.com/scripts/Dk...ds=LED&x=0&y=0

Under the "Optoelectronics" heading, click on "LEDs - <75mA, Discrete" and you get a nice parametric search:

http://search.digikey.com/scripts/Dk...t=524729&k=LED

Let's pick color=red, and mounting type = through hole. This narrows things down a bit.

We still have 40+pages of results to filter...so let's choose a Lens Type and Lens Style that we like.

"Lens style" round / 5mm / T 1 3/4 is the familiar, inexpensive plain LED. We'll choose that, and also "diffused red" for "lens type". Clear-lensed LEDs tend to have poor viewing angles.

Only six pages of results now. Check the "in stock" box, and we have only 2 pages, which we can browse by clicking the "View page" button.

Here's an inexpensive option with decent light output rating:

http://search.digikey.com/scripts/Dk...me=160-1705-ND

I'll use the above (LTL-307E) for the sake of example. But just about any regular (Vf = 2V +/- 0.5V) LED will work. Choose a color/size/shape that you like.


Determining how much current the LED will draw


Let's forget about the MIDI CPU and consider a single LED. An LED requires a series resistor to limit the current thru the LED.

Check out "Calculating an LED resistor value" here:

http://www.kpsec.freeuk.com/componen....htm#calculate

As stated in the link above, most non-super-bright, non-blue/white LEDs have a forward voltage of about 2V. Every LED datasheet will include a "forward voltage" rating.

Looking at the datasheet for our selection, we can confirm that Vf is 2V. The maximum forward current is 30mA, which is plenty. We'll probably operate the LED at 10mA or less, which is usually enough for a nice bright output.

The MIDI CPU can supply a 5V signal for driving LEDs. So, if our LED "drops" 2V (Vf = 2V), that leaves 3V across the current limiting resistor. If we choose a resistor value of 1kohm, the current thru the resistor (and thus, thru the LED) is 3V / 1kohm = roughly 3 mA.

Ok--3mA per LED. Let's take a look at how the LEDs are connected to the MIDI CPU. Here's an example from this thread:



Note that, instead of placing a resistor in series with every single LED, we can just place a resistor in each "LED Data" output line.

The MIDI CPU drives each "LED common" output in sequence, never more than one at the same time. Each LED Common output can drive up to 8 LEDs (as shown in the diagram above). If we have an LED matrix that includes a row of 8 LTL-307E LEDs with a 1kohm resistor on each LED Data output, then the MIDI CPU will be supplying up to ~24mA of current (3mA x 8) at any time.

This is within the 70mA that the Rev K MIDI CPU can supply. It is also within the 25mA per-control-terminal limit--this is important because a single "LED common output" control terminal will potentially drive 8 LEDs at once.

If our LED matrix had fewer LEDs per LED common output (in other words--fewer than 8 LED data outputs in use), then we could also use a slightly smaller resistor value and still be below the 25mA per-control-terminal limit.

More below...

Last edited by John; 09-04-2010 at 02:41 PM.
Reply With Quote
  #2  
Old 09-03-2010, 09:40 PM
John's Avatar
John John is offline
Moderator
 
Join Date: Jan 2009
Posts: 3,007
Default Increased Brightness & LED Current

Let's say we built the circuit in the post above, but the LEDs aren't quite bright enough for our needs. We could always try a different LED type (there is a surprising amount variation between different LED part #s, even at the same current). But if that's not an option, we can simply increase the LED current.

LED current is increased by decreasing the resistance of the current limiting resistor. If we changed from a 1kohm to a 470ohm resistor, the LED current would change from 3mA to roughly 6.4mA. (3V / 470ohm = 6.4mA) Double the current should roughly double the brightness.

This works fine for each LED data output--6.4mA is less than the 25mA per-control-terminal limit.

However, if 8 LEDs in the same "column" are activated, then the LED common output is sinking 8 x 6.4 = 51.2mA. This is too much for one control terminal--it will damage the MIDI CPU.

So, we can add a "buffer" circuit that will sink the current, and protect the MIDI CPU LED common output.

Let's use a ULN2803 IC:

http://search.digikey.com/scripts/Dk...=ULN2803APG-ND

It has 8 NPN "buffers", each of which can sink up to 500mA. More than enough. When activated, each buffer will draw only 2mA or so from the MIDI CPU LED common output.

Here's what the new diagram looks like. Since we have added an inverting buffer to each LED common output, the control terminal modes should be switched from "non-inverted common cathode" to "inverted common cathode".


Last edited by John; 10-11-2010 at 08:29 PM.
Reply With Quote
  #3  
Old 09-03-2010, 10:05 PM
John's Avatar
John John is offline
Moderator
 
Join Date: Jan 2009
Posts: 3,007
Default Even More Brightness & LED Current

Let's say we changed to the buffered circuit above, and the 6.4mA per LED still wasn't bright enough.

If we changed our current limiting resistors to 220ohms, the current per LED would be: 3V / 220 = 13.6mA.

13.6mA is still below the 25ma per-control-terminal limit for the LED data outputs, but if all 8 LEDs in a column are activated, the MIDI CPU would need to supply 13.6 x 8 = 108.8mA. This is too much and could damage the MIDI CPU.

The solution is to buffer the LED data outputs as well. We can do this with a 74AC241 buffer IC:

http://www.mouser.com/ProductDetail/...9XEd3ohsp3w%3d

It has 8 buffer circuits, each of which can supply 24mA. This will work fine, as long as the 74AC214 is not powered from the MIDI CPU regulated output. (Use a separate voltage regulator, like the 7805, to get 5V.)

The new diagram looks like this:



I'm considering an add-on product for the MIDI CPU that would combine the ULN2803, 74AC241, and current limiting resistors to make LED control hassle-free.
Reply With Quote
  #4  
Old 08-09-2014, 08:11 AM
slateboy slateboy is offline
Junior Member
 
Join Date: Feb 2012
Posts: 15
Default mixed LED outputs

With a setup using one or two 7-segment LED displays and some discrete LEDs would it be best to configure and wire them all as the same output type, ie common anode/cathode?
Obviously, most 7-segment displays will have one common anode or cathode whereas single LEDs can be used either way round, so, when it comes to wiring up my project i'm wondering if its possible to mix and match or perhaps better practice to keep consistent.
thanks
Reply With Quote
  #5  
Old 08-13-2014, 02:57 PM
John's Avatar
John John is offline
Moderator
 
Join Date: Jan 2009
Posts: 3,007
Default

Quote:
Originally Posted by slateboy View Post
With a setup using one or two 7-segment LED displays and some discrete LEDs would it be best to configure and wire them all as the same output type, ie common anode/cathode?
Obviously, most 7-segment displays will have one common anode or cathode whereas single LEDs can be used either way round, so, when it comes to wiring up my project i'm wondering if its possible to mix and match or perhaps better practice to keep consistent.
thanks
You can mix and match, but it will make the configuration and wiring less confusing if you use the same common type for all LEDs.
Reply With Quote
Reply

Tags
led, midi cpu

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:31 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.