Logo Banner

ELECTRONICS - [Knight Rider Light Computer]

Knight Rider Light computer - version 2

This knight rider light computer is a successor of my first version of the Knight Rider. This version is much smaller and justifies the use of a microcontroller. The project is based on the PIC 12F629 microcontroller.

The hardware part

Unlike my previous project this light computer is build around the PIC12F629: a microcontroller with only 8 pins. It is shipped in a DIL-8 housing.

An external clock is not necessary: the chip has an internal 4 MHz oscillator. The reset circuit is not necessary either: I configured the PIC to use its internal reset circuit. So only 2 pins are needed to power the microcontroller. All other pins are available for I/O.

Schematic diagram of the Knight Rider lightcomputer

The schematic diagram can be kept very small. You only need the PIC12F629, eight LEDs, two resistors and a zenerdiode.

Each output of the PIC drives two LEDs. The cathode of all LEDs is common and connected to a single resistor. This is not a good design practice: each LED should have its own resistors as LEDs should never be placed in parallel. I did it anyway in this particular design because I needed a very compact solution (2 LEDs of the same type can slightly differ: they can have a different forward voltage. This can cause problems when they are placed in parallel).

The PIC's GP03 port doesn't drive any LEDs because it is solely an input port.

The circuit itself must be powered by a 9 VDC supply. This voltage is down sized to 4.7V by a zenerdiode D1 and resistor R2. Eventually they can be replaced by a 7805 regulator.

Possible PCB Layout

Screenshot of a possible PCB layout

The image at the left illustrates how small this circuit could be when you create a PCB of it. Please note I drew this PCB very quick - I didn't check it for errors as it is just an example. The PCB can't be downloaded from this website.

The software part

I wrote the software in the C language. I used the (free) HI-TECH C language that was included with MPLab, a tool for the PIC microprocessors.

I used an array that contains all the 6 different output states. A loop is cycled: each cycle another output state is retrieved from the array.

I programmed this microcontroller with my very cheap Olimex USB PIC programmer [External]. This programmer can be used with Microchip MPLab so you don't need any additional software.

Developed in: High-Tech C (Microchip)
Download type: Source Code (.C Source)
License: Freeware
Size:
Source code: Available
MD5 Checksum:

Copyright ©1998-2022 Vanderhaegen Bart - last modified: August 24, 2013