Summary of Pic RGB color generator using PIC12F629
PIC RGB is a small PIC-based circuit that generates and smoothly fades random RGB colors using a single RGB LED. Designed for PIC12F629/12F675 (or similar 12F series with 1K flash and two timers), it uses integer math to independently vary three color channels. The basic build includes a 78L05 regulator, resistors sized to ~20 mA per LED color, decoupling capacitor, and a push-button to switch between random and sequence modes. PCB and schematic (Eagle) and hex files are available for download.
Parts used in the PIC RGB project:
- PIC microcontroller (PIC12F629 or PIC12F675)
- RGB LED (common type supporting 20–25 mA per color)
- 78L05 voltage regulator
- Decoupling capacitor
- Resistor for red LED: 150 Ohm
- Resistor for green LED: 82 Ohm
- Resistor for blue LED: 82 Ohm
- Push-button switch
- PCB (designed in Eagle)
- Power supply (suitable input for 78L05)
Description
PIC RGB is a circuit that generates random RGB colors using a RGB LED and fades between them. The idea for this circuit came from the candle simulator [1] and another project called TinyRGB [2] .
The challenge was to create an algorithm that could fade 3 independent colors at different speeds in the same time interval, using integer math, (of course).
There are other enhanced versions of this project named Pic RGB Power board and Pic RGB Power board with Infrared remote control. Both circuits drive a powerful 3W Prolight RGB LED.
Design and Implementation
The PIC may be any small 12F***, as long as they have 1KWords of flash and two timers. Below at the downloads section are two hex files for PICs 12F629 and 12F675 [3].
Schematic
Basic schematic includes a voltage regulator 78L05, the PIC with a decoupling capacitor and a few resistors.
Since each PIC pin can supply a maximum of 25mA of current, and the LED specification indicates a maximum of 25mA, the LED resistors were calculated to provide 20mA of current in each color.
Vred = 2.1V, Vgreen=3.4 and Vblue=3.5V
R=V/I
Rred = 145 Ohm -> 150 Ohm
Rgreen = 80 Ohm -> 82 Ohm
Rblue = 75 Ohm -> 82 Ohm
The push-button switches between running modes, random and sequence.
PCB
The PCB and Schematic were created using Eagle from Cadsoft and are available below at the downloads section. Click on the image below to expand it and have a look at the top placement information.
Note: PIC pin1 is the lower right one.
For more detail: Pic RGB color generator using PIC12F629
- What PICs are compatible with the PIC RGB project?
PIC12F629 and PIC12F675 are provided; any small 12F series with 1KWords flash and two timers will work. - How are the LED resistor values determined?
Resistors were calculated using R = V / I targeting about 20 mA per color based on LED forward voltages. - What resistor values are used for each LED color?
Red 150 Ohm, Green 82 Ohm, Blue 82 Ohm as rounded values from calculations. - What is the purpose of the 78L05 in the circuit?
78L05 is used as the voltage regulator to supply 5 V to the PIC and circuit. - How does the project vary the RGB colors?
The PIC runs an algorithm that fades three independent color channels at different speeds using integer math to generate random RGB colors and fades between them. - What does the push-button do?
The push-button switches between running modes: random and sequence. - Are PCB and schematic files available?
Yes, PCB and schematic created in Eagle are available in the downloads section. - Can this design drive high-power RGB LEDs like 3W types?
Enhanced versions named Pic RGB Power board and Pic RGB Power board with Infrared remote control exist to drive powerful 3W Prolight RGB LEDs.

