I have to blame my pal Danno for this.  He wanted a 70's vintage "color organ" one of those things that used to be a box that had Christmas tree lights on the inside and that frazzled plastic they put over fluorescent light fixtures on the front.

I figured replace the Christmas tree lights with LED's and call it a day.  I have to make my life more complicated though.

I started thinking of the color changing LED's so I got a pack of the fast and slow changing ones.  They are pretty neat.  They have a Vf of about 3V and I have a 15V 1A power supply, 5 of the LED's in series and about 1.5K gives them a nice brightness.  If you run them at even 10 ma they are way too bright and IMHO the colors are not as deep.

The problem with these is they are on all the time and while the color chaning is cool, the static placement of  the lights is not.  But, if I could sequence the lights, perhaps make different shapes or like a circle expanding out, that would be cool.

My first thoughts turned to a micro controller, but that would not be happy with my 15V supply and would probably not be happy driving the LED's directly, and that would lead to transistors or drivers or what not.  More goop.  My second thought tuned to either a CMOS based inverter acting with an RC as an oscillator or god forbid, a much hated 555.  This could drive a CMOS decimal counter.  Only this has a lot of parts and if you want the outputs to build up to all 10 being on at once it would also require flip flops.  Urg.  Can my life never be simple?

Than it hit me.  Dead assed simple.  An old National linear chip:  The LM3914.  This was designed to drive bargraph displays.  I was able to get 10 of them for under $2 on eBay.  This will run off of up to 15V, this has a constant current drive for the LED's (just one R to set the current for all 10 LED's), this can do bar or dot displays (just open one pin up), it has an internal 10 step divider and the hi and low sides are pins, it can take up to Vcc -3V.  The input to the comparitors is a high impedance.  Hmm.

My first test with the new chip was 10 red led's and a circuit right out of Nationals app notes for the part.  They have a voltage divider to make it respond full scale to 5V.  I did not have the exact resistors.  When I first turned it on, all hell broke loose.  Everything flashing and strobeing, but I did not have the input tied to anything.  I tied it to ground and poof all the lights went out.  So far so good.  I hooked up a pot between ground and my +15V and put a DVM on the wiper and verified that it was at zero and I could sweep it up from there.  Cool.  I hooked the input to the pot and I was happy to see the LED;s coming on in sequence.  I was also happy to see when I opened up the dot/bar pin the display type changed.  Cool beans.  

So, the next iteration was a 100Uf cap (rated at 16V, yea getting close there...) and a 1 meg resistor between V+ and ground with my dvm and the input to the bargraph across the cap.  Powering on, no lights, but as the voltage made it's way up near .5V, the first light came on.   Than the second, than the third, all the way to #10.  Yahoo.  Moving the V+ side of the resistor on the RC to ground reversed the process.  Too cool.

Next, I switched out the LED's to the color changers.  I was wondering if they would have too much digital noise and cause issues, and I had wanted to start simple for 2 reasons.  One is it is just a good idea, and two, I was mildly questioning if the chips I bought actually had any guts in them at the price I paid.  I was very happy they passed the simple test...

When I powered up the fast color changing LED's all hell broke loose.  Shit.  I tried bypassing the LED's like they suggested in the app note but with no luck.  I was pondering trying to bypass each LED on it's own, when I noticed one of my ground wires had popped out when I was transplanting the LED's.  Power off, fix that, power on and... Nothing, but just when I am starting to panic, the first LED comes on and starts color changing...  Than the next...  Yahoo.  The color changers are fine.  No problem at all.

So, I have a couple more tests to do.  One is to solder up a series string of 5 of the color changers and see how the chip likes driving the string of them.  My guess is it will be totally happy, and the next thing, and I am still pondering this, is one transistor that the #10 output can turn on that will short out the cap and cause the cycle to start over again.  It would be cool to have an RC on the base of the transistor so the #10 light string could stay on for a while before resetting.  I am thinking of an RC with a zener diode in series with the base.

BTW, for construction I am thinking "Chinese" style.  With this few parts I am thinking I can screw the power supply to a piece of fish paper and air staple that to the inside of the case, and I can hot melt glue the chip and the caps to the back board and hot melt the LED strings in place and just tack solder the stuff together.  There really are very few parts.  

So if you are in need of a circuit to sequence a bunch of outputs and you don't wanna spring for the cost of a micro or a micro does not meet the drive requirements, and you don't wanna screw around with a multi chip solution, have a look at the LM3914.  Also, if you do audio they make an LM3915 that has a logarithmic divider inside it for making VU meters.  They cost more.  Go figure...

