PIC16F628 4 RGB LED PWM Controller

Summary of PIC16F628 4 RGB LED PWM Controller


Summary (under 100 words): This project is a daisy-chainable, addressable RGB LED controller using a PIC16F628 microcontroller with hardware USART and internal 4 MHz oscillator. It provides PWM-based multi-intensity control for each color, supports multiple individually controllable RGB LEDs, offers high-speed serial updates via RS232, and is designed for simple serial control. The author produced a PCB (BatchPCB) and notes a required pull-up resistor on RA5 not shown in the original schematic.

Parts used in the PIC16F628 4 RGB LED PWM Controller:

  • PIC16F628 microcontroller
  • PCB (custom board from BatchPCB)
  • RGB LEDs (4 per board)
  • Resistors for LED current limiting
  • Pull-up resistor for RA5
  • RS232 serial interface components
  • Power supply components (voltage regulator / decoupling capacitors)
  • Headers/connectors for daisy-chaining
  • Programming header for PIC reprogramming

I am a big fan of LEDs.  Bright, colorful, flashing LEDs.  So, given my affinity for LEDs, I decided to work on a controller that me and a few of my friends could use as an art project/passive information display.  I have posted videos from the first prototypes (here and here), but it has been tough to dedicate time to further development given my research, so I thought I would post the information so that anyone can take the design and modify it to their liking!

LED PWM Controller

Some insipration came from the BlinkM “smart LED” and the ShiftBrite RGB LED Module, but I was interested in using RS232 serial control.  Therefore, I chose one of my favorite simple-to-use microcontrollers, the PIC16F628.  The advantages include the built-in 4MHz oscillator, hardware USART, and ease of reprogramming.  A couple of features I had in mind during the design:

  1. Multiple intensities for each color (using PWM)
  2. Multiple individually controllable RGB LEDs
  3. High-speed update rate
  4. Daisy-chainable and addressable
  5. Simple serial control

Schematic
Here
is the full schematic for the driver. I chose to use a PIC16F628 as the microcontroller because it is cheap, has a internal oscillator (4 MHz) and an internal USART. NOTE: There is an error in this schematic and a pull-up resistor on RA5 (pin 4 in the schematic) is necessary.  See the bottom of the post for an updated schematic and board.

Board
I decided I would try getting a PCB printed for the first time, so I got boards created at BatchPCB.com for $5 each.  The total for 4 boards shipped was $32.36 (4 x $5 for the boards and $12.36 for shipping and handling).

 

For more detail: PIC16F628 4 RGB LED PWM Controller

Quick Solutions to Questions related to PIC16F628 4 RGB LED PWM Controller:

  • What microcontroller is used in the project?
    The project uses a PIC16F628 microcontroller with a built-in 4 MHz oscillator and hardware USART.
  • How are multiple intensities for each color achieved?
    Multiple intensities are achieved using PWM (pulse-width modulation) implemented on the PIC16F628.
  • Can multiple RGB LEDs be individually controlled?
    Yes, the design supports multiple individually controllable RGB LEDs (4 per board).
  • Does the controller support daisy-chaining and addressing?
    Yes, the controller is designed to be daisy-chainable and addressable via serial control.
  • What serial protocol is used for control?
    The design uses RS232 serial control via the PIC16F628 USART.
  • Is the update rate suitable for high-speed changes?
    Yes, the project targets a high-speed update rate for LED updates.
  • Was a PCB used for this project?
    Yes, the author had PCBs manufactured at BatchPCB.com and assembled boards.
  • Is there any known schematic error to be aware of?
    Yes, the original schematic is missing a pull-up resistor on RA5; a pull-up is necessary.
  • Why was the PIC16F628 chosen?
    The PIC16F628 was chosen for its low cost, internal 4 MHz oscillator, built-in USART, and ease of reprogramming.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter