Author Topic: [Resolved] Davidoff CD4017s  (Read 1706 times)

0 Members and 1 Guest are viewing this topic.

Offline GrytpypeTopic starter

  • Contributor
  • Posts: 25
  • Country: gb
[Resolved] Davidoff CD4017s
« on: January 17, 2023, 09:18:27 pm »
Hi all,

All manflu'd up, I thought I'd try an easy project to pass the time : http://www.circuitdiagram.org/11-led-knight-rider-project.html

All went together no problems but it doesn't flash like Kitt from Knightrider - all the way up, then all the way down in a fluid 'wave' sequence, swapping between the 4017s.

As you can see from the GIF, the first 4017 does what's expected but the second flashes the LEDs once per cycle of the first one and holds the active LED from the second 4017 high whilst it's happening. More sh*terider.

I did some reading around this and it seems this is what 4017s should do in series like this i.e. if I added a third one, it would 'work' every cycle of the second one - dividing by ten / decades each time.

So my question is, could that circuit ever work like Hasselhoff would want? 1 to 11, then 11 to 1 and repeat.

Thanks all.
« Last Edit: January 18, 2023, 09:05:18 am by Grytpype »
 

Offline GrytpypeTopic starter

  • Contributor
  • Posts: 25
  • Country: gb
Re: Davidoff CD4017s
« Reply #1 on: January 17, 2023, 09:22:10 pm »
...and animated GIFs don't work  :palm: : all the LEDs fire left to right from the first 4017. When each cycle completes, the second 4017 lights up just one of the LEDS back the other way... Added it to a zip.
« Last Edit: January 17, 2023, 09:24:31 pm by Grytpype »
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
« Last Edit: January 17, 2023, 11:54:01 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: Grytpype

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Davidoff CD4017s
« Reply #3 on: January 17, 2023, 11:59:22 pm »
It's impossible to see exactly how you've got it wired up, but it's almost certain that you have an error somewhere.
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 11538
  • Country: ch
Re: Davidoff CD4017s
« Reply #4 on: January 18, 2023, 12:07:44 am »
More sh*terider.
This made me literally chortle out loud!

I did some reading around this and it seems this is what 4017s should do in series like this i.e. if I added a third one, it would 'work' every cycle of the second one - dividing by ten / decades each time.

So my question is, could that circuit ever work like Hasselhoff would want? 1 to 11, then 11 to 1 and repeat.
I don’t see how it could. Your understanding of the carry output is exactly right.

I guess if you had two of them, plus a toggle flip-flop and some AND gates, you could cobble together something that alternates between the two 4017s.

There might be some other decade counter with a direction input.

Of course I’d just use some little MCU and program it…
 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 2583
  • Country: gb
Re: Davidoff CD4017s
« Reply #5 on: January 18, 2023, 01:30:32 am »
If you want to stick with ole skool  logic, a binary up/down counter and a   binary decimal convertor or 2 ,add in a bit of logic to trigger the up/down direction and your done.
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1209
  • Country: pl
Re: Davidoff CD4017s
« Reply #6 on: January 18, 2023, 01:42:13 am »
I wonder: why the website features no single photo of an actually built circuit. ;)

Below is an explanation of what IMO happens. But first try to debug it yourself. And here is the hint: take a single CD4017, connect its outputs to LEDs and wiggle the clock input. At least 20–30 wiggles. Do you see, what happens with the output sequence?



Explanation (spoiler):
CD4017 are ring counters, aren’t they? After reaching OUT_9 (pin 11), the sequence repeats. See the diagram from p. 4 of National Semiconductor’s datasheet.

So your CD4017s are properly daisy chained. The problem lies with both of them generating a sequence at the same time. Sequences from both are OR-ed through the diodes and this gives you the faster sequence from IC2 and the 10× slower sequence from IC3 displayed at the same time.
People imagine AI as T1000. What we got so far is glorified T9.
 
The following users thanked this post: tooki

Offline Swainster

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: sg
Re: Davidoff CD4017s
« Reply #7 on: January 18, 2023, 03:38:37 am »
I think it should work... maybe you've got ClK and CLK_EN swapped on the second '4017?
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 660
  • Country: de