I have not revisited my prototype but I have been pondering this some.  I am now wondering if it would be easier to just use an opto isolator for discharging the cap quickly.  This has the advantage of being able to just hook the LED up in series with or in place of a string of LED's, and the collector current is rated at 50ma or 100m for under 1ms.  Have to get out my scope and see what the internal resistance of the 100uf cap is and see how much current it can supply for how long if it is simply shorted out.  I have a hunch the opto may be able to do it.  I can always use a smaller cap and a bigger R up to the point that the leakage resistance of the cap and impedance of the input to the comparitor string start becoming significant.  This is not precision timing, but it does have to charge up to at least 5ish volts.

--

I tell you those solid state doo dads are just too damn fast!  In my experimenting I put a pair of clip leads across the timing cap and crossed them as quickly as I could, and that did a wonderful job of near totally discharging the cap, and stating the whole cycle over.  I spent the afternoon looking for a transistor opto isolator.  I have at least a tube of them someplace in my stuff.  That someplace was not the two rooms and countless boxes I weeded through.  On the plus side I found the flow sensor I wanna put in line with the water pump on my laser cutter, some nice stainless rack handles for a friend who likes that sort of thing, and all kinds of other goodies.  I finally found a tube of DH11F1M's which are opto fets.  I kind of hate the idea of wasting one here,  but I hate the idea of digging through more boxes even more.  So I snarfed a few and off to the lab I go.

The nice thing with the 3914 is it uses a more or less consent current drive on the LED's so you can put them in series and in this case get an idea of what is going on, given you can not see the IR LED in the opto..  As usual I figured start simple and get complicated as necessary.  God knows things get complicated enough on their own.  No need to go asking for it from the get go.  So I wired up the LED in the opto in series with the color changer and I just hooked the fet leads, which are interchangeable in this case,  directly across the cap.  I figured the LED comes on and bam, the fet shorts the cap out and the cycle starts anew.  Nope.  The pules is so fast, though you can see the LED flicker on, all the FET has time to do is discharge the cap enough to turn the LED that has turned the FET on, to off.  The #10 LED just flickers.  A DVM across the cap reflects this, the V+ of the circuit is 15V.  The top of the voltage divider ladder in the 3914 is someplace around 5.5V or a bit less.  Without the opto fet, the charge on the cap keeps rising up past 6V, it should in theory top off around 15, though the cap may have some leakage and being charged through 1 meg, the leakage may limit the extent of the charge.  But in any case, with the opto fet, it never gets above 5.2V on my meter.  I suspect if I got my scope out I could see the fet kicking in.  The damn thing is just too fast.  It may do a bit better with more current through it, I have been hitting it with ~10 ma just like the other LED's.  I should look at the curves and see with the Rds is @ 10 mils on the LED.  The bitch is even if more current would help, I don't wanna mess with the other LED's.  I am now pondering an opto scr or opto triac.  My fear with them is the charging current (about .015 ma) may be enough to keep the device latched on, so it would never turn off.  Time to look and see what parts are available....

---------

OK, I was over at my pal Daves and he had a board that had a bunch of opto bipolar transistors.  The board was a bit on the old side and the solder got that old solder smank to it, making it very hard to un solder the optos.  I am not sure if perhaps a good washing with acetone or scraping the surface smank off with a wire wheel on a dremel might help.  That all sounded like way too much work.  We put the board in a vice, I got on the two pinless facets of the chip with a pair of vice grips, and my friend hit the solder end with a flamless torch.  Pop.  We pulled a few of them off. 

Given these were rather rudely removed, I gave them a quick once over with my ohmmeter and they seemed to look like a diode and a transistor and I built a little test jig on a solder less breadboard and all of the parts seemed to be alive.  Yahoo.

So I was excited when I hooked it up.  I put the LED in the opto is series with the #10 LED in the string.  Remember that the 3914 drives the LED's with a constant current so this is a handy way to see when the #10 LED comes on and know it also had about 10 ma going through the LED.  Anyway, the end result was very similar to the FET.  I was really hoping that 10ma through the FET coupler was not turning it on enough to really discharge the cap.  I had high hopes that the bipolar one would be more digital in it's response.  Sadly, the end results were about the same.

In the interim I had one more thought.  Thie 3914 drives the outputs low to turn the LED's on, it takes a common anode LED so to speak.  I figured just tying the #10 LED drive to the cap would at least allow 10 mils of discharge current to flow..  Sadly, still not enough to discharge the cap.

----------

So, I have an open plea:  Does anybody out  there have an opto SCR or opto TRIAC they can send me?  I need like one of them.  I am too cheap to pay the minimum order for one small part.  I am hoping if I use an opto SCR that once it is on, it will discharge the cap all the way and turn off.  It will be just my luck in this case that this one will have too much charging current and the SCR will NOT turn off.  It would be just my luck.  Too little or too much.

----------

The opto triac has arrived!  And amazingly enough it works a lot as I expected it would.  The last LED perhaps gives the slightest little flash (I should unhook the others so I can see it alone, it is hard to tell with the clear package if one led is giving a quick blink or the ones next to it are just shining through it) but at any rate, as I wanted, the triac latches and brings the cap near all the way down.  There are the drops in the triac so it does not sap it all the way down to zero, but it does reset the string.  The small difference in the delay time between the first and second LED can be mediated by making the reference voltage higher and making the R or C smaller.  Right now I have about 1V between steps so it tops out at 5V and the RC is running off of 15V so I have a lot of room.

