CD4017BD (datasheet for CD4017BCN) am I reading this right?

GopherT

Joined Nov 23, 2012
8,009
Datasheets of a CD4017 show how to cascade two or more of them using AND gates so a lighted dot goes around all of their outputs. A 74HC4017 is connected the same except its max supply is 6V and its max current output is much higher.
Each decade counter will always have one lit output. The decade counter will cascade like place- value (ones, tens, hundreds). I don’t see how Three cascaded decade counters can become a 30-position chaser.
 

Audioguru

Joined Dec 20, 2007
11,248
Each decade counter will always have one lit output. The decade counter will cascade like place- value (ones, tens, hundreds). I don’t see how Three cascaded decade counters can become a 30-position chaser.
No. Post #35 shows straight lines, zig-zag lines, a figure 8 and random with the LEDs lighting in sequence one after the other. Only one LED at a time.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
@Audioguru Actually, with the CD4017 there's a way to get 100 LED's to chase using just two CD4017 and 10 transistors. The first 4017 commands the chase. The second 4017 controls the transistors. When the first chases the second one holds output 0 high. That output turns on a transistor (typically NPN), providing ground for the first 10 LED's. When the Ninth output goes high the 10th LED is lit. When the first 4017 completes the count, on the next clock pulse the first 4017 sends a "Carry Out" signal which acts like a clock input to the second. The second moves from output 0 to 1, turning off the first transistor and turning on the second. This "Carry Out" command can be used as a clock input for the second. No need for any gates. Every time the first carry's out, the second one clocks to the next position. Each transistor is tied to the negative lead of 10 LED's each. 10 x 10 = 100 (LED's).

The 74 series does not have a carry out. There is probably a way to use the last output from the first counter to act like a carry out. But you'd be limited to 9 outputs on the first, and up to 10 transistors to complete up to a 90 LED string of a chase light. You would probably also have to use the master reset with output #9. I'll have to investigate that further. My parts arrive tomorrow. (Thursday)
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
Three cascaded decade counters can become a 30-position chaser.
They can't. Just like you said. The way you do it is to use the first to count (see post #43), and the second to toggle transistors that either turn ground ON or OFF to each bank of 10. If you cascade the 74 series counters, using 3 of them you can only get 9 outputs from the first and 8 from every subsequent counter. So, 9, 17, 25, 33, 41 and so on. The reason is because you are not using output #0 from the others. And when the first gets to output #9 you have to disable the counter. For that you also need AND gates. Then when you reach the final output of your chase string you send a Master Reset to all the chips, resetting everything to output 0. Since output 0 on the first counter is connected to an LED, it's lit. While all the other counters, output 0 is ignored (not connected). Cascading 74HC4017's in that manor you lose one output from the first and two outputs from each of the rest. In a while I'll look up a drawing I did some time ago and show you all how to cascade these counters using only two.
 

GopherT

Joined Nov 23, 2012
8,009
They can't. Just like you said. The way you do it is to use the first to count (see post #43), and the second to toggle transistors that either turn ground ON or OFF to each bank of 10. If you cascade the 74 series counters, using 3 of them you can only get 9 outputs from the first and 8 from every subsequent counter. So, 9, 17, 25, 33, 41 and so on. The reason is because you are not using output #0 from the others. And when the first gets to output #9 you have to disable the counter. For that you also need AND gates. Then when you reach the final output of your chase string you send a Master Reset to all the chips, resetting everything to output 0. Since output 0 on the first counter is connected to an LED, it's lit. While all the other counters, output 0 is ignored (not connected). Cascading 74HC4017's in that manor you lose one output from the first and two outputs from each of the rest. In a while I'll look up a drawing I did some time ago and show you all how to cascade these counters using only two.

No need for the drawing, I understand how you are doing this. From my perspective, a shift register is much easier and more versatile -allowing any pattern and can be reversed for occasional fun as the chasers follow your marbles.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
No need for the drawing, I understand how you are doing this. From my perspective, a shift register is much easier and more versatile -allowing any pattern and can be reversed for occasional fun as the chasers follow your marbles.
I agree. Shift Registers would be easier. However, with a failed battery I'd have to reprogram them every time. And if you change batteries (to maintain the memory) again, programming would be required. Since this is a gift I don't want to have to be going over there just to reprogram a toy every time they pull a battery out. While I AM using a 5 V wall wart, the battery would be necessary to maintain the memory. As I learned from Crutschow the memory is volatile. Without a battery the programming would be lost every time the machine is unplugged.

[edit] see post #21
 

GopherT

Joined Nov 23, 2012
8,009
I agree. Shift Registers would be easier. However, with a failed battery I'd have to reprogram them every time. And if you change batteries (to maintain the memory) again, programming would be required. Since this is a gift I don't want to have to be going over there just to reprogram a toy every time they pull a battery out. While I AM using a 5 V wall wart, the battery would be necessary to maintain the memory. As I learned from Crutschow the memory is volatile. Without a battery the programming would be lost every time the machine is unplugged.

[edit] see post #21

No,

a shift register can be as simple as one 555 timer tapping out a constant clock at the frequency you want your lights to cascade (lets say once every second).

and a second 555 timer tapping out a 66% duty cycle with a 3 second period as the input to the first shift register.

That way, the shift register will shift the value of the input (1 or 0) down the cascade on every clock cycle.

With the two 555 timers shown, the value on the input will be high (1) for two clock cycles and low (o) for one clock cycle. The two highs will show up on your cascade as two lit LEDs followed by one blank LED. The that sequence will march down your marble path if you want a simple pattern like that.

