This compact circuit operates 8 LEDs directly driven from a PIC microcontroller, accompanied by a single mode control switch. The firmware controls the LEDs using a 5-bit PWM signal, enabling four levels of intensity for each LED channel: off, dim, mid, and bright. Various sequences are programmed into the firmware to create engaging visual effects and chase sequences, similar to the classic effect seen in the Knight Rider television series. The software features sequential, random, and manual sequence run modes, with the ability to manually advance to the next sequence in any mode. The selected sequence and mode are stored in non-volatile memory, ensuring that the circuit restarts in the chosen mode. The design is intentionally straightforward, with each LED directly driven by a PIC I/O pin. This simplicity, along with the inclusion of an in-circuit programming header (ICSP), makes the circuit ideal for teaching and learning introductory PIC assembly language programming. The circuit can accommodate various LED sizes and colors, as well as fewer than 8 LEDs. It serves not only as an LED chaser but also as an excellent tool for adding effects to toys and models. For users seeking a pre-written LED chaser program, a ready-made program featuring 34 chase effects, along with source code and programmer-ready HEX files, is available at the bottom of the page. Several variations based on the basic PWM LED chaser have been constructed, utilizing the same base code but employing different sequences to suit the layout of the boards. The core of the LED chaser is the PIC 16F628A microcontroller (IC2), which controls the LEDs connected to the output port pins. Resistors R1 through R8 limit the current through LED1 to LED8 to a safe level, preventing damage to the PIC's I/O ports and the LEDs. Resistor R9 provides a pull-up for the input connected to switch S1, while R10 pulls up the PIC's MCLR reset signal during normal operation, allowing the input to be raised to 12.5 volts during in-circuit programming. JP1 connects to an ICSP programmer, such as a PICkit2, facilitating easy reprogramming of the PIC without removal from the PCB. Capacitor C1 decouples the 5-volt power supply to the PIC and should be positioned close to the PIC's Vdd connection (pin 14) when building the circuit on a breadboard or stripboard. Power is supplied through J1 and must be smooth DC ranging from 9 to 14 volts. The PIC requires a precisely regulated 5-volt supply, provided by IC1, a 7805 3-terminal, 5-volt regulator. The circuit typically draws around 100mA with all LEDs illuminated, so the voltage regulator does not require an additional heatsink. Capacitors C2 and C3 stabilize the regulator, and diode D1 protects the circuit from reverse polarity of the input voltage. While capacitors C2 and C3 may be omitted in most applications, they are included in the schematic, and the PCB layout accommodates them. If there is uncertainty about their necessity, it is advisable to install them. High-brightness LEDs are very luminous even with 270-ohm current-limiting resistors. However, if resistor values need to be altered, it is essential to consider that the maximum current the PIC can source from an I/O port pin is 25mA. Additionally, the output voltage may drop as the load increases. If LEDs requiring a lower series resistor are installed, it may hinder in-circuit programming via the ICSP header, as the I/O port pins used for In-Circuit Serial Programming are shared with the LEDs. With 270-ohm resistors and a PICKit2 programmer, in-circuit programming should function without issues. JP1 serves as the ICSP header, allowing for programming flexibility.This neat little circuit provides 8 LEDs directly driven from the PIC along with a single mode control switch. 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, bright.
A number of sequences are programmed into the firmware to provide some interesting visual effects and chase sequences, including the classic effect seen on the car in the Knight Rider TV series. 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. This and the inclusion of an in-circuit programming header (ICSP) make the circuit ideal for teaching/learning introductory PIC assembly language programming.
You can use it with different sized LEDs and mixed colours, as well as fewer than 8 LEDs. As well as using it as a LED chaser it is great for adding effects to toys and models. See FAQ However, if you just want a cool LED chaser without having to write any code, a ready written LED chaser program including 34 chase effects with source code and programmer ready HEX files is provided at the bottom of this page. Here`s a couple of variations I`ve built based on the basic PWM LED chaser described on this page. They run exactly the same base code, just use different sequences to suit the layout of the boards. The heart of the LED chaser is the PIC 16F628A microcontroller, IC2. 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 pulls up the PIC`s MCLR reset signal during normal operation while allowing the input to be raised to 12. 5 volts during in-circuit programming. JP1 provides connection for an ICSP programmer such as a PICkit2 making it easy to reprogram the PIC without removing it from the PCB.
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 J1 and must be smooth DC between 9 and 14 volts. The PIC requires a precisely controlled 5 volt supply and this is provided by IC1, a 7805 3-terminal, 5 volt regulator.
Typical current drawn by the circuit with all LEDs on is only around 100mA so the voltage regulator doesn`t require any additional heatsink. Capacitors C2 and C3 stabilize the regulator. Diode D1 protects the circuit from accidental reverse polarity of the input voltage. Capacitors C2/C3 stabilize the voltage regulator and may be omitted for most applications, however the schematic shows them and the PCB layout makes provision for them.
If you`re unsure whether you will need them then it`s best to install them. The latest high brightness LEDs are very bright even with 270R current limiting resistors. However, if you do need to change these resistors for some reason take into account the maximum current that the PIC can source from an I/O port pin is 25mA, and also be aware that the output voltage will drop as you increase the load. If you install LEDs that require a lower value series resistor you may find you are unable to program the PIC in-circuit via the ICSP header.
This is because the I/O port pins on the PIC that are used for In-Circuit Serial Programming are shared with the LEDs. The programmer may be unable to drive these lines when lower value resistor are used. With the 270R resistors and PICKit2 programmer, In-Circuit programming should work without problems. JP1 is an ICSP header to allow p 🔗 External reference
The approaches using on-chip A-to-D converters on AVR, PIC, and Cypress controllers reached sample rates of up to about 60 kHz. Not really very useful for the sort of thing I was thinking about using this for: encoded data,...
The BA6104 is a five-digit LED level meter driver integrated circuit (IC) used in basic application circuits. When the input level exceeds the required display threshold of 1V, only 7 feet of the power supply Vcc are indirectly affected...
The objective of this project is to design a circuit for an electronic infrared communication system, develop innovative ideas for implementing this circuit, and study the circuitry along with various components such as DTMF generators, DTMF decoders, operational amplifiers,...
Using a PC parallel port to control external devices is a popular approach these days but I certainly couldn’t afford to tie up a PC for the few weeks leading up to Christmas just to flash a few LEDs!...
The circuit is an easy-to-build and use general-purpose Big LED with SPI serial interfacing. It is expandable for multiple digits while utilizing only three wires to receive data from any microcontroller boards. The design incorporates a serial-in-parallel-out shift register,...
To provide rapid motor speed changes and motor direction reversal, four outputs drive a MOSFET H-bridge. N-channel devices serve as the lower rail power MOSFETs, while P-channel devices are utilized as the upper MOSFETs. All MOSFETs are controlled by...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more