'Knight Rider' style light chaser

Thread Starter

BillO

Joined Nov 24, 2008
992
I've seen a lot of queries lately regarding 'Knight Rider' and other types of light chasers here and on other boards. So, here is a very simple MCU approach to that classic light chaser.

It uses an Omega Mini-328 breadboard MCU but any Arduino compatible or even just an Atmega328/168 chip on a solderless breadboard could be used to implement it.

All it requires, beyond the MCU are 16 LEDs and four 470 ohm resistors.

The LEDs are grouped in banks of 4 and addressed in a 4x4 matrix fashion. Indeed, the arrangement of the LEDs is one component of this project that can be altered to whatever suits the experimenter. In my case, I laid them out linearly to get that "night Rider" effect. Doing it this way allows 16 LEDs with only 8 I/O. Of course, with a Atmega328 there are other possibilities, but this gets the job done.

I have also included an Arduino sketch that is internally documented fairly well and produces the desired effect. However, there are literally hundreds of possibilities that could be coded for this basic arrangement and this is only one simple example.
 

Attachments

Wendy

Joined Mar 24, 2008
21,840
Just curious, how much did that µC set up cost? I like pictures, so I massaged yours a bit...

 

Attachments

Thread Starter

BillO

Joined Nov 24, 2008
992
The Mini-328 and the Dev-Duino together run about $43.

It's soooo much nicer than having to bang the Mini into a breadboard with a mallet.:D I've seen folks damage a Arduino Mini getting them into the breadboard. The Dev-Duino has everything too, power supply, serial interface and auto-reset. It's nice to use.
 

R!f@@

Joined Apr 2, 2009
9,647
I can't believe I missed this. :mad:

By the way this is interesting.

I like to see a video of this and some more info on that thing on the ZIF socket. ( A little more detail notes on to us N00bs )
 

Thread Starter

BillO

Joined Nov 24, 2008
992
Okay. here you go.

Edit: Update...

The video is HERE

The owners manual for the OMS Mini-328 (the thing in the ZIF socket) is HERE

Edit: Update #2

There was a problem with the service provider earlier, but now everything seems to be working fine.
 
Last edited:

DakLak

Joined Jan 20, 2013
4
I like simplicity. If all you are doing is making uni or bi-directional Knight Rider lights it is very simple without resorting to a microprocessor. If you wish to program lesser counts than 100, a simple one-wire connection will achieve this.

If this is a demonstration in deploying a microprocessor, I apologise for intervening.

You can drive up to 100 'positions' just using two CD4017s and a 555 plus 20 transistors and 40 resistors.

I live in VietNam where cars are too expensive so the youngsters 'soup' up their motorcycles by adding Knight Riders, etc.

I can't give you realistic costs since our purchases are so cheap. 100 quarter watt resistors cost 15 cents (US), a signal transistor costs 1 cent a piece and CD4017s are priced at 14 cents. The 55 costs 7 cents!
 

Thread Starter

BillO

Joined Nov 24, 2008
992
@DakLak

Yes, it was meant to be an exercise in using a MCU, not a minimum cost solution. A demonstration of how quickly and easily this can be done using the power of a microcontroller.

@R!f@@, it should work. I just tried it myself.
 

Thread Starter

BillO

Joined Nov 24, 2008
992
That's neat. I have an MSP430 that I've never tried. I need to get myself a copy of the Energia IDE to try it out.
 

MMcLaren

Joined Feb 14, 2010
842
Hi Bill,

Hope you didn't mind me adding to your thread... Anyway, here's a video for a Charlieplexed version;


Here are Charlieplexed and Multiplexed wiring diagrams for comparison and sketches to make them work on Arduino or on Energia + Launchpad...

Have fun... Mike

Knight Rider Charlie.png
Knight Rider Mux'd.png
Rich (BB code):
 /*
  *  Knight Rider Charlieplex Demo for
  *  Arduino or MSP430 Launchpad + Energia
  *
  *  Michael McLaren, K8LH
  *  Micro Application Consultants
  *
  */

  void setup()        
  { pinMode(6, INPUT);
    pinMode(7, INPUT);
    pinMode(8, INPUT);
    pinMode(9, INPUT);
    pinMode(10, INPUT);
  }

  void loop()
  { static byte led = 1;          // value 0..19
    static byte dir = -1;         // value 1 or -1
    led += dir;                   //
    byte col = led / 4 + 6;       // D6..D10 cathode columns
    byte row = led % 4 + 6;       // D6..D9 anode rows
    if(col == row) row = 10;      // if col == row, use "float" pin
    pinMode(col, OUTPUT);         // turn column 'on'
    digitalWrite(col, LOW);       //   "
    pinMode(row, OUTPUT);         // turn row 'on'
    digitalWrite(row, HIGH);      //   "
    delay(30);                    //
    pinMode(col, INPUT);          // turn column 'off'
    pinMode(row, INPUT);          //
    if(led == 0) dir = 1;         // check for end-of-scan
    if(led == 19) dir = -1;       //    "
  }                               //
Rich (BB code):
 /*
  *  Knight Rider Multiplex Demo for
  *  Arduino or MSP430 Launchpad + Energia
  *
  *  Michael McLaren, K8LH
  *  Micro Application Consultants
  *
  */

  void setup()        
  { pinMode(2, OUTPUT);
    pinMode(3, OUTPUT);
    pinMode(4, OUTPUT);
    pinMode(5, OUTPUT);
    pinMode(6, OUTPUT);
    pinMode(7, OUTPUT);
    pinMode(8, OUTPUT);
    pinMode(9, OUTPUT);
    pinMode(10, OUTPUT);
  }

  void loop()
  { static byte led = 1;          //
    static byte dir = -1;         //
    led += dir;                   //
    byte col = led / 4 + 6;       // D6..D10 common cathodes
    byte row = led % 4 + 2;       // D2..D5 mux'd anodes
    digitalWrite(col, LOW);       // active lo col on
    digitalWrite(row, HIGH);      // active hi row on
    delay(25);                    //
    digitalWrite(row, LOW);       //
    digitalWrite(col, HIGH);      //
    if(led == 0) dir = 1;         // check for end-of-scan
    if(led == 19) dir = -1;       //    "
  }
 
Last edited:
Top