More blinking LEDs - KITT inspired gizmo, version 1

What could I do with couple of ICs (mainly shift registers), LEDs and basic components, but without a micro-controller?

This article is Part 1 in a 2-Part Series.

Challenge is fun

I wrote a little about my path to hobby electronics in a previous post about LED cube. I also mentioned that I ordered a bunch of components from AliExpress. They were mostly items from a list provided in the book I mentioned in the post too. As a consequence I ended up with a pile of components and I began to think, what could I make with them.

There were various ICs included and among them a few shift registers. Hmm, maybe I can drive a row of LEDs with a shift register! And of course, you can connect a shift register to a micro-controller, add LEDs and then program various behaviors. And it’s fun, for a while. But let’s make it a bit more challenging. What about building something without any micro-controller?


KITT from KnigthRider

Do you remember Knight Rider? A TV show from eighties staring David Hasselhoff and more importantly an intelligent car named KITT. Take a moment and watch an original intro for the show, it’s worth it.

As you can see, the car’s mask has this iconic swiping light effect. It should be easy to recreate it with a shift register, shouldn’t it?

Shift register

74595 SIPO register pinout

If you know what a shift register is, you can skip to the next chapter. In other case, quick and simplified explanation follows. I am going to use the PIN names from this 74595 data sheet in the article.

SIPO (serial in parallel out) shift register is an IC, that allows control of several parallel outputs by a serial input. There are 8 outputs (QA,…, QH) in the case of sn74hc595. The IC remembers a value for each input in a register. When you want to set some value on those outputs, you do it in a loop, bit by bit.

  1. Set serial input (SER) to LOW or HIGH, according desired value for this bit.
  2. Send a pulse to clock input (SRCLK).
  3. IC will store the value in the first register, value that was previously in the first register will be shifted to the second register and so on. That’s why it’s called shift register.
  4. The value in the last register is forgotten, but there’s a pin that allows for easy chaining. The last value is exposed on this PIN (QH') until next clock cycle. You may notice backtick in PIN’s name. That basically means, that the value to this pin is propagated as soon as shift happens and not when RCLK is triggered (see step 6).
  5. You repeat steps 1-4 until you shift all desired bits.
  6. All shifted values aren’t propagated to parallel outputs automatically. You must tell the IC to send stored values to the outputs using another signal input (RCLK).

And that’s it. As I mentioned, it’s really easy to control one or more shift registers with a micro-controller. The Arduino SDK have a special function for it – shiftOut(). But as I already mentioned, let’s do this gizmo without programming at all.

Shifting one bit

Let’s say we have some clock circuit, that provides us with a stable clock signal. I am not going to cover details of such circuit, because it’s easy to find plenty of ways how to build one of those. Then we can:

  1. Connect the clock to SRCLK and RCLK. Each pulse will trigger both shifting and propagation to the outputs.
  2. Connect the outputs to diodes, where each diode has a current limiting resistor.
  3. Connect all other pins required for functionality according to the datasheet (VCC, GND, OE, SRCLR).
  4. Create infinite loop by connecting QH' to SER.

Now it’s possible to send a short HIGH pulse to SER (I used a button) and if the timing is correct, one HIGH bit will be sent into the register. This one HIGH bit will cycle there forever.

But this gives us only a half of the desired effect. We can observe how the lit LED moves from left to right and than jumps back to the beginning and the cycle repeats. But we want it to return back by lighting the diodes in reverse order.

So what about adding another shift register? We can connect them in series and somehow pair their outputs in such configuration, that we achieve desired effect. Well, what “somehow” means? Simple OR gate would do. Unfortunately I didn’t have any OR gates, so I used NOR gates and inverters. But for the sake of simplicity there are OR gates in the schematic. Another approach would be to use diodes.

The schematic is a bit mess, though. But the trick is to connect outputs of ICs in reverse order. U1QX are outputs of the first IC and U2QX for the second.

  • LED1 = U1QA OR U2QH
  • LED2 = U1QB OR U2QG
  • LED3 = U1QC OR U2QF
  • LED4 = U1QD OR U2QE
  • LED5 = U1QE OR U2QD
  • LED6 = U1QF OR U2QC
  • LED7 = U1QG OR U2QB
  • LED8 = U1QH OR U2QA

And here we go:

Completed prototype version 1 (video). Longer version available on youtube.

Problems and ideas

This is actually just a really simple idea and circuit I already shared in a reddit post few months ago. There are several problems and possible improvements.

  • It requires a manual starting pulse.
  • The first and the last LEDs are turned on twice each time the direction is reversed.
  • LEDs just blink. There’s no cool fading trail effect.

I already created a new version, that solves all those problems, but I am going to write a separate post about it. This one is meant to be an introduction and warm-up for the next article. Stay tuned.

This article is Part 1 in a 2-Part Series.