electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
  Faux Pas Quartet and friends Music From Last Thursday
Please visit the chat
 Forum index » DIY Hardware and Software
A Collection of LED Drivers
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 2 [35 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Mon Sep 05, 2011 10:36 pm    Post subject: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

Hi Everyone,
In my never-ending quest for more blinky lights, here are some LED drivers I’ve found around the Interweb, and even a few tweaks I’ve made. This stuff is fairly simple, and you’ll see circuits like this all over the place, but I thought I’d bring some of them together in one place here.

Why use a driver circuit? Well, the best reason is to avoid loading down the circuit the LED is attached to. If you load down a circuit like an LFO, it can change the LFO’s output level or even affect the frequency, and asking a CMOS chip to directly drive an LED can result in erratic operation or even damage to the chip. For example, the 4017 used in many simple sequencers can only supply about 8mA (and that’s the max rating – you generally don’t want to depend on that for long term operation).

Of course, here’s the classic. An NPN transistor actually supplies the current to the LED, and the amount of current required from driving circuit is minimal. This circuit works well with digital or analog inputs, and is dirt simple. R1 sets the current to the base of the transistor - I’ve used a wide range of values from 10K to 150K. R2 sets the current through the transistor and into the LED. Most LEDs can take up to 20mA (0.020A), but you can usually get away with MUCH less than this and still have a very visible indicator. Use Ohm’s Law (I = V/R) to figure out how much current you’re putting through your transistor and LED. For example, in the circuit below with a +15V supply and a 2K resistor, we’re running about 7.5mA (15 / 2,000 = 0.0075A) through the green LED. The protection diode D2 is recommended if the input signal goes more negative than -6V (this is the base – emitter “breakdown voltage” for the 2N3904 and negative voltages greater than this will damage the transistor).

Let’s not forget that there are problems with LEDs. They consume a relatively large amount of current, and they can switch on and off very quickly. This means that your power supply is suddenly expected to deliver an extra 10 or 20mA, and can cause a spike through the supply and every circuit connected to it, resulting in switching noise getting into your audio. One solution is to use as little current through the LED as possible. It can vary with the color and brand of LED, but just a few milliamps can be enough in many cases. Experiment with a larger value current limiting resistor (R2), and see what works. Another thing I do with my LFOs is to run the LED off the triangle wave rather than the square. This turns the LED on and off more gradually, and gives the power supply and filter capacitors throughout the system more time to supply the necessary current. If all you have available is a square wave, you might want to try adding a capacitor to ground after R1. This forms a low pass filter and can help round off the sharp edges of the switching signal going to the transistor.

Enjoy!

Tim (Captain Blinky) Servo


BASIC LED DRIVER.jpg
 Description:
 Filesize:  580.1 KB
 Viewed:  14288 Time(s)

BASIC LED DRIVER.jpg



Last edited by Tim Servo on Mon Sep 05, 2011 10:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Mon Sep 05, 2011 10:39 pm    Post subject: A Bipolar LED Driver Reply with quote  Mark this post and the followings unread

The LED driver pictured above is very handy, and is about as simple as is gets, but there are a few things I don’t like about it. The first is that it doesn’t show the negative half of the waveform. Well, adding a second circuit using a 2N3906 and the negative supply solves that. Smile The circuit here is still fairly simple and now shows both halves of a bipolar wave. There’s still one thing that bugs me – the LED’s don’t come on until they have a few volts across them (approximately 1.7 for red LEDs, 2.1 for green, and 3.4 for blue). This means that they don’t show the transitions around 0V. For a slow moving LFO signal, this can take several seconds. If that's a problem for you, I'll show a fix for that in the next post.

Tim (Admiral Blinky) Servo


BIPOLAR LED DRIVER.jpg
 Description:
 Filesize:  616.89 KB
 Viewed:  232 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

BIPOLAR LED DRIVER.jpg


Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Mon Sep 05, 2011 10:48 pm    Post subject: A Bipolar LED Driver with Bias Adjustment Reply with quote  Mark this post and the followings unread

Okay, so to have our indicator show the lower voltages around 0V, we need to bias the input signal by adding a volt or two to it. This forces the LED to come on earlier and lets us monitor the changes around the 0V area better. This is basically the same thing as biasing an audio amplifier to reduce crossover distortion. You can use a couple of resistors as a voltage divider to add a volt or two to the input signal and bias it up (or down in the case of the negative voltage monitor). The values I’ve shown should be close, but you may want to experiment to get the effect you like. We’re looking for the LED to come on when the input signal is just barely above (or below) 0V. What I really like is the second solution with the adjustable bias trimmers. Put in a 100K (or even 1M) trimmer, and adjust it so that the LED comes on when you like. You can even set them so they come on just before the signal crosses the 0V line. If you don’t want to ‘waste’ a trimmer, just measure the resistance between the trimmer’s legs, and substitute the closest available fixed resistors. I’ve set mine so that there is a bit of overlap – the LEDs are both on (dimly) during the crossover around 0V. It makes a great indicator for the odd waveshapes on the LFX, and the whole mess consumes only about 7 or 8mA. (LFX link...
http://www.electro-music.com/forum/topic-49081.html

Also, since the current through the LEDs is inversely proportional (when one is high, the other is low, and there is overlap in the middle where both are at lower levels), the system has a relatively stable power draw. It seems to vary from 5 to 8mA, but doesn’t swing from 0 to 20mA like some LED circuits. You still need to make sure your power supply has enough current capability before you add LEDs, but this setup is a little more “gentle” as far as sudden current swings and spikes.

One more thing: blue LEDs aren’t necessarily evil, but most of the time they are too darned bright! Don’t be afraid to throw in a really big current limiting resistor (like 10K or even 20K). Also, I stack the LEDs, putting the blue one BEHIND a red or green diffused LED. It can be a bit of a challenge to mount (try putting the first LED in a regular panel mount and then using heat shrink tubing to fix the second one behind it), but the color combinations can be really nice.

Well, I have a few more, but I'll shut up for now. Have fun!

Tim (Queen of the Blinky People?) Servo


BIPOLAR LED DRIVERS with BIAS R.jpg
 Description:
 Filesize:  112.04 KB
 Viewed:  266 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

BIPOLAR LED DRIVERS with BIAS R.jpg


Back to top
View user's profile Send private message
bubzy



Joined: Oct 27, 2010
Posts: 555
Location: United Kingdom
Audio files: 62

PostPosted: Tue Sep 06, 2011 2:11 am    Post subject: Reply with quote  Mark this post and the followings unread

it would be nice to have one that drives a rgb led so that all states of the lfo could be indicated.
just a thought. im sure its no problem and i havent really had time to read the whole post (should be working Razz)
Back to top
View user's profile Send private message
Dougster



Joined: Sep 20, 2005
Posts: 272
Location: Tucson, AZ, USA

PostPosted: Tue Sep 06, 2011 2:35 pm    Post subject: Re: A Bipolar LED Driver with Bias Adjustment Reply with quote  Mark this post and the followings unread

Tim Servo wrote:
One more thing: blue LEDs aren’t necessarily evil, but most of the time they are too darned bright!

Nope. They're evil.

_________________
Once you start down the modular path, forever will it dominate your destiny!

Every DIY person should own a copy of Electronotes: http://electronotes.netfirms.com

Blue LEDs are evil.
Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Tue Sep 06, 2011 5:18 pm    Post subject: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

Hi Bub,

Let's see... an RGB level meter could maybe do something like
Red >2.5V
Blue -2.5V to 2.5V
Green <-2.5V
I'm not 100% sure how to do this, but it could be a fun challenge. I think it could be done with four transistors, which isn't too bad but it is certainly more complex than the other drivers here. I'll post if I can come up with something.

Hi Doug,

Okay, maybe they're evil. Wink To quote Jessica Rabbit - "I'm not bad, I'm just drawn that way. And my current limiting resistor should be increased."
Probably not a perfect quote there, it's been a while since I've seen that movie.

Also, is it just me, or does that first "Basic Driver" graphic not show up?

Tim (Who Framed) Servo
Back to top
View user's profile Send private message
Dougster



Joined: Sep 20, 2005
Posts: 272
Location: Tucson, AZ, USA

PostPosted: Tue Sep 06, 2011 5:26 pm    Post subject: Re: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

Tim Servo wrote:
Also, is it just me, or does that first "Basic Driver" graphic not show up?

Shows up for me...

_________________
Once you start down the modular path, forever will it dominate your destiny!

Every DIY person should own a copy of Electronotes: http://electronotes.netfirms.com

Blue LEDs are evil.
Back to top
View user's profile Send private message
Danno Gee Ray



Joined: Sep 25, 2005
Posts: 1343
Location: Telford, PA USA

PostPosted: Tue Sep 06, 2011 7:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

No show for me.
Back to top
View user's profile Send private message
marvkaye



Joined: Mar 14, 2011
Posts: 225
Location: Fla

PostPosted: Tue Sep 06, 2011 7:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hey Mr. Blinky.... thanks for putting these driver schems up, very cool stuff. I decided to stripboard your "Bipolar... w/ adjustable bias" one, seeing as how I've got some LFX boards that need them... thought other folks might be interested. Very teeny, only 1" x 1.3", and there are no strips that need to be divided. Now all I need to do is work them into my LFX stripboard layout... next little project. They never seem to end.

<marv>

PS... I can see all the schematics, even the basic one. Just lucky I guess,.


Bipolar_LED_driver.jpg
 Description:
Bipolar LED driver with adjustable bias stripboard
 Filesize:  89.02 KB
 Viewed:  14003 Time(s)

Bipolar_LED_driver.jpg


Back to top
View user's profile Send private message
Paradigm X



Joined: Feb 15, 2011
Posts: 281
Location: Null and void

PostPosted: Wed Sep 07, 2011 2:58 am    Post subject: Re: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

Tim Servo wrote:
Hi Bub,

Let's see... an RGB level meter could maybe do something like
Red >2.5V
Blue -2.5V to 2.5V
Green <-2.5V
I'm not 100% sure how to do this, but it could be a fun challenge. I think it could be done with four transistors, which isn't too bad but it is certainly more complex than the other drivers here. I'll post if I can come up with something.


Found this recently on the Deathlehem/S0und 0f L0g1c form (Rykhard's).

http://www.techlib.com/electronics/bargraph.htm

Could be altered with different LEDs obviously

(i like blue LEDs ! Embarassed Razz )
Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Wed Sep 07, 2011 12:41 pm    Post subject: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

Hi Para,

Nifty, I like that! A couple of notes though: 1) I would NOT feed any negative-going signals into that one. Use a resistor and diode to block any negative voltages going in, or else you could fry that CMOS chip. 2) At the maximum signal level, all the LEDs are lit so you're going to consume a fair amount of current. With a 9V supply and 1K current limiting resistors, each LED will consume 9mA, and the whole chain will consume 45mA when fully lit (by comparison, most synth modules consume 50 to 100mA, so that indicator can take as much current as an entire module).

Tim (fully lit) Servo
Back to top
View user's profile Send private message
Paradigm X



Joined: Feb 15, 2011
Posts: 281
Location: Null and void

PostPosted: Thu Sep 08, 2011 9:16 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh Ok, thanks. Bit of a noob at all this Laughing

To paraphrase the simpsons;

"Right!! That's why you're the judge and I'm the law-talking guy."

Very Happy
Back to top
View user's profile Send private message
VW



Joined: Feb 06, 2011
Posts: 3
Location: Finland

PostPosted: Fri Sep 09, 2011 5:42 am    Post subject: Reply with quote  Mark this post and the followings unread

Nice topic, I remember searching for this info at the time when I was doing my first synth-diy experiments. Today this basic npn transistor driver is a routine addition for each led to be lit, even for power supply and bypass indicators.
What I've done with my LFO's though is using Multi-Color (Red-Green) leds. Green indicates the positive phase, while red takes care of the negative phase of the LFO waveform. The Bi-Colour led's I'm using are two-pin - they take current in both directions.
Instead of using a transistor, using an op-amp as a buffer will allow both negative and positive voltages to pass while not loading down the circuit.
I found out about this bicolour led driver circuit when Tom Bugs posted a schematic in various topics in the Thomas Henry forum; Since this is a LED-driver collection I guess it won't hurt adding this here too:


bi-colour_led_driver.jpg
 Description:
 Filesize:  12.46 KB
 Viewed:  13598 Time(s)

bi-colour_led_driver.jpg


Back to top
View user's profile Send private message Visit poster's website
Thomas_Henry



Joined: Jul 24, 2009
Posts: 129
Location: N. Mankato, MN

PostPosted: Fri Sep 09, 2011 6:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi gang,

Here's a tricolored affair I came up which appeared in Electronotes, Volume 14, Number 134, February, 1982, pp.17-20. Perhaps you might find it useful.

It monitors an input voltage and displays green if the level is "low", orange-yellow if the level is "safe" and red if the level is "high." It's great for protecting sensitive chips like bucket brigade devices. Notice that the color transitions are continuous, so you can monitor trends easily.

Thomas Henry


TriColor.pdf
 Description:
Tri-Colored Peak Monitor

Download
 Filename:  TriColor.pdf
 Filesize:  149.55 KB
 Downloaded:  393 Time(s)

Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Sun Sep 11, 2011 12:00 am    Post subject: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

Nice, Thomas! I like the oscillator that creates the yellow mix color.

Tim (mixing it up) Servo
Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Sun Sep 11, 2011 12:40 am    Post subject: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

And now for something completely different... I was wondering if I could run two LEDs off of a single transistor, one off the emitter, and one off the collector (in inverting mode). Turns out you CAN do this Wink This circuit doesn't have quite the range of the two-transistor model, but it's very close and uses fewer parts. This version is also more sensitive to the bias setting, but just apply a nice slow triangle wave and adjust the bias so that the two LEDs stay on for the same amount of time. I've also used this setup with a green LED for D1 and a blue LED for D2. Don't be afraid to experiment with different resistor values. I've used a 15K for R4 with a blue LED, and that tames it down quite a bit. Makes a pretty light show.

Have fun with it!

Tim (Captain Different) Servo


SINGLE TRANS BIPOLAR LED DRIVER.jpg
 Description:
 Filesize:  598.92 KB
 Viewed:  13359 Time(s)

SINGLE TRANS BIPOLAR LED DRIVER.jpg


Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Sun Sep 11, 2011 1:00 am    Post subject: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

Okay, I'm going to try this again. For some bizarre reason, some of my JPG images don't show up in previews or when I look at the thread later. I know some others have had the same problem, while others can see them just fine. If the images are too small I don't see them, but if I put them in a wide border they work just fine... go figure.

Anywho, these images are for those who can't see the basic LED driver and Single Transistor Bipolar LED driver schematics I've posted above.

Tim (Invisible Man) Servo


SINGLE TRANS BIPOLAR LED DRIVER2.jpg
 Description:
 Filesize:  603.6 KB
 Viewed:  184 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

SINGLE TRANS BIPOLAR LED DRIVER2.jpg



BASIC LED DRIVER2.jpg
 Description:
 Filesize:  586.83 KB
 Viewed:  170 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

BASIC LED DRIVER2.jpg


Back to top
View user's profile Send private message
richardc64



Joined: Jun 01, 2006
Posts: 614
Location: NYC
Audio files: 25

PostPosted: Sun Sep 11, 2011 5:04 am    Post subject: Re: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

Tim Servo wrote:
Okay, I'm going to try this again. For some bizarre reason, some of my JPG images don't show up in previews or when I look at the thread later.


They all show up for me, but there's definitely something not right about them. No way should images those dimensions be 600KB, unless they're BMPs with an erroneous JPG extension. I get 19KB and 42K after I Open and re-Save them. Whatever.

Thanks for the info.

_________________
"I am endeavoring, ma'am, to create a mnemonic memory circuit... using stone
knives and bearskins." -- Spock to Edith Keeler
Back to top
View user's profile Send private message Visit poster's website
footfleet



Joined: Oct 09, 2011
Posts: 2
Location: Providence, RI

PostPosted: Sun Oct 09, 2011 2:03 pm    Post subject: Resistor-only + gate-length Reply with quote  Mark this post and the followings unread

Hey all - This site has been a huge help so many times. First post...

2 questions...
1) Is my LED set up bad?
- I have no negative voltage. I'm pretty new to this, but my in-progress 4017 CV sequencer has simply a 2.2k resistor before each LED... receiving current from the 4017 outputs. So, it's about 7.5V into the resistor, and 1.8V hitting the LED anode. If I'm doing Ohm's Law right, each LED is getting around 0.8mA (.0008A), which is less than what Tim Servo was getting with his first transistor circuit (low is good, right?).
- So, is this LED set up ok? ...or is it that even though the current is low, there is an issue with taking the current right from the 4017 like that?