Re: Davidoff CD4017s
« Reply #8 on: January 18, 2023, 05:48:32 am »
But you wont be able to generate the fading effect with LEDs and 4017‘s unless extensive additional circuitry is involved.
Microcontroller would be the lowest part count solution here.
Didn’t the original scanner consist of eight lights?
« Last Edit: January 18, 2023, 05:50:17 am by inse »
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Davidoff CD4017s
« Reply #9 on: January 18, 2023, 06:55:51 am »
No, that circuit cannot work.

The idea is to put one CD4017 in charge of the "forward scan" of the LEDs, the other one for the "backward scan". That general idea makes sense -- the CD4017 can only count up, so a second chip (with its outputs wired in the opposite order) is required for the reverse motion.

But the designer got the logic wrong which is meant to alternate between the two counters. Obviously you cannot achieve the desired effect by clocking the second counter with the carry of the first. Both counters need the same clock, and would need to be enabled in an alternating way. This could be fixed with some additional logic, I guess, which evaluates both counters' carry outputs and generates alternating enable signals for the two counters. The detailed design is left as an exercise for the reader. ;)

Even then, it's worth noting that each counter will always have one of its outputs high. So there would be an additional LED which stays on while the other counter does its output scan.
 
The following users thanked this post: tooki

Offline GrytpypeTopic starter

  • Contributor
  • Posts: 25
  • Country: gb
Re: Davidoff CD4017s
« Reply #10 on: January 18, 2023, 09:04:51 am »
Nice one - thanks everyone.

I do have an MCU and can easily do it with that but am trying to learn what components do from the ground up - this seemed like an easy project. I have accidentally learnt a lot more than intended though so it's all good.

Ta!

P.S. Yes it looks like Kitt had 8 lights in the grill but I'd already gone down the rabbit-hole.
« Last Edit: January 18, 2023, 09:29:56 am by Grytpype »
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1209
  • Country: pl
Re: [Resolved] Davidoff CD4017s
« Reply #11 on: January 18, 2023, 09:22:32 am »
You can do a 5 LED version with a single 4017, though.

You already know, how to perform a logical OR operation using a diode, you have a sequence of 10 outputs going high in sequence (one will remain unused).
People imagine AI as T1000. What we got so far is glorified T9.
 
The following users thanked this post: Grytpype

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1391
  • Country: ca
Re: [Resolved] Davidoff CD4017s
« Reply #12 on: January 18, 2023, 12:41:34 pm »
Keep in mind KITT had more than two lights lit at the same time at different levels of brightness.  It's quite a little challenge to do it right.
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
Want to see an old guy fumble around re-learning a career left 40 years ago?  Well, look no further .. https://www.youtube.com/@uni-byte
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1209
  • Country: pl
Re: [Resolved] Davidoff CD4017s
« Reply #13 on: January 18, 2023, 02:43:05 pm »
Emulating the exact behavior with LEDs may be hard. I believe the original used pretty strong incandescent bulbs, possibly a ready stage lighting bar. Those would have very fast on time, yet not as instant as LEDs, and a noticeable cool-off time.

However, approximation with two LEDs enabled at the same time is not that hard. Fortunately it is realizable with OR gates only:
Code: [Select]
L0 = O0 ∨ O8 ∨ O9
L1 = O0 ∨ O1 ∨ O7 ∨ L8
L2 = O1 ∨ O2 ∨ O6 ∨ O7
L3 = O2 ∨ O3 ∨ O5 ∨ O6
L4 = O3 ∨ O4 ∨ O5
Where Ln stands for n-th LED, On stands for n-th output.
That is on logical level. I did not build a physical copy, but 4000 series chips may be pretty limited regarding output current. Without additional buffering, this will lead to uneven brightness across different stages. Falstad simulation, image in the attachment.

As for the number of lights, in the opening KITT is visible with both 6- and 7-position bars.
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 2583
  • Country: gb
Re: [Resolved] Davidoff CD4017s
« Reply #14 on: January 18, 2023, 03:13:41 pm »
10 channel notsoshite rider https://tinyurl.com/2o6da2p6
 
The following users thanked this post: Grytpype

