Help Needed Inverting "Lighthouse" Sweep with 4017 and PNP

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
The end goal of this project is to have 6-10 LEDs arranged in a circle, much like builders make for model lighthouses and such, but instead of lighting LED(s) in a sweeping pattern, I want to invert it, so the sweeping section is actually the non-illuminated LED(s). I'm trying to stick with ICs I know, so I'm using 4017s ultimately driven from a 4047 (I want the 50% duty cycle), and I prefer to stick to 5V where I can.

I started with this pretty straightforward circuit in Multisim. I'm using a function generator instead of a 4047, since Multisim lacks that part. I have no problems wiring a pulse to a 4017, so it's not something I'm concerned about. I'm using 6 LEDs at the moment, but the logic should work for more. I know there should be NPNs and such on the LEDs, but that's not applicable at the moment:

http://www.prop-forge.com/circuits/img/SpinCircuit01.jpg

From there, I wanted to have 2 LEDs lit at any one time, so I added a second 4017, and offset the outputs by one pin. Effectively, LEDs 1&6 are lit, then 1&2, 2&3, etc.

http://www.prop-forge.com/circuits/img/SpinCircuit02.jpg

The presented an issue though (at least in Multisim), as I would now have outputs combined, so I added in diodes:

http://www.prop-forge.com/circuits/img/SpinCircuit03.jpg

So now I have a circle of 6 LEDs, with 2 LEDs next to each other lit at any one time, which generates a sweeping pattern. This is the opposite of my end goal. I needed some way to invert this, so I'd have 4 LEDs lit, and 2 off to generate the pattern. I suppose I could have used another pair of 4015s with offsets, but that is too many ICs for my taste, so I decided to try PNP transistors (2n3906). This is where I started having issues with the design. I know there needs to be a 0.7V change through the transistor to trigger it, and I know the diodes will drop the voltage from the 4017, but the math was driving me bonkers (haven't done EE in a decade), so I tinkered around in Multisim and finally got something that works. The issue I have is that it doesn't make sense to me, when I look at other examples people have done with PNPs and LEDs. Here's what I currently have that works in Multisim:

http://www.prop-forge.com/circuits/img/SpinCircuit04.jpg

I'd prefer to use 5V across the board on this project, so I have VCC at 5. The 10k pulldown resistors were added due to experience with Arduino pins, and the circuit worked after I made this addition. Now, I know what might work in Multisim won't always work in real life, and vice versa, so I want to know if there's a more elegant way to do this with the same parts. Like I said, I'm using a 4047 and 2x 4017s to drive the logic, but I would like some advice on what I can do to improve the inversion of the LED lighting.
 

GopherT

Joined Nov 23, 2012
8,009
There are many solutions to this problem.

If you have it working for the non-inverted solution, you could run your outputs through logic inverters or use PNP transistors to turn on when output is low.

Other options could be shift registers, a series if three dual flipflop chips could also handle your six LEDs - easiest would be a small micro controller.
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
Gopher, I'm attempting to use PNPs in my final solution. I have it working in Multisim, but doubt it's a good solution, if it would even function in real life. My question how to set up the PNPs correctly in this design. The only issue I have is what a better solution is between the LEDs and the diodes.
 

Bernard

Joined Aug 7, 2008
5,784
As Bertus suggested, one 4017 & more diodes; reduce 10k to 2k, add a diode [ maybe 2 ] in emitter supply to compensate for ORing diodes drop & output 0f 4017 slightly below 5V. 140 Ω may need to be reduced.
 

Attachments

AnalogKid

Joined Aug 1, 2013
10,987
I think you're working too hard.

A 4017 will both source and sink current. Without getting into brightness issues, go back to the third sch in your first post, with two 4017's with 6 diodes each. Reverse all 12 diodes, reverse all 6 LEDs, and change the ground connection (to the right of the 140 Ohm resistors) to Vcc. That should get you the pattern you want. If it does and you want more brightness, try smaller LED resistors (but pay attention to the max. power being dissipated by the 4017's). For even more brightness, then we talk transistors.

ak
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
Using a single 4017 as a sink works, but as soon as I add the second 4017, the circuit ceases to function.

The Multisim oscilloscope shows some pretty strange noise, so I think something is getting coupled along the way.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
10,987
With all 18 diodes reversed and the LED power moved from GND to Vcc, it should work. In fact, with you can keep the diodes and eliminate the 2nd 4017. Since they are clocked and reset identically and their outputs are diode-isolated, the output will be the same if each output drives two LEDs through 4001 diodes. For example, pin 3 has diodes going to LED1 and LED6, pin 2 has diodes going to LED2 and LED1, etc. This increases the power dissipation in the 4017, but eliminates a chip.