2) Considering I have no negative voltage (just a 9V battery), what's the simplest way for me to switch to a gate-length LED blink?
- I have a 3-way switch on each step (I'm receiving my clock from the Korg MS-20 sq wave 0 to +5V) which gives me the trigger options: 'gate-length' / off / long. I can set the gate length with the LFO sq wave duty cycle knob on the synth.
- I built Ken Stone's LED driver, and took current off the individual gated steps, yet for some reason the LED blinked full-length, instead of gate-length. I haven't had a chance to try and figure out why, but I was wondering if anyone has a suggestion for theee simplest gate-length LED driver that doesn't need to deal with negative voltage?

...With 30 steps, I'm desperately trying to keep every corner of this circuit minimal... mostly cause its getting too confusing for me to keep track of!
THANKS
Back to top
View user's profile Send private message
bubzy



Joined: Oct 27, 2010
Posts: 555
Location: United Kingdom
Audio files: 62

PostPosted: Sun Oct 09, 2011 3:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

welcome to electro-music Smile
i put the leds directy into the outputs of the 4017, doesnt seem to make any difference.
Back to top
View user's profile Send private message
footfleet



Joined: Oct 09, 2011
Posts: 2
Location: Providence, RI

PostPosted: Wed Oct 12, 2011 10:40 am    Post subject: Reply with quote  Mark this post and the followings unread

Good to know. I won't sweat it, then...
Thanks
Back to top
View user's profile Send private message
Tim Servo



Joined: Jul 16, 2006
Posts: 924
Location: Silicon Valley
Audio files: 11

PostPosted: Fri Oct 14, 2011 11:11 am    Post subject: A Collection of LED Drivers Reply with quote  Mark this post and the followings unread

My concerns over driving an LED directly off a 4017 output are only from reading the spec sheet, not actual use. It just seemed to me that it was awfully close to the max that the chip can supply, but of course, that also depends on how much current you run through the LED. I'd say that if it's a module for your own use and it works, then go for it. I would probably avoid doing that on a commercial product though. Smile

Tim (current events) Servo
Back to top
View user's profile Send private message
Paradigm X



Joined: Feb 15, 2011
Posts: 281
Location: Null and void

PostPosted: Sat Nov 05, 2011 1:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi

Bumping this up with what might well be a stupid question. (!)

Ive got a midi to trigger deivce which has 23 outputs... to make a blinky for each, would i really need 23 of the first transistor circuits, or is there a cleverer way of going about it?

Cheers, Ben Smile

[/right]
Back to top
View user's profile Send private message
Dougster



Joined: Sep 20, 2005
Posts: 272
Location: Tucson, AZ, USA

PostPosted: Sat Nov 05, 2011 6:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

Do you have a couple shift registers available? You could make an LED matrix like the one used in the MIDIbox Sequencer. It'll take a bit of programming and the leds won't be directly tied to the outputs...

http://ucapps.de/mbhp/button_duoled_matrix.pdf

http://ucapps.de/midibox_seq_v3_options.html

_________________
Once you start down the modular path, forever will it dominate your destiny!

Every DIY person should own a copy of Electronotes: http://electronotes.netfirms.com

Blue LEDs are evil.
Back to top
View user's profile Send private message
Paradigm X



Joined: Feb 15, 2011
Posts: 281
Location: Null and void

PostPosted: Mon Nov 07, 2011 5:06 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks Doug. However,

Dougster wrote:
It'll take a bit of programming


puts me right off tbh... best ive ever done is

10 Print Hello world
20 goto 10

Razz

Still getting my head around attaching bits of metal to each other with a hot pencil. Embarassed Razz

Ill have a read thru those links when i get a chance tho Smile

Cheers

Ben
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 2 [35 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use