Offline Swainster

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: sg
Re: [Resolved] Davidoff CD4017s
« Reply #15 on: January 18, 2023, 04:32:41 pm »
Oops, just realised I was looking at the circuit in David Alpha's reply, not the OP. Yes, the OPs circuit has no chance- shite indeed
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: [Resolved] Davidoff CD4017s
« Reply #16 on: January 18, 2023, 05:53:57 pm »
Keep in mind KITT had more than two lights lit at the same time at different levels of brightness.  It's quite a little challenge to do it right.

That's only because it used incandescent lamps. I saw a youtube video at some point that showed one of the real ones up close, they looked like 50W halogen lamps of the sort used in fog lights, those have quite a lot of thermal inertia. I was surprised they were such large lamps but then it had to be visible in daylight on film.
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 11538
  • Country: ch
Re: [Resolved] Davidoff CD4017s
« Reply #17 on: January 18, 2023, 06:16:03 pm »
I did a project last spring that emulated tungsten with LEDs. The project is a giant-digit thermometer using 38mm LED filaments to make a Numitron-inspired 7-segment display. I used an NXP LED driver per digit, and just have two arrays, one for the current brightness and one for the target brightness for each segment. The code iterates through comparing each segment’s current and target brightnesses, and if they differ, steps the brightness up or down until the target is reached. I run the increase and decrease code on different timers so that turning on happens faster than turning off. It actually looks really cool.

Maybe with a future version using RGB or WW/CW LEDs, I could have the color shift appropriately too. :P
 

Online rsjsouza

  • Super Contributor
  • ***
  • Posts: 5986
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: [Resolved] Davidoff CD4017s
« Reply #18 on: January 18, 2023, 07:08:06 pm »
So my question is, could that circuit ever work like Hasselhoff would want? 1 to 11, then 11 to 1 and repeat.
If you connect each LED to two output pins (through diodes) you can do a back and forth movement. Less LEDs but closer to the expected effect.
LED1 - pin 3 (Q0) and pin 11 (Q9)
LED2 - pin 2 (Q1) and pin 9 (Q8)
LED3 - pin 4 (Q2) and pin 6 (Q7)
LED4 - pin 7 (Q3) and pin 5 (Q6)
LED5 - pin 10 (Q4) and pin 1 (Q5)

You could potentially reorder the LEDs so it does not blink twice at the end of the first pass.

There may be other details that escape me, but that is how I did it in the 80s...
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline GrytpypeTopic starter

  • Contributor
  • Posts: 25
  • Country: gb
Re: [Resolved] Davidoff CD4017s
« Reply #19 on: January 18, 2023, 08:29:46 pm »
Ta - lots of different things to try :-+

Also found this on the YouTubes that uses a couple of transistors to drive the 4017s in sequence from the 555 - skip to 36 seconds for the circuit. Could adapt this to the same LED setup as per the circuit first-used in this thread.

Thanks again all!




« Last Edit: January 18, 2023, 08:36:03 pm by Grytpype »
 

Offline GrytpypeTopic starter

  • Contributor
  • Posts: 25
  • Country: gb
Re: [Resolved] Davidoff CD4017s
« Reply #20 on: January 21, 2023, 05:41:57 pm »
...Got it going using the transistor method above - just for my own sanity.


« Last Edit: January 21, 2023, 08:14:53 pm by Grytpype »
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
Re: [Resolved] Davidoff CD4017s
« Reply #21 on: January 23, 2023, 02:12:42 pm »
I am reminded of this EDN design idea:

https://www.edn.com/cascade-two-decade-counters-to-obtain-19-step-sequential-counter/

Not exactly the same because two LEDs are always on, but you can get a chasing effect by interleaving the outputs of the two chips.

An interesting aspect of the circuit is that it utilizes the CLK+ and CLK- inputs of the 4017 to alternately clock the two chips.

Below is the schematic taken from the 2007 Design Ideas compilation:

https://www.edn.com/wp-content/uploads/EDN_Design_Ideas_2007.pdf

Other years available at https://www.edn.com/design-ideas-pdf-collections-2001-2009/
 
The following users thanked this post: Grytpype


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf