Help Needed Inverting "Lighthouse" Sweep with 4017 and PNP

AnalogKid

Joined Aug 1, 2013
11,038
The ULN2004 has a 10.5K input resistor, and is intended for 6V to 15V inputs. The 2003 has a 2.7K input resistor, and works very well with 5V inputs.

And, the 4011 really is a NAND gate. The DeMorgan equivalent is an inverted-input OR, not a NOR.

ak
 

SgtWookie

Joined Jul 17, 2007
22,230
I actually did a typo when I entered 4011 in that post; it's now been corrected!

If I'm going to use a quad NAND, I go with the CD4093, which has Schmitt-trigger inputs. I consider the 4093 to be one of the most useful of the 4000 series.
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
Here's a slightly unrelated question. If the rule of thumb is a cap across VSS/VDD on all 40xx ICs, how does one handle something like multiple 4015s that are chained? given their close proximity on the final board, does each still require an independent cap, or will a single one suffice?
 

SgtWookie

Joined Jul 17, 2007
22,230
You start off with at least one 0.1uF/100nF cap across each and every IC's power/ground leads; once you get it working with that configuration, you decide how much of your time you want to spend trying to save a few pennies by eliminating a capacitor or two.

It's not worth your time. You will risk introducing intermittent 'glitches', where it seems to work fine most of the time, but occasionally it just acts weird ... good luck fixing it at that point. Or you risk having your power/ground lines "ringing", which will drive you nuts trying to figure out why.

I have had plenty of people asking me to help them fix a problem with a schematic, and after spending lots of time on them, having them suddenly admitting they left off the bypass capacitors - and after I had them install ALL of the bypass caps, suddenly everything started working properly. I find that kind of wasting of my time very annoying, as I really don't have a lot of "extra" time to throw away like that.
 

Brownout

Joined Jan 10, 2012
2,390
want to invert it, so the sweeping section is actually the non-illuminated LED(s).
Connect each output of the 4017 through an invertor of a 7404 hex inverter. You'll need two chips for 10 outputs. Better yet, connect each output to a 7486 X-OR gate. Connect the other inputs together and connect to a switch. Now, you can switch between the 'normal' effect and the modified one you want.
 

AnalogKid

Joined Aug 1, 2013
11,038
Brownout, nice tagline. But it's Hedy, not Hedley (unless you're quoting the character from Blazing Saddles). Hedy invented frequency hopping.

ak
 

SgtWookie

Joined Jul 17, 2007
22,230
It was, in fact, the character "Hedley Lamarr" in Blazing Saddles that Brownout is quoting.
According to the Wikipedia entry on Blazing Saddles, Mel Brooks claimed that Hedy Lamarr threatened to sue, saying the film's running "Hedley Lamarr" joke infringed her right to privacy. This is lampooned when Hedley corrects Governor Le Petomane's pronunciation of his name, and Le Petomane replies with "What the hell are you worried about? This is 1874, in 50 years, you'll be able to sue her!". Brooks says he and the actress settled out of court for a small sum.
 

AnalogKid

Joined Aug 1, 2013
11,038
Yeah, I know that story. Very disappointing, seems like she had no sense of humor about herself. OTOH, the Eudora Wetly gladly gave her consent when Steve Dorner asked about naming his email program after her. Cool.

ak
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
Okay, this thing works, but due to the physical layout of the LEDs, I had to swap the direction of sink/source and flip the LEDs, but things still check out. I also added caps to all my 40xx ICs per SgtWookie.

Now here's another design challenge. I need to run 4 of these clusters at the same time, and I'm left in a difficult spot. I could make a driver for each cluster, but that's pretty wasteful, or I could drive 4 LEDs from each transistor. The sticky point there is I'm not able to arrange the LEDs between clusters in series, so I'm left with the not-good-practice of doing 6 groups of 4 parallel LEDs.

I read through SgtWookie's write-up about LED matching, so I plan on doing that to minimize variance in Vf, but that left me with another question. If the Vf of each group is matched closely, am I able to use a single resistor, or should each LED have its' own? Inversely, if each LED has its' own resistor, is matching them less important?

I will be using a 5V regulated supply from Recom. I've used them before and they seem to work well.
 

AnalogKid

Joined Aug 1, 2013
11,038
Go with one R per D, sometimes called a ballast resistor. Yes, it will reduce the brightness mismatches. It comes down to the variation in diode forward voltage versus the voltage drop across the resistor. If you had a 12 V supply, and two LEDs with forward voltages of 2.0V and 2.1V, then the 0.1V difference is very small compared to the nominal 10V across the resistors and will have only a 1% influence on the current through the string. With a 5V source the reduction is not as great, but it still is worth adding the resistors.

Separate from this is the conversion factor of the LEDs, in brightness per mA of current. The only way to correct for that is by matching. For a bunch of LEDs from the same production or wafer lot, this usually is not a big deal. However, it might be apparent if you wait a year and buy more LEDs for another group of displays. I've seen 30% brightness variations for the "same" part over time. Some parts have matching grades on the data sheet. Tighter matching = $.

ak
 

SgtWookie

Joined Jul 17, 2007
22,230
You should post your revised schematic for review.

If your LEDs Vf is around 3.6v, you are not going to have much voltage to drop across the resistors, which can make regulating the current somewhat dicey.
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
I actually think I figured out a way to run the LEDs in series, and can use a 9V regulator instead of 5V. I just need to revise my schematic and error check it before I post it up. Apparently the anode/cathode on the particular LEDs I'm going to use are reversed from what I thought they were, so I'm actually able to route traces accordingly. I'm still going to test the Vf on all of them to best determine my resistor values, though.
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
Okay, I got my LEDs, and they all average about 2.05V, with a few +/ .03V, but I can match them accordingly, depending on the situation. Attached are my current schematics, one with the LEDs in parallel, the other in series. The parallel one works on Multisim, but I'm not sure the single resistor is a good idea, but I really don't have room for a resistor for each LED. The series circuit looks as though it should work in Multisim, but it doesn't, and I'm not sure why.

I can supply up to 12V to these LEDs, but I would like to keep current draw down as much as possible.
 

Attachments

AnalogKid

Joined Aug 1, 2013
11,038
Since the majority of the current is going through the LEDs, you can keep it low with higher resistor values. The series version has headroom problems at 9 V. 8.2V for the LEDs, 0.6 V min. for the transistor (an emitter follower can not saturate), and then there's this - A CMOS output is rail-to-rail only if there is no output current. The base current of the emitter follower is enough to pull the output down enough to affect the emitter voltage. Increase the 9V to 12V, up the 39 ohms to 330, and things should work.

The Vf of an LED is not constant with temperature or age, so no matter how tightly you match them now, things will move. Increasing the battery and the current limiting resistor increases the ballast effect, reducing the effects of Vf drift (see earlier post). System power is up a little; performance stability is up more.

ak
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
I bought the rest of the components for this circuit, so I'll breadboard them up and see how things perform, and measure just how much voltage and current is being moved.
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
For running LEDs in series like I plan to, what's the better option for matching them to maintain similar brightness levels? Am I better off matching the individual LEDs in each group to each other so that the Vfs are close, or am I better off matching them so the total voltage through ieach group is the same relative to each other?

IIRC, current is what control the brightness in an LED, and the supply voltage, total LED Vf, and resistor set the amount of current (I=(V-Vf)/R). This would tell me then that each LED in that group should be matched to each other to keep brightness consistent. It makes sense in my mind, but I'd appreciate any input.
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
For this particular circuit, what would be the least parts-laden way to provide a constant current? My PCB space is relatively limited, but if I can use an IC, that shouldn't be an issue. If I'm not able to run constant current, and have to match LEDs, which is the preferred method?
 

Bernard

Joined Aug 7, 2008
5,784
Might be a good time to re-read post 15, # 2, & post 34.
I would probably try a 74AC02, NOR & drive 2 short strings of 2 LED's in series with resistor from each output--2N2904's gone. Vdd 5 V to 6.5 V?
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
If I'm driving 2 strings of 2 LEDs in series, aren't I back to the issue of having LEDs in parallel, essentially a 2x2 matrix?

This circuit isn't anything critical, I just don't want to be burning through power (12V batteries) or frying LEDs. I'm just trying to have a relatively robust circuit that does what it needs to do; take 4 groups of 6 LEDs, and animate them such that there is a sweeping pattern made by a pair of LEDs in the OFF state.
 
Top