You can also create a sort of random pattern by ANDing two 555 outputs together and sending the result down the cascade.

You can even add a long period but low duty cycle 555 to be a "reverse" to temporarily reverse the marching direction of the lights for a brief period occasionally if you select a bi-directional shift register.

There is no "programming". The memory is cleared after each power down but starting the march is half the fun.

You can even have a reset pulse occasionally to intentionally clear the value of all the shift registers.

Since it is a toy, you can add a potentiometer to control the 555 clock speed (marching speed) and a switch that allows manual input (and a push button with a pull up) that allows the user to create their own pattern for the march.

The definition of a simple shift register is what ever value is on the input when the clock toggles, is what is pushed down the cascade of registers.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
@GopherT

HEY! I LIKE THAT IDEA. The next question is what to do with the 10 74HC4017's I have arriving tomorrow. I certainly have enough 555's. Plus, what I really like about the push button idea is that the kids can send any chain of lights up that they want. REALLY LIKING that idea.

Thanks BUNCHES! But now I have to order SR's
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
@GopherT Quick question: Can I send the last shift register back to the first? If so, and the kids hold the button down a long time there could be an endless stream of lit lights. HMM. That's bringing up a problem: If all the lights are lit at once, my power supply won't be strong enough to power that many devices. I think.

Two buttons: One to send highs ( 1's ) and one to set low's ( 2's ). Doable? ? ?
 

GopherT

Joined Nov 23, 2012
8,009
@GopherT Quick question: Can I send the last shift register back to the first? If so, and the kids hold the button down a long time there could be an endless stream of lit lights. HMM. That's bringing up a problem: If all the lights are lit at once, my power supply won't be strong enough to power that many devices. I think.

Two buttons: One to send highs ( 1's ) and one to set low's ( 2's ). Doable? ? ?
Yes, shift registers can be looped (last back to first).

The switch cannot easily be wired for one for high, a second switch for low becaus there is no third state in the case neither is pressed.
 

GopherT

Joined Nov 23, 2012
8,009
Depending how complicated you want to make this thing, you could have three input options
1) automatic - from the duty cycle of the non-clock 555 timer(s)

2) manual - from the push button

3) loop - allows the manually entered pattern to be fed from the last shift register’s output.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
Sounds like good advice. I can send the single pulse to start one soldier marching up the chain. When it gets to the end he dies. But the 555 is sending more soldiers. Meanwhile, the kids can keep sending more and more soldiers off to war, each dying at the end of the string. I think I'm beginning to settle down on a plan. The choice now is whether to go with the 74HC4017's or to order some SR's.
 

GopherT

Joined Nov 23, 2012
8,009
For your question about power, use high brightness LEDs and 1mA is plenty if you have a whole mess of them. A little 1 amp 3.3 V should light a couple hundred LEDs if you are that ambitious.
 

Bernard

Joined Aug 7, 2008
5,784
If the kids have a push button to load 1s, then we can put a limit on the number of 1s allowed with a simple sample & hold with a comparator to determine how many.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
If the kids have a push button to load 1s, then we can put a limit on the number of 1s allowed with a simple sample & hold with a comparator to determine how many.
Interesting notion. Was thinking of a "OneShot" that would limit the amount of time they can input 1's, then for another preset period of time they can NOT enter any more inputs until the time-out ends.
 

GopherT

Joined Nov 23, 2012
8,009
Interesting notion. Was thinking of a "OneShot" that would limit the amount of time they can input 1's, then for another preset period of time they can NOT enter any more inputs until the time-out ends.
Don't be so controlling. Let them do what they want!
 

Bernard

Joined Aug 7, 2008
5,784
Seems a comet tail was mentioned so here is a simple tested version for either 4017 or SR like 74HC164.
Tried with 1N92's shottky's & 1N4148's; I like the 1N4148's the best with a 4 LED tail, shottky about 5 LEDs.
The LED used were a disappointment as viewing angle is about 30 deg., advertised as bright.Comit Tail 00000.jpg
 

Audioguru

Joined Dec 20, 2007
11,248
Seems a comet tail was mentioned so here is a simple tested version for either 4017 or SR like 74HC164.
Tried with 1N92's shottky's & 1N4148's; I like the 1N4148's the best with a 4 LED tail, shottky about 5 LEDs.
The LED used were a disappointment as viewing angle is about 30 deg., advertised as bright.
With a CD4017 and the 5V supply, the current in each LED is only about 2.5mA. Without the resistors the current is only 3mA.
So of course the LEDs were dim and are either on or off.

I made a circle of 9 wide angle LEDs and used a Cmos 555 clocking a CD4017. Then a diode from each output quickly charges a capacitor and a resistor slowly discharges it and feeds a transistor emitter follower. Each transistor drives its own LED. When the capacitor is charged the LED is bright and slowly dims as more LEDs are turned on and dimmed off. About 5 LEDs are lit at the same time at dimming brightnesses. It really looks like a comet tail.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
A 74HC4017 does exactly the same functions as a CD4017
Thanks. My HC4017's arrive today. I'm beginning to develop my schematic for this. Meanwhile, yesterday was a pretty productive day with building the turbo section of my marble machine. I'll take some pictures later this afternoon and post.

Your recommendations please: Should I go with 2N2222 BJT's or with 2N7000 MOSFET's? I'm going to use only two 4017's, the first directs the march, the second dictates which section marches.
 
Top