UFO round LED Chaser with speed control for PIC16F628A
This is an updated version of the UFO LED Chaser project, revised to use the PWM LED Chaser code version 3.0.0 with support for variable chase speed. The basic LED chaser ‘engine’ firmware is the same as that used with the 481/483 LED chaser projects also on this site. The only difference is the sequence data used to create the programmer ready .HEX file. This has been modified to include chase effects that suit the circular arrangement of LEDs.
Unlike many simple LED chaser projects the design presented here provides 8 LEDs directly driven from the PIC along with a single mode control switch and speed adjust control. The firmware elsewhere on this page drives the LEDs with a 5 bit PWM signal providing each of the 8 LED channels with four levels of intensity; off, dim, mid and bright. A number of sequences are programmed into the firmware to provide some interesting visual effects and chase sequences.
The software has sequential, random and manual sequence run modes and manual advance to the next sequence in any mode. The selected sequence and mode are also saved to non-volatile memory so it will always restart in the selected mode.
The design is deliberately simple with each LED being directly driven from a PIC I/O pin. You can use it with different sized LEDs and mixed colours. While it works well as a simple LED chaser, thinking outside the box it can be used to add effects to toys and models and even accessorize fancy dress costumes. See FAQ
A solder pad jumper on the PCB selects between fixed speed chaser using internal timing or variable chase speed adjustable using the on-board variable resistor. The adjustable chase speed option makes it ideal for use in a wide range of applications. The kit 433K includes all parts needed to build the variable speed chaser.
The firmware pre-programmed into the PIC16F628A supplied with the kit includes over 34 chase effects and sequences. If you’re interested in PIC micros and programming and want to modify the sequences or create new ones, the source code and programmer ready HEX file is provided at the bottom of this page.
The heart of the LED chaser is the PIC 16F628A microcontroller, IC1. The program that runs on this chip controls the LEDs attached to the output port pins. Resistors R1 thru R8 limit the current through LED1 – LED8 to a safe level that won’t damage the PICs I/O ports or LEDs. Resistor R9 provides a pull-up for the input connected to switch S1. R10 holds the PICs MCLR reset signal high.
The variable resistor PR1 along with C4 are used to create a software oscillator. C4 is charged and discharged via PR1 from port B0 output. The input on Port A7 is monitored by the firmware, when the input goes high port B0 is driven low to discharge C4. When Port A7 goes low, port B0 is driven high to charge C4. An important requirement is the use of a Schmitt trigger input buffer on Port A7 input pin which provides the necessary hysteresis to make the software oscillator work. This oscillator is then used to provide the clock for the chaser timing and since the speed is controlled by the rate C4 charges through PR1 the chaser speed can be controlled by adjusting PR1. A 1K0 resistor, R11 is placed in series with PR1 to set the maximum chase speed when PR1 is adjusted to minimum resistance.
Capacitor C1 is used to decouple the 5 volt power supply to the PIC. If you’re building the circuit on a breadboard or stripboard you should ensure it is located close to the PICs Vdd connection (pin 14 ).
Power is supplied to the circuit via the +/- solder points. The voltage regulator, IC2 is a LM2931-5.0, low-drop-out regulator and will maintain regulation with an input voltage down to 5.8 volts. Input voltage for the LED chaser should be between 6 volts and 14 volts to ensure power dissipation remains within limits. The LM2931-5.0 regulator is designed for battery powered and automotive applications and includes internal current limiting, thermal shutdown, as well as reverse battery connection without damage to itself or the circuit behind it. Capacitor C3 is important and must be fitted to prevent instability of the regulator output
Typical current drawn by the circuit with all LEDs on is only around 80mA; with all LEDs off it is under 5mA.
- The latest high brightness LEDs are very bright even with 330R current limiting resistors. However, if you do need to change these resistors for some reason take into account the maximum current that the on-board voltage regulator can deliver is 100mA.
- EXT solder bridge jumper.
When left open the chaser runs at a fixed speed using the internal sequence timing data.
When closed (bridged with solder on the PCB) the chaser uses the software controlled oscillator for timing, the frequency is adjusted using PR1 which in turn controls the chase speed.
If you leave the ‘EXT’ jumper open, you can omit PR1, R11 and C4. The circuit and firmware will operate correctly using the internal timing data.
- The jumpers marked ‘SJ1‘ and ‘MODE‘ are not currently used. Do not bridge them with solder.
For more detail: UFO round LED Chaser with speed control for PIC16F628A
JLCPCB – Prototype 10 PCBs for $2 (For Any Color)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w
Current Project / Post can also be found using:
- pic16f628a projects
- 16f628a led chaser
- UFO led chaser daigram
- UFO 10led chaser daigram