Summary of Schematic design with the PIC16F84A microcontroller
The article describes a compact PIC16F84A-based knightrider LED driver as an alternative to CD4017 designs, powered by 7–12 V with a 7805 (or zener) regulator. It uses an RC oscillator (10k resistor, optional capacitor) and drives LEDs on PORTB (RB0–RB7) with two LEDs active at once. Speed is set by resistor R1 (measured on-time 0.14 s). Two firmware versions exist: an assembler ON/OFF variant and a C version with PWM-based trailing dim LEDs.Parts used in the PIC16F84A knightrider project:
- PIC16F84A microcontroller
- LEDs (connected to RB0 ... RB7)
- 7805 voltage regulator
- Zener diode (optional for voltage stabilization)
- Resistor R1 (10k for oscillator; adjustable to change speed)
- RC oscillator resistor (10k)
- Oscillator capacitor (optional, between OSC1 and GND)
- Power supply 7 ... 12 V DC

The microcontroller is oscillated by an external RC oscillator. The capacitor was left away. This can be done but it decreases the stability of the frequency. The resistor has a value of 10k.
The microcontroller drives LEDs through output ports RB0 ... RB7.. During the execution of a knightrider effect there are always 2 LEDs active at a time.
I did some measurements on the circuit and the LEDs are active for a period of 0.14 seconds. To change the speed you can simply change the value of resistor R1. You could also add a capacitor between OSC1 and the GND.
Software Design
Over time I wrote two different versions of the software for this light computer.
- A basic version in the assembler language. It runs the knight-rider light effect with only two possible output states: ON or OFF. Download the assembler source code.
- An extended version in the C Language. This software generates a little trail before and after the active LEDs. The intensity of the LEDs in the trail is lower. This is done by implementing some sort of PWM (pulse width modulation). Download the High-TECH C source code.
For more detail: Schematic design with the PIC16F84A microcontroller
Quick Solutions to Questions related to PIC16F84A knightrider project:
- What microcontroller is used in the project?
The project uses a PIC16F84A microcontroller. - What supply voltage does the circuit require?
The circuit can be powered by a DC voltage between 7 and 12 V. - How is the 5 V supply generated?
A 7805 regulator is used to create a stable 5 VDC; a zener diode can be used for a smaller circuit instead. - How is the microcontroller clocked?
The microcontroller uses an external RC oscillator with a 10k resistor; the capacitor is optional. - How many LEDs are active during the knightrider effect?
There are always two LEDs active at a time during the knightrider effect. - How can the speed of the effect be changed?
Change the value of resistor R1 or add a capacitor between OSC1 and GND to change the speed. - What is the measured on-time of the LEDs?
The LEDs are active for a period of 0.14 seconds based on measurements. - What software versions are available for the project?
There is a basic assembler version with simple ON/OFF outputs and an extended C version that implements PWM for dimmed trailing LEDs.
Related projects
PIC Stepper Motor Controller using PIC16F84A with Proteus Simulation
Introduction Stepper motors are widely used in embedded systems and DIY electronics projects where precise position control is required. This PIC Stepper...
Programmers & ICSP · PIC16F84APIC Musical Doorbell using PIC16F84A with Proteus Simulation
IntroductionThis microcontroller project demonstrates a musical doorbell built around a PIC16F84A and a simple piezo sounder.Using two push buttons, the system allows...
Beginner Tutorials · PIC16C84Exploring the World of PIC Microcontrollers: An Architectural Overview
A Peripheral Interface Microcontroller (PIC), developed by General Instruments Microcontrollers in 1993, operates under software control and is programmed to execute various...
LED ProjectsAn Application-Driven Microcontroller Curriculum
Understanding how to apply microcontrollers lies at the core of modern embedded systems education. This student project takes an experiential approach to...
LED ProjectsBuild this microcontroller controlled rainbow flying disc – and then throw it!
Hello all and welcome to this super simple and inexpensive instructable. If you like throwing frisbees AND you like flashing lights AND...
LED ProjectsLED Scrolling Display Project Working With Circuit Diagram
We normally use a simple static LED display screen to convey a message. Earlier, when we want to display large data, we...