-----------

Changes today!  First off, it seems the internal reference is very sensitive, it make sense with the opamp.  Let me digress a bit.  Now that I have the opto crowbar across the cap so it fires when the 10th LED fires I got to thinking, gee wouldn't it  be cool if it responded to audio.  On one of my last orders I picked up an inexpensive (and tiny) 2 terminal electret condenser microphone.  Don't let the term electret fool you.  The electret has enough capacity (no pun!) to keep essentially a static (again, no pun) charge on the diaphragm but these mic's need some low voltage at a much higher current (on the order of a milliamp) than what the electret can provide for the inpedance matching FET in them.  The long and the short of this is you need a power supply between about 2 and 10V that can provide on the order of a miliamp.  I figured that would be a good use of the reference, as I no longer on using the reference for it's intended purpose.  More on that in a sec.  Anyway, putting a small 10uf cap to ground on the reference out totally freaked it out and made all the LED's come on.  Not good.  Just hooking a wire to the reference out did similar.  So much for that.  My goal is to not to have to use an amp on the mic, to set the high side of the comparitor string at about 20mv or so.  So, the idea was to filter the reference out to make it clean and to use one part of it to bias the mic and also run it into a 10 turn trimpot I could play with, to drive the reference divider in the comparitor string.  That did not work as expected, I think it is the gain of the opaamp that boosts the 1.2V reference does not like having any stray noise injected into it.   If I was (A) not lazy and (B) had a small value ceramic cap on hand I would have tried bypassing it with that, but I did not and I am (lazy) so I just let sleeping dogs lie and moved on to the next idea.

The next idea worked well to a point.  That was just taking my trimpot and putting that from +15 to ground and using the output of that as the reference.  I still had the RC driving the analog input and the divider worked great- to a point.  Grounding the input and turning the reference down was cool until some point under a volt when all hell broke loose with the LED's.  This may just be a low limit.  I turned the pot until the first LED just stopped flickering.  Again, some bypassing would no doubt help here.  Than again bypassing with long leaded caps is not all that effective.

There was a bit of confusion with the mic.  Mostly cause I dropped it on the shop floor.  I found all kinds of neat stuff and spiders and things and after about 20 minutes I even found the mic.   I dropped it putting it in my little vice for soldering some leads onto it.  Take II I made sure to have a shop ran under the vice so if it fell it would not hit hit the floor and find an even more obscure place to hide.  The mic was a bit tricky as even with my magnifying head gear my old eyes could not see the side that was grounded.  Lucky for me I can still see my ohmmeter.  About at this point I forgot the bias wanted to be around 2-9V but at the same time I found a spool of 10K resistors so I used a 10K resistor to pull the mic up through a 10K resitor and I used a 10uf cap to block the DC going into the analog input to the 3914 chip.  Guess what happened?  If you guessed all hell broke loose you win today prize.  I kind of expected that though.  Take II was sadly putting another 10K resistor on the chips side of the coupling cap to ground.

That amazingly enough worked!  Not great.  You have to tap the mic or talk rather loudly into it, but the bargraph of multicolored LED's does in fact go up and down with the audio.  So if you wanna use the 3914 for audio activated effects without more components, there is hope.

Some things to consider.  First, Better circuit layout and bypassing.  With the big spaghetti of wires I have I am somewhat amazed this works at all, no less how well it does.  I suspect with a clean layout with short traces, and lots of ground between things I could dial the reference down lower. 

Some scaling in the trimpot would be good too.  I used a 50K trimpot just because that was what I could extract off of another board I had.  Putting a resistor in series with that would let me have much finer control over the low end of the range.  I am also not 100% sure the trimpot really goes down to zero.  The ting that makes this a job for a trimpot is I could not find (admittedly I did not look super hard) at what the impedance looking into the top of the voltage divider chain is.  The show it in the simplified schematic as just a bunch of resistors.  No sign of a buffer.  So the pot lets you set it where you want it.  I do have a pretty good stash of resistors but I dread going and fishing them out.  I did mention lazy right?

Doing some experimenting on the resistor that goes from ground to the signal input might help too.  I can not help but to think that I am loosing half of my signal to the 10k over 10k voltage divider.  I had that as a first thought, than as a second thought I pondered the FET's output impedance may well be less than 10K so I was not loosing signal, and than it occurred to me that the FET itself is powered through a 10K resistor so I was right in the first place.  I think (smile)  I suspect making that resistor as big as possible would get you more signal.

As it is, this would easily work at "club" volumes but probably not in your average more quiet living room.  I think some of the above would get the sensitivity down to where it would respond to normal speech or the TV or what not...