[Resolved] Davidoff CD4017s - Page 1
Forum section: electronics / beginners

author: Grytpype
author_rank: Contributor
timestamp: January 17, 2023, 09:18:27 pm
content: 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.htmlAll 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.

author: Grytpype
author_rank: Contributor
timestamp: January 17, 2023, 09:22:10 pm
content: ...and animated GIFs don't work: 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.

author: DavidAlfa
author_rank: Super Contributor
timestamp: January 17, 2023, 11:51:56 pm
content: Usehttps://gifyu.com/Try:https://www.circuitlib.com/index.php/projects/product/62-knight-rider-leds/category_pathway-15

author: james_s
author_rank: Super Contributor
timestamp: January 17, 2023, 11:59:22 pm
content: It's impossible to see exactly how you've got it wired up, but it's almost certain that you have an error somewhere.

author: tooki
author_rank: Super Contributor
timestamp: January 18, 2023, 12:07:44 am
content: Quote from: Grytpype on January 17, 2023, 09:18:27 pmThis made me literally chortle out loud!Quote from: Grytpype on January 17, 2023, 09:18:27 pmI 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…

author: themadhippy
author_rank: Super Contributor
timestamp: January 18, 2023, 01:30:32 am
content: 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.

author: golden_labels
author_rank: Super Contributor
timestamp: January 18, 2023, 01:42:13 am
content: 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 asingleCD4017, 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.

author: Swainster
author_rank: Frequent Contributor
timestamp: January 18, 2023, 03:38:37 am
content: I think it should work... maybe you've got ClK and CLK_EN swapped on the second '4017?

author: inse
author_rank: Super Contributor
timestamp: January 18, 2023, 05:48:32 am
content: 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?

author: ebastler
author_rank: Super Contributor
timestamp: January 18, 2023, 06:55:51 am
content: 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.

author: Grytpype
author_rank: Contributor
timestamp: January 18, 2023, 09:04:51 am
content: 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.

author: golden_labels
author_rank: Super Contributor
timestamp: January 18, 2023, 09:22:32 am
content: 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).

author: BillyO
author_rank: Super Contributor
timestamp: January 18, 2023, 12:41:34 pm
content: 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.

author: golden_labels
author_rank: Super Contributor
timestamp: January 18, 2023, 02:43:05 pm
content: 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:L0 = O0 ∨ O8 ∨ O9L1 = O0 ∨ O1 ∨ O7 ∨ L8L2 = O1 ∨ O2 ∨ O6 ∨ O7L3 = O2 ∨ O3 ∨ O5 ∨ O6L4 = O3 ∨ O4 ∨ O5Where 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.

author: themadhippy
author_rank: Super Contributor
timestamp: January 18, 2023, 03:13:41 pm
content: 10 channel notsoshite riderhttps://tinyurl.com/2o6da2p6

author: Swainster
author_rank: Frequent Contributor
timestamp: January 18, 2023, 04:32:41 pm
content: 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

author: james_s
author_rank: Super Contributor
timestamp: January 18, 2023, 05:53:57 pm
content: Quote from: BillyO on January 18, 2023, 12:41:34 pmThat'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.

author: tooki
author_rank: Super Contributor
timestamp: January 18, 2023, 06:16:03 pm
content: 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.

author: rsjsouza
author_rank: Super Contributor
timestamp: January 18, 2023, 07:08:06 pm
content: Quote from: Grytpype on January 17, 2023, 09:18:27 pmIf 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...

author: Grytpype
author_rank: Contributor
timestamp: January 18, 2023, 08:29:46 pm
content: Ta - lots of different things to tryAlso 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!

author: Grytpype
author_rank: Contributor
timestamp: January 21, 2023, 05:41:57 pm
content: ...Got it going using the transistor method above - just for my own sanity.

author: ledtester
author_rank: Super Contributor
timestamp: January 23, 2023, 02:12:42 pm
content: 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.pdfOther years available athttps://www.edn.com/design-ideas-pdf-collections-2001-2009/