ak
 

AnalogKid

Joined Aug 1, 2013
10,987
Stop:
HALT
HALT
GOTO Stop

OK, I blew this one. My first suggestion will not work, as you found out.

Your 4th schematic covers the basics, but won't work in the real world unless the 1N4001 diode voltage drop is *less* than the Vbe of the transistor, which it isn't. Three possiblities: first, change the 4001s to Shottkey diodes with a Vf of 0.2 or 0.3 V; second, add a diode in series with each 3906 emitter; third, leave the diodes alone and change the transistors to darlingtons. The goal is to get the 4017 output to pull the base voltage up high enough to reverse bias the base-emitter junction and turn off the transistor.

My 2nd suggestion about eliminating one of the 4017s still holds.

Sorry about the goof.

ak
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
I'd prefer to go the Darlington route, as I wouldn't be adding any more parts to the circuit, but I'm having a bear of a time finding a PNP Darlington in a TO-92 package. I can't find any Shottky diodes with a forward voltage under 3.1V.

Would I be better off just using an inverter like a 7404 or 4049 and then NPN transistors?
 

SgtWookie

Joined Jul 17, 2007
22,230
Use a CD4017B, and NOR gates (a pair of CD4001B would give you 8 outputs) with the outputs driving channels on a ULN2803, sinking current from the LEDs via an octal resistor network. You'll still need a clock input, of course - a CMOS 555 timer would work for that.

Besides the clock circuit, you'd need five IC's (one 4017, two 4001's, one ULN2803, one resistor network suitable for limiting current from your Vcc/Vdd through your LED and figure a 1v drop on the Darlington channels) - that's a heck of a lot easier than trying to solder up lots of discrete resistors and transistors.
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
Okay, so I tossed in a 4049 Hex Inverter, and swapped the 3906's for 3904's and it seems to work. I probed around the circuit looking for strange voltages and currents, and it seems kosher. I also like that the inverters and transistors are easily found in an IC package, which I'm a fan off.

Does anyone with fresher eyes see anything that would make this circuit fail over time?

EDIT: I typed all this before I saw Wookie's input.
 

Attachments

AnalogKid

Joined Aug 1, 2013
10,987
Only two things.

1. You'll need pull-down resistors on the 4049 inputs.

2. You can move the LEDs to the 3904 collectors. This will have the on transistors saturated, to decrease their power dissipation and give you more voltage compliance for the LED-resistor pairs for more even brightness.

I, too, suggest replacing the individual transistors with an array chip such as the ULN2003A. Used a zillion of them, indestructible.

ak
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
See the attached for a schematic view of what I described above.

Note that each 40xx IC needs a 100nF/0.1uF cap across it's power pins (Vdd/Vss), not shown; this is not optional.

By the way, your dual 4017 scheme needed a way to reset the Johnson counters (the 4017s) to keep them in sync.
[eta]
IC5 should have been labeled as a ULN2803 for Vdd <= 5.5v, or ULN2804 for Vdd > 5.5v.
RN1 needs to be calculated considering your Vdd, the LED typical Vf, the desired I(LED) and the Vce of the ULN280x; likely around 1.3v.
VSS is shown connected to GND via a zero-Ohm resistor; this was necessary as the IC's in use have different names for their ground pins and Eagle complains via Erc if they are not connected, and you wind up with circuit malfunctions if they are not somehow electrically connected. You can't simply wire between the two, as one node name would override the other.
 

Attachments

Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
SgtWookie, what do you use for schematic capture?

ak
For that last schematic, I used Cadsoft Eagle and exported the schematic as monocrhrome 150dpi, as it had all of the components available that I wanted to show. I generally use LTSpice, but occasionally it's a bit awkward to show things certain ways. I did check circuit operation using LTSpice; but that schematic was not as "clean" as the one I posted.
[eta]
The 40xx library in Cadsoft's Eagle shows the 4001's looking like NAND gates instead of NOR gates; this is the Cadsoft's librarian's fault. Please don't let that confuse you. NAND gates would not work as desired for this circuit.
 
Last edited:

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
Wookie, is the choice of a ULN2803 for a specific characteristic of that chip, or is it personal preference? I've used ULN2004s in the past, and the datasheets don't seem to show any glaring differences, other than an extra pair of transistors, but I could be missing something.
 

SgtWookie

Joined Jul 17, 2007
22,230
I chose a ULN280x because I'd decided to use two quad NOR gates, which could use eight of the 10 outputs from the 4017, and can drive 8 Darlington channels. You could use a ULN200x if you'd like - but what will you use for the other channel? If you need less than 8 channels, no big deal.
 